class JStatementExpression extends JStatement
| Modifier and Type | Field and Description |
|---|---|
(package private) JExpression |
expr
The expression.
|
compilationUnit, line| Constructor and Description |
|---|
JStatementExpression(int line,
JExpression expr)
Construct an AST node for a statement expression given its line number,
and expression.
|
| Modifier and Type | Method and Description |
|---|---|
JStatement |
analyze(Context context)
Analysis involves analyzing the encapsulated expression if indeed it is a
statement expression, i.e., one with a side effect.
|
void |
codegen(CLEmitter output)
Generating code for the statement expression involves simply generating
code for the encapsulated expression.
|
void |
writeToStdOut(PrettyPrinter p)
Write the information pertaining to this AST to STDOUT.
|
line, partialCodegenJExpression expr
public JStatementExpression(int line,
JExpression expr)
line - line in which the expression occurs in the source file.expr - the expression.public JStatement analyze(Context context)
public void codegen(CLEmitter output)
public void writeToStdOut(PrettyPrinter p)
JASTwriteToStdOut in class JASTp - for pretty printing with indentation.