src/antlr3commontoken.c(3)

πŸ“¦ version 3.4, in fedora 43

src/antlr3commontoken.c πŸ’–

okay so bestie, this is the ANTLR3C manual page for src/antlr3commontoken.c, section 3. it's giving token factory realness and we are obsessed. no cap, every detail is about to be served.


✨ NAME ✨

src/antlr3commontoken.c


🌸 SYNOPSIS 🌸

#include <antlr3.h>

πŸŽ€ Functions πŸŽ€

here's the entire function lineup, literally every single one:

  • 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)

that's all 27, periodt.


πŸ“š Function Documentation πŸ“š

✨ 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::getChannel, getChannel(), ANTLR3_COMMON_TOKEN_struct::getCharPositionInLine, getCharPositionInLine(), ANTLR3_COMMON_TOKEN_struct::getLine, getLine(), ANTLR3_COMMON_TOKEN_struct::getStartIndex, getStartIndex(), ANTLR3_COMMON_TOKEN_struct::getStopIndex, getStopIndex(), ANTLR3_COMMON_TOKEN_struct::getText, getText(), ANTLR3_COMMON_TOKEN_struct::getTokenIndex, getTokenIndex(), ANTLR3_COMMON_TOKEN_struct::getType, getType(), ANTLR3_COMMON_TOKEN_struct::setChannel, setChannel(), ANTLR3_COMMON_TOKEN_struct::setCharPositionInLine, setCharPositionInLine(), ANTLR3_COMMON_TOKEN_struct::setLine, setLine(), ANTLR3_COMMON_TOKEN_struct::setStartIndex, setStartIndex(), ANTLR3_COMMON_TOKEN_struct::setStopIndex, setStopIndex(), ANTLR3_COMMON_TOKEN_struct::setText, setText(), ANTLR3_COMMON_TOKEN_struct::setText8, setText8(), ANTLR3_COMMON_TOKEN_struct::setTokenIndex, setTokenIndex(), ANTLR3_COMMON_TOKEN_struct::setType, setType(), ANTLR3_COMMON_TOKEN_struct::toString, and toString().
  • Referenced by: antlr3LexerNew(), antlr3TokenFactoryNew(), newPoolToken(), and newToken().

✨ ANTLR3_API pANTLR3_TOKEN_FACTORY antlr3TokenFactoryNew (pANTLR3_INPUT_STREAM input) ✨

  • References: ANTLR3_TRUE, antlr3SetTokenAPI(), ANTLR3_TOKEN_FACTORY_struct::close, factoryClose(), ANTLR3_COMMON_TOKEN_struct::factoryMade, factoryReset(), ANTLR3_TOKEN_FACTORY_struct::maxPool, newPool(), newPoolToken(), ANTLR3_TOKEN_FACTORY_struct::newToken, ANTLR3_TOKEN_FACTORY_struct::pools, ANTLR3_TOKEN_FACTORY_struct::reset, ANTLR3_TOKEN_FACTORY_struct::setInputStream, setInputStream(), ANTLR3_TOKEN_FACTORY_struct::thisPool, and ANTLR3_TOKEN_FACTORY_struct::unTruc.
  • Referenced by: ANTLR3_TREE_ADAPTORNew(), getMissingSymbol(), and setCharStream().

✨ void factoryClose (pANTLR3_TOKEN_FACTORY factory) [static] ✨

  • References: ANTLR3_FACTORY_POOL_SIZE, ANTLR3_COMMON_TOKEN_struct::custom, ANTLR3_COMMON_TOKEN_struct::freeCustom, ANTLR3_TOKEN_FACTORY_struct::nextToken, ANTLR3_TOKEN_FACTORY_struct::pools, and ANTLR3_TOKEN_FACTORY_struct::thisPool.
  • Referenced by: antlr3ArboretumNew(), and antlr3TokenFactoryNew().

✨ void factoryReset (pANTLR3_TOKEN_FACTORY factory) [static] ✨

  • References: newPool(), and ANTLR3_TOKEN_FACTORY_struct::thisPool.
  • Referenced by: antlr3TokenFactoryNew().

