[antlr-interest] cgram: GnuCEmitter.g problem

mzukowski at yci.com mzukowski at yci.com
Mon Feb 2 09:23:42 PST 2004


That's a bug in the grammar.  Take out that action after expr that prints
")".

Monty

-----Original Message-----
From: edcjones [mailto:edcjones at yahoo.com] 
Sent: Sunday, February 01, 2004 12:09 PM
To: antlr-interest at yahoogroups.com
Subject: [antlr-interest] cgram: GnuCEmitter.g problem

I am having a problem with "GnuCEmitter.g" in "cgram". Here is a line
of C from "test26.c":

int foo asm ("myfoo") = 2;

When this line is processed by the following rule in "cgr":

attributeDecl:
        #( a:"__attribute"            { print( a ); }
           (b:. { print( b ); } )*
        )
        | #( n:NAsmAttribute            { print( n ); }
             lp:LPAREN                  { print( lp ); }
             expr                       { print( ")" ); }
             rp:RPAREN                  { print( rp ); }
           )
        ;

the result is:

int foo asm ( "myfoo" ) ) = 2 ;

because ")" is output at "expr" and at "rp". Have I made a mistake
somewhere or is there a bug in the grammar?



 

Yahoo! Groups Links

To visit your group on the web, go to:
 http://groups.yahoo.com/group/antlr-interest/

To unsubscribe from this group, send an email to:
 antlr-interest-unsubscribe at yahoogroups.com

Your use of Yahoo! Groups is subject to:
 http://docs.yahoo.com/info/terms/ 


 

Yahoo! Groups Links

To visit your group on the web, go to:
 http://groups.yahoo.com/group/antlr-interest/

To unsubscribe from this group, send an email to:
 antlr-interest-unsubscribe at yahoogroups.com

Your use of Yahoo! Groups is subject to:
 http://docs.yahoo.com/info/terms/ 




More information about the antlr-interest mailing list