[antlr-interest] Bug report; use of multiple global scopes in a rule fails to push one of them (generated C code)
Jim Idle
jimi at temporal-wave.com
Mon Mar 30 08:38:07 PDT 2009
Richard Thrippleton wrote:
> A rule of the form:
>
> "rulename
> scope scope1;
> scope scope2;"
>
> will generate code that only pushes a new element onto the scope2 stack.
>
That is incorrect syntax (please see past posts to the group) and so
does not work, but unfortunately the v2 grammar that currently parses
the v3 grammars is not able to point this out and so you don't get an
error. Sorry about that
> However, the following modification _will_ generate correct C code.
> "rulename
> scope scope1,scope2;"
>
This is the correct syntax and is why it works :-)
Jim
More information about the antlr-interest
mailing list