Modifier and Type | Field and Description |
---|---|
protected Expr |
init
The (non-optional) initialization expression for the variable being
declared
|
protected java.lang.String |
name
The name of the variable being declared
|
protected java.lang.String |
type
The type of the variable being declared
|
Constructor and Description |
---|
DeclStmt(int lineNum,
java.lang.String type,
java.lang.String name,
Expr init)
DeclStmt constructor
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
accept(visitor.Visitor v,
java.lang.Object o)
Visitor method
|
Expr |
getInit()
Get the initialization expression for the declared variable
|
java.lang.String |
getName()
Get the name of the declared variable
|
java.lang.String |
getType()
Get the type of the declared variable
|
getLineNum
protected java.lang.String type
protected java.lang.String name
protected Expr init
public DeclStmt(int lineNum, java.lang.String type, java.lang.String name, Expr init)
lineNum
- source line number corresponding to this AST nodetype
- the symbol representing the type of the variable being declaredname
- the symbol representing the name of the variable being declaredinit
- the (non-optional) initialization expression for the declared
variablepublic java.lang.String getType()
public java.lang.String getName()
public Expr getInit()