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