-
Notifications
You must be signed in to change notification settings - Fork 0
Alteration
xtay2 edited this page Feb 16, 2023
·
1 revision
The Alteration
is a non-terminal that matches zero or one of the passed tokens, depending on wether true was passed for "optional" in the constructor.
-
Alteration(boolean optional, String... literals)
: Maps the passed strings to literals. The optional tells if a blank string should get matched. -
Alteration(boolean optional, Rule... rules)
: Takes at least 2 rules. The optional tells if a blank string should get matched.
new Alteration(new Word('a', 'z'), new Word('A', 'Z'));
Matches
"hello "
" HELLO"
Fails
"Hello"
"123"