[antlr-interest] Catching errors

Peter Kronenberg PKronenberg at technicacorp.com
Wed Dec 7 07:00:07 PST 2005


How can I trap parsing errors from Antlr?  When there is a syntax error
in the expression, I get something like this on System.err:

line 1:16: unexpected token: 80

But in my Java code, the call to the parser returns with no errors. The
only indication that there is a problem is that parser.getAST() returns
null.  So I can detect that there is an error, but I'd like to be able
to trap the text of the error so I can display it properly in the
client. 


Peter Kronenberg
Software Engineer
(703) 885-1222
pkronenberg at technicacorp.com


The information contained in this transmission may contain privileged and confidential information. It is intended only for the use of the person(s) named above. If you are not the intended recipient, you are hereby notified that any review, dissemination, distribution or duplication of this communication is strictly prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. Technica Corporation does not represent this e-mail to be free from any virus, fault or defect and it is therefore the responsibility of the recipient to first scan it for viruses, faults and defects. To reply to our e-mail administrator directly, please send an e-mail to postmaster at technicacorp.com. Thank you.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20051207/0ee46627/attachment-0001.html


More information about the antlr-interest mailing list