2170377ef6619451bfe62f2428dc61ad06efbb13
[phpeclipse.git] / net.sourceforge.phpeclipse / src / test / Token.java
1 /* Generated By:JavaCC: Do not edit this line. Token.java Version 3.0 */
2 package test;
3
4 /**
5  * Describes the input token stream.
6  */
7
8 public class Token {
9
10   /**
11    * An integer that describes the kind of this token.  This numbering
12    * system is determined by JavaCCParser, and a table of these numbers is
13    * stored in the file ...Constants.java.
14    */
15   public int kind;
16
17   /**
18    * beginLine and beginColumn describe the position of the first character
19    * of this token; endLine and endColumn describe the position of the
20    * last character of this token.
21    */
22   public int beginLine, beginColumn, endLine, endColumn;
23
24   //Matthieu Casanova addition
25   public int sourceStart, sourceEnd;
26   /**
27    * The string image of the token.
28    */
29   public String image;
30
31   /**
32    * A reference to the next regular (non-special) token from the input
33    * stream.  If this is the last token from the input stream, or if the
34    * token manager has not read tokens beyond this one, this field is
35    * set to null.  This is true only if this token is also a regular
36    * token.  Otherwise, see below for a description of the contents of
37    * this field.
38    */
39   public Token next;
40
41   /**
42    * This field is used to access special tokens that occur prior to this
43    * token, but after the immediately preceding regular (non-special) token.
44    * If there are no such special tokens, this field is set to null.
45    * When there are more than one such special token, this field refers
46    * to the last of these special tokens, which in turn refers to the next
47    * previous special token through its specialToken field, and so on
48    * until the first special token (whose specialToken field is null).
49    * The next fields of special tokens refer to other special tokens that
50    * immediately follow it (without an intervening regular token).  If there
51    * is no such token, this field is null.
52    */
53   public Token specialToken;
54
55   /**
56    * Returns the image.
57    */
58   public String toString()
59   {
60      return image;
61   }
62
63   /**
64    * Returns a new Token object, by default. However, if you want, you
65    * can create and return subclass objects based on the value of ofKind.
66    * Simply add the cases to the switch for all those special cases.
67    * For example, if you have a subclass of Token called IDToken that
68    * you want to create if ofKind is ID, simlpy add something like :
69    *
70    *    case MyParserConstants.ID : return new IDToken();
71    *
72    * to the following switch statement. Then you can cast matchedToken
73    * variable to the appropriate type and use it in your lexical actions.
74    */
75   public static final Token newToken(int ofKind)
76   {
77      switch(ofKind)
78      {
79        default : return new Token();
80      }
81   }
82
83 }