11
11
*
12
12
*
13
13
* IDENTIFICATION
14
- * $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.689 2009/11/09 02:36:56 tgl Exp $
14
+ * $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.690 2009/11/09 18:38:48 tgl Exp $
15
15
*
16
16
* HISTORY
17
17
* AUTHOR DATE MAJOR EVENT
75
75
(Current) = (Rhs)[0]; \
76
76
} while (0)
77
77
78
- /*
79
- * The %name-prefix option below will make bison call base_yylex, but we
80
- * really want it to call filtered_base_yylex (see parser.c).
81
- */
82
- #define base_yylex filtered_base_yylex
83
-
84
78
/*
85
79
* Bison doesn't allocate anything that needs to live across parser calls,
86
80
* so we can easily have it use palloc instead of malloc. This prevents
@@ -104,10 +98,10 @@ typedef struct PrivTarget
104
98
#define parser_yyerror(msg) scanner_yyerror(msg, yyscanner)
105
99
#define parser_errposition(pos) scanner_errposition(pos, yyscanner)
106
100
107
- static void base_yyerror(YYLTYPE *yylloc, base_yyscan_t yyscanner,
101
+ static void base_yyerror(YYLTYPE *yylloc, core_yyscan_t yyscanner,
108
102
const char *msg);
109
103
static Node *makeColumnRef(char *colname, List *indirection,
110
- int location, base_yyscan_t yyscanner);
104
+ int location, core_yyscan_t yyscanner);
111
105
static Node *makeTypeCast(Node *arg, TypeName *typename, int location);
112
106
static Node *makeStringConst(char *str, int location);
113
107
static Node *makeStringConstCast(char *str, int location, TypeName *typename);
@@ -118,17 +112,17 @@ static Node *makeNullAConst(int location);
118
112
static Node *makeAConst(Value *v, int location);
119
113
static Node *makeBoolAConst(bool state, int location);
120
114
static FuncCall *makeOverlaps(List *largs, List *rargs,
121
- int location, base_yyscan_t yyscanner);
122
- static void check_qualified_name(List *names, base_yyscan_t yyscanner);
123
- static List *check_func_name(List *names, base_yyscan_t yyscanner);
124
- static List *check_indirection(List *indirection, base_yyscan_t yyscanner);
115
+ int location, core_yyscan_t yyscanner);
116
+ static void check_qualified_name(List *names, core_yyscan_t yyscanner);
117
+ static List *check_func_name(List *names, core_yyscan_t yyscanner);
118
+ static List *check_indirection(List *indirection, core_yyscan_t yyscanner);
125
119
static List *extractArgTypes(List *parameters);
126
120
static SelectStmt *findLeftmostSelect(SelectStmt *node);
127
121
static void insertSelectOptions(SelectStmt *stmt,
128
122
List *sortClause, List *lockingClause,
129
123
Node *limitOffset, Node *limitCount,
130
124
WithClause *withClause,
131
- base_yyscan_t yyscanner);
125
+ core_yyscan_t yyscanner);
132
126
static Node *makeSetOp(SetOperation op, bool all, Node *larg, Node *rarg);
133
127
static Node *doNegate(Node *n, int location);
134
128
static void doNegateFloat(Value *v);
@@ -145,15 +139,18 @@ static TypeName *TableFuncTypeName(List *columns);
145
139
%name-prefix="base_yy"
146
140
%locations
147
141
148
- %parse-param {base_yyscan_t yyscanner}
149
- %lex-param {base_yyscan_t yyscanner}
142
+ %parse-param {core_yyscan_t yyscanner}
143
+ %lex-param {core_yyscan_t yyscanner}
150
144
151
145
%union
152
146
{
147
+ core_YYSTYPE core_yystype;
148
+ /* these fields must match core_YYSTYPE: */
153
149
int ival;
154
- char chr;
155
150
char *str;
156
151
const char *keyword;
152
+
153
+ char chr;
157
154
bool boolean;
158
155
JoinType jtype;
159
156
DropBehavior dbehavior;
@@ -162,7 +159,6 @@ static TypeName *TableFuncTypeName(List *columns);
162
159
Node *node;
163
160
Value *value;
164
161
ObjectType objtype;
165
-
166
162
TypeName *typnam;
167
163
FunctionParameter *fun_param;
168
164
FunctionParameterMode fun_param_mode;
@@ -180,7 +176,6 @@ static TypeName *TableFuncTypeName(List *columns);
180
176
ResTarget *target;
181
177
struct PrivTarget *privtarget;
182
178
AccessPriv *accesspriv;
183
-
184
179
InsertStmt *istmt;
185
180
VariableSetStmt *vsetstmt;
186
181
}
@@ -602,6 +597,7 @@ static TypeName *TableFuncTypeName(List *columns);
602
597
%left JOIN CROSS LEFT FULL RIGHT INNER_P NATURAL
603
598
/* kluge to keep xml_whitespace_option from causing shift/reduce conflicts */
604
599
%right PRESERVE STRIP_P
600
+
605
601
%%
606
602
607
603
/*
@@ -10932,14 +10928,14 @@ reserved_keyword:
10932
10928
* available from the scanner.
10933
10929
*/
10934
10930
static void
10935
- base_yyerror(YYLTYPE *yylloc, base_yyscan_t yyscanner, const char *msg)
10931
+ base_yyerror(YYLTYPE *yylloc, core_yyscan_t yyscanner, const char *msg)
10936
10932
{
10937
10933
parser_yyerror(msg);
10938
10934
}
10939
10935
10940
10936
static Node *
10941
10937
makeColumnRef(char *colname, List *indirection,
10942
- int location, base_yyscan_t yyscanner)
10938
+ int location, core_yyscan_t yyscanner)
10943
10939
{
10944
10940
/*
10945
10941
* Generate a ColumnRef node, with an A_Indirection node added if there
@@ -11109,7 +11105,7 @@ makeBoolAConst(bool state, int location)
11109
11105
* Create and populate a FuncCall node to support the OVERLAPS operator.
11110
11106
*/
11111
11107
static FuncCall *
11112
- makeOverlaps(List *largs, List *rargs, int location, base_yyscan_t yyscanner)
11108
+ makeOverlaps(List *largs, List *rargs, int location, core_yyscan_t yyscanner)
11113
11109
{
11114
11110
FuncCall *n = makeNode(FuncCall);
11115
11111
@@ -11143,7 +11139,7 @@ makeOverlaps(List *largs, List *rargs, int location, base_yyscan_t yyscanner)
11143
11139
* subscripts and '*', which we then must reject here.
11144
11140
*/
11145
11141
static void
11146
- check_qualified_name(List *names, base_yyscan_t yyscanner)
11142
+ check_qualified_name(List *names, core_yyscan_t yyscanner)
11147
11143
{
11148
11144
ListCell *i;
11149
11145
@@ -11160,7 +11156,7 @@ check_qualified_name(List *names, base_yyscan_t yyscanner)
11160
11156
* and '*', which we then must reject here.
11161
11157
*/
11162
11158
static List *
11163
- check_func_name(List *names, base_yyscan_t yyscanner)
11159
+ check_func_name(List *names, core_yyscan_t yyscanner)
11164
11160
{
11165
11161
ListCell *i;
11166
11162
@@ -11178,7 +11174,7 @@ check_func_name(List *names, base_yyscan_t yyscanner)
11178
11174
* in the grammar, so do it here.
11179
11175
*/
11180
11176
static List *
11181
- check_indirection(List *indirection, base_yyscan_t yyscanner)
11177
+ check_indirection(List *indirection, core_yyscan_t yyscanner)
11182
11178
{
11183
11179
ListCell *l;
11184
11180
@@ -11237,7 +11233,7 @@ insertSelectOptions(SelectStmt *stmt,
11237
11233
List *sortClause, List *lockingClause,
11238
11234
Node *limitOffset, Node *limitCount,
11239
11235
WithClause *withClause,
11240
- base_yyscan_t yyscanner)
11236
+ core_yyscan_t yyscanner)
11241
11237
{
11242
11238
Assert(IsA(stmt, SelectStmt));
11243
11239
@@ -11463,12 +11459,9 @@ TableFuncTypeName(List *columns)
11463
11459
}
11464
11460
11465
11461
/*
11466
- * Must undefine base_yylex before including scan.c, since we want it
11467
- * to create the function base_yylex not filtered_base_yylex .
11462
+ * Must undefine this stuff before including scan.c, since it has different
11463
+ * definitions for these macros .
11468
11464
*/
11469
- #undef base_yylex
11470
-
11471
- /* Undefine some other stuff that would conflict in scan.c, too */
11472
11465
#undef yyerror
11473
11466
#undef yylval
11474
11467
#undef yylloc
0 commit comments