001//
002// Generated by JTB 1.3.2
003//
004
005package jtb.syntaxtree;
006
007// Grammar production:
008// f0 -> "switch"
009// f1 -> "("
010// f2 -> Expression()
011// f3 -> ")"
012// f4 -> "{"
013// f5 -> ( SwitchLabel() ( BlockStatement() )* )*
014// f6 -> "}"
015public class SwitchStatement implements Node {
016   // This was added after running jtb to remove serializable warning.
017   static final long serialVersionUID = 20150406L;
018
019   private Node parent;
020   public NodeToken f0;
021   public NodeToken f1;
022   public Expression f2;
023   public NodeToken f3;
024   public NodeToken f4;
025   public NodeListOptional f5;
026   public NodeToken f6;
027
028   public SwitchStatement(NodeToken n0, NodeToken n1, Expression n2, NodeToken n3, NodeToken n4, NodeListOptional n5, NodeToken n6) {
029      f0 = n0;
030      if ( f0 != null ) f0.setParent(this);
031      f1 = n1;
032      if ( f1 != null ) f1.setParent(this);
033      f2 = n2;
034      if ( f2 != null ) f2.setParent(this);
035      f3 = n3;
036      if ( f3 != null ) f3.setParent(this);
037      f4 = n4;
038      if ( f4 != null ) f4.setParent(this);
039      f5 = n5;
040      if ( f5 != null ) f5.setParent(this);
041      f6 = n6;
042      if ( f6 != null ) f6.setParent(this);
043   }
044
045   public SwitchStatement(Expression n0, NodeListOptional n1) {
046      f0 = new NodeToken("switch");
047      if ( f0 != null ) f0.setParent(this);
048      f1 = new NodeToken("(");
049      if ( f1 != null ) f1.setParent(this);
050      f2 = n0;
051      if ( f2 != null ) f2.setParent(this);
052      f3 = new NodeToken(")");
053      if ( f3 != null ) f3.setParent(this);
054      f4 = new NodeToken("{");
055      if ( f4 != null ) f4.setParent(this);
056      f5 = n1;
057      if ( f5 != null ) f5.setParent(this);
058      f6 = new NodeToken("}");
059      if ( f6 != null ) f6.setParent(this);
060   }
061
062   public void accept(jtb.visitor.Visitor v) {
063      v.visit(this);
064   }
065   public <R,A> R accept(jtb.visitor.GJVisitor<R,A> v, A argu) {
066      return v.visit(this,argu);
067   }
068   public <R> R accept(jtb.visitor.GJNoArguVisitor<R> v) {
069      return v.visit(this);
070   }
071   public <A> void accept(jtb.visitor.GJVoidVisitor<A> v, A argu) {
072      v.visit(this,argu);
073   }
074   public void setParent(Node n) { parent = n; }
075   public Node getParent()       { return parent; }
076}
077