abstract class JExpression extends JStatement
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
isStatementExpression
Whether or not this expression is a statement.
|
protected Type |
type
Expression type.
|
compilationUnit, line| Modifier | Constructor and Description |
|---|---|
protected |
JExpression(int line)
Construct an AST node for an expression given its line number.
|
| Modifier and Type | Method and Description |
|---|---|
abstract JExpression |
analyze(Context context)
The analysis of any JExpression returns a JExpression.
|
void |
codegen(CLEmitter output,
String targetLabel,
boolean onTrue)
Perform (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.
|
boolean |
isStatementExpression()
Is this a statementRxpression?
|
Type |
type()
Return the expression type.
|
codegen, line, partialCodegen, writeToStdOutprotected Type type
protected boolean isStatementExpression
protected JExpression(int line)
line - line in which the expression occurs in the source file.public Type type()
public boolean isStatementExpression()
public abstract JExpression analyze(Context context)
public void codegen(CLEmitter output, String targetLabel, boolean onTrue)
output - the code emitter (basically an abstraction for producing the
.class file).targetLabel - the label to which we should branch.onTrue - do we branch on true?