✨ ANTLR3_UINT32 getChannel (pANTLR3_COMMON_TOKEN token) [static] ✨

  • References: ANTLR3_COMMON_TOKEN_struct::channel.
  • Referenced by: antlr3SetTokenAPI().

✨ ANTLR3_INT32 getCharPositionInLine (pANTLR3_COMMON_TOKEN token) [static] ✨

  • References: ANTLR3_COMMON_TOKEN_struct::charPosition.

✨ ANTLR3_UINT32 getLine (pANTLR3_COMMON_TOKEN token) [static] ✨

  • References: ANTLR3_COMMON_TOKEN_struct::line.

✨ ANTLR3_MARKER getStartIndex (pANTLR3_COMMON_TOKEN token) [static] ✨

  • References: ANTLR3_INPUT_STREAM_struct::data, ANTLR3_COMMON_TOKEN_struct::input, and ANTLR3_COMMON_TOKEN_struct::start.
  • Referenced by: antlr3SetTokenAPI().

✨ ANTLR3_MARKER getStopIndex (pANTLR3_COMMON_TOKEN token) [static] ✨

  • References: ANTLR3_COMMON_TOKEN_struct::stop.
  • Referenced by: antlr3SetTokenAPI().

✨ 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_STRING_struct::factory, 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.

✨ ANTLR3_MARKER getTokenIndex (pANTLR3_COMMON_TOKEN token) [static] ✨

  • References: ANTLR3_COMMON_TOKEN_struct::index.
  • Referenced by: antlr3SetTokenAPI().

✨ ANTLR3_UINT32 getType (pANTLR3_COMMON_TOKEN token) [static] ✨

  • References: ANTLR3_COMMON_TOKEN_struct::type.

✨ ANTLR3_BOOLEAN newPool (pANTLR3_TOKEN_FACTORY factory) [static] ✨

  • References: ANTLR3_FACTORY_POOL_SIZE, ANTLR3_FALSE, ANTLR3_TRUE, ANTLR3_TOKEN_FACTORY_struct::maxPool, ANTLR3_TOKEN_FACTORY_struct::nextToken, ANTLR3_TOKEN_FACTORY_struct::pools, and ANTLR3_TOKEN_FACTORY_struct::thisPool.
  • Referenced by: antlr3TokenFactoryNew(), factoryReset(), and newPoolToken().

✨ pANTLR3_COMMON_TOKEN newPoolToken (pANTLR3_TOKEN_FACTORY factory) [static] ✨

  • References: ANTLR3_FACTORY_POOL_SIZE, ANTLR3_TRUE, 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_COMMON_TOKEN_struct::setStartIndex, ANTLR3_COMMON_TOKEN_struct::strFactory, ANTLR3_INPUT_STREAM_struct::strFactory, and ANTLR3_TOKEN_FACTORY_struct::thisPool.
  • Referenced by: antlr3TokenFactoryNew().

✨ pANTLR3_COMMON_TOKEN newToken (void ) [static] ✨

  • References: ANTLR3_FALSE, antlr3SetTokenAPI(), and ANTLR3_COMMON_TOKEN_struct::factoryMade.
  • Referenced by: antlr3CommonTokenNew(), createToken(), and createTokenFromToken().

✨ void setChannel (pANTLR3_COMMON_TOKEN token, ANTLR3_UINT32 channel) [static] ✨

  • References: ANTLR3_COMMON_TOKEN_struct::channel.
  • Referenced by: antlr3SetTokenAPI().

✨ void setCharPositionInLine (pANTLR3_COMMON_TOKEN token, ANTLR3_INT32 pos) [static] ✨

  • References: ANTLR3_COMMON_TOKEN_struct::charPosition.
  • Referenced by: antlr3SetTokenAPI().

