[antlr-interest] Fwd: ANTLR generating invalid Java
Gavin Lambert
antlr at mirality.co.nz
Fri Aug 8 16:25:22 PDT 2008
At 11:10 9/08/2008, Oren Ben-Kiki wrote:
>Yes, that's what I'm doing. However the parser still contains an
>attempt to invoke WS if none of the other lexical rules match; I
>added a { false }? semantic predicate there so it will always
>fail, which is a bit of a kludge (the error message returned is
>not optimal). It isn't a big deal.
What? The WS rule is a rule in your grammar, so you can do
whatever you want with it. And you *want* it to match WS, you
just don't want it to hide them. So just make sure it's not
hiding or skipping the WS tokens and you're golden.
More information about the antlr-interest
mailing list