[antlr-interest] How can I capture an error?

Luciana Nunes Leal lucianaleal2002 at yahoo.com.br
Tue Dec 6 09:30:38 PST 2005


Hi all,
   
  I´d like to know how can I capture an error?
  For example, I defined the grammar, generate de lexer and the parser. After, I create a class that execute the parser, like below:
   
  ...
  LNCLexer lexer = new LNCLexer(stringReader);
LNCParser parser = new LNCParser(lexer);
parser.rule();
...
   
  But I need to capture errors like this: "line 1:1: unexpected token: when". The method doesn´t throw exceptions.
   
  Thanks in advance, 
  Luciana.

		
---------------------------------
 Yahoo! doce lar. Faça do Yahoo! sua homepage.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20051206/843302dd/attachment.html


More information about the antlr-interest mailing list