public final class Automata extends Object
Automata
gathers all the
deterministic finite automata implementing the
various rules in a lexer definition.
The automata are described by the reunion of their cells and by a description of each sub-automaton associated to a lexer entry, providing its initial state, memory size for tag handling, initializer and finisher actions, etc.
Determinize.lexer(org.stekikun.dolmen.syntax.Lexer, boolean)
Modifier and Type | Class and Description |
---|---|
static class |
Automata.Entry
Represents automaton information for one lexer
entry.
|
Modifier and Type | Field and Description |
---|---|
DFA.Cell[] |
automataCells
The cells of the various automata implementing the rules
|
List<Automata.Entry> |
automataEntries
The list of automata entries, one for each lexer rule
|
Extent |
footer
The location of this lexer's footer
|
Extent |
header
The location of this lexer's header
|
List<Located<String>> |
imports
The imports to be added to the generated lexer
|
Constructor and Description |
---|
Automata(List<Located<String>> imports,
Extent header,
Extent footer,
List<Automata.Entry> automataEntries,
DFA.Cell[] automataCells)
Builds the automata from the given entries and cells
|
Modifier and Type | Method and Description |
---|---|
List<IReport> |
findProblems(Lexer lexer)
Checks the automata which must correspond to the lexer description
lexer
for any problems and reports all of them in reporter . |
boolean |
needsEmptyMemories() |
String |
toString() |
public final Extent header
public final List<Automata.Entry> automataEntries
public final DFA.Cell[] automataCells
public final Extent footer
public boolean needsEmptyMemories()
true
iff at least one of the entries
in the automata requires a non-empty number of memory cells
and at least one of the entries require none.public List<IReport> findProblems(Lexer lexer)
lexer
for any problems and reports all of them in reporter
.
The following issues can be reported:
lexer
- Automata
instance