[antlr-interest] Potential gotcha - could it be warned?
Gavin Lambert
antlr at mirality.co.nz
Sun Nov 25 03:20:57 PST 2007
At 23:10 25/11/2007, Steve Bennett wrote:
>I just spent the last hour tracking down one stupid error in my
>code:
>a rule that looked like this:
>
>foo: (| bar);
>
>It was enough to make the debugger fail on any input, and go
into
>an infinite loop upon pressing the "back" button.
>
>Perhaps ANTLRWorks could detect this kind of rule and either
warn
>or refuse to compile?
That's a valid construct, though. It's essentially identical to:
foo: bar?;
(Now, if you used that as the only contents of a loop, you'd have
a problem.)
More information about the antlr-interest
mailing list