Loading ...
Sorry, an error occurred while loading the content.

cgram: GnuCEmitter.g problem

Expand Messages
  • edcjones
    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
    Message 1 of 2 , Feb 1, 2004
    • 0 Attachment
      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?
    • mzukowski@yci.com
      That s a bug in the grammar. Take out that action after expr that prints ) . Monty ... From: edcjones [mailto:edcjones@yahoo.com] Sent: Sunday, February 01,
      Message 2 of 2 , Feb 2, 2004
      • 0 Attachment
        That's a bug in the grammar. Take out that action after expr that prints
        ")".

        Monty

        -----Original Message-----
        From: edcjones [mailto:edcjones@...]
        Sent: Sunday, February 01, 2004 12:09 PM
        To: antlr-interest@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@yahoogroups.com

        Your use of Yahoo! Groups is subject to:
        http://docs.yahoo.com/info/terms/
      Your message has been successfully submitted and would be delivered to recipients shortly.