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