[antlr-interest] Get string from cmd output when run jar file about parsetree

Michael Matera mike.matera at xilinx.com
Mon Nov 29 10:45:37 PST 2010


Hi,

Take a look at the documentation here:

http://www.antlr.org/wiki/display/ANTLR3/Error+reporting+and+recovery

Here's the summary:  You must override the error reporting mechanisms of 
your parser.  Then you can do whatever you want with the text of the 
errors.

Cheers
./m

beginner.nguyen wrote:
> Hi, all
> I use antlr-3.2.jar tool to general java code of a grammar, after that  I
> built a program by java language to output a parsetree. 
> When i run my program in cmd with input string: "which tour beggin ain
> 11/11/2010 ?" 
> then a message appear in cmd: "line 1:19 no viable alternative at character
> 'a'". I know that the message appear because I type incorrect at "ain",
> correct must be "in". But I want to get that message and set into a string
> variable. could you help me.(I have attached a image)
> Thank you very much. looking forward from you.
> http://antlr.1301665.n2.nabble.com/file/n5780991/h2.jpg 

This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.




More information about the antlr-interest mailing list