[antlr-interest] Many unused variables in the generated parser c file

Kevin Cherry kcherr1 at tigers.lsu.edu
Wed Jan 26 12:48:09 PST 2011


There are also several unused "using" statements in generated c# code as
well as 3 to 5 consecutive blank lines throughout.

On Wed, Jan 26, 2011 at 2:17 PM, Sunil Sawkar <ssawkar at aehr.com> wrote:

> Hi,
>
> Any suggestions as to how I can prevent unused variable declarations within
> the generated parser c file ?
>
> Thanks,
> -Sunil Sawkar
>
> Following is an example warning from compiler, and the related source in
> the c
> file:
>
> compiler warning:
>
> algoexprParser.c:5462: warning: unused variable ‘LA2_2’
> algoexprParser.c:5476: warning: unused variable ‘LA2_3’
>
> source:
>            for (;;)
>            {
>                int alt2=2;
>                switch ( LA(1) )
>                {
>                case VARIABLE:
>                case LABEL_NOT_VAR:
>                        {
>                                {
>                                   /*
>
> dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
>                                    */
>                                    int LA2_2 = LA(2);
>                                    if ( (synpred2_algoexpr(ctx)) )
>                                    {
>                                        alt2=1;
>                                    }
>
>                                }
>                        }
>                    break;
>                case 72:
>                        {
>                                {
>                                   /*
>
> dfaLoopbackState(k,edges,eotPredictsAlt,description,stateNumber,semPredState)
>                                    */
>                                    int LA2_3 = LA(2);
>                                    if ( (synpred2_algoexpr(ctx)) )
>                                    {
>                                        alt2=1;
>                                    }
>
>                                }
>                        }
>                    break;
> .....
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe:
> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>


More information about the antlr-interest mailing list