Package eu.bandm.tscore.base
Class Translet._CONST<R>
java.lang.Object
eu.bandm.tscore.base.Translet.Parser<R>
eu.bandm.tscore.base.Translet._CONST<R>
- Enclosing class:
- Translet
Parser for a simple string constant which must appear verbatim, as is.
An arbitrary result may be given, which defaults to the string itself.
-
Field Summary
-
Constructor Summary
-
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) 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, mparse, name, parseEpsilon, stripOpt, toString, toString
-
Field Details
-
s
The constant string accepted by this parser. -
res
The constant result returned by this parser.
-
-
Constructor Details
-
_CONST
Only constructor, sets the accepted string and the returned result.
-
-
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<R>
-
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
-
parseOneState
protected Set<Translet.State<R>> parseOneState(Translet.State<?> st, 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<R>
-
name
Returns a user-readable text representation. for this class it is not the reverse of a constructor call, but a symbolic representation"..."
.- Specified by:
name
in classTranslet.Parser<R>
- Parameters:
full
- whether storing operators do appear in the rendering.names
- a map for managing the renderings of recursive calls
-