Package jminusminus
Class JReturnStatement
java.lang.Object
jminusminus.JAST
jminusminus.JStatement
jminusminus.JReturnStatement
The AST node for a return-statement. If the enclosing method is non-void, then there is a
value to return, so we keep track of the expression denoting that value and its type.
-
Field Summary
Fields inherited from class jminusminus.JAST
compilationUnit, line
-
Constructor Summary
ConstructorDescriptionJReturnStatement
(int line, JExpression expr) Constructs an AST node for a return-statement. -
Method Summary
Modifier and TypeMethodDescriptionPerforms semantic analysis on this AST and returns the (possibly modified) AST.void
Performs code generation for this AST.void
toJSON
(JSONElement json) Stores information about this AST in JSON format.Methods inherited from class jminusminus.JAST
line, partialCodegen, unescape
-
Constructor Details
-
JReturnStatement
Constructs an AST node for a return-statement.- Parameters:
line
- line in which the return-statement appears in the source file.expr
- the returned expression.
-
-
Method Details
-
analyze
Performs semantic analysis on this AST and returns the (possibly modified) AST. -
codegen
Performs code generation for this AST. -
toJSON
Stores information about this AST in JSON format.
-