1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Add ^ precidence.

This commit is contained in:
Bruce Momjian
1999-07-08 00:00:43 +00:00
parent 38ff52c379
commit 104d6c816e
3 changed files with 37 additions and 10 deletions

View File

@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.86 1999/07/04 04:55:59 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.87 1999/07/08 00:00:42 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@ -349,7 +349,7 @@ Oid param_type(int t); /* used in parse_expr.c */
%nonassoc NULL_P
%nonassoc IS
%left '+' '-'
%left '*' '/' '%'
%left '*' '/' '%' '^'
%left '|' /* this is the relation union op, not logical or */
/* Unary Operators */
%right ':'
@ -973,6 +973,8 @@ default_expr: AexprConst
{ $$ = nconc( $1, lcons( makeString( "%"), $3)); }
| default_expr '*' default_expr
{ $$ = nconc( $1, lcons( makeString( "*"), $3)); }
| default_expr '^' default_expr
{ $$ = nconc( $1, lcons( makeString( "^"), $3)); }
| default_expr '=' default_expr
{ elog(ERROR,"boolean expressions not supported in DEFAULT"); }
| default_expr '<' default_expr
@ -1121,6 +1123,8 @@ constraint_expr: AexprConst
{ $$ = nconc( $1, lcons( makeString( "%"), $3)); }
| constraint_expr '*' constraint_expr
{ $$ = nconc( $1, lcons( makeString( "*"), $3)); }
| constraint_expr '^' constraint_expr
{ $$ = nconc( $1, lcons( makeString( "^"), $3)); }
| constraint_expr '=' constraint_expr
{ $$ = nconc( $1, lcons( makeString( "="), $3)); }
| constraint_expr '<' constraint_expr
@ -3641,8 +3645,12 @@ a_expr: attr opt_indirection
{ $$ = doNegate($2); }
| '%' a_expr
{ $$ = makeA_Expr(OP, "%", NULL, $2); }
| '^' a_expr
{ $$ = makeA_Expr(OP, "^", NULL, $2); }
| a_expr '%'
{ $$ = makeA_Expr(OP, "%", $1, NULL); }
| a_expr '^'
{ $$ = makeA_Expr(OP, "^", $1, NULL); }
| a_expr '+' a_expr
{ $$ = makeA_Expr(OP, "+", $1, $3); }
| a_expr '-' a_expr
@ -3653,6 +3661,8 @@ a_expr: attr opt_indirection
{ $$ = makeA_Expr(OP, "%", $1, $3); }
| a_expr '*' a_expr
{ $$ = makeA_Expr(OP, "*", $1, $3); }
| a_expr '^' a_expr
{ $$ = makeA_Expr(OP, "^", $1, $3); }
| a_expr '<' a_expr
{ $$ = makeA_Expr(OP, "<", $1, $3); }
| a_expr '>' a_expr
@ -4302,8 +4312,12 @@ b_expr: attr opt_indirection
{ $$ = doNegate($2); }
| '%' b_expr
{ $$ = makeA_Expr(OP, "%", NULL, $2); }
| '^' b_expr
{ $$ = makeA_Expr(OP, "^", NULL, $2); }
| b_expr '%'
{ $$ = makeA_Expr(OP, "%", $1, NULL); }
| b_expr '^'
{ $$ = makeA_Expr(OP, "^", $1, NULL); }
| b_expr '+' b_expr
{ $$ = makeA_Expr(OP, "+", $1, $3); }
| b_expr '-' b_expr
@ -4312,6 +4326,8 @@ b_expr: attr opt_indirection
{ $$ = makeA_Expr(OP, "/", $1, $3); }
| b_expr '%' b_expr
{ $$ = makeA_Expr(OP, "%", $1, $3); }
| b_expr '^' b_expr
{ $$ = makeA_Expr(OP, "^", $1, $3); }
| b_expr '*' b_expr
{ $$ = makeA_Expr(OP, "*", $1, $3); }
| ':' b_expr

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.49 1999/05/12 07:12:51 thomas Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.50 1999/07/08 00:00:43 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -155,7 +155,7 @@ identifier {letter}{letter_or_digit}*
typecast "::"
self [,()\[\].;$\:\+\-\*\/\%\<\>\=\|]
self [,()\[\].;$\:\+\-\*\/\%\^\<\>\=\|]
op_and_self [\~\!\@\#\^\&\|\`\?\$\:\+\-\*\/\%\<\>\=]
operator {op_and_self}+