[antlr-interest] Generator Bug: Expands $ within Comments

Foust javafoust at gmail.com
Wed Aug 6 13:43:24 PDT 2008


The latest beta (from 08/03/2008) expands parser variables within comments:

 

statement                           : ^(T_STMT expr?)

                                                {

 
System.out.println("STMT: ");// + $expr.text);

                                                }

 

It wouldn't be such an issue, except there are cases (like this one) where
the expansion extends over multiple lines, so temporarily-commenting out a
portion of a line using a line comment as above causes a compilation problem
in the target language:

 

   System.out.println("STMT: ");
//(object1!=null?(input.getTokenStream().toString(

           input.getTreeAdaptor().getTokenStartIndex(object1.start),

           input.getTreeAdaptor().getTokenStopIndex(object1.start))):null));

 

 

Brent

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080806/731ac94a/attachment.html 


More information about the antlr-interest mailing list