|
Packit |
1c1d7e |
/* Generated By:JavaCC: Do not edit this line. Token.h Version 6.0 */
|
|
Packit |
1c1d7e |
/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true,TOKEN_INCLUDES=,TOKEN_EXTENDS= */
|
|
Packit |
1c1d7e |
#ifndef TOKEN_H
|
|
Packit |
1c1d7e |
#define TOKEN_H
|
|
Packit |
1c1d7e |
#include "JavaCC.h"
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
namespace vhdl {
|
|
Packit |
1c1d7e |
namespace parser {
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
/**
|
|
Packit |
1c1d7e |
* Describes the input token stream.
|
|
Packit |
1c1d7e |
*/
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
class Token
|
|
Packit |
1c1d7e |
{
|
|
Packit |
1c1d7e |
public:
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
/**
|
|
Packit |
1c1d7e |
* An integer that describes the kind of this token. This numbering
|
|
Packit |
1c1d7e |
* system is determined by JavaCCParser, and a table of these numbers is
|
|
Packit |
1c1d7e |
* stored in the file ...Constants.java.
|
|
Packit |
1c1d7e |
*/
|
|
Packit |
1c1d7e |
int kind;
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
/** The line number of the first character of this Token. */
|
|
Packit |
1c1d7e |
int beginLine;
|
|
Packit |
1c1d7e |
/** The column number of the first character of this Token. */
|
|
Packit |
1c1d7e |
int beginColumn;
|
|
Packit |
1c1d7e |
/** The line number of the last character of this Token. */
|
|
Packit |
1c1d7e |
int endLine;
|
|
Packit |
1c1d7e |
/** The column number of the last character of this Token. */
|
|
Packit |
1c1d7e |
int endColumn;
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
/**
|
|
Packit |
1c1d7e |
* The string image of the token.
|
|
Packit |
1c1d7e |
*/
|
|
Packit |
1c1d7e |
JAVACC_STRING_TYPE image;
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
/**
|
|
Packit |
1c1d7e |
* A reference to the next regular (non-special) token from the input
|
|
Packit |
1c1d7e |
* stream. If this is the last token from the input stream, or if the
|
|
Packit |
1c1d7e |
* token manager has not read tokens beyond this one, this field is
|
|
Packit |
1c1d7e |
* set to NULL. This is true only if this token is also a regular
|
|
Packit |
1c1d7e |
* token. Otherwise, see below for a description of the contents of
|
|
Packit |
1c1d7e |
* this field.
|
|
Packit |
1c1d7e |
*/
|
|
Packit |
1c1d7e |
Token *next;
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
/**
|
|
Packit |
1c1d7e |
* This field is used to access special tokens that occur prior to this
|
|
Packit |
1c1d7e |
* token, but after the immediately preceding regular (non-special) token.
|
|
Packit |
1c1d7e |
* If there are no such special tokens, this field is set to NULL.
|
|
Packit |
1c1d7e |
* When there are more than one such special token, this field refers
|
|
Packit |
1c1d7e |
* to the last of these special tokens, which in turn refers to the next
|
|
Packit |
1c1d7e |
* previous special token through its specialToken field, and so on
|
|
Packit |
1c1d7e |
* until the first special token (whose specialToke_ field is NULL).
|
|
Packit |
1c1d7e |
* The next fields of special tokens refer to other special tokens that
|
|
Packit |
1c1d7e |
* immediately follow it (without an intervening regular token). If there
|
|
Packit |
1c1d7e |
* is no such token, this field is NULL.
|
|
Packit |
1c1d7e |
*/
|
|
Packit |
1c1d7e |
Token *specialToken;
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
/**
|
|
Packit |
1c1d7e |
* An optional attribute value of the Token.
|
|
Packit |
1c1d7e |
* Tokens which are not used as syntactic sugar will often contain
|
|
Packit |
1c1d7e |
* meaningful values that will be used later on by the compiler or
|
|
Packit |
1c1d7e |
* interpreter. This attribute value is often different from the image.
|
|
Packit |
1c1d7e |
* Any subclass of Token that actually wants to return a non-NULL value can
|
|
Packit |
1c1d7e |
* override this method as appropriate.
|
|
Packit |
1c1d7e |
*/
|
|
Packit |
1c1d7e |
void * getValue();
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
/**
|
|
Packit |
1c1d7e |
* No-argument constructor
|
|
Packit |
1c1d7e |
*/
|
|
Packit |
1c1d7e |
Token();
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
/**
|
|
Packit |
1c1d7e |
* Constructs a new token for the specified Image.
|
|
Packit |
1c1d7e |
*/
|
|
Packit |
1c1d7e |
Token(int kind);
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
/**
|
|
Packit |
1c1d7e |
* Constructs a new token for the specified Image and Kind.
|
|
Packit |
1c1d7e |
*/
|
|
Packit |
1c1d7e |
Token(int kind, JAVACC_STRING_TYPE image);
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
/**
|
|
Packit |
1c1d7e |
* Returns the image.
|
|
Packit |
1c1d7e |
*/
|
|
Packit |
1c1d7e |
JAVACC_STRING_TYPE toString();
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
public: virtual ~Token();
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
/**
|
|
Packit |
1c1d7e |
* Returns a new Token void *, by default. However, if you want, you
|
|
Packit |
1c1d7e |
* can create and return subclass objects based on the value of ofKind.
|
|
Packit |
1c1d7e |
* Simply add the cases to the switch for all those special cases.
|
|
Packit |
1c1d7e |
* For example, if you have a subclass of Token called IDToken that
|
|
Packit |
1c1d7e |
* you want to create if ofKind is ID, simply add something like :
|
|
Packit |
1c1d7e |
*
|
|
Packit |
1c1d7e |
* case MyParserConstants.ID : return new IDToken(ofKind, image);
|
|
Packit |
1c1d7e |
*
|
|
Packit |
1c1d7e |
* to the following switch statement. Then you can cast matchedToken
|
|
Packit |
1c1d7e |
* variable to the appropriate type and use sit in your lexical actions.
|
|
Packit |
1c1d7e |
*/
|
|
Packit |
1c1d7e |
static Token *newToken(int ofKind, JAVACC_STRING_TYPE image);
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
static Token *newToken(int ofKind);
|
|
Packit |
1c1d7e |
};
|
|
Packit |
1c1d7e |
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
}
|
|
Packit |
1c1d7e |
#endif
|
|
Packit |
1c1d7e |
/* JavaCC - OriginalChecksum=2f5eb1c937adc983dfa2008c4fe383a7 (do not edit this line) */
|