Imported Upstream version 1.8.8
[platform/upstream/doxygen.git] / vhdlparser / Token.h
1 /* Generated By:JavaCC: Do not edit this line. Token.h Version 6.0 */
2 /* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true,TOKEN_INCLUDES=,TOKEN_EXTENDS= */
3 #ifndef TOKEN_H
4 #define TOKEN_H
5 #include "JavaCC.h"
6
7
8 namespace vhdl {
9 namespace parser {
10
11 /**
12  * Describes the input token stream.
13  */
14
15 class Token
16 {
17  public:
18
19   /**
20    * An integer that describes the kind of this token.  This numbering
21    * system is determined by JavaCCParser, and a table of these numbers is
22    * stored in the file ...Constants.java.
23    */
24   int kind;
25
26   /** The line number of the first character of this Token. */
27   int beginLine;
28   /** The column number of the first character of this Token. */
29   int beginColumn;
30   /** The line number of the last character of this Token. */
31   int endLine;
32   /** The column number of the last character of this Token. */
33   int endColumn;
34
35   /**
36    * The string image of the token.
37    */
38   JAVACC_STRING_TYPE image;
39
40   /**
41    * A reference to the next regular (non-special) token from the input
42    * stream.  If this is the last token from the input stream, or if the
43    * token manager has not read tokens beyond this one, this field is
44    * set to NULL.  This is true only if this token is also a regular
45    * token.  Otherwise, see below for a description of the contents of
46    * this field.
47    */
48   Token *next;
49
50   /**
51    * This field is used to access special tokens that occur prior to this
52    * token, but after the immediately preceding regular (non-special) token.
53    * If there are no such special tokens, this field is set to NULL.
54    * When there are more than one such special token, this field refers
55    * to the last of these special tokens, which in turn refers to the next
56    * previous special token through its specialToken field, and so on
57    * until the first special token (whose specialToke_ field is NULL).
58    * The next fields of special tokens refer to other special tokens that
59    * immediately follow it (without an intervening regular token).  If there
60    * is no such token, this field is NULL.
61    */
62   Token *specialToken;
63
64   /**
65    * An optional attribute value of the Token.
66    * Tokens which are not used as syntactic sugar will often contain
67    * meaningful values that will be used later on by the compiler or
68    * interpreter. This attribute value is often different from the image.
69    * Any subclass of Token that actually wants to return a non-NULL value can
70    * override this method as appropriate.
71    */
72   void * getValue();
73
74   /**
75    * No-argument constructor
76    */
77   Token();
78
79   /**
80    * Constructs a new token for the specified Image.
81    */
82   Token(int kind);
83
84   /**
85    * Constructs a new token for the specified Image and Kind.
86    */
87   Token(int kind, JAVACC_STRING_TYPE image);
88
89   /**
90    * Returns the image.
91    */
92   JAVACC_STRING_TYPE toString();
93
94   public: virtual ~Token();
95
96   /**
97    * Returns a new Token void *, by default. However, if you want, you
98    * can create and return subclass objects based on the value of ofKind.
99    * Simply add the cases to the switch for all those special cases.
100    * For example, if you have a subclass of Token called IDToken that
101    * you want to create if ofKind is ID, simply add something like :
102    *
103    *    case MyParserConstants.ID : return new IDToken(ofKind, image);
104    *
105    * to the following switch statement. Then you can cast matchedToken
106    * variable to the appropriate type and use sit in your lexical actions.
107    */
108   static Token *newToken(int ofKind, JAVACC_STRING_TYPE image);
109
110   static Token *newToken(int ofKind);
111 };
112
113 }
114 }
115 #endif
116 /* JavaCC - OriginalChecksum=2f5eb1c937adc983dfa2008c4fe383a7 (do not edit this line) */