*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.102 1998/02/03 16:04:02 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.103 1998/02/03 19:26:41 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
n->subselect = $7;
$$ = (Node *)n;
}
+ | '(' row_descriptor ')' '+' ANY '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = $2;
+ n->oper = lcons("+",NIL);
+ n->useor = false;
+ n->subLinkType = ANY_SUBLINK;
+ n->subselect = $7;
+ $$ = (Node *)n;
+ }
+ | '(' row_descriptor ')' '-' ANY '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = $2;
+ n->oper = lcons("-",NIL);
+ n->useor = false;
+ n->subLinkType = ANY_SUBLINK;
+ n->subselect = $7;
+ $$ = (Node *)n;
+ }
+ | '(' row_descriptor ')' '/' ANY '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = $2;
+ n->oper = lcons("/",NIL);
+ n->useor = false;
+ n->subLinkType = ANY_SUBLINK;
+ n->subselect = $7;
+ $$ = (Node *)n;
+ }
+ | '(' row_descriptor ')' '*' ANY '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = $2;
+ n->oper = lcons("*",NIL);
+ n->useor = false;
+ n->subLinkType = ANY_SUBLINK;
+ n->subselect = $7;
+ $$ = (Node *)n;
+ }
+ | '(' row_descriptor ')' '<' ANY '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = $2;
+ n->oper = lcons("<",NIL);
+ n->useor = false;
+ n->subLinkType = ANY_SUBLINK;
+ n->subselect = $7;
+ $$ = (Node *)n;
+ }
+ | '(' row_descriptor ')' '>' ANY '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = $2;
+ n->oper = lcons(">",NIL);
+ n->useor = false;
+ n->subLinkType = ANY_SUBLINK;
+ n->subselect = $7;
+ $$ = (Node *)n;
+ }
+ | '(' row_descriptor ')' '=' ANY '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = $2;
+ n->oper = lcons("=",NIL);
+ n->useor = false;
+ n->subLinkType = ANY_SUBLINK;
+ n->subselect = $7;
+ $$ = (Node *)n;
+ }
| '(' row_descriptor ')' Op ALL '(' SubSelect ')'
{
SubLink *n = makeNode(SubLink);
n->subselect = $7;
$$ = (Node *)n;
}
+ | '(' row_descriptor ')' '+' ALL '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = $2;
+ n->oper = lcons("+",NIL);
+ n->useor = false;
+ n->subLinkType = ALL_SUBLINK;
+ n->subselect = $7;
+ $$ = (Node *)n;
+ }
+ | '(' row_descriptor ')' '-' ALL '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = $2;
+ n->oper = lcons("-",NIL);
+ n->useor = false;
+ n->subLinkType = ALL_SUBLINK;
+ n->subselect = $7;
+ $$ = (Node *)n;
+ }
+ | '(' row_descriptor ')' '/' ALL '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = $2;
+ n->oper = lcons("/",NIL);
+ n->useor = false;
+ n->subLinkType = ALL_SUBLINK;
+ n->subselect = $7;
+ $$ = (Node *)n;
+ }
+ | '(' row_descriptor ')' '*' ALL '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = $2;
+ n->oper = lcons("*",NIL);
+ n->useor = false;
+ n->subLinkType = ALL_SUBLINK;
+ n->subselect = $7;
+ $$ = (Node *)n;
+ }
+ | '(' row_descriptor ')' '<' ALL '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = $2;
+ n->oper = lcons("<",NIL);
+ n->useor = false;
+ n->subLinkType = ALL_SUBLINK;
+ n->subselect = $7;
+ $$ = (Node *)n;
+ }
+ | '(' row_descriptor ')' '>' ALL '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = $2;
+ n->oper = lcons(">",NIL);
+ n->useor = false;
+ n->subLinkType = ALL_SUBLINK;
+ n->subselect = $7;
+ $$ = (Node *)n;
+ }
+ | '(' row_descriptor ')' '=' ALL '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = $2;
+ n->oper = lcons("=",NIL);
+ n->useor = false;
+ n->subLinkType = ALL_SUBLINK;
+ n->subselect = $7;
+ $$ = (Node *)n;
+ }
| '(' row_descriptor ')' Op '(' SubSelect ')'
{
SubLink *n = makeNode(SubLink);
n->subselect = $6;
$$ = (Node *)n;
}
+ | '(' row_descriptor ')' '+' '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = $2;
+ n->oper = lcons("+", NIL);
+ n->useor = false;
+ n->subLinkType = EXPR_SUBLINK;
+ n->subselect = $6;
+ $$ = (Node *)n;
+ }
+ | '(' row_descriptor ')' '-' '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = $2;
+ n->oper = lcons("-", NIL);
+ n->useor = false;
+ n->subLinkType = EXPR_SUBLINK;
+ n->subselect = $6;
+ $$ = (Node *)n;
+ }
+ | '(' row_descriptor ')' '/' '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = $2;
+ n->oper = lcons("/", NIL);
+ n->useor = false;
+ n->subLinkType = EXPR_SUBLINK;
+ n->subselect = $6;
+ $$ = (Node *)n;
+ }
+ | '(' row_descriptor ')' '*' '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = $2;
+ n->oper = lcons("*", NIL);
+ n->useor = false;
+ n->subLinkType = EXPR_SUBLINK;
+ n->subselect = $6;
+ $$ = (Node *)n;
+ }
+ | '(' row_descriptor ')' '<' '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = $2;
+ n->oper = lcons("<", NIL);
+ n->useor = false;
+ n->subLinkType = EXPR_SUBLINK;
+ n->subselect = $6;
+ $$ = (Node *)n;
+ }
+ | '(' row_descriptor ')' '>' '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = $2;
+ n->oper = lcons(">", NIL);
+ n->useor = false;
+ n->subLinkType = EXPR_SUBLINK;
+ n->subselect = $6;
+ $$ = (Node *)n;
+ }
+ | '(' row_descriptor ')' '=' '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = $2;
+ n->oper = lcons("=", NIL);
+ n->useor = false;
+ n->subLinkType = EXPR_SUBLINK;
+ n->subselect = $6;
+ $$ = (Node *)n;
+ }
| '(' row_descriptor ')' Op '(' row_descriptor ')'
{
$$ = makeRowExpr($4, $2, $6);
}
+ | '(' row_descriptor ')' '+' '(' row_descriptor ')'
+ {
+ $$ = makeRowExpr("+", $2, $6);
+ }
+ | '(' row_descriptor ')' '-' '(' row_descriptor ')'
+ {
+ $$ = makeRowExpr("-", $2, $6);
+ }
+ | '(' row_descriptor ')' '/' '(' row_descriptor ')'
+ {
+ $$ = makeRowExpr("/", $2, $6);
+ }
+ | '(' row_descriptor ')' '*' '(' row_descriptor ')'
+ {
+ $$ = makeRowExpr("*", $2, $6);
+ }
+ | '(' row_descriptor ')' '<' '(' row_descriptor ')'
+ {
+ $$ = makeRowExpr("<", $2, $6);
+ }
+ | '(' row_descriptor ')' '>' '(' row_descriptor ')'
+ {
+ $$ = makeRowExpr(">", $2, $6);
+ }
+ | '(' row_descriptor ')' '=' '(' row_descriptor ')'
+ {
+ $$ = makeRowExpr("=", $2, $6);
+ }
;
row_descriptor: row_list ',' a_expr
n->subselect = $5;
$$ = (Node *)n;
}
+ | a_expr '+' ANY '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = lcons($1,NIL);
+ n->oper = lcons("+",NIL);
+ n->useor = false;
+ n->subLinkType = ANY_SUBLINK;
+ n->subselect = $5;
+ $$ = (Node *)n;
+ }
+ | a_expr '-' ANY '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = lcons($1,NIL);
+ n->oper = lcons("-",NIL);
+ n->useor = false;
+ n->subLinkType = ANY_SUBLINK;
+ n->subselect = $5;
+ $$ = (Node *)n;
+ }
+ | a_expr '/' ANY '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = lcons($1,NIL);
+ n->oper = lcons("/",NIL);
+ n->useor = false;
+ n->subLinkType = ANY_SUBLINK;
+ n->subselect = $5;
+ $$ = (Node *)n;
+ }
+ | a_expr '*' ANY '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = lcons($1,NIL);
+ n->oper = lcons("*",NIL);
+ n->useor = false;
+ n->subLinkType = ANY_SUBLINK;
+ n->subselect = $5;
+ $$ = (Node *)n;
+ }
+ | a_expr '<' ANY '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = lcons($1,NIL);
+ n->oper = lcons("<",NIL);
+ n->useor = false;
+ n->subLinkType = ANY_SUBLINK;
+ n->subselect = $5;
+ $$ = (Node *)n;
+ }
+ | a_expr '>' ANY '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = lcons($1,NIL);
+ n->oper = lcons(">",NIL);
+ n->useor = false;
+ n->subLinkType = ANY_SUBLINK;
+ n->subselect = $5;
+ $$ = (Node *)n;
+ }
+ | a_expr '=' ANY '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = lcons($1,NIL);
+ n->oper = lcons("=",NIL);
+ n->useor = false;
+ n->subLinkType = ANY_SUBLINK;
+ n->subselect = $5;
+ $$ = (Node *)n;
+ }
| a_expr Op ALL '(' SubSelect ')'
{
SubLink *n = makeNode(SubLink);
n->subselect = $5;
$$ = (Node *)n;
}
+ | a_expr '+' ALL '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = lcons($1, NULL);
+ n->oper = lcons("+",NIL);
+ n->useor = false;
+ n->subLinkType = ALL_SUBLINK;
+ n->subselect = $5;
+ $$ = (Node *)n;
+ }
+ | a_expr '-' ALL '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = lcons($1, NULL);
+ n->oper = lcons("-",NIL);
+ n->useor = false;
+ n->subLinkType = ALL_SUBLINK;
+ n->subselect = $5;
+ $$ = (Node *)n;
+ }
+ | a_expr '/' ALL '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = lcons($1, NULL);
+ n->oper = lcons("/",NIL);
+ n->useor = false;
+ n->subLinkType = ALL_SUBLINK;
+ n->subselect = $5;
+ $$ = (Node *)n;
+ }
+ | a_expr '*' ALL '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = lcons($1, NULL);
+ n->oper = lcons("*",NIL);
+ n->useor = false;
+ n->subLinkType = ALL_SUBLINK;
+ n->subselect = $5;
+ $$ = (Node *)n;
+ }
+ | a_expr '<' ALL '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = lcons($1, NULL);
+ n->oper = lcons("<",NIL);
+ n->useor = false;
+ n->subLinkType = ALL_SUBLINK;
+ n->subselect = $5;
+ $$ = (Node *)n;
+ }
+ | a_expr '>' ALL '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = lcons($1, NULL);
+ n->oper = lcons(">",NIL);
+ n->useor = false;
+ n->subLinkType = ALL_SUBLINK;
+ n->subselect = $5;
+ $$ = (Node *)n;
+ }
+ | a_expr '=' ALL '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = lcons($1, NULL);
+ n->oper = lcons("=",NIL);
+ n->useor = false;
+ n->subLinkType = ALL_SUBLINK;
+ n->subselect = $5;
+ $$ = (Node *)n;
+ }
| a_expr Op '(' SubSelect ')'
{
SubLink *n = makeNode(SubLink);
n->subselect = $4;
$$ = (Node *)n;
}
+ | a_expr '+' '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = lcons($1, NULL);
+ n->oper = lcons("+",NIL);
+ n->useor = false;
+ n->subLinkType = ALL_SUBLINK;
+ n->subselect = $4;
+ $$ = (Node *)n;
+ }
+ | a_expr '-' '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = lcons($1, NULL);
+ n->oper = lcons("-",NIL);
+ n->useor = false;
+ n->subLinkType = ALL_SUBLINK;
+ n->subselect = $4;
+ $$ = (Node *)n;
+ }
+ | a_expr '/' '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = lcons($1, NULL);
+ n->oper = lcons("/",NIL);
+ n->useor = false;
+ n->subLinkType = ALL_SUBLINK;
+ n->subselect = $4;
+ $$ = (Node *)n;
+ }
+ | a_expr '*' '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = lcons($1, NULL);
+ n->oper = lcons("*",NIL);
+ n->useor = false;
+ n->subLinkType = ALL_SUBLINK;
+ n->subselect = $4;
+ $$ = (Node *)n;
+ }
+ | a_expr '<' '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = lcons($1, NULL);
+ n->oper = lcons("<",NIL);
+ n->useor = false;
+ n->subLinkType = ALL_SUBLINK;
+ n->subselect = $4;
+ $$ = (Node *)n;
+ }
+ | a_expr '>' '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = lcons($1, NULL);
+ n->oper = lcons(">",NIL);
+ n->useor = false;
+ n->subLinkType = ALL_SUBLINK;
+ n->subselect = $4;
+ $$ = (Node *)n;
+ }
+ | a_expr '=' '(' SubSelect ')'
+ {
+ SubLink *n = makeNode(SubLink);
+ n->lefthand = lcons($1, NULL);
+ n->oper = lcons("=",NIL);
+ n->useor = false;
+ n->subLinkType = ALL_SUBLINK;
+ n->subselect = $4;
+ $$ = (Node *)n;
+ }
| a_expr AND a_expr
{ $$ = makeA_Expr(AND, NULL, $1, $3); }
| a_expr OR a_expr