#include <antlr3.h>
ANTLR3_API pANTLR3_COMMON_TOKEN antlr3CommonTokenNew | ( | ANTLR3_UINT32 | ttype | ) |
References newToken(), and ANTLR3_COMMON_TOKEN_struct::setType.
Referenced by antlr3CommonTreeNodeStreamNew(), newDownNode(), and newUpNode().
ANTLR3_API void antlr3SetTokenAPI | ( | pANTLR3_COMMON_TOKEN | token | ) |
References ANTLR3_COMMON_TOKEN_struct::channel, ANTLR3_COMMON_TOKEN_struct::custom, ANTLR3_COMMON_TOKEN_struct::freeCustom, ANTLR3_COMMON_TOKEN_struct::getChannel, ANTLR3_COMMON_TOKEN_struct::getCharPositionInLine, ANTLR3_COMMON_TOKEN_struct::getLine, ANTLR3_COMMON_TOKEN_struct::getStartIndex, ANTLR3_COMMON_TOKEN_struct::getStopIndex, ANTLR3_COMMON_TOKEN_struct::getText, ANTLR3_COMMON_TOKEN_struct::getTokenIndex, ANTLR3_COMMON_TOKEN_struct::getType, ANTLR3_COMMON_TOKEN_struct::index, ANTLR3_COMMON_TOKEN_struct::input, ANTLR3_COMMON_TOKEN_struct::line, ANTLR3_COMMON_TOKEN_struct::setChannel, ANTLR3_COMMON_TOKEN_struct::setCharPositionInLine, ANTLR3_COMMON_TOKEN_struct::setLine, ANTLR3_COMMON_TOKEN_struct::setStartIndex, ANTLR3_COMMON_TOKEN_struct::setStopIndex, ANTLR3_COMMON_TOKEN_struct::setText, ANTLR3_COMMON_TOKEN_struct::setText8, ANTLR3_COMMON_TOKEN_struct::setTokenIndex, ANTLR3_COMMON_TOKEN_struct::setType, ANTLR3_COMMON_TOKEN_struct::start, ANTLR3_COMMON_TOKEN_struct::stop, ANTLR3_COMMON_TOKEN_struct::textState, ANTLR3_COMMON_TOKEN_struct::toString, ANTLR3_COMMON_TOKEN_struct::type, ANTLR3_COMMON_TOKEN_struct::user1, ANTLR3_COMMON_TOKEN_struct::user2, and ANTLR3_COMMON_TOKEN_struct::user3.
Referenced by antlr3LexerNew(), antlr3TokenFactoryNew(), newPoolToken(), and newToken().
ANTLR3_API pANTLR3_TOKEN_FACTORY antlr3TokenFactoryNew | ( | pANTLR3_INPUT_STREAM | input | ) |
References ANTLR3_MALLOC, antlr3SetTokenAPI(), ANTLR3_TOKEN_FACTORY_struct::close, ANTLR3_COMMON_TOKEN_struct::factoryMade, newPool(), ANTLR3_TOKEN_FACTORY_struct::newToken, ANTLR3_TOKEN_FACTORY_struct::pools, setInputStream(), ANTLR3_TOKEN_FACTORY_struct::setInputStream, ANTLR3_TOKEN_FACTORY_struct::thisPool, and ANTLR3_TOKEN_FACTORY_struct::unTruc.
Referenced by ANTLR3_TREE_ADAPTORNew(), getMissingSymbol(), and setCharStream().
static void factoryClose | ( | pANTLR3_TOKEN_FACTORY | factory | ) | [static] |
static ANTLR3_UINT32 getChannel | ( | pANTLR3_COMMON_TOKEN | token | ) | [static] |
References ANTLR3_COMMON_TOKEN_struct::channel.
static ANTLR3_INT32 getCharPositionInLine | ( | pANTLR3_COMMON_TOKEN | token | ) | [static] |
References ANTLR3_COMMON_TOKEN_struct::charPosition.
static ANTLR3_UINT32 getLine | ( | pANTLR3_COMMON_TOKEN | token | ) | [static] |
References ANTLR3_COMMON_TOKEN_struct::line.
static ANTLR3_MARKER getStartIndex | ( | pANTLR3_COMMON_TOKEN | token | ) | [static] |
static ANTLR3_MARKER getStopIndex | ( | pANTLR3_COMMON_TOKEN | token | ) | [static] |
References ANTLR3_COMMON_TOKEN_struct::stop.
static pANTLR3_STRING getText | ( | pANTLR3_COMMON_TOKEN | token | ) | [static] |
Contains the default implementation of the common token used within java.
Custom tokens should create this structure and then append to it using the custom pointer to install their own structure and API.
References ANTLR3_TEXT_CHARP, ANTLR3_TEXT_STRING, ANTLR3_TOKEN_EOF, ANTLR3_COMMON_TOKEN_struct::chars, ANTLR3_COMMON_TOKEN_struct::getStartIndex, ANTLR3_COMMON_TOKEN_struct::getStopIndex, ANTLR3_COMMON_TOKEN_struct::input, ANTLR3_STRING_FACTORY_struct::newStr8, ANTLR3_COMMON_TOKEN_struct::strFactory, ANTLR3_INPUT_STREAM_struct::substr, ANTLR3_COMMON_TOKEN_struct::text, ANTLR3_COMMON_TOKEN_struct::textState, ANTLR3_COMMON_TOKEN_struct::tokText, and ANTLR3_COMMON_TOKEN_struct::type.
static ANTLR3_MARKER getTokenIndex | ( | pANTLR3_COMMON_TOKEN | token | ) | [static] |
References ANTLR3_COMMON_TOKEN_struct::index.
static ANTLR3_UINT32 getType | ( | pANTLR3_COMMON_TOKEN | token | ) | [static] |
References ANTLR3_COMMON_TOKEN_struct::type.
static void newPool | ( | pANTLR3_TOKEN_FACTORY | factory | ) | [static] |
References ANTLR3_FACTORY_POOL_SIZE, ANTLR3_MALLOC, ANTLR3_REALLOC, ANTLR3_TOKEN_FACTORY_struct::nextToken, ANTLR3_TOKEN_FACTORY_struct::pools, and ANTLR3_TOKEN_FACTORY_struct::thisPool.
Referenced by antlr3TokenFactoryNew(), and newPoolToken().
static pANTLR3_COMMON_TOKEN newPoolToken | ( | pANTLR3_TOKEN_FACTORY | factory | ) | [static] |
References ANTLR3_FACTORY_POOL_SIZE, antlr3SetTokenAPI(), ANTLR3_COMMON_TOKEN_struct::factoryMade, ANTLR3_COMMON_TOKEN_struct::input, ANTLR3_TOKEN_FACTORY_struct::input, newPool(), ANTLR3_TOKEN_FACTORY_struct::nextToken, ANTLR3_TOKEN_FACTORY_struct::pools, ANTLR3_INPUT_STREAM_struct::strFactory, ANTLR3_COMMON_TOKEN_struct::strFactory, and ANTLR3_TOKEN_FACTORY_struct::thisPool.
static pANTLR3_COMMON_TOKEN newToken | ( | void | ) | [static] |
References ANTLR3_MALLOC, antlr3SetTokenAPI(), and ANTLR3_COMMON_TOKEN_struct::factoryMade.
Referenced by antlr3CommonTokenNew().
static void setChannel | ( | pANTLR3_COMMON_TOKEN | token, | |
ANTLR3_UINT32 | channel | |||
) | [static] |
References ANTLR3_COMMON_TOKEN_struct::channel.
static void setCharPositionInLine | ( | pANTLR3_COMMON_TOKEN | token, | |
ANTLR3_INT32 | pos | |||
) | [static] |
References ANTLR3_COMMON_TOKEN_struct::charPosition.
static void setInputStream | ( | pANTLR3_TOKEN_FACTORY | factory, | |
pANTLR3_INPUT_STREAM | input | |||
) | [static] |
References ANTLR3_COMMON_TOKEN_struct::input, ANTLR3_TOKEN_FACTORY_struct::input, ANTLR3_INPUT_STREAM_struct::strFactory, ANTLR3_COMMON_TOKEN_struct::strFactory, and ANTLR3_TOKEN_FACTORY_struct::unTruc.
Referenced by antlr3TokenFactoryNew().
static void setLine | ( | pANTLR3_COMMON_TOKEN | token, | |
ANTLR3_UINT32 | line | |||
) | [static] |
References ANTLR3_COMMON_TOKEN_struct::line.
static void setStartIndex | ( | pANTLR3_COMMON_TOKEN | token, | |
ANTLR3_MARKER | index | |||
) | [static] |
References ANTLR3_COMMON_TOKEN_struct::start.
static void setStopIndex | ( | pANTLR3_COMMON_TOKEN | token, | |
ANTLR3_MARKER | index | |||
) | [static] |
References ANTLR3_COMMON_TOKEN_struct::stop.
static void setText | ( | pANTLR3_COMMON_TOKEN | token, | |
pANTLR3_STRING | text | |||
) | [static] |
Install the supplied text string as teh text for the token.
The method assumes that the existing text (if any) was created by a factory and so does not attempt to release any memory it is using.Text not created by a string fctory (not advised) should be released prior to this call.
References ANTLR3_COMMON_TOKEN_struct::text, ANTLR3_COMMON_TOKEN_struct::textState, and ANTLR3_COMMON_TOKEN_struct::tokText.
static void setText8 | ( | pANTLR3_COMMON_TOKEN | token, | |
pANTLR3_UINT8 | text | |||
) | [static] |
static void setTokenIndex | ( | pANTLR3_COMMON_TOKEN | token, | |
ANTLR3_MARKER | index | |||
) | [static] |
References ANTLR3_COMMON_TOKEN_struct::index.
static void setType | ( | pANTLR3_COMMON_TOKEN | token, | |
ANTLR3_UINT32 | type | |||
) | [static] |
References ANTLR3_COMMON_TOKEN_struct::type.
static pANTLR3_STRING toString | ( | pANTLR3_COMMON_TOKEN | token | ) | [static] |
References ANTLR3_STRING_struct::addc, ANTLR3_STRING_struct::addi, ANTLR3_STRING_struct::append8, ANTLR3_STRING_struct::appendS, ANTLR3_STRING_struct::factory, ANTLR3_COMMON_TOKEN_struct::getChannel, ANTLR3_COMMON_TOKEN_struct::getCharPositionInLine, ANTLR3_COMMON_TOKEN_struct::getLine, ANTLR3_COMMON_TOKEN_struct::getStartIndex, ANTLR3_COMMON_TOKEN_struct::getStopIndex, ANTLR3_COMMON_TOKEN_struct::getText, ANTLR3_COMMON_TOKEN_struct::getTokenIndex, ANTLR3_STRING_FACTORY_struct::newRaw, and ANTLR3_COMMON_TOKEN_struct::type.