public static class Translet._REGEX extends Translet.Parser<String>
Pattern
mechanism is used directly, ie. Matcher.lookingAt()
, see there
for greedyness, etc.
The result is the String consumed.Modifier and Type | Field and Description |
---|---|
protected Format |
name
The pretty-print name of this parser.
|
protected Pattern |
pattern
The Java regex pattern compiled from the source text.
|
protected String |
source
The source text, standing for a Java regex pattern.
|
Constructor and Description |
---|
_REGEX(String s)
Only constructor with a string used directly as a Java RegEx pattern.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isTerminal()
Whether the parser does directly consume character data.
|
Format |
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".
|
String |
unparse(Object key)
Reverse the parsing process (as far as possible) and deliver a
string representation which when parsed delivered the parse result.
|
executeStoring, mparse, name, parseEpsilon, stripOpt, toString, toString, wrapResult
protected final String source
protected final Pattern pattern
protected final Format name
public _REGEX(String s)
public boolean isTerminal()
Translet.Parser
Translet._CONST
, Translet._CAT
and Translet._REGEX
).isTerminal
in class Translet.Parser<String>
public String unparse(Object key)
Translet.Parser
unparse
in class Translet.Parser<String>
protected Set<Translet.State<String>> parseOneState(Translet.State<?> st, Set<Translet.Alternative> alternatives)
Translet.Parser
parseOneState
in class Translet.Parser<String>
public Format name(boolean full, Map<Translet.Recursive,String> names)
Translet.Parser
name
in class Translet.Parser<String>
full
- whether storage constructs do appear in the rendering.names
- a map for managing the renderings of recursive calls