[antlr-interest] A bug at C# DLLs?

Johannes Luber jaluber at gmx.de
Mon Nov 17 13:57:36 PST 2008


Rodrigo C. L. schrieb:
> Hello!
> 
> I'm new at ANTLR, and I'm using it to generate code for C# (.NET v3.5).
> 
> My grammar is:
> 
> tokens {
> MODULE;
> SPECIFICATION;
> }
> compilation : specification EOF! ;
> specification : ( definition )* -> ^( SPECIFICATION definition* ) ;
> definition : module ';' ;
> module : 'module' ID '{' specification '}' -> ^(MODULE ID specification) ;
> ID : ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'0'..'9'|'_')* ;
> 
> and I have this simple input for test:
> 
> module etal { };
> 
> And I got
> 
> Antlr.Runtime.Tree.RewriteEmptyStreamException{"token ID"},
> 
> which is odd, because ID should be 'etal'.
> 
> I changed the rule module using operators and got
> NullReferenceException, for the same reason.
> 
> I am new at this, so I'm not sure how to handle. Is this a bug from
> the DLLs that I should report or I am doing something wrong? Because I
> tried the same grammar using ANTLRWorks and changing the language to
> Java, and it worked like a charm, with no errors.
> 
> I don't know if this was already discussed, thought I searched for
> this at the most recent Interest Archives. If it was, sorry.
> 
> Thank you all very much for any help.

I believe the cause lies in a bug in the Mono C# compiler. Can you
compile the sources yourself via Visual Studio? Under windows the Nant
script is supposed to be working.

Johannes
> 
>  -- Rodrigo C. Lopes
>  -- Also in r.cerqueira.lopes at gmail.com
> 
> 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