Added ability to order the execution of dictionary adapter behaviors.
[castle.git] / Experiments / Attic / Rook / Castle.Rook.Compiler / Parser / antlr / TokenWithIndex.cs
blob7aa4c1a0ef6ef8828f35f7a49efa1a2da82cf52d
1 namespace antlr
3 /* ANTLR Translator Generator
4 * Project led by Terence Parr at http://www.jGuru.com
5 * Software rights: http://www.antlr.org/license.html
6 */
8 //
9 // ANTLR C# Code Generator by Micheal Jordan
10 // Kunle Odutola : kunle UNDERSCORE odutola AT hotmail DOT com
11 // Anthony Oguntimehin
14 using System;
16 /// <summary>
17 /// This token tracks it's own index 0..n-1 relative to the beginning
18 /// of the stream. It is designed to work with
19 /// <see cref="TokenStreamRewriteEngine"/> in TokenStreamRewriteEngine.cs
20 /// </summary>
21 public class TokenWithIndex : CommonToken
23 /// <summary>
24 /// Index into token array indicating position in input stream
25 /// </summary>
26 int index;
28 public TokenWithIndex() : base()
32 public TokenWithIndex(int i, string t) : base(i, t)
36 public void setIndex(int i)
38 index = i;
41 public int getIndex()
43 return index;
46 public override string ToString()
48 return "["+index+":\"" + getText() + "\",<" + Type + ">,line=" + line + ",col=" + col + "]\n";