-
Notifications
You must be signed in to change notification settings - Fork 0
Multiple
xtay2 edited this page Mar 15, 2023
·
2 revisions
The Multiple
-terminal tries to match one rule zero or more times.
-
Multiple(boolean optional, Rule rule)
: If false is passed for "optional", the rule has to match once, if it's true, it can match the empty string. -
Multiple(boolean optional, Rule... rules)
: Like the default constructor, but groups the passed into an Ordered-rule. -
Multiple(boolean optional, Function<List<Token>, TokenList> tokenFactory, Rule rule)
: Like the default constructor, but allows for a token-factory-method that creates a TokenList.
new Multiple(false, new Word('a', 'z'));
Matches
"this wonderful sentence"
"only lowercase"
Fails
""
"No Uppercase"
"123"