help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Token precedence only applies to tokens immediately before and afte


From: Yinpeng Li
Subject: Re: Token precedence only applies to tokens immediately before and after the parsing dot
Date: Tue, 12 May 2009 18:33:24 +0800

Sorry, I am a rookie here...Could you explain more thoroughly?

On Tue, May 12, 2009 at 4:32 PM, Hans Aberg <address@hidden> wrote:

> On 12 May 2009, at 09:06, Yinpeng Li wrote:
>
>  %left OR
>> %left AND
>> ............................
>> %%
>> ............................
>> predicate:    predicate OR predicate                            {
>>                   $$ = new AST_PredicateTreeNode($1, $3,
>> AST_PredicateTreeNode::OR) ;
>>                   REGISTER_AST_NODE($$) ;
>>               }
>>           |    predicate AND predicate                            {
>>                   $$ = new AST_PredicateTreeNode($1, $3,
>> AST_PredicateTreeNode::AND) ;
>>                   REGISTER_AST_NODE($$) ;
>>               }
>>           |    LEFT_PARENTHESIS predicate RIGHT_PARENTHESIS    {
>>                   $$ = $2 ;
>>               }
>>           ;
>>
>> THE ERROR REPORT:
>> state 54
>>
>>  17 predicate: predicate . OR predicate  [END_OF_COMMAND,
>> RIGHT_PARENTHESIS, OR]
>>  17          | predicate OR predicate .  [END_OF_COMMAND,
>> RIGHT_PARENTHESIS, OR]
>>  18          | predicate . AND predicate
>>
>>   AND  shift, and go to state 40
>>
>>   $default  reduce using rule 17 (predicate)
>>
>>   Conflict between rule 17 and token OR resolved as reduce (%left OR).
>>   Conflict between rule 17 and token AND resolved as shift (OR < AND).
>> _______________________________________________
>> address@hidden http://lists.gnu.org/mailman/listinfo/help-bison
>>
>
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]