[antlr-interest] No match

Jason Hocker jkh at datatel.com
Sat May 26 18:52:54 PDT 2007


I mean that the rule doesn't match... so the loop breaks out... so there 
is code that I want the parser to parse, but the parser has finished its 
method.

Matching nothing is also valid, so I want to keep it at zero-to-many. What 
I want to add is that if I have bad code there is an error reported.



Jason Hocker, SCJP (1.4), SCWCD (1.3, 1.4), SCMAD, SCDJWS 
Senior Developer
Datatel, Inc.
How higher education does business.

Voice: 703-653-1221
Fax: 703-802-3965
E-Mail: jkh at datatel.com
www.datatel.com




"Micheal J" <open.zone at virgin.net> 
Sent by: antlr-interest-bounces at antlr.org
05/26/2007 09:45 PM

To
<antlr-interest at antlr.org>
cc

Subject
Re: [antlr-interest] No match






You could start by making the rule non-optional.
 
    code:    (ruleA | ruleB ... ruleD)+ ;
 
When you say the parser continues and ends, what exactly do you mean?.
 
Micheal
 
-----------------------
The best way to contact me is via the list/forum. My time is very limited. 

-----Original Message-----
From: antlr-interest-bounces at antlr.org 
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Jason Hocker
Sent: 27 May 2007 02:38
To: antlr-interest at antlr.org
Subject: [antlr-interest] No match


We have a rule like: 

code: (ruleA | ruleB | ruleC | ruleD)*; 

So if we try to parse code that is wrong... it won't match any of these 
rules, and the parser continues and end. 

How can we better implement error handling? 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070526/92a2da45/attachment.html 


More information about the antlr-interest mailing list