1 package persistence.antlr; 2 3 8 9 import persistence.antlr.collections.AST; 10 11 12 public class CommonAST extends BaseAST { 13 int ttype = Token.INVALID_TYPE; 14 String text; 15 16 17 18 public String getText() { 19 return text; 20 } 21 22 23 public int getType() { 24 return ttype; 25 } 26 27 public void initialize(int t, String txt) { 28 setType(t); 29 setText(txt); 30 } 31 32 public void initialize(AST t) { 33 setText(t.getText()); 34 setType(t.getType()); 35 } 36 37 public CommonAST() { 38 } 39 40 public CommonAST(Token tok) { 41 initialize(tok); 42 } 43 44 public void initialize(Token tok) { 45 setText(tok.getText()); 46 setType(tok.getType()); 47 } 48 49 50 public void setText(String text_) { 51 text = text_; 52 } 53 54 55 public void setType(int ttype_) { 56 ttype = ttype_; 57 } 58 } 59 | Popular Tags |