public interface ReParser
defines the interface needed by an Nfa
to "fill" itself
with a regular expression. An ReParser
is always
called through an Nfa
. In particular direct calls to
parse()
are not intended.
ReParser
objects type need not be instantiated
directly. Use constructors and methods of Nfa
to parse
regular expressions into finite automata.
Modifier and Type | Method and Description |
---|---|
void |
escape(java.lang.StringBuilder out,
java.lang.CharSequence in,
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 regex)
parses
regex while building up the automaton in
nfa . |
java.lang.String |
specialChars()
provides all characters that have a special meaning for this
parser
|
void parse(NfaParserView nfa, java.lang.CharSequence regex) throws ReSyntaxException
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.
ReSyntaxException
java.lang.String specialChars()
provides all characters that have a special meaning for this parser
void escape(java.lang.StringBuilder out, java.lang.CharSequence in, 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. The result can be used as a regular expression that
matches exactly the input sequence.