*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.217 2001/01/20 17:37:52 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.218 2001/01/23 22:39:08 tgl Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
%nonassoc OVERLAPS
%nonassoc BETWEEN
%nonassoc IN
+%left POSTFIXOP /* dummy for postfix Op rules */
%left Op /* multi-character ops and user-defined operators */
%nonassoc NOTNULL
%nonassoc ISNULL
-%nonassoc NULL_P
-%nonassoc IS
+%nonassoc IS NULL_P TRUE_P FALSE_P /* sets precedence for IS NULL, etc */
%left '+' '-'
%left '*' '/' '%'
%left '^'
/* Unary Operators */
-%left AT
+%left AT ZONE /* sets precedence for AT TIME ZONE */
%right UMINUS
%left '.'
%left '[' ']'
{ $$ = makeA_Expr(OP, $2, $1, $3); }
| Op a_expr
{ $$ = makeA_Expr(OP, $1, NULL, $2); }
- | a_expr Op
+ | a_expr Op %prec POSTFIXOP
{ $$ = makeA_Expr(OP, $2, $1, NULL); }
| a_expr AND a_expr
n->typename->typmod = -1;
$$ = makeA_Expr(OP, "=", $1,(Node *)n);
}
- | a_expr BETWEEN b_expr AND b_expr
+ | a_expr BETWEEN b_expr AND b_expr %prec BETWEEN
{
$$ = makeA_Expr(AND, NULL,
makeA_Expr(OP, ">=", $1, $3),
makeA_Expr(OP, "<=", $1, $5));
}
- | a_expr NOT BETWEEN b_expr AND b_expr
+ | a_expr NOT BETWEEN b_expr AND b_expr %prec BETWEEN
{
$$ = makeA_Expr(OR, NULL,
makeA_Expr(OP, "<", $1, $4),
$$ = n;
}
}
- | a_expr all_Op sub_type select_with_parens
+ | a_expr all_Op sub_type select_with_parens %prec Op
{
SubLink *n = makeNode(SubLink);
n->lefthand = makeList1($1);
{ $$ = makeA_Expr(OP, $2, $1, $3); }
| Op b_expr
{ $$ = makeA_Expr(OP, $1, NULL, $2); }
- | b_expr Op
+ | b_expr Op %prec POSTFIXOP
{ $$ = makeA_Expr(OP, $2, $1, NULL); }
;