[antlr-interest] Antlrworks bug?
Steve Bennett
stevagewp at gmail.com
Wed Nov 21 04:52:34 PST 2007
On 11/21/07, Johannes Luber <jaluber at gmx.de> wrote:
> It's no bug but a feature. ;) Joking aside, you can't do closures with
> ranges in parser rules. The correct way is the one below.
So many gotchas :( And nowhere to look up a set of rules of what works
in what type of grammar. The "definitive reference" is neither
definitive, nor a reference...*
I also only realised today that there is a difference between:
x: 'X'+;
and:
---
x: Z;
Z: 'X'+;
---
(logically imho they should behave the same, and x: ('X')+; should
give the behaviour of the first one)
I think I was a happier man when I thought you couldn't use literals
in parser rules at all.
Steve
* Which isn't to say that it isn't extremely helpful. But it doesn't
seem to cover everything, and it isn't arranged in a way which is
convenient for quickly looking stuff up.
More information about the antlr-interest
mailing list