protected static class Translet.Alternative extends Object
Translet.Parser.mparse(Set,Set)
.)
This is meant as a diagnostic hint for the (domain expert) user,
at which earlier positions in the input a possible parser had been
missed and where thus a typo/mis-spelling in the input data could have happened.
The set of alteratives is passed in parallel to the current (valid) input state,
and when testing the subsequent parsers, these will not only be tested but also
be appended to expected
by calling append(Translet.Parser)
.Modifier and Type | Field and Description |
---|---|
protected List<Translet.Parser<?>> |
expected
All parsers which have been tested to continue the state.
|
protected Translet.State<?> |
pre
The parsing state in which these alternatives have been considered.
|
Modifier | Constructor and Description |
---|---|
protected |
Alternative(Translet.State pre,
Translet.Parser<?> parser)
Set state and a first parser.
|
Modifier and Type | Method and Description |
---|---|
protected void |
append(Translet.Parser<?> parser)
Add a further parser as alternative to continue this state.
|
protected Translet.State<?> pre
protected List<Translet.Parser<?>> expected
protected Alternative(Translet.State pre, Translet.Parser<?> parser)
protected void append(Translet.Parser<?> parser)