[antlr-interest] strangeness parsing comments
Raymer David-fdr017
David.Raymer at motorola.com
Wed May 21 13:23:21 PDT 2008
well .. this was a symptom, not the problem. The problem is actually another lexer rule ... it appears that rule is a misuse of the lexer, and should be implemented as a parser rule.
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
________________________________
From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-bounces at antlr.org] On Behalf Of Raymer David-fdr017
Sent: Wednesday, May 21, 2008 2:47 PM
To: antlr-interest at antlr.org
Subject: [antlr-interest] strangeness parsing comments
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/cbc4dc18/attachment.html
More information about the antlr-interest
mailing list