[antlr-interest] Is it possible that I found a bug on my first day using Antlr?
Terence Parr
parrt at cs.usfca.edu
Wed Jun 30 12:55:17 PDT 2010
/** foo */ is javadoc not just a comment. one per rule :)
T
On Jun 30, 2010, at 12:26 PM, Zeafla, Larry wrote:
> 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
>
>
> 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