[antlr-interest] v3.1.2 breakage in Lexer with +=

Greg Smolyn greg at smolyn.org
Tue Mar 10 14:42:26 PDT 2009


Hi, I just gave that a try and it doesn't come out right at all.

Try compiling it-- you'll see that it's missing the variable  
introduction for $h.Count

In mF_UNICODEDIGITS, it should be creating an IToken or ITree h, as  
well as IList list_h.  This was what ANTLR 3.1.1 did.  However, it  
does not, and so $h.Count cannot be compiled, because there is no  
variable to be put in the place for $h!

The list_h was there before and is the list that h is supposed to get  
added to.


On 10-Mar-09, at 2:36 PM, Johannes Luber wrote:
>
> grammar TestList;
>
> options{
> language=CSharp2;
> }
>
>
> rule
> 	:	DIGIT
> 	;
>
> DIGIT
> 	:	 F_UNICODEDIGITS
> 	;
>
> fragment F_HEXDIGIT
>   : '0'..'9' | 'a'..'f' | 'A'..'F'
>   ;
>
> fragment F_UNICODEDIGITS
>   : (h+=F_HEXDIGIT)+ {$h.Count <= 6}?
>   ;

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090310/1ddbca9c/attachment.html 


More information about the antlr-interest mailing list