Package jminusminus
Class JConstructorDeclaration
java.lang.Object
jminusminus.JAST
jminusminus.JMethodDeclaration
jminusminus.JConstructorDeclaration
- All Implemented Interfaces:
JMember
The AST node for a constructor declaration.
-
Field Summary
Fields inherited from class jminusminus.JMethodDeclaration
body, context, descriptor, exceptions, isAbstract, isPrivate, isStatic, mods, name, params, returnType
Fields inherited from class jminusminus.JAST
compilationUnit, line
-
Constructor Summary
ConstructorDescriptionJConstructorDeclaration
(int line, ArrayList<String> mods, String name, ArrayList<JFormalParameter> params, ArrayList<TypeName> exceptions, JBlock body) Constructs an AST node for a constructor declaration. -
Method Summary
Modifier and TypeMethodDescriptionPerforms semantic analysis on this AST and returns the (possibly modified) AST.void
Performs code generation for this AST.void
partialCodegen
(Context context, CLEmitter partial) Generates a partial class for a type, reflecting only the member information required to do analysis.void
preAnalyze
(Context context, CLEmitter partial) Declares the member names in the specified (class) context and generates the member headers in the partial class.void
toJSON
(JSONElement json) Stores information about this AST in JSON format.
-
Constructor Details
-
JConstructorDeclaration
public JConstructorDeclaration(int line, ArrayList<String> mods, String name, ArrayList<JFormalParameter> params, ArrayList<TypeName> exceptions, JBlock body) Constructs an AST node for a constructor declaration.- Parameters:
line
- line in which the constructor declaration occurs in the source file.mods
- modifiers.name
- constructor name.params
- the formal parameters.exceptions
- exceptions thrown.body
- constructor body.
-
-
Method Details
-
preAnalyze
Declares the member names in the specified (class) context and generates the member headers in the partial class.- Specified by:
preAnalyze
in interfaceJMember
- Overrides:
preAnalyze
in classJMethodDeclaration
- Parameters:
context
- class context in which names are resolved.partial
- the code emitter.
-
analyze
Performs semantic analysis on this AST and returns the (possibly modified) AST.- Overrides:
analyze
in classJMethodDeclaration
- Parameters:
context
- the environment (scope) in which code is analyzed.- Returns:
- the (possibly modified) AST.
-
partialCodegen
Generates a partial class for a type, reflecting only the member information required to do analysis.- Overrides:
partialCodegen
in classJMethodDeclaration
- Parameters:
context
- the parent (class) context.partial
- the code emitter.
-
codegen
Performs code generation for this AST.- Overrides:
codegen
in classJMethodDeclaration
- Parameters:
output
- the code emitter.
-
toJSON
Stores information about this AST in JSON format.- Overrides:
toJSON
in classJMethodDeclaration
- Parameters:
json
- the JSON emitter.
-