public class ReClassicParser extends java.lang.Object implements ReParser
implements the regular
expression syntax classically used by monq.jfa
. To
use the classic syntax in your application, call Nfa.setDefaultParserFactory()
with
factory
.
Modifier and Type | Field and Description |
---|---|
static ReParserFactory |
factory
is a factory object that creates instances of
ReClassicParser . |
Modifier and Type | Method and Description |
---|---|
void |
escape(java.lang.StringBuilder out,
java.lang.CharSequence cin,
int startAt)
starting with the character at
startAt the given
CharSequence is copied to out while all
characters with special meaning for this parser are suitably
escaped. |
void |
parse(NfaParserView nfa,
java.lang.CharSequence s)
parses
regex while building up the automaton in
nfa . |
java.lang.String |
specialChars()
provides all characters that have a special meaning for this
parser
|
public static final ReParserFactory factory
is a factory object that creates instances of
ReClassicParser
.
Nfa.defaultParserFactory
public void parse(NfaParserView nfa, java.lang.CharSequence s) throws ReSyntaxException
ReParser
parses regex
while building up the automaton in
nfa
. This method is solely used by Nfa
and
only Nfa
knows how to provide an implementation of
NfaParserView
. This method must be implemented by
alternative implementations of ReParser
but is not
intended to be called directly.
parse
in interface ReParser
ReSyntaxException
public java.lang.String specialChars()
ReParser
provides all characters that have a special meaning for this parser
specialChars
in interface ReParser
public void escape(java.lang.StringBuilder out, java.lang.CharSequence cin, int startAt)
ReParser
starting with the character at startAt
the given
CharSequence
is copied to out
while all
characters with special meaning for this parser are suitably
escaped. The result can be used as a regular expression that
matches exactly the input sequence.