[antlr-interest] 3.1 C - target and error recovery

Jim Idle jimi at temporal-wave.com
Tue Sep 2 07:49:51 PDT 2008


On Tue, 2008-09-02 at 15:45 +0200, Corno Schraverus wrote:

> Hi all,
> 
> I'm having problems with the error recovery in the C target. When a syntax
> error is found, an error message is printed to the console, the rule is
> exited and then later on the compiler crashes during the evaluation of
> another rule.
> I have no clue on how to debug this. Can anyone give me some pointers on how
> I could find the cause?


Compile your programs, and the C runtime with debug information built
in. IF you look at the ./configure --help output, you will see that it
allows you to include debug information in the code (don't confuse it
with enabling/disabling the ANTLR debugger).

Then run your parser with the valgrind program. 

Also, make sure you get the update I provided yesterday to stop tokens
whose text is an empty "" having no terminator. That might be your
issue.

Jim

> 
> The tokens are custom made, maybe that could be the cause but I can't see
> how the parser could work fine if there are no syntax errors, and even if
> there are, it is still able to print the error info but crash later on.
> 
> greetings,
> 
> Corno
> 
> 
> 
> 
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080902/ff10ee90/attachment.html 


More information about the antlr-interest mailing list