|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectast.ASTNode
ast.Stmt
ast.DeclStmt
public class DeclStmt
The DeclStmt class represents a variable declaration statement appearing in a method declaration. It contains a variable type (type), a name (name), and an (non-optional) initialization expression (init).
ASTNode,
Stmt| Field Summary | |
|---|---|
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 |
| Fields inherited from class ast.ASTNode |
|---|
charNum, lineNum, lineStr |
| Constructor Summary | |
|---|---|
DeclStmt(int lineNum,
java.lang.String type,
java.lang.String name,
Expr init)
DeclStmt constructor |
|
| Method Summary | |
|---|---|
java.lang.Object |
accept(Visitor v)
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 |
| Methods inherited from class ast.ASTNode |
|---|
getLineNum |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String type
protected java.lang.String name
protected Expr init
| Constructor Detail |
|---|
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 variable| Method Detail |
|---|
public java.lang.String getType()
public java.lang.String getName()
public Expr getInit()
public java.lang.Object accept(Visitor v)
accept in class Stmtv - visitor object
Visitor
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||