|
10 | 10 | *
|
11 | 11 | *
|
12 | 12 | * IDENTIFICATION
|
13 |
| - * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.25 1997/01/16 14:56:05 momjian Exp $ |
| 13 | + * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.26 1997/02/13 15:40:03 momjian Exp $ |
14 | 14 | *
|
15 | 15 | * HISTORY
|
16 | 16 | * AUTHORDATEMAJOR EVENT
|
@@ -149,7 +149,8 @@ static Node *makeA_Expr(int oper, char *opname, Node *lexpr, Node *rexpr);
|
149 | 149 | %type <coldef>columnDef
|
150 | 150 | %type <defelt>def_elem
|
151 | 151 | %type <node>def_arg, columnElem, where_clause,
|
152 |
| -a_expr, AexprConst, in_expr_nodes, not_in_expr_nodes, |
| 152 | +a_expr, a_expr_or_null, AexprConst, |
| 153 | +in_expr_nodes, not_in_expr_nodes, |
153 | 154 | having_clause
|
154 | 155 | %type <value>NumConst
|
155 | 156 | %type <attr>event_object, attr
|
@@ -1751,6 +1752,15 @@ Typename: typname opt_array_bounds
|
1751 | 1752 | *
|
1752 | 1753 | *****************************************************************************/
|
1753 | 1754 |
|
| 1755 | +a_expr_or_null: a_expr |
| 1756 | +{ $$ = $1;} |
| 1757 | +| Pnull |
| 1758 | +{ |
| 1759 | + A_Const *n = makeNode(A_Const); |
| 1760 | + n->val.type = T_Null; |
| 1761 | + $$ = (Node *)n; |
| 1762 | +} |
| 1763 | + |
1754 | 1764 | a_expr: attr opt_indirection
|
1755 | 1765 | {
|
1756 | 1766 | $1->indirection = $2;
|
@@ -1800,7 +1810,7 @@ a_expr: attr opt_indirection
|
1800 | 1810 | }
|
1801 | 1811 | $$ = (Node *)$2;
|
1802 | 1812 | }
|
1803 |
| -| '('a_expr ')' |
| 1813 | +| '('a_expr_or_null ')' |
1804 | 1814 | { $$ = $2; }
|
1805 | 1815 | | a_expr Op a_expr
|
1806 | 1816 | { $$ = makeA_Expr(OP, $2, $1, $3); }
|
@@ -1892,9 +1902,9 @@ opt_indirection: '[' a_expr ']' opt_indirection
|
1892 | 1902 | { $$ = NIL; }
|
1893 | 1903 | ;
|
1894 | 1904 |
|
1895 |
| -expr_list:a_expr |
| 1905 | +expr_list:a_expr_or_null |
1896 | 1906 | { $$ = lcons($1, NIL); }
|
1897 |
| -| expr_list ','a_expr |
| 1907 | +| expr_list ','a_expr_or_null |
1898 | 1908 | { $$ = lappend($1, $3); }
|
1899 | 1909 | ;
|
1900 | 1910 |
|
@@ -1966,7 +1976,7 @@ res_target_list: res_target_list ',' res_target_el
|
1966 | 1976 | }
|
1967 | 1977 | ;
|
1968 | 1978 |
|
1969 |
| -res_target_el: Id opt_indirection '='a_expr |
| 1979 | +res_target_el: Id opt_indirection '='a_expr_or_null |
1970 | 1980 | {
|
1971 | 1981 | $$ = makeNode(ResTarget);
|
1972 | 1982 | $$->name = $1;
|
@@ -2014,7 +2024,7 @@ res_target_el2: a_expr AS Id
|
2014 | 2024 | $$->indirection = NULL;
|
2015 | 2025 | $$->val = (Node *)$1;
|
2016 | 2026 | }
|
2017 |
| -|a_expr |
| 2027 | +|a_expr_or_null |
2018 | 2028 | {
|
2019 | 2029 | $$ = makeNode(ResTarget);
|
2020 | 2030 | $$->name = NULL;
|
@@ -2108,12 +2118,6 @@ AexprConst: Iconst
|
2108 | 2118 | }
|
2109 | 2119 | | ParamNo
|
2110 | 2120 | { $$ = (Node *)$1; }
|
2111 |
| -| Pnull |
2112 |
| -{ |
2113 |
| - A_Const *n = makeNode(A_Const); |
2114 |
| - n->val.type = T_Null; |
2115 |
| - $$ = (Node *)n; |
2116 |
| -} |
2117 | 2121 | ;
|
2118 | 2122 |
|
2119 | 2123 | ParamNo: PARAM
|
|