Hi, I am using ANTLR 3.1.3.
The class BaseRecognizer has a method getNumberOfSyntaxErrors() that is supposed to return the number of syntax errors detected. The count is maintained in BaseRecognizer.reportError(...). However, the Lexer class overrides this method and does not update the syntax error count when a lexer error is reported. As a result, the syntax error count is not reliable in the lexer. The only way to reliably count lexer syntax errors seems to be to override reportError again and maintain the count yourself. Is this a bug? If it is a feature, it seems to be an undocumented one. Is there a better way to detect whether an error has ocurred during parsing? I could not find a way to suppress error recovery in the lexer, and the comment in the Lexer.reportError implementation is not very promising: it reads "TODO: not thought about recovery in lexer yet." I am looking for a way to reliably detect whether my ANTLR-generated parser and lexer have detected any syntax errors. Regards, Johan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en -~----------~----~----~----~------~----~------~--~---
List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
