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).
_______________________________________________
help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison



_______________________________________________
help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Reply via email to