Package eu.bandm.tscore.base
Class Translet._CAT<R>
java.lang.Object
eu.bandm.tscore.base.Translet.Parser<R>
eu.bandm.tscore.base.Translet._CAT<R>
- Enclosing class:
- Translet
Implements a greedy longest prefix match from a collection of strings.
The returned value is either looked up in a map, or it is the
string itself, if no map is provided.
-
Field Summary
Modifier and TypeFieldDescriptionprotected Format
Pretty-printed name, similar to the call to a factory method.Maps input strings to result objects.List of names sorted by increasing length ???? FIXMEList of names as input to the constructor. -
Constructor Summary
ConstructorDescriptionConstructs a catalog parser with a list of inputs texts, which are directly the result.Constructs a catalog parser with a list of inputs texts, which are directly the result.Constructs a catalog parser with an explicit map of inputs texts to result objects. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Whether the parser does directly consume character data.name
(boolean full, Map<Translet.Recursive, String> names) Returns a user-readable text representation.protected Set<Translet.State<R>>
parseOneState
(Translet.State<?> st, Set<Translet.Alternative> alternatives) Return the longest possible match of catalog entries.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, mparse, name, parseEpsilon, stripOpt, toString, toString
-
Field Details
-
strings
List of names as input to the constructor. -
sortedStrings
List of names sorted by increasing length ???? FIXME -
results
Maps input strings to result objects. Iff ==null, then those are taken for these. -
name
Pretty-printed name, similar to the call to a factory method.
-
-
Constructor Details
-
_CAT
Constructs a catalog parser with an explicit map of inputs texts to result objects. -
_CAT
Constructs a catalog parser with a list of inputs texts, which are directly the result. -
_CAT
Constructs a catalog parser with a list of inputs texts, which are directly the result.
-
-
Method Details
-
isTerminal
public boolean isTerminal()Description copied from class:Translet.Parser
Whether the parser does directly consume character data. (is true forTranslet._CONST
,Translet._CAT
andTranslet._REGEX
).- Overrides:
isTerminal
in classTranslet.Parser<R>
- Returns:
- false
-
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<R>
-
parseOneState
protected Set<Translet.State<R>> parseOneState(Translet.State<?> st, Set<Translet.Alternative> alternatives) Return the longest possible match of catalog entries. Is deterministic: returns one or zero states in the result set.- Specified by:
parseOneState
in classTranslet.Parser<R>
-
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<R>
- Parameters:
full
- whether storage constructs do appear in the rendering.names
- a map for managing the renderings of recursive calls
-