ANTLR3C 3.3.1
antlr3commontoken.c File Reference
#include <antlr3.h>
Include dependency graph for antlr3commontoken.c:

Functions

ANTLR3_API pANTLR3_COMMON_TOKEN antlr3CommonTokenNew (ANTLR3_UINT32 ttype)
ANTLR3_API void antlr3SetTokenAPI (pANTLR3_COMMON_TOKEN token)
ANTLR3_API pANTLR3_TOKEN_FACTORY antlr3TokenFactoryNew (pANTLR3_INPUT_STREAM input)
static void factoryClose (pANTLR3_TOKEN_FACTORY factory)
static void factoryReset (pANTLR3_TOKEN_FACTORY factory)
static ANTLR3_UINT32 getChannel (pANTLR3_COMMON_TOKEN token)
static ANTLR3_INT32 getCharPositionInLine (pANTLR3_COMMON_TOKEN token)
static ANTLR3_UINT32 getLine (pANTLR3_COMMON_TOKEN token)
static ANTLR3_MARKER getStartIndex (pANTLR3_COMMON_TOKEN token)
static ANTLR3_MARKER getStopIndex (pANTLR3_COMMON_TOKEN token)
static pANTLR3_STRING getText (pANTLR3_COMMON_TOKEN token)
 Contains the default implementation of the common token used within java.
static ANTLR3_MARKER getTokenIndex (pANTLR3_COMMON_TOKEN token)
static ANTLR3_UINT32 getType (pANTLR3_COMMON_TOKEN token)
static ANTLR3_BOOLEAN newPool (pANTLR3_TOKEN_FACTORY factory)
static pANTLR3_COMMON_TOKEN newPoolToken (pANTLR3_TOKEN_FACTORY factory)
static pANTLR3_COMMON_TOKEN newToken (void)
static void setChannel (pANTLR3_COMMON_TOKEN token, ANTLR3_UINT32 channel)
static void setCharPositionInLine (pANTLR3_COMMON_TOKEN token, ANTLR3_INT32 pos)
static void setInputStream (pANTLR3_TOKEN_FACTORY factory, pANTLR3_INPUT_STREAM input)
static void setLine (pANTLR3_COMMON_TOKEN token, ANTLR3_UINT32 line)
static void setStartIndex (pANTLR3_COMMON_TOKEN token, ANTLR3_MARKER index)
static void setStopIndex (pANTLR3_COMMON_TOKEN token, ANTLR3_MARKER index)
static void setText (pANTLR3_COMMON_TOKEN token, pANTLR3_STRING text)
 Install the supplied text string as teh text for the token.
static void setText8 (pANTLR3_COMMON_TOKEN token, pANTLR3_UINT8 text)
static void setTokenIndex (pANTLR3_COMMON_TOKEN token, ANTLR3_MARKER)
static void setType (pANTLR3_COMMON_TOKEN token, ANTLR3_UINT32 type)
static pANTLR3_STRING toString (pANTLR3_COMMON_TOKEN token)

Function Documentation

◆ antlr3CommonTokenNew()

ANTLR3_API pANTLR3_COMMON_TOKEN antlr3CommonTokenNew ( ANTLR3_UINT32 ttype)

References antlr3CommonTokenNew(), newToken(), and ANTLR3_COMMON_TOKEN_struct::setType.

Referenced by antlr3CommonTokenNew(), antlr3CommonTreeNodeStreamNew(), newDownNode(), and newUpNode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ antlr3SetTokenAPI()

◆ antlr3TokenFactoryNew()

◆ factoryClose()

◆ factoryReset()

void factoryReset ( pANTLR3_TOKEN_FACTORY factory)
static

References factoryReset(), newPool(), and ANTLR3_TOKEN_FACTORY_struct::thisPool.

Referenced by antlr3TokenFactoryNew(), and factoryReset().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getChannel()

ANTLR3_UINT32 getChannel ( pANTLR3_COMMON_TOKEN token)
static

References ANTLR3_COMMON_TOKEN_struct::channel, and getChannel().

Referenced by antlr3SetTokenAPI(), and getChannel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCharPositionInLine()

ANTLR3_INT32 getCharPositionInLine ( pANTLR3_COMMON_TOKEN token)
static

References ANTLR3_COMMON_TOKEN_struct::charPosition.

Referenced by antlr3SetTokenAPI().

Here is the caller graph for this function:

◆ getLine()

ANTLR3_UINT32 getLine ( pANTLR3_COMMON_TOKEN token)
static

References ANTLR3_COMMON_TOKEN_struct::line.

Referenced by antlr3SetTokenAPI().

Here is the caller graph for this function:

