class JConstructorDeclaration extends JMethodDeclaration implements JMember
Modifier and Type | Field and Description |
---|---|
(package private) JClassDeclaration |
definingClass
Defining class
|
body, context, descriptor, isAbstract, isPrivate, isStatic, mods, name, params, returnType
compilationUnit, line
Constructor and Description |
---|
JConstructorDeclaration(int line,
ArrayList<String> mods,
String name,
ArrayList<JFormalParameter> params,
JBlock body)
Construct an AST node for a constructor declaration given the line
number, modifiers, constructor name, formal parameters, and the
constructor body.
|
Modifier and Type | Method and Description |
---|---|
JAST |
analyze(Context context)
Analysis for a constructor declaration is very much like that for a
method declaration.
|
void |
codegen(CLEmitter output)
Generate code for the constructor declaration.
|
void |
partialCodegen(Context context,
CLEmitter partial)
Add this constructor declaration to the partial class.
|
void |
preAnalyze(Context context,
CLEmitter partial)
Declare this constructor in the parent (class) context.
|
void |
writeToStdOut(PrettyPrinter p)
Write the information pertaining to this AST to STDOUT.
|
JClassDeclaration definingClass
public JConstructorDeclaration(int line, ArrayList<String> mods, String name, ArrayList<JFormalParameter> params, JBlock body)
line
- line in which the constructor declaration occurs in the source
file.mods
- modifiers.name
- constructor name.params
- the formal parameters.body
- constructor body.public void preAnalyze(Context context, CLEmitter partial)
preAnalyze
in interface JMember
preAnalyze
in class JMethodDeclaration
context
- the parent (class) context.partial
- the code emitter (basically an abstraction for producing the
partial class).public JAST analyze(Context context)
analyze
in class JMethodDeclaration
context
- context in which names are resolved.public void partialCodegen(Context context, CLEmitter partial)
partialCodegen
in class JMethodDeclaration
context
- the parent (class) context.partial
- the code emitter (basically an abstraction for producing the
partial class).public void codegen(CLEmitter output)
codegen
in class JMethodDeclaration
output
- the code emitter (basically an abstraction for producing the
.class file).public void writeToStdOut(PrettyPrinter p)
JAST
writeToStdOut
in class JMethodDeclaration
p
- for pretty printing with indentation.