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