[antlr-interest] Re: Exceptions on errors, thread safety

micheal_jor open.zone at virgin.net
Thu Mar 18 08:40:12 PST 2004


--- In antlr-interest at yahoogroups.com, "Hrvoje Nezic"
<hrvoje.nezic at e...> wrote:
> Hi,

Hi Hrvoje Nezic,

> I haven't used ANTLR for some time, now I installed 2.7.3rc2.
> I am using the C# version.

Did you patch it as detailed on the list? (search for 2.7.3rc2 in the
archives)

> I would like to be able to get exceptions if input text is not correct.
> However, it seems this is not the case. Exceptions are not thrown.
> Instead, error messages are written on the console.

AFAICR - and off the top of my head - this shouldn't be the case.

Questions:
1.  Did you *re-generate* your Lexer/Parser/TreeParser from your
grammar files using 2.7.3rc2?. 
2.  Did you also then re-build your C# project taking care to ensure
that you build against the 2.7.3rc2 runtime and not an older version?

If doing this doesn't fix the issue, send me a copy of your project
and I'll have a look at it.

> Is this by design, and can it be changed somehow?

I need to check if this happens as you describe first but, "No. And
yes, it can be changed".

The intent is that ANTLR lexer/parser/treeparsers should be usable
from all application types and not just command-line apps.

> Is it possible to achieve that error messages are not written on the
console?

Yes. That is the intent.

> My second question is about thread safety: are ANTLT-generated parsers 
> (and especially the C# version) thread-safe?

No. And there is no advantage AFAICT in making them so IMHO. Or is there?

Cheers,

Micheal
ANTLR/C#






 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
     antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list