Class Node.Visitor

java.lang.Object
com.javacc.parser.Node.Visitor
Direct Known Subclasses:
DeadCodeEliminator, JavaFormatter2, NfaBuilder, SanityChecker.RegexpVisitor, SyntaxConverter
Enclosing interface:
Node

public abstract static class Node.Visitor extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    fallback(Node node)
    If there is no specific method to visit this node type, it just uses this method.
    final void
    recurse(Node node)
    Just recurses over (i.e.
    final void
    visit(Node node)
    Tries to invoke (via reflection) the appropriate visit(...) method defined in a subclass.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • visitUnparsedTokens

      protected boolean visitUnparsedTokens
  • Constructor Details

    • Visitor

      public Visitor()
  • Method Details

    • visit

      public final void visit(Node node)
      Tries to invoke (via reflection) the appropriate visit(...) method defined in a subclass. If there is none, it just calls the fallback() routine.
      Parameters:
      node - the Node to "visit"
    • recurse

      public final void recurse(Node node)
      Just recurses over (i.e. visits) node's children
      Parameters:
      node - the node we are traversing
    • fallback

      public void fallback(Node node)
      If there is no specific method to visit this node type, it just uses this method. The default base implementation is just to recurse over the nodes.
      Parameters:
      node - The node we are currently traversing