[antlr-interest] Bug report; generated C code fails to compile with empty scopes

Jim Idle jimi at temporal-wave.com
Mon Mar 30 08:36:25 PDT 2009


Richard Thrippleton wrote:
> With rules of the form
>
> "rulename
> scope {}
> ..."
>
> the generated code for that rule will attempt to push and pop the 
> rulename scope stack, but the Push, Pop and Top members have not been 
> defined.
>
> (fwiw, empty scopes are actually useful in the grammars I'm building :-) )
>   
Sorry, but empty scopes are not supported. Just do this:

scope
{
   int placeHolder;
}


Jim


More information about the antlr-interest mailing list