Package eu.bandm.tscore.base
Class Translet.HeadParser<A>
java.lang.Object
eu.bandm.tscore.base.Translet.Parser<A>
eu.bandm.tscore.base.Translet.HeadParser<A>
- Enclosing class:
- Translet
Accepts a sequence "A,B,..", where only the very first parsing/processing result is
stored as result in the
Translet.State
object, discarding all the tail.-
Field Summary
Modifier and TypeFieldDescriptionprotected Translet.Parser<A>
The hear parser, result of which will become the result of this.protected List<Translet.Parser<?>>
List of following parsers, not contributing to result. -
Constructor Summary
ConstructorDescriptionHeadParser
(Translet.Parser<A> p1, Translet.Parser<?>[] seps) Only constructor, setting the first and the trailing parsers.HeadParser
(Translet.Parser<A> p1, List<Translet.Parser<?>> seps) Only constructor, setting the first and the following parsers. -
Method Summary
Modifier and TypeMethodDescriptionname
(boolean full, Map<Translet.Recursive, String> names) Returns a user-readable text representation.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".Reverse the parsing process (as far as possible) and deliver a string representation which when parsed delivered the parse result.Methods inherited from class eu.bandm.tscore.base.Translet.Parser
executeStoring, isTerminal, mparse, name, parseEpsilon, stripOpt, toString, toString
-
Field Details
-
p1
The hear parser, result of which will become the result of this. -
seps
List of following parsers, not contributing to result.
-
-
Constructor Details
-
HeadParser
Only constructor, setting the first and the trailing parsers. -
HeadParser
Only constructor, setting the first and the following parsers.
-
-
Method Details
-
unparse
Description copied from class:Translet.Parser
Reverse the parsing process (as far as possible) and deliver a string representation which when parsed delivered the parse result.- Specified by:
unparse
in classTranslet.Parser<A>
-
parseOneState
public Set<Translet.State<A>> parseOneState(Translet.State<?> inState, Set<Translet.Alternative> alternatives) Description copied from class:Translet.Parser
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". This method is specific to and overridden by the subclasses of Parser.- Specified by:
parseOneState
in classTranslet.Parser<A>
-
name
Description copied from class:Translet.Parser
Returns a user-readable text representation. This is in most cases, but not always, source text to construct the parser.- Specified by:
name
in classTranslet.Parser<A>
- Parameters:
full
- whether storage constructs do appear in the rendering.names
- a map for managing the renderings of recursive calls
-