Tried that too.
The error is not at definition. I made this simple grammar:
grammar Test;
options {
language=CSharp2;
output=AST;
ASTLabelType=CommonTree;
}
phrase : WORD ( ',' WORD ) -> ^( ',' WORD+ ) ;
WORD : ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'0'..'9'|'_')* ;
WS : ( '\t' | ' ' | '\r' | '\n' | '\u000C' )+ { $channel=HIDDEN; } ;
and the very same error persists at WORD.
Doesn't it happen with anyone else?
I'll try with some older release..
-- Rodrigo C. Lopes
-- Também em [EMAIL PROTECTED]
2008/11/18 Gavin Lambert <[EMAIL PROTECTED]>:
> At 09:08 18/11/2008, Rodrigo C. L. wrote:
>>compilation : specification EOF! ;
>>specification : ( definition )* -> ^( SPECIFICATION definition* );
>>definition : module ';' ;
>>module : 'module' ID '{' specification '}' -> ^(MODULE ID
>>specification) ;
> [...]
>>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'm not sure why the error message mentions ID, but I suspect the problem is
> actually with the 'definition' rule. It's the only rule in the group that
> doesn't contain any tree construction at all (neither rewrite expressions
> nor tree operators).
>
> I've never been entirely sure what ANTLR does with rules that don't define
> tree construction, but I seem to recall it causing problems at some point.
> So try:
>
> definition : module ';'! ;
>
>
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
-~----------~----~----~----~------~----~------~--~---