[antlr-interest] ANTLR - Detecting if parsing was successful

tcorbat at hsr.ch tcorbat at hsr.ch
Fri Apr 23 13:05:40 PDT 2010


Hi Kunal

That's not quite correct. The @after block gets executed after matching a rule. It is not executed during syntactic predicate evaluation, or backtracking respectively. So if your @after block gets executed I think the rule must have matched. Could you give an example for reproducing your observation? Input and Rules?

Regards
Thomas

________________________________________
Von: antlr-interest-bounces at antlr.org [antlr-interest-bounces at antlr.org] im Auftrag von Kunal Sawlani [kunalsawlani at gmail.com]
Gesendet: Freitag, 23. April 2010 19:56
An: antlr-interest at antlr.org
Betreff: [antlr-interest] ANTLR - Detecting if parsing was successful

Hi,
I am a new to ANTLR and have been trying to detect if the parsing was
successful or not. As of now, I was using the @after block, which gets
executed
only if the parsing was successful. But this block gets executed, even for
incorrect inputs in the language. I think I am missing something, which I
must do
to deactivate the error recovery mechanism, to avoid the after block from
being executed. Can anyone please guide me to some material on this issue.

Any help would be greatly appreciated.
Thanks
--
Kunal

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address


More information about the antlr-interest mailing list