DepthFirstVisitor.java

//
// Generated by JTB 1.3.2
//

package net.metanotion.contentstore.markup.parser.visitor;
import net.metanotion.contentstore.markup.parser.syntaxtree.*;
import java.util.*;

/**
 * Provides default methods which visit each node in the tree in depth-first
 * order.  Your visitors may extend this class.
 */
public class DepthFirstVisitor implements Visitor {
   //
   // Auto class visitors--probably don't need to be overridden.
   //
   public void visit(NodeList n) {
      for ( Enumeration<Node> e = n.elements(); e.hasMoreElements(); )
         e.nextElement().accept(this);
   }

   public void visit(NodeListOptional n) {
      if ( n.present() )
         for ( Enumeration<Node> e = n.elements(); e.hasMoreElements(); )
            e.nextElement().accept(this);
   }

   public void visit(NodeOptional n) {
      if ( n.present() )
         n.node.accept(this);
   }

   public void visit(NodeSequence n) {
      for ( Enumeration<Node> e = n.elements(); e.hasMoreElements(); )
         e.nextElement().accept(this);
   }

   public void visit(NodeToken n) { }

   //
   // User-generated visitor methods below
   //

   /**
    * f0 -> ( Raw() | Tag() )*
    * f1 -> <EOF>
    */
   public void visit(Content n) {
      n.f0.accept(this);
      n.f1.accept(this);
   }

   /**
    * f0 -> <BR>
    *       | <PLAIN>
    */
   public void visit(Raw n) {
      n.f0.accept(this);
   }

   /**
    * f0 -> Anchor()
    *       | Div()
    *       | Img()
    */
   public void visit(Tag n) {
      n.f0.accept(this);
   }

   /**
    * f0 -> <A>
    * f1 -> ( <ATAG> )*
    * f2 -> <END_A>
    */
   public void visit(Anchor n) {
      n.f0.accept(this);
      n.f1.accept(this);
      n.f2.accept(this);
   }

   /**
    * f0 -> <RAW>
    * f1 -> ( <TAGSOUP> )*
    * f2 -> <END_RAW>
    */
   public void visit(Div n) {
      n.f0.accept(this);
      n.f1.accept(this);
      n.f2.accept(this);
   }

   /**
    * f0 -> <IMG>
    * f1 -> ( <IMGTAG> )*
    * f2 -> <END_IMG>
    */
   public void visit(Img n) {
      n.f0.accept(this);
      n.f1.accept(this);
      n.f2.accept(this);
   }

}