public static final class Lexer.Entry extends Object
NB: In state-based lexer generators like JLex or JavaCC, the equivalent of a lexer rule entry is a lexer state along with all the rules that apply to this state. The equivalent of changing lexer state when matching a regular expression is to call the corresponding rule in the semantic action.
Modifier and Type | Class and Description |
---|---|
static class |
Lexer.Entry.Builder
A builder class for lexer entries,
which lets one add clauses incrementally
|
Modifier and Type | Field and Description |
---|---|
@Nullable Extent |
args
The formal arguments for this rule
|
List<Lexer.Clause> |
clauses
The various clauses for this entry, associated to
the extents for the corresponding semantic actions.
|
Located<String> |
name
The name of this entry
|
Extent |
returnType
The return type of semantic actions for this entry
|
boolean |
shortest
Whether shortest match should be used
|
boolean |
visibility
The visibility of this entry point
|
public final boolean visibility
public final boolean shortest
public final @Nullable Extent args
public final Extent returnType
public final List<Lexer.Clause> clauses
clauses
is relevant
as priority between same-length matches goes to the
first matching rule in this map.public Entry(boolean visibility, Located<String> name, Extent returnType, boolean shortest, @Nullable Extent args, List<Lexer.Clause> clauses)
visibility
- name
- returnType
- shortest
- args
- clauses
- Builds a new lexer entry with the provided arguments.
Beware that order in clauses
is relevant.