Added ability to order the execution of dictionary adapter behaviors.
[castle.git] / Experiments / Attic / Rook / Castle.Rook.Compiler / Parser / antlr / Token.cs
blobe71509d7d0af13b9e11717fd73d18a71ca72ce59
1 using System;
3 namespace antlr
5 /*ANTLR Translator Generator
6 * Project led by Terence Parr at http://www.jGuru.com
7 * Software rights: http://www.antlr.org/license.html
9 * $Id:$
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
26 // constants
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
34 protected int type_;
36 // the illegal token object
37 public static Token badToken = new Token(INVALID_TYPE, "<no text>");
39 public Token()
41 type_ = INVALID_TYPE;
43 public Token(int t)
45 type_ = t;
47 public Token(int t, string txt)
49 type_ = t;
50 setText(txt);
52 public virtual int getColumn()
54 return 0;
56 public virtual int getLine()
58 return 0;
60 public virtual string getFilename()
62 return null;
65 public virtual void setFilename(string name)
69 public virtual string getText()
71 return "<no text>";
74 public int Type
76 get { return type_; }
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_ + ">]";