[antlr-interest] Re: 2.7.2a4 ANTLR/C# - build ok, panic shutdown

micheal_jor open.zone at virgin.net
Wed Dec 4 04:58:50 PST 2002


Hi Daniel,

> First, thanks for the reply.  I followed your advice, went back to 
2.7.2a4
> for ANTLR/C#, and got it to build.  It turns out my mistake was in 
trying to
> compile the C# codegen files by themselves, using commands 
like "javac
> CSharp*.java".  A simple "javac *.java" works fine.

The following files in the ANTLR root directory are provided just for 
this purpose:

build.bat
build-actions.bat
build-codegen.bat

The csharp-runtime.html document in the 'doc' directory has further 
information about their building ANTLR/C#.

<SNIP>

> That doesn't work with
> assembly-qualified names.  As a result, the tokens weren't getting 
created,
> and panic() was getting called instead.  By taking the assembly bit 
off the
> type name, like this:
> 
>   myLexer.setTokenObjectClass("MyClass.CustomToken")
> 
> I got the code to run.

This should have been included in the release announcement for 
2.7.2a4 and the updated 2.7.2a2. My apologies to ANTLR/C# users if it 
wasn't.

> That, however, is not the bug.  The bug has to do
> with the panic routine:
> 
>   public virtual void  panic(string s)
>   {
>      Console.Error.WriteLine("CharScanner; panic: " + s);
>      Environment.Exit(1);
>   }

You are correct that Environment.Exit is bad for GUI apps. I'll look 
into this. In the meantime you can override the method as Richard 
suggests in his reply.

Cheers!,

Micheal



 

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



More information about the antlr-interest mailing list