1 /* Generated By:JavaCC: Do not edit this line. Token.cc Version 6.0 */
2 /* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true,TOKEN_INCLUDES=,TOKEN_EXTENDS= */
9 * Describes the input token stream.
13 * An optional attribute value of the Token.
14 * Tokens which are not used as syntactic sugar will often contain
15 * meaningful values that will be used later on by the compiler or
16 * interpreter. This attribute value is often different from the image.
17 * Any subclass of Token that actually wants to return a non-NULL value can
18 * override this method as appropriate.
20 void * Token::getValue() {
25 * No-argument constructor
29 this->specialToken = NULL;
33 * Constructs a new token for the specified Image.
35 Token::Token(int kind)
39 this->specialToken = NULL;
43 * Constructs a new token for the specified Image and Kind.
45 Token::Token(int kind, JAVACC_STRING_TYPE image)
50 this->specialToken = NULL;
56 JAVACC_STRING_TYPE Token::toString()
62 * Returns a new Token object, by default. However, if you want, you
63 * can create and return subclass objects based on the value of ofKind.
64 * Simply add the cases to the switch for all those special cases.
65 * For example, if you have a subclass of Token called IDToken that
66 * you want to create if ofKind is ID, simply add something like :
68 * case MyParserConstants.ID : return new IDToken(ofKind, image);
70 * to the following switch statement. Then you can cast matchedToken
71 * variable to the appropriate type and use sit in your lexical actions.
73 Token *Token::newToken(int ofKind, JAVACC_STRING_TYPE image)
77 default : return new Token(ofKind, image);
81 Token *Token::newToken(int ofKind)
83 return newToken(ofKind, JAVACC_STRING_TYPE((JAVACC_CHAR_TYPE*)""));
87 if (specialToken) delete specialToken;
92 /* JavaCC - OriginalChecksum=9db9ca693072c4c37bb7cc933c0c5e35 (do not edit this line) */