Package jminusminus
Class JVariableDeclaration
java.lang.Object
jminusminus.JAST
jminusminus.JStatement
jminusminus.JVariableDeclaration
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 jminusminus.JAST
compilationUnit, line
-
Constructor Summary
ConstructorDescriptionJVariableDeclaration
(int line, ArrayList<JVariableDeclarator> decls) Constructs an AST node for a variable 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
toJSON
(JSONElement json) Stores information about this AST in JSON format.Methods inherited from class jminusminus.JAST
line, partialCodegen, unescape
-
Constructor Details
-
JVariableDeclaration
Constructs an AST node for a variable declaration.- Parameters:
line
- line in which the variable declaration occurs in the source file.decls
- variable declarators.
-
-
Method Details
-
analyze
Performs 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.
-