Package jminusminus
Class JFieldSelection
java.lang.Object
jminusminus.JAST
jminusminus.JStatement
jminusminus.JExpression
jminusminus.JFieldSelection
- All Implemented Interfaces:
- JLhs
The AST node for a field selection operation. It has a target object, a field name, and the
 field it defines.
- 
Field SummaryFieldsFields inherited from class jminusminus.JExpressionisStatementExpression, typeFields inherited from class jminusminus.JASTcompilationUnit, line
- 
Constructor SummaryConstructorsConstructorDescriptionJFieldSelection(int line, AmbiguousName ambiguousPart, JExpression target, String fieldName) Construct an AST node for a field selection having an ambiguous part.JFieldSelection(int line, JExpression target, String fieldName) Constructs an AST node for a field selection without an ambiguous part.
- 
Method SummaryModifier and TypeMethodDescriptionAnalyzes and returns a JExpression.analyzeLhs(Context context) Analyzes the lhs of an assignment.voidPerforms code generation for this AST.voidPerforms short-circuit code generation for a boolean expression, given the code emitter, a target label, and whether we branch to that label on true or on false.voidcodegenDuplicateRvalue(CLEmitter output) Generates the code to duplicate the Rvalue that is on the stack because it is to be used in a surrounding expression, as in a[i] = x--.voidcodegenLoadLhsLvalue(CLEmitter output) Generates code to load onto the stack any part of the lhs that must be there, as in a[i] = x.voidcodegenLoadLhsRvalue(CLEmitter output) Generates code to load an Rvalue of the lhs, as in a += x.voidcodegenStore(CLEmitter output) Generates the code to do the actual assignment.voidtoJSON(JSONElement json) Stores information about this AST in JSON format.Methods inherited from class jminusminus.JExpressionisStatementExpression, typeMethods inherited from class jminusminus.JASTline, partialCodegen, unescape
- 
Field Details- 
targetThe target expression.
 
- 
- 
Constructor Details- 
JFieldSelectionConstructs an AST node for a field selection without an ambiguous part.- Parameters:
- line- the line number of the selection.
- target- the target of the selection.
- fieldName- the field name.
 
- 
JFieldSelectionConstruct an AST node for a field selection having an ambiguous part.- Parameters:
- line- line in which the field selection occurs in the source file.
- ambiguousPart- the ambiguous part.
- target- the target of the selection.
- fieldName- the field name.
 
 
- 
- 
Method Details- 
analyzeAnalyzes and returns a JExpression.- Specified by:
- analyzein class- JExpression
- Parameters:
- context- context in which names are resolved.
- Returns:
- the analyzed (and possibly rewritten) AST subtree.
 
- 
analyzeLhsAnalyzes the lhs of an assignment. This is very much like the analyze() methods, but perhaps a little more selective here and there.- Specified by:
- analyzeLhsin interface- JLhs
- Parameters:
- context- context in which names are resolved.
- Returns:
- the analyzed (and possibly rewritten) AST subtree.
 
- 
codegenPerforms code generation for this AST.
- 
codegenPerforms short-circuit code generation for a boolean expression, given the code emitter, a target label, and whether we branch to that label on true or on false.- Overrides:
- codegenin class- JExpression
- Parameters:
- output- the code emitter.
- targetLabel- the label to which we should branch.
- onTrue- do we branch on true?
 
- 
codegenLoadLhsLvalueGenerates code to load onto the stack any part of the lhs that must be there, as in a[i] = x.- Specified by:
- codegenLoadLhsLvaluein interface- JLhs
- Parameters:
- output- the code emitter.
 
- 
codegenLoadLhsRvalueGenerates code to load an Rvalue of the lhs, as in a += x.- Specified by:
- codegenLoadLhsRvaluein interface- JLhs
- Parameters:
- output- the code emitter.
 
- 
codegenDuplicateRvalueGenerates the code to duplicate the Rvalue that is on the stack because it is to be used in a surrounding expression, as in a[i] = x--.- Specified by:
- codegenDuplicateRvaluein interface- JLhs
- Parameters:
- output- the code emitter.
 
- 
codegenStoreGenerates the code to do the actual assignment.- Specified by:
- codegenStorein interface- JLhs
- Parameters:
- output- the code emitter.
 
- 
toJSONStores information about this AST in JSON format.
 
-