1 package persistence.antlr; 2 3 8 9 16 abstract class GrammarElement { 17 public static final int AUTO_GEN_NONE = 1; 18 public static final int AUTO_GEN_CARET = 2; 19 public static final int AUTO_GEN_BANG = 3; 20 21 29 protected Grammar grammar; 30 protected int line; 31 protected int column; 32 33 public GrammarElement(Grammar g) { 34 grammar = g; 35 line = -1; 36 column = -1; 37 } 38 39 public GrammarElement(Grammar g, Token start) { 40 grammar = g; 41 line = start.getLine(); 42 column = start.getColumn(); 43 } 44 45 public void generate() { 46 } 47 48 public int getLine() { 49 return line; 50 } 51 52 public int getColumn() { 53 return column; 54 } 55 56 public Lookahead look(int k) { 57 return null; 58 } 59 60 public abstract String toString(); 61 } 62 | Popular Tags |