[antlr-interest] ANTLR Error Messages

Joel da Silva js at cin.ufpe.br
Wed Feb 21 11:22:44 PST 2007


Hello friends,
I am trying to develop an application that uses a parser generated by the
Antlr.
In my application source code, I call:
...
       MDXLexer lexer = new MDXLexer(...
       MDXRecognizer parser = new MDXRecognizer(lexer);
        try {
            parser.mdx_statement();
        }
        catch (RecognitionException e) {
            e.printStackTrace();
        }
        catch (TokenStreamException e) {
            e.printStackTrace();
        }

Thus, sending a erroneous input, a error message will appear:
" line 1:106: unexpected token: null
  line 1:106: expecting "FROM", found 'null'  "

But, how can I return the error messages for my application?  and handling
this message?
thanks for your attention,
best regards
Joel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070221/96be3510/attachment.html 


More information about the antlr-interest mailing list