Package jminusminus
Class JExpression
java.lang.Object
jminusminus.JAST
jminusminus.JStatement
jminusminus.JExpression
- Direct Known Subclasses:
- JArrayExpression,- JArrayInitializer,- JBinaryExpression,- JCastOp,- JConditionalExpression,- JFieldSelection,- JInstanceOfOp,- JLiteralBoolean,- JLiteralChar,- JLiteralDouble,- JLiteralInt,- JLiteralLong,- JLiteralNull,- JLiteralString,- JMessageExpression,- JNewArrayOp,- JNewOp,- JSuper,- JSuperConstruction,- JThis,- JThisConstruction,- JUnaryExpression,- JVariable,- JWildExpression
The AST node for an expression. The syntax says all expressions are statements, but a semantic
 check throws some (those without a side-effect) out. Every expression has a type and a flag
 indicating whether or not it's a statement-expression.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected booleanWhether or not this expression is a statement.protected TypeExpression type.Fields inherited from class jminusminus.JASTcompilationUnit, line
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedJExpression(int line) Constructs an AST node for an expression.
- 
Method SummaryModifier and TypeMethodDescriptionabstract JExpressionAnalyzes and returns a JExpression.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.booleanReturns true if this expression is being used as a statement, and false otherwise.type()Returns the expression type.
- 
Field Details- 
typeExpression type.
- 
isStatementExpressionprotected boolean isStatementExpressionWhether or not this expression is a statement.
 
- 
- 
Constructor Details- 
JExpressionprotected JExpression(int line) Constructs an AST node for an expression.- Parameters:
- line- line in which the expression occurs in the source file.
 
 
- 
- 
Method Details- 
typeReturns the expression type.- Returns:
- the expression type.
 
- 
isStatementExpressionpublic boolean isStatementExpression()Returns true if this expression is being used as a statement, and false otherwise.- Returns:
- true if this expression is being used as a statement, and false otherwise.
 
- 
analyzeAnalyzes and returns a JExpression.
- 
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.- Parameters:
- output- the code emitter.
- targetLabel- the label to which we should branch.
- onTrue- do we branch on true?
 
 
-