Package iota
Class IAST
java.lang.Object
iota.IAST
- Direct Known Subclasses:
ICompilationUnit
,IFormalParameter
,IMethodDeclaration
,IStatement
IAST is the abstract superclass of all nodes in the abstract syntax tree (AST).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic ICompilationUnit
Current compilation unit (set in ICompilationUnit()).protected int
Line in which the source for the AST was found. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
IAST
(int line) Constructs an AST node the given its line number in the source file. -
Method Summary
Modifier and TypeMethodDescriptionabstract IAST
Performs second phase of semantic analysis on this AST and returns the (possibly modified) AST.abstract void
Performs code generation for this AST.int
line()
Returns the line in which the source for the AST was found.void
preAnalyze
(Context context, CLEmitter partial) Performs first phase of semantic analysis on this AST.void
toJSON
(JSONElement json) Stores information about this AST in JSON format.
-
Field Details
-
compilationUnit
Current compilation unit (set in ICompilationUnit()). -
line
protected int lineLine in which the source for the AST was found.
-
-
Constructor Details
-
IAST
protected IAST(int line) Constructs an AST node the given its line number in the source file.- Parameters:
line
- line in which the source for the AST was found.
-
-
Method Details
-
line
public int line()Returns the line in which the source for the AST was found.- Returns:
- the line in which the source for the AST was found.
-
preAnalyze
Performs first phase of semantic analysis on this AST.- 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.- Parameters:
context
- the environment (scope) in which code is analyzed.- Returns:
- the (possibly modified) AST.
-
codegen
Performs code generation for this AST.- Parameters:
output
- the code emitter.
-
toJSON
Stores information about this AST in JSON format.- Parameters:
json
- the JSON emitter.
-