[antlr-interest] v3.1.2 breakage in Lexer with +=
Johannes Luber
jaluber at gmx.de
Tue Mar 10 15:05:37 PDT 2009
Greg Smolyn schrieb:
> 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.
Ah, I didn't notice that. I've managed to trace the cause down to a line
which ended up in the wrong template. I'll look into another release to
fix that problem.
Johannes
>
>
> 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}?
>> ;
>
More information about the antlr-interest
mailing list