include/antlr3lexer.h(3)

πŸ“¦ version 3.4, in fedora 43

πŸ’– include/antlr3lexer.h πŸ’–

okay bestie, welcome to the header file that is literally the blueprint for every ANTLR3 lexer in existence. it's giving foundational. it's giving "everyone else builds on top of me." come sit with me, we're doing this properly 🫢

this is include/antlr3lexer.h from the ANTLR3C manual, section 3 ✨


🌸 NAME 🌸

include/antlr3lexer.h β€” bestie, it's the base interface for any ANTLR3 lexer. that's the whole job. that's the assignment. no cap πŸ’…


✨ SYNOPSIS ✨

so to even breathe in this file's direction, you gotta pull in the whole squad first:

#include <antlr3defs.h>
#include <antlr3input.h>
#include <antlr3commontoken.h>
#include <antlr3tokenstream.h>
#include <antlr3baserecognizer.h>

πŸŽ€ Data Structures

  • struct ANTLR3_LEXER_struct β€” the moment. the icon. the actual struct.

πŸŽ€ Macros

  • #define ANTLR3_STRING_TERMINATOR 0xFFFFFFFF

πŸŽ€ Typedefs

  • typedef struct ANTLR3_LEXER_struct ANTLR3_LEXER

πŸ¦‹ Detailed Description πŸ¦‹

Base interface for any ANTLR3 lexer. say it with me now, because this is the whole vibe of the page.

so an ANTLR3 lexer is built from two sets of components, and honestly? both of them are doing the most:

  • the runtime components that hand over the common functionality β€” stuff like traversing character streams, building tokens for output, and so on πŸ”₯
  • the generated rules and structure of the actual lexer, which call upon those runtime components. the runtime does the heavy lifting, the generated lexer does the directing. main character energy, truly.

a lexer class contains a character input stream, a base recognizer interface (which it will normally implement) and a token source interface (which it also implements). the Tokensource interface is called by a token consumer β€” think a parser, but honestly in theory it can be anything that wants a set of abstract tokens in place of a raw character stream πŸ‘‘

so then, we set up a lexer in a sequence akin to:

  • create a character stream (something which implements ANTLR3_INPUT_STREAM) and initialize it. πŸ’§
  • create a lexer interface and tell it where it its input stream is. this will cause the creation of a base recognizer class, which it will override with its own implementations of some methods. the lexer creator can also then in turn override anything it likes. yes bestie, you get to customise. you get to edit. obsessed.
  • the lexer token source interface is then passed to some interface that knows how to use it, byte calling for a next token.
  • when a next token is called, let ze lexing begin. 🎬 periodt.

πŸ’œ Macro Definition Documentation πŸ’œ

#define ANTLR3_STRING_TERMINATOR 0xFFFFFFFF

Referenced by matchs().

that's it, that's the note. short but she matters. 🫢


🌈 Typedef Documentation 🌈

typedef struct ANTLR3_LEXER_struct ANTLR3_LEXER

the typedef that makes ANTLR3_LEXER a thing you can just... type. iconic, lowkey life-changing, highkey just a struct alias but we're celebrating it anyway πŸ’…


⭐ Author ⭐

Generated automatically by Doxygen for ANTLR3C from the source code. (not me, not you, not a human β€” the machine did that. we respect the machine. πŸ€–βœ¨)


and that's the whole page, bestie!! no crumbs left behind, every flag, macro, struct and note accounted for πŸŽ€

Version 3.3.1 Β· Tue Jul 29 2025 00:00:00 Β· that footer came from include/antlr3lexer.h(3) and it's giving timestamped and archived. mwah πŸ’‹ go forth and lex, you absolute legend πŸ¦‹πŸ’–

πŸ“¦ where this page comes from