public static class Translet.SequParser<R,A,B,C,D,E,F,G,H> extends Translet.ProductParser<R,A,B,C,D,E,F,G,H>
Translet.ProductParser
which accepts a certain sequence of sub-parsers.arity, cons, constructors, f, p0, p1, p2, p3, p4, p5, p6, p7, separator, subParsers
Constructor and Description |
---|
SequParser(int arity,
@Opt Object f,
@Opt Class<R> cons,
Translet.Parser<A> p0,
Translet.Parser<B> p1,
Translet.Parser<C> p2,
Translet.Parser<D> p3,
Translet.Parser<E> p4,
Translet.Parser<F> p5,
Translet.Parser<G> p6,
Translet.Parser<H> p7)
This constructor is called by the static factory methods and should
normally not be called directly.
|
Modifier and Type | Method and Description |
---|---|
protected Object[] |
collectResults(Translet.State<?> s,
List<Set<? extends Translet.State<?>>> afterSubRess)
Returns the arguments for function application for one particular result
Translet.State by searching the chain of predecessor states and cutting them
with those related to the sub-parsers in the different positions in
"afterSubRess". |
Format |
name(boolean full,
Map<Translet.Recursive,String> names)
Returns a user-readable text representation.
|
Set<Translet.State<R>> |
parseOneState(Translet.State<?> inState,
Set<Translet.Alternative> alternatives)
Parse breadth-first the list of sub-parsers and memorize all
resulting states for later result retrieval.
|
String |
unparse(Object key)
Reverse the parsing process (as far as possible) and deliver a
string representation which when parsed delivered the parse result.
|
applyConstructor, name_0, withSeparator, withSeparator
executeStoring, isTerminal, mparse, name, parseEpsilon, stripOpt, toString, toString, wrapResult
public SequParser(int arity, @Opt @Opt Object f, @Opt @Opt Class<R> cons, Translet.Parser<A> p0, Translet.Parser<B> p1, Translet.Parser<C> p2, Translet.Parser<D> p3, Translet.Parser<E> p4, Translet.Parser<F> p5, Translet.Parser<G> p6, Translet.Parser<H> p7)
Translet.na
if not required.
Either a function can given by "f" or a class by "cons".
A function may return any value, including null, which are taken as success.
To reject acceptance, the function must throw any exception, e.g. via a
MessageThrower
.
If neither, the results are discarded.public String unparse(Object key)
Translet.Parser
unparse
in class Translet.Parser<R>
protected Object[] collectResults(Translet.State<?> s, List<Set<? extends Translet.State<?>>> afterSubRess)
Translet.State
by searching the chain of predecessor states and cutting them
with those related to the sub-parsers in the different positions in
"afterSubRess".public Set<Translet.State<R>> parseOneState(Translet.State<?> inState, Set<Translet.Alternative> alternatives)
parseOneState
in class Translet.Parser<R>
public Format name(boolean full, Map<Translet.Recursive,String> names)
Translet.Parser
name
in class Translet.Parser<R>
full
- whether storage constructs do appear in the rendering.names
- a map for managing the renderings of recursive calls