class JVariableDeclaration extends JStatement
compilationUnit, line
Constructor and Description |
---|
JVariableDeclaration(int line,
ArrayList<String> mods,
ArrayList<JVariableDeclarator> decls)
Construct an AST node for a variable declaration given the line number,
modifiers, and the variable declarators.
|
Modifier and Type | Method and Description |
---|---|
JStatement |
analyze(Context context)
We declare the variable(s).
|
void |
codegen(CLEmitter output)
Local variable initializations (rewritten as assignments in analyze())
are generated here.
|
ArrayList<String> |
mods()
Return the list of modifiers.
|
void |
writeToStdOut(PrettyPrinter p)
Write the information pertaining to this AST to STDOUT.
|
line, partialCodegen
public JVariableDeclaration(int line, ArrayList<String> mods, ArrayList<JVariableDeclarator> decls)
line
- line in which the variable declaration occurs in the source
file.mods
- modifiers.decls
- variable declarators.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.