Debian Codegraph @

Source/Parser/FunctionalJAVACC/Token.cpp

raw
1 /* Generated By:JavaCC: Do not edit this line. Token.cc Version 6.0 */
2 /* JavaCCOptions:STATIC=true,SUPPORT_CLASS_VISIBILITY_PUBLIC=true,TOKEN_INCLUDES=CTokenBase.h,TOKEN_EXTENDS=CTokenBase */
3 #include "Token.h"
4
5 namespace Konclude {
6 namespace Parser {
7 namespace FunctionalJAVACC {
8
9 /**
10 * Describes the input token stream.
11 */
12
13 /**
14 * An optional attribute value of the Token.
15 * Tokens which are not used as syntactic sugar will often contain
16 * meaningful values that will be used later on by the compiler or
17 * interpreter. This attribute value is often different from the image.
18 * Any subclass of Token that actually wants to return a non-NULL value can
19 * override this method as appropriate.
20 */
21 void * Token::getValue() {
22 return NULL;
23 }
24
25 /**
26 * No-argument constructor
27 */
28 Token::Token() {
29 this->next = NULL;
30 this->specialToken = NULL;
31 }
32
33 /**
34 * Constructs a new token for the specified Image.
35 */
36 Token::Token(int kind)
37 {
38 this->kind = kind;
39 this->next = NULL;
40 this->specialToken = NULL;
41 }
42
43 /**
44 * Constructs a new token for the specified Image and Kind.
45 */
46 Token::Token(int kind, JAVACC_STRING_TYPE image)
47 {
48 this->kind = kind;
49 this->image = image;
50 this->next = NULL;
51 this->specialToken = NULL;
52 }
53
54 /**
55 * Returns the image.
56 */
57 JAVACC_STRING_TYPE Token::toString()
58 {
59 return image;
60 }
61
62 /**
63 * Returns a new Token object, by default. However, if you want, you
64 * can create and return subclass objects based on the value of ofKind.
65 * Simply add the cases to the switch for all those special cases.
66 * For example, if you have a subclass of Token called IDToken that
67 * you want to create if ofKind is ID, simply add something like :
68 *
69 * case MyParserConstants.ID : return new IDToken(ofKind, image);
70 *
71 * to the following switch statement. Then you can cast matchedToken
72 * variable to the appropriate type and use sit in your lexical actions.
73 */
74 Token *Token::newToken(int ofKind, JAVACC_STRING_TYPE image)
75 {
76 switch(ofKind)
77 {
78 default : return new Token(ofKind, image);
79 }
80 }
81
82 Token *Token::newToken(int ofKind)
83 {
84 return newToken(ofKind, JAVACC_STRING_TYPE((JAVACC_CHAR_TYPE*)""));
85 }
86
87 Token::~Token() {
88 if (specialToken) delete specialToken;
89 }
90
91 }
92 }
93 }
94 /* JavaCC - OriginalChecksum=d964ca3869acc778134ca8a3306f6958 (do not edit this line) */