[antlr-interest] Re: strong error recovery

Neurosurg khamenya at mail.ru
Fri Jul 30 02:17:01 PDT 2004


Thank you for you reply, Monty

--- In antlr-interest at yahoogroups.com, Monty Zukowski <monty at c...> wrote:
> Here's the idea.  Follow my discussion in my article about how to write 
> a parser which grabs tokens from the input stream and then only parses 
> when it sees an interesting token.  In my example GOTO was one such 
> token that should be parsed.  In your example it will be anything that 
> can be an expression.

That's the point. In my case, the valid symbols might be a part of the
garbage:

input:
+)((7+5)*8

extracted output:
(7+5)*8

So, the following your advice looks for me as closer 
approach to my case:
 
> [...]Now that I think about it, there are probably other ways to handle 
> this.  For instance if you aren't passing on to a TokenStream, you 
> could get by with a parser rule like this:
> 
> top: (expr | .)*;

however this doesn't work as well for the test above and test posted
in my original post.


Best regards,
Valery




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

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



More information about the antlr-interest mailing list