Class SymtabVisitor

java.lang.Object
  extended by hw3.ReflectiveVisitor
      extended by hw3.NodeVisitor
          extended by SymtabVisitor

public class SymtabVisitor
extends NodeVisitor

You must implement the visitor and the symbol table


Field Summary
 
Fields inherited from class hw3.NodeVisitor
level, ps
 
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 lets us keep Main as-is before and after your implementation.
 
Methods inherited from class hw3.NodeVisitor
err, err, out, out, setPrintStream, visitChildren
 
Methods inherited from class hw3.ReflectiveVisitor
dispatch, getBestMethodFor, perform, performVisit
 
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 lets us keep Main as-is before and after your implementation. Suggestion: develop as follows. Step 1: replace the return below with return new SymtabVisitor(new ClassBuildSymtab()); This will use your visitor but the class symbol table implementation Step 2: [ not necessary but if you want] replace the return below with return new SymtabVisitor(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