[antlr-interest] Problem catching exceptions in c# generated code

Ed Sykes ed.sykes at gmail.com
Thu Feb 21 07:04:42 PST 2008


I've just tried moving the try catch into the lexer around the call to
Antlr.Runtime.Match() and this seems to catch the exception. I'm confused as
to why putting the code in the driver doesn't work, but moving the try catch
to the lexer does.

at least i have a workaround if i can't figure out how to get it working in
the driver.

On Thu, Feb 21, 2008 at 2:59 PM, Ed Sykes <ed.sykes at gmail.com> wrote:

>
> ahh ok then yes, the try catch block is inside the driver. You say that
> this doesn't work in 3.01?
>
>
> On Thu, Feb 21, 2008 at 2:55 PM, Johannes Luber <jaluber at gmx.de> wrote:
>
> > Ed Sykes schrieb:
> > > On Thu, Feb 21, 2008 at 2:50 PM, Ed Sykes <ed.sykes at gmail.com
> > > <mailto:ed.sykes at gmail.com>> wrote:
> > >
> > >     I'm not sure what you mean by driver,
> > >
> > >     but the catch clause is in the code that calls expr() which is
> > >     outside any generated files (i.e. in my calling code).
> >
> > That is the driver program. Just to get your situation: ANTLR generates
> > exceptions. Do you have in the generated code some catch clause which
> > isn't called? Or do you complain that you had to add a catch clause to
> > your driver?
> >
> > Johannes
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080221/16e284a0/attachment-0001.html 


More information about the antlr-interest mailing list