class JNewArrayOp extends JExpression
isStatementExpression, typecompilationUnit, line| Constructor and Description |
|---|
JNewArrayOp(int line,
Type typeSpec,
ArrayList<JExpression> dimExprs)
Construct an AST node for a "new" array operation.
|
| Modifier and Type | Method and Description |
|---|---|
JExpression |
analyze(Context context)
Analysis of a new array operation involves resolving its type and
analyzing the array bounds and checking their types.
|
void |
codegen(CLEmitter output)
Generate code to push the bounds on the stack and then generate the
appropriate array creation instruction.
|
void |
writeToStdOut(PrettyPrinter p)
Write the information pertaining to this AST to STDOUT.
|
codegen, isStatementExpression, typeline, partialCodegenpublic JNewArrayOp(int line,
Type typeSpec,
ArrayList<JExpression> dimExprs)
line - the line in which the operation occurs in the source file.typeSpec - the type of the array being created.dimExprs - a list of dimension expressions.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.