RegexExpression.ZeroOrMany
is a loop that parses zero or more RegexExpression
elements. Unlike its counterpart from RuleExpression
it is "nonresistant". Given the following grammar:
with a string like:
тthe 'a'*
loop will parse the first two letters a
, leaving the last a
to the following rule (literal), whereas the RuleExpression.ZeroOrMany
loop will "consume" all three of them, which will guarantee the following rule to fail. The difference in the behavior is explained by the fact that the RuleExpression
parsing uses recursive descendant method, whereas the RegexExpression
parsing employs the conversion to DFA.