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