Package iota
Class IMethodDeclaration
java.lang.Object
iota.IAST
iota.IMethodDeclaration
The AST node for a method declaration.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected IBlock
Method body.protected MethodContext
Method context (built in analyze()).protected String
Method descriptor (computed in preAnalyze()).Method modifiers.protected String
Method name.protected ArrayList
<IFormalParameter> The formal parameters.protected Type
Return type.protected String
Method signature (also computed in preAnalyze()).Fields inherited from class iota.IAST
compilationUnit, line
-
Constructor Summary
ConstructorsConstructorDescriptionIMethodDeclaration
(int line, String name, Type returnType, ArrayList<IFormalParameter> params, IBlock body) Constructs an AST node for a method declaration. -
Method Summary
Modifier and TypeMethodDescriptionPerforms second phase of semantic analysis on this AST and returns the (possibly modified) AST.void
Performs code generation for this AST.void
preAnalyze
(Context context, CLEmitter partial) Performs first phase of semantic analysis on this AST.void
toJSON
(JSONElement json) Adds information pertaining to this context to the given JSON element.
-
Field Details
-
mods
Method modifiers. -
name
Method name. -
returnType
Return type. -
params
The formal parameters. -
body
Method body. -
context
Method context (built in analyze()). -
descriptor
Method descriptor (computed in preAnalyze()). -
signature
Method signature (also computed in preAnalyze()).
-
-
Constructor Details
-
IMethodDeclaration
public IMethodDeclaration(int line, String name, Type returnType, ArrayList<IFormalParameter> params, IBlock body) Constructs an AST node for a method declaration.- Parameters:
line
- line in which the method declaration occurs in the source file.name
- method name.returnType
- return type.params
- the formal parameters.body
- method body.
-
-
Method Details
-
preAnalyze
Performs first phase of semantic analysis on this AST.- Overrides:
preAnalyze
in classIAST
- Parameters:
context
- the environment (scope) in which code is pre-analyzed.partial
- the code emitter.
-
analyze
Performs second phase of semantic analysis on this AST and returns the (possibly modified) AST. -
codegen
Performs code generation for this AST. -
toJSON
Adds information pertaining to this context to the given JSON element.
-