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

Rodrigo C. L. tapetedepadaria at gmail.com
Mon Nov 17 16:43:59 PST 2008


hello, thanks for the help..

I did all this throught visual studio with .NET, not Mono. I did
compile the grammar with the jar (3.1.1). I'm going to try with NAnt,
but I'm not confident that it'll work.

Anyway, didn't it ocurred with anyone?

My ASTLabelType is CommonTree. Does it help if I change it?

I'm sorry the urge of the questions. I have kind of a deadline. :(

 -- Rodrigo C. Lopes
 -- Também em r.cerqueira.lopes at gmail.com



2008/11/17 Johannes Luber <jaluber at gmx.de>:

> 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. 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.
>>
>>  -- 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