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 public class CommonToken
: Token
22 public static readonly CommonToken
.CommonTokenCreator Creator
= new CommonTokenCreator();
24 // most tokens will want line and text information
25 protected internal int line
;
26 protected internal string text
= null;
27 protected internal int col
;
33 public CommonToken(int t
, string txt
)
39 public CommonToken(string s
)
44 override public int getLine()
49 override public string getText()
54 override public void setLine(int l
)
59 override public void setText(string s
)
64 override public string ToString()
66 return "[\"" + getText() + "\",<" + type_
+ ">,line=" + line
+ ",col=" + col
+ "]";
69 /*Return token's start column */
70 override public int getColumn()
75 override public void setColumn(int c
)
80 public class CommonTokenCreator
: TokenCreator
82 public CommonTokenCreator() {}
85 /// Returns the fully qualified name of the Token type that this
88 public override string TokenTypeName
92 return typeof(antlr
.CommonToken
).FullName
;;
97 /// Constructs a <see cref="Token"/> instance.
99 public override IToken
Create()
101 return new CommonToken();