✨ void setInputStream (pANTLR3_TOKEN_FACTORY factory, pANTLR3_INPUT_STREAM input) [static] ✨

  • References: ANTLR3_COMMON_TOKEN_struct::input, ANTLR3_TOKEN_FACTORY_struct::input, ANTLR3_COMMON_TOKEN_struct::strFactory, ANTLR3_INPUT_STREAM_struct::strFactory, and ANTLR3_TOKEN_FACTORY_struct::unTruc.
  • Referenced by: antlr3TokenFactoryNew().

✨ void setLine (pANTLR3_COMMON_TOKEN token, ANTLR3_UINT32 line) [static] ✨

  • References: ANTLR3_COMMON_TOKEN_struct::line.
  • Referenced by: antlr3SetTokenAPI().

✨ void setStartIndex (pANTLR3_COMMON_TOKEN token, ANTLR3_MARKER index) [static] ✨

  • References: ANTLR3_COMMON_TOKEN_struct::start.
  • Referenced by: antlr3SetTokenAPI().

✨ void setStopIndex (pANTLR3_COMMON_TOKEN token, ANTLR3_MARKER index) [static] ✨

  • References: ANTLR3_COMMON_TOKEN_struct::stop.
  • Referenced by: antlr3SetTokenAPI().

✨ 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 factory (not advised) should be released prior to this call.

⚠️ bestie, if your text wasn't made by a string factory (and honestly, don't do that), you gotta release it before you call this. that's the rule.
  • References: ANTLR3_TEXT_STRING, ANTLR3_COMMON_TOKEN_struct::text, ANTLR3_COMMON_TOKEN_struct::textState, and ANTLR3_COMMON_TOKEN_struct::tokText.

✨ void setText8 (pANTLR3_COMMON_TOKEN token, pANTLR3_UINT8 text) [static] ✨

  • References: ANTLR3_TEXT_CHARP, ANTLR3_TEXT_NONE, ANTLR3_COMMON_TOKEN_struct::chars, ANTLR3_STRING_struct::set8, ANTLR3_COMMON_TOKEN_struct::text, ANTLR3_COMMON_TOKEN_struct::textState, and ANTLR3_COMMON_TOKEN_struct::tokText.

✨ void setTokenIndex (pANTLR3_COMMON_TOKEN token, ANTLR3_MARKER index) [static] ✨

  • References: ANTLR3_COMMON_TOKEN_struct::index.
  • Referenced by: antlr3SetTokenAPI().

✨ void setType (pANTLR3_COMMON_TOKEN token, ANTLR3_UINT32 type) [static] ✨

  • References: ANTLR3_COMMON_TOKEN_struct::type.

✨ pANTLR3_STRING toString (pANTLR3_COMMON_TOKEN token) [static] ✨

  • References: ANTLR3_STRING_struct::addc, ANTLR3_STRING_struct::addi, ANTLR3_TOKEN_DEFAULT_CHANNEL, 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.
  • Referenced by: antlr3CommonTokenStreamNew(), antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), antlr3SetCTAPI(), and antlr3SetTokenAPI().

✨ Author ✨

okay so plot twist bestie: nobody wrote this by hand. πŸ’€ This whole page was Generated automatically by Doxygen for ANTLR3C from the source code. Like, it literally pulled itself together from the actual source β€” no human sat down and typed it out, no cap. It's giving "the code documented itself" main character energy. 🫢

So if you spot something here that's a little quirky, blame the source code and the doc generator, not some tired dev at 3am. The docs are ✨sourced from the source✨, fr fr β€” which is actually iconic when you think about it. 🌸


and that's a wrap on the whole page, bestie!! πŸŽ€ you made it all the way to the bottom, which honestly? ate. πŸ’…

quick lil receipts for you, so you can cite this in your group chat:

  • Version β€” 3.3.1 πŸ‘‘
  • Dated β€” Tue Jul 29 2025 00:00:00 🌈
  • Source page β€” src/antlr3commontoken.c(3) πŸ¦‹

go forth and tokenize, queen. πŸ§šπŸ’–

πŸ“¦ where this page comes from