[antlr-interest] How to the generated code in the "catch" section ?

Olivier Lefevre lefevrol at yahoo.com
Thu Feb 28 18:05:36 PST 2008


Gavin Lambert wrote:
> It's syntactically valid but last time I checked ANTLR3 didn't actually 
> do anything with the catch blocks.  (ANTLR2 does support it, and ANTLR3 
> will support it, but I don't think it does yet.)

With regard to parser errors, experimentation shows that in ANTLR 3.0.1
1) a global directive of the form
        @rulecatch { catch (RecognitionException e) { } }
    works
2) a local directive of the form
        catch [RecognitionException e] { } directive
    works and has higher precedence than the global directive if present
3) a local directive of the same form as the global directive is accepted
    but does nothing
The last point is weird. Ter?

-- O.L.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Test_Frag3.java
Url: http://www.antlr.org/pipermail/antlr-interest/attachments/20080229/6d961da5/attachment.pl 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Frag3.g
Url: http://www.antlr.org/pipermail/antlr-interest/attachments/20080229/6d961da5/attachment-0001.pl 


More information about the antlr-interest mailing list