|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectavrora.core.isdl.ast.Stmt
avrora.core.isdl.ast.DeclStmt
The DeclStmt represents a declaration of a local, temporary
value in the IR. A named temporary is given a type and an initial value
at declaration time, allowing typechecking and ensuring that every
variable is initialized before it is used.
| Field Summary | |
Expr |
init
The init field stores a reference to the expression which is
evaluated to give an initial value to the local. |
Token |
name
The name field stores a reference to the name of the local. |
Token |
type
The type field stores a reference to a token representing
the type of the local. |
| Constructor Summary | |
DeclStmt(java.lang.String n,
Token t,
Expr i)
The constructor of the DeclStmt class initializes the references
to the name, type, and initial value of the declared local. |
|
DeclStmt(Token n,
Token t,
Expr i)
The constructor of the DeclStmt class initializes the references
to the name, type, and initial value of the declared local. |
|
| Method Summary | |
Stmt |
accept(StmtRebuilder r)
The accept() method implements one half of the visitor
pattern for visiting the abstract syntax trees representing the
code of a particular instruction or subroutine. |
void |
accept(StmtVisitor v)
The accept() method implements one half of the visitor
pattern for visiting the abstract syntax trees representing the
code of a particular instruction or subroutine. |
java.lang.String |
toString()
The toString() method recursively converts this statement
to a string. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public final Token name
name field stores a reference to the name of the local.
public final Token type
type field stores a reference to a token representing
the type of the local.
public final Expr init
init field stores a reference to the expression which is
evaluated to give an initial value to the local.
| Constructor Detail |
public DeclStmt(Token n,
Token t,
Expr i)
DeclStmt class initializes the references
to the name, type, and initial value of the declared local.
n - the name of the local as a tokent - the type of the local as a tokeni - a reference to the expression evaluated to give the local an initial
value
public DeclStmt(java.lang.String n,
Token t,
Expr i)
DeclStmt class initializes the references
to the name, type, and initial value of the declared local.
n - the name of the local as a stringt - the type of the local as a tokeni - a reference to the expression evaluated to give the local an initial
value| Method Detail |
public void accept(StmtVisitor v)
accept() method implements one half of the visitor
pattern for visiting the abstract syntax trees representing the
code of a particular instruction or subroutine.
accept in class Stmtv - the visitor to acceptpublic java.lang.String toString()
toString() method recursively converts this statement
to a string.
public Stmt accept(StmtRebuilder r)
accept() method implements one half of the visitor
pattern for visiting the abstract syntax trees representing the
code of a particular instruction or subroutine. The
StmtRebuilder interface allows visitors to rearrange
and rebuild the statements.
accept in class Stmtr - the visitor to accept
visit()
of the rebuilder passed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||