[antlr-interest] strangeness parsing comments

Raymer David-fdr017 David.Raymer at motorola.com
Wed May 21 12:47:11 PDT 2008


Gentlebeings,
 
 
Given the following lexer construct in a grammar file ...
 
INLINE_COMMENT
     :  '/*' ( options {greedy=false;} : . )* '*/'   { $channel=HIDDEN; }
     |  '//' ~('\n'|'\r')* '\r'? '\n'  { $channel=HIDDEN; }
     ;    

If this rule executes on the "/* .... */" construct, it seems as tho my parser is stuck in "not greedy" mode -- that is the match of the any subsequent rules fail.  If I remove the "/* ... */" from the input file everying works. 
 
I'm using AntlrWorks 1.1.7 and Antlr 3.0.1 on Windoze(tm) with JDK 1.6.0_05 
 
thanks for any thoughts on what I am doing wrong ..

Dave Raymer
D: (817)-245-6834       M:(817)501-2665         ICBM: 32.9° N 97.2° W
All that is necessary for the triumph of evil is for good men to do nothing
-- attributed to Edmund Burke 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080521/49739ef1/attachment.html 


More information about the antlr-interest mailing list