|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object spiglet.visitor.GJDepthFirst<R,A>
public class GJDepthFirst<R,A>
Provides default methods which visit each node in the tree in depth-first order. Your visitors may extend this class.
Constructor Summary | |
---|---|
GJDepthFirst()
|
Method Summary | |
---|---|
R |
visit(BinOp n,
A argu)
operator -> Operator() temp -> Temp() simpleExp -> SimpleExp() |
R |
visit(Call n,
A argu)
nodeToken -> "CALL" simpleExp -> SimpleExp() nodeToken1 -> "(" nodeListOptional -> ( Temp() )* nodeToken2 -> ")" |
R |
visit(CJumpStmt n,
A argu)
nodeToken -> "CJUMP" temp -> Temp() label -> Label() |
R |
visit(ErrorStmt n,
A argu)
nodeToken -> "ERROR" |
R |
visit(Exp n,
A argu)
nodeChoice -> Call() | HAllocate() | BinOp() | SimpleExp() |
R |
visit(Goal n,
A argu)
nodeToken -> "MAIN" stmtList -> StmtList() nodeToken1 -> "END" nodeListOptional -> ( Procedure() )* nodeToken2 -> <EOF> |
R |
visit(HAllocate n,
A argu)
nodeToken -> "HALLOCATE" simpleExp -> SimpleExp() |
R |
visit(HLoadStmt n,
A argu)
nodeToken -> "HLOAD" temp -> Temp() temp1 -> Temp() integerLiteral -> IntegerLiteral() |
R |
visit(HStoreStmt n,
A argu)
nodeToken -> "HSTORE" temp -> Temp() integerLiteral -> IntegerLiteral() temp1 -> Temp() |
R |
visit(IntegerLiteral n,
A argu)
nodeToken -> <INTEGER_LITERAL> |
R |
visit(JumpStmt n,
A argu)
nodeToken -> "JUMP" label -> Label() |
R |
visit(Label n,
A argu)
nodeToken -> <IDENTIFIER> |
R |
visit(MoveStmt n,
A argu)
nodeToken -> "MOVE" temp -> Temp() exp -> Exp() |
R |
visit(NodeList n,
A argu)
|
R |
visit(NodeListOptional n,
A argu)
|
R |
visit(NodeOptional n,
A argu)
|
R |
visit(NodeSequence n,
A argu)
|
R |
visit(NodeToken n,
A argu)
|
R |
visit(NoOpStmt n,
A argu)
nodeToken -> "NOOP" |
R |
visit(Operator n,
A argu)
nodeChoice -> "LT" | "PLUS" | "MINUS" | "TIMES" |
R |
visit(PrintStmt n,
A argu)
nodeToken -> "PRINT" simpleExp -> SimpleExp() |
R |
visit(Procedure n,
A argu)
label -> Label() nodeToken -> "[" integerLiteral -> IntegerLiteral() nodeToken1 -> "]" stmtExp -> StmtExp() |
R |
visit(SimpleExp n,
A argu)
nodeChoice -> Temp() | IntegerLiteral() | Label() |
R |
visit(Stmt n,
A argu)
nodeChoice -> NoOpStmt() | ErrorStmt() | CJumpStmt() | JumpStmt() | HStoreStmt() | HLoadStmt() | MoveStmt() | PrintStmt() |
R |
visit(StmtExp n,
A argu)
nodeToken -> "BEGIN" stmtList -> StmtList() nodeToken1 -> "RETURN" simpleExp -> SimpleExp() nodeToken2 -> "END" |
R |
visit(StmtList n,
A argu)
nodeListOptional -> ( ( Label() )? Stmt() )* |
R |
visit(Temp n,
A argu)
nodeToken -> "TEMP" integerLiteral -> IntegerLiteral() |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GJDepthFirst()
Method Detail |
---|
public R visit(NodeList n, A argu)
visit
in interface GJVisitor<R,A>
public R visit(NodeListOptional n, A argu)
visit
in interface GJVisitor<R,A>
public R visit(NodeOptional n, A argu)
visit
in interface GJVisitor<R,A>
public R visit(NodeSequence n, A argu)
visit
in interface GJVisitor<R,A>
public R visit(NodeToken n, A argu)
visit
in interface GJVisitor<R,A>
public R visit(Goal n, A argu)
nodeToken -> "MAIN" stmtList -> StmtList() nodeToken1 -> "END" nodeListOptional -> ( Procedure() )* nodeToken2 -> <EOF>
visit
in interface GJVisitor<R,A>
public R visit(StmtList n, A argu)
nodeListOptional -> ( ( Label() )? Stmt() )*
visit
in interface GJVisitor<R,A>
public R visit(Procedure n, A argu)
label -> Label() nodeToken -> "[" integerLiteral -> IntegerLiteral() nodeToken1 -> "]" stmtExp -> StmtExp()
visit
in interface GJVisitor<R,A>
public R visit(Stmt n, A argu)
nodeChoice -> NoOpStmt() | ErrorStmt() | CJumpStmt() | JumpStmt() | HStoreStmt() | HLoadStmt() | MoveStmt() | PrintStmt()
visit
in interface GJVisitor<R,A>
public R visit(NoOpStmt n, A argu)
nodeToken -> "NOOP"
visit
in interface GJVisitor<R,A>
public R visit(ErrorStmt n, A argu)
nodeToken -> "ERROR"
visit
in interface GJVisitor<R,A>
public R visit(CJumpStmt n, A argu)
nodeToken -> "CJUMP" temp -> Temp() label -> Label()
visit
in interface GJVisitor<R,A>
public R visit(JumpStmt n, A argu)
nodeToken -> "JUMP" label -> Label()
visit
in interface GJVisitor<R,A>
public R visit(HStoreStmt n, A argu)
nodeToken -> "HSTORE" temp -> Temp() integerLiteral -> IntegerLiteral() temp1 -> Temp()
visit
in interface GJVisitor<R,A>
public R visit(HLoadStmt n, A argu)
nodeToken -> "HLOAD" temp -> Temp() temp1 -> Temp() integerLiteral -> IntegerLiteral()
visit
in interface GJVisitor<R,A>
public R visit(MoveStmt n, A argu)
nodeToken -> "MOVE" temp -> Temp() exp -> Exp()
visit
in interface GJVisitor<R,A>
public R visit(PrintStmt n, A argu)
nodeToken -> "PRINT" simpleExp -> SimpleExp()
visit
in interface GJVisitor<R,A>
public R visit(Exp n, A argu)
nodeChoice -> Call() | HAllocate() | BinOp() | SimpleExp()
visit
in interface GJVisitor<R,A>
public R visit(StmtExp n, A argu)
nodeToken -> "BEGIN" stmtList -> StmtList() nodeToken1 -> "RETURN" simpleExp -> SimpleExp() nodeToken2 -> "END"
visit
in interface GJVisitor<R,A>
public R visit(Call n, A argu)
nodeToken -> "CALL" simpleExp -> SimpleExp() nodeToken1 -> "(" nodeListOptional -> ( Temp() )* nodeToken2 -> ")"
visit
in interface GJVisitor<R,A>
public R visit(HAllocate n, A argu)
nodeToken -> "HALLOCATE" simpleExp -> SimpleExp()
visit
in interface GJVisitor<R,A>
public R visit(BinOp n, A argu)
operator -> Operator() temp -> Temp() simpleExp -> SimpleExp()
visit
in interface GJVisitor<R,A>
public R visit(Operator n, A argu)
nodeChoice -> "LT" | "PLUS" | "MINUS" | "TIMES"
visit
in interface GJVisitor<R,A>
public R visit(SimpleExp n, A argu)
nodeChoice -> Temp() | IntegerLiteral() | Label()
visit
in interface GJVisitor<R,A>
public R visit(Temp n, A argu)
nodeToken -> "TEMP" integerLiteral -> IntegerLiteral()
visit
in interface GJVisitor<R,A>
public R visit(IntegerLiteral n, A argu)
nodeToken -> <INTEGER_LITERAL>
visit
in interface GJVisitor<R,A>
public R visit(Label n, A argu)
nodeToken -> <IDENTIFIER>
visit
in interface GJVisitor<R,A>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |