1 package antlr; 2 3 9 10 import java.util.Hashtable ; 11 12 13 class Alternative { 14 AlternativeElement head; AlternativeElement tail; 18 protected SynPredBlock synPred; 20 protected String semPred; 22 protected ExceptionSpec exceptionSpec; 24 protected Lookahead[] cache; protected int lookaheadDepth; protected Token treeSpecifier = null; 35 private boolean doAutoGen; 37 38 39 public Alternative() { 40 } 41 42 public Alternative(AlternativeElement firstElement) { 43 addElement(firstElement); 44 } 45 46 public void addElement(AlternativeElement e) { 47 if (head == null) { 49 head = tail = e; 50 } 51 else { 52 tail.next = e; 53 tail = e; 54 } 55 } 56 57 public boolean atStart() { 58 return head == null; 59 } 60 61 public boolean getAutoGen() { 62 return doAutoGen && treeSpecifier == null; 64 } 65 66 public Token getTreeSpecifier() { 67 return treeSpecifier; 68 } 69 70 public void setAutoGen(boolean doAutoGen_) { 71 doAutoGen = doAutoGen_; 72 } 73 } 74 | Popular Tags |