[antlr-interest] @rulecatch for lexer, doable?

Terence Parr parrt at cs.usfca.edu
Sat Jan 17 16:30:28 PST 2009


try @lexer::rulecatch...not sure the lexers respond to this, however.  
They do not individually trap exceptions I think. Look at the  
nextToken() method. It should be the thing that handles errors emitted  
from calling mTokens() rule method.

Ter
On Jan 17, 2009, at 4:17 PM, Mats Ekberg wrote:

> Hi!
>
> To generate a custom catch clause in the parser one can write:
>
> @rulecatch {
>     ..code..
> }
>
> How do I accomplish the same thing in the lexer?
>
> /mats
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address



More information about the antlr-interest mailing list