[antlr-interest] A bug at C# DLLs?
Rodrigo C. L.
tapetedepadaria at gmail.com
Tue Nov 18 06:25:44 PST 2008
I forgot to tell. The error occurs when I construct the tree..
-- Rodrigo C. Lopes
-- Também em r.cerqueira.lopes at gmail.com
2008/11/18 Rodrigo C. L. <tapetedepadaria at gmail.com>:
> 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 r.cerqueira.lopes at gmail.com
>
>
>
> 2008/11/18 Gavin Lambert <antlr at mirality.co.nz>:
>> 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 ';'! ;
>>
>>
>
More information about the antlr-interest
mailing list