class JThisConstruction extends JExpression
isStatementExpression, type
compilationUnit, line
Modifier | Constructor and Description |
---|---|
protected |
JThisConstruction(int line,
ArrayList<JExpression> arguments)
Construct the AST node for a this(...) constructor given its line number
and arguments.
|
Modifier and Type | Method and Description |
---|---|
JExpression |
analyze(Context context)
Analyzing a this constructor statement involves (1) setting the type, (2)
analyzing the actual arguments, (3) checking that this construction
statement is properly invoked (as the first statement in another
constructor), and (4) finding the appropriate Constructor
|
void |
codegen(CLEmitter output)
Code generation involves generating the code for loading the actual
arguments onto the stack, and then for invoking this constructor.
|
void |
markProperUseOfConstructor()
Used in JConstructorDeclaration to mark this(...) as being properly
placed, ie, as the first statement in its body.
|
void |
writeToStdOut(PrettyPrinter p)
Write the information pertaining to this AST to STDOUT.
|
codegen, isStatementExpression, type
line, partialCodegen
protected JThisConstruction(int line, ArrayList<JExpression> arguments)
line
- line in which the constructor occurs in the source file.arguments
- the constructor's arguments.public void markProperUseOfConstructor()
public JExpression analyze(Context context)
analyze
in class JExpression
context
- context in which names are resolved.public void codegen(CLEmitter output)
public void writeToStdOut(PrettyPrinter p)
JAST
writeToStdOut
in class JAST
p
- for pretty printing with indentation.