|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.agentfactory.common.parser.Visitor
public abstract class Visitor
This interface should be used to implemnet any visitor classes that you wish to use to traverse the parse tree. Only one method is required, and this method should simply call the accept() method on the associated node object. TODO (Rem Collier): It may, in the future be better to make this an abstract base class and to implement the visit method only once.
| Field Summary | |
|---|---|
protected AFSession |
session
|
| Constructor Summary | |
|---|---|
Visitor()
|
|
| Method Summary | |
|---|---|
abstract void |
endOfStatement()
This method is invoked by the compiler once the visitor has completed its traversal of a single statement in the language. |
abstract void |
endOfVisit()
this method is invoked by the compiler once the visitor has completed its traversal of the entire program. |
abstract void |
reset()
This method should be invoked prior to the visitor traversing a program parse tree. |
void |
setSession(AFSession session)
|
abstract void |
visit(Node node)
This method is invoked to start the tree traversal process, and is invoked for every subsequent node that is visited. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected AFSession session
| Constructor Detail |
|---|
public Visitor()
| Method Detail |
|---|
public void setSession(AFSession session)
public abstract void reset()
public abstract void visit(Node node)
throws SemanticError
node - the node that should be visited next.
SemanticErrorpublic abstract void endOfStatement()
public abstract void endOfVisit()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||