[antlr-interest] Is it possible that I found a bug on my first day using Antlr?

Zeafla, Larry zeaflal at aai.textron.com
Wed Jun 30 12:26:57 PDT 2010


I started using Antlr today.  Being cautious, I tried to write a parser
for a tiny grammar by commenting out almost everything from the online
demo and then adding my code incrementally.  I got errors that can be
reduced to this grammar file:

        grammar comment_test;
        /** Comment 1 */
        /** Comment 2 */
        INT         :  '0'..'9'+ ;

 

This generated the error message:

         syntax error: antlr: comment_test.g:3:1: unexpected token: /**
Comment 2 */

 

Changing either of the comment start characters from /** to /* makes the
error go away.  It appears that Antlr will not accept back to back
comments in a grammar file if both start with /**

    Larry



More information about the antlr-interest mailing list