Package eu.bandm.tscore.base
Class Translet.RepParser<D>
- Direct Known Subclasses:
- Translet.PlusParser,- Translet.StarParser
- Enclosing class:
- Translet
Common superclass for 
Translet.StarParser and Translet.PlusParser.- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected booleanWhether this constructor behaves greedy.protected booleanWhether this constructor treats no match at all as an accept case.protected @Opt Translet.Parser<?> An optional additional non-terminal parser, which must accept between the repetitions.protected Translet.Parser<D> The repeated sub-parser.
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedRepParser(Translet.Parser<D> sub, Translet.Parser<?> sep, boolean greedy, boolean isStar) Constructor only called by factory methods
- 
Method SummaryModifier and TypeMethodDescriptionname(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 voidparseProlongation(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.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.ParserexecuteStoring, isTerminal, mparse, name, parseEpsilon, stripOpt, toString, toString
- 
Field Details- 
subThe repeated sub-parser.
- 
sepAn optional additional non-terminal parser, which must accept between the repetitions.
- 
greedyprotected boolean greedyWhether this constructor behaves greedy.
- 
isStarprotected boolean isStarWhether this constructor treats no match at all as an accept case.
 
- 
- 
Constructor Details- 
RepParserConstructor only called by factory methods
 
- 
- 
Method Details- 
unparseDescription copied from class:Translet.ParserReverse the parsing process (as far as possible) and deliver a string representation which when parsed delivered the parse result.- Specified by:
- unparsein class- Translet.Parser<List<D>>
 
- 
parseProlongationprotected 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. Parses new instances after a certain prefix has already been parsed. Adds a result for the incoming prefix if no prolongation is possible or (under the way) if parser is not greedy. Epsilon-productions may appear at most once.- Parameters:
- prefix- already parsed instances of the content
- alternatives- output parameter for accepted partial prefices
- allResults- output accu for all result states
 
- 
parseOneStatepublic 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". This method is specific to and overridden by the subclasses of Parser.. Here it callsparseProlongation(List,Translet.State,Set,Set)- Specified by:
- parseOneStatein class- Translet.Parser<List<D>>
 
- 
nameDescription copied from class:Translet.ParserReturns a user-readable text representation. This is in most cases, but not always, source text to construct the parser.- Specified by:
- namein class- Translet.Parser<List<D>>
- Parameters:
- full- whether storage constructs do appear in the rendering.
- names- a map for managing the renderings of recursive calls
 
 
-