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 [EMAIL PROTECTED]

List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org:8080/mailman/options/antlr-interest/your-email-address


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to