class JBlock extends JStatement
compilationUnit, line
Constructor and Description |
---|
JBlock(int line,
ArrayList<JStatement> statements)
Construct an AST node for a block given its line number, and the list of
statements forming the block body.
|
Modifier and Type | Method and Description |
---|---|
JBlock |
analyze(Context context)
Analyzing a block consists of creating a new nested context for that
block and analyzing each of its statements within that context.
|
void |
codegen(CLEmitter output)
Generating code for a block consists of generating code for each of its
statements.
|
ArrayList<JStatement> |
statements()
Return the list of statements comprising the block.
|
void |
writeToStdOut(PrettyPrinter p)
Write the information pertaining to this AST to STDOUT.
|
line, partialCodegen
public JBlock(int line, ArrayList<JStatement> statements)
line
- line in which the block occurs in the source file.statements
- list of statements forming the block body.public ArrayList<JStatement> statements()
public JBlock analyze(Context context)
public void codegen(CLEmitter output)
public void writeToStdOut(PrettyPrinter p)
JAST
writeToStdOut
in class JAST
p
- for pretty printing with indentation.