Class SymtabVisitor

java.lang.Object
  |
  +--hw3.ReflectiveVisitor
        |
        +--hw3.NodeVisitor
              |
              +--SymtabVisitor

public class SymtabVisitor
extends NodeVisitor

You must implement the visitor and the symbol table


Fields inherited from class hw3.NodeVisitor
level
 
Fields inherited from class hw3.ReflectiveVisitor
debug
 
Constructor Summary
SymtabVisitor(SymtabInterface sti)
           
 
Method Summary
 void defaultVisit(java.lang.Object o)
          This method will cause the whole AST to be visited, but nothing will happen.
static ReflectiveVisitor getVisitor()
          This method let's us keep Main as-is before and after your implementation.
 
Methods inherited from class hw3.NodeVisitor
visitChildren
 
Methods inherited from class hw3.ReflectiveVisitor
dispatch, getBestMethodFor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SymtabVisitor

public SymtabVisitor(SymtabInterface sti)
Method Detail

getVisitor

public static ReflectiveVisitor getVisitor()
This method let's us keep Main as-is before and after your implementation. Suggestion: develop as follows. Step 1: replace the return below with return new BuildSymtabVisitor(new ClassBuildSymtab()); This will use your visitor but the class symbol table implementation Step 2: replace the return below with return new BuildSymtabVisitor(new BuildSymtab()); This will use your visitor and your symbol table implementation

defaultVisit

public void defaultVisit(java.lang.Object o)
This method will cause the whole AST to be visited, but nothing will happen. It's good default behavior, but you'll need methods to handle various node types.
Overrides:
defaultVisit in class NodeVisitor