[antlr-interest] Error rollback on incomplete input?
Darien Hager
darien.hager at etelos-inc.com
Tue Feb 12 17:20:45 PST 2008
More or less solved, and I feel a little silly at missing it the first time
around. Huzzah for exploratory debugging. For the search engine record and
lurkers:
Use the CommonTokenStream's mark() and
rewind() functions. (Assuming you've already disabled ANTLR's recovery attempts)
Alternately, the index() and get() methods of CommonTokenStream can pull
back the next Token about to be processed, which in turn has information
about it's offset within the stream or original string.
--
Darien Hager
Developer
Etelos, Inc.
darien at etelos.com
http://www.etelos.com
"Revolutionizing the way applications are developed, distributed and
consumed."
This e-mail message, including attachments, may contain confidential
information for the sole use of the intended recipient(s). If you are not
the intended recipient, then this is notice that any use, disclosure,
dissemination, distribution or copying is strictly prohibited. If you have
received this message in error please contact the sender by reply mail and
destroy all copies of the original message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080212/6007806a/attachment.html
More information about the antlr-interest
mailing list