◆ getStartIndex()

ANTLR3_MARKER getStartIndex ( pANTLR3_COMMON_TOKEN token)
static

References ANTLR3_INPUT_STREAM_struct::data, getStartIndex(), ANTLR3_COMMON_TOKEN_struct::input, and ANTLR3_COMMON_TOKEN_struct::start.

Referenced by antlr3SetTokenAPI(), and getStartIndex().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getStopIndex()

ANTLR3_MARKER getStopIndex ( pANTLR3_COMMON_TOKEN token)
static

References getStopIndex(), and ANTLR3_COMMON_TOKEN_struct::stop.

Referenced by antlr3SetTokenAPI(), and getStopIndex().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getText()

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::getStartIndex, ANTLR3_COMMON_TOKEN_struct::getStopIndex, getText(), ANTLR3_COMMON_TOKEN_struct::input, ANTLR3_STRING_FACTORY_struct::newStr8, ANTLR3_COMMON_TOKEN_struct::strFactory, ANTLR3_INPUT_STREAM_struct::substr, ANTLR3_COMMON_TOKEN_struct::textState, ANTLR3_COMMON_TOKEN_struct::tokText, and ANTLR3_COMMON_TOKEN_struct::type.

Here is the call graph for this function:

◆ getTokenIndex()

ANTLR3_MARKER getTokenIndex ( pANTLR3_COMMON_TOKEN token)
static

References getTokenIndex(), and ANTLR3_COMMON_TOKEN_struct::index.

Referenced by antlr3SetTokenAPI(), and getTokenIndex().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getType()

ANTLR3_UINT32 getType ( pANTLR3_COMMON_TOKEN token)
static

References getType(), and ANTLR3_COMMON_TOKEN_struct::type.

Here is the call graph for this function:

◆ newPool()

◆ newPoolToken()

◆ newToken()

pANTLR3_COMMON_TOKEN newToken ( void )
static

References ANTLR3_FALSE, antlr3SetTokenAPI(), ANTLR3_COMMON_TOKEN_struct::factoryMade, and newToken().

Referenced by antlr3CommonTokenNew(), createToken(), createTokenFromToken(), and newToken().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setChannel()

void setChannel ( pANTLR3_COMMON_TOKEN token,
ANTLR3_UINT32 channel )
static

References ANTLR3_COMMON_TOKEN_struct::channel, and setChannel().

Referenced by antlr3SetTokenAPI(), and setChannel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setCharPositionInLine()

void setCharPositionInLine ( pANTLR3_COMMON_TOKEN token,
ANTLR3_INT32 pos )
static

References ANTLR3_COMMON_TOKEN_struct::charPosition, and setCharPositionInLine().

Referenced by antlr3SetTokenAPI(), and setCharPositionInLine().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setInputStream()

void setInputStream ( pANTLR3_TOKEN_FACTORY factory,
pANTLR3_INPUT_STREAM input )
static

◆ setLine()

void setLine ( pANTLR3_COMMON_TOKEN token,
ANTLR3_UINT32 line )
static

References ANTLR3_COMMON_TOKEN_struct::line, and setLine().

Referenced by antlr3SetTokenAPI(), and setLine().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setStartIndex()

void setStartIndex ( pANTLR3_COMMON_TOKEN token,
ANTLR3_MARKER index )
static

References setStartIndex(), and ANTLR3_COMMON_TOKEN_struct::start.

Referenced by antlr3SetTokenAPI(), and setStartIndex().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setStopIndex()

void setStopIndex ( pANTLR3_COMMON_TOKEN token,
ANTLR3_MARKER index )
static

References setStopIndex(), and ANTLR3_COMMON_TOKEN_struct::stop.

Referenced by antlr3SetTokenAPI(), and setStopIndex().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setText()

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_TEXT_STRING, setText(), ANTLR3_COMMON_TOKEN_struct::textState, and ANTLR3_COMMON_TOKEN_struct::tokText.

Here is the call graph for this function:

◆ setText8()

void setText8 ( pANTLR3_COMMON_TOKEN token,
pANTLR3_UINT8 text )
static

◆ setTokenIndex()

void setTokenIndex ( pANTLR3_COMMON_TOKEN token,
ANTLR3_MARKER index )
static

References ANTLR3_COMMON_TOKEN_struct::index, and setTokenIndex().

Referenced by antlr3SetTokenAPI(), and setTokenIndex().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setType()

void setType ( pANTLR3_COMMON_TOKEN token,
ANTLR3_UINT32 type )
static

References setType(), and ANTLR3_COMMON_TOKEN_struct::type.

Here is the call graph for this function:

◆ toString()