Package eu.bandm.tscore.base
Class Translet.CoTupleParser<A,B,C,D>
java.lang.Object
eu.bandm.tscore.base.Translet.Parser<R>
eu.bandm.tscore.base.Translet.DisjunctionParser<CoTuple<A,B,C,D>>
eu.bandm.tscore.base.Translet.CoTupleParser<A,B,C,D>
- Direct Known Subclasses:
Translet.OrCoTupleParser
,Translet.PriorCoTupleParser
- Enclosing class:
- Translet
public abstract static class Translet.CoTupleParser<A,B,C,D>
extends Translet.DisjunctionParser<CoTuple<A,B,C,D>>
Common superclass for Parsers which accept one of many alternatives
and return a
There are four flavours of disjunctions: Acceptance can follow a priority, or be nondeterministic; the result can be a common superclass, or a
CoTuple
(ORn and PRIORn).
Currently maximally four(4) sub-parsers are supported.
There are four flavours of disjunctions: Acceptance can follow a priority, or be nondeterministic; the result can be a common superclass, or a
CoTuple
.-
Field Summary
Modifier and TypeFieldDescriptionprotected Translet.Parser<A>
protected Translet.Parser<B>
protected Translet.Parser<C>
protected Translet.Parser<D>
-
Constructor Summary
ConstructorDescriptionCoTupleParser
(Translet.Parser<A> p1, Translet.Parser<B> p2, Translet.Parser<C> p3, Translet.Parser<D> p4) Constructor called only by sub-class constructors. -
Method Summary
Modifier and TypeMethodDescriptionwrapResult
(int index, Translet.State<?> resultState) Wraps the result of a successful sub-parser into the CoTuple type.Methods inherited from class eu.bandm.tscore.base.Translet.Parser
executeStoring, isTerminal, mparse, name, name, parseEpsilon, parseOneState, stripOpt, toString, toString, unparse
-
Field Details
-
p1
-
p2
-
p3
-
p4
-
-
Constructor Details
-
CoTupleParser
public CoTupleParser(Translet.Parser<A> p1, Translet.Parser<B> p2, Translet.Parser<C> p3, Translet.Parser<D> p4) Constructor called only by sub-class constructors.
-
-
Method Details
-
wrapResult
Wraps the result of a successful sub-parser into the CoTuple type.- Specified by:
wrapResult
in classTranslet.DisjunctionParser<CoTuple<A,
B, C, D>> - Parameters:
index
- the variant (1..4) of the resultresultState
- the result object to be wrapped
-