include/antlr3lexer.h(3)
π 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
- fedora 43: antlr3-C-devel 1:3.4-3.5.3.14.fc43 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms