Package iota
Class IVariableDeclaration
java.lang.Object
iota.IAST
iota.IStatement
iota.IVariableDeclaration
The AST node for a local variable declaration. Local variables are declared by its analyze() method, which also
re-writes any initializations as assignment statements, in turn generated by its codegen() method.
-
Field Summary
Fields inherited from class iota.IAST
compilationUnit, line
-
Constructor Summary
ConstructorsConstructorDescriptionIVariableDeclaration
(int line, String name, Type type, IExpression initializer) Constructs an AST node for a variable declarator. -
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.name()
Returns the variable name.void
Sets the variable type.void
toJSON
(JSONElement json) Stores information about this AST in JSON format.type()
Returns the variable type.Methods inherited from class iota.IAST
line, preAnalyze
-
Constructor Details
-
IVariableDeclaration
Constructs an AST node for a variable declarator.- Parameters:
line
- line in which the variable occurs in the source file.name
- variable name.type
- variable type.initializer
- initializer.
-
-
Method Details
-
name
Returns the variable name.- Returns:
- the variable name.
-
type
Returns the variable type.- Returns:
- the variable type.
-
setType
Sets the variable type.- Parameters:
type
- the type
-
analyze
Performs second phase of semantic analysis on this AST and returns the (possibly modified) AST. -
codegen
Performs code generation for this AST. -
toJSON
Stores information about this AST in JSON format.
-