//
// Generated by JTB 1.3.2
//

package jtb.syntaxtree;

// Grammar production:
// f0 -> [ PackageDeclaration() ]
// f1 -> ( ImportDeclaration() )*
// f2 -> ( TypeDeclaration() )*
// f3 -> ( <"\u001a"> )?
// f4 -> ( <STUFF_TO_IGNORE: ~[]> )?
// f5 -> <EOF>
public class CompilationUnit implements Node {
   // This was added after running jtb to remove serializable warning.
   static final long serialVersionUID = 20150406L;

   private Node parent;
   public NodeOptional f0;
   public NodeListOptional f1;
   public NodeListOptional f2;
   public NodeOptional f3;
   public NodeOptional f4;
   public NodeToken f5;

   public CompilationUnit(NodeOptional n0, NodeListOptional n1, NodeListOptional n2, NodeOptional n3, NodeOptional n4, NodeToken n5) {
      f0 = n0;
      if ( f0 != null ) f0.setParent(this);
      f1 = n1;
      if ( f1 != null ) f1.setParent(this);
      f2 = n2;
      if ( f2 != null ) f2.setParent(this);
      f3 = n3;
      if ( f3 != null ) f3.setParent(this);
      f4 = n4;
      if ( f4 != null ) f4.setParent(this);
      f5 = n5;
      if ( f5 != null ) f5.setParent(this);
   }

   public CompilationUnit(NodeOptional n0, NodeListOptional n1, NodeListOptional n2, NodeOptional n3, NodeOptional n4) {
      f0 = n0;
      if ( f0 != null ) f0.setParent(this);
      f1 = n1;
      if ( f1 != null ) f1.setParent(this);
      f2 = n2;
      if ( f2 != null ) f2.setParent(this);
      f3 = n3;
      if ( f3 != null ) f3.setParent(this);
      f4 = n4;
      if ( f4 != null ) f4.setParent(this);
      f5 = new NodeToken("");
      if ( f5 != null ) f5.setParent(this);
   }

   public void accept(jtb.visitor.Visitor v) {
      v.visit(this);
   }
   public <R,A> R accept(jtb.visitor.GJVisitor<R,A> v, A argu) {
      return v.visit(this,argu);
   }
   public <R> R accept(jtb.visitor.GJNoArguVisitor<R> v) {
      return v.visit(this);
   }
   public <A> void accept(jtb.visitor.GJVoidVisitor<A> v, A argu) {
      v.visit(this,argu);
   }
   public void setParent(Node n) { parent = n; }
   public Node getParent()       { return parent; }
}

