[antlr-interest] Restarting a rule

David Penton djplists at arrowsash.com
Sun Feb 9 19:36:40 PST 2003


Sorry to answer my own post, but I see that my first question in the
original post does not require an answer.  I am barking up the wrong
tree with that approach; I think I need to be doing token filtering
instead.

I would appreciate confirmation that there is no way to set global error
code in a parser (i.e. exception handling code for every rule.)

- Dave -

On Sun, 2003-02-09 at 22:22, David Penton wrote:
> I switched to 2.7.2; all is well - it fixes some things that had been
> problems for my project.
> 
> Now my questions.  (I asked similar or related questions a couple weeks
> ago but did not quite solve my problem. Sorry for more or less repeating
> myself.)
> 
> Q1: Is there a good way to skip over a bad token in a parser?  In other
> words, I don't want the default handling (syncing and moving to the next
> rule), but rather I want to test the token (I guess in the exception
> handler) and restart the "present" rule if it is a certain kind of
> token. This may be a java question instead of an antlr question.
> 
> Q2: It looks like it is not possible to set error handling code in a
> parser "globally", i.e. something that gets copied into every method
> implementing a rule.  Is that right?
> 
> Thanks much.
> 
> - Dave -
> 
> 
> 
> 
>  
> 
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 
> 
> 



 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list