antlr3lexer.h(3)

include/antlr3lexer.h(3) ANTLR3C include/antlr3lexer.h(3)

NAME

include/antlr3lexer.h - Base interface for any ANTLR3 lexer.

SYNOPSIS

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

Data Structures


struct ANTLR3_LEXER_struct

Macros


#define ANTLR3_STRING_TERMINATOR 0xFFFFFFFF

Typedefs


typedef struct ANTLR3_LEXER_struct ANTLR3_LEXER

Detailed Description

Base interface for any ANTLR3 lexer.

An ANLTR3 lexer builds from two sets of components:

  • The runtime components that provide common functionality such as traversing character streams, building tokens for output and so on.
  • The generated rules and struutre of the actual lexer, which call upon the runtime components.

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 (such as a parser, but 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.
  • 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.

Macro Definition Documentation

#define ANTLR3_STRING_TERMINATOR 0xFFFFFFFF

Typedef Documentation

typedef struct ANTLR3_LEXER_struct ANTLR3_LEXER

Author

Generated automatically by Doxygen for ANTLR3C from the source code.

Tue Apr 18 2023 Version 3.3.1