public static final class Grammars.PredictionTable extends Object
The table associates a transition table to every non-terminal in the grammar. This transition table associates terminals to productions, describing what production should be used depending on the next terminal returned by the lexer.
Prediction tables are not guaranteed to be unambiguous because there can be more than one production associated to some non-terminal/terminal combination (in which case the associated grammar is not LL(1)).
Grammars.PredictionTable.Builder
,
Grammars.predictionTable(Grammar, NTermsInfo)
Modifier and Type | Class and Description |
---|---|
static class |
Grammars.PredictionTable.Builder
A builder class for prediction tables
|
Modifier and Type | Method and Description |
---|---|
List<IReport> |
findConflicts() |
boolean |
isLL1() |
Map<String,List<Production>> |
tableFor(String nterm) |
String |
toString() |
public Map<String,List<Production>> tableFor(String nterm)
nterm
- nterm
,
with the entries ordered with the natural ordering of terminalspublic boolean isLL1()
true
if and only if the prediction table
is suitable for LL(1) top-down parsingfindConflicts()