On Wed, 2008-09-17 at 16:27 -0400, Tim Halloran wrote:
> On Wed, Sep 17, 2008 at 3:27 PM, Terence Parr <[EMAIL PROTECTED]>
> wrote:
> 
>         Just throw an Error, which will not require a change to the
>         signature and will blast all way out.
> 
> 
> This is undesirable because it breaks the client side and loses
> reporting information.  My client side looks like:


Basically though, if your lexer is throwing NVA's, it means it isn't
complete or has bugs. By rights, the lexer should make something out of
anything, even if it is a throw away element:

ANY : . { skip(); }

Or more likely, a more controlled error message:
ANY : . { myErrorLog.error("The character " + $text + " is not
supported."); $channel = HIDDEN; }




> 



> }
> }
> 
> A better approach (like an option to turn off lexer error recovery)
> seems a good enhancement to a future version of ANTLR.  

Given all the things that can happen, the approach now seems best. It is
not difficult to override a method.


> That said, this approach is nice because it works in the way most
> folks client code would expect.


Lexer recovery is just that it eats the character it did not want. There
is not much else you can do. If you turn it off, then what should it do?

Jim


> 
> Regards,
> Tim
> 
> 
> List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest
> Unsubscribe: 
> http://www.antlr.org:8080/mailman/options/antlr-interest/your-email-address
> 
> 

> 
> 

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org:8080/mailman/options/antlr-interest/your-email-address

Reply via email to