*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.25 1997/01/16 14:56:05 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.26 1997/02/13 15:40:03 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
%type <coldef> columnDef
%type <defelt> def_elem
%type <node> def_arg, columnElem, where_clause,
- a_expr, AexprConst, in_expr_nodes, not_in_expr_nodes,
+ a_expr, a_expr_or_null, AexprConst,
+ in_expr_nodes, not_in_expr_nodes,
having_clause
%type <value> NumConst
%type <attr> event_object, attr
*
*****************************************************************************/
+a_expr_or_null: a_expr
+ { $$ = $1;}
+ | Pnull
+ {
+ A_Const *n = makeNode(A_Const);
+ n->val.type = T_Null;
+ $$ = (Node *)n;
+ }
+
a_expr: attr opt_indirection
{
$1->indirection = $2;
}
$$ = (Node *)$2;
}
- | '(' a_expr ')'
+ | '(' a_expr_or_null ')'
{ $$ = $2; }
| a_expr Op a_expr
{ $$ = makeA_Expr(OP, $2, $1, $3); }
{ $$ = NIL; }
;
-expr_list: a_expr
+expr_list: a_expr_or_null
{ $$ = lcons($1, NIL); }
- | expr_list ',' a_expr
+ | expr_list ',' a_expr_or_null
{ $$ = lappend($1, $3); }
;
}
;
-res_target_el: Id opt_indirection '=' a_expr
+res_target_el: Id opt_indirection '=' a_expr_or_null
{
$$ = makeNode(ResTarget);
$$->name = $1;
$$->indirection = NULL;
$$->val = (Node *)$1;
}
- | a_expr
+ | a_expr_or_null
{
$$ = makeNode(ResTarget);
$$->name = NULL;
}
| ParamNo
{ $$ = (Node *)$1; }
- | Pnull
- {
- A_Const *n = makeNode(A_Const);
- n->val.type = T_Null;
- $$ = (Node *)n;
- }
;
ParamNo: PARAM