TokenSymbol.java
上传用户:afrynkmhm
上传日期:2007-01-06
资源大小:1262k
文件大小:1k
源码类别:

编译器/解释器

开发平台:

Others

  1. package antlr;
  2. /* ANTLR Translator Generator
  3.  * Project led by Terence Parr at http://www.jGuru.com
  4.  * Software rights: http://www.antlr.org/RIGHTS.html
  5.  *
  6.  * $Id: //depot/code/org.antlr/release/antlr-2.7.0/antlr/TokenSymbol.java#1 $
  7.  */
  8. class TokenSymbol extends GrammarSymbol {
  9. protected int ttype;
  10. /** describes what token matches in "human terms" */
  11. protected String paraphrase = null;
  12. /** Set to a value in the tokens {...} section */
  13. protected String ASTNodeType;
  14. public TokenSymbol(String r) {
  15. super(r);
  16. ttype = Token.INVALID_TYPE;
  17. }
  18. public String getASTNodeType() {
  19. return ASTNodeType;
  20. }
  21. public void setASTNodeType(String type) {
  22. ASTNodeType = type;
  23. }
  24. public String getParaphrase() {return paraphrase;}
  25. public int getTokenType() {
  26. return ttype;
  27. }
  28. public void setParaphrase(String p) {paraphrase = p;}
  29. public void setTokenType(int t) {
  30. ttype = t;
  31. }
  32. }