ANTLR3_TOKEN_FACTORY_struct(3)

πŸ“¦ version 3.4, in fedora 43

πŸŽ€ NAME πŸŽ€

ANTLR3_TOKEN_FACTORY_struct β€” the ANTLR3 Token factory interface, bestie πŸ’– It makes a TON of tokens efficiently instead of creating and freeing a million little bits of memory one at a time.

Oh and btw, this page lives in the ANTLR3C manual, as page ANTLR3_TOKEN_FACTORY_struct(3). Iykyk 🫢


✨ SYNOPSIS ✨

#include <antlr3commontoken.h>

πŸ¦‹ Data Fields πŸ¦‹

  • void(* close )(struct ANTLR3_TOKEN_FACTORY_struct *factory) β€” Pointer to a function the destroys the factory. πŸ’€
  • pANTLR3_INPUT_STREAM input β€” Pointer to an input stream that is using this token factory (may be NULL) which will be assigned to the tokens automatically.
  • ANTLR3_INT32 maxPool β€” Maximum pool count we have available.
  • pANTLR3_COMMON_TOKEN(* newToken )(struct ANTLR3_TOKEN_FACTORY_struct *factory) β€” Pointer to a function that returns a new token.
  • ANTLR3_UINT32 nextToken β€” The next token to throw out from the pool, will cause a new pool allocation if this exceeds the available tokenCount.
  • pANTLR3_COMMON_TOKEN * pools β€” Pointers to the array of tokens that this factory has produced so far.
  • void(* reset )(struct ANTLR3_TOKEN_FACTORY_struct *factory) β€” Pointer to a function that resets the factory so you can reuse the pools it has laready allocated. ♻️
  • void(* setInputStream )(struct ANTLR3_TOKEN_FACTORY_struct *factory, pANTLR3_INPUT_STREAM input) β€” Pointer to a function that changes teh curent inptu stream so that new tokens are created with reference to their originating text.
  • ANTLR3_INT32 thisPool β€” Current pool tokens we are allocating from.
  • ANTLR3_COMMON_TOKEN unTruc β€” Trick to initialize tokens and their API quickly, we set up this token when the factory is created, then just copy the memory it uses into the new token.

πŸ’… Detailed Description πŸ’…

ANTLR3 Token factory interface to create lots of tokens efficiently rather than creating and freeing lots of little bits of memory. She's giving main character energy but like, for memory management. No cap. πŸ”₯


🌸 Field Documentation 🌸

void(* ANTLR3_TOKEN_FACTORY_struct::close) (struct ANTLR3_TOKEN_FACTORY_struct *factory)

Pointer to a function the destroys the factory.

Referenced by antlr3TokenFactoryNew(), ctaFree(), freeBR(), and freeLexer().

pANTLR3_INPUT_STREAM ANTLR3_TOKEN_FACTORY_struct::input

Pointer to an input stream that is using this token factory (may be NULL) which will be assigned to the tokens automatically.

Referenced by createToken(), newPoolToken(), and setInputStream().

ANTLR3_INT32 ANTLR3_TOKEN_FACTORY_struct::maxPool

Maximum pool count we have available.

Referenced by antlr3TokenFactoryNew(), and newPool().

pANTLR3_COMMON_TOKEN(* ANTLR3_TOKEN_FACTORY_struct::newToken) (struct ANTLR3_TOKEN_FACTORY_struct *factory)

Pointer to a function that returns a new token.

Referenced by antlr3TokenFactoryNew(), createToken(), createTokenFromToken(), emit(), and getMissingSymbol().

ANTLR3_UINT32 ANTLR3_TOKEN_FACTORY_struct::nextToken

The next token to throw out from the pool, will cause a new pool allocation if this exceeds the available tokenCount.

Referenced by factoryClose(), newPool(), and newPoolToken().

pANTLR3_COMMON_TOKEN* ANTLR3_TOKEN_FACTORY_struct::pools

Pointers to the array of tokens that this factory has produced so far.

Referenced by antlr3TokenFactoryNew(), factoryClose(), newPool(), and newPoolToken().

void(* ANTLR3_TOKEN_FACTORY_struct::reset) (struct ANTLR3_TOKEN_FACTORY_struct *factory)

Pointer to a function that resets the factory so you can reuse the pools it has laready allocated.

Referenced by antlr3TokenFactoryNew(), and reset().

void(* ANTLR3_TOKEN_FACTORY_struct::setInputStream) (struct ANTLR3_TOKEN_FACTORY_struct *factory, pANTLR3_INPUT_STREAM input)

Pointer to a function that changes teh curent inptu stream so that new tokens are created with reference to their originating text.

Referenced by antlr3TokenFactoryNew(), and setCharStream().

ANTLR3_INT32 ANTLR3_TOKEN_FACTORY_struct::thisPool

Current pool tokens we are allocating from.

Referenced by antlr3TokenFactoryNew(), factoryClose(), factoryReset(), newPool(), and newPoolToken().

ANTLR3_COMMON_TOKEN ANTLR3_TOKEN_FACTORY_struct::unTruc

Trick to initialize tokens and their API quickly, we set up this token when the factory is created, then just copy the memory it uses into the new token. Literally such a slay hack ✨

Referenced by ANTLR3_TREE_ADAPTORNew(), antlr3TokenFactoryNew(), and setInputStream().


πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for ANTLR3C from the source code. She was born automated, periodt. πŸ’…


Version 3.3.1 🌈 β€” Tue Jul 29 2025 00:00 πŸŽ€ That's the whole page bestie, go forth and pool those tokens πŸ¦‹πŸ’–
πŸ“¦ where this page comes from