class JReturnStatement extends JStatement
compilationUnit, line
Constructor and Description |
---|
JReturnStatement(int line,
JExpression expr)
Construct an AST node for a return-statement given its
line number, and the expression that is returned.
|
Modifier and Type | Method and Description |
---|---|
JStatement |
analyze(Context context)
Analysis distinguishes between our being in a constructor
or in a regular method in checking return types.
|
void |
codegen(CLEmitter output)
Generate code for the return statement.
|
void |
writeToStdOut(PrettyPrinter p)
Write the information pertaining to this AST to STDOUT.
|
line, partialCodegen
public JReturnStatement(int line, JExpression expr)
line
- line in which the return-statement appears
in the source file.expr
- the returned expression.public JStatement analyze(Context context)
public void codegen(CLEmitter output)
public void writeToStdOut(PrettyPrinter p)
JAST
writeToStdOut
in class JAST
p
- for pretty printing with indentation.