Package jminusminus
Class JFormalParameter
java.lang.Object
jminusminus.JAST
jminusminus.JFormalParameter
The AST node for a formal parameter declaration.
-
Field Summary
Fields inherited from class jminusminus.JAST
compilationUnit, line
-
Constructor Summary
ConstructorDescriptionJFormalParameter
(int line, String name, Type type) Constructs an AST node for a formal parameter declaration. -
Method Summary
Modifier and TypeMethodDescriptionPerforms semantic analysis on this AST and returns the (possibly modified) AST.void
Performs code generation for this AST.name()
Returns the parameter's name.Sets the parameter's type to the specified type, and returns the new type.type()
Returns the parameter's type.Methods inherited from class jminusminus.JAST
line, partialCodegen, toJSON, unescape
-
Constructor Details
-
JFormalParameter
Constructs an AST node for a formal parameter declaration.- Parameters:
line
- line in which the parameter occurs in the source file.name
- parameter name.type
- parameter type.
-
-
Method Details
-
name
Returns the parameter's name.- Returns:
- the parameter's name.
-
type
Returns the parameter's type.- Returns:
- the parameter's type.
-
setType
Sets the parameter's type to the specified type, and returns the new type.- Parameters:
newType
- the new type.- Returns:
- return the new type.
-
analyze
Performs semantic analysis on this AST and returns the (possibly modified) AST. -
codegen
Performs code generation for this AST.
-