[antlr-interest] Re: Error recovery
lgcraymer
lgc at mail1.jpl.nasa.gov
Fri Apr 9 22:09:52 PDT 2004
What you really want to change is the input buffering. Check out
CharBuffer.java in the antlr directory and write an equivalent
(assuming that you are using Java--C++ and C# differ) that blocks on
interactive input at end of line rather than returning EOF.
--Loring
--- In antlr-interest at yahoogroups.com, "jduquevieira" <jpdv at m...> wrote:
> Hello.
>
> I have a math editor that uses ANTLR as the parser.
> Now I have problems recovering from errors.
>
> For instance, if the user writes:
> "2+"
>
> The parser can't handle it, because it expects another number after
> the sum operator:
> "2+<number>"
>
> I've tried to handle it with exceptions and got no good results.
> Besides, by using exceptions the parser gets too slow.
>
> I've also tried to write every possibility in every rule, but I get
> a lot of ambiguities.
>
> Does anyone know how to do this?
> Any ideas?
>
> Thanks in advance.
> Best regards.
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