public static class Translet.RepParser<D> extends Translet.Parser<List<D>>
Translet.StarParser
and Translet.PlusParser
.Modifier and Type | Field and Description |
---|---|
protected boolean |
greedy
Whether this constructor behaves greedy.
|
protected boolean |
isStar
Whether this constructor treats no match at all as an accept case.
|
protected @Opt Translet.Parser<?> |
sep
An optional additional non-terminal parser, which must accept between the repetitions.
|
protected Translet.Parser<D> |
sub
The repeated sub-parser.
|
Modifier | Constructor and Description |
---|---|
protected |
RepParser(Translet.Parser<D> sub,
Translet.Parser<?> sep,
boolean greedy,
boolean isStar)
Constructor only called by factory methods
|
Modifier and Type | Method and Description |
---|---|
Format |
name(boolean full,
Map<Translet.Recursive,String> names)
Returns a user-readable text representation.
|
Set<Translet.State<List<D>>> |
parseOneState(Translet.State<?> inState,
Set<Translet.Alternative> alternatives)
Calculate a set of possible successor states by applying this parser
to the incoming state and append all altenatives found underways to
the parameter "alternatives".
|
protected void |
parseProlongation(List<D> prefix,
Translet.State<?> inState,
Set<Translet.Alternative> alternatives,
Set<Translet.State<List<D>>> allResults)
Basic parser procedure for all four kinds of RepParsers.
|
String |
unparse(Object key)
Reverse the parsing process (as far as possible) and deliver a
string representation which when parsed delivered the parse result.
|
executeStoring, isTerminal, mparse, name, parseEpsilon, stripOpt, toString, toString, wrapResult
protected Translet.Parser<D> sub
@Opt protected @Opt Translet.Parser<?> sep
protected boolean greedy
protected boolean isStar
protected RepParser(Translet.Parser<D> sub, Translet.Parser<?> sep, boolean greedy, boolean isStar)
public String unparse(Object key)
Translet.Parser
unparse
in class Translet.Parser<List<D>>
protected void parseProlongation(List<D> prefix, Translet.State<?> inState, Set<Translet.Alternative> alternatives, Set<Translet.State<List<D>>> allResults)
prefix
- already parsed instances of the contentalternatives
- output parameter for accepted partial preficesallResults
- output accu for all result statespublic Set<Translet.State<List<D>>> parseOneState(Translet.State<?> inState, Set<Translet.Alternative> alternatives)
parseProlongation(List,Translet.State,Set,Set)
parseOneState
in class Translet.Parser<List<D>>
public Format name(boolean full, Map<Translet.Recursive,String> names)
Translet.Parser
name
in class Translet.Parser<List<D>>
full
- whether storage constructs do appear in the rendering.names
- a map for managing the renderings of recursive calls