compilationUnit, line
Constructor and Description |
---|
JFieldDeclaration(int line,
ArrayList<String> mods,
ArrayList<JVariableDeclarator> decls)
Construct an AST node for a field declaration given the line number,
modifiers, and the variable declarators.
|
Modifier and Type | Method and Description |
---|---|
JFieldDeclaration |
analyze(Context context)
Analysis of field declaration involves rewriting initializations (if any)
as assignment statements.
|
void |
codegen(CLEmitter output)
Code generation for field declaration involves generate field the header.
|
void |
codegenInitializations(CLEmitter output)
Generate code for any field initializations (now rewritten as assignment
statements).
|
ArrayList<String> |
mods()
Return the list of modifiers.
|
void |
preAnalyze(Context context,
CLEmitter partial)
Declare fields in the parent's (partial) class.
|
void |
writeToStdOut(PrettyPrinter p)
Write the information pertaining to this AST to STDOUT.
|
line, partialCodegen
public JFieldDeclaration(int line, ArrayList<String> mods, ArrayList<JVariableDeclarator> decls)
line
- line in which the variable declaration occurs in the source
file.mods
- field modifiers.decls
- variable declarators.public void preAnalyze(Context context, CLEmitter partial)
preAnalyze
in interface JMember
context
- the parent (class) context.partial
- the code emitter (basically an abstraction for producing the
partial class).public JFieldDeclaration analyze(Context context)
public void codegenInitializations(CLEmitter output)
output
- the code emitter (basically an abstraction for producing the
.class file).public void codegen(CLEmitter output)
public void writeToStdOut(PrettyPrinter p)
JAST
writeToStdOut
in class JAST
p
- for pretty printing with indentation.