class JArrayInitializer extends JExpression
isStatementExpression, typecompilationUnit, line| Constructor and Description |
|---|
JArrayInitializer(int line,
Type expected,
ArrayList<JExpression> initials)
Construct an AST node for an array initializer given the
(expected) array type and initial values.
|
| Modifier and Type | Method and Description |
|---|---|
JExpression |
analyze(Context context)
Analysis of array initializer involves making sure that
that the type of the initials is the same as the component
type.
|
void |
codegen(CLEmitter output)
Perform code generation necessary to construct the
initializing array and leave it on top of the stack.
|
void |
writeToStdOut(PrettyPrinter p)
Write the information pertaining to this AST to STDOUT.
|
codegen, isStatementExpression, typeline, partialCodegenpublic JArrayInitializer(int line,
Type expected,
ArrayList<JExpression> initials)
line - line in which this array initializer occurs
in the source file.expected - the type of the array we're initializing.initials - initializations.public JExpression analyze(Context context)
analyze in class JExpressioncontext - context in which names are resolved.public void codegen(CLEmitter output)
public void writeToStdOut(PrettyPrinter p)
JASTwriteToStdOut in class JASTp - for pretty printing with indentation.