[antlr-interest] Catching multiple errors in a tree parser

Heiko Folkerts Heiko.Folkerts at david-bs.de
Thu Nov 26 01:37:15 PST 2009


Hi all,
I want to catch more then one error within my tree parser. I read somewhere that tree parsers don't recover from the first error since parsing errors in tree grammars are the programmers fault. Have I got that wrong?

Since we use several parsers to create and validate our AST sometimes we have to report more than one error from within the tree parser but only the first one is reported via the displayError routine.

So my question is: how can I make the parser report every error that is encountered instead of only the first?

For our errors we create exceptions and attach the info we need to the custom pointer from within the grammar. 

Regareds 
Heiko


Mit freundlichem Gruß
Heiko Folkerts
Systementwicklung und -design
--
______________________________________________
DAVID GmbH · Wendenring 1 · 38114 Braunschweig
Tel.: +49 531 24379-14
Fax.: +49 531 24379-79
E-Mail: mailto:Heiko.Folkerts at david-bs.de
WWW:   http://www.david-bs.de 
Eintragung: Amtsgericht Braunschweig, HRB 3167
Geschäftsführer: Frank Ptok
______________________________________________

 


More information about the antlr-interest mailing list