Debian Codegraph @

Source/Parser/FunctionalJAVACC/Token.h

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