Skip to content

Commit

Permalink
Cleanup: fixing shift-reduce conflicts in expr/bool_pri/predicate
Browse files Browse the repository at this point in the history
  • Loading branch information
abarkov authored and vaintroub committed May 21, 2018
1 parent 508373d commit b73083c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
11 changes: 7 additions & 4 deletions sql/sql_yacc.yy
Expand Up @@ -892,10 +892,10 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%parse-param { THD *thd }
%lex-param { THD *thd }
/*
Currently there are 99 shift/reduce conflicts.
Currently there are 72 shift/reduce conflicts.
We should not introduce new conflicts any more.
*/
%expect 99
%expect 72

/*
Comments for TOKENS.
Expand Down Expand Up @@ -1658,7 +1658,10 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%left OR_SYM OR2_SYM
%left XOR
%left AND_SYM AND_AND_SYM

%left PREC_BELOW_NOT
%left NOT_SYM

%left BETWEEN_SYM CASE_SYM WHEN_SYM THEN_SYM ELSE
%left '=' EQUAL_SYM GE '>' LE '<' NE IS LIKE REGEXP IN_SYM
%left '|'
Expand Down Expand Up @@ -9581,7 +9584,7 @@ expr:
if (unlikely($$ == NULL))
MYSQL_YYABORT;
}
| bool_pri
| bool_pri %prec PREC_BELOW_NOT
;

bool_pri:
Expand Down Expand Up @@ -9717,7 +9720,7 @@ predicate:
if (unlikely($$ == NULL))
MYSQL_YYABORT;
}
| bit_expr
| bit_expr %prec PREC_BELOW_NOT
;

bit_expr:
Expand Down
11 changes: 7 additions & 4 deletions sql/sql_yacc_ora.yy
Expand Up @@ -284,10 +284,10 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%parse-param { THD *thd }
%lex-param { THD *thd }
/*
Currently there are 99 shift/reduce conflicts.
Currently there are 73 shift/reduce conflicts.
We should not introduce new conflicts any more.
*/
%expect 99
%expect 73

/*
Comments for TOKENS.
Expand Down Expand Up @@ -1050,7 +1050,10 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%left OR_SYM OR2_SYM
%left XOR
%left AND_SYM AND_AND_SYM

%left PREC_BELOW_NOT
%left NOT_SYM

%left BETWEEN_SYM CASE_SYM WHEN_SYM THEN_SYM ELSE
%left '=' EQUAL_SYM GE '>' LE '<' NE IS LIKE REGEXP IN_SYM
%left '|'
Expand Down Expand Up @@ -9664,7 +9667,7 @@ expr:
if (unlikely($$ == NULL))
MYSQL_YYABORT;
}
| bool_pri
| bool_pri %prec PREC_BELOW_NOT
;

bool_pri:
Expand Down Expand Up @@ -9800,7 +9803,7 @@ predicate:
if (unlikely($$ == NULL))
MYSQL_YYABORT;
}
| bit_expr
| bit_expr %prec PREC_BELOW_NOT
;

bit_expr:
Expand Down

0 comments on commit b73083c

Please sign in to comment.