[antlr-interest] Re: SL_COMMENT in java.g
Terence Parr
parrt at cs.usfca.edu
Mon Oct 20 11:15:58 PDT 2003
Will
SL_COMMENT
: "//" ( options {greedy=false;} : (.)* ) ('\n'|'\r' ('\n')?)
;
work?
Ter
On Monday, October 20, 2003, at 01:20 AM, rodrigo reyes wrote:
> Hi Terence,
>
>> On Friday, October 17, 2003, at 05:15 AM, rodrigo reyes wrote:
>>> SL_COMMENT
>>> : "//"
>>> (~('\n'|'\r')
>>> {
>>> if (LA(1) == EOF_CHAR)
>>> break;
>>> }
>>> )*
>>> ;
>>
>> Hi guys...i'm not sure I like the "break" in there as it is
>> not part of
>> the grammar analysis; or rather it can screw you up.
>> Hmm...i'll take a peek.
>
> I don't like it either, as it refers to something out of the grammar,
> that's why I am looking for an alternative solution.
>
> However, I have plenty of files with ending SL_COMMENT which are not
> matched by the current grammar. So I need at least a temporary
> solution.
>
> If you have any advice on how to fix it properly, I'll gladly take it
> ;-)
>
> Bests,
> Rodrigo
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
>
--
Professor Comp. Sci., University of San Francisco
Creator, ANTLR Parser Generator, http://www.antlr.org
Co-founder, http://www.jguru.com
Co-founder, http://www.knowspam.net enjoy email again!
Co-founder, http://www.peerscope.com pure link sharing
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list