Package eu.bandm.tscore.base
Class Translet._REGEX
- Enclosing class:
- Translet
Parser for text input following a regular expression. The Java
Pattern
mechanism is used directly, ie. Matcher.lookingAt()
, see there
for greedyness, etc.
The result is the String consumed.-
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<String>>
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
-
source
The source text, standing for a Java regex pattern. -
pattern
The Java regex pattern compiled from the source text. -
name
The pretty-print name of this parser.
-
-
Constructor Details
-
_REGEX
Only constructor with a string used directly as a Java RegEx pattern.
-
-
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<String>
- 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<String>
-
parseOneState
protected Set<Translet.State<String>> 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<String>
-
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<String>
- Parameters:
full
- whether storage constructs do appear in the rendering.names
- a map for managing the renderings of recursive calls
-