Package jminusminus
Class JBlock
java.lang.Object
jminusminus.JAST
jminusminus.JStatement
jminusminus.JBlock
The AST node for a block, which delimits a nested level of scope.
-
Field Summary
Fields inherited from class jminusminus.JAST
compilationUnit, line
-
Constructor Summary
ConstructorDescriptionJBlock
(int line, ArrayList<JStatement> statements) Constructs an AST node for a block. -
Method Summary
Modifier and TypeMethodDescriptionPerforms semantic analysis on this AST and returns the (possibly modified) AST.void
Performs code generation for this AST.Returns the list of statements comprising this block.void
toJSON
(JSONElement json) Stores information about this AST in JSON format.Methods inherited from class jminusminus.JAST
line, partialCodegen, unescape
-
Constructor Details
-
JBlock
Constructs an AST node for a block.- Parameters:
line
- line in which the block occurs in the source file.statements
- list of statements forming the block body.
-
-
Method Details
-
statements
Returns the list of statements comprising this block.- Returns:
- the list of statements comprising this block.
-
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.
-