duckdb 0.6.2-dev2115.0 → 0.6.2-dev2226.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/duckdb/extension/json/buffered_json_reader.cpp +18 -5
- package/src/duckdb/extension/json/include/buffered_json_reader.hpp +6 -1
- package/src/duckdb/extension/json/include/json_common.hpp +1 -0
- package/src/duckdb/extension/json/include/json_scan.hpp +7 -0
- package/src/duckdb/extension/json/include/json_transform.hpp +25 -10
- package/src/duckdb/extension/json/json_common.cpp +6 -2
- package/src/duckdb/extension/json/json_functions/json_structure.cpp +47 -9
- package/src/duckdb/extension/json/json_functions/json_transform.cpp +183 -106
- package/src/duckdb/extension/json/json_functions/read_json.cpp +35 -22
- package/src/duckdb/extension/json/json_scan.cpp +26 -5
- package/src/duckdb/extension/parquet/parquet-extension.cpp +1 -0
- package/src/duckdb/src/catalog/catalog.cpp +11 -12
- package/src/duckdb/src/catalog/catalog_entry/duck_table_entry.cpp +1 -1
- package/src/duckdb/src/common/box_renderer.cpp +9 -1
- package/src/duckdb/src/common/compressed_file_system.cpp +1 -1
- package/src/duckdb/src/common/enums/relation_type.cpp +2 -0
- package/src/duckdb/src/common/gzip_file_system.cpp +1 -1
- package/src/duckdb/src/common/local_file_system.cpp +1 -1
- package/src/duckdb/src/common/row_operations/row_aggregate.cpp +2 -2
- package/src/duckdb/src/common/types/column_data_allocator.cpp +2 -2
- package/src/duckdb/src/common/types/date.cpp +7 -2
- package/src/duckdb/src/common/types/vector.cpp +3 -2
- package/src/duckdb/src/common/virtual_file_system.cpp +1 -1
- package/src/duckdb/src/execution/index/art/art.cpp +5 -5
- package/src/duckdb/src/execution/join_hashtable.cpp +4 -5
- package/src/duckdb/src/execution/operator/persistent/physical_update.cpp +2 -0
- package/src/duckdb/src/execution/operator/projection/physical_unnest.cpp +182 -123
- package/src/duckdb/src/execution/operator/schema/physical_attach.cpp +22 -18
- package/src/duckdb/src/execution/physical_plan/plan_create_table.cpp +1 -1
- package/src/duckdb/src/function/aggregate/distributive/arg_min_max.cpp +2 -3
- package/src/duckdb/src/function/scalar/math/setseed.cpp +1 -1
- package/src/duckdb/src/function/scalar/string/substring.cpp +8 -0
- package/src/duckdb/src/function/table/read_csv.cpp +1 -1
- package/src/duckdb/src/function/table/version/pragma_version.cpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/box_renderer.hpp +4 -0
- package/src/duckdb/src/include/duckdb/common/enums/relation_type.hpp +1 -0
- package/src/duckdb/src/include/duckdb/common/file_opener.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/http_stats.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/limits.hpp +3 -0
- package/src/duckdb/src/include/duckdb/common/types/validity_mask.hpp +1 -9
- package/src/duckdb/src/include/duckdb/common/types/vector.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/executor.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/index/art/art.hpp +3 -3
- package/src/duckdb/src/include/duckdb/execution/operator/projection/physical_unnest.hpp +5 -1
- package/src/duckdb/src/include/duckdb/main/client_context.hpp +3 -0
- package/src/duckdb/src/include/duckdb/main/config.hpp +0 -4
- package/src/duckdb/src/include/duckdb/main/database.hpp +6 -0
- package/src/duckdb/src/include/duckdb/main/extension_helper.hpp +5 -5
- package/src/duckdb/src/include/duckdb/main/relation/write_csv_relation.hpp +2 -1
- package/src/duckdb/src/include/duckdb/main/relation/write_parquet_relation.hpp +34 -0
- package/src/duckdb/src/include/duckdb/main/relation.hpp +6 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/copy_info.hpp +2 -1
- package/src/duckdb/src/include/duckdb/parser/statement/copy_statement.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/binder.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/index.hpp +4 -3
- package/src/duckdb/src/include/duckdb.h +7 -0
- package/src/duckdb/src/main/capi/threading-c.cpp +8 -0
- package/src/duckdb/src/main/client_context.cpp +7 -0
- package/src/duckdb/src/main/client_context_file_opener.cpp +14 -0
- package/src/duckdb/src/main/database.cpp +57 -40
- package/src/duckdb/src/main/extension/extension_load.cpp +20 -28
- package/src/duckdb/src/main/relation/write_csv_relation.cpp +4 -2
- package/src/duckdb/src/main/relation/write_parquet_relation.cpp +37 -0
- package/src/duckdb/src/main/relation.cpp +12 -2
- package/src/duckdb/src/parallel/executor.cpp +4 -0
- package/src/duckdb/src/parser/statement/copy_statement.cpp +1 -1
- package/src/duckdb/src/parser/transform/statement/transform_show.cpp +4 -3
- package/src/duckdb/src/planner/binder/expression/bind_cast_expression.cpp +1 -1
- package/src/duckdb/src/planner/binder/statement/bind_create.cpp +24 -3
- package/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +1 -1
- package/src/duckdb/src/planner/subquery/flatten_dependent_join.cpp +2 -0
- package/src/duckdb/src/storage/compression/bitpacking.cpp +2 -1
- package/src/duckdb/src/storage/compression/fixed_size_uncompressed.cpp +1 -1
- package/src/duckdb/src/storage/index.cpp +1 -1
- package/src/duckdb/src/storage/meta_block_writer.cpp +1 -1
- package/src/duckdb/src/storage/table/column_segment.cpp +3 -3
- package/src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp +1 -2
- package/src/duckdb/third_party/libpg_query/src_backend_parser_scan.cpp +539 -300
- package/src/duckdb/ub_src_main.cpp +0 -2
- package/src/duckdb/ub_src_main_relation.cpp +2 -0
- package/src/duckdb/src/include/duckdb/function/replacement_open.hpp +0 -54
- package/src/duckdb/src/include/duckdb/main/replacement_opens.hpp +0 -20
- package/src/duckdb/src/main/extension_prefix_opener.cpp +0 -55
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
#line
|
|
2
|
-
#line 2 "third_party/libpg_query/scan.l"
|
|
1
|
+
#line 1 "third_party/libpg_query/src_backend_parser_scan.cpp"
|
|
3
2
|
/*-------------------------------------------------------------------------
|
|
4
3
|
*
|
|
5
4
|
* scan.l
|
|
@@ -41,10 +40,7 @@
|
|
|
41
40
|
|
|
42
41
|
#include <stdexcept>
|
|
43
42
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
#line 48 "third_party/libpg_query/src_backend_parser_scan.cpp"
|
|
43
|
+
#line 43 "third_party/libpg_query/src_backend_parser_scan.cpp"
|
|
48
44
|
|
|
49
45
|
#define YY_INT_ALIGNED short int
|
|
50
46
|
|
|
@@ -52,12 +48,246 @@
|
|
|
52
48
|
|
|
53
49
|
#define FLEX_SCANNER
|
|
54
50
|
#define YY_FLEX_MAJOR_VERSION 2
|
|
55
|
-
#define YY_FLEX_MINOR_VERSION
|
|
56
|
-
#define YY_FLEX_SUBMINOR_VERSION
|
|
51
|
+
#define YY_FLEX_MINOR_VERSION 6
|
|
52
|
+
#define YY_FLEX_SUBMINOR_VERSION 4
|
|
57
53
|
#if YY_FLEX_SUBMINOR_VERSION > 0
|
|
58
54
|
#define FLEX_BETA
|
|
59
55
|
#endif
|
|
60
56
|
|
|
57
|
+
#ifdef yy_create_buffer
|
|
58
|
+
#define core_yy_create_buffer_ALREADY_DEFINED
|
|
59
|
+
#else
|
|
60
|
+
#define yy_create_buffer core_yy_create_buffer
|
|
61
|
+
#endif
|
|
62
|
+
|
|
63
|
+
#ifdef yy_delete_buffer
|
|
64
|
+
#define core_yy_delete_buffer_ALREADY_DEFINED
|
|
65
|
+
#else
|
|
66
|
+
#define yy_delete_buffer core_yy_delete_buffer
|
|
67
|
+
#endif
|
|
68
|
+
|
|
69
|
+
#ifdef yy_scan_buffer
|
|
70
|
+
#define core_yy_scan_buffer_ALREADY_DEFINED
|
|
71
|
+
#else
|
|
72
|
+
#define yy_scan_buffer core_yy_scan_buffer
|
|
73
|
+
#endif
|
|
74
|
+
|
|
75
|
+
#ifdef yy_scan_string
|
|
76
|
+
#define core_yy_scan_string_ALREADY_DEFINED
|
|
77
|
+
#else
|
|
78
|
+
#define yy_scan_string core_yy_scan_string
|
|
79
|
+
#endif
|
|
80
|
+
|
|
81
|
+
#ifdef yy_scan_bytes
|
|
82
|
+
#define core_yy_scan_bytes_ALREADY_DEFINED
|
|
83
|
+
#else
|
|
84
|
+
#define yy_scan_bytes core_yy_scan_bytes
|
|
85
|
+
#endif
|
|
86
|
+
|
|
87
|
+
#ifdef yy_init_buffer
|
|
88
|
+
#define core_yy_init_buffer_ALREADY_DEFINED
|
|
89
|
+
#else
|
|
90
|
+
#define yy_init_buffer core_yy_init_buffer
|
|
91
|
+
#endif
|
|
92
|
+
|
|
93
|
+
#ifdef yy_flush_buffer
|
|
94
|
+
#define core_yy_flush_buffer_ALREADY_DEFINED
|
|
95
|
+
#else
|
|
96
|
+
#define yy_flush_buffer core_yy_flush_buffer
|
|
97
|
+
#endif
|
|
98
|
+
|
|
99
|
+
#ifdef yy_load_buffer_state
|
|
100
|
+
#define core_yy_load_buffer_state_ALREADY_DEFINED
|
|
101
|
+
#else
|
|
102
|
+
#define yy_load_buffer_state core_yy_load_buffer_state
|
|
103
|
+
#endif
|
|
104
|
+
|
|
105
|
+
#ifdef yy_switch_to_buffer
|
|
106
|
+
#define core_yy_switch_to_buffer_ALREADY_DEFINED
|
|
107
|
+
#else
|
|
108
|
+
#define yy_switch_to_buffer core_yy_switch_to_buffer
|
|
109
|
+
#endif
|
|
110
|
+
|
|
111
|
+
#ifdef yypush_buffer_state
|
|
112
|
+
#define core_yypush_buffer_state_ALREADY_DEFINED
|
|
113
|
+
#else
|
|
114
|
+
#define yypush_buffer_state core_yypush_buffer_state
|
|
115
|
+
#endif
|
|
116
|
+
|
|
117
|
+
#ifdef yypop_buffer_state
|
|
118
|
+
#define core_yypop_buffer_state_ALREADY_DEFINED
|
|
119
|
+
#else
|
|
120
|
+
#define yypop_buffer_state core_yypop_buffer_state
|
|
121
|
+
#endif
|
|
122
|
+
|
|
123
|
+
#ifdef yyensure_buffer_stack
|
|
124
|
+
#define core_yyensure_buffer_stack_ALREADY_DEFINED
|
|
125
|
+
#else
|
|
126
|
+
#define yyensure_buffer_stack core_yyensure_buffer_stack
|
|
127
|
+
#endif
|
|
128
|
+
|
|
129
|
+
#ifdef yylex
|
|
130
|
+
#define core_yylex_ALREADY_DEFINED
|
|
131
|
+
#else
|
|
132
|
+
#define yylex core_yylex
|
|
133
|
+
#endif
|
|
134
|
+
|
|
135
|
+
#ifdef yyrestart
|
|
136
|
+
#define core_yyrestart_ALREADY_DEFINED
|
|
137
|
+
#else
|
|
138
|
+
#define yyrestart core_yyrestart
|
|
139
|
+
#endif
|
|
140
|
+
|
|
141
|
+
#ifdef yylex_init
|
|
142
|
+
#define core_yylex_init_ALREADY_DEFINED
|
|
143
|
+
#else
|
|
144
|
+
#define yylex_init core_yylex_init
|
|
145
|
+
#endif
|
|
146
|
+
|
|
147
|
+
#ifdef yylex_init_extra
|
|
148
|
+
#define core_yylex_init_extra_ALREADY_DEFINED
|
|
149
|
+
#else
|
|
150
|
+
#define yylex_init_extra core_yylex_init_extra
|
|
151
|
+
#endif
|
|
152
|
+
|
|
153
|
+
#ifdef yylex_destroy
|
|
154
|
+
#define core_yylex_destroy_ALREADY_DEFINED
|
|
155
|
+
#else
|
|
156
|
+
#define yylex_destroy core_yylex_destroy
|
|
157
|
+
#endif
|
|
158
|
+
|
|
159
|
+
#ifdef yyget_debug
|
|
160
|
+
#define core_yyget_debug_ALREADY_DEFINED
|
|
161
|
+
#else
|
|
162
|
+
#define yyget_debug core_yyget_debug
|
|
163
|
+
#endif
|
|
164
|
+
|
|
165
|
+
#ifdef yyset_debug
|
|
166
|
+
#define core_yyset_debug_ALREADY_DEFINED
|
|
167
|
+
#else
|
|
168
|
+
#define yyset_debug core_yyset_debug
|
|
169
|
+
#endif
|
|
170
|
+
|
|
171
|
+
#ifdef yyget_extra
|
|
172
|
+
#define core_yyget_extra_ALREADY_DEFINED
|
|
173
|
+
#else
|
|
174
|
+
#define yyget_extra core_yyget_extra
|
|
175
|
+
#endif
|
|
176
|
+
|
|
177
|
+
#ifdef yyset_extra
|
|
178
|
+
#define core_yyset_extra_ALREADY_DEFINED
|
|
179
|
+
#else
|
|
180
|
+
#define yyset_extra core_yyset_extra
|
|
181
|
+
#endif
|
|
182
|
+
|
|
183
|
+
#ifdef yyget_in
|
|
184
|
+
#define core_yyget_in_ALREADY_DEFINED
|
|
185
|
+
#else
|
|
186
|
+
#define yyget_in core_yyget_in
|
|
187
|
+
#endif
|
|
188
|
+
|
|
189
|
+
#ifdef yyset_in
|
|
190
|
+
#define core_yyset_in_ALREADY_DEFINED
|
|
191
|
+
#else
|
|
192
|
+
#define yyset_in core_yyset_in
|
|
193
|
+
#endif
|
|
194
|
+
|
|
195
|
+
#ifdef yyget_out
|
|
196
|
+
#define core_yyget_out_ALREADY_DEFINED
|
|
197
|
+
#else
|
|
198
|
+
#define yyget_out core_yyget_out
|
|
199
|
+
#endif
|
|
200
|
+
|
|
201
|
+
#ifdef yyset_out
|
|
202
|
+
#define core_yyset_out_ALREADY_DEFINED
|
|
203
|
+
#else
|
|
204
|
+
#define yyset_out core_yyset_out
|
|
205
|
+
#endif
|
|
206
|
+
|
|
207
|
+
#ifdef yyget_leng
|
|
208
|
+
#define core_yyget_leng_ALREADY_DEFINED
|
|
209
|
+
#else
|
|
210
|
+
#define yyget_leng core_yyget_leng
|
|
211
|
+
#endif
|
|
212
|
+
|
|
213
|
+
#ifdef yyget_text
|
|
214
|
+
#define core_yyget_text_ALREADY_DEFINED
|
|
215
|
+
#else
|
|
216
|
+
#define yyget_text core_yyget_text
|
|
217
|
+
#endif
|
|
218
|
+
|
|
219
|
+
#ifdef yyget_lineno
|
|
220
|
+
#define core_yyget_lineno_ALREADY_DEFINED
|
|
221
|
+
#else
|
|
222
|
+
#define yyget_lineno core_yyget_lineno
|
|
223
|
+
#endif
|
|
224
|
+
|
|
225
|
+
#ifdef yyset_lineno
|
|
226
|
+
#define core_yyset_lineno_ALREADY_DEFINED
|
|
227
|
+
#else
|
|
228
|
+
#define yyset_lineno core_yyset_lineno
|
|
229
|
+
#endif
|
|
230
|
+
|
|
231
|
+
#ifdef yyget_column
|
|
232
|
+
#define core_yyget_column_ALREADY_DEFINED
|
|
233
|
+
#else
|
|
234
|
+
#define yyget_column core_yyget_column
|
|
235
|
+
#endif
|
|
236
|
+
|
|
237
|
+
#ifdef yyset_column
|
|
238
|
+
#define core_yyset_column_ALREADY_DEFINED
|
|
239
|
+
#else
|
|
240
|
+
#define yyset_column core_yyset_column
|
|
241
|
+
#endif
|
|
242
|
+
|
|
243
|
+
#ifdef yywrap
|
|
244
|
+
#define core_yywrap_ALREADY_DEFINED
|
|
245
|
+
#else
|
|
246
|
+
#define yywrap core_yywrap
|
|
247
|
+
#endif
|
|
248
|
+
|
|
249
|
+
#ifdef yyget_lval
|
|
250
|
+
#define core_yyget_lval_ALREADY_DEFINED
|
|
251
|
+
#else
|
|
252
|
+
#define yyget_lval core_yyget_lval
|
|
253
|
+
#endif
|
|
254
|
+
|
|
255
|
+
#ifdef yyset_lval
|
|
256
|
+
#define core_yyset_lval_ALREADY_DEFINED
|
|
257
|
+
#else
|
|
258
|
+
#define yyset_lval core_yyset_lval
|
|
259
|
+
#endif
|
|
260
|
+
|
|
261
|
+
#ifdef yyget_lloc
|
|
262
|
+
#define core_yyget_lloc_ALREADY_DEFINED
|
|
263
|
+
#else
|
|
264
|
+
#define yyget_lloc core_yyget_lloc
|
|
265
|
+
#endif
|
|
266
|
+
|
|
267
|
+
#ifdef yyset_lloc
|
|
268
|
+
#define core_yyset_lloc_ALREADY_DEFINED
|
|
269
|
+
#else
|
|
270
|
+
#define yyset_lloc core_yyset_lloc
|
|
271
|
+
#endif
|
|
272
|
+
|
|
273
|
+
#ifdef yyalloc
|
|
274
|
+
#define core_yyalloc_ALREADY_DEFINED
|
|
275
|
+
#else
|
|
276
|
+
#define yyalloc core_yyalloc
|
|
277
|
+
#endif
|
|
278
|
+
|
|
279
|
+
#ifdef yyrealloc
|
|
280
|
+
#define core_yyrealloc_ALREADY_DEFINED
|
|
281
|
+
#else
|
|
282
|
+
#define yyrealloc core_yyrealloc
|
|
283
|
+
#endif
|
|
284
|
+
|
|
285
|
+
#ifdef yyfree
|
|
286
|
+
#define core_yyfree_ALREADY_DEFINED
|
|
287
|
+
#else
|
|
288
|
+
#define yyfree core_yyfree
|
|
289
|
+
#endif
|
|
290
|
+
|
|
61
291
|
/* First, we deal with platform-specific or compiler-specific issues. */
|
|
62
292
|
|
|
63
293
|
/* begin standard C headers. */
|
|
@@ -100,7 +330,6 @@ typedef int flex_int32_t;
|
|
|
100
330
|
typedef unsigned char flex_uint8_t;
|
|
101
331
|
typedef unsigned short int flex_uint16_t;
|
|
102
332
|
typedef unsigned int flex_uint32_t;
|
|
103
|
-
#endif /* ! C99 */
|
|
104
333
|
|
|
105
334
|
/* Limits of integral types. */
|
|
106
335
|
#ifndef INT8_MIN
|
|
@@ -131,38 +360,32 @@ typedef unsigned int flex_uint32_t;
|
|
|
131
360
|
#define UINT32_MAX (4294967295U)
|
|
132
361
|
#endif
|
|
133
362
|
|
|
134
|
-
#
|
|
135
|
-
|
|
136
|
-
#
|
|
137
|
-
|
|
138
|
-
/* The "const" storage-class-modifier is valid. */
|
|
139
|
-
#define YY_USE_CONST
|
|
140
|
-
|
|
141
|
-
#else /* ! __cplusplus */
|
|
363
|
+
#ifndef SIZE_MAX
|
|
364
|
+
#define SIZE_MAX (~(size_t)0)
|
|
365
|
+
#endif
|
|
142
366
|
|
|
143
|
-
/* C99
|
|
144
|
-
#if defined (__STDC__)
|
|
367
|
+
#endif /* ! C99 */
|
|
145
368
|
|
|
146
|
-
#
|
|
369
|
+
#endif /* ! FLEXINT_H */
|
|
147
370
|
|
|
148
|
-
|
|
149
|
-
#endif /* ! __cplusplus */
|
|
371
|
+
/* begin standard C++ headers. */
|
|
150
372
|
|
|
151
|
-
|
|
373
|
+
/* TODO: this is always defined, so inline it */
|
|
152
374
|
#define yyconst const
|
|
375
|
+
|
|
376
|
+
#if defined(__GNUC__) && __GNUC__ >= 3
|
|
377
|
+
#define yynoreturn __attribute__((__noreturn__))
|
|
153
378
|
#else
|
|
154
|
-
#define
|
|
379
|
+
#define yynoreturn
|
|
155
380
|
#endif
|
|
156
381
|
|
|
157
382
|
/* Returned upon end-of-file. */
|
|
158
383
|
#define YY_NULL 0
|
|
159
384
|
|
|
160
|
-
/* Promotes a possibly negative, possibly signed char to an
|
|
161
|
-
*
|
|
162
|
-
* we want to instead treat it as an 8-bit unsigned char, hence the
|
|
163
|
-
* double cast.
|
|
385
|
+
/* Promotes a possibly negative, possibly signed char to an
|
|
386
|
+
* integer in range [0..255] for use as an array index.
|
|
164
387
|
*/
|
|
165
|
-
#define YY_SC_TO_UI(c) ((
|
|
388
|
+
#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
|
|
166
389
|
|
|
167
390
|
/* An opaque pointer. */
|
|
168
391
|
#ifndef YY_TYPEDEF_YY_SCANNER_T
|
|
@@ -186,25 +409,29 @@ typedef void* yyscan_t;
|
|
|
186
409
|
* definition of BEGIN.
|
|
187
410
|
*/
|
|
188
411
|
#define BEGIN yyg->yy_start = 1 + 2 *
|
|
189
|
-
|
|
190
412
|
/* Translate the current start state into a value that can be later handed
|
|
191
413
|
* to BEGIN to return to the state. The YYSTATE alias is for lex
|
|
192
414
|
* compatibility.
|
|
193
415
|
*/
|
|
194
416
|
#define YY_START ((yyg->yy_start - 1) / 2)
|
|
195
417
|
#define YYSTATE YY_START
|
|
196
|
-
|
|
197
418
|
/* Action number for EOF rule of a given start state. */
|
|
198
419
|
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
|
|
199
|
-
|
|
200
420
|
/* Special action meaning "start processing a new file". */
|
|
201
|
-
#define YY_NEW_FILE
|
|
202
|
-
|
|
421
|
+
#define YY_NEW_FILE yyrestart( yyin , yyscanner )
|
|
203
422
|
#define YY_END_OF_BUFFER_CHAR 0
|
|
204
423
|
|
|
205
424
|
/* Size of default input buffer. */
|
|
206
425
|
#ifndef YY_BUF_SIZE
|
|
426
|
+
#ifdef __ia64__
|
|
427
|
+
/* On IA-64, the buffer size is 16k, not 8k.
|
|
428
|
+
* Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
|
|
429
|
+
* Ditto for the __ia64__ case accordingly.
|
|
430
|
+
*/
|
|
431
|
+
#define YY_BUF_SIZE 32768
|
|
432
|
+
#else
|
|
207
433
|
#define YY_BUF_SIZE 16384
|
|
434
|
+
#endif /* __ia64__ */
|
|
208
435
|
#endif
|
|
209
436
|
|
|
210
437
|
/* The state buf must be large enough to hold one state per character in the main buffer.
|
|
@@ -224,8 +451,9 @@ typedef size_t yy_size_t;
|
|
|
224
451
|
#define EOB_ACT_CONTINUE_SCAN 0
|
|
225
452
|
#define EOB_ACT_END_OF_FILE 1
|
|
226
453
|
#define EOB_ACT_LAST_MATCH 2
|
|
227
|
-
|
|
454
|
+
|
|
228
455
|
#define YY_LESS_LINENO(n)
|
|
456
|
+
#define YY_LINENO_REWIND_TO(ptr)
|
|
229
457
|
|
|
230
458
|
/* Return all but the first "n" matched characters back to the input stream. */
|
|
231
459
|
#define yyless(n) \
|
|
@@ -240,7 +468,6 @@ typedef size_t yy_size_t;
|
|
|
240
468
|
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
|
|
241
469
|
} \
|
|
242
470
|
while ( 0 )
|
|
243
|
-
|
|
244
471
|
#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
|
|
245
472
|
|
|
246
473
|
#ifndef YY_STRUCT_YY_BUFFER_STATE
|
|
@@ -283,7 +510,7 @@ struct yy_buffer_state
|
|
|
283
510
|
|
|
284
511
|
int yy_bs_lineno; /**< The line count. */
|
|
285
512
|
int yy_bs_column; /**< The column count. */
|
|
286
|
-
|
|
513
|
+
|
|
287
514
|
/* Whether to try to fill the input buffer when we reach the
|
|
288
515
|
* end of it.
|
|
289
516
|
*/
|
|
@@ -300,7 +527,7 @@ struct yy_buffer_state
|
|
|
300
527
|
* possible backing-up.
|
|
301
528
|
*
|
|
302
529
|
* When we actually see the EOF, we change the status to "new"
|
|
303
|
-
* (via
|
|
530
|
+
* (via yyrestart()), so that the user can continue scanning by
|
|
304
531
|
* just pointing yyin at a new input file.
|
|
305
532
|
*/
|
|
306
533
|
#define YY_BUFFER_EOF_PENDING 2
|
|
@@ -317,73 +544,67 @@ struct yy_buffer_state
|
|
|
317
544
|
#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
|
|
318
545
|
? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
|
|
319
546
|
: NULL)
|
|
320
|
-
|
|
321
547
|
/* Same as previous macro, but useful when we know that the buffer stack is not
|
|
322
548
|
* NULL or when we need an lvalue. For internal use only.
|
|
323
549
|
*/
|
|
324
550
|
#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
|
|
325
551
|
|
|
326
|
-
void
|
|
327
|
-
void
|
|
328
|
-
YY_BUFFER_STATE
|
|
329
|
-
void
|
|
330
|
-
void
|
|
331
|
-
void
|
|
332
|
-
void
|
|
333
|
-
|
|
334
|
-
static void core_yyensure_buffer_stack (yyscan_t yyscanner );
|
|
335
|
-
static void core_yy_load_buffer_state (yyscan_t yyscanner );
|
|
336
|
-
static void core_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
|
|
337
|
-
|
|
338
|
-
#define YY_FLUSH_BUFFER core_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
|
|
552
|
+
void yyrestart ( FILE *input_file , yyscan_t yyscanner );
|
|
553
|
+
void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
|
|
554
|
+
YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
|
|
555
|
+
void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
|
|
556
|
+
void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
|
|
557
|
+
void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
|
|
558
|
+
void yypop_buffer_state ( yyscan_t yyscanner );
|
|
339
559
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
560
|
+
static void yyensure_buffer_stack ( yyscan_t yyscanner );
|
|
561
|
+
static void yy_load_buffer_state ( yyscan_t yyscanner );
|
|
562
|
+
static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner );
|
|
563
|
+
#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner)
|
|
343
564
|
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
565
|
+
YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
|
|
566
|
+
YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
|
|
567
|
+
YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, yy_size_t len , yyscan_t yyscanner );
|
|
347
568
|
|
|
348
|
-
|
|
569
|
+
void *yyalloc ( yy_size_t , yyscan_t yyscanner );
|
|
570
|
+
void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
|
|
571
|
+
void yyfree ( void * , yyscan_t yyscanner );
|
|
349
572
|
|
|
573
|
+
#define yy_new_buffer yy_create_buffer
|
|
350
574
|
#define yy_set_interactive(is_interactive) \
|
|
351
575
|
{ \
|
|
352
576
|
if ( ! YY_CURRENT_BUFFER ){ \
|
|
353
|
-
|
|
577
|
+
yyensure_buffer_stack (yyscanner); \
|
|
354
578
|
YY_CURRENT_BUFFER_LVALUE = \
|
|
355
|
-
|
|
579
|
+
yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
|
|
356
580
|
} \
|
|
357
581
|
YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
|
|
358
582
|
}
|
|
359
|
-
|
|
360
583
|
#define yy_set_bol(at_bol) \
|
|
361
584
|
{ \
|
|
362
585
|
if ( ! YY_CURRENT_BUFFER ){\
|
|
363
|
-
|
|
586
|
+
yyensure_buffer_stack (yyscanner); \
|
|
364
587
|
YY_CURRENT_BUFFER_LVALUE = \
|
|
365
|
-
|
|
588
|
+
yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
|
|
366
589
|
} \
|
|
367
590
|
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
|
|
368
591
|
}
|
|
369
|
-
|
|
370
592
|
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
|
|
371
593
|
|
|
372
594
|
/* Begin user sect3 */
|
|
373
595
|
|
|
374
|
-
#define core_yywrap(
|
|
596
|
+
#define core_yywrap(yyscanner) (/*CONSTCOND*/1)
|
|
375
597
|
#define YY_SKIP_YYWRAP
|
|
376
|
-
|
|
377
|
-
typedef unsigned char YY_CHAR;
|
|
598
|
+
typedef flex_uint8_t YY_CHAR;
|
|
378
599
|
|
|
379
600
|
typedef int yy_state_type;
|
|
380
601
|
|
|
381
602
|
#define yytext_ptr yytext_r
|
|
382
603
|
|
|
383
|
-
static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
|
|
384
|
-
static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
|
|
385
|
-
static int yy_get_next_buffer (yyscan_t yyscanner );
|
|
386
|
-
static void yy_fatal_error (
|
|
604
|
+
static yy_state_type yy_get_previous_state ( yyscan_t yyscanner );
|
|
605
|
+
static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner);
|
|
606
|
+
static int yy_get_next_buffer ( yyscan_t yyscanner );
|
|
607
|
+
static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner );
|
|
387
608
|
|
|
388
609
|
/* Done after the current pattern has been matched and before the
|
|
389
610
|
* corresponding action - sets up yytext.
|
|
@@ -394,7 +615,6 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
|
|
|
394
615
|
yyg->yy_hold_char = *yy_cp; \
|
|
395
616
|
*yy_cp = '\0'; \
|
|
396
617
|
yyg->yy_c_buf_p = yy_cp;
|
|
397
|
-
|
|
398
618
|
#define YY_NUM_RULES 83
|
|
399
619
|
#define YY_END_OF_BUFFER 84
|
|
400
620
|
/* This struct is not used in this scanner,
|
|
@@ -404,7 +624,7 @@ struct yy_trans_info
|
|
|
404
624
|
flex_int32_t yy_verify;
|
|
405
625
|
flex_int32_t yy_nxt;
|
|
406
626
|
};
|
|
407
|
-
static
|
|
627
|
+
static const flex_int16_t yy_accept[296] =
|
|
408
628
|
{ 0,
|
|
409
629
|
0, 0, 12, 12, 0, 0, 0, 0, 11, 11,
|
|
410
630
|
0, 0, 0, 0, 0, 0, 0, 0, 55, 55,
|
|
@@ -441,7 +661,7 @@ static yyconst flex_int16_t yy_accept[296] =
|
|
|
441
661
|
|
|
442
662
|
} ;
|
|
443
663
|
|
|
444
|
-
static
|
|
664
|
+
static const YY_CHAR yy_ec[256] =
|
|
445
665
|
{ 0,
|
|
446
666
|
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
|
|
447
667
|
1, 2, 4, 1, 1, 1, 1, 1, 1, 1,
|
|
@@ -473,7 +693,7 @@ static yyconst flex_int32_t yy_ec[256] =
|
|
|
473
693
|
30, 30, 30, 30, 30
|
|
474
694
|
} ;
|
|
475
695
|
|
|
476
|
-
static
|
|
696
|
+
static const YY_CHAR yy_meta[39] =
|
|
477
697
|
{ 0,
|
|
478
698
|
1, 1, 2, 2, 3, 4, 5, 3, 3, 6,
|
|
479
699
|
1, 7, 3, 3, 1, 7, 8, 8, 1, 3,
|
|
@@ -481,7 +701,7 @@ static yyconst flex_int32_t yy_meta[39] =
|
|
|
481
701
|
10, 10, 10, 10, 10, 11, 10, 10
|
|
482
702
|
} ;
|
|
483
703
|
|
|
484
|
-
static
|
|
704
|
+
static const flex_int16_t yy_base[363] =
|
|
485
705
|
{ 0,
|
|
486
706
|
0, 0, 431, 430, 34, 54, 428, 419, 414, 409,
|
|
487
707
|
41, 50, 408, 402, 38, 54, 405, 393, 85, 121,
|
|
@@ -525,7 +745,7 @@ static yyconst flex_int16_t yy_base[363] =
|
|
|
525
745
|
1185, 1196
|
|
526
746
|
} ;
|
|
527
747
|
|
|
528
|
-
static
|
|
748
|
+
static const flex_int16_t yy_def[363] =
|
|
529
749
|
{ 0,
|
|
530
750
|
295, 1, 296, 296, 297, 297, 298, 298, 299, 299,
|
|
531
751
|
300, 300, 301, 301, 302, 302, 298, 298, 303, 303,
|
|
@@ -569,7 +789,7 @@ static yyconst flex_int16_t yy_def[363] =
|
|
|
569
789
|
295, 295
|
|
570
790
|
} ;
|
|
571
791
|
|
|
572
|
-
static
|
|
792
|
+
static const flex_int16_t yy_nxt[1247] =
|
|
573
793
|
{ 0,
|
|
574
794
|
28, 29, 30, 29, 31, 32, 33, 34, 35, 36,
|
|
575
795
|
37, 38, 34, 39, 40, 41, 42, 42, 43, 44,
|
|
@@ -710,7 +930,7 @@ static yyconst flex_int16_t yy_nxt[1247] =
|
|
|
710
930
|
295, 295, 295, 295, 295, 295
|
|
711
931
|
} ;
|
|
712
932
|
|
|
713
|
-
static
|
|
933
|
+
static const flex_int16_t yy_chk[1247] =
|
|
714
934
|
{ 0,
|
|
715
935
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
716
936
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
@@ -887,7 +1107,7 @@ bool standard_conforming_strings = true;
|
|
|
887
1107
|
#define YY_EXTRA_TYPE core_yy_extra_type *
|
|
888
1108
|
|
|
889
1109
|
/*
|
|
890
|
-
* Each call to
|
|
1110
|
+
* Each call to yylex must set yylloc to the location of the found token
|
|
891
1111
|
* (expressed as a byte offset from the start of the input text).
|
|
892
1112
|
* When we parse a token that requires multiple lexer rules to process,
|
|
893
1113
|
* this should be done in the first such rule, else yylloc will point
|
|
@@ -929,6 +1149,7 @@ static void check_escape_warning(core_yyscan_t yyscanner);
|
|
|
929
1149
|
extern int core_yyget_column(yyscan_t yyscanner);
|
|
930
1150
|
extern void core_yyset_column(int column_no, yyscan_t yyscanner);
|
|
931
1151
|
|
|
1152
|
+
#line 1151 "third_party/libpg_query/src_backend_parser_scan.cpp"
|
|
932
1153
|
#define YY_NO_INPUT 1
|
|
933
1154
|
/*
|
|
934
1155
|
* OK, here is a short description of lex/flex rules behavior.
|
|
@@ -958,17 +1179,6 @@ extern void core_yyset_column(int column_no, yyscan_t yyscanner);
|
|
|
958
1179
|
* The default one is probably not the right thing.
|
|
959
1180
|
*/
|
|
960
1181
|
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
1182
|
/*
|
|
973
1183
|
* In order to make the world safe for Windows and Mac clients as well as
|
|
974
1184
|
* Unix ones, we accept either \n or \r as a newline. A DOS-style \r\n
|
|
@@ -1093,7 +1303,7 @@ extern void core_yyset_column(int column_no, yyscan_t yyscanner);
|
|
|
1093
1303
|
* Note that xcstart must appear before operator, as explained above!
|
|
1094
1304
|
* Also whitespace (comment) must appear before operator.
|
|
1095
1305
|
*/
|
|
1096
|
-
#line
|
|
1306
|
+
#line 1305 "third_party/libpg_query/src_backend_parser_scan.cpp"
|
|
1097
1307
|
|
|
1098
1308
|
#define INITIAL 0
|
|
1099
1309
|
#define xb 1
|
|
@@ -1151,7 +1361,7 @@ struct yyguts_t
|
|
|
1151
1361
|
|
|
1152
1362
|
}; /* end struct yyguts_t */
|
|
1153
1363
|
|
|
1154
|
-
static int yy_init_globals (yyscan_t yyscanner );
|
|
1364
|
+
static int yy_init_globals ( yyscan_t yyscanner );
|
|
1155
1365
|
|
|
1156
1366
|
/* This must go here because YYSTYPE and YYLTYPE are included
|
|
1157
1367
|
* from bison output in section 1.*/
|
|
@@ -1159,46 +1369,50 @@ static int yy_init_globals (yyscan_t yyscanner );
|
|
|
1159
1369
|
|
|
1160
1370
|
# define yylloc yyg->yylloc_r
|
|
1161
1371
|
|
|
1162
|
-
int
|
|
1372
|
+
int yylex_init (yyscan_t* scanner);
|
|
1163
1373
|
|
|
1164
|
-
int
|
|
1374
|
+
int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
|
|
1165
1375
|
|
|
1166
1376
|
/* Accessor methods to globals.
|
|
1167
1377
|
These are made visible to non-reentrant scanners for convenience. */
|
|
1168
1378
|
|
|
1169
|
-
int
|
|
1379
|
+
int yylex_destroy ( yyscan_t yyscanner );
|
|
1380
|
+
|
|
1381
|
+
int yyget_debug ( yyscan_t yyscanner );
|
|
1170
1382
|
|
|
1171
|
-
int
|
|
1383
|
+
void yyset_debug ( int debug_flag , yyscan_t yyscanner );
|
|
1172
1384
|
|
|
1173
|
-
|
|
1385
|
+
YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
|
|
1174
1386
|
|
|
1175
|
-
YY_EXTRA_TYPE
|
|
1387
|
+
void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
|
|
1176
1388
|
|
|
1177
|
-
|
|
1389
|
+
FILE *yyget_in ( yyscan_t yyscanner );
|
|
1178
1390
|
|
|
1179
|
-
FILE *
|
|
1391
|
+
void yyset_in ( FILE * _in_str , yyscan_t yyscanner );
|
|
1180
1392
|
|
|
1181
|
-
|
|
1393
|
+
FILE *yyget_out ( yyscan_t yyscanner );
|
|
1182
1394
|
|
|
1183
|
-
FILE *
|
|
1395
|
+
void yyset_out ( FILE * _out_str , yyscan_t yyscanner );
|
|
1184
1396
|
|
|
1185
|
-
|
|
1397
|
+
yy_size_t yyget_leng ( yyscan_t yyscanner );
|
|
1186
1398
|
|
|
1187
|
-
|
|
1399
|
+
char *yyget_text ( yyscan_t yyscanner );
|
|
1188
1400
|
|
|
1189
|
-
|
|
1401
|
+
int yyget_lineno ( yyscan_t yyscanner );
|
|
1190
1402
|
|
|
1191
|
-
int
|
|
1403
|
+
void yyset_lineno ( int _line_number , yyscan_t yyscanner );
|
|
1192
1404
|
|
|
1193
|
-
|
|
1405
|
+
int yyget_column ( yyscan_t yyscanner );
|
|
1194
1406
|
|
|
1195
|
-
|
|
1407
|
+
void yyset_column ( int _column_no , yyscan_t yyscanner );
|
|
1196
1408
|
|
|
1197
|
-
|
|
1409
|
+
YYSTYPE * yyget_lval ( yyscan_t yyscanner );
|
|
1198
1410
|
|
|
1199
|
-
|
|
1411
|
+
void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner );
|
|
1412
|
+
|
|
1413
|
+
YYLTYPE *yyget_lloc ( yyscan_t yyscanner );
|
|
1200
1414
|
|
|
1201
|
-
void
|
|
1415
|
+
void yyset_lloc ( YYLTYPE * yylloc_param , yyscan_t yyscanner );
|
|
1202
1416
|
|
|
1203
1417
|
/* Macros after this point can all be overridden by user definitions in
|
|
1204
1418
|
* section 1.
|
|
@@ -1206,33 +1420,41 @@ void core_yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
|
|
|
1206
1420
|
|
|
1207
1421
|
#ifndef YY_SKIP_YYWRAP
|
|
1208
1422
|
#ifdef __cplusplus
|
|
1209
|
-
extern "C" int
|
|
1423
|
+
extern "C" int yywrap ( yyscan_t yyscanner );
|
|
1210
1424
|
#else
|
|
1211
|
-
extern int
|
|
1425
|
+
extern int yywrap ( yyscan_t yyscanner );
|
|
1426
|
+
#endif
|
|
1212
1427
|
#endif
|
|
1428
|
+
|
|
1429
|
+
#ifndef YY_NO_UNPUT
|
|
1430
|
+
|
|
1213
1431
|
#endif
|
|
1214
1432
|
|
|
1215
1433
|
#ifndef yytext_ptr
|
|
1216
|
-
static void yy_flex_strncpy (char *,
|
|
1434
|
+
static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
|
|
1217
1435
|
#endif
|
|
1218
1436
|
|
|
1219
1437
|
#ifdef YY_NEED_STRLEN
|
|
1220
|
-
static int yy_flex_strlen (
|
|
1438
|
+
static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
|
|
1221
1439
|
#endif
|
|
1222
1440
|
|
|
1223
1441
|
#ifndef YY_NO_INPUT
|
|
1224
|
-
|
|
1225
1442
|
#ifdef __cplusplus
|
|
1226
|
-
static int yyinput (yyscan_t yyscanner );
|
|
1443
|
+
static int yyinput ( yyscan_t yyscanner );
|
|
1227
1444
|
#else
|
|
1228
|
-
static int input (yyscan_t yyscanner );
|
|
1445
|
+
static int input ( yyscan_t yyscanner );
|
|
1229
1446
|
#endif
|
|
1230
1447
|
|
|
1231
1448
|
#endif
|
|
1232
1449
|
|
|
1233
1450
|
/* Amount of stuff to slurp up with each read. */
|
|
1234
1451
|
#ifndef YY_READ_BUF_SIZE
|
|
1452
|
+
#ifdef __ia64__
|
|
1453
|
+
/* On IA-64, the buffer size is 16k, not 8k */
|
|
1454
|
+
#define YY_READ_BUF_SIZE 16384
|
|
1455
|
+
#else
|
|
1235
1456
|
#define YY_READ_BUF_SIZE 8192
|
|
1457
|
+
#endif /* __ia64__ */
|
|
1236
1458
|
#endif
|
|
1237
1459
|
|
|
1238
1460
|
/* Copy whatever the last rule matched to the standard output. */
|
|
@@ -1240,7 +1462,7 @@ static int input (yyscan_t yyscanner );
|
|
|
1240
1462
|
/* This used to be an fputs(), but since the string might contain NUL's,
|
|
1241
1463
|
* we now use fwrite().
|
|
1242
1464
|
*/
|
|
1243
|
-
#define ECHO fwrite( yytext, yyleng, 1, yyout )
|
|
1465
|
+
#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
|
|
1244
1466
|
#endif
|
|
1245
1467
|
|
|
1246
1468
|
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
|
|
@@ -1264,7 +1486,7 @@ static int input (yyscan_t yyscanner );
|
|
|
1264
1486
|
else \
|
|
1265
1487
|
{ \
|
|
1266
1488
|
errno=0; \
|
|
1267
|
-
while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
|
|
1489
|
+
while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
|
|
1268
1490
|
{ \
|
|
1269
1491
|
if( errno != EINTR) \
|
|
1270
1492
|
{ \
|
|
@@ -1305,10 +1527,10 @@ static int input (yyscan_t yyscanner );
|
|
|
1305
1527
|
#ifndef YY_DECL
|
|
1306
1528
|
#define YY_DECL_IS_OURS 1
|
|
1307
1529
|
|
|
1308
|
-
extern int
|
|
1309
|
-
(YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner);
|
|
1530
|
+
extern int yylex \
|
|
1531
|
+
(YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner);
|
|
1310
1532
|
|
|
1311
|
-
#define YY_DECL int
|
|
1533
|
+
#define YY_DECL int yylex \
|
|
1312
1534
|
(YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
|
|
1313
1535
|
#endif /* !YY_DECL */
|
|
1314
1536
|
|
|
@@ -1321,7 +1543,7 @@ extern int core_yylex \
|
|
|
1321
1543
|
|
|
1322
1544
|
/* Code executed at the end of each rule. */
|
|
1323
1545
|
#ifndef YY_BREAK
|
|
1324
|
-
#define YY_BREAK break;
|
|
1546
|
+
#define YY_BREAK /*LINTED*/break;
|
|
1325
1547
|
#endif
|
|
1326
1548
|
|
|
1327
1549
|
#define YY_RULE_SETUP \
|
|
@@ -1336,11 +1558,6 @@ YY_DECL
|
|
|
1336
1558
|
int yy_act;
|
|
1337
1559
|
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
|
1338
1560
|
|
|
1339
|
-
#line 403 "third_party/libpg_query/scan.l"
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
#line 1342 "third_party/libpg_query/src_backend_parser_scan.cpp"
|
|
1343
|
-
|
|
1344
1561
|
yylval = yylval_param;
|
|
1345
1562
|
|
|
1346
1563
|
yylloc = yylloc_param;
|
|
@@ -1356,15 +1573,21 @@ YY_DECL
|
|
|
1356
1573
|
if ( ! yyg->yy_start )
|
|
1357
1574
|
yyg->yy_start = 1; /* first start state */
|
|
1358
1575
|
if ( ! YY_CURRENT_BUFFER ) {
|
|
1359
|
-
|
|
1576
|
+
yyensure_buffer_stack (yyscanner);
|
|
1360
1577
|
YY_CURRENT_BUFFER_LVALUE =
|
|
1361
|
-
|
|
1578
|
+
yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
|
|
1362
1579
|
}
|
|
1363
1580
|
|
|
1364
|
-
|
|
1581
|
+
yy_load_buffer_state( yyscanner );
|
|
1365
1582
|
}
|
|
1366
1583
|
|
|
1367
|
-
|
|
1584
|
+
{
|
|
1585
|
+
#line 403 "third_party/libpg_query/scan.l"
|
|
1586
|
+
|
|
1587
|
+
|
|
1588
|
+
#line 1594 "third_party/libpg_query/src_backend_parser_scan.cpp"
|
|
1589
|
+
|
|
1590
|
+
while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
|
|
1368
1591
|
{
|
|
1369
1592
|
yy_cp = yyg->yy_c_buf_p;
|
|
1370
1593
|
|
|
@@ -1380,7 +1603,7 @@ YY_DECL
|
|
|
1380
1603
|
yy_match:
|
|
1381
1604
|
do
|
|
1382
1605
|
{
|
|
1383
|
-
YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
|
|
1606
|
+
YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
|
|
1384
1607
|
if ( yy_accept[yy_current_state] )
|
|
1385
1608
|
{
|
|
1386
1609
|
yyg->yy_last_accepting_state = yy_current_state;
|
|
@@ -1390,9 +1613,9 @@ yy_match:
|
|
|
1390
1613
|
{
|
|
1391
1614
|
yy_current_state = (int) yy_def[yy_current_state];
|
|
1392
1615
|
if ( yy_current_state >= 296 )
|
|
1393
|
-
yy_c = yy_meta[
|
|
1616
|
+
yy_c = yy_meta[yy_c];
|
|
1394
1617
|
}
|
|
1395
|
-
yy_current_state = yy_nxt[yy_base[yy_current_state] +
|
|
1618
|
+
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
|
|
1396
1619
|
++yy_cp;
|
|
1397
1620
|
}
|
|
1398
1621
|
while ( yy_current_state != 295 );
|
|
@@ -2392,7 +2615,7 @@ YY_RULE_SETUP
|
|
|
2392
2615
|
if (keyword_text[yyleng - 1] == '\0') {
|
|
2393
2616
|
yyless(yyleng - 1);
|
|
2394
2617
|
}
|
|
2395
|
-
yylval->keyword =
|
|
2618
|
+
yylval->keyword = keyword_text;
|
|
2396
2619
|
return keyword->value;
|
|
2397
2620
|
}
|
|
2398
2621
|
|
|
@@ -2425,7 +2648,7 @@ YY_RULE_SETUP
|
|
|
2425
2648
|
#line 1083 "third_party/libpg_query/scan.l"
|
|
2426
2649
|
YY_FATAL_ERROR( "flex scanner jammed" );
|
|
2427
2650
|
YY_BREAK
|
|
2428
|
-
#line
|
|
2651
|
+
#line 2657 "third_party/libpg_query/src_backend_parser_scan.cpp"
|
|
2429
2652
|
|
|
2430
2653
|
case YY_END_OF_BUFFER:
|
|
2431
2654
|
{
|
|
@@ -2441,7 +2664,7 @@ YY_FATAL_ERROR( "flex scanner jammed" );
|
|
|
2441
2664
|
/* We're scanning a new file or input source. It's
|
|
2442
2665
|
* possible that this happened because the user
|
|
2443
2666
|
* just pointed yyin at a new source and called
|
|
2444
|
-
*
|
|
2667
|
+
* yylex(). If so, then we have to assure
|
|
2445
2668
|
* consistency between YY_CURRENT_BUFFER and our
|
|
2446
2669
|
* globals. Here is the right place to do so, because
|
|
2447
2670
|
* this is the first action (other than possibly a
|
|
@@ -2502,7 +2725,7 @@ YY_FATAL_ERROR( "flex scanner jammed" );
|
|
|
2502
2725
|
{
|
|
2503
2726
|
yyg->yy_did_buffer_switch_on_eof = 0;
|
|
2504
2727
|
|
|
2505
|
-
if (
|
|
2728
|
+
if ( yywrap( yyscanner ) )
|
|
2506
2729
|
{
|
|
2507
2730
|
/* Note: because we've taken care in
|
|
2508
2731
|
* yy_get_next_buffer() to have set up
|
|
@@ -2555,7 +2778,8 @@ YY_FATAL_ERROR( "flex scanner jammed" );
|
|
|
2555
2778
|
"fatal flex scanner internal error--no action found" );
|
|
2556
2779
|
} /* end of action switch */
|
|
2557
2780
|
} /* end of scanning one token */
|
|
2558
|
-
} /* end of
|
|
2781
|
+
} /* end of user's declarations */
|
|
2782
|
+
} /* end of yylex */
|
|
2559
2783
|
|
|
2560
2784
|
/* yy_get_next_buffer - try to read in a new buffer
|
|
2561
2785
|
*
|
|
@@ -2598,7 +2822,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
|
|
|
2598
2822
|
/* Try to read more data. */
|
|
2599
2823
|
|
|
2600
2824
|
/* First move last chars to start of buffer. */
|
|
2601
|
-
number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr
|
|
2825
|
+
number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
|
|
2602
2826
|
|
|
2603
2827
|
for ( i = 0; i < number_to_move; ++i )
|
|
2604
2828
|
*(dest++) = *(source++);
|
|
@@ -2618,7 +2842,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
|
|
|
2618
2842
|
{ /* Not enough room in the buffer - grow it. */
|
|
2619
2843
|
|
|
2620
2844
|
/* just a shorter name for the current buffer */
|
|
2621
|
-
YY_BUFFER_STATE b =
|
|
2845
|
+
YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
|
|
2622
2846
|
|
|
2623
2847
|
int yy_c_buf_p_offset =
|
|
2624
2848
|
(int) (yyg->yy_c_buf_p - b->yy_ch_buf);
|
|
@@ -2634,11 +2858,12 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
|
|
|
2634
2858
|
|
|
2635
2859
|
b->yy_ch_buf = (char *)
|
|
2636
2860
|
/* Include room in for 2 EOB chars. */
|
|
2637
|
-
|
|
2861
|
+
yyrealloc( (void *) b->yy_ch_buf,
|
|
2862
|
+
(yy_size_t) (b->yy_buf_size + 2) , yyscanner );
|
|
2638
2863
|
}
|
|
2639
2864
|
else
|
|
2640
2865
|
/* Can't grow it, we don't own it. */
|
|
2641
|
-
b->yy_ch_buf =
|
|
2866
|
+
b->yy_ch_buf = NULL;
|
|
2642
2867
|
|
|
2643
2868
|
if ( ! b->yy_ch_buf )
|
|
2644
2869
|
YY_FATAL_ERROR(
|
|
@@ -2666,7 +2891,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
|
|
|
2666
2891
|
if ( number_to_move == YY_MORE_ADJ )
|
|
2667
2892
|
{
|
|
2668
2893
|
ret_val = EOB_ACT_END_OF_FILE;
|
|
2669
|
-
|
|
2894
|
+
yyrestart( yyin , yyscanner);
|
|
2670
2895
|
}
|
|
2671
2896
|
|
|
2672
2897
|
else
|
|
@@ -2680,12 +2905,15 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
|
|
|
2680
2905
|
else
|
|
2681
2906
|
ret_val = EOB_ACT_CONTINUE_SCAN;
|
|
2682
2907
|
|
|
2683
|
-
if ((
|
|
2908
|
+
if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
|
|
2684
2909
|
/* Extend the array by 50%, plus the number we really need. */
|
|
2685
2910
|
yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
|
|
2686
|
-
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *)
|
|
2911
|
+
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
|
|
2912
|
+
(void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner );
|
|
2687
2913
|
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
|
|
2688
2914
|
YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
|
|
2915
|
+
/* "- 2" to take care of EOB's */
|
|
2916
|
+
YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
|
|
2689
2917
|
}
|
|
2690
2918
|
|
|
2691
2919
|
yyg->yy_n_chars += number_to_move;
|
|
@@ -2719,9 +2947,9 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
|
|
|
2719
2947
|
{
|
|
2720
2948
|
yy_current_state = (int) yy_def[yy_current_state];
|
|
2721
2949
|
if ( yy_current_state >= 296 )
|
|
2722
|
-
yy_c = yy_meta[
|
|
2950
|
+
yy_c = yy_meta[yy_c];
|
|
2723
2951
|
}
|
|
2724
|
-
yy_current_state = yy_nxt[yy_base[yy_current_state] +
|
|
2952
|
+
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
|
|
2725
2953
|
}
|
|
2726
2954
|
|
|
2727
2955
|
return yy_current_state;
|
|
@@ -2748,14 +2976,19 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
|
|
|
2748
2976
|
{
|
|
2749
2977
|
yy_current_state = (int) yy_def[yy_current_state];
|
|
2750
2978
|
if ( yy_current_state >= 296 )
|
|
2751
|
-
yy_c = yy_meta[
|
|
2979
|
+
yy_c = yy_meta[yy_c];
|
|
2752
2980
|
}
|
|
2753
|
-
yy_current_state = yy_nxt[yy_base[yy_current_state] +
|
|
2981
|
+
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
|
|
2754
2982
|
yy_is_jam = (yy_current_state == 295);
|
|
2755
2983
|
|
|
2984
|
+
(void)yyg;
|
|
2756
2985
|
return yy_is_jam ? 0 : yy_current_state;
|
|
2757
2986
|
}
|
|
2758
2987
|
|
|
2988
|
+
#ifndef YY_NO_UNPUT
|
|
2989
|
+
|
|
2990
|
+
#endif
|
|
2991
|
+
|
|
2759
2992
|
#ifndef YY_NO_INPUT
|
|
2760
2993
|
#ifdef __cplusplus
|
|
2761
2994
|
static int yyinput (yyscan_t yyscanner)
|
|
@@ -2798,13 +3031,13 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
|
|
|
2798
3031
|
*/
|
|
2799
3032
|
|
|
2800
3033
|
/* Reset buffer status. */
|
|
2801
|
-
|
|
3034
|
+
yyrestart( yyin , yyscanner);
|
|
2802
3035
|
|
|
2803
3036
|
/*FALLTHROUGH*/
|
|
2804
3037
|
|
|
2805
3038
|
case EOB_ACT_END_OF_FILE:
|
|
2806
3039
|
{
|
|
2807
|
-
if (
|
|
3040
|
+
if ( yywrap( yyscanner ) )
|
|
2808
3041
|
return 0;
|
|
2809
3042
|
|
|
2810
3043
|
if ( ! yyg->yy_did_buffer_switch_on_eof )
|
|
@@ -2836,34 +3069,34 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
|
|
|
2836
3069
|
* @param yyscanner The scanner object.
|
|
2837
3070
|
* @note This function does not reset the start condition to @c INITIAL .
|
|
2838
3071
|
*/
|
|
2839
|
-
void
|
|
3072
|
+
void yyrestart (FILE * input_file , yyscan_t yyscanner)
|
|
2840
3073
|
{
|
|
2841
3074
|
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
|
2842
3075
|
|
|
2843
3076
|
if ( ! YY_CURRENT_BUFFER ){
|
|
2844
|
-
|
|
3077
|
+
yyensure_buffer_stack (yyscanner);
|
|
2845
3078
|
YY_CURRENT_BUFFER_LVALUE =
|
|
2846
|
-
|
|
3079
|
+
yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
|
|
2847
3080
|
}
|
|
2848
3081
|
|
|
2849
|
-
|
|
2850
|
-
|
|
3082
|
+
yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner);
|
|
3083
|
+
yy_load_buffer_state( yyscanner );
|
|
2851
3084
|
}
|
|
2852
3085
|
|
|
2853
3086
|
/** Switch to a different input buffer.
|
|
2854
3087
|
* @param new_buffer The new input buffer.
|
|
2855
3088
|
* @param yyscanner The scanner object.
|
|
2856
3089
|
*/
|
|
2857
|
-
void
|
|
3090
|
+
void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
|
|
2858
3091
|
{
|
|
2859
3092
|
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
|
2860
3093
|
|
|
2861
3094
|
/* TODO. We should be able to replace this entire function body
|
|
2862
3095
|
* with
|
|
2863
|
-
*
|
|
2864
|
-
*
|
|
3096
|
+
* yypop_buffer_state();
|
|
3097
|
+
* yypush_buffer_state(new_buffer);
|
|
2865
3098
|
*/
|
|
2866
|
-
|
|
3099
|
+
yyensure_buffer_stack (yyscanner);
|
|
2867
3100
|
if ( YY_CURRENT_BUFFER == new_buffer )
|
|
2868
3101
|
return;
|
|
2869
3102
|
|
|
@@ -2876,17 +3109,17 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
|
|
|
2876
3109
|
}
|
|
2877
3110
|
|
|
2878
3111
|
YY_CURRENT_BUFFER_LVALUE = new_buffer;
|
|
2879
|
-
|
|
3112
|
+
yy_load_buffer_state( yyscanner );
|
|
2880
3113
|
|
|
2881
3114
|
/* We don't actually know whether we did this switch during
|
|
2882
|
-
* EOF (
|
|
2883
|
-
* is looked at is after
|
|
3115
|
+
* EOF (yywrap()) processing, but the only time this flag
|
|
3116
|
+
* is looked at is after yywrap() is called, so it's safe
|
|
2884
3117
|
* to go ahead and always set it.
|
|
2885
3118
|
*/
|
|
2886
3119
|
yyg->yy_did_buffer_switch_on_eof = 1;
|
|
2887
3120
|
}
|
|
2888
3121
|
|
|
2889
|
-
static void
|
|
3122
|
+
static void yy_load_buffer_state (yyscan_t yyscanner)
|
|
2890
3123
|
{
|
|
2891
3124
|
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
|
2892
3125
|
yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
|
|
@@ -2901,35 +3134,35 @@ static void core_yy_load_buffer_state (yyscan_t yyscanner)
|
|
|
2901
3134
|
* @param yyscanner The scanner object.
|
|
2902
3135
|
* @return the allocated buffer state.
|
|
2903
3136
|
*/
|
|
2904
|
-
YY_BUFFER_STATE
|
|
3137
|
+
YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
|
|
2905
3138
|
{
|
|
2906
3139
|
YY_BUFFER_STATE b;
|
|
2907
3140
|
|
|
2908
|
-
b = (YY_BUFFER_STATE)
|
|
3141
|
+
b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
|
|
2909
3142
|
if ( ! b )
|
|
2910
|
-
YY_FATAL_ERROR( "out of dynamic memory in
|
|
3143
|
+
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
|
|
2911
3144
|
|
|
2912
3145
|
b->yy_buf_size = size;
|
|
2913
3146
|
|
|
2914
3147
|
/* yy_ch_buf has to be 2 characters longer than the size given because
|
|
2915
3148
|
* we need to put in 2 end-of-buffer characters.
|
|
2916
3149
|
*/
|
|
2917
|
-
b->yy_ch_buf = (char *)
|
|
3150
|
+
b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
|
|
2918
3151
|
if ( ! b->yy_ch_buf )
|
|
2919
|
-
YY_FATAL_ERROR( "out of dynamic memory in
|
|
3152
|
+
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
|
|
2920
3153
|
|
|
2921
3154
|
b->yy_is_our_buffer = 1;
|
|
2922
3155
|
|
|
2923
|
-
|
|
3156
|
+
yy_init_buffer( b, file , yyscanner);
|
|
2924
3157
|
|
|
2925
3158
|
return b;
|
|
2926
3159
|
}
|
|
2927
3160
|
|
|
2928
3161
|
/** Destroy the buffer.
|
|
2929
|
-
* @param b a buffer created with
|
|
3162
|
+
* @param b a buffer created with yy_create_buffer()
|
|
2930
3163
|
* @param yyscanner The scanner object.
|
|
2931
3164
|
*/
|
|
2932
|
-
void
|
|
3165
|
+
void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
|
|
2933
3166
|
{
|
|
2934
3167
|
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
|
2935
3168
|
|
|
@@ -2940,28 +3173,28 @@ static void core_yy_load_buffer_state (yyscan_t yyscanner)
|
|
|
2940
3173
|
YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
|
|
2941
3174
|
|
|
2942
3175
|
if ( b->yy_is_our_buffer )
|
|
2943
|
-
|
|
3176
|
+
yyfree( (void *) b->yy_ch_buf , yyscanner );
|
|
2944
3177
|
|
|
2945
|
-
|
|
3178
|
+
yyfree( (void *) b , yyscanner );
|
|
2946
3179
|
}
|
|
2947
3180
|
|
|
2948
3181
|
/* Initializes or reinitializes a buffer.
|
|
2949
3182
|
* This function is sometimes called more than once on the same buffer,
|
|
2950
|
-
* such as during a
|
|
3183
|
+
* such as during a yyrestart() or at EOF.
|
|
2951
3184
|
*/
|
|
2952
|
-
static void
|
|
3185
|
+
static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
|
|
2953
3186
|
|
|
2954
3187
|
{
|
|
2955
3188
|
int oerrno = errno;
|
|
2956
3189
|
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
|
2957
3190
|
|
|
2958
|
-
|
|
3191
|
+
yy_flush_buffer( b , yyscanner);
|
|
2959
3192
|
|
|
2960
3193
|
b->yy_input_file = file;
|
|
2961
3194
|
b->yy_fill_buffer = 1;
|
|
2962
3195
|
|
|
2963
|
-
/* If b is the current buffer, then
|
|
2964
|
-
* called from
|
|
3196
|
+
/* If b is the current buffer, then yy_init_buffer was _probably_
|
|
3197
|
+
* called from yyrestart() or through yy_get_next_buffer.
|
|
2965
3198
|
* In that case, we don't want to reset the lineno or column.
|
|
2966
3199
|
*/
|
|
2967
3200
|
if (b != YY_CURRENT_BUFFER){
|
|
@@ -2978,7 +3211,7 @@ static void core_yy_load_buffer_state (yyscan_t yyscanner)
|
|
|
2978
3211
|
* @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
|
|
2979
3212
|
* @param yyscanner The scanner object.
|
|
2980
3213
|
*/
|
|
2981
|
-
void
|
|
3214
|
+
void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
|
|
2982
3215
|
{
|
|
2983
3216
|
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
|
2984
3217
|
if ( ! b )
|
|
@@ -2999,7 +3232,7 @@ static void core_yy_load_buffer_state (yyscan_t yyscanner)
|
|
|
2999
3232
|
b->yy_buffer_status = YY_BUFFER_NEW;
|
|
3000
3233
|
|
|
3001
3234
|
if ( b == YY_CURRENT_BUFFER )
|
|
3002
|
-
|
|
3235
|
+
yy_load_buffer_state( yyscanner );
|
|
3003
3236
|
}
|
|
3004
3237
|
|
|
3005
3238
|
/** Pushes the new state onto the stack. The new state becomes
|
|
@@ -3008,15 +3241,15 @@ static void core_yy_load_buffer_state (yyscan_t yyscanner)
|
|
|
3008
3241
|
* @param new_buffer The new state.
|
|
3009
3242
|
* @param yyscanner The scanner object.
|
|
3010
3243
|
*/
|
|
3011
|
-
void
|
|
3244
|
+
void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
|
|
3012
3245
|
{
|
|
3013
3246
|
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
|
3014
3247
|
if (new_buffer == NULL)
|
|
3015
3248
|
return;
|
|
3016
3249
|
|
|
3017
|
-
|
|
3250
|
+
yyensure_buffer_stack(yyscanner);
|
|
3018
3251
|
|
|
3019
|
-
/* This block is copied from
|
|
3252
|
+
/* This block is copied from yy_switch_to_buffer. */
|
|
3020
3253
|
if ( YY_CURRENT_BUFFER )
|
|
3021
3254
|
{
|
|
3022
3255
|
/* Flush out information for old buffer. */
|
|
@@ -3030,8 +3263,8 @@ void core_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
|
|
|
3030
3263
|
yyg->yy_buffer_stack_top++;
|
|
3031
3264
|
YY_CURRENT_BUFFER_LVALUE = new_buffer;
|
|
3032
3265
|
|
|
3033
|
-
/* copied from
|
|
3034
|
-
|
|
3266
|
+
/* copied from yy_switch_to_buffer. */
|
|
3267
|
+
yy_load_buffer_state( yyscanner );
|
|
3035
3268
|
yyg->yy_did_buffer_switch_on_eof = 1;
|
|
3036
3269
|
}
|
|
3037
3270
|
|
|
@@ -3039,19 +3272,19 @@ void core_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
|
|
|
3039
3272
|
* The next element becomes the new top.
|
|
3040
3273
|
* @param yyscanner The scanner object.
|
|
3041
3274
|
*/
|
|
3042
|
-
void
|
|
3275
|
+
void yypop_buffer_state (yyscan_t yyscanner)
|
|
3043
3276
|
{
|
|
3044
3277
|
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
|
3045
3278
|
if (!YY_CURRENT_BUFFER)
|
|
3046
3279
|
return;
|
|
3047
3280
|
|
|
3048
|
-
|
|
3281
|
+
yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner);
|
|
3049
3282
|
YY_CURRENT_BUFFER_LVALUE = NULL;
|
|
3050
3283
|
if (yyg->yy_buffer_stack_top > 0)
|
|
3051
3284
|
--yyg->yy_buffer_stack_top;
|
|
3052
3285
|
|
|
3053
3286
|
if (YY_CURRENT_BUFFER) {
|
|
3054
|
-
|
|
3287
|
+
yy_load_buffer_state( yyscanner );
|
|
3055
3288
|
yyg->yy_did_buffer_switch_on_eof = 1;
|
|
3056
3289
|
}
|
|
3057
3290
|
}
|
|
@@ -3059,7 +3292,7 @@ void core_yypop_buffer_state (yyscan_t yyscanner)
|
|
|
3059
3292
|
/* Allocates the stack if it does not exist.
|
|
3060
3293
|
* Guarantees space for at least one push.
|
|
3061
3294
|
*/
|
|
3062
|
-
static void
|
|
3295
|
+
static void yyensure_buffer_stack (yyscan_t yyscanner)
|
|
3063
3296
|
{
|
|
3064
3297
|
yy_size_t num_to_alloc;
|
|
3065
3298
|
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
|
@@ -3070,15 +3303,15 @@ static void core_yyensure_buffer_stack (yyscan_t yyscanner)
|
|
|
3070
3303
|
* scanner will even need a stack. We use 2 instead of 1 to avoid an
|
|
3071
3304
|
* immediate realloc on the next call.
|
|
3072
3305
|
*/
|
|
3073
|
-
|
|
3074
|
-
yyg->yy_buffer_stack = (struct yy_buffer_state**)
|
|
3306
|
+
num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
|
|
3307
|
+
yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
|
|
3075
3308
|
(num_to_alloc * sizeof(struct yy_buffer_state*)
|
|
3076
3309
|
, yyscanner);
|
|
3077
3310
|
if ( ! yyg->yy_buffer_stack )
|
|
3078
|
-
YY_FATAL_ERROR( "out of dynamic memory in
|
|
3079
|
-
|
|
3311
|
+
YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
|
|
3312
|
+
|
|
3080
3313
|
memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
|
|
3081
|
-
|
|
3314
|
+
|
|
3082
3315
|
yyg->yy_buffer_stack_max = num_to_alloc;
|
|
3083
3316
|
yyg->yy_buffer_stack_top = 0;
|
|
3084
3317
|
return;
|
|
@@ -3087,15 +3320,15 @@ static void core_yyensure_buffer_stack (yyscan_t yyscanner)
|
|
|
3087
3320
|
if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
|
|
3088
3321
|
|
|
3089
3322
|
/* Increase the buffer to prepare for a possible push. */
|
|
3090
|
-
|
|
3323
|
+
yy_size_t grow_size = 8 /* arbitrary grow size */;
|
|
3091
3324
|
|
|
3092
3325
|
num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
|
|
3093
|
-
yyg->yy_buffer_stack = (struct yy_buffer_state**)
|
|
3326
|
+
yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
|
|
3094
3327
|
(yyg->yy_buffer_stack,
|
|
3095
3328
|
num_to_alloc * sizeof(struct yy_buffer_state*)
|
|
3096
3329
|
, yyscanner);
|
|
3097
3330
|
if ( ! yyg->yy_buffer_stack )
|
|
3098
|
-
YY_FATAL_ERROR( "out of dynamic memory in
|
|
3331
|
+
YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
|
|
3099
3332
|
|
|
3100
3333
|
/* zero only the new slots.*/
|
|
3101
3334
|
memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
|
|
@@ -3107,9 +3340,9 @@ static void core_yyensure_buffer_stack (yyscan_t yyscanner)
|
|
|
3107
3340
|
* @param base the character buffer
|
|
3108
3341
|
* @param size the size in bytes of the character buffer
|
|
3109
3342
|
* @param yyscanner The scanner object.
|
|
3110
|
-
* @return the newly allocated buffer state object.
|
|
3343
|
+
* @return the newly allocated buffer state object.
|
|
3111
3344
|
*/
|
|
3112
|
-
YY_BUFFER_STATE
|
|
3345
|
+
YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
|
|
3113
3346
|
{
|
|
3114
3347
|
YY_BUFFER_STATE b;
|
|
3115
3348
|
|
|
@@ -3117,68 +3350,69 @@ YY_BUFFER_STATE core_yy_scan_buffer (char * base, yy_size_t size , yyscan_t yy
|
|
|
3117
3350
|
base[size-2] != YY_END_OF_BUFFER_CHAR ||
|
|
3118
3351
|
base[size-1] != YY_END_OF_BUFFER_CHAR )
|
|
3119
3352
|
/* They forgot to leave room for the EOB's. */
|
|
3120
|
-
return
|
|
3353
|
+
return NULL;
|
|
3121
3354
|
|
|
3122
|
-
b = (YY_BUFFER_STATE)
|
|
3355
|
+
b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
|
|
3123
3356
|
if ( ! b )
|
|
3124
|
-
YY_FATAL_ERROR( "out of dynamic memory in
|
|
3357
|
+
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
|
|
3125
3358
|
|
|
3126
|
-
b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
|
|
3359
|
+
b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
|
|
3127
3360
|
b->yy_buf_pos = b->yy_ch_buf = base;
|
|
3128
3361
|
b->yy_is_our_buffer = 0;
|
|
3129
|
-
b->yy_input_file =
|
|
3362
|
+
b->yy_input_file = NULL;
|
|
3130
3363
|
b->yy_n_chars = b->yy_buf_size;
|
|
3131
3364
|
b->yy_is_interactive = 0;
|
|
3132
3365
|
b->yy_at_bol = 1;
|
|
3133
3366
|
b->yy_fill_buffer = 0;
|
|
3134
3367
|
b->yy_buffer_status = YY_BUFFER_NEW;
|
|
3135
3368
|
|
|
3136
|
-
|
|
3369
|
+
yy_switch_to_buffer( b , yyscanner );
|
|
3137
3370
|
|
|
3138
3371
|
return b;
|
|
3139
3372
|
}
|
|
3140
3373
|
|
|
3141
|
-
/** Setup the input buffer state to scan a string. The next call to
|
|
3374
|
+
/** Setup the input buffer state to scan a string. The next call to yylex() will
|
|
3142
3375
|
* scan from a @e copy of @a str.
|
|
3143
3376
|
* @param yystr a NUL-terminated string to scan
|
|
3144
3377
|
* @param yyscanner The scanner object.
|
|
3145
3378
|
* @return the newly allocated buffer state object.
|
|
3146
3379
|
* @note If you want to scan bytes that may contain NUL values, then use
|
|
3147
|
-
*
|
|
3380
|
+
* yy_scan_bytes() instead.
|
|
3148
3381
|
*/
|
|
3149
|
-
YY_BUFFER_STATE
|
|
3382
|
+
YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner)
|
|
3150
3383
|
{
|
|
3151
3384
|
|
|
3152
|
-
return
|
|
3385
|
+
return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner);
|
|
3153
3386
|
}
|
|
3154
3387
|
|
|
3155
|
-
/** Setup the input buffer state to scan the given bytes. The next call to
|
|
3388
|
+
/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
|
|
3156
3389
|
* scan from a @e copy of @a bytes.
|
|
3157
|
-
* @param
|
|
3158
|
-
* @param
|
|
3390
|
+
* @param yybytes the byte buffer to scan
|
|
3391
|
+
* @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
|
|
3159
3392
|
* @param yyscanner The scanner object.
|
|
3160
3393
|
* @return the newly allocated buffer state object.
|
|
3161
3394
|
*/
|
|
3162
|
-
YY_BUFFER_STATE
|
|
3395
|
+
YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner)
|
|
3163
3396
|
{
|
|
3164
3397
|
YY_BUFFER_STATE b;
|
|
3165
3398
|
char *buf;
|
|
3166
|
-
yy_size_t n
|
|
3399
|
+
yy_size_t n;
|
|
3400
|
+
yy_size_t i;
|
|
3167
3401
|
|
|
3168
3402
|
/* Get memory for full buffer, including space for trailing EOB's. */
|
|
3169
|
-
n = _yybytes_len + 2;
|
|
3170
|
-
buf = (char *)
|
|
3403
|
+
n = (yy_size_t) (_yybytes_len + 2);
|
|
3404
|
+
buf = (char *) yyalloc( n , yyscanner );
|
|
3171
3405
|
if ( ! buf )
|
|
3172
|
-
YY_FATAL_ERROR( "out of dynamic memory in
|
|
3406
|
+
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
|
|
3173
3407
|
|
|
3174
3408
|
for ( i = 0; i < _yybytes_len; ++i )
|
|
3175
3409
|
buf[i] = yybytes[i];
|
|
3176
3410
|
|
|
3177
3411
|
buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
|
|
3178
3412
|
|
|
3179
|
-
b =
|
|
3413
|
+
b = yy_scan_buffer( buf, n , yyscanner);
|
|
3180
3414
|
if ( ! b )
|
|
3181
|
-
YY_FATAL_ERROR( "bad buffer in
|
|
3415
|
+
YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
|
|
3182
3416
|
|
|
3183
3417
|
/* It's okay to grow etc. this buffer, and we should throw it
|
|
3184
3418
|
* away when we're done.
|
|
@@ -3192,9 +3426,11 @@ YY_BUFFER_STATE core_yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes
|
|
|
3192
3426
|
#define YY_EXIT_FAILURE 2
|
|
3193
3427
|
#endif
|
|
3194
3428
|
|
|
3195
|
-
static void yy_fatal_error (
|
|
3429
|
+
static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner)
|
|
3196
3430
|
{
|
|
3197
|
-
|
|
3431
|
+
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
|
3432
|
+
(void)yyg;
|
|
3433
|
+
//( stderr, "%s\n", msg );
|
|
3198
3434
|
throw std::runtime_error(msg); // YY_EXIT_FAILURE );
|
|
3199
3435
|
}
|
|
3200
3436
|
|
|
@@ -3205,7 +3441,7 @@ static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
|
|
|
3205
3441
|
do \
|
|
3206
3442
|
{ \
|
|
3207
3443
|
/* Undo effects of setting up yytext. */ \
|
|
3208
|
-
|
|
3444
|
+
yy_size_t yyless_macro_arg = (n); \
|
|
3209
3445
|
YY_LESS_LINENO(yyless_macro_arg);\
|
|
3210
3446
|
yytext[yyleng] = yyg->yy_hold_char; \
|
|
3211
3447
|
yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
|
|
@@ -3220,7 +3456,7 @@ static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
|
|
|
3220
3456
|
/** Get the user-defined data for this scanner.
|
|
3221
3457
|
* @param yyscanner The scanner object.
|
|
3222
3458
|
*/
|
|
3223
|
-
YY_EXTRA_TYPE
|
|
3459
|
+
YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner)
|
|
3224
3460
|
{
|
|
3225
3461
|
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
|
3226
3462
|
return yyextra;
|
|
@@ -3229,10 +3465,10 @@ YY_EXTRA_TYPE core_yyget_extra (yyscan_t yyscanner)
|
|
|
3229
3465
|
/** Get the current line number.
|
|
3230
3466
|
* @param yyscanner The scanner object.
|
|
3231
3467
|
*/
|
|
3232
|
-
int
|
|
3468
|
+
int yyget_lineno (yyscan_t yyscanner)
|
|
3233
3469
|
{
|
|
3234
3470
|
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
|
3235
|
-
|
|
3471
|
+
|
|
3236
3472
|
if (! YY_CURRENT_BUFFER)
|
|
3237
3473
|
return 0;
|
|
3238
3474
|
|
|
@@ -3242,10 +3478,10 @@ int core_yyget_lineno (yyscan_t yyscanner)
|
|
|
3242
3478
|
/** Get the current column number.
|
|
3243
3479
|
* @param yyscanner The scanner object.
|
|
3244
3480
|
*/
|
|
3245
|
-
int
|
|
3481
|
+
int yyget_column (yyscan_t yyscanner)
|
|
3246
3482
|
{
|
|
3247
3483
|
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
|
3248
|
-
|
|
3484
|
+
|
|
3249
3485
|
if (! YY_CURRENT_BUFFER)
|
|
3250
3486
|
return 0;
|
|
3251
3487
|
|
|
@@ -3255,7 +3491,7 @@ int core_yyget_column (yyscan_t yyscanner)
|
|
|
3255
3491
|
/** Get the input stream.
|
|
3256
3492
|
* @param yyscanner The scanner object.
|
|
3257
3493
|
*/
|
|
3258
|
-
FILE *
|
|
3494
|
+
FILE *yyget_in (yyscan_t yyscanner)
|
|
3259
3495
|
{
|
|
3260
3496
|
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
|
3261
3497
|
return yyin;
|
|
@@ -3264,7 +3500,7 @@ FILE *core_yyget_in (yyscan_t yyscanner)
|
|
|
3264
3500
|
/** Get the output stream.
|
|
3265
3501
|
* @param yyscanner The scanner object.
|
|
3266
3502
|
*/
|
|
3267
|
-
FILE *
|
|
3503
|
+
FILE *yyget_out (yyscan_t yyscanner)
|
|
3268
3504
|
{
|
|
3269
3505
|
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
|
3270
3506
|
return yyout;
|
|
@@ -3273,7 +3509,7 @@ FILE *core_yyget_out (yyscan_t yyscanner)
|
|
|
3273
3509
|
/** Get the length of the current token.
|
|
3274
3510
|
* @param yyscanner The scanner object.
|
|
3275
3511
|
*/
|
|
3276
|
-
yy_size_t
|
|
3512
|
+
yy_size_t yyget_leng (yyscan_t yyscanner)
|
|
3277
3513
|
{
|
|
3278
3514
|
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
|
3279
3515
|
return yyleng;
|
|
@@ -3283,7 +3519,7 @@ yy_size_t core_yyget_leng (yyscan_t yyscanner)
|
|
|
3283
3519
|
* @param yyscanner The scanner object.
|
|
3284
3520
|
*/
|
|
3285
3521
|
|
|
3286
|
-
char *
|
|
3522
|
+
char *yyget_text (yyscan_t yyscanner)
|
|
3287
3523
|
{
|
|
3288
3524
|
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
|
3289
3525
|
return yytext;
|
|
@@ -3293,93 +3529,93 @@ char *core_yyget_text (yyscan_t yyscanner)
|
|
|
3293
3529
|
* @param user_defined The data to be associated with this scanner.
|
|
3294
3530
|
* @param yyscanner The scanner object.
|
|
3295
3531
|
*/
|
|
3296
|
-
void
|
|
3532
|
+
void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
|
|
3297
3533
|
{
|
|
3298
3534
|
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
|
3299
3535
|
yyextra = user_defined ;
|
|
3300
3536
|
}
|
|
3301
3537
|
|
|
3302
3538
|
/** Set the current line number.
|
|
3303
|
-
* @param
|
|
3539
|
+
* @param _line_number line number
|
|
3304
3540
|
* @param yyscanner The scanner object.
|
|
3305
3541
|
*/
|
|
3306
|
-
void
|
|
3542
|
+
void yyset_lineno (int _line_number , yyscan_t yyscanner)
|
|
3307
3543
|
{
|
|
3308
3544
|
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
|
3309
3545
|
|
|
3310
3546
|
/* lineno is only valid if an input buffer exists. */
|
|
3311
3547
|
if (! YY_CURRENT_BUFFER )
|
|
3312
|
-
|
|
3548
|
+
YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
|
|
3313
3549
|
|
|
3314
|
-
yylineno =
|
|
3550
|
+
yylineno = _line_number;
|
|
3315
3551
|
}
|
|
3316
3552
|
|
|
3317
3553
|
/** Set the current column.
|
|
3318
|
-
* @param
|
|
3554
|
+
* @param _column_no column number
|
|
3319
3555
|
* @param yyscanner The scanner object.
|
|
3320
3556
|
*/
|
|
3321
|
-
void
|
|
3557
|
+
void yyset_column (int _column_no , yyscan_t yyscanner)
|
|
3322
3558
|
{
|
|
3323
3559
|
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
|
3324
3560
|
|
|
3325
3561
|
/* column is only valid if an input buffer exists. */
|
|
3326
3562
|
if (! YY_CURRENT_BUFFER )
|
|
3327
|
-
|
|
3563
|
+
YY_FATAL_ERROR( "yyset_column called with no buffer" );
|
|
3328
3564
|
|
|
3329
|
-
yycolumn =
|
|
3565
|
+
yycolumn = _column_no;
|
|
3330
3566
|
}
|
|
3331
3567
|
|
|
3332
3568
|
/** Set the input stream. This does not discard the current
|
|
3333
3569
|
* input buffer.
|
|
3334
|
-
* @param
|
|
3570
|
+
* @param _in_str A readable stream.
|
|
3335
3571
|
* @param yyscanner The scanner object.
|
|
3336
|
-
* @see
|
|
3572
|
+
* @see yy_switch_to_buffer
|
|
3337
3573
|
*/
|
|
3338
|
-
void
|
|
3574
|
+
void yyset_in (FILE * _in_str , yyscan_t yyscanner)
|
|
3339
3575
|
{
|
|
3340
3576
|
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
|
3341
|
-
yyin =
|
|
3577
|
+
yyin = _in_str ;
|
|
3342
3578
|
}
|
|
3343
3579
|
|
|
3344
|
-
void
|
|
3580
|
+
void yyset_out (FILE * _out_str , yyscan_t yyscanner)
|
|
3345
3581
|
{
|
|
3346
3582
|
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
|
3347
|
-
yyout =
|
|
3583
|
+
yyout = _out_str ;
|
|
3348
3584
|
}
|
|
3349
3585
|
|
|
3350
|
-
int
|
|
3586
|
+
int yyget_debug (yyscan_t yyscanner)
|
|
3351
3587
|
{
|
|
3352
3588
|
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
|
3353
3589
|
return yy_flex_debug;
|
|
3354
3590
|
}
|
|
3355
3591
|
|
|
3356
|
-
void
|
|
3592
|
+
void yyset_debug (int _bdebug , yyscan_t yyscanner)
|
|
3357
3593
|
{
|
|
3358
3594
|
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
|
3359
|
-
yy_flex_debug =
|
|
3595
|
+
yy_flex_debug = _bdebug ;
|
|
3360
3596
|
}
|
|
3361
3597
|
|
|
3362
3598
|
/* Accessor methods for yylval and yylloc */
|
|
3363
3599
|
|
|
3364
|
-
YYSTYPE *
|
|
3600
|
+
YYSTYPE * yyget_lval (yyscan_t yyscanner)
|
|
3365
3601
|
{
|
|
3366
3602
|
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
|
3367
3603
|
return yylval;
|
|
3368
3604
|
}
|
|
3369
3605
|
|
|
3370
|
-
void
|
|
3606
|
+
void yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
|
|
3371
3607
|
{
|
|
3372
3608
|
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
|
3373
3609
|
yylval = yylval_param;
|
|
3374
3610
|
}
|
|
3375
3611
|
|
|
3376
|
-
YYLTYPE *
|
|
3612
|
+
YYLTYPE *yyget_lloc (yyscan_t yyscanner)
|
|
3377
3613
|
{
|
|
3378
3614
|
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
|
3379
3615
|
return yylloc;
|
|
3380
3616
|
}
|
|
3381
3617
|
|
|
3382
|
-
void
|
|
3618
|
+
void yyset_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner)
|
|
3383
3619
|
{
|
|
3384
3620
|
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
|
3385
3621
|
yylloc = yylloc_param;
|
|
@@ -3387,20 +3623,18 @@ void core_yyset_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner)
|
|
|
3387
3623
|
|
|
3388
3624
|
/* User-visible API */
|
|
3389
3625
|
|
|
3390
|
-
/*
|
|
3626
|
+
/* yylex_init is special because it creates the scanner itself, so it is
|
|
3391
3627
|
* the ONLY reentrant function that doesn't take the scanner as the last argument.
|
|
3392
3628
|
* That's why we explicitly handle the declaration, instead of using our macros.
|
|
3393
3629
|
*/
|
|
3394
|
-
|
|
3395
|
-
int core_yylex_init(yyscan_t* ptr_yy_globals)
|
|
3396
|
-
|
|
3630
|
+
int yylex_init(yyscan_t* ptr_yy_globals)
|
|
3397
3631
|
{
|
|
3398
3632
|
if (ptr_yy_globals == NULL){
|
|
3399
3633
|
errno = EINVAL;
|
|
3400
3634
|
return 1;
|
|
3401
3635
|
}
|
|
3402
3636
|
|
|
3403
|
-
*ptr_yy_globals = (yyscan_t)
|
|
3637
|
+
*ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
|
|
3404
3638
|
|
|
3405
3639
|
if (*ptr_yy_globals == NULL){
|
|
3406
3640
|
errno = ENOMEM;
|
|
@@ -3413,39 +3647,37 @@ int core_yylex_init(yyscan_t* ptr_yy_globals)
|
|
|
3413
3647
|
return yy_init_globals ( *ptr_yy_globals );
|
|
3414
3648
|
}
|
|
3415
3649
|
|
|
3416
|
-
/*
|
|
3650
|
+
/* yylex_init_extra has the same functionality as yylex_init, but follows the
|
|
3417
3651
|
* convention of taking the scanner as the last argument. Note however, that
|
|
3418
3652
|
* this is a *pointer* to a scanner, as it will be allocated by this call (and
|
|
3419
3653
|
* is the reason, too, why this function also must handle its own declaration).
|
|
3420
|
-
* The user defined value in the first argument will be available to
|
|
3654
|
+
* The user defined value in the first argument will be available to yyalloc in
|
|
3421
3655
|
* the yyextra field.
|
|
3422
3656
|
*/
|
|
3423
|
-
|
|
3424
|
-
int core_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
|
|
3425
|
-
|
|
3657
|
+
int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )
|
|
3426
3658
|
{
|
|
3427
3659
|
struct yyguts_t dummy_yyguts;
|
|
3428
3660
|
|
|
3429
|
-
|
|
3661
|
+
yyset_extra (yy_user_defined, &dummy_yyguts);
|
|
3430
3662
|
|
|
3431
3663
|
if (ptr_yy_globals == NULL){
|
|
3432
3664
|
errno = EINVAL;
|
|
3433
3665
|
return 1;
|
|
3434
3666
|
}
|
|
3435
|
-
|
|
3436
|
-
*ptr_yy_globals = (yyscan_t)
|
|
3437
|
-
|
|
3667
|
+
|
|
3668
|
+
*ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
|
|
3669
|
+
|
|
3438
3670
|
if (*ptr_yy_globals == NULL){
|
|
3439
3671
|
errno = ENOMEM;
|
|
3440
3672
|
return 1;
|
|
3441
3673
|
}
|
|
3442
|
-
|
|
3674
|
+
|
|
3443
3675
|
/* By setting to 0xAA, we expose bugs in
|
|
3444
3676
|
yy_init_globals. Leave at 0x00 for releases. */
|
|
3445
3677
|
memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3678
|
+
|
|
3679
|
+
yyset_extra (yy_user_defined, *ptr_yy_globals);
|
|
3680
|
+
|
|
3449
3681
|
return yy_init_globals ( *ptr_yy_globals );
|
|
3450
3682
|
}
|
|
3451
3683
|
|
|
@@ -3453,13 +3685,13 @@ static int yy_init_globals (yyscan_t yyscanner)
|
|
|
3453
3685
|
{
|
|
3454
3686
|
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
|
3455
3687
|
/* Initialization is the same as for the non-reentrant scanner.
|
|
3456
|
-
* This function is called from
|
|
3688
|
+
* This function is called from yylex_destroy(), so don't allocate here.
|
|
3457
3689
|
*/
|
|
3458
3690
|
|
|
3459
|
-
yyg->yy_buffer_stack =
|
|
3691
|
+
yyg->yy_buffer_stack = NULL;
|
|
3460
3692
|
yyg->yy_buffer_stack_top = 0;
|
|
3461
3693
|
yyg->yy_buffer_stack_max = 0;
|
|
3462
|
-
yyg->yy_c_buf_p =
|
|
3694
|
+
yyg->yy_c_buf_p = NULL;
|
|
3463
3695
|
yyg->yy_init = 0;
|
|
3464
3696
|
yyg->yy_start = 0;
|
|
3465
3697
|
|
|
@@ -3468,41 +3700,46 @@ static int yy_init_globals (yyscan_t yyscanner)
|
|
|
3468
3700
|
yyg->yy_start_stack = NULL;
|
|
3469
3701
|
|
|
3470
3702
|
/* Defined in main.c */
|
|
3471
|
-
|
|
3472
|
-
|
|
3703
|
+
#ifdef YY_STDINIT
|
|
3704
|
+
yyin = stdin;
|
|
3705
|
+
yyout = stdout;
|
|
3706
|
+
#else
|
|
3707
|
+
yyin = NULL;
|
|
3708
|
+
yyout = NULL;
|
|
3709
|
+
#endif
|
|
3473
3710
|
|
|
3474
3711
|
/* For future reference: Set errno on error, since we are called by
|
|
3475
|
-
*
|
|
3712
|
+
* yylex_init()
|
|
3476
3713
|
*/
|
|
3477
3714
|
return 0;
|
|
3478
3715
|
}
|
|
3479
3716
|
|
|
3480
|
-
/*
|
|
3481
|
-
int
|
|
3717
|
+
/* yylex_destroy is for both reentrant and non-reentrant scanners. */
|
|
3718
|
+
int yylex_destroy (yyscan_t yyscanner)
|
|
3482
3719
|
{
|
|
3483
3720
|
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
|
3484
3721
|
|
|
3485
3722
|
/* Pop the buffer stack, destroying each element. */
|
|
3486
3723
|
while(YY_CURRENT_BUFFER){
|
|
3487
|
-
|
|
3724
|
+
yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner );
|
|
3488
3725
|
YY_CURRENT_BUFFER_LVALUE = NULL;
|
|
3489
|
-
|
|
3726
|
+
yypop_buffer_state(yyscanner);
|
|
3490
3727
|
}
|
|
3491
3728
|
|
|
3492
3729
|
/* Destroy the stack itself. */
|
|
3493
|
-
|
|
3730
|
+
yyfree(yyg->yy_buffer_stack , yyscanner);
|
|
3494
3731
|
yyg->yy_buffer_stack = NULL;
|
|
3495
3732
|
|
|
3496
3733
|
/* Destroy the start condition stack. */
|
|
3497
|
-
|
|
3734
|
+
yyfree( yyg->yy_start_stack , yyscanner );
|
|
3498
3735
|
yyg->yy_start_stack = NULL;
|
|
3499
3736
|
|
|
3500
3737
|
/* Reset the globals. This is important in a non-reentrant scanner so the next time
|
|
3501
|
-
*
|
|
3738
|
+
* yylex() is called, initialization will occur. */
|
|
3502
3739
|
yy_init_globals( yyscanner);
|
|
3503
3740
|
|
|
3504
3741
|
/* Destroy the main struct (reentrant only). */
|
|
3505
|
-
|
|
3742
|
+
yyfree ( yyscanner , yyscanner );
|
|
3506
3743
|
yyscanner = NULL;
|
|
3507
3744
|
return 0;
|
|
3508
3745
|
}
|
|
@@ -3512,8 +3749,11 @@ int core_yylex_destroy (yyscan_t yyscanner)
|
|
|
3512
3749
|
*/
|
|
3513
3750
|
|
|
3514
3751
|
#ifndef yytext_ptr
|
|
3515
|
-
static void yy_flex_strncpy (char* s1,
|
|
3752
|
+
static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner)
|
|
3516
3753
|
{
|
|
3754
|
+
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
|
3755
|
+
(void)yyg;
|
|
3756
|
+
|
|
3517
3757
|
int i;
|
|
3518
3758
|
for ( i = 0; i < n; ++i )
|
|
3519
3759
|
s1[i] = s2[i];
|
|
@@ -3521,7 +3761,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yysca
|
|
|
3521
3761
|
#endif
|
|
3522
3762
|
|
|
3523
3763
|
#ifdef YY_NEED_STRLEN
|
|
3524
|
-
static int yy_flex_strlen (
|
|
3764
|
+
static int yy_flex_strlen (const char * s , yyscan_t yyscanner)
|
|
3525
3765
|
{
|
|
3526
3766
|
int n;
|
|
3527
3767
|
for ( n = 0; s[n]; ++n )
|
|
@@ -3536,11 +3776,10 @@ static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
|
|
|
3536
3776
|
#line 1083 "third_party/libpg_query/scan.l"
|
|
3537
3777
|
|
|
3538
3778
|
|
|
3539
|
-
|
|
3540
3779
|
/* LCOV_EXCL_STOP */
|
|
3541
3780
|
|
|
3542
3781
|
/*
|
|
3543
|
-
* Arrange access to yyextra for subroutines of the main
|
|
3782
|
+
* Arrange access to yyextra for subroutines of the main yylex() function.
|
|
3544
3783
|
* We expect each subroutine to have a yyscanner parameter. Rather than
|
|
3545
3784
|
* use the yyget_xxx functions, which might or might not get inlined by the
|
|
3546
3785
|
* compiler, we cheat just a bit and cast yyscanner to the right type.
|
|
@@ -3585,7 +3824,7 @@ scanner_errposition(int location, core_yyscan_t yyscanner)
|
|
|
3585
3824
|
* Report a lexer or grammar error.
|
|
3586
3825
|
*
|
|
3587
3826
|
* The message's cursor position is whatever YYLLOC was last set to,
|
|
3588
|
-
* ie, the start of the current token if called within
|
|
3827
|
+
* ie, the start of the current token if called within yylex(), or the
|
|
3589
3828
|
* most recently lexed token if called from the grammar.
|
|
3590
3829
|
* This is OK for syntax error messages from the Bison parser, because Bison
|
|
3591
3830
|
* parsers report error as soon as the first unparsable token is reached.
|
|
@@ -3628,8 +3867,8 @@ scanner_init(const char *str,
|
|
|
3628
3867
|
PGSize slen = strlen(str);
|
|
3629
3868
|
yyscan_t scanner;
|
|
3630
3869
|
|
|
3631
|
-
if (
|
|
3632
|
-
elog(ERROR, "
|
|
3870
|
+
if (yylex_init(&scanner) != 0)
|
|
3871
|
+
elog(ERROR, "yylex_init() failed: %m");
|
|
3633
3872
|
|
|
3634
3873
|
core_yyset_extra(yyext, scanner);
|
|
3635
3874
|
|
|
@@ -3647,7 +3886,7 @@ scanner_init(const char *str,
|
|
|
3647
3886
|
yyext->scanbuflen = slen;
|
|
3648
3887
|
memcpy(yyext->scanbuf, str, slen);
|
|
3649
3888
|
yyext->scanbuf[slen] = yyext->scanbuf[slen + 1] = YY_END_OF_BUFFER_CHAR;
|
|
3650
|
-
|
|
3889
|
+
yy_scan_buffer(yyext->scanbuf, slen + 2, scanner);
|
|
3651
3890
|
|
|
3652
3891
|
/* initialize literal buffer to a reasonable but expansible size */
|
|
3653
3892
|
yyext->literalalloc = 1024;
|
|
@@ -3665,7 +3904,7 @@ void
|
|
|
3665
3904
|
scanner_finish(core_yyscan_t yyscanner)
|
|
3666
3905
|
{
|
|
3667
3906
|
/*
|
|
3668
|
-
* We don't bother to call
|
|
3907
|
+
* We don't bother to call yylex_destroy(), because all it would do is
|
|
3669
3908
|
* pfree a small amount of control storage. It's cheaper to leak the
|
|
3670
3909
|
* storage until the parsing context is destroyed. The amount of space
|
|
3671
3910
|
* involved is usually negligible compared to the output parse tree
|