5 /*ANTLR Translator Generator
6 * Project led by Terence Parr at http://www.jGuru.com
7 * Software rights: http://www.antlr.org/license.html
13 // ANTLR C# Code Generator by Micheal Jordan
14 // Kunle Odutola : kunle UNDERSCORE odutola AT hotmail DOT com
15 // Anthony Oguntimehin
17 // With many thanks to Eric V. Smith from the ANTLR list.
20 /*A token is minimally a token type. Subclasses can add the text matched
21 * for the token and line info.
24 public class Token
: IToken
//, ICloneable
27 public const int MIN_USER_TYPE
= 4;
28 public const int NULL_TREE_LOOKAHEAD
= 3;
29 public const int INVALID_TYPE
= 0;
30 public const int EOF_TYPE
= 1;
31 public static readonly int SKIP
= - 1;
33 // each Token has at least a token type
36 // the illegal token object
37 public static Token badToken
= new Token(INVALID_TYPE
, "<no text>");
47 public Token(int t
, string txt
)
52 public virtual int getColumn()
56 public virtual int getLine()
60 public virtual string getFilename()
65 public virtual void setFilename(string name
)
69 public virtual string getText()
77 set { type_ = value; }
80 public virtual void setType(int newType
) { this.Type = newType; }
82 public virtual void setColumn(int c
)
86 public virtual void setLine(int l
)
90 public virtual void setText(string t
)
94 override public string ToString()
96 return "[\"" + getText() + "\",<" + type_
+ ">]";