001// 002// Generated by JTB 1.3.2 003// 004 005package jtb.syntaxtree; 006 007// Represents a grammar choice, e.g. ( A | B ) 008public class NodeChoice implements Node { 009 // This was added after running jtb to remove serializable warning. 010 static final long serialVersionUID = 20150406L; 011 012 public NodeChoice(Node node) { 013 this(node, -1); 014 } 015 016 public NodeChoice(Node node, int whichChoice) { 017 choice = node; 018 choice.setParent(this); 019 which = whichChoice; 020 } 021 022 public void accept(jtb.visitor.Visitor v) { 023 v.visit(this); 024 } 025 public <R,A> R accept(jtb.visitor.GJVisitor<R,A> v, A argu) { 026 return choice.accept(v,argu); 027 } 028 public <R> R accept(jtb.visitor.GJNoArguVisitor<R> v) { 029 return choice.accept(v); 030 } 031 public <A> void accept(jtb.visitor.GJVoidVisitor<A> v, A argu) { 032 choice.accept(v,argu); 033 } 034 035 public void setParent(Node n) { parent = n; } 036 public Node getParent() { return parent; } 037 038 private Node parent; 039 public Node choice; 040 public int which; 041} 042