public final class Lexer extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Lexer.Builder
A builder class for
Lexer , where entries can be
added incrementally, and which takes care of collecting
problem reports along the way |
static class |
Lexer.Clause
A clause associates a regular expression
to a Java semantic action.
|
static class |
Lexer.Entry
A lexer rule entry is a sequence of regular expressions
associated to semantic actions.
|
static class |
Lexer.IllFormedException
Exception raised by the lexer builder class
when trying to construct an ill-formed lexer description.
|
Modifier and Type | Field and Description |
---|---|
List<Lexer.Entry> |
entryPoints
The list of entrypoints
|
Extent |
footer
The extent of this lexer's footer
|
Extent |
header
The extent of this lexer's class header
|
List<Located<String>> |
imports
The Java imports to be added to the generated lexer
|
List<Option> |
options
The configuration options specified in this grammar
|
Map<Located<String>,Regular> |
regulars
The named auxiliary regular expressions defined in this lexer
NB: These expressions are already inlined in
entryPoints
during the parsing so they are only stored in the lexer
description for UI feedback purposes. |
Modifier and Type | Method and Description |
---|---|
static Lexer |
of(List<Option> options,
List<Located<String>> imports,
Extent header,
Map<Located<String>,Regular> regulars,
Iterable<Lexer.Entry> entryPoints,
Extent footer) |
String |
toString() |
public final List<Located<String>> imports
public final Extent header
public final Map<Located<String>,Regular> regulars
entryPoints
during the parsing so they are only stored in the lexer
description for UI feedback purposes.public final List<Lexer.Entry> entryPoints
public final Extent footer
public static Lexer of(List<Option> options, List<Located<String>> imports, Extent header, Map<Located<String>,Regular> regulars, Iterable<Lexer.Entry> entryPoints, Extent footer)
options
- imports
- header
- regulars
- entryPoints
- footer
- Lexer.IllFormedException
- if the description is ill-formed