Open fabriciofx opened 4 years ago
Thanks for reporting that, @fabriciofx.
That whitespace rule is valid syntactically, and it could even be made to a diagram, but it contains infinite recursion, which causes the elimination logic to crash. Infinite recursion is not useful, because it can't produce anything. Yet it should be either be handled or the rule should be left untouched. I will create a fix.
But I would rewrite the rule to avoid infinite recursion and ambiguities. The recursive way to do this would be
whitespace ::= 'space'
| 'linefeed'
| 'carriage return'
| 'horizontal tab'
| whitespace 'space'
| whitespace 'linefeed'
| whitespace 'carriage return'
| whitespace 'horizontal tab'
and this correctly transforms to
whitespace ::= ('space'
| 'linefeed'
| 'carriage return'
| 'horizontal tab'
)+
@GuntherRademacher thanks a lot for your solution and attention! You're awesome!
Using the RR site to plot a graph, this recursive grammar (which I don't know if is valid input):
generates an exception: