001// 002// Generated by JTB 1.3.2 003// 004 005package jtb.syntaxtree; 006 007// Grammar production: 008// f0 -> "do" 009// f1 -> Statement() 010// f2 -> "while" 011// f3 -> "(" 012// f4 -> Expression() 013// f5 -> ")" 014// f6 -> ";" 015public class DoStatement 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 Statement f1; 022 public NodeToken f2; 023 public NodeToken f3; 024 public Expression f4; 025 public NodeToken f5; 026 public NodeToken f6; 027 028 public DoStatement(NodeToken n0, Statement n1, NodeToken n2, NodeToken n3, Expression n4, NodeToken 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 DoStatement(Statement n0, Expression n1) { 046 f0 = new NodeToken("do"); 047 if ( f0 != null ) f0.setParent(this); 048 f1 = n0; 049 if ( f1 != null ) f1.setParent(this); 050 f2 = new NodeToken("while"); 051 if ( f2 != null ) f2.setParent(this); 052 f3 = new NodeToken("("); 053 if ( f3 != null ) f3.setParent(this); 054 f4 = n1; 055 if ( f4 != null ) f4.setParent(this); 056 f5 = new NodeToken(")"); 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