[antlr-interest] deleting a left-recursive

jabon elekis at gmail.com
Fri May 2 23:47:37 PDT 2008


Johannes Luber a écrit :
> jabon schrieb:
>> hi all,
>>
>> I have a little probleme with my grammar , I have a left recursive 
>> and I have lot of diffcult to remove this.  I need a little help (I m 
>> not an expert sorry and compilations lessons are far away)
>>
>> expression
>>    : T_LParent expression T_RParent
>>    | binaryExpression
>>    | castExpression
>>    | desig | literal
>>    | newExpression
>>    | quantifierExpression
>>    | unaryExpression
>>    ;
>>
>>
>> binaryExpression
>>    : (expression (T_Ne|T_Eq|T_Ge|T_Le|T_Lt|T_Gt) expression)
>>    |(expression (T_And|T_Mod|T_Star|T_Slash) expression)
>>    |(expression (T_Iff|T_Implies|T_Or|T_Plus|T_Minus) expression);
>>
>> thanks a lot
>>
>> a+++
>>
>
> You've reminded me that I didn't posted my tutorial about 
> left-recursion removal yet. After 1 hour or so intense formatting you 
> can see the result here: 
> <http://www.antlr.org/wiki/display/ANTLR3/Left-Recursion+Removal>. 
> Hopefully it is helpful enough. :)
>
> Johannes
thanks all, I ll look

a++


More information about the antlr-interest mailing list