[antlr-interest] Way to "cut" parsing?

Jim Idle jimi at temporal-wave.com
Tue Oct 16 19:39:51 PDT 2012

You may or may not need catch clauses - usually you do not. You will almost
certainly need to influence error recovery by adding the empty rule to do
some magic token eating though, as this is what keeps antlr within the inner
rules as long as possible.


-----Original Message-----
From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Juancarlo Añez
Sent: Wednesday, October 17, 2012 5:58 AM
To: antlr-interest at antlr.org
Subject: Re: [antlr-interest] Way to "cut" parsing?


Without backtracking, then the techniques I explain in the article I sent to
> you will work for this. Give it a try.

Will do. Just to be sure, what I have to do is to add a *catch* clause to
the rules in which I want parsing to be cut, and customize recovery (or
remove recovery) there. Right?

> You may also be using to heavy handed
> lookaheads. A lot of people will write:

> (rule)=>rule when they in fact only need (X|Y|Z)=>rule

Guilty as charged! I will look into that too.


Juancarlo *Añez*

List: http://www.antlr.org/mailman/listinfo/antlr-interest

More information about the antlr-interest mailing list