4 ** The author disclaims copyright to this source code. In place of
5 ** a legal notice, here is a blessing:
7 ** May you do good and not evil.
8 ** May you find forgiveness for yourself and forgive others.
9 ** May you share freely, never taking more than you give.
11 *************************************************************************
12 ** Driver template for the LEMON parser generator.
14 ** The "lemon" program processes an LALR(1) input grammar file, then uses
15 ** this template to construct a parser. The "lemon" program inserts text
16 ** at each "%%" line. Also, any "P-a-r-s-e" identifer prefix (without the
17 ** interstitial "-" characters) contained in this template is changed into
18 ** the value of the %name directive from the grammar. Otherwise, the content
19 ** of this template is copied straight through into the generate parser
22 ** The following is the concatenation of all %include directives from the
23 ** input grammar file:
26 /************ Begin %include sections from the grammar ************************/
27 #line 1 "src/parser_proc.y"
29 #include "php_psi_stdinc.h"
37 /* rename lemon symbols, works better than DEF(%name) */
38 #define ParseAlloc psi_parser_proc_init_ex
39 #define Parse psi_parser_proc_parse
40 #define ParseTrace psi_parser_proc_trace
41 #define ParseFree psi_parser_proc_free_ex
44 void *ParseAlloc(void *(*mallocProc
)(size_t));
45 void ParseFree(void *p
, void (*freeProc
)(void*));
48 void *psi_parser_proc_init(void)
50 return ParseAlloc(malloc
);
53 void psi_parser_proc_free(void **parser_proc
)
56 ParseFree(*parser_proc
, free
);
61 #line 62 "src/parser_proc.c"
62 /**************** End of %include directives **********************************/
63 /* These constants specify the various numeric values for terminal symbols
64 ** in a format understandable to "makeheaders". This section is blank unless
65 ** "lemon" is run with the "-m" command-line option.
66 ***************** Begin makeheaders token definitions *************************/
67 /**************** End makeheaders token definitions ***************************/
69 /* The next sections is a series of control #defines.
70 ** various aspects of the generated parser.
71 ** YYCODETYPE is the data type used to store the integer codes
72 ** that represent terminal and non-terminal symbols.
73 ** "unsigned char" is used if there are fewer than
74 ** 256 symbols. Larger types otherwise.
75 ** YYNOCODE is a number of type YYCODETYPE that is not used for
76 ** any terminal or nonterminal symbol.
77 ** YYFALLBACK If defined, this indicates that one or more tokens
78 ** (also known as: "terminal symbols") have fall-back
79 ** values which should be used if the original symbol
80 ** would not parse. This permits keywords to sometimes
81 ** be used as identifiers, for example.
82 ** YYACTIONTYPE is the data type used for "action codes" - numbers
83 ** that indicate what to do in response to the next
85 ** ParseTOKENTYPE is the data type used for minor type for terminal
86 ** symbols. Background: A "minor type" is a semantic
87 ** value associated with a terminal or non-terminal
88 ** symbols. For example, for an "ID" terminal symbol,
89 ** the minor type might be the name of the identifier.
90 ** Each non-terminal can have a different minor type.
91 ** Terminal symbols all have the same minor type, though.
92 ** This macros defines the minor type for terminal
94 ** YYMINORTYPE is the data type used for all minor types.
95 ** This is typically a union of many types, one of
96 ** which is ParseTOKENTYPE. The entry in the union
97 ** for terminal symbols is called "yy0".
98 ** YYSTACKDEPTH is the maximum depth of the parser's stack. If
99 ** zero the stack is dynamically sized using realloc()
100 ** ParseARG_SDECL A static variable declaration for the %extra_argument
101 ** ParseARG_PDECL A parameter declaration for the %extra_argument
102 ** ParseARG_STORE Code to store %extra_argument into yypParser
103 ** ParseARG_FETCH Code to extract %extra_argument from yypParser
104 ** YYERRORSYMBOL is the code number of the error symbol. If not
105 ** defined, then do no error processing.
106 ** YYNSTATE the combined number of states.
107 ** YYNRULE the number of rules in the grammar
108 ** YY_MAX_SHIFT Maximum value for shift actions
109 ** YY_MIN_SHIFTREDUCE Minimum value for shift-reduce actions
110 ** YY_MAX_SHIFTREDUCE Maximum value for shift-reduce actions
111 ** YY_MIN_REDUCE Maximum value for reduce actions
112 ** YY_ERROR_ACTION The yy_action[] code for syntax error
113 ** YY_ACCEPT_ACTION The yy_action[] code for accept
114 ** YY_NO_ACTION The yy_action[] code for no-op
119 /************* Begin control #defines *****************************************/
120 #define YYCODETYPE unsigned char
122 #define YYACTIONTYPE unsigned short int
123 #define YYWILDCARD 74
124 #define ParseTOKENTYPE struct psi_token *
128 struct psi_decl_union
* yy15
;
129 struct psi_decl_abi
* yy26
;
130 struct psi_impl_arg
* yy34
;
131 struct psi_const
* yy38
;
132 struct psi_let_calloc
* yy45
;
133 struct psi_impl
* yy49
;
134 struct psi_impl_func
* yy56
;
135 struct psi_number
* yy57
;
136 struct psi_let_func
* yy67
;
138 struct psi_let_callback
* yy120
;
139 struct psi_cpp_macro_decl
* yy134
;
140 struct psi_impl_def_val
* yy145
;
141 struct psi_free_exp
* yy146
;
142 struct psi_decl_enum_item
* yy169
;
143 struct psi_decl_type
* yy172
;
144 struct psi_plist
* yy179
;
145 struct psi_set_exp
* yy180
;
146 struct psi_let_exp
* yy200
;
147 struct psi_assert_stmt
* yy201
;
148 struct psi_num_exp
* yy207
;
149 struct psi_free_stmt
* yy220
;
150 struct psi_token
** yy238
;
151 struct psi_layout yy239
;
152 struct psi_plist
* yy243
;
153 struct psi_impl_type
* yy246
;
154 struct psi_decl_var
* yy271
;
155 struct psi_cpp_exp
* yy274
;
156 struct psi_decl
* yy303
;
157 struct psi_let_stmt
* yy319
;
158 struct psi_decl_arg
* yy320
;
159 struct psi_decl_enum
* yy323
;
160 struct psi_decl_struct
* yy324
;
161 struct psi_return_stmt
* yy342
;
162 struct psi_const_type
* yy351
;
163 struct psi_set_stmt
* yy358
;
164 struct psi_set_func
* yy362
;
165 struct psi_layout
* yy369
;
166 struct psi_impl_var
* yy370
;
170 #define YYSTACKDEPTH 100
172 #define ParseARG_SDECL struct psi_parser *P;
173 #define ParseARG_PDECL ,struct psi_parser *P
174 #define ParseARG_FETCH struct psi_parser *P = yypParser->P
175 #define ParseARG_STORE yypParser->P = P
179 #define YY_MAX_SHIFT 232
180 #define YY_MIN_SHIFTREDUCE 385
181 #define YY_MAX_SHIFTREDUCE 575
182 #define YY_MIN_REDUCE 576
183 #define YY_MAX_REDUCE 766
184 #define YY_ERROR_ACTION 767
185 #define YY_ACCEPT_ACTION 768
186 #define YY_NO_ACTION 769
187 /************* End control #defines *******************************************/
189 /* Define the yytestcase() macro to be a no-op if is not already defined
192 ** Applications can choose to define yytestcase() in the %include section
193 ** to a macro that can assist in verifying code coverage. For production
194 ** code the yytestcase() macro should be turned off. But it is useful
198 # define yytestcase(X)
202 /* Next are the tables used to determine what action to take based on the
203 ** current state and lookahead token. These tables are used to implement
204 ** functions that take a state number and lookahead value and return an
207 ** Suppose the action integer is N. Then the action is determined as
210 ** 0 <= N <= YY_MAX_SHIFT Shift N. That is, push the lookahead
211 ** token onto the stack and goto state N.
213 ** N between YY_MIN_SHIFTREDUCE Shift to an arbitrary state then
214 ** and YY_MAX_SHIFTREDUCE reduce by rule N-YY_MIN_SHIFTREDUCE.
216 ** N between YY_MIN_REDUCE Reduce by rule N-YY_MIN_REDUCE
219 ** N == YY_ERROR_ACTION A syntax error has occurred.
221 ** N == YY_ACCEPT_ACTION The parser accepts its input.
223 ** N == YY_NO_ACTION No such action. Denotes unused
224 ** slots in the yy_action[] table.
226 ** The action table is constructed as a single large table named yy_action[].
227 ** Given state S and lookahead X, the action is computed as either:
229 ** (A) N = yy_action[ yy_shift_ofst[S] + X ]
230 ** (B) N = yy_default[S]
232 ** The (A) formula is preferred. The B formula is used instead if:
233 ** (1) The yy_shift_ofst[S]+X value is out of range, or
234 ** (2) yy_lookahead[yy_shift_ofst[S]+X] is not equal to X, or
235 ** (3) yy_shift_ofst[S] equal YY_SHIFT_USE_DFLT.
236 ** (Implementation note: YY_SHIFT_USE_DFLT is chosen so that
237 ** YY_SHIFT_USE_DFLT+X will be out of range for all possible lookaheads X.
238 ** Hence only tests (1) and (2) need to be evaluated.)
240 ** The formulas above are for computing the action when the lookahead is
241 ** a terminal symbol. If the lookahead is a non-terminal (as occurs after
242 ** a reduce action) then the yy_reduce_ofst[] array is used in place of
243 ** the yy_shift_ofst[] array and YY_REDUCE_USE_DFLT is used in place of
244 ** YY_SHIFT_USE_DFLT.
246 ** The following are the tables generated in this section:
248 ** yy_action[] A single table containing all actions.
249 ** yy_lookahead[] A table containing the lookahead for each entry in
250 ** yy_action. Used to detect hash collisions.
251 ** yy_shift_ofst[] For each state, the offset into yy_action for
252 ** shifting terminals.
253 ** yy_reduce_ofst[] For each state, the offset into yy_action for
254 ** shifting non-terminals after a reduce.
255 ** yy_default[] Default action for each state.
257 *********** Begin parsing tables **********************************************/
258 #define YY_ACTTAB_COUNT (1132)
259 static const YYACTIONTYPE yy_action
[] = {
260 /* 0 */ 482, 497, 520, 497, 497, 497, 497, 497, 497, 497,
261 /* 10 */ 497, 497, 497, 104, 525, 519, 189, 136, 565, 519,
262 /* 20 */ 521, 114, 17, 529, 531, 28, 28, 568, 25, 25,
263 /* 30 */ 510, 127, 42, 52, 11, 10, 70, 104, 28, 28,
264 /* 40 */ 173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
265 /* 50 */ 142, 568, 25, 25, 50, 94, 42, 52, 11, 10,
266 /* 60 */ 70, 568, 511, 501, 505, 505, 505, 505, 505, 438,
267 /* 70 */ 174, 59, 30, 30, 30, 30, 30, 30, 30, 30,
268 /* 80 */ 30, 30, 30, 30, 30, 29, 51, 30, 30, 171,
269 /* 90 */ 2, 101, 100, 99, 499, 436, 158, 37, 401, 401,
270 /* 100 */ 584, 585, 478, 92, 77, 75, 74, 482, 497, 226,
271 /* 110 */ 497, 497, 497, 497, 497, 497, 497, 497, 497, 497,
272 /* 120 */ 120, 104, 526, 519, 144, 504, 166, 519, 441, 441,
273 /* 130 */ 441, 441, 559, 28, 28, 568, 166, 166, 166, 166,
274 /* 140 */ 166, 166, 166, 218, 493, 81, 28, 28, 173, 173,
275 /* 150 */ 173, 173, 173, 173, 173, 173, 173, 173, 392, 146,
276 /* 160 */ 485, 78, 94, 437, 440, 482, 497, 464, 497, 497,
277 /* 170 */ 497, 497, 497, 497, 497, 497, 497, 497, 174, 68,
278 /* 180 */ 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
279 /* 190 */ 68, 68, 482, 29, 68, 68, 232, 471, 204, 206,
280 /* 200 */ 205, 503, 498, 46, 37, 513, 178, 502, 515, 478,
281 /* 210 */ 92, 77, 75, 74, 183, 135, 517, 516, 462, 128,
282 /* 220 */ 44, 514, 518, 482, 497, 463, 497, 497, 497, 497,
283 /* 230 */ 497, 497, 497, 497, 497, 497, 467, 423, 457, 180,
284 /* 240 */ 129, 560, 421, 453, 422, 149, 420, 419, 498, 46,
285 /* 250 */ 569, 417, 493, 21, 470, 134, 101, 100, 99, 498,
286 /* 260 */ 46, 91, 36, 418, 176, 161, 142, 478, 92, 77,
287 /* 270 */ 75, 74, 118, 142, 437, 439, 149, 119, 94, 172,
288 /* 280 */ 121, 482, 497, 162, 497, 497, 497, 497, 497, 497,
289 /* 290 */ 497, 497, 497, 497, 478, 92, 77, 221, 493, 573,
290 /* 300 */ 574, 575, 60, 768, 3, 3, 132, 219, 56, 493,
291 /* 310 */ 126, 112, 152, 142, 101, 100, 99, 106, 215, 195,
292 /* 320 */ 37, 454, 506, 73, 1, 478, 92, 77, 75, 74,
293 /* 330 */ 170, 142, 124, 80, 79, 568, 87, 182, 186, 482,
294 /* 340 */ 497, 207, 497, 497, 497, 497, 497, 497, 497, 497,
295 /* 350 */ 497, 497, 447, 191, 142, 104, 88, 519, 18, 512,
296 /* 360 */ 190, 519, 515, 122, 172, 498, 35, 28, 28, 568,
297 /* 370 */ 517, 516, 204, 206, 205, 514, 518, 520, 37, 105,
298 /* 380 */ 28, 28, 133, 478, 92, 77, 75, 74, 431, 464,
299 /* 390 */ 445, 444, 185, 186, 76, 521, 108, 482, 497, 207,
300 /* 400 */ 497, 497, 497, 497, 497, 497, 497, 497, 497, 497,
301 /* 410 */ 203, 219, 98, 96, 103, 493, 172, 402, 90, 591,
302 /* 420 */ 4, 472, 509, 498, 46, 142, 466, 29, 569, 520,
303 /* 430 */ 204, 206, 205, 188, 186, 520, 37, 142, 142, 142,
304 /* 440 */ 569, 478, 92, 77, 75, 74, 159, 521, 109, 143,
305 /* 450 */ 432, 192, 94, 521, 110, 482, 497, 207, 497, 497,
306 /* 460 */ 497, 497, 497, 497, 497, 497, 497, 497, 203, 219,
307 /* 470 */ 98, 96, 194, 493, 153, 38, 90, 142, 520, 473,
308 /* 480 */ 490, 498, 46, 142, 562, 40, 175, 489, 204, 206,
309 /* 490 */ 205, 540, 8, 402, 37, 586, 521, 116, 139, 478,
310 /* 500 */ 92, 77, 75, 74, 521, 115, 483, 528, 530, 148,
311 /* 510 */ 85, 527, 542, 482, 497, 79, 497, 497, 497, 497,
312 /* 520 */ 497, 497, 497, 497, 497, 497, 142, 219, 98, 96,
313 /* 530 */ 156, 493, 550, 13, 142, 408, 547, 547, 547, 547,
314 /* 540 */ 547, 547, 547, 547, 547, 547, 204, 206, 205, 549,
315 /* 550 */ 7, 520, 548, 467, 520, 539, 6, 478, 92, 77,
316 /* 560 */ 75, 74, 157, 520, 179, 23, 165, 569, 93, 521,
317 /* 570 */ 111, 22, 521, 113, 470, 137, 561, 169, 167, 498,
318 /* 580 */ 46, 521, 123, 104, 545, 519, 552, 448, 24, 519,
319 /* 590 */ 412, 65, 565, 41, 520, 28, 28, 568, 465, 142,
320 /* 600 */ 172, 456, 142, 125, 204, 206, 205, 224, 28, 28,
321 /* 610 */ 166, 142, 521, 117, 455, 478, 92, 77, 75, 74,
322 /* 620 */ 166, 166, 166, 166, 166, 166, 166, 396, 225, 493,
323 /* 630 */ 616, 104, 449, 519, 616, 19, 512, 519, 214, 515,
324 /* 640 */ 565, 45, 142, 28, 28, 568, 201, 517, 516, 202,
325 /* 650 */ 488, 486, 514, 518, 481, 29, 28, 28, 166, 479,
326 /* 660 */ 175, 138, 2, 47, 95, 48, 430, 97, 166, 166,
327 /* 670 */ 166, 166, 166, 166, 166, 231, 231, 140, 521, 115,
328 /* 680 */ 755, 528, 530, 141, 429, 527, 541, 130, 208, 428,
329 /* 690 */ 230, 229, 389, 390, 228, 227, 49, 423, 217, 425,
330 /* 700 */ 69, 64, 421, 29, 422, 461, 420, 419, 142, 460,
331 /* 710 */ 433, 417, 398, 21, 147, 61, 71, 150, 164, 151,
332 /* 720 */ 62, 63, 32, 418, 176, 30, 30, 30, 30, 30,
333 /* 730 */ 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
334 /* 740 */ 30, 30, 30, 507, 507, 507, 507, 30, 30, 30,
335 /* 750 */ 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
336 /* 760 */ 30, 30, 30, 30, 30, 572, 155, 219, 15, 25,
337 /* 770 */ 25, 558, 34, 42, 52, 11, 10, 70, 557, 563,
338 /* 780 */ 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
339 /* 790 */ 30, 30, 30, 30, 30, 30, 30, 30, 536, 507,
340 /* 800 */ 507, 507, 507, 507, 500, 535, 82, 551, 12, 14,
341 /* 810 */ 43, 506, 537, 538, 30, 30, 30, 30, 30, 30,
342 /* 820 */ 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
343 /* 830 */ 30, 30, 168, 5, 53, 54, 27, 9, 452, 16,
344 /* 840 */ 177, 451, 20, 181, 83, 84, 55, 26, 68, 68,
345 /* 850 */ 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
346 /* 860 */ 68, 68, 68, 68, 68, 68, 184, 520, 569, 104,
347 /* 870 */ 86, 519, 187, 57, 644, 519, 443, 442, 565, 165,
348 /* 880 */ 522, 28, 28, 568, 72, 521, 113, 193, 89, 196,
349 /* 890 */ 477, 198, 197, 199, 28, 28, 166, 554, 131, 552,
350 /* 900 */ 200, 475, 496, 474, 495, 494, 166, 166, 166, 166,
351 /* 910 */ 166, 166, 166, 172, 405, 142, 30, 30, 30, 30,
352 /* 920 */ 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
353 /* 930 */ 30, 30, 30, 30, 507, 507, 507, 507, 446, 616,
354 /* 940 */ 427, 29, 68, 68, 68, 68, 68, 68, 68, 68,
355 /* 950 */ 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
356 /* 960 */ 761, 209, 211, 212, 210, 102, 459, 31, 216, 416,
357 /* 970 */ 222, 213, 410, 220, 457, 39, 410, 58, 223, 175,
358 /* 980 */ 409, 399, 66, 66, 107, 33, 391, 388, 387, 386,
359 /* 990 */ 507, 507, 507, 507, 507, 66, 66, 521, 115, 385,
360 /* 1000 */ 528, 530, 578, 578, 527, 534, 578, 578, 578, 578,
361 /* 1010 */ 578, 578, 578, 578, 578, 578, 578, 578, 578, 578,
362 /* 1020 */ 154, 578, 578, 578, 578, 578, 578, 142, 578, 578,
363 /* 1030 */ 578, 578, 578, 221, 578, 573, 574, 575, 60, 578,
364 /* 1040 */ 578, 578, 67, 578, 520, 578, 175, 145, 578, 578,
365 /* 1050 */ 578, 578, 578, 106, 215, 195, 165, 578, 578, 73,
366 /* 1060 */ 1, 520, 521, 113, 521, 115, 520, 528, 530, 80,
367 /* 1070 */ 79, 527, 163, 165, 160, 578, 552, 578, 165, 521,
368 /* 1080 */ 113, 578, 578, 520, 521, 113, 578, 578, 578, 578,
369 /* 1090 */ 172, 556, 142, 552, 142, 165, 555, 578, 552, 578,
370 /* 1100 */ 578, 521, 113, 578, 578, 578, 578, 172, 578, 142,
371 /* 1110 */ 578, 578, 172, 546, 142, 552, 578, 578, 578, 578,
372 /* 1120 */ 578, 578, 578, 578, 578, 578, 578, 578, 578, 172,
375 static const YYCODETYPE yy_lookahead
[] = {
376 /* 0 */ 2, 3, 130, 5, 6, 7, 8, 9, 10, 11,
377 /* 10 */ 12, 13, 14, 14, 15, 16, 177, 178, 23, 20,
378 /* 20 */ 148, 149, 23, 151, 152, 26, 27, 28, 62, 63,
379 /* 30 */ 143, 144, 66, 67, 68, 69, 70, 14, 39, 40,
380 /* 40 */ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
381 /* 50 */ 178, 28, 62, 63, 167, 57, 66, 67, 68, 69,
382 /* 60 */ 70, 28, 143, 97, 15, 16, 17, 18, 19, 75,
383 /* 70 */ 71, 72, 22, 23, 24, 25, 26, 27, 28, 29,
384 /* 80 */ 30, 31, 32, 33, 34, 86, 167, 37, 38, 191,
385 /* 90 */ 96, 93, 94, 95, 137, 97, 14, 99, 74, 74,
386 /* 100 */ 76, 76, 104, 105, 106, 107, 108, 2, 3, 85,
387 /* 110 */ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
388 /* 120 */ 171, 14, 15, 16, 175, 167, 41, 20, 1, 2,
389 /* 130 */ 3, 4, 75, 26, 27, 28, 51, 52, 53, 54,
390 /* 140 */ 55, 56, 57, 14, 187, 88, 39, 40, 41, 42,
391 /* 150 */ 43, 44, 45, 46, 47, 48, 49, 50, 169, 170,
392 /* 160 */ 5, 172, 57, 116, 117, 2, 3, 130, 5, 6,
393 /* 170 */ 7, 8, 9, 10, 11, 12, 13, 14, 71, 22,
394 /* 180 */ 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
395 /* 190 */ 33, 34, 2, 86, 37, 38, 168, 132, 93, 94,
396 /* 200 */ 95, 167, 137, 138, 99, 147, 101, 167, 150, 104,
397 /* 210 */ 105, 106, 107, 108, 177, 178, 158, 159, 130, 131,
398 /* 220 */ 57, 163, 164, 2, 3, 130, 5, 6, 7, 8,
399 /* 230 */ 9, 10, 11, 12, 13, 14, 14, 113, 14, 128,
400 /* 240 */ 165, 166, 118, 132, 120, 142, 122, 123, 137, 138,
401 /* 250 */ 28, 127, 187, 129, 132, 133, 93, 94, 95, 137,
402 /* 260 */ 138, 106, 99, 139, 140, 130, 178, 104, 105, 106,
403 /* 270 */ 107, 108, 171, 178, 116, 117, 142, 171, 57, 176,
404 /* 280 */ 171, 2, 3, 130, 5, 6, 7, 8, 9, 10,
405 /* 290 */ 11, 12, 13, 14, 104, 105, 106, 73, 187, 75,
406 /* 300 */ 76, 77, 78, 179, 180, 181, 130, 183, 86, 187,
407 /* 310 */ 176, 171, 101, 178, 93, 94, 95, 93, 94, 95,
408 /* 320 */ 99, 14, 111, 99, 100, 104, 105, 106, 107, 108,
409 /* 330 */ 142, 178, 171, 109, 110, 28, 57, 177, 178, 2,
410 /* 340 */ 3, 113, 5, 6, 7, 8, 9, 10, 11, 12,
411 /* 350 */ 13, 14, 124, 125, 178, 14, 128, 16, 146, 147,
412 /* 360 */ 132, 20, 150, 171, 176, 137, 138, 26, 27, 28,
413 /* 370 */ 158, 159, 93, 94, 95, 163, 164, 130, 99, 88,
414 /* 380 */ 39, 40, 142, 104, 105, 106, 107, 108, 97, 130,
415 /* 390 */ 130, 130, 177, 178, 57, 148, 149, 2, 3, 113,
416 /* 400 */ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
417 /* 410 */ 124, 183, 184, 185, 14, 187, 176, 74, 132, 76,
418 /* 420 */ 134, 135, 141, 137, 138, 178, 14, 86, 28, 130,
419 /* 430 */ 93, 94, 95, 177, 178, 130, 99, 178, 178, 178,
420 /* 440 */ 28, 104, 105, 106, 107, 108, 162, 148, 149, 114,
421 /* 450 */ 115, 141, 57, 148, 149, 2, 3, 113, 5, 6,
422 /* 460 */ 7, 8, 9, 10, 11, 12, 13, 14, 124, 183,
423 /* 470 */ 184, 185, 121, 187, 87, 88, 132, 178, 130, 135,
424 /* 480 */ 187, 137, 138, 178, 87, 88, 130, 187, 93, 94,
425 /* 490 */ 95, 87, 88, 74, 99, 76, 148, 149, 178, 104,
426 /* 500 */ 105, 106, 107, 108, 148, 149, 189, 151, 152, 170,
427 /* 510 */ 57, 155, 156, 2, 3, 110, 5, 6, 7, 8,
428 /* 520 */ 9, 10, 11, 12, 13, 14, 178, 183, 184, 185,
429 /* 530 */ 176, 187, 87, 88, 178, 14, 41, 42, 43, 44,
430 /* 540 */ 45, 46, 47, 48, 49, 50, 93, 94, 95, 87,
431 /* 550 */ 88, 130, 57, 14, 130, 87, 88, 104, 105, 106,
432 /* 560 */ 107, 108, 140, 130, 87, 88, 142, 28, 57, 148,
433 /* 570 */ 149, 86, 148, 149, 132, 133, 166, 153, 154, 137,
434 /* 580 */ 138, 148, 149, 14, 160, 16, 162, 87, 88, 20,
435 /* 590 */ 87, 88, 23, 176, 130, 26, 27, 28, 126, 178,
436 /* 600 */ 176, 126, 178, 178, 93, 94, 95, 86, 39, 40,
437 /* 610 */ 41, 178, 148, 149, 126, 104, 105, 106, 107, 108,
438 /* 620 */ 51, 52, 53, 54, 55, 56, 57, 87, 88, 187,
439 /* 630 */ 92, 14, 126, 16, 96, 146, 147, 20, 92, 150,
440 /* 640 */ 23, 119, 178, 26, 27, 28, 92, 158, 159, 136,
441 /* 650 */ 2, 190, 163, 164, 2, 86, 39, 40, 41, 188,
442 /* 660 */ 130, 178, 96, 116, 119, 116, 182, 119, 51, 52,
443 /* 670 */ 53, 54, 55, 56, 57, 64, 65, 14, 148, 149,
444 /* 680 */ 111, 151, 152, 14, 182, 155, 156, 157, 14, 182,
445 /* 690 */ 79, 80, 81, 82, 83, 84, 119, 113, 102, 14,
446 /* 700 */ 89, 90, 118, 86, 120, 186, 122, 123, 178, 186,
447 /* 710 */ 115, 127, 14, 129, 173, 92, 98, 87, 101, 111,
448 /* 720 */ 92, 92, 86, 139, 140, 21, 22, 23, 24, 25,
449 /* 730 */ 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
450 /* 740 */ 36, 37, 38, 1, 2, 3, 4, 21, 22, 23,
451 /* 750 */ 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
452 /* 760 */ 34, 35, 36, 37, 38, 181, 20, 183, 96, 62,
453 /* 770 */ 63, 75, 86, 66, 67, 68, 69, 70, 75, 75,
454 /* 780 */ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
455 /* 790 */ 31, 32, 33, 34, 35, 36, 37, 38, 75, 57,
456 /* 800 */ 58, 59, 60, 61, 97, 75, 98, 87, 98, 88,
457 /* 810 */ 86, 111, 87, 87, 21, 22, 23, 24, 25, 26,
458 /* 820 */ 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
459 /* 830 */ 37, 38, 87, 86, 86, 86, 86, 98, 75, 96,
460 /* 840 */ 87, 75, 86, 14, 87, 87, 86, 88, 21, 22,
461 /* 850 */ 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
462 /* 860 */ 33, 34, 35, 36, 37, 38, 14, 130, 28, 14,
463 /* 870 */ 87, 16, 14, 86, 86, 20, 75, 75, 23, 142,
464 /* 880 */ 87, 26, 27, 28, 98, 148, 149, 20, 14, 16,
465 /* 890 */ 87, 16, 88, 86, 39, 40, 41, 160, 161, 162,
466 /* 900 */ 92, 75, 14, 75, 14, 14, 51, 52, 53, 54,
467 /* 910 */ 55, 56, 57, 176, 87, 178, 21, 22, 23, 24,
468 /* 920 */ 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
469 /* 930 */ 35, 36, 37, 38, 1, 2, 3, 4, 14, 96,
470 /* 940 */ 87, 86, 21, 22, 23, 24, 25, 26, 27, 28,
471 /* 950 */ 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
472 /* 960 */ 0, 16, 16, 86, 88, 14, 103, 98, 16, 75,
473 /* 970 */ 14, 92, 16, 19, 14, 86, 20, 96, 14, 130,
474 /* 980 */ 87, 14, 26, 27, 86, 14, 14, 14, 14, 19,
475 /* 990 */ 57, 58, 59, 60, 61, 39, 40, 148, 149, 76,
476 /* 1000 */ 151, 152, 192, 192, 155, 156, 192, 192, 192, 192,
477 /* 1010 */ 192, 192, 192, 192, 192, 192, 192, 192, 192, 192,
478 /* 1020 */ 87, 192, 192, 192, 192, 192, 192, 178, 192, 192,
479 /* 1030 */ 192, 192, 192, 73, 192, 75, 76, 77, 78, 192,
480 /* 1040 */ 192, 192, 86, 192, 130, 192, 130, 91, 192, 192,
481 /* 1050 */ 192, 192, 192, 93, 94, 95, 142, 192, 192, 99,
482 /* 1060 */ 100, 130, 148, 149, 148, 149, 130, 151, 152, 109,
483 /* 1070 */ 110, 155, 156, 142, 160, 192, 162, 192, 142, 148,
484 /* 1080 */ 149, 192, 192, 130, 148, 149, 192, 192, 192, 192,
485 /* 1090 */ 176, 160, 178, 162, 178, 142, 160, 192, 162, 192,
486 /* 1100 */ 192, 148, 149, 192, 192, 192, 192, 176, 192, 178,
487 /* 1110 */ 192, 192, 176, 160, 178, 162, 192, 192, 192, 192,
488 /* 1120 */ 192, 192, 192, 192, 192, 192, 192, 192, 192, 176,
491 #define YY_SHIFT_USE_DFLT (1132)
492 #define YY_SHIFT_COUNT (232)
493 #define YY_SHIFT_MIN (-34)
494 #define YY_SHIFT_MAX (974)
495 static const short yy_shift_ofst
[] = {
496 /* 0 */ 224, 163, 221, 960, -2, 569, -1, 617, -1, -1,
497 /* 10 */ -1, 855, 855, 855, 855, -10, -10, 107, -34, 707,
498 /* 20 */ 279, 337, 279, 105, 395, 341, 341, 341, 341, 341,
499 /* 30 */ 341, 341, 933, 24, 23, 23, 453, 511, 742, 956,
500 /* 40 */ 23, 23, 23, 23, 307, -6, 23, 23, 23, -6,
501 /* 50 */ -5, -5, 82, -5, -5, 33, 33, 33, 129, 495,
502 /* 60 */ 611, 742, 742, 742, 956, 956, 956, 956, 956, 956,
503 /* 70 */ 85, 49, 49, 127, 190, 190, 307, 155, 25, -5,
504 /* 80 */ 405, 82, -5, 485, 485, 33, 485, 33, 485, 546,
505 /* 90 */ 554, 648, 652, 33, 33, 566, 546, 566, 546, 663,
506 /* 100 */ 669, 674, 546, 596, 596, 129, 685, 698, 704, 726,
507 /* 110 */ 759, 793, 827, 895, 895, 895, 895, 895, 921, 921,
508 /* 120 */ 921, 921, 921, 50, 157, 222, 211, 387, 397, 57,
509 /* 130 */ 404, 445, 462, 468, 477, 400, 412, 500, 539, 412,
510 /* 140 */ 538, 538, 400, 291, 503, 521, 343, 540, 419, 618,
511 /* 150 */ 623, 630, 608, 628, 629, 636, 746, 672, 686, 696,
512 /* 160 */ 703, 723, 708, 730, 720, 710, 724, 721, 725, 745,
513 /* 170 */ 747, 748, 700, 749, 750, 739, 743, 763, 753, 766,
514 /* 180 */ 756, 757, 829, 760, 758, 852, 840, 783, 858, 787,
515 /* 190 */ 788, 801, 802, 786, 867, 874, 803, 873, 804, 875,
516 /* 200 */ 807, 808, 826, 828, 888, 890, 891, 924, 843, 853,
517 /* 210 */ 945, 876, 946, 877, 879, 951, 863, 952, 869, 881,
518 /* 220 */ 894, 954, 889, 893, 964, 967, 898, 971, 972, 973,
519 /* 230 */ 974, 970, 923,
521 #define YY_REDUCE_USE_DFLT (-162)
522 #define YY_REDUCE_COUNT (107)
523 #define YY_REDUCE_MIN (-161)
524 #define YY_REDUCE_MAX (953)
525 static const short yy_reduce_ofst
[] = {
526 /* 0 */ 124, 228, 286, 584, 344, 424, 530, 737, 356, 849,
527 /* 10 */ 916, 914, 931, 936, 953, 212, 489, -128, 58, 58,
528 /* 20 */ 122, 111, 442, 65, 65, 247, 299, 305, 348, 421,
529 /* 30 */ 433, 464, -113, -11, 88, 37, -43, -43, -81, -51,
530 /* 40 */ 95, 135, 153, 176, -161, 47, 259, 260, 261, 158,
531 /* 50 */ 103, 134, 75, 188, 240, 160, 215, 256, 335, -102,
532 /* 60 */ 28, -42, 34, 40, 101, 106, 109, 140, 161, 192,
533 /* 70 */ 284, 281, 310, 351, 293, 300, 320, 317, 339, 354,
534 /* 80 */ 422, 410, 417, 472, 475, 425, 488, 320, 506, 522,
535 /* 90 */ 513, 461, 471, 483, 320, 547, 545, 549, 548, 484,
536 /* 100 */ 502, 507, 577, 519, 523, 595, 507, 541,
538 static const YYACTIONTYPE yy_default
[] = {
539 /* 0 */ 767, 767, 767, 767, 767, 734, 767, 755, 767, 767,
540 /* 10 */ 767, 755, 755, 755, 755, 767, 767, 767, 767, 767,
541 /* 20 */ 659, 767, 659, 767, 767, 767, 767, 767, 767, 767,
542 /* 30 */ 767, 767, 767, 767, 767, 757, 767, 767, 767, 604,
543 /* 40 */ 767, 767, 767, 767, 757, 767, 767, 767, 767, 767,
544 /* 50 */ 755, 755, 767, 755, 755, 757, 757, 757, 767, 767,
545 /* 60 */ 767, 767, 767, 767, 767, 767, 767, 767, 767, 767,
546 /* 70 */ 767, 767, 767, 767, 683, 682, 767, 675, 767, 755,
547 /* 80 */ 767, 767, 755, 767, 767, 767, 767, 660, 767, 617,
548 /* 90 */ 667, 678, 671, 767, 767, 767, 617, 767, 617, 615,
549 /* 100 */ 615, 615, 617, 649, 649, 767, 615, 588, 767, 767,
550 /* 110 */ 767, 767, 767, 744, 724, 723, 715, 625, 595, 606,
551 /* 120 */ 605, 597, 594, 714, 598, 767, 767, 767, 767, 767,
552 /* 130 */ 767, 767, 767, 767, 767, 758, 758, 767, 767, 767,
553 /* 140 */ 686, 685, 767, 767, 767, 767, 767, 767, 767, 699,
554 /* 150 */ 767, 767, 767, 767, 767, 767, 767, 767, 767, 767,
555 /* 160 */ 767, 767, 767, 767, 767, 767, 767, 735, 767, 767,
556 /* 170 */ 767, 767, 767, 767, 767, 711, 767, 767, 767, 767,
557 /* 180 */ 767, 767, 767, 767, 767, 767, 758, 767, 767, 767,
558 /* 190 */ 641, 767, 767, 767, 767, 767, 767, 767, 767, 767,
559 /* 200 */ 767, 767, 767, 767, 767, 767, 767, 767, 687, 767,
560 /* 210 */ 767, 767, 767, 767, 767, 767, 767, 767, 626, 767,
561 /* 220 */ 767, 767, 602, 767, 767, 767, 767, 767, 767, 767,
562 /* 230 */ 767, 767, 767,
564 /********** End of lemon-generated parsing tables *****************************/
566 /* The next table maps tokens (terminal symbols) into fallback tokens.
567 ** If a construct like the following:
569 ** %fallback ID X Y Z.
571 ** appears in the grammar, then ID becomes a fallback token for X, Y,
572 ** and Z. Whenever one of the tokens X, Y, or Z is input to the parser
573 ** but it does not parse, the type of the token is changed to ID and
574 ** the parse is retried before an error is thrown.
576 ** This feature can be used, for example, to cause some keywords in a language
577 ** to revert to identifiers if they keyword does not apply in the context where
581 static const YYCODETYPE yyFallback
[] = {
582 0, /* $ => nothing */
583 0, /* BOOL => nothing */
584 0, /* INT => nothing */
585 0, /* FLOAT => nothing */
586 14, /* STRING => NAME */
587 0, /* DOUBLE => nothing */
588 0, /* INT8 => nothing */
589 0, /* UINT8 => nothing */
590 0, /* INT16 => nothing */
591 0, /* UINT16 => nothing */
592 0, /* INT32 => nothing */
593 0, /* UINT32 => nothing */
594 0, /* INT64 => nothing */
595 0, /* UINT64 => nothing */
596 0, /* NAME => nothing */
597 0, /* NULL => nothing */
598 0, /* NUMBER => nothing */
599 0, /* TRUE => nothing */
600 0, /* FALSE => nothing */
601 0, /* QUOTED_STRING => nothing */
602 0, /* NSNAME => nothing */
603 0, /* PIPE => nothing */
604 0, /* CARET => nothing */
605 0, /* AMPERSAND => nothing */
606 0, /* LSHIFT => nothing */
607 0, /* RSHIFT => nothing */
608 0, /* PLUS => nothing */
609 0, /* MINUS => nothing */
610 0, /* ASTERISK => nothing */
611 0, /* SLASH => nothing */
612 0, /* MODULO => nothing */
613 0, /* RCHEVR => nothing */
614 0, /* LCHEVR => nothing */
615 0, /* CMP_GE => nothing */
616 0, /* CMP_LE => nothing */
617 0, /* OR => nothing */
618 0, /* AND => nothing */
619 0, /* CMP_EQ => nothing */
620 0, /* CMP_NE => nothing */
621 0, /* TILDE => nothing */
622 0, /* NOT => nothing */
623 14, /* ZVAL => NAME */
624 0, /* OBJVAL => nothing */
625 0, /* ARRVAL => nothing */
626 0, /* PATHVAL => nothing */
627 0, /* STRLEN => nothing */
628 0, /* STRVAL => nothing */
629 0, /* FLOATVAL => nothing */
630 0, /* INTVAL => nothing */
631 0, /* BOOLVAL => nothing */
632 14, /* COUNT => NAME */
633 0, /* TO_OBJECT => nothing */
634 0, /* TO_ARRAY => nothing */
635 0, /* TO_STRING => nothing */
636 0, /* TO_INT => nothing */
637 0, /* TO_FLOAT => nothing */
638 0, /* TO_BOOL => nothing */
639 0, /* VOID => nothing */
640 0, /* MIXED => nothing */
641 0, /* ARRAY => nothing */
642 0, /* OBJECT => nothing */
643 0, /* CALLABLE => nothing */
644 0, /* PRE_ASSERT => nothing */
645 0, /* POST_ASSERT => nothing */
646 14, /* ERROR => NAME */
647 14, /* WARNING => NAME */
648 14, /* TEMP => NAME */
649 14, /* FREE => NAME */
650 14, /* SET => NAME */
651 14, /* LET => NAME */
652 14, /* RETURN => NAME */
653 14, /* CALLOC => NAME */
654 14, /* CALLBACK => NAME */
655 14, /* LIB => NAME */
657 #endif /* YYFALLBACK */
659 /* The following structure represents a single element of the
660 ** parser's stack. Information stored includes:
662 ** + The state number for the parser at this level of the stack.
664 ** + The value of the token stored at this level of the stack.
665 ** (In other words, the "major" token.)
667 ** + The semantic value stored at this level of the stack. This is
668 ** the information used by the action routines in the grammar.
669 ** It is sometimes called the "minor" token.
671 ** After the "shift" half of a SHIFTREDUCE action, the stateno field
672 ** actually contains the reduce action for the second half of the
675 struct yyStackEntry
{
676 YYACTIONTYPE stateno
; /* The state-number, or reduce action in SHIFTREDUCE */
677 YYCODETYPE major
; /* The major token value. This is the code
678 ** number for the token at this stack level */
679 YYMINORTYPE minor
; /* The user-supplied minor token value. This
680 ** is the value of the token */
682 typedef struct yyStackEntry yyStackEntry
;
684 /* The state of the parser is completely contained in an instance of
685 ** the following structure */
687 yyStackEntry
*yytos
; /* Pointer to top element of the stack */
688 #ifdef YYTRACKMAXSTACKDEPTH
689 int yyhwm
; /* High-water mark of the stack */
691 #ifndef YYNOERRORRECOVERY
692 int yyerrcnt
; /* Shifts left before out of the error */
694 ParseARG_SDECL
/* A place to hold %extra_argument */
696 int yystksz
; /* Current side of the stack */
697 yyStackEntry
*yystack
; /* The parser's stack */
698 yyStackEntry yystk0
; /* First stack entry */
700 yyStackEntry yystack
[YYSTACKDEPTH
]; /* The parser's stack */
703 typedef struct yyParser yyParser
;
707 static FILE *yyTraceFILE
= 0;
708 static char *yyTracePrompt
= 0;
713 ** Turn parser tracing on by giving a stream to which to write the trace
714 ** and a prompt to preface each trace message. Tracing is turned off
715 ** by making either argument NULL
719 ** <li> A FILE* to which trace output should be written.
720 ** If NULL, then tracing is turned off.
721 ** <li> A prefix string written at the beginning of every
722 ** line of trace output. If NULL, then tracing is
729 void ParseTrace(FILE *TraceFILE
, char *zTracePrompt
){
730 yyTraceFILE
= TraceFILE
;
731 yyTracePrompt
= zTracePrompt
;
732 if( yyTraceFILE
==0 ) yyTracePrompt
= 0;
733 else if( yyTracePrompt
==0 ) yyTraceFILE
= 0;
738 /* For tracing shifts, the names of all terminals and nonterminals
739 ** are required. The following table supplies these names */
740 static const char *const yyTokenName
[] = {
741 "$", "BOOL", "INT", "FLOAT",
742 "STRING", "DOUBLE", "INT8", "UINT8",
743 "INT16", "UINT16", "INT32", "UINT32",
744 "INT64", "UINT64", "NAME", "NULL",
745 "NUMBER", "TRUE", "FALSE", "QUOTED_STRING",
746 "NSNAME", "PIPE", "CARET", "AMPERSAND",
747 "LSHIFT", "RSHIFT", "PLUS", "MINUS",
748 "ASTERISK", "SLASH", "MODULO", "RCHEVR",
749 "LCHEVR", "CMP_GE", "CMP_LE", "OR",
750 "AND", "CMP_EQ", "CMP_NE", "TILDE",
751 "NOT", "ZVAL", "OBJVAL", "ARRVAL",
752 "PATHVAL", "STRLEN", "STRVAL", "FLOATVAL",
753 "INTVAL", "BOOLVAL", "COUNT", "TO_OBJECT",
754 "TO_ARRAY", "TO_STRING", "TO_INT", "TO_FLOAT",
755 "TO_BOOL", "VOID", "MIXED", "ARRAY",
756 "OBJECT", "CALLABLE", "PRE_ASSERT", "POST_ASSERT",
757 "ERROR", "WARNING", "TEMP", "FREE",
758 "SET", "LET", "RETURN", "CALLOC",
759 "CALLBACK", "LIB", "ANY", "EOS",
760 "EOL", "COMMENT", "HASH", "IFDEF",
761 "IFNDEF", "ENDIF", "ELSE", "UNDEF",
762 "DEFINE", "NO_WHITESPACE", "LPAREN", "RPAREN",
763 "COMMA", "IF", "ELIF", "DEFINED",
764 "COLON", "ENUM", "STRUCT", "UNION",
765 "LBRACE", "RBRACE", "EQUALS", "CONST",
766 "TYPEDEF", "ELLIPSIS", "LBRACKET", "RBRACKET",
767 "CHAR", "SHORT", "LONG", "UNSIGNED",
768 "SIGNED", "STATIC", "FUNCTION", "DOLLAR_NAME",
769 "error", "decl_enum", "decl_enum_items", "decl_enum_item",
770 "decl_struct_args_block", "decl_struct_args", "decl_struct", "align_and_size",
771 "decl_union", "const_type", "constant", "decl_typedef",
772 "decl_typedef_body_ex", "decl_typedef_body", "decl_typedef_body_fn_args", "decl",
773 "decl_func", "decl_abi", "decl_var", "decl_vars",
774 "decl_arg", "decl_args", "struct_args", "struct_arg",
775 "decl_layout", "decl_type", "const_decl_type", "impl",
776 "impl_func", "impl_def_val", "impl_var", "impl_arg",
777 "impl_args", "impl_vararg", "impl_stmts", "impl_stmt",
778 "number", "num_exp", "let_stmt", "let_calloc",
779 "let_func", "callback_arg_list", "callback_args", "let_callback",
780 "let_exp", "let_exps", "assert_stmt", "set_stmt",
781 "set_exp", "set_exps", "set_func", "return_stmt",
782 "free_stmt", "free_exps", "free_exp", "impl_type",
783 "cpp_exp", "cpp_macro_decl", "cpp_macro_decl_tokens", "cpp_macro_exp",
784 "cpp_macro_sig", "cpp_macro_sig_args", "cpp_macro_call", "cpp_macro_call_args",
785 "reference", "indirection", "pointers", "file",
786 "blocks", "block", "optional_name", "enum_name",
787 "struct_name", "union_name", "decl_var_array_size", "decl_scalar_type",
788 "decl_scalar_type_short", "decl_scalar_type_long", "decl_scalar_type_long_long", "callback_rval",
793 /* For tracing reduce actions, the names of all rules are required.
795 static const char *const yyRuleName
[] = {
796 /* 0 */ "block ::= HASH cpp_exp EOL",
797 /* 1 */ "cpp_exp ::= ERROR|WARNING QUOTED_STRING",
798 /* 2 */ "cpp_exp ::= IFDEF NAME",
799 /* 3 */ "cpp_exp ::= IFNDEF NAME",
800 /* 4 */ "cpp_exp ::= ENDIF",
801 /* 5 */ "cpp_exp ::= ELSE",
802 /* 6 */ "cpp_exp ::= UNDEF NAME",
803 /* 7 */ "cpp_exp ::= DEFINE NAME cpp_macro_decl",
804 /* 8 */ "cpp_macro_decl ::=",
805 /* 9 */ "cpp_macro_decl ::= cpp_macro_sig",
806 /* 10 */ "cpp_macro_decl ::= cpp_macro_sig cpp_macro_decl_tokens",
807 /* 11 */ "cpp_macro_sig ::= NO_WHITESPACE LPAREN cpp_macro_sig_args RPAREN",
808 /* 12 */ "cpp_macro_sig_args ::=",
809 /* 13 */ "cpp_macro_sig_args ::= NAME",
810 /* 14 */ "cpp_macro_sig_args ::= cpp_macro_sig_args COMMA NAME",
811 /* 15 */ "cpp_macro_decl ::= cpp_macro_decl_tokens",
812 /* 16 */ "cpp_macro_decl_tokens ::= ANY",
813 /* 17 */ "cpp_macro_decl_tokens ::= cpp_macro_decl_tokens ANY",
814 /* 18 */ "cpp_exp ::= IF cpp_macro_exp",
815 /* 19 */ "cpp_exp ::= ELIF cpp_macro_exp",
816 /* 20 */ "cpp_macro_exp ::= LPAREN cpp_macro_exp RPAREN",
817 /* 21 */ "cpp_macro_exp ::= TILDE|NOT|PLUS|MINUS cpp_macro_exp",
818 /* 22 */ "cpp_macro_exp ::= cpp_macro_exp PIPE|CARET|AMPERSAND|LSHIFT|RSHIFT|PLUS|MINUS|ASTERISK|SLASH|MODULO|RCHEVR|LCHEVR|CMP_GE|CMP_LE|OR|AND|CMP_EQ|CMP_NE cpp_macro_exp",
819 /* 23 */ "cpp_macro_exp ::= DEFINED NAME",
820 /* 24 */ "cpp_macro_exp ::= DEFINED LPAREN NAME RPAREN",
821 /* 25 */ "cpp_macro_exp ::= NUMBER|NSNAME",
822 /* 26 */ "cpp_macro_exp ::= NAME",
823 /* 27 */ "cpp_macro_exp ::= NAME LPAREN cpp_macro_call_args RPAREN",
824 /* 28 */ "cpp_macro_call_args ::=",
825 /* 29 */ "cpp_macro_call_args ::= cpp_macro_exp",
826 /* 30 */ "cpp_macro_call_args ::= cpp_macro_call_args COMMA cpp_macro_exp",
827 /* 31 */ "block ::= LIB QUOTED_STRING EOS",
828 /* 32 */ "block ::= decl",
829 /* 33 */ "block ::= impl",
830 /* 34 */ "block ::= decl_typedef",
831 /* 35 */ "block ::= constant",
832 /* 36 */ "block ::= decl_struct",
833 /* 37 */ "block ::= decl_union",
834 /* 38 */ "block ::= decl_enum",
835 /* 39 */ "optional_name ::=",
836 /* 40 */ "optional_name ::= NAME",
837 /* 41 */ "align_and_size ::=",
838 /* 42 */ "align_and_size ::= COLON COLON LPAREN NUMBER COMMA NUMBER RPAREN",
839 /* 43 */ "enum_name ::= ENUM optional_name",
840 /* 44 */ "struct_name ::= STRUCT optional_name",
841 /* 45 */ "union_name ::= UNION optional_name",
842 /* 46 */ "decl_enum ::= enum_name LBRACE decl_enum_items RBRACE",
843 /* 47 */ "decl_enum_items ::= decl_enum_item",
844 /* 48 */ "decl_enum_items ::= decl_enum_items COMMA decl_enum_item",
845 /* 49 */ "decl_enum_item ::= NAME EQUALS num_exp",
846 /* 50 */ "decl_enum_item ::= NAME",
847 /* 51 */ "decl_struct_args_block ::= LBRACE struct_args RBRACE",
848 /* 52 */ "decl_struct_args ::= decl_struct_args_block",
849 /* 53 */ "decl_struct_args ::= EOS",
850 /* 54 */ "decl_struct ::= STRUCT NAME align_and_size decl_struct_args",
851 /* 55 */ "decl_union ::= UNION NAME align_and_size decl_struct_args",
852 /* 56 */ "const_type ::= BOOL|INT|FLOAT|STRING",
853 /* 57 */ "constant ::= CONST const_type NSNAME EQUALS impl_def_val EOS",
854 /* 58 */ "decl_typedef ::= TYPEDEF decl_typedef_body EOS",
855 /* 59 */ "decl_typedef_body_ex ::= struct_name align_and_size decl_struct_args_block decl_var",
856 /* 60 */ "decl_typedef_body_ex ::= union_name align_and_size decl_struct_args_block decl_var",
857 /* 61 */ "decl_typedef_body_ex ::= decl_enum NAME",
858 /* 62 */ "decl_typedef_body ::= decl_typedef_body_ex",
859 /* 63 */ "decl_typedef_body_fn_args ::= LPAREN decl_args RPAREN",
860 /* 64 */ "decl_typedef_body ::= decl_func decl_typedef_body_fn_args",
861 /* 65 */ "decl_typedef_body ::= decl_arg",
862 /* 66 */ "decl ::= decl_abi decl_func LPAREN decl_args RPAREN EOS",
863 /* 67 */ "decl ::= decl_abi decl_func LPAREN decl_args COMMA ELLIPSIS RPAREN EOS",
864 /* 68 */ "decl_func ::= decl_arg",
865 /* 69 */ "decl_func ::= VOID NAME",
866 /* 70 */ "decl_typedef_body ::= VOID indirection LPAREN indirection NAME RPAREN decl_typedef_body_fn_args",
867 /* 71 */ "decl_typedef_body ::= CONST VOID pointers LPAREN indirection NAME RPAREN decl_typedef_body_fn_args",
868 /* 72 */ "decl_abi ::= NAME",
869 /* 73 */ "decl_var_array_size ::=",
870 /* 74 */ "decl_var_array_size ::= LBRACKET NUMBER RBRACKET",
871 /* 75 */ "decl_var ::= NAME decl_var_array_size",
872 /* 76 */ "decl_var ::= pointers NAME decl_var_array_size",
873 /* 77 */ "decl_vars ::= decl_var",
874 /* 78 */ "decl_vars ::= decl_vars COMMA decl_var",
875 /* 79 */ "decl_arg ::= const_decl_type decl_var",
876 /* 80 */ "decl_typedef_body ::= const_decl_type indirection LPAREN indirection NAME RPAREN decl_typedef_body_fn_args",
877 /* 81 */ "decl_arg ::= VOID pointers NAME",
878 /* 82 */ "decl_arg ::= CONST VOID pointers NAME",
879 /* 83 */ "decl_args ::=",
880 /* 84 */ "decl_args ::= VOID",
881 /* 85 */ "decl_args ::= decl_arg",
882 /* 86 */ "decl_args ::= decl_args COMMA decl_arg",
883 /* 87 */ "struct_args ::= struct_arg",
884 /* 88 */ "struct_args ::= struct_args struct_arg",
885 /* 89 */ "struct_arg ::= decl_typedef_body_ex EOS",
886 /* 90 */ "struct_arg ::= decl_arg decl_layout EOS",
887 /* 91 */ "decl_layout ::=",
888 /* 92 */ "decl_layout ::= COLON COLON LPAREN NUMBER COMMA NUMBER RPAREN",
889 /* 93 */ "decl_scalar_type ::= CHAR",
890 /* 94 */ "decl_scalar_type ::= SHORT decl_scalar_type_short",
891 /* 95 */ "decl_scalar_type_short ::=",
892 /* 96 */ "decl_scalar_type_short ::= INT",
893 /* 97 */ "decl_scalar_type ::= INT",
894 /* 98 */ "decl_scalar_type ::= LONG decl_scalar_type_long",
895 /* 99 */ "decl_scalar_type_long ::=",
896 /* 100 */ "decl_scalar_type_long ::= DOUBLE",
897 /* 101 */ "decl_scalar_type_long ::= LONG decl_scalar_type_long_long",
898 /* 102 */ "decl_scalar_type_long_long ::=",
899 /* 103 */ "decl_scalar_type_long_long ::= INT",
900 /* 104 */ "decl_type ::= UNSIGNED decl_scalar_type",
901 /* 105 */ "decl_type ::= SIGNED decl_scalar_type",
902 /* 106 */ "decl_type ::= UNSIGNED",
903 /* 107 */ "decl_type ::= SIGNED",
904 /* 108 */ "decl_type ::= decl_scalar_type",
905 /* 109 */ "decl_type ::= STRUCT NAME",
906 /* 110 */ "decl_type ::= UNION NAME",
907 /* 111 */ "decl_type ::= ENUM NAME",
908 /* 112 */ "decl_type ::= FLOAT|DOUBLE|INT8|UINT8|INT16|UINT16|INT32|UINT32|INT64|UINT64|NAME",
909 /* 113 */ "const_decl_type ::= decl_type",
910 /* 114 */ "const_decl_type ::= CONST decl_type",
911 /* 115 */ "impl ::= impl_func LBRACE impl_stmts RBRACE",
912 /* 116 */ "impl ::= STATIC impl_func LBRACE impl_stmts RBRACE",
913 /* 117 */ "impl_func ::= FUNCTION reference NSNAME LPAREN RPAREN COLON impl_type",
914 /* 118 */ "impl_func ::= FUNCTION reference NSNAME LPAREN impl_args RPAREN COLON impl_type",
915 /* 119 */ "impl_func ::= FUNCTION reference NSNAME LPAREN impl_args COMMA impl_type reference ELLIPSIS DOLLAR_NAME RPAREN COLON impl_type",
916 /* 120 */ "impl_def_val ::= NULL|NUMBER|TRUE|FALSE|QUOTED_STRING",
917 /* 121 */ "impl_var ::= reference DOLLAR_NAME",
918 /* 122 */ "impl_type ::= VOID|MIXED|BOOL|INT|FLOAT|STRING|ARRAY|OBJECT|CALLABLE",
919 /* 123 */ "impl_arg ::= impl_type impl_var",
920 /* 124 */ "impl_arg ::= impl_type impl_var EQUALS impl_def_val",
921 /* 125 */ "impl_args ::= impl_arg",
922 /* 126 */ "impl_args ::= impl_args COMMA impl_arg",
923 /* 127 */ "impl_stmts ::= impl_stmt",
924 /* 128 */ "impl_stmts ::= impl_stmts impl_stmt",
925 /* 129 */ "impl_stmt ::= return_stmt",
926 /* 130 */ "impl_stmt ::= let_stmt",
927 /* 131 */ "impl_stmt ::= set_stmt",
928 /* 132 */ "impl_stmt ::= assert_stmt",
929 /* 133 */ "impl_stmt ::= free_stmt",
930 /* 134 */ "number ::= NUMBER|NSNAME",
931 /* 135 */ "number ::= decl_var",
932 /* 136 */ "num_exp ::= number",
933 /* 137 */ "num_exp ::= LPAREN num_exp RPAREN",
934 /* 138 */ "num_exp ::= num_exp PIPE|CARET|AMPERSAND|LSHIFT|RSHIFT|PLUS|MINUS|ASTERISK|SLASH|MODULO|RCHEVR|LCHEVR|CMP_GE|CMP_LE|OR|AND|CMP_EQ|CMP_NE num_exp",
935 /* 139 */ "num_exp ::= TILDE|NOT|PLUS|MINUS num_exp",
936 /* 140 */ "let_exp ::= NULL",
937 /* 141 */ "let_exp ::= AMPERSAND NULL",
938 /* 142 */ "let_exp ::= let_callback",
939 /* 143 */ "let_exp ::= let_calloc",
940 /* 144 */ "let_exp ::= AMPERSAND let_calloc",
941 /* 145 */ "let_exp ::= let_func",
942 /* 146 */ "let_exp ::= AMPERSAND let_func",
943 /* 147 */ "let_exp ::= num_exp",
944 /* 148 */ "let_exp ::= AMPERSAND num_exp",
945 /* 149 */ "let_exp ::= decl_var EQUALS let_exp",
946 /* 150 */ "let_stmt ::= LET let_exp EOS",
947 /* 151 */ "let_stmt ::= TEMP decl_var EQUALS reference decl_var EOS",
948 /* 152 */ "let_callback ::= CALLBACK callback_rval LPAREN impl_var LPAREN callback_arg_list RPAREN RPAREN",
949 /* 153 */ "let_calloc ::= CALLOC LPAREN num_exp COMMA num_exp RPAREN",
950 /* 154 */ "let_func ::= ZVAL|OBJVAL|ARRVAL|PATHVAL|STRLEN|STRVAL|FLOATVAL|INTVAL|BOOLVAL|COUNT LPAREN impl_var RPAREN",
951 /* 155 */ "let_func ::= ZVAL|OBJVAL|ARRVAL|PATHVAL|STRLEN|STRVAL|FLOATVAL|INTVAL|BOOLVAL|COUNT LPAREN impl_var COMMA let_exps RPAREN",
952 /* 156 */ "let_exps ::= let_exp",
953 /* 157 */ "let_exps ::= let_exps COMMA let_exp",
954 /* 158 */ "callback_arg_list ::=",
955 /* 159 */ "callback_arg_list ::= callback_args",
956 /* 160 */ "callback_args ::= set_exp",
957 /* 161 */ "callback_args ::= callback_args COMMA set_exp",
958 /* 162 */ "callback_rval ::= ZVAL|OBJVAL|ARRVAL|PATHVAL|STRLEN|STRVAL|FLOATVAL|INTVAL|BOOLVAL|COUNT",
959 /* 163 */ "callback_rval ::= VOID",
960 /* 164 */ "set_func ::= TO_OBJECT|TO_ARRAY|TO_STRING|TO_INT|TO_FLOAT|TO_BOOL|ZVAL|VOID LPAREN decl_var RPAREN",
961 /* 165 */ "set_func ::= TO_OBJECT|TO_ARRAY|TO_STRING|TO_INT|TO_FLOAT|TO_BOOL|ZVAL|VOID LPAREN decl_var COMMA set_exps RPAREN",
962 /* 166 */ "set_func ::= TO_OBJECT|TO_ARRAY|TO_STRING|TO_INT|TO_FLOAT|TO_BOOL|ZVAL|VOID LPAREN decl_var COMMA ELLIPSIS RPAREN",
963 /* 167 */ "set_exp ::= set_func",
964 /* 168 */ "set_exp ::= num_exp",
965 /* 169 */ "set_exps ::= set_exp",
966 /* 170 */ "set_exps ::= set_exps COMMA set_exp",
967 /* 171 */ "set_exp ::= impl_var EQUALS set_exp",
968 /* 172 */ "set_stmt ::= SET set_exp EOS",
969 /* 173 */ "return_stmt ::= RETURN set_func EOS",
970 /* 174 */ "free_stmt ::= FREE free_exps EOS",
971 /* 175 */ "free_exps ::= free_exp",
972 /* 176 */ "free_exps ::= free_exps COMMA free_exp",
973 /* 177 */ "free_exp ::= NAME LPAREN decl_vars RPAREN",
974 /* 178 */ "assert_stmt ::= PRE_ASSERT|POST_ASSERT num_exp EOS",
975 /* 179 */ "reference ::=",
976 /* 180 */ "reference ::= AMPERSAND",
977 /* 181 */ "indirection ::=",
978 /* 182 */ "indirection ::= pointers",
979 /* 183 */ "pointers ::= ASTERISK",
980 /* 184 */ "pointers ::= pointers ASTERISK",
981 /* 185 */ "file ::= blocks",
982 /* 186 */ "blocks ::= block",
983 /* 187 */ "blocks ::= blocks block",
984 /* 188 */ "block ::= EOS",
985 /* 189 */ "block ::= EOL",
986 /* 190 */ "block ::= COMMENT",
993 ** Try to increase the size of the parser stack. Return the number
994 ** of errors. Return 0 on success.
996 static int yyGrowStack(yyParser
*p
){
1001 newSize
= p
->yystksz
*2 + 100;
1002 idx
= p
->yytos
? (int)(p
->yytos
- p
->yystack
) : 0;
1003 if( p
->yystack
==&p
->yystk0
){
1004 pNew
= malloc(newSize
*sizeof(pNew
[0]));
1005 if( pNew
) pNew
[0] = p
->yystk0
;
1007 pNew
= realloc(p
->yystack
, newSize
*sizeof(pNew
[0]));
1011 p
->yytos
= &p
->yystack
[idx
];
1014 fprintf(yyTraceFILE
,"%sStack grows from %d to %d entries.\n",
1015 yyTracePrompt
, p
->yystksz
, newSize
);
1018 p
->yystksz
= newSize
;
1024 /* Datatype of the argument to the memory allocated passed as the
1025 ** second argument to ParseAlloc() below. This can be changed by
1026 ** putting an appropriate #define in the %include section of the input
1029 #ifndef YYMALLOCARGTYPE
1030 # define YYMALLOCARGTYPE size_t
1033 /* Initialize a new parser that has already been allocated.
1035 void ParseInit(void *yypParser
){
1036 yyParser
*pParser
= (yyParser
*)yypParser
;
1037 #ifdef YYTRACKMAXSTACKDEPTH
1041 pParser
->yytos
= NULL
;
1042 pParser
->yystack
= NULL
;
1043 pParser
->yystksz
= 0;
1044 if( yyGrowStack(pParser
) ){
1045 pParser
->yystack
= &pParser
->yystk0
;
1046 pParser
->yystksz
= 1;
1049 #ifndef YYNOERRORRECOVERY
1050 pParser
->yyerrcnt
= -1;
1052 pParser
->yytos
= pParser
->yystack
;
1053 pParser
->yystack
[0].stateno
= 0;
1054 pParser
->yystack
[0].major
= 0;
1057 #ifndef Parse_ENGINEALWAYSONSTACK
1059 ** This function allocates a new parser.
1060 ** The only argument is a pointer to a function which works like
1064 ** A pointer to the function used to allocate memory.
1067 ** A pointer to a parser. This pointer is used in subsequent calls
1068 ** to Parse and ParseFree.
1070 void *ParseAlloc(void *(*mallocProc
)(YYMALLOCARGTYPE
)){
1072 pParser
= (yyParser
*)(*mallocProc
)( (YYMALLOCARGTYPE
)sizeof(yyParser
) );
1073 if( pParser
) ParseInit(pParser
);
1076 #endif /* Parse_ENGINEALWAYSONSTACK */
1079 /* The following function deletes the "minor type" or semantic value
1080 ** associated with a symbol. The symbol can be either a terminal
1081 ** or nonterminal. "yymajor" is the symbol code, and "yypminor" is
1082 ** a pointer to the value to be deleted. The code used to do the
1083 ** deletions is derived from the %destructor and/or %token_destructor
1084 ** directives of the input grammar.
1086 static void yy_destructor(
1087 yyParser
*yypParser
, /* The parser */
1088 YYCODETYPE yymajor
, /* Type code for object to destroy */
1089 YYMINORTYPE
*yypminor
/* The object to be destroyed */
1093 /* Here is inserted the actions which take place when a
1094 ** terminal or non-terminal is destroyed. This can happen
1095 ** when the symbol is popped from the stack during a
1096 ** reduce or during error processing or when a parser is
1097 ** being destroyed before it is finished parsing.
1099 ** Note: during a reduce, the only symbols destroyed are those
1100 ** which appear on the RHS of the rule, but which are *not* used
1101 ** inside the C code.
1103 /********* Begin destructor definitions ***************************************/
1104 /* TERMINAL Destructor */
1108 case 4: /* STRING */
1109 case 5: /* DOUBLE */
1113 case 9: /* UINT16 */
1114 case 10: /* INT32 */
1115 case 11: /* UINT32 */
1116 case 12: /* INT64 */
1117 case 13: /* UINT64 */
1120 case 16: /* NUMBER */
1122 case 18: /* FALSE */
1123 case 19: /* QUOTED_STRING */
1124 case 20: /* NSNAME */
1126 case 22: /* CARET */
1127 case 23: /* AMPERSAND */
1128 case 24: /* LSHIFT */
1129 case 25: /* RSHIFT */
1131 case 27: /* MINUS */
1132 case 28: /* ASTERISK */
1133 case 29: /* SLASH */
1134 case 30: /* MODULO */
1135 case 31: /* RCHEVR */
1136 case 32: /* LCHEVR */
1137 case 33: /* CMP_GE */
1138 case 34: /* CMP_LE */
1141 case 37: /* CMP_EQ */
1142 case 38: /* CMP_NE */
1143 case 39: /* TILDE */
1146 case 42: /* OBJVAL */
1147 case 43: /* ARRVAL */
1148 case 44: /* PATHVAL */
1149 case 45: /* STRLEN */
1150 case 46: /* STRVAL */
1151 case 47: /* FLOATVAL */
1152 case 48: /* INTVAL */
1153 case 49: /* BOOLVAL */
1154 case 50: /* COUNT */
1155 case 51: /* TO_OBJECT */
1156 case 52: /* TO_ARRAY */
1157 case 53: /* TO_STRING */
1158 case 54: /* TO_INT */
1159 case 55: /* TO_FLOAT */
1160 case 56: /* TO_BOOL */
1162 case 58: /* MIXED */
1163 case 59: /* ARRAY */
1164 case 60: /* OBJECT */
1165 case 61: /* CALLABLE */
1166 case 62: /* PRE_ASSERT */
1167 case 63: /* POST_ASSERT */
1168 case 64: /* ERROR */
1169 case 65: /* WARNING */
1174 case 70: /* RETURN */
1175 case 71: /* CALLOC */
1176 case 72: /* CALLBACK */
1181 case 77: /* COMMENT */
1183 case 79: /* IFDEF */
1184 case 80: /* IFNDEF */
1185 case 81: /* ENDIF */
1187 case 83: /* UNDEF */
1188 case 84: /* DEFINE */
1189 case 85: /* NO_WHITESPACE */
1190 case 86: /* LPAREN */
1191 case 87: /* RPAREN */
1192 case 88: /* COMMA */
1195 case 91: /* DEFINED */
1196 case 92: /* COLON */
1198 case 94: /* STRUCT */
1199 case 95: /* UNION */
1200 case 96: /* LBRACE */
1201 case 97: /* RBRACE */
1202 case 98: /* EQUALS */
1203 case 99: /* CONST */
1204 case 100: /* TYPEDEF */
1205 case 101: /* ELLIPSIS */
1206 case 102: /* LBRACKET */
1207 case 103: /* RBRACKET */
1208 case 104: /* CHAR */
1209 case 105: /* SHORT */
1210 case 106: /* LONG */
1211 case 107: /* UNSIGNED */
1212 case 108: /* SIGNED */
1213 case 109: /* STATIC */
1214 case 110: /* FUNCTION */
1215 case 111: /* DOLLAR_NAME */
1217 #line 37 "src/parser_proc.y"
1218 free((yypminor
->yy0
));
1219 #line 1220 "src/parser_proc.c"
1222 /* Default NON-TERMINAL Destructor */
1223 case 112: /* error */
1224 case 119: /* align_and_size */
1225 case 176: /* reference */
1226 case 177: /* indirection */
1227 case 178: /* pointers */
1228 case 179: /* file */
1229 case 180: /* blocks */
1230 case 181: /* block */
1231 case 182: /* optional_name */
1232 case 183: /* enum_name */
1233 case 184: /* struct_name */
1234 case 185: /* union_name */
1235 case 186: /* decl_var_array_size */
1236 case 187: /* decl_scalar_type */
1237 case 188: /* decl_scalar_type_short */
1238 case 189: /* decl_scalar_type_long */
1239 case 190: /* decl_scalar_type_long_long */
1240 case 191: /* callback_rval */
1242 #line 38 "src/parser_proc.y"
1244 #line 1245 "src/parser_proc.c"
1247 case 113: /* decl_enum */
1249 #line 66 "src/parser_proc.y"
1250 psi_decl_enum_free(&(yypminor
->yy323
));
1251 #line 1252 "src/parser_proc.c"
1254 case 114: /* decl_enum_items */
1255 case 116: /* decl_struct_args_block */
1256 case 117: /* decl_struct_args */
1257 case 126: /* decl_typedef_body_fn_args */
1258 case 131: /* decl_vars */
1259 case 133: /* decl_args */
1260 case 134: /* struct_args */
1261 case 144: /* impl_args */
1262 case 146: /* impl_stmts */
1263 case 157: /* let_exps */
1264 case 161: /* set_exps */
1265 case 165: /* free_exps */
1266 case 170: /* cpp_macro_decl_tokens */
1267 case 172: /* cpp_macro_sig */
1268 case 173: /* cpp_macro_sig_args */
1269 case 174: /* cpp_macro_call */
1270 case 175: /* cpp_macro_call_args */
1272 #line 68 "src/parser_proc.y"
1273 psi_plist_free((yypminor
->yy179
));
1274 #line 1275 "src/parser_proc.c"
1277 case 115: /* decl_enum_item */
1279 #line 70 "src/parser_proc.y"
1280 psi_decl_enum_item_free(&(yypminor
->yy169
));
1281 #line 1282 "src/parser_proc.c"
1284 case 118: /* decl_struct */
1286 #line 76 "src/parser_proc.y"
1287 psi_decl_struct_free(&(yypminor
->yy324
));
1288 #line 1289 "src/parser_proc.c"
1291 case 120: /* decl_union */
1293 #line 79 "src/parser_proc.y"
1294 psi_decl_union_free(&(yypminor
->yy15
));
1295 #line 1296 "src/parser_proc.c"
1298 case 121: /* const_type */
1300 #line 81 "src/parser_proc.y"
1301 psi_const_type_free(&(yypminor
->yy351
));
1302 #line 1303 "src/parser_proc.c"
1305 case 122: /* constant */
1307 #line 83 "src/parser_proc.y"
1308 psi_const_free(&(yypminor
->yy38
));
1309 #line 1310 "src/parser_proc.c"
1312 case 123: /* decl_typedef */
1313 case 124: /* decl_typedef_body_ex */
1314 case 125: /* decl_typedef_body */
1315 case 128: /* decl_func */
1316 case 132: /* decl_arg */
1317 case 135: /* struct_arg */
1319 #line 85 "src/parser_proc.y"
1320 psi_decl_arg_free(&(yypminor
->yy320
));
1321 #line 1322 "src/parser_proc.c"
1324 case 127: /* decl */
1326 #line 93 "src/parser_proc.y"
1327 psi_decl_free(&(yypminor
->yy303
));
1328 #line 1329 "src/parser_proc.c"
1331 case 129: /* decl_abi */
1333 #line 97 "src/parser_proc.y"
1334 psi_decl_abi_free(&(yypminor
->yy26
));
1335 #line 1336 "src/parser_proc.c"
1338 case 130: /* decl_var */
1340 #line 99 "src/parser_proc.y"
1341 psi_decl_var_free(&(yypminor
->yy271
));
1342 #line 1343 "src/parser_proc.c"
1345 case 136: /* decl_layout */
1347 #line 111 "src/parser_proc.y"
1348 psi_layout_free(&(yypminor
->yy369
));
1349 #line 1350 "src/parser_proc.c"
1352 case 137: /* decl_type */
1353 case 138: /* const_decl_type */
1355 #line 113 "src/parser_proc.y"
1356 psi_decl_type_free(&(yypminor
->yy172
));
1357 #line 1358 "src/parser_proc.c"
1360 case 139: /* impl */
1362 #line 117 "src/parser_proc.y"
1363 psi_impl_free(&(yypminor
->yy49
));
1364 #line 1365 "src/parser_proc.c"
1367 case 140: /* impl_func */
1369 #line 119 "src/parser_proc.y"
1370 psi_impl_func_free(&(yypminor
->yy56
));
1371 #line 1372 "src/parser_proc.c"
1374 case 141: /* impl_def_val */
1376 #line 121 "src/parser_proc.y"
1377 psi_impl_def_val_free(&(yypminor
->yy145
));
1378 #line 1379 "src/parser_proc.c"
1381 case 142: /* impl_var */
1383 #line 123 "src/parser_proc.y"
1384 psi_impl_var_free(&(yypminor
->yy370
));
1385 #line 1386 "src/parser_proc.c"
1388 case 143: /* impl_arg */
1389 case 145: /* impl_vararg */
1391 #line 125 "src/parser_proc.y"
1392 psi_impl_arg_free(&(yypminor
->yy34
));
1393 #line 1394 "src/parser_proc.c"
1396 case 147: /* impl_stmt */
1398 #line 133 "src/parser_proc.y"
1399 psi_impl_stmt_free(&(yypminor
->yy238
));
1400 #line 1401 "src/parser_proc.c"
1403 case 148: /* number */
1405 #line 135 "src/parser_proc.y"
1406 psi_number_free(&(yypminor
->yy57
));
1407 #line 1408 "src/parser_proc.c"
1410 case 149: /* num_exp */
1411 case 171: /* cpp_macro_exp */
1413 #line 137 "src/parser_proc.y"
1414 psi_num_exp_free(&(yypminor
->yy207
));
1415 #line 1416 "src/parser_proc.c"
1418 case 150: /* let_stmt */
1420 #line 139 "src/parser_proc.y"
1421 psi_let_stmt_free(&(yypminor
->yy319
));
1422 #line 1423 "src/parser_proc.c"
1425 case 151: /* let_calloc */
1427 #line 141 "src/parser_proc.y"
1428 psi_let_calloc_free(&(yypminor
->yy45
));
1429 #line 1430 "src/parser_proc.c"
1432 case 152: /* let_func */
1434 #line 143 "src/parser_proc.y"
1435 psi_let_func_free(&(yypminor
->yy67
));
1436 #line 1437 "src/parser_proc.c"
1439 case 153: /* callback_arg_list */
1440 case 154: /* callback_args */
1442 #line 145 "src/parser_proc.y"
1443 psi_plist_free((yypminor
->yy243
));
1444 #line 1445 "src/parser_proc.c"
1447 case 155: /* let_callback */
1449 #line 149 "src/parser_proc.y"
1450 psi_let_callback_free(&(yypminor
->yy120
));
1451 #line 1452 "src/parser_proc.c"
1454 case 156: /* let_exp */
1456 #line 151 "src/parser_proc.y"
1457 psi_let_exp_free(&(yypminor
->yy200
));
1458 #line 1459 "src/parser_proc.c"
1461 case 158: /* assert_stmt */
1463 #line 155 "src/parser_proc.y"
1464 psi_assert_stmt_free(&(yypminor
->yy201
));
1465 #line 1466 "src/parser_proc.c"
1468 case 159: /* set_stmt */
1470 #line 157 "src/parser_proc.y"
1471 psi_set_stmt_free(&(yypminor
->yy358
));
1472 #line 1473 "src/parser_proc.c"
1475 case 160: /* set_exp */
1477 #line 159 "src/parser_proc.y"
1478 psi_set_exp_free(&(yypminor
->yy180
));
1479 #line 1480 "src/parser_proc.c"
1482 case 162: /* set_func */
1484 #line 163 "src/parser_proc.y"
1485 psi_set_func_free(&(yypminor
->yy362
));
1486 #line 1487 "src/parser_proc.c"
1489 case 163: /* return_stmt */
1491 #line 165 "src/parser_proc.y"
1492 psi_return_stmt_free(&(yypminor
->yy342
));
1493 #line 1494 "src/parser_proc.c"
1496 case 164: /* free_stmt */
1498 #line 167 "src/parser_proc.y"
1499 psi_free_stmt_free(&(yypminor
->yy220
));
1500 #line 1501 "src/parser_proc.c"
1503 case 166: /* free_exp */
1505 #line 171 "src/parser_proc.y"
1506 psi_free_exp_free(&(yypminor
->yy146
));
1507 #line 1508 "src/parser_proc.c"
1510 case 167: /* impl_type */
1512 #line 173 "src/parser_proc.y"
1513 psi_impl_type_free(&(yypminor
->yy246
));
1514 #line 1515 "src/parser_proc.c"
1517 case 168: /* cpp_exp */
1519 #line 175 "src/parser_proc.y"
1520 psi_cpp_exp_free(&(yypminor
->yy274
));
1521 #line 1522 "src/parser_proc.c"
1524 case 169: /* cpp_macro_decl */
1526 #line 177 "src/parser_proc.y"
1527 psi_cpp_macro_decl_free(&(yypminor
->yy134
));
1528 #line 1529 "src/parser_proc.c"
1531 /********* End destructor definitions *****************************************/
1532 default: break; /* If no destructor action specified: do nothing */
1537 ** Pop the parser's stack once.
1539 ** If there is a destructor routine associated with the token which
1540 ** is popped from the stack, then call it.
1542 static void yy_pop_parser_stack(yyParser
*pParser
){
1543 yyStackEntry
*yytos
;
1544 assert( pParser
->yytos
!=0 );
1545 assert( pParser
->yytos
> pParser
->yystack
);
1546 yytos
= pParser
->yytos
--;
1549 fprintf(yyTraceFILE
,"%sPopping %s\n",
1551 yyTokenName
[yytos
->major
]);
1554 yy_destructor(pParser
, yytos
->major
, &yytos
->minor
);
1558 ** Clear all secondary memory allocations from the parser
1560 void ParseFinalize(void *p
){
1561 yyParser
*pParser
= (yyParser
*)p
;
1562 while( pParser
->yytos
>pParser
->yystack
) yy_pop_parser_stack(pParser
);
1564 if( pParser
->yystack
!=&pParser
->yystk0
) free(pParser
->yystack
);
1568 #ifndef Parse_ENGINEALWAYSONSTACK
1570 ** Deallocate and destroy a parser. Destructors are called for
1571 ** all stack elements before shutting the parser down.
1573 ** If the YYPARSEFREENEVERNULL macro exists (for example because it
1574 ** is defined in a %include section of the input grammar) then it is
1575 ** assumed that the input pointer is never NULL.
1578 void *p
, /* The parser to be deleted */
1579 void (*freeProc
)(void*) /* Function used to reclaim memory */
1581 #ifndef YYPARSEFREENEVERNULL
1587 #endif /* Parse_ENGINEALWAYSONSTACK */
1590 ** Return the peak depth of the stack for a parser.
1592 #ifdef YYTRACKMAXSTACKDEPTH
1593 int ParseStackPeak(void *p
){
1594 yyParser
*pParser
= (yyParser
*)p
;
1595 return pParser
->yyhwm
;
1600 ** Find the appropriate action for a parser given the terminal
1601 ** look-ahead token iLookAhead.
1603 static unsigned int yy_find_shift_action(
1604 yyParser
*pParser
, /* The parser */
1605 YYCODETYPE iLookAhead
/* The look-ahead token */
1608 int stateno
= pParser
->yytos
->stateno
;
1610 if( stateno
>=YY_MIN_REDUCE
) return stateno
;
1611 assert( stateno
<= YY_SHIFT_COUNT
);
1613 i
= yy_shift_ofst
[stateno
];
1614 assert( iLookAhead
!=YYNOCODE
);
1616 if( i
<0 || i
>=YY_ACTTAB_COUNT
|| yy_lookahead
[i
]!=iLookAhead
){
1618 YYCODETYPE iFallback
; /* Fallback token */
1619 if( iLookAhead
<sizeof(yyFallback
)/sizeof(yyFallback
[0])
1620 && (iFallback
= yyFallback
[iLookAhead
])!=0 ){
1623 fprintf(yyTraceFILE
, "%sFALLBACK %s => %s\n",
1624 yyTracePrompt
, yyTokenName
[iLookAhead
], yyTokenName
[iFallback
]);
1627 assert( yyFallback
[iFallback
]==0 ); /* Fallback loop must terminate */
1628 iLookAhead
= iFallback
;
1634 int j
= i
- iLookAhead
+ YYWILDCARD
;
1636 #if YY_SHIFT_MIN+YYWILDCARD<0
1639 #if YY_SHIFT_MAX+YYWILDCARD>=YY_ACTTAB_COUNT
1640 j
<YY_ACTTAB_COUNT
&&
1642 yy_lookahead
[j
]==YYWILDCARD
&& iLookAhead
>0
1646 fprintf(yyTraceFILE
, "%sWILDCARD %s => %s\n",
1647 yyTracePrompt
, yyTokenName
[iLookAhead
],
1648 yyTokenName
[YYWILDCARD
]);
1651 return yy_action
[j
];
1654 #endif /* YYWILDCARD */
1655 return yy_default
[stateno
];
1657 return yy_action
[i
];
1663 ** Find the appropriate action for a parser given the non-terminal
1664 ** look-ahead token iLookAhead.
1666 static int yy_find_reduce_action(
1667 int stateno
, /* Current state number */
1668 YYCODETYPE iLookAhead
/* The look-ahead token */
1671 #ifdef YYERRORSYMBOL
1672 if( stateno
>YY_REDUCE_COUNT
){
1673 return yy_default
[stateno
];
1676 assert( stateno
<=YY_REDUCE_COUNT
);
1678 i
= yy_reduce_ofst
[stateno
];
1679 assert( i
!=YY_REDUCE_USE_DFLT
);
1680 assert( iLookAhead
!=YYNOCODE
);
1682 #ifdef YYERRORSYMBOL
1683 if( i
<0 || i
>=YY_ACTTAB_COUNT
|| yy_lookahead
[i
]!=iLookAhead
){
1684 return yy_default
[stateno
];
1687 assert( i
>=0 && i
<YY_ACTTAB_COUNT
);
1688 assert( yy_lookahead
[i
]==iLookAhead
);
1690 return yy_action
[i
];
1694 ** The following routine is called if the stack overflows.
1696 static void yyStackOverflow(yyParser
*yypParser
){
1700 fprintf(yyTraceFILE
,"%sStack Overflow!\n",yyTracePrompt
);
1703 while( yypParser
->yytos
>yypParser
->yystack
) yy_pop_parser_stack(yypParser
);
1704 /* Here code is inserted which will execute if the parser
1705 ** stack every overflows */
1706 /******** Begin %stack_overflow code ******************************************/
1707 /******** End %stack_overflow code ********************************************/
1708 ParseARG_STORE
; /* Suppress warning about unused %extra_argument var */
1712 ** Print tracing information for a SHIFT action
1715 static void yyTraceShift(yyParser
*yypParser
, int yyNewState
){
1717 if( yyNewState
<YYNSTATE
){
1718 fprintf(yyTraceFILE
,"%sShift '%s', go to state %d\n",
1719 yyTracePrompt
,yyTokenName
[yypParser
->yytos
->major
],
1722 fprintf(yyTraceFILE
,"%sShift '%s'\n",
1723 yyTracePrompt
,yyTokenName
[yypParser
->yytos
->major
]);
1728 # define yyTraceShift(X,Y)
1732 ** Perform a shift action.
1734 static void yy_shift(
1735 yyParser
*yypParser
, /* The parser to be shifted */
1736 int yyNewState
, /* The new state to shift in */
1737 int yyMajor
, /* The major token to shift in */
1738 ParseTOKENTYPE yyMinor
/* The minor token to shift in */
1740 yyStackEntry
*yytos
;
1742 #ifdef YYTRACKMAXSTACKDEPTH
1743 if( (int)(yypParser
->yytos
- yypParser
->yystack
)>yypParser
->yyhwm
){
1745 assert( yypParser
->yyhwm
== (int)(yypParser
->yytos
- yypParser
->yystack
) );
1749 if( yypParser
->yytos
>=&yypParser
->yystack
[YYSTACKDEPTH
] ){
1751 yyStackOverflow(yypParser
);
1755 if( yypParser
->yytos
>=&yypParser
->yystack
[yypParser
->yystksz
] ){
1756 if( yyGrowStack(yypParser
) ){
1758 yyStackOverflow(yypParser
);
1763 if( yyNewState
> YY_MAX_SHIFT
){
1764 yyNewState
+= YY_MIN_REDUCE
- YY_MIN_SHIFTREDUCE
;
1766 yytos
= yypParser
->yytos
;
1767 yytos
->stateno
= (YYACTIONTYPE
)yyNewState
;
1768 yytos
->major
= (YYCODETYPE
)yyMajor
;
1769 yytos
->minor
.yy0
= yyMinor
;
1770 yyTraceShift(yypParser
, yyNewState
);
1773 /* The following table contains information about every rule that
1774 ** is used during the reduce.
1776 static const struct {
1777 YYCODETYPE lhs
; /* Symbol on the left-hand side of the rule */
1778 unsigned char nrhs
; /* Number of right-hand side symbols in the rule */
1973 static void yy_accept(yyParser
*); /* Forward Declaration */
1976 ** Perform a reduce action and the shift that must immediately
1977 ** follow the reduce.
1979 static void yy_reduce(
1980 yyParser
*yypParser
, /* The parser */
1981 unsigned int yyruleno
/* Number of the rule by which to reduce */
1983 int yygoto
; /* The next state */
1984 int yyact
; /* The next action */
1985 yyStackEntry
*yymsp
; /* The top of the parser's stack */
1986 int yysize
; /* Amount to pop the stack */
1988 yymsp
= yypParser
->yytos
;
1990 if( yyTraceFILE
&& yyruleno
<(int)(sizeof(yyRuleName
)/sizeof(yyRuleName
[0])) ){
1991 yysize
= yyRuleInfo
[yyruleno
].nrhs
;
1992 fprintf(yyTraceFILE
, "%sReduce [%s], go to state %d.\n", yyTracePrompt
,
1993 yyRuleName
[yyruleno
], yymsp
[-yysize
].stateno
);
1997 /* Check that the stack is large enough to grow by a single entry
1998 ** if the RHS of the rule is empty. This ensures that there is room
1999 ** enough on the stack to push the LHS value */
2000 if( yyRuleInfo
[yyruleno
].nrhs
==0 ){
2001 #ifdef YYTRACKMAXSTACKDEPTH
2002 if( (int)(yypParser
->yytos
- yypParser
->yystack
)>yypParser
->yyhwm
){
2004 assert( yypParser
->yyhwm
== (int)(yypParser
->yytos
- yypParser
->yystack
));
2008 if( yypParser
->yytos
>=&yypParser
->yystack
[YYSTACKDEPTH
-1] ){
2009 yyStackOverflow(yypParser
);
2013 if( yypParser
->yytos
>=&yypParser
->yystack
[yypParser
->yystksz
-1] ){
2014 if( yyGrowStack(yypParser
) ){
2015 yyStackOverflow(yypParser
);
2018 yymsp
= yypParser
->yytos
;
2024 /* Beginning here are the reduction cases. A typical example
2027 ** #line <lineno> <grammarfile>
2028 ** { ... } // User supplied code
2029 ** #line <lineno> <thisfile>
2032 /********** Begin reduce actions **********************************************/
2033 YYMINORTYPE yylhsminor
;
2034 case 0: /* block ::= HASH cpp_exp EOL */
2035 { yy_destructor(yypParser
,78,&yymsp
[-2].minor
);
2036 #line 199 "src/parser_proc.y"
2038 P
->cpp
.exp
= yymsp
[-1].minor
.yy274
;
2040 #line 2041 "src/parser_proc.c"
2041 yy_destructor(yypParser
,76,&yymsp
[0].minor
);
2044 case 1: /* cpp_exp ::= ERROR|WARNING QUOTED_STRING */
2045 case 2: /* cpp_exp ::= IFDEF NAME */ yytestcase(yyruleno
==2);
2046 case 3: /* cpp_exp ::= IFNDEF NAME */ yytestcase(yyruleno
==3);
2047 case 6: /* cpp_exp ::= UNDEF NAME */ yytestcase(yyruleno
==6);
2048 #line 202 "src/parser_proc.y"
2050 yylhsminor
.yy274
= psi_cpp_exp_init(yymsp
[-1].minor
.yy0
->type
, yymsp
[0].minor
.yy0
);
2051 yylhsminor
.yy274
->token
= yymsp
[-1].minor
.yy0
;
2053 #line 2054 "src/parser_proc.c"
2054 yymsp
[-1].minor
.yy274
= yylhsminor
.yy274
;
2056 case 4: /* cpp_exp ::= ENDIF */
2057 case 5: /* cpp_exp ::= ELSE */ yytestcase(yyruleno
==5);
2058 #line 214 "src/parser_proc.y"
2060 yylhsminor
.yy274
= psi_cpp_exp_init(yymsp
[0].minor
.yy0
->type
, NULL
);
2061 yylhsminor
.yy274
->token
= yymsp
[0].minor
.yy0
;
2063 #line 2064 "src/parser_proc.c"
2064 yymsp
[0].minor
.yy274
= yylhsminor
.yy274
;
2066 case 7: /* cpp_exp ::= DEFINE NAME cpp_macro_decl */
2067 #line 226 "src/parser_proc.y"
2069 yylhsminor
.yy274
= psi_cpp_exp_init(yymsp
[-2].minor
.yy0
->type
, yymsp
[0].minor
.yy134
);
2070 yylhsminor
.yy274
->token
= yymsp
[-2].minor
.yy0
;
2071 yymsp
[0].minor
.yy134
->token
= yymsp
[-1].minor
.yy0
;
2073 #line 2074 "src/parser_proc.c"
2074 yymsp
[-2].minor
.yy274
= yylhsminor
.yy274
;
2076 case 8: /* cpp_macro_decl ::= */
2077 #line 231 "src/parser_proc.y"
2079 yymsp
[1].minor
.yy134
= psi_cpp_macro_decl_init(NULL
, NULL
, NULL
);
2081 #line 2082 "src/parser_proc.c"
2083 case 9: /* cpp_macro_decl ::= cpp_macro_sig */
2084 #line 234 "src/parser_proc.y"
2086 yylhsminor
.yy134
= psi_cpp_macro_decl_init(yymsp
[0].minor
.yy179
, NULL
, NULL
);
2088 #line 2089 "src/parser_proc.c"
2089 yymsp
[0].minor
.yy134
= yylhsminor
.yy134
;
2091 case 10: /* cpp_macro_decl ::= cpp_macro_sig cpp_macro_decl_tokens */
2092 #line 237 "src/parser_proc.y"
2094 yylhsminor
.yy134
= psi_cpp_macro_decl_init(yymsp
[-1].minor
.yy179
, yymsp
[0].minor
.yy179
, NULL
);
2096 #line 2097 "src/parser_proc.c"
2097 yymsp
[-1].minor
.yy134
= yylhsminor
.yy134
;
2099 case 11: /* cpp_macro_sig ::= NO_WHITESPACE LPAREN cpp_macro_sig_args RPAREN */
2100 { yy_destructor(yypParser
,85,&yymsp
[-3].minor
);
2101 #line 240 "src/parser_proc.y"
2103 yymsp
[-3].minor
.yy179
= yymsp
[-1].minor
.yy179
;
2105 #line 2106 "src/parser_proc.c"
2106 yy_destructor(yypParser
,86,&yymsp
[-2].minor
);
2107 yy_destructor(yypParser
,87,&yymsp
[0].minor
);
2110 case 12: /* cpp_macro_sig_args ::= */
2111 case 28: /* cpp_macro_call_args ::= */ yytestcase(yyruleno
==28);
2112 case 83: /* decl_args ::= */ yytestcase(yyruleno
==83);
2113 #line 243 "src/parser_proc.y"
2115 yymsp
[1].minor
.yy179
= NULL
;
2117 #line 2118 "src/parser_proc.c"
2119 case 13: /* cpp_macro_sig_args ::= NAME */
2120 case 16: /* cpp_macro_decl_tokens ::= ANY */ yytestcase(yyruleno
==16);
2121 #line 246 "src/parser_proc.y"
2123 yylhsminor
.yy179
= psi_plist_add(psi_plist_init((void (*)(void *)) psi_token_free
), &yymsp
[0].minor
.yy0
);
2125 #line 2126 "src/parser_proc.c"
2126 yymsp
[0].minor
.yy179
= yylhsminor
.yy179
;
2128 case 14: /* cpp_macro_sig_args ::= cpp_macro_sig_args COMMA NAME */
2129 #line 249 "src/parser_proc.y"
2131 yylhsminor
.yy179
= psi_plist_add(yymsp
[-2].minor
.yy179
, &yymsp
[0].minor
.yy0
);
2133 #line 2134 "src/parser_proc.c"
2134 yy_destructor(yypParser
,88,&yymsp
[-1].minor
);
2135 yymsp
[-2].minor
.yy179
= yylhsminor
.yy179
;
2137 case 15: /* cpp_macro_decl ::= cpp_macro_decl_tokens */
2138 #line 252 "src/parser_proc.y"
2140 yylhsminor
.yy134
= psi_cpp_macro_decl_init(NULL
, yymsp
[0].minor
.yy179
, NULL
);
2142 #line 2143 "src/parser_proc.c"
2143 yymsp
[0].minor
.yy134
= yylhsminor
.yy134
;
2145 case 17: /* cpp_macro_decl_tokens ::= cpp_macro_decl_tokens ANY */
2146 #line 258 "src/parser_proc.y"
2148 yylhsminor
.yy179
= psi_plist_add(yymsp
[-1].minor
.yy179
, &yymsp
[0].minor
.yy0
);
2150 #line 2151 "src/parser_proc.c"
2151 yymsp
[-1].minor
.yy179
= yylhsminor
.yy179
;
2153 case 18: /* cpp_exp ::= IF cpp_macro_exp */
2154 case 19: /* cpp_exp ::= ELIF cpp_macro_exp */ yytestcase(yyruleno
==19);
2155 #line 261 "src/parser_proc.y"
2157 yylhsminor
.yy274
= psi_cpp_exp_init(yymsp
[-1].minor
.yy0
->type
, yymsp
[0].minor
.yy207
);
2158 yylhsminor
.yy274
->token
= yymsp
[-1].minor
.yy0
;
2160 #line 2161 "src/parser_proc.c"
2161 yymsp
[-1].minor
.yy274
= yylhsminor
.yy274
;
2163 case 20: /* cpp_macro_exp ::= LPAREN cpp_macro_exp RPAREN */
2164 #line 269 "src/parser_proc.y"
2166 yylhsminor
.yy207
= psi_num_exp_init_unary(yymsp
[-2].minor
.yy0
->type
, yymsp
[-1].minor
.yy207
);
2167 yylhsminor
.yy207
->token
= yymsp
[-2].minor
.yy0
;
2169 #line 2170 "src/parser_proc.c"
2170 yy_destructor(yypParser
,87,&yymsp
[0].minor
);
2171 yymsp
[-2].minor
.yy207
= yylhsminor
.yy207
;
2173 case 21: /* cpp_macro_exp ::= TILDE|NOT|PLUS|MINUS cpp_macro_exp */
2174 case 139: /* num_exp ::= TILDE|NOT|PLUS|MINUS num_exp */ yytestcase(yyruleno
==139);
2175 #line 273 "src/parser_proc.y"
2177 yylhsminor
.yy207
= psi_num_exp_init_unary(yymsp
[-1].minor
.yy0
->type
, yymsp
[0].minor
.yy207
);
2178 yylhsminor
.yy207
->token
= yymsp
[-1].minor
.yy0
;
2180 #line 2181 "src/parser_proc.c"
2181 yymsp
[-1].minor
.yy207
= yylhsminor
.yy207
;
2183 case 22: /* cpp_macro_exp ::= cpp_macro_exp PIPE|CARET|AMPERSAND|LSHIFT|RSHIFT|PLUS|MINUS|ASTERISK|SLASH|MODULO|RCHEVR|LCHEVR|CMP_GE|CMP_LE|OR|AND|CMP_EQ|CMP_NE cpp_macro_exp */
2184 case 138: /* num_exp ::= num_exp PIPE|CARET|AMPERSAND|LSHIFT|RSHIFT|PLUS|MINUS|ASTERISK|SLASH|MODULO|RCHEVR|LCHEVR|CMP_GE|CMP_LE|OR|AND|CMP_EQ|CMP_NE num_exp */ yytestcase(yyruleno
==138);
2185 #line 277 "src/parser_proc.y"
2187 yylhsminor
.yy207
= psi_num_exp_init_binary(yymsp
[-1].minor
.yy0
->type
, yymsp
[-2].minor
.yy207
, yymsp
[0].minor
.yy207
);
2188 yylhsminor
.yy207
->token
= yymsp
[-1].minor
.yy0
;
2190 #line 2191 "src/parser_proc.c"
2191 yymsp
[-2].minor
.yy207
= yylhsminor
.yy207
;
2193 case 23: /* cpp_macro_exp ::= DEFINED NAME */
2194 { yy_destructor(yypParser
,91,&yymsp
[-1].minor
);
2195 #line 281 "src/parser_proc.y"
2198 uint8_t exists
= zend_hash_str_exists(&P
->cpp
.defs
, yymsp
[0].minor
.yy0
->text
, yymsp
[0].minor
.yy0
->size
);
2199 yymsp
[-1].minor
.yy207
= psi_num_exp_init_num(psi_number_init(PSI_T_UINT8
, &exists
));
2200 yymsp
[-1].minor
.yy207
->token
= yymsp
[0].minor
.yy0
;
2203 #line 2204 "src/parser_proc.c"
2206 case 24: /* cpp_macro_exp ::= DEFINED LPAREN NAME RPAREN */
2207 { yy_destructor(yypParser
,91,&yymsp
[-3].minor
);
2208 #line 288 "src/parser_proc.y"
2211 uint8_t exists
= zend_hash_str_exists(&P
->cpp
.defs
, yymsp
[-1].minor
.yy0
->text
, yymsp
[-1].minor
.yy0
->size
);
2212 yymsp
[-3].minor
.yy207
= psi_num_exp_init_num(psi_number_init(PSI_T_UINT8
, &exists
));
2213 yymsp
[-3].minor
.yy207
->token
= yymsp
[-1].minor
.yy0
;
2216 #line 2217 "src/parser_proc.c"
2217 yy_destructor(yypParser
,86,&yymsp
[-2].minor
);
2218 yy_destructor(yypParser
,87,&yymsp
[0].minor
);
2221 case 25: /* cpp_macro_exp ::= NUMBER|NSNAME */
2222 #line 295 "src/parser_proc.y"
2224 yylhsminor
.yy207
= psi_num_exp_init_num(psi_number_init(yymsp
[0].minor
.yy0
->type
, yymsp
[0].minor
.yy0
->text
));
2225 yylhsminor
.yy207
->token
= yymsp
[0].minor
.yy0
;
2226 yylhsminor
.yy207
->data
.n
->token
= psi_token_copy(yymsp
[0].minor
.yy0
);
2228 #line 2229 "src/parser_proc.c"
2229 yymsp
[0].minor
.yy207
= yylhsminor
.yy207
;
2231 case 26: /* cpp_macro_exp ::= NAME */
2232 #line 300 "src/parser_proc.y"
2234 yylhsminor
.yy207
= psi_num_exp_init_num(psi_number_init(PSI_T_DEFINE
, yymsp
[0].minor
.yy0
->text
));
2235 yylhsminor
.yy207
->token
= yymsp
[0].minor
.yy0
;
2236 yylhsminor
.yy207
->data
.n
->token
= psi_token_copy(yymsp
[0].minor
.yy0
);
2238 #line 2239 "src/parser_proc.c"
2239 yymsp
[0].minor
.yy207
= yylhsminor
.yy207
;
2241 case 27: /* cpp_macro_exp ::= NAME LPAREN cpp_macro_call_args RPAREN */
2242 #line 305 "src/parser_proc.y"
2244 yylhsminor
.yy207
= psi_num_exp_init_num(psi_number_init(PSI_T_FUNCTION
,
2245 psi_cpp_macro_call_init(yymsp
[-3].minor
.yy0
->text
, yymsp
[-1].minor
.yy179
)));
2246 yylhsminor
.yy207
->token
= yymsp
[-3].minor
.yy0
;
2248 #line 2249 "src/parser_proc.c"
2249 yy_destructor(yypParser
,86,&yymsp
[-2].minor
);
2250 yy_destructor(yypParser
,87,&yymsp
[0].minor
);
2251 yymsp
[-3].minor
.yy207
= yylhsminor
.yy207
;
2253 case 29: /* cpp_macro_call_args ::= cpp_macro_exp */
2254 #line 313 "src/parser_proc.y"
2256 yylhsminor
.yy179
= psi_plist_add(psi_plist_init((void (*)(void *)) psi_num_exp_free
), &yymsp
[0].minor
.yy207
);
2258 #line 2259 "src/parser_proc.c"
2259 yymsp
[0].minor
.yy179
= yylhsminor
.yy179
;
2261 case 30: /* cpp_macro_call_args ::= cpp_macro_call_args COMMA cpp_macro_exp */
2262 #line 316 "src/parser_proc.y"
2264 yylhsminor
.yy179
= psi_plist_add(yymsp
[-2].minor
.yy179
, &yymsp
[0].minor
.yy207
);
2266 #line 2267 "src/parser_proc.c"
2267 yy_destructor(yypParser
,88,&yymsp
[-1].minor
);
2268 yymsp
[-2].minor
.yy179
= yylhsminor
.yy179
;
2270 case 31: /* block ::= LIB QUOTED_STRING EOS */
2271 #line 319 "src/parser_proc.y"
2274 P
->error(PSI_DATA(P
), yymsp
[-2].minor
.yy0
, PSI_WARNING
, "Extra 'lib %s' statement has no effect", yymsp
[-1].minor
.yy0
->text
);
2276 P
->file
.ln
= strndup(yymsp
[-1].minor
.yy0
->text
+ 1, yymsp
[-1].minor
.yy0
->size
- 2);
2278 free(yymsp
[-1].minor
.yy0
);
2279 free(yymsp
[-2].minor
.yy0
);
2281 #line 2282 "src/parser_proc.c"
2282 yy_destructor(yypParser
,75,&yymsp
[0].minor
);
2284 case 32: /* block ::= decl */
2285 #line 328 "src/parser_proc.y"
2288 P
->decls
= psi_plist_init((psi_plist_dtor
) psi_decl_free
);
2290 P
->decls
= psi_plist_add(P
->decls
, &yymsp
[0].minor
.yy303
);
2292 #line 2293 "src/parser_proc.c"
2294 case 33: /* block ::= impl */
2295 #line 334 "src/parser_proc.y"
2298 P
->impls
= psi_plist_init((psi_plist_dtor
) psi_impl_free
);
2300 P
->impls
= psi_plist_add(P
->impls
, &yymsp
[0].minor
.yy49
);
2302 #line 2303 "src/parser_proc.c"
2304 case 34: /* block ::= decl_typedef */
2305 #line 340 "src/parser_proc.y"
2308 P
->types
= psi_plist_init((psi_plist_dtor
) psi_decl_arg_free
);
2310 P
->types
= psi_plist_add(P
->types
, &yymsp
[0].minor
.yy320
);
2311 switch (yymsp
[0].minor
.yy320
->type
->type
) {
2313 if (yymsp
[0].minor
.yy320
->type
->real
.strct
) {
2315 P
->structs
= psi_plist_init((psi_plist_dtor
) psi_decl_struct_free
);
2317 P
->structs
= psi_plist_add(P
->structs
, &yymsp
[0].minor
.yy320
->type
->real
.strct
);
2321 if (yymsp
[0].minor
.yy320
->type
->real
.unn
) {
2323 P
->unions
= psi_plist_init((psi_plist_dtor
) psi_decl_union_free
);
2325 P
->unions
= psi_plist_add(P
->unions
, &yymsp
[0].minor
.yy320
->type
->real
.unn
);
2329 if (yymsp
[0].minor
.yy320
->type
->real
.enm
) {
2331 P
->enums
= psi_plist_init((psi_plist_dtor
) psi_decl_enum_free
);
2333 P
->enums
= psi_plist_add(P
->enums
, &yymsp
[0].minor
.yy320
->type
->real
.enm
);
2338 #line 2339 "src/parser_proc.c"
2340 case 35: /* block ::= constant */
2341 #line 372 "src/parser_proc.y"
2344 P
->consts
= psi_plist_init((psi_plist_dtor
) psi_const_free
);
2346 P
->consts
= psi_plist_add(P
->consts
, &yymsp
[0].minor
.yy38
);
2348 #line 2349 "src/parser_proc.c"
2350 case 36: /* block ::= decl_struct */
2351 #line 378 "src/parser_proc.y"
2354 P
->structs
= psi_plist_init((psi_plist_dtor
) psi_decl_struct_free
);
2356 P
->structs
= psi_plist_add(P
->structs
, &yymsp
[0].minor
.yy324
);
2358 #line 2359 "src/parser_proc.c"
2360 case 37: /* block ::= decl_union */
2361 #line 384 "src/parser_proc.y"
2364 P
->unions
= psi_plist_init((psi_plist_dtor
) psi_decl_union_free
);
2366 P
->unions
= psi_plist_add(P
->unions
, &yymsp
[0].minor
.yy15
);
2368 #line 2369 "src/parser_proc.c"
2370 case 38: /* block ::= decl_enum */
2371 #line 390 "src/parser_proc.y"
2374 P
->enums
= psi_plist_init((psi_plist_dtor
) psi_decl_enum_free
);
2376 P
->enums
= psi_plist_add(P
->enums
, &yymsp
[0].minor
.yy323
);
2378 #line 2379 "src/parser_proc.c"
2380 case 39: /* optional_name ::= */
2381 case 73: /* decl_var_array_size ::= */ yytestcase(yyruleno
==73);
2382 case 95: /* decl_scalar_type_short ::= */ yytestcase(yyruleno
==95);
2383 case 99: /* decl_scalar_type_long ::= */ yytestcase(yyruleno
==99);
2384 case 102: /* decl_scalar_type_long_long ::= */ yytestcase(yyruleno
==102);
2385 #line 396 "src/parser_proc.y"
2387 yymsp
[1].minor
.yy0
= NULL
;
2389 #line 2390 "src/parser_proc.c"
2391 case 40: /* optional_name ::= NAME */
2392 case 93: /* decl_scalar_type ::= CHAR */ yytestcase(yyruleno
==93);
2393 case 96: /* decl_scalar_type_short ::= INT */ yytestcase(yyruleno
==96);
2394 case 97: /* decl_scalar_type ::= INT */ yytestcase(yyruleno
==97);
2395 case 100: /* decl_scalar_type_long ::= DOUBLE */ yytestcase(yyruleno
==100);
2396 case 103: /* decl_scalar_type_long_long ::= INT */ yytestcase(yyruleno
==103);
2397 case 162: /* callback_rval ::= ZVAL|OBJVAL|ARRVAL|PATHVAL|STRLEN|STRVAL|FLOATVAL|INTVAL|BOOLVAL|COUNT */ yytestcase(yyruleno
==162);
2398 case 163: /* callback_rval ::= VOID */ yytestcase(yyruleno
==163);
2399 #line 399 "src/parser_proc.y"
2401 yylhsminor
.yy0
= yymsp
[0].minor
.yy0
;
2403 #line 2404 "src/parser_proc.c"
2404 yymsp
[0].minor
.yy0
= yylhsminor
.yy0
;
2406 case 41: /* align_and_size ::= */
2407 #line 402 "src/parser_proc.y"
2409 yymsp
[1].minor
.yy239
.pos
= 0;
2410 yymsp
[1].minor
.yy239
.len
= 0;
2412 #line 2413 "src/parser_proc.c"
2414 case 42: /* align_and_size ::= COLON COLON LPAREN NUMBER COMMA NUMBER RPAREN */
2415 { yy_destructor(yypParser
,92,&yymsp
[-6].minor
);
2416 #line 406 "src/parser_proc.y"
2418 yymsp
[-6].minor
.yy239
.pos
= atol(yymsp
[-3].minor
.yy0
->text
);
2419 yymsp
[-6].minor
.yy239
.len
= atol(yymsp
[-1].minor
.yy0
->text
);
2420 free(yymsp
[-3].minor
.yy0
);
2421 free(yymsp
[-1].minor
.yy0
);
2423 #line 2424 "src/parser_proc.c"
2424 yy_destructor(yypParser
,92,&yymsp
[-5].minor
);
2425 yy_destructor(yypParser
,86,&yymsp
[-4].minor
);
2426 yy_destructor(yypParser
,88,&yymsp
[-2].minor
);
2427 yy_destructor(yypParser
,87,&yymsp
[0].minor
);
2430 case 43: /* enum_name ::= ENUM optional_name */
2431 case 44: /* struct_name ::= STRUCT optional_name */ yytestcase(yyruleno
==44);
2432 case 45: /* union_name ::= UNION optional_name */ yytestcase(yyruleno
==45);
2433 #line 412 "src/parser_proc.y"
2435 if (yymsp
[0].minor
.yy0
) {
2436 yylhsminor
.yy0
= yymsp
[0].minor
.yy0
;
2437 free(yymsp
[-1].minor
.yy0
);
2440 psi_token_hash(yymsp
[-1].minor
.yy0
, digest
);
2441 yylhsminor
.yy0
= psi_token_append("@", yymsp
[-1].minor
.yy0
, 1, digest
);
2444 #line 2445 "src/parser_proc.c"
2445 yymsp
[-1].minor
.yy0
= yylhsminor
.yy0
;
2447 case 46: /* decl_enum ::= enum_name LBRACE decl_enum_items RBRACE */
2448 #line 442 "src/parser_proc.y"
2450 yylhsminor
.yy323
= psi_decl_enum_init(yymsp
[-3].minor
.yy0
->text
, yymsp
[-1].minor
.yy179
);
2451 yylhsminor
.yy323
->token
= yymsp
[-3].minor
.yy0
;
2453 #line 2454 "src/parser_proc.c"
2454 yy_destructor(yypParser
,96,&yymsp
[-2].minor
);
2455 yy_destructor(yypParser
,97,&yymsp
[0].minor
);
2456 yymsp
[-3].minor
.yy323
= yylhsminor
.yy323
;
2458 case 47: /* decl_enum_items ::= decl_enum_item */
2459 #line 446 "src/parser_proc.y"
2461 yylhsminor
.yy179
= psi_plist_add(psi_plist_init((psi_plist_dtor
) psi_decl_enum_item_free
),
2462 &yymsp
[0].minor
.yy169
);
2464 #line 2465 "src/parser_proc.c"
2465 yymsp
[0].minor
.yy179
= yylhsminor
.yy179
;
2467 case 48: /* decl_enum_items ::= decl_enum_items COMMA decl_enum_item */
2468 #line 450 "src/parser_proc.y"
2470 yylhsminor
.yy179
= psi_plist_add(yymsp
[-2].minor
.yy179
, &yymsp
[0].minor
.yy169
);
2472 #line 2473 "src/parser_proc.c"
2473 yy_destructor(yypParser
,88,&yymsp
[-1].minor
);
2474 yymsp
[-2].minor
.yy179
= yylhsminor
.yy179
;
2476 case 49: /* decl_enum_item ::= NAME EQUALS num_exp */
2477 #line 453 "src/parser_proc.y"
2479 yylhsminor
.yy169
= psi_decl_enum_item_init(yymsp
[-2].minor
.yy0
->text
, yymsp
[0].minor
.yy207
);
2480 yylhsminor
.yy169
->token
= yymsp
[-2].minor
.yy0
;
2482 #line 2483 "src/parser_proc.c"
2483 yy_destructor(yypParser
,98,&yymsp
[-1].minor
);
2484 yymsp
[-2].minor
.yy169
= yylhsminor
.yy169
;
2486 case 50: /* decl_enum_item ::= NAME */
2487 #line 457 "src/parser_proc.y"
2489 yylhsminor
.yy169
= psi_decl_enum_item_init(yymsp
[0].minor
.yy0
->text
, NULL
);
2490 yylhsminor
.yy169
->token
= yymsp
[0].minor
.yy0
;
2492 #line 2493 "src/parser_proc.c"
2493 yymsp
[0].minor
.yy169
= yylhsminor
.yy169
;
2495 case 51: /* decl_struct_args_block ::= LBRACE struct_args RBRACE */
2496 { yy_destructor(yypParser
,96,&yymsp
[-2].minor
);
2497 #line 461 "src/parser_proc.y"
2499 yymsp
[-2].minor
.yy179
= yymsp
[-1].minor
.yy179
;
2501 #line 2502 "src/parser_proc.c"
2502 yy_destructor(yypParser
,97,&yymsp
[0].minor
);
2505 case 52: /* decl_struct_args ::= decl_struct_args_block */
2506 #line 464 "src/parser_proc.y"
2508 yylhsminor
.yy179
= yymsp
[0].minor
.yy179
;
2510 #line 2511 "src/parser_proc.c"
2511 yymsp
[0].minor
.yy179
= yylhsminor
.yy179
;
2513 case 53: /* decl_struct_args ::= EOS */
2514 { yy_destructor(yypParser
,75,&yymsp
[0].minor
);
2515 #line 467 "src/parser_proc.y"
2517 yymsp
[0].minor
.yy179
= psi_plist_init((psi_plist_dtor
) psi_decl_arg_free
);
2519 #line 2520 "src/parser_proc.c"
2522 case 54: /* decl_struct ::= STRUCT NAME align_and_size decl_struct_args */
2523 { yy_destructor(yypParser
,94,&yymsp
[-3].minor
);
2524 #line 470 "src/parser_proc.y"
2526 yymsp
[-3].minor
.yy324
= psi_decl_struct_init(yymsp
[-2].minor
.yy0
->text
, yymsp
[0].minor
.yy179
);
2527 yymsp
[-3].minor
.yy324
->align
= yymsp
[-1].minor
.yy239
.pos
;
2528 yymsp
[-3].minor
.yy324
->size
= yymsp
[-1].minor
.yy239
.len
;
2529 yymsp
[-3].minor
.yy324
->token
= yymsp
[-2].minor
.yy0
;
2531 #line 2532 "src/parser_proc.c"
2534 case 55: /* decl_union ::= UNION NAME align_and_size decl_struct_args */
2535 { yy_destructor(yypParser
,95,&yymsp
[-3].minor
);
2536 #line 476 "src/parser_proc.y"
2538 yymsp
[-3].minor
.yy15
= psi_decl_union_init(yymsp
[-2].minor
.yy0
->text
, yymsp
[0].minor
.yy179
);
2539 yymsp
[-3].minor
.yy15
->align
= yymsp
[-1].minor
.yy239
.pos
;
2540 yymsp
[-3].minor
.yy15
->size
= yymsp
[-1].minor
.yy239
.len
;
2541 yymsp
[-3].minor
.yy15
->token
= yymsp
[-2].minor
.yy0
;
2543 #line 2544 "src/parser_proc.c"
2546 case 56: /* const_type ::= BOOL|INT|FLOAT|STRING */
2547 #line 482 "src/parser_proc.y"
2549 yylhsminor
.yy351
= psi_const_type_init(yymsp
[0].minor
.yy0
->type
, yymsp
[0].minor
.yy0
->text
);
2550 free(yymsp
[0].minor
.yy0
);
2552 #line 2553 "src/parser_proc.c"
2553 yymsp
[0].minor
.yy351
= yylhsminor
.yy351
;
2555 case 57: /* constant ::= CONST const_type NSNAME EQUALS impl_def_val EOS */
2556 { yy_destructor(yypParser
,99,&yymsp
[-5].minor
);
2557 #line 486 "src/parser_proc.y"
2559 yymsp
[-5].minor
.yy38
= psi_const_init(yymsp
[-4].minor
.yy351
, yymsp
[-3].minor
.yy0
->text
, yymsp
[-1].minor
.yy145
);
2560 yymsp
[-5].minor
.yy38
->token
= yymsp
[-3].minor
.yy0
;
2562 #line 2563 "src/parser_proc.c"
2563 yy_destructor(yypParser
,98,&yymsp
[-2].minor
);
2564 yy_destructor(yypParser
,75,&yymsp
[0].minor
);
2567 case 58: /* decl_typedef ::= TYPEDEF decl_typedef_body EOS */
2568 #line 490 "src/parser_proc.y"
2570 yylhsminor
.yy320
= yymsp
[-1].minor
.yy320
;
2571 yylhsminor
.yy320
->token
= yymsp
[-2].minor
.yy0
;
2573 #line 2574 "src/parser_proc.c"
2574 yy_destructor(yypParser
,75,&yymsp
[0].minor
);
2575 yymsp
[-2].minor
.yy320
= yylhsminor
.yy320
;
2577 case 59: /* decl_typedef_body_ex ::= struct_name align_and_size decl_struct_args_block decl_var */
2578 #line 494 "src/parser_proc.y"
2580 yylhsminor
.yy320
= psi_decl_arg_init(psi_decl_type_init(PSI_T_STRUCT
, yymsp
[-3].minor
.yy0
->text
), yymsp
[0].minor
.yy271
);
2581 yylhsminor
.yy320
->type
->token
= psi_token_copy(yymsp
[-3].minor
.yy0
);
2582 yylhsminor
.yy320
->type
->real
.strct
= psi_decl_struct_init(yymsp
[-3].minor
.yy0
->text
, yymsp
[-1].minor
.yy179
);
2583 yylhsminor
.yy320
->type
->real
.strct
->token
= yymsp
[-3].minor
.yy0
;
2584 yylhsminor
.yy320
->type
->real
.strct
->align
= yymsp
[-2].minor
.yy239
.pos
;
2585 yylhsminor
.yy320
->type
->real
.strct
->size
= yymsp
[-2].minor
.yy239
.len
;
2587 #line 2588 "src/parser_proc.c"
2588 yymsp
[-3].minor
.yy320
= yylhsminor
.yy320
;
2590 case 60: /* decl_typedef_body_ex ::= union_name align_and_size decl_struct_args_block decl_var */
2591 #line 502 "src/parser_proc.y"
2593 yylhsminor
.yy320
= psi_decl_arg_init(psi_decl_type_init(PSI_T_UNION
, yymsp
[-3].minor
.yy0
->text
), yymsp
[0].minor
.yy271
);
2594 yylhsminor
.yy320
->type
->token
= psi_token_copy(yymsp
[-3].minor
.yy0
);
2595 yylhsminor
.yy320
->type
->real
.unn
= psi_decl_union_init(yymsp
[-3].minor
.yy0
->text
, yymsp
[-1].minor
.yy179
);
2596 yylhsminor
.yy320
->type
->real
.unn
->token
= yymsp
[-3].minor
.yy0
;
2597 yylhsminor
.yy320
->type
->real
.unn
->align
= yymsp
[-2].minor
.yy239
.pos
;
2598 yylhsminor
.yy320
->type
->real
.unn
->size
= yymsp
[-2].minor
.yy239
.len
;
2600 #line 2601 "src/parser_proc.c"
2601 yymsp
[-3].minor
.yy320
= yylhsminor
.yy320
;
2603 case 61: /* decl_typedef_body_ex ::= decl_enum NAME */
2604 #line 510 "src/parser_proc.y"
2606 yylhsminor
.yy320
= psi_decl_arg_init(psi_decl_type_init(PSI_T_ENUM
, yymsp
[-1].minor
.yy323
->name
), psi_decl_var_init(yymsp
[0].minor
.yy0
->text
, 0, 0));
2607 yylhsminor
.yy320
->var
->token
= yymsp
[0].minor
.yy0
;
2608 yylhsminor
.yy320
->type
->token
= psi_token_copy(yymsp
[-1].minor
.yy323
->token
);
2609 yylhsminor
.yy320
->type
->real
.enm
= yymsp
[-1].minor
.yy323
;
2611 #line 2612 "src/parser_proc.c"
2612 yymsp
[-1].minor
.yy320
= yylhsminor
.yy320
;
2614 case 62: /* decl_typedef_body ::= decl_typedef_body_ex */
2615 case 65: /* decl_typedef_body ::= decl_arg */ yytestcase(yyruleno
==65);
2616 case 68: /* decl_func ::= decl_arg */ yytestcase(yyruleno
==68);
2617 #line 516 "src/parser_proc.y"
2619 yylhsminor
.yy320
= yymsp
[0].minor
.yy320
;
2621 #line 2622 "src/parser_proc.c"
2622 yymsp
[0].minor
.yy320
= yylhsminor
.yy320
;
2624 case 63: /* decl_typedef_body_fn_args ::= LPAREN decl_args RPAREN */
2625 { yy_destructor(yypParser
,86,&yymsp
[-2].minor
);
2626 #line 519 "src/parser_proc.y"
2628 yymsp
[-2].minor
.yy179
= yymsp
[-1].minor
.yy179
;
2630 #line 2631 "src/parser_proc.c"
2631 yy_destructor(yypParser
,87,&yymsp
[0].minor
);
2634 case 64: /* decl_typedef_body ::= decl_func decl_typedef_body_fn_args */
2635 #line 522 "src/parser_proc.y"
2637 yylhsminor
.yy320
= psi_decl_arg_init(psi_decl_type_init(PSI_T_FUNCTION
, yymsp
[-1].minor
.yy320
->var
->name
), psi_decl_var_copy(yymsp
[-1].minor
.yy320
->var
));
2638 yylhsminor
.yy320
->type
->token
= psi_token_copy(yymsp
[-1].minor
.yy320
->token
);
2639 yylhsminor
.yy320
->type
->real
.func
= psi_decl_init(psi_decl_abi_init("default"), yymsp
[-1].minor
.yy320
, yymsp
[0].minor
.yy179
);
2641 #line 2642 "src/parser_proc.c"
2642 yymsp
[-1].minor
.yy320
= yylhsminor
.yy320
;
2644 case 66: /* decl ::= decl_abi decl_func LPAREN decl_args RPAREN EOS */
2645 #line 530 "src/parser_proc.y"
2647 yylhsminor
.yy303
= psi_decl_init(yymsp
[-5].minor
.yy26
, yymsp
[-4].minor
.yy320
, yymsp
[-2].minor
.yy179
);
2649 #line 2650 "src/parser_proc.c"
2650 yy_destructor(yypParser
,86,&yymsp
[-3].minor
);
2651 yy_destructor(yypParser
,87,&yymsp
[-1].minor
);
2652 yy_destructor(yypParser
,75,&yymsp
[0].minor
);
2653 yymsp
[-5].minor
.yy303
= yylhsminor
.yy303
;
2655 case 67: /* decl ::= decl_abi decl_func LPAREN decl_args COMMA ELLIPSIS RPAREN EOS */
2656 #line 533 "src/parser_proc.y"
2658 yylhsminor
.yy303
= psi_decl_init(yymsp
[-7].minor
.yy26
, yymsp
[-6].minor
.yy320
, yymsp
[-4].minor
.yy179
);
2659 yylhsminor
.yy303
->varargs
= 1;
2661 #line 2662 "src/parser_proc.c"
2662 yy_destructor(yypParser
,86,&yymsp
[-5].minor
);
2663 yy_destructor(yypParser
,88,&yymsp
[-3].minor
);
2664 yy_destructor(yypParser
,101,&yymsp
[-2].minor
);
2665 yy_destructor(yypParser
,87,&yymsp
[-1].minor
);
2666 yy_destructor(yypParser
,75,&yymsp
[0].minor
);
2667 yymsp
[-7].minor
.yy303
= yylhsminor
.yy303
;
2669 case 69: /* decl_func ::= VOID NAME */
2670 #line 540 "src/parser_proc.y"
2672 yylhsminor
.yy320
= psi_decl_arg_init(
2673 psi_decl_type_init(yymsp
[-1].minor
.yy0
->type
, yymsp
[-1].minor
.yy0
->text
),
2674 psi_decl_var_init(yymsp
[0].minor
.yy0
->text
, 0, 0)
2676 yylhsminor
.yy320
->type
->token
= yymsp
[-1].minor
.yy0
;
2677 yylhsminor
.yy320
->var
->token
= yymsp
[0].minor
.yy0
;
2678 yylhsminor
.yy320
->token
= yymsp
[0].minor
.yy0
;
2680 #line 2681 "src/parser_proc.c"
2681 yymsp
[-1].minor
.yy320
= yylhsminor
.yy320
;
2683 case 70: /* decl_typedef_body ::= VOID indirection LPAREN indirection NAME RPAREN decl_typedef_body_fn_args */
2684 #line 549 "src/parser_proc.y"
2686 struct psi_decl_arg
*func_
= psi_decl_arg_init(
2687 psi_decl_type_init(yymsp
[-6].minor
.yy0
->type
, yymsp
[-6].minor
.yy0
->text
),
2688 psi_decl_var_init(yymsp
[-2].minor
.yy0
->text
, yymsp
[-5].minor
.yy382
, 0)
2690 func_
->type
->token
= yymsp
[-6].minor
.yy0
;
2691 func_
->var
->token
= yymsp
[-2].minor
.yy0
;
2692 func_
->token
= yymsp
[-2].minor
.yy0
;
2693 yylhsminor
.yy320
= psi_decl_arg_init(
2694 psi_decl_type_init(PSI_T_FUNCTION
, func_
->var
->name
),
2695 psi_decl_var_copy(func_
->var
)
2697 yylhsminor
.yy320
->var
->pointer_level
= yymsp
[-3].minor
.yy382
;
2698 yylhsminor
.yy320
->type
->token
= psi_token_copy(func_
->token
);
2699 yylhsminor
.yy320
->type
->real
.func
= psi_decl_init(psi_decl_abi_init("default"), func_
, yymsp
[0].minor
.yy179
);
2701 #line 2702 "src/parser_proc.c"
2702 yy_destructor(yypParser
,86,&yymsp
[-4].minor
);
2703 yy_destructor(yypParser
,87,&yymsp
[-1].minor
);
2704 yymsp
[-6].minor
.yy320
= yylhsminor
.yy320
;
2706 case 71: /* decl_typedef_body ::= CONST VOID pointers LPAREN indirection NAME RPAREN decl_typedef_body_fn_args */
2707 { yy_destructor(yypParser
,99,&yymsp
[-7].minor
);
2708 #line 565 "src/parser_proc.y"
2710 struct psi_decl_arg
*func_
= psi_decl_arg_init(
2711 psi_decl_type_init(yymsp
[-6].minor
.yy0
->type
, yymsp
[-6].minor
.yy0
->text
),
2712 psi_decl_var_init(yymsp
[-2].minor
.yy0
->text
, yymsp
[-5].minor
.yy382
, 0)
2714 func_
->type
->token
= yymsp
[-6].minor
.yy0
;
2715 func_
->var
->token
= yymsp
[-2].minor
.yy0
;
2716 func_
->token
= yymsp
[-2].minor
.yy0
;
2717 yymsp
[-7].minor
.yy320
= psi_decl_arg_init(
2718 psi_decl_type_init(PSI_T_FUNCTION
, func_
->var
->name
),
2719 psi_decl_var_copy(func_
->var
)
2721 yymsp
[-7].minor
.yy320
->var
->pointer_level
= yymsp
[-3].minor
.yy382
;
2722 yymsp
[-7].minor
.yy320
->type
->token
= psi_token_copy(func_
->token
);
2723 yymsp
[-7].minor
.yy320
->type
->real
.func
= psi_decl_init(psi_decl_abi_init("default"), func_
, yymsp
[0].minor
.yy179
);
2725 #line 2726 "src/parser_proc.c"
2726 yy_destructor(yypParser
,86,&yymsp
[-4].minor
);
2727 yy_destructor(yypParser
,87,&yymsp
[-1].minor
);
2730 case 72: /* decl_abi ::= NAME */
2731 #line 581 "src/parser_proc.y"
2733 yylhsminor
.yy26
= psi_decl_abi_init(yymsp
[0].minor
.yy0
->text
);
2734 yylhsminor
.yy26
->token
= yymsp
[0].minor
.yy0
;
2736 #line 2737 "src/parser_proc.c"
2737 yymsp
[0].minor
.yy26
= yylhsminor
.yy26
;
2739 case 74: /* decl_var_array_size ::= LBRACKET NUMBER RBRACKET */
2740 { yy_destructor(yypParser
,102,&yymsp
[-2].minor
);
2741 #line 588 "src/parser_proc.y"
2743 yymsp
[-2].minor
.yy0
= yymsp
[-1].minor
.yy0
;
2745 #line 2746 "src/parser_proc.c"
2746 yy_destructor(yypParser
,103,&yymsp
[0].minor
);
2749 case 75: /* decl_var ::= NAME decl_var_array_size */
2750 #line 591 "src/parser_proc.y"
2752 yylhsminor
.yy271
= psi_decl_var_init(yymsp
[-1].minor
.yy0
->text
, 0, yymsp
[0].minor
.yy0
?atol(yymsp
[0].minor
.yy0
->text
):0);
2753 yylhsminor
.yy271
->token
= yymsp
[-1].minor
.yy0
;
2754 if (yymsp
[0].minor
.yy0
) {
2755 free(yymsp
[0].minor
.yy0
);
2758 #line 2759 "src/parser_proc.c"
2759 yymsp
[-1].minor
.yy271
= yylhsminor
.yy271
;
2761 case 76: /* decl_var ::= pointers NAME decl_var_array_size */
2762 #line 598 "src/parser_proc.y"
2764 yylhsminor
.yy271
= psi_decl_var_init(yymsp
[-1].minor
.yy0
->text
, yymsp
[-2].minor
.yy382
+!!yymsp
[0].minor
.yy0
, yymsp
[0].minor
.yy0
?atol(yymsp
[0].minor
.yy0
->text
):0);
2765 yylhsminor
.yy271
->token
= yymsp
[-1].minor
.yy0
;
2766 if (yymsp
[0].minor
.yy0
) {
2767 free(yymsp
[0].minor
.yy0
);
2770 #line 2771 "src/parser_proc.c"
2771 yymsp
[-2].minor
.yy271
= yylhsminor
.yy271
;
2773 case 77: /* decl_vars ::= decl_var */
2774 #line 605 "src/parser_proc.y"
2776 yylhsminor
.yy179
= psi_plist_add(psi_plist_init((psi_plist_dtor
) psi_decl_var_free
),
2777 &yymsp
[0].minor
.yy271
);
2779 #line 2780 "src/parser_proc.c"
2780 yymsp
[0].minor
.yy179
= yylhsminor
.yy179
;
2782 case 78: /* decl_vars ::= decl_vars COMMA decl_var */
2783 #line 609 "src/parser_proc.y"
2785 yylhsminor
.yy179
= psi_plist_add(yymsp
[-2].minor
.yy179
, &yymsp
[0].minor
.yy271
);
2787 #line 2788 "src/parser_proc.c"
2788 yy_destructor(yypParser
,88,&yymsp
[-1].minor
);
2789 yymsp
[-2].minor
.yy179
= yylhsminor
.yy179
;
2791 case 79: /* decl_arg ::= const_decl_type decl_var */
2792 #line 612 "src/parser_proc.y"
2794 yylhsminor
.yy320
= psi_decl_arg_init(yymsp
[-1].minor
.yy172
, yymsp
[0].minor
.yy271
);
2796 #line 2797 "src/parser_proc.c"
2797 yymsp
[-1].minor
.yy320
= yylhsminor
.yy320
;
2799 case 80: /* decl_typedef_body ::= const_decl_type indirection LPAREN indirection NAME RPAREN decl_typedef_body_fn_args */
2800 #line 615 "src/parser_proc.y"
2802 struct psi_decl_arg
*func_
= psi_decl_arg_init(
2803 yymsp
[-6].minor
.yy172
,
2804 psi_decl_var_init(yymsp
[-2].minor
.yy0
->text
, yymsp
[-5].minor
.yy382
, 0)
2806 func_
->var
->token
= yymsp
[-2].minor
.yy0
;
2807 func_
->token
= yymsp
[-2].minor
.yy0
;
2808 yylhsminor
.yy320
= psi_decl_arg_init(
2809 psi_decl_type_init(PSI_T_FUNCTION
, func_
->var
->name
),
2810 psi_decl_var_copy(func_
->var
)
2812 yylhsminor
.yy320
->var
->pointer_level
= yymsp
[-3].minor
.yy382
;
2813 yylhsminor
.yy320
->type
->token
= psi_token_copy(func_
->token
);
2814 yylhsminor
.yy320
->type
->real
.func
= psi_decl_init(psi_decl_abi_init("default"), func_
, yymsp
[0].minor
.yy179
);
2816 #line 2817 "src/parser_proc.c"
2817 yy_destructor(yypParser
,86,&yymsp
[-4].minor
);
2818 yy_destructor(yypParser
,87,&yymsp
[-1].minor
);
2819 yymsp
[-6].minor
.yy320
= yylhsminor
.yy320
;
2821 case 81: /* decl_arg ::= VOID pointers NAME */
2822 #line 630 "src/parser_proc.y"
2824 yylhsminor
.yy320
= psi_decl_arg_init(
2825 psi_decl_type_init(yymsp
[-2].minor
.yy0
->type
, yymsp
[-2].minor
.yy0
->text
),
2826 psi_decl_var_init(yymsp
[0].minor
.yy0
->text
, yymsp
[-1].minor
.yy382
, 0)
2828 yylhsminor
.yy320
->type
->token
= yymsp
[-2].minor
.yy0
;
2829 yylhsminor
.yy320
->var
->token
= yymsp
[0].minor
.yy0
;
2830 yylhsminor
.yy320
->token
= yymsp
[0].minor
.yy0
;
2832 #line 2833 "src/parser_proc.c"
2833 yymsp
[-2].minor
.yy320
= yylhsminor
.yy320
;
2835 case 82: /* decl_arg ::= CONST VOID pointers NAME */
2836 { yy_destructor(yypParser
,99,&yymsp
[-3].minor
);
2837 #line 639 "src/parser_proc.y"
2839 yymsp
[-3].minor
.yy320
= psi_decl_arg_init(
2840 psi_decl_type_init(yymsp
[-2].minor
.yy0
->type
, yymsp
[-2].minor
.yy0
->text
),
2841 psi_decl_var_init(yymsp
[0].minor
.yy0
->text
, yymsp
[-1].minor
.yy382
, 0)
2843 yymsp
[-3].minor
.yy320
->type
->token
= yymsp
[-2].minor
.yy0
;
2844 yymsp
[-3].minor
.yy320
->var
->token
= yymsp
[0].minor
.yy0
;
2845 yymsp
[-3].minor
.yy320
->token
= yymsp
[0].minor
.yy0
;
2847 #line 2848 "src/parser_proc.c"
2850 case 84: /* decl_args ::= VOID */
2851 { yy_destructor(yypParser
,57,&yymsp
[0].minor
);
2852 #line 651 "src/parser_proc.y"
2854 yymsp
[0].minor
.yy179
= NULL
;
2856 #line 2857 "src/parser_proc.c"
2859 case 85: /* decl_args ::= decl_arg */
2860 case 87: /* struct_args ::= struct_arg */ yytestcase(yyruleno
==87);
2861 #line 654 "src/parser_proc.y"
2863 yylhsminor
.yy179
= psi_plist_add(psi_plist_init((psi_plist_dtor
) psi_decl_arg_free
),
2864 &yymsp
[0].minor
.yy320
);
2866 #line 2867 "src/parser_proc.c"
2867 yymsp
[0].minor
.yy179
= yylhsminor
.yy179
;
2869 case 86: /* decl_args ::= decl_args COMMA decl_arg */
2870 #line 658 "src/parser_proc.y"
2872 yylhsminor
.yy179
= psi_plist_add(yymsp
[-2].minor
.yy179
, &yymsp
[0].minor
.yy320
);
2874 #line 2875 "src/parser_proc.c"
2875 yy_destructor(yypParser
,88,&yymsp
[-1].minor
);
2876 yymsp
[-2].minor
.yy179
= yylhsminor
.yy179
;
2878 case 88: /* struct_args ::= struct_args struct_arg */
2879 #line 665 "src/parser_proc.y"
2881 yylhsminor
.yy179
= psi_plist_add(yymsp
[-1].minor
.yy179
, &yymsp
[0].minor
.yy320
);
2883 #line 2884 "src/parser_proc.c"
2884 yymsp
[-1].minor
.yy179
= yylhsminor
.yy179
;
2886 case 89: /* struct_arg ::= decl_typedef_body_ex EOS */
2887 #line 668 "src/parser_proc.y"
2889 yylhsminor
.yy320
= yymsp
[-1].minor
.yy320
;
2890 switch (yymsp
[-1].minor
.yy320
->type
->type
) {
2892 if (yymsp
[-1].minor
.yy320
->type
->real
.strct
) {
2894 P
->structs
= psi_plist_init((psi_plist_dtor
) psi_decl_struct_free
);
2896 P
->structs
= psi_plist_add(P
->structs
, &yymsp
[-1].minor
.yy320
->type
->real
.strct
);
2900 if (yymsp
[-1].minor
.yy320
->type
->real
.unn
) {
2902 P
->unions
= psi_plist_init((psi_plist_dtor
) psi_decl_union_free
);
2904 P
->unions
= psi_plist_add(P
->unions
, &yymsp
[-1].minor
.yy320
->type
->real
.unn
);
2908 if (yymsp
[-1].minor
.yy320
->type
->real
.enm
) {
2910 P
->enums
= psi_plist_init((psi_plist_dtor
) psi_decl_enum_free
);
2912 P
->enums
= psi_plist_add(P
->enums
, &yymsp
[-1].minor
.yy320
->type
->real
.enm
);
2917 #line 2918 "src/parser_proc.c"
2918 yy_destructor(yypParser
,75,&yymsp
[0].minor
);
2919 yymsp
[-1].minor
.yy320
= yylhsminor
.yy320
;
2921 case 90: /* struct_arg ::= decl_arg decl_layout EOS */
2922 #line 697 "src/parser_proc.y"
2924 yymsp
[-2].minor
.yy320
->layout
= yymsp
[-1].minor
.yy369
;
2925 yylhsminor
.yy320
= yymsp
[-2].minor
.yy320
;
2927 #line 2928 "src/parser_proc.c"
2928 yy_destructor(yypParser
,75,&yymsp
[0].minor
);
2929 yymsp
[-2].minor
.yy320
= yylhsminor
.yy320
;
2931 case 91: /* decl_layout ::= */
2932 #line 701 "src/parser_proc.y"
2934 yymsp
[1].minor
.yy369
= NULL
;
2936 #line 2937 "src/parser_proc.c"
2938 case 92: /* decl_layout ::= COLON COLON LPAREN NUMBER COMMA NUMBER RPAREN */
2939 { yy_destructor(yypParser
,92,&yymsp
[-6].minor
);
2940 #line 704 "src/parser_proc.y"
2942 yymsp
[-6].minor
.yy369
= psi_layout_init(atol(yymsp
[-3].minor
.yy0
->text
), atol(yymsp
[-1].minor
.yy0
->text
));
2943 free(yymsp
[-3].minor
.yy0
);
2944 free(yymsp
[-1].minor
.yy0
);
2946 #line 2947 "src/parser_proc.c"
2947 yy_destructor(yypParser
,92,&yymsp
[-5].minor
);
2948 yy_destructor(yypParser
,86,&yymsp
[-4].minor
);
2949 yy_destructor(yypParser
,88,&yymsp
[-2].minor
);
2950 yy_destructor(yypParser
,87,&yymsp
[0].minor
);
2953 case 94: /* decl_scalar_type ::= SHORT decl_scalar_type_short */
2954 case 98: /* decl_scalar_type ::= LONG decl_scalar_type_long */ yytestcase(yyruleno
==98);
2955 case 101: /* decl_scalar_type_long ::= LONG decl_scalar_type_long_long */ yytestcase(yyruleno
==101);
2956 #line 712 "src/parser_proc.y"
2958 if (yymsp
[0].minor
.yy0
) {
2959 yylhsminor
.yy0
= psi_token_cat(" ", 2, yymsp
[-1].minor
.yy0
, yymsp
[0].minor
.yy0
);
2960 free(yymsp
[-1].minor
.yy0
);
2961 free(yymsp
[0].minor
.yy0
);
2963 yylhsminor
.yy0
= yymsp
[-1].minor
.yy0
;
2966 #line 2967 "src/parser_proc.c"
2967 yymsp
[-1].minor
.yy0
= yylhsminor
.yy0
;
2969 case 104: /* decl_type ::= UNSIGNED decl_scalar_type */
2970 case 105: /* decl_type ::= SIGNED decl_scalar_type */ yytestcase(yyruleno
==105);
2971 #line 760 "src/parser_proc.y"
2973 struct psi_token
*T
= psi_token_cat(" ", 2, yymsp
[-1].minor
.yy0
, yymsp
[0].minor
.yy0
);
2974 yylhsminor
.yy172
= psi_decl_type_init(T
->type
, T
->text
);
2975 yylhsminor
.yy172
->token
= T
;
2976 free(yymsp
[-1].minor
.yy0
);
2977 free(yymsp
[0].minor
.yy0
);
2979 #line 2980 "src/parser_proc.c"
2980 yymsp
[-1].minor
.yy172
= yylhsminor
.yy172
;
2982 case 106: /* decl_type ::= UNSIGNED */
2983 case 107: /* decl_type ::= SIGNED */ yytestcase(yyruleno
==107);
2984 #line 774 "src/parser_proc.y"
2986 yylhsminor
.yy172
= psi_decl_type_init(PSI_T_NAME
, yymsp
[0].minor
.yy0
->text
);
2987 yylhsminor
.yy172
->token
= yymsp
[0].minor
.yy0
;
2989 #line 2990 "src/parser_proc.c"
2990 yymsp
[0].minor
.yy172
= yylhsminor
.yy172
;
2992 case 108: /* decl_type ::= decl_scalar_type */
2993 case 112: /* decl_type ::= FLOAT|DOUBLE|INT8|UINT8|INT16|UINT16|INT32|UINT32|INT64|UINT64|NAME */ yytestcase(yyruleno
==112);
2994 #line 782 "src/parser_proc.y"
2996 yylhsminor
.yy172
= psi_decl_type_init(yymsp
[0].minor
.yy0
->type
, yymsp
[0].minor
.yy0
->text
);
2997 yylhsminor
.yy172
->token
= yymsp
[0].minor
.yy0
;
2999 #line 3000 "src/parser_proc.c"
3000 yymsp
[0].minor
.yy172
= yylhsminor
.yy172
;
3002 case 109: /* decl_type ::= STRUCT NAME */
3003 case 110: /* decl_type ::= UNION NAME */ yytestcase(yyruleno
==110);
3004 case 111: /* decl_type ::= ENUM NAME */ yytestcase(yyruleno
==111);
3005 #line 786 "src/parser_proc.y"
3007 yylhsminor
.yy172
= psi_decl_type_init(yymsp
[-1].minor
.yy0
->type
, yymsp
[0].minor
.yy0
->text
);
3008 yylhsminor
.yy172
->token
= yymsp
[0].minor
.yy0
;
3009 free(yymsp
[-1].minor
.yy0
);
3011 #line 3012 "src/parser_proc.c"
3012 yymsp
[-1].minor
.yy172
= yylhsminor
.yy172
;
3014 case 113: /* const_decl_type ::= decl_type */
3015 #line 805 "src/parser_proc.y"
3017 yylhsminor
.yy172
= yymsp
[0].minor
.yy172
;
3019 #line 3020 "src/parser_proc.c"
3020 yymsp
[0].minor
.yy172
= yylhsminor
.yy172
;
3022 case 114: /* const_decl_type ::= CONST decl_type */
3023 { yy_destructor(yypParser
,99,&yymsp
[-1].minor
);
3024 #line 808 "src/parser_proc.y"
3026 yymsp
[-1].minor
.yy172
= yymsp
[0].minor
.yy172
;
3028 #line 3029 "src/parser_proc.c"
3031 case 115: /* impl ::= impl_func LBRACE impl_stmts RBRACE */
3032 #line 811 "src/parser_proc.y"
3034 yylhsminor
.yy49
= psi_impl_init(yymsp
[-3].minor
.yy56
, yymsp
[-1].minor
.yy179
);
3036 #line 3037 "src/parser_proc.c"
3037 yy_destructor(yypParser
,96,&yymsp
[-2].minor
);
3038 yy_destructor(yypParser
,97,&yymsp
[0].minor
);
3039 yymsp
[-3].minor
.yy49
= yylhsminor
.yy49
;
3041 case 116: /* impl ::= STATIC impl_func LBRACE impl_stmts RBRACE */
3042 { yy_destructor(yypParser
,109,&yymsp
[-4].minor
);
3043 #line 814 "src/parser_proc.y"
3045 yymsp
[-3].minor
.yy56
->static_memory
= 1;
3046 yymsp
[-4].minor
.yy49
= psi_impl_init(yymsp
[-3].minor
.yy56
, yymsp
[-1].minor
.yy179
);
3048 #line 3049 "src/parser_proc.c"
3049 yy_destructor(yypParser
,96,&yymsp
[-2].minor
);
3050 yy_destructor(yypParser
,97,&yymsp
[0].minor
);
3053 case 117: /* impl_func ::= FUNCTION reference NSNAME LPAREN RPAREN COLON impl_type */
3054 { yy_destructor(yypParser
,110,&yymsp
[-6].minor
);
3055 #line 818 "src/parser_proc.y"
3057 yymsp
[-6].minor
.yy56
= psi_impl_func_init(yymsp
[-4].minor
.yy0
->text
, NULL
, yymsp
[0].minor
.yy246
);
3058 yymsp
[-6].minor
.yy56
->token
= yymsp
[-4].minor
.yy0
;
3059 yymsp
[-6].minor
.yy56
->return_reference
= yymsp
[-5].minor
.yy89
;
3061 #line 3062 "src/parser_proc.c"
3062 yy_destructor(yypParser
,86,&yymsp
[-3].minor
);
3063 yy_destructor(yypParser
,87,&yymsp
[-2].minor
);
3064 yy_destructor(yypParser
,92,&yymsp
[-1].minor
);
3067 case 118: /* impl_func ::= FUNCTION reference NSNAME LPAREN impl_args RPAREN COLON impl_type */
3068 { yy_destructor(yypParser
,110,&yymsp
[-7].minor
);
3069 #line 823 "src/parser_proc.y"
3071 yymsp
[-7].minor
.yy56
= psi_impl_func_init(yymsp
[-5].minor
.yy0
->text
, yymsp
[-3].minor
.yy179
, yymsp
[0].minor
.yy246
);
3072 yymsp
[-7].minor
.yy56
->token
= yymsp
[-5].minor
.yy0
;
3073 yymsp
[-7].minor
.yy56
->return_reference
= yymsp
[-6].minor
.yy89
;
3075 #line 3076 "src/parser_proc.c"
3076 yy_destructor(yypParser
,86,&yymsp
[-4].minor
);
3077 yy_destructor(yypParser
,87,&yymsp
[-2].minor
);
3078 yy_destructor(yypParser
,92,&yymsp
[-1].minor
);
3081 case 119: /* impl_func ::= FUNCTION reference NSNAME LPAREN impl_args COMMA impl_type reference ELLIPSIS DOLLAR_NAME RPAREN COLON impl_type */
3082 { yy_destructor(yypParser
,110,&yymsp
[-12].minor
);
3083 #line 828 "src/parser_proc.y"
3085 yymsp
[-12].minor
.yy56
= psi_impl_func_init(yymsp
[-10].minor
.yy0
->text
, yymsp
[-8].minor
.yy179
, yymsp
[0].minor
.yy246
);
3086 yymsp
[-12].minor
.yy56
->token
= yymsp
[-10].minor
.yy0
;
3087 yymsp
[-12].minor
.yy56
->return_reference
= yymsp
[-11].minor
.yy89
;
3088 yymsp
[-12].minor
.yy56
->vararg
= psi_impl_arg_init(yymsp
[-6].minor
.yy246
, psi_impl_var_init(yymsp
[-3].minor
.yy0
->text
, yymsp
[-5].minor
.yy89
), NULL
);
3089 free(yymsp
[-3].minor
.yy0
);
3091 #line 3092 "src/parser_proc.c"
3092 yy_destructor(yypParser
,86,&yymsp
[-9].minor
);
3093 yy_destructor(yypParser
,88,&yymsp
[-7].minor
);
3094 yy_destructor(yypParser
,101,&yymsp
[-4].minor
);
3095 yy_destructor(yypParser
,87,&yymsp
[-2].minor
);
3096 yy_destructor(yypParser
,92,&yymsp
[-1].minor
);
3099 case 120: /* impl_def_val ::= NULL|NUMBER|TRUE|FALSE|QUOTED_STRING */
3100 #line 835 "src/parser_proc.y"
3102 yylhsminor
.yy145
= psi_impl_def_val_init(yymsp
[0].minor
.yy0
->type
, yymsp
[0].minor
.yy0
->text
);
3103 yylhsminor
.yy145
->token
= yymsp
[0].minor
.yy0
;
3105 #line 3106 "src/parser_proc.c"
3106 yymsp
[0].minor
.yy145
= yylhsminor
.yy145
;
3108 case 121: /* impl_var ::= reference DOLLAR_NAME */
3109 #line 839 "src/parser_proc.y"
3111 yylhsminor
.yy370
= psi_impl_var_init(yymsp
[0].minor
.yy0
->text
, yymsp
[-1].minor
.yy89
);
3112 yylhsminor
.yy370
->token
= yymsp
[0].minor
.yy0
;
3114 #line 3115 "src/parser_proc.c"
3115 yymsp
[-1].minor
.yy370
= yylhsminor
.yy370
;
3117 case 122: /* impl_type ::= VOID|MIXED|BOOL|INT|FLOAT|STRING|ARRAY|OBJECT|CALLABLE */
3118 #line 843 "src/parser_proc.y"
3120 yylhsminor
.yy246
= psi_impl_type_init(yymsp
[0].minor
.yy0
->type
, yymsp
[0].minor
.yy0
->text
);
3121 free(yymsp
[0].minor
.yy0
);
3123 #line 3124 "src/parser_proc.c"
3124 yymsp
[0].minor
.yy246
= yylhsminor
.yy246
;
3126 case 123: /* impl_arg ::= impl_type impl_var */
3127 #line 847 "src/parser_proc.y"
3129 yylhsminor
.yy34
= psi_impl_arg_init(yymsp
[-1].minor
.yy246
, yymsp
[0].minor
.yy370
, NULL
);
3131 #line 3132 "src/parser_proc.c"
3132 yymsp
[-1].minor
.yy34
= yylhsminor
.yy34
;
3134 case 124: /* impl_arg ::= impl_type impl_var EQUALS impl_def_val */
3135 #line 850 "src/parser_proc.y"
3137 yylhsminor
.yy34
= psi_impl_arg_init(yymsp
[-3].minor
.yy246
, yymsp
[-2].minor
.yy370
, yymsp
[0].minor
.yy145
);
3139 #line 3140 "src/parser_proc.c"
3140 yy_destructor(yypParser
,98,&yymsp
[-1].minor
);
3141 yymsp
[-3].minor
.yy34
= yylhsminor
.yy34
;
3143 case 125: /* impl_args ::= impl_arg */
3144 #line 853 "src/parser_proc.y"
3146 yylhsminor
.yy179
= psi_plist_add(psi_plist_init((psi_plist_dtor
) psi_impl_arg_free
),
3147 &yymsp
[0].minor
.yy34
);
3149 #line 3150 "src/parser_proc.c"
3150 yymsp
[0].minor
.yy179
= yylhsminor
.yy179
;
3152 case 126: /* impl_args ::= impl_args COMMA impl_arg */
3153 #line 857 "src/parser_proc.y"
3155 yylhsminor
.yy179
= psi_plist_add(yymsp
[-2].minor
.yy179
, &yymsp
[0].minor
.yy34
);
3157 #line 3158 "src/parser_proc.c"
3158 yy_destructor(yypParser
,88,&yymsp
[-1].minor
);
3159 yymsp
[-2].minor
.yy179
= yylhsminor
.yy179
;
3161 case 127: /* impl_stmts ::= impl_stmt */
3162 #line 860 "src/parser_proc.y"
3164 yylhsminor
.yy179
= psi_plist_add(psi_plist_init((psi_plist_dtor
) psi_impl_stmt_free
),
3165 &yymsp
[0].minor
.yy238
);
3167 #line 3168 "src/parser_proc.c"
3168 yymsp
[0].minor
.yy179
= yylhsminor
.yy179
;
3170 case 128: /* impl_stmts ::= impl_stmts impl_stmt */
3171 #line 864 "src/parser_proc.y"
3173 yylhsminor
.yy179
= psi_plist_add(yymsp
[-1].minor
.yy179
, &yymsp
[0].minor
.yy238
);
3175 #line 3176 "src/parser_proc.c"
3176 yymsp
[-1].minor
.yy179
= yylhsminor
.yy179
;
3178 case 129: /* impl_stmt ::= return_stmt */
3179 #line 867 "src/parser_proc.y"
3181 yylhsminor
.yy238
= (struct psi_token
**) yymsp
[0].minor
.yy342
;
3183 #line 3184 "src/parser_proc.c"
3184 yymsp
[0].minor
.yy238
= yylhsminor
.yy238
;
3186 case 130: /* impl_stmt ::= let_stmt */
3187 #line 870 "src/parser_proc.y"
3189 yylhsminor
.yy238
= (struct psi_token
**) yymsp
[0].minor
.yy319
;
3191 #line 3192 "src/parser_proc.c"
3192 yymsp
[0].minor
.yy238
= yylhsminor
.yy238
;
3194 case 131: /* impl_stmt ::= set_stmt */
3195 #line 873 "src/parser_proc.y"
3197 yylhsminor
.yy238
= (struct psi_token
**) yymsp
[0].minor
.yy358
;
3199 #line 3200 "src/parser_proc.c"
3200 yymsp
[0].minor
.yy238
= yylhsminor
.yy238
;
3202 case 132: /* impl_stmt ::= assert_stmt */
3203 #line 876 "src/parser_proc.y"
3205 yylhsminor
.yy238
= (struct psi_token
**) yymsp
[0].minor
.yy201
;
3207 #line 3208 "src/parser_proc.c"
3208 yymsp
[0].minor
.yy238
= yylhsminor
.yy238
;
3210 case 133: /* impl_stmt ::= free_stmt */
3211 #line 879 "src/parser_proc.y"
3213 yylhsminor
.yy238
= (struct psi_token
**) yymsp
[0].minor
.yy220
;
3215 #line 3216 "src/parser_proc.c"
3216 yymsp
[0].minor
.yy238
= yylhsminor
.yy238
;
3218 case 134: /* number ::= NUMBER|NSNAME */
3219 #line 882 "src/parser_proc.y"
3221 yylhsminor
.yy57
= psi_number_init(yymsp
[0].minor
.yy0
->type
, yymsp
[0].minor
.yy0
->text
);
3222 yylhsminor
.yy57
->token
= yymsp
[0].minor
.yy0
;
3224 #line 3225 "src/parser_proc.c"
3225 yymsp
[0].minor
.yy57
= yylhsminor
.yy57
;
3227 case 135: /* number ::= decl_var */
3228 #line 886 "src/parser_proc.y"
3230 yylhsminor
.yy57
= psi_number_init(PSI_T_NAME
, yymsp
[0].minor
.yy271
);
3231 yylhsminor
.yy57
->token
= psi_token_copy(yymsp
[0].minor
.yy271
->token
);
3233 #line 3234 "src/parser_proc.c"
3234 yymsp
[0].minor
.yy57
= yylhsminor
.yy57
;
3236 case 136: /* num_exp ::= number */
3237 #line 890 "src/parser_proc.y"
3239 yylhsminor
.yy207
= psi_num_exp_init_num(yymsp
[0].minor
.yy57
);
3240 yylhsminor
.yy207
->token
= psi_token_copy(yymsp
[0].minor
.yy57
->token
);
3242 #line 3243 "src/parser_proc.c"
3243 yymsp
[0].minor
.yy207
= yylhsminor
.yy207
;
3245 case 137: /* num_exp ::= LPAREN num_exp RPAREN */
3246 #line 894 "src/parser_proc.y"
3248 yylhsminor
.yy207
= psi_num_exp_init_unary(PSI_T_LPAREN
, yymsp
[-1].minor
.yy207
);
3249 yylhsminor
.yy207
->token
= yymsp
[-2].minor
.yy0
;
3251 #line 3252 "src/parser_proc.c"
3252 yy_destructor(yypParser
,87,&yymsp
[0].minor
);
3253 yymsp
[-2].minor
.yy207
= yylhsminor
.yy207
;
3255 case 140: /* let_exp ::= NULL */
3256 { yy_destructor(yypParser
,15,&yymsp
[0].minor
);
3257 #line 906 "src/parser_proc.y"
3259 yymsp
[0].minor
.yy200
= psi_let_exp_init(PSI_LET_NULL
, NULL
);
3261 #line 3262 "src/parser_proc.c"
3264 case 141: /* let_exp ::= AMPERSAND NULL */
3265 { yy_destructor(yypParser
,23,&yymsp
[-1].minor
);
3266 #line 909 "src/parser_proc.y"
3268 yymsp
[-1].minor
.yy200
= psi_let_exp_init(PSI_LET_NULL
, NULL
);
3269 yymsp
[-1].minor
.yy200
->is_reference
= 1;
3271 #line 3272 "src/parser_proc.c"
3272 yy_destructor(yypParser
,15,&yymsp
[0].minor
);
3275 case 142: /* let_exp ::= let_callback */
3276 #line 913 "src/parser_proc.y"
3278 yylhsminor
.yy200
= psi_let_exp_init(PSI_LET_CALLBACK
, yymsp
[0].minor
.yy120
);
3280 #line 3281 "src/parser_proc.c"
3281 yymsp
[0].minor
.yy200
= yylhsminor
.yy200
;
3283 case 143: /* let_exp ::= let_calloc */
3284 #line 916 "src/parser_proc.y"
3286 yylhsminor
.yy200
= psi_let_exp_init(PSI_LET_CALLOC
, yymsp
[0].minor
.yy45
);
3288 #line 3289 "src/parser_proc.c"
3289 yymsp
[0].minor
.yy200
= yylhsminor
.yy200
;
3291 case 144: /* let_exp ::= AMPERSAND let_calloc */
3292 { yy_destructor(yypParser
,23,&yymsp
[-1].minor
);
3293 #line 919 "src/parser_proc.y"
3295 yymsp
[-1].minor
.yy200
= psi_let_exp_init(PSI_LET_CALLOC
, yymsp
[0].minor
.yy45
);
3296 yymsp
[-1].minor
.yy200
->is_reference
= 1;
3298 #line 3299 "src/parser_proc.c"
3301 case 145: /* let_exp ::= let_func */
3302 #line 923 "src/parser_proc.y"
3304 yylhsminor
.yy200
= psi_let_exp_init_ex(NULL
, PSI_LET_FUNC
, yymsp
[0].minor
.yy67
);
3306 #line 3307 "src/parser_proc.c"
3307 yymsp
[0].minor
.yy200
= yylhsminor
.yy200
;
3309 case 146: /* let_exp ::= AMPERSAND let_func */
3310 { yy_destructor(yypParser
,23,&yymsp
[-1].minor
);
3311 #line 926 "src/parser_proc.y"
3313 yymsp
[-1].minor
.yy200
= psi_let_exp_init_ex(NULL
, PSI_LET_FUNC
, yymsp
[0].minor
.yy67
);
3314 yymsp
[-1].minor
.yy200
->is_reference
= 1;
3316 #line 3317 "src/parser_proc.c"
3319 case 147: /* let_exp ::= num_exp */
3320 #line 930 "src/parser_proc.y"
3322 yylhsminor
.yy200
= psi_let_exp_init_ex(NULL
, PSI_LET_NUMEXP
, yymsp
[0].minor
.yy207
);
3324 #line 3325 "src/parser_proc.c"
3325 yymsp
[0].minor
.yy200
= yylhsminor
.yy200
;
3327 case 148: /* let_exp ::= AMPERSAND num_exp */
3328 { yy_destructor(yypParser
,23,&yymsp
[-1].minor
);
3329 #line 933 "src/parser_proc.y"
3331 yymsp
[-1].minor
.yy200
= psi_let_exp_init_ex(NULL
, PSI_LET_NUMEXP
, yymsp
[0].minor
.yy207
);
3332 yymsp
[-1].minor
.yy200
->is_reference
= 1;
3334 #line 3335 "src/parser_proc.c"
3337 case 149: /* let_exp ::= decl_var EQUALS let_exp */
3338 #line 937 "src/parser_proc.y"
3340 yylhsminor
.yy200
= yymsp
[0].minor
.yy200
;
3341 yylhsminor
.yy200
->var
= yymsp
[-2].minor
.yy271
;
3343 #line 3344 "src/parser_proc.c"
3344 yy_destructor(yypParser
,98,&yymsp
[-1].minor
);
3345 yymsp
[-2].minor
.yy200
= yylhsminor
.yy200
;
3347 case 150: /* let_stmt ::= LET let_exp EOS */
3348 #line 941 "src/parser_proc.y"
3350 yylhsminor
.yy319
= psi_let_stmt_init(yymsp
[-1].minor
.yy200
);
3351 yylhsminor
.yy319
->token
= yymsp
[-2].minor
.yy0
;
3353 #line 3354 "src/parser_proc.c"
3354 yy_destructor(yypParser
,75,&yymsp
[0].minor
);
3355 yymsp
[-2].minor
.yy319
= yylhsminor
.yy319
;
3357 case 151: /* let_stmt ::= TEMP decl_var EQUALS reference decl_var EOS */
3358 #line 945 "src/parser_proc.y"
3360 yylhsminor
.yy319
= psi_let_stmt_init(psi_let_exp_init_ex(yymsp
[-4].minor
.yy271
, PSI_LET_TMP
, yymsp
[-1].minor
.yy271
));
3361 yylhsminor
.yy319
->token
= yymsp
[-5].minor
.yy0
;
3362 yylhsminor
.yy319
->exp
->is_reference
= yymsp
[-2].minor
.yy89
? 1 : 0;
3364 #line 3365 "src/parser_proc.c"
3365 yy_destructor(yypParser
,98,&yymsp
[-3].minor
);
3366 yy_destructor(yypParser
,75,&yymsp
[0].minor
);
3367 yymsp
[-5].minor
.yy319
= yylhsminor
.yy319
;
3369 case 152: /* let_callback ::= CALLBACK callback_rval LPAREN impl_var LPAREN callback_arg_list RPAREN RPAREN */
3370 #line 950 "src/parser_proc.y"
3372 yylhsminor
.yy120
= psi_let_callback_init(psi_let_func_init(yymsp
[-6].minor
.yy0
->type
, yymsp
[-6].minor
.yy0
->text
, yymsp
[-4].minor
.yy370
), yymsp
[-2].minor
.yy243
);
3373 yylhsminor
.yy120
->token
= yymsp
[-7].minor
.yy0
;
3374 free(yymsp
[-6].minor
.yy0
);
3376 #line 3377 "src/parser_proc.c"
3377 yy_destructor(yypParser
,86,&yymsp
[-5].minor
);
3378 yy_destructor(yypParser
,86,&yymsp
[-3].minor
);
3379 yy_destructor(yypParser
,87,&yymsp
[-1].minor
);
3380 yy_destructor(yypParser
,87,&yymsp
[0].minor
);
3381 yymsp
[-7].minor
.yy120
= yylhsminor
.yy120
;
3383 case 153: /* let_calloc ::= CALLOC LPAREN num_exp COMMA num_exp RPAREN */
3384 #line 955 "src/parser_proc.y"
3386 yylhsminor
.yy45
= psi_let_calloc_init(yymsp
[-3].minor
.yy207
, yymsp
[-1].minor
.yy207
);
3387 yylhsminor
.yy45
->token
= yymsp
[-5].minor
.yy0
;
3389 #line 3390 "src/parser_proc.c"
3390 yy_destructor(yypParser
,86,&yymsp
[-4].minor
);
3391 yy_destructor(yypParser
,88,&yymsp
[-2].minor
);
3392 yy_destructor(yypParser
,87,&yymsp
[0].minor
);
3393 yymsp
[-5].minor
.yy45
= yylhsminor
.yy45
;
3395 case 154: /* let_func ::= ZVAL|OBJVAL|ARRVAL|PATHVAL|STRLEN|STRVAL|FLOATVAL|INTVAL|BOOLVAL|COUNT LPAREN impl_var RPAREN */
3396 #line 959 "src/parser_proc.y"
3398 yylhsminor
.yy67
= psi_let_func_init(yymsp
[-3].minor
.yy0
->type
, yymsp
[-3].minor
.yy0
->text
, yymsp
[-1].minor
.yy370
);
3399 yylhsminor
.yy67
->token
= yymsp
[-3].minor
.yy0
;
3401 #line 3402 "src/parser_proc.c"
3402 yy_destructor(yypParser
,86,&yymsp
[-2].minor
);
3403 yy_destructor(yypParser
,87,&yymsp
[0].minor
);
3404 yymsp
[-3].minor
.yy67
= yylhsminor
.yy67
;
3406 case 155: /* let_func ::= ZVAL|OBJVAL|ARRVAL|PATHVAL|STRLEN|STRVAL|FLOATVAL|INTVAL|BOOLVAL|COUNT LPAREN impl_var COMMA let_exps RPAREN */
3407 #line 963 "src/parser_proc.y"
3409 yylhsminor
.yy67
= psi_let_func_init(yymsp
[-5].minor
.yy0
->type
, yymsp
[-5].minor
.yy0
->text
, yymsp
[-3].minor
.yy370
);
3410 yylhsminor
.yy67
->token
= yymsp
[-5].minor
.yy0
;
3411 yylhsminor
.yy67
->inner
= yymsp
[-1].minor
.yy179
;
3413 #line 3414 "src/parser_proc.c"
3414 yy_destructor(yypParser
,86,&yymsp
[-4].minor
);
3415 yy_destructor(yypParser
,88,&yymsp
[-2].minor
);
3416 yy_destructor(yypParser
,87,&yymsp
[0].minor
);
3417 yymsp
[-5].minor
.yy67
= yylhsminor
.yy67
;
3419 case 156: /* let_exps ::= let_exp */
3420 #line 968 "src/parser_proc.y"
3422 yylhsminor
.yy179
= psi_plist_add(psi_plist_init((psi_plist_dtor
) psi_let_exp_free
),
3423 &yymsp
[0].minor
.yy200
);
3425 #line 3426 "src/parser_proc.c"
3426 yymsp
[0].minor
.yy179
= yylhsminor
.yy179
;
3428 case 157: /* let_exps ::= let_exps COMMA let_exp */
3429 #line 972 "src/parser_proc.y"
3431 yylhsminor
.yy179
= psi_plist_add(yymsp
[-2].minor
.yy179
, &yymsp
[0].minor
.yy200
);
3433 #line 3434 "src/parser_proc.c"
3434 yy_destructor(yypParser
,88,&yymsp
[-1].minor
);
3435 yymsp
[-2].minor
.yy179
= yylhsminor
.yy179
;
3437 case 158: /* callback_arg_list ::= */
3438 #line 975 "src/parser_proc.y"
3440 yymsp
[1].minor
.yy243
= NULL
;
3442 #line 3443 "src/parser_proc.c"
3444 case 159: /* callback_arg_list ::= callback_args */
3445 #line 978 "src/parser_proc.y"
3447 yylhsminor
.yy243
= yymsp
[0].minor
.yy243
;
3449 #line 3450 "src/parser_proc.c"
3450 yymsp
[0].minor
.yy243
= yylhsminor
.yy243
;
3452 case 160: /* callback_args ::= set_exp */
3453 #line 981 "src/parser_proc.y"
3455 yylhsminor
.yy243
= psi_plist_add(psi_plist_init((psi_plist_dtor
) psi_set_exp_free
),
3456 &yymsp
[0].minor
.yy180
);
3458 #line 3459 "src/parser_proc.c"
3459 yymsp
[0].minor
.yy243
= yylhsminor
.yy243
;
3461 case 161: /* callback_args ::= callback_args COMMA set_exp */
3462 #line 985 "src/parser_proc.y"
3464 yylhsminor
.yy243
= psi_plist_add(yymsp
[-2].minor
.yy243
, &yymsp
[0].minor
.yy180
);
3466 #line 3467 "src/parser_proc.c"
3467 yy_destructor(yypParser
,88,&yymsp
[-1].minor
);
3468 yymsp
[-2].minor
.yy243
= yylhsminor
.yy243
;
3470 case 164: /* set_func ::= TO_OBJECT|TO_ARRAY|TO_STRING|TO_INT|TO_FLOAT|TO_BOOL|ZVAL|VOID LPAREN decl_var RPAREN */
3471 #line 994 "src/parser_proc.y"
3473 yylhsminor
.yy362
= psi_set_func_init(yymsp
[-3].minor
.yy0
->type
, yymsp
[-3].minor
.yy0
->text
, yymsp
[-1].minor
.yy271
);
3474 yylhsminor
.yy362
->token
= yymsp
[-3].minor
.yy0
;
3476 #line 3477 "src/parser_proc.c"
3477 yy_destructor(yypParser
,86,&yymsp
[-2].minor
);
3478 yy_destructor(yypParser
,87,&yymsp
[0].minor
);
3479 yymsp
[-3].minor
.yy362
= yylhsminor
.yy362
;
3481 case 165: /* set_func ::= TO_OBJECT|TO_ARRAY|TO_STRING|TO_INT|TO_FLOAT|TO_BOOL|ZVAL|VOID LPAREN decl_var COMMA set_exps RPAREN */
3482 #line 998 "src/parser_proc.y"
3484 yylhsminor
.yy362
= psi_set_func_init(yymsp
[-5].minor
.yy0
->type
, yymsp
[-5].minor
.yy0
->text
, yymsp
[-3].minor
.yy271
);
3485 yylhsminor
.yy362
->token
= yymsp
[-5].minor
.yy0
;
3486 yylhsminor
.yy362
->inner
= yymsp
[-1].minor
.yy179
;
3488 #line 3489 "src/parser_proc.c"
3489 yy_destructor(yypParser
,86,&yymsp
[-4].minor
);
3490 yy_destructor(yypParser
,88,&yymsp
[-2].minor
);
3491 yy_destructor(yypParser
,87,&yymsp
[0].minor
);
3492 yymsp
[-5].minor
.yy362
= yylhsminor
.yy362
;
3494 case 166: /* set_func ::= TO_OBJECT|TO_ARRAY|TO_STRING|TO_INT|TO_FLOAT|TO_BOOL|ZVAL|VOID LPAREN decl_var COMMA ELLIPSIS RPAREN */
3495 #line 1003 "src/parser_proc.y"
3497 yylhsminor
.yy362
= psi_set_func_init(yymsp
[-5].minor
.yy0
->type
, yymsp
[-5].minor
.yy0
->text
, yymsp
[-3].minor
.yy271
);
3498 yylhsminor
.yy362
->token
= yymsp
[-5].minor
.yy0
;
3499 yylhsminor
.yy362
->recursive
= 1;
3501 #line 3502 "src/parser_proc.c"
3502 yy_destructor(yypParser
,86,&yymsp
[-4].minor
);
3503 yy_destructor(yypParser
,88,&yymsp
[-2].minor
);
3504 yy_destructor(yypParser
,101,&yymsp
[-1].minor
);
3505 yy_destructor(yypParser
,87,&yymsp
[0].minor
);
3506 yymsp
[-5].minor
.yy362
= yylhsminor
.yy362
;
3508 case 167: /* set_exp ::= set_func */
3509 #line 1008 "src/parser_proc.y"
3511 yylhsminor
.yy180
= psi_set_exp_init(PSI_SET_FUNC
, yymsp
[0].minor
.yy362
);
3513 #line 3514 "src/parser_proc.c"
3514 yymsp
[0].minor
.yy180
= yylhsminor
.yy180
;
3516 case 168: /* set_exp ::= num_exp */
3517 #line 1011 "src/parser_proc.y"
3519 yylhsminor
.yy180
= psi_set_exp_init(PSI_SET_NUMEXP
, yymsp
[0].minor
.yy207
);
3521 #line 3522 "src/parser_proc.c"
3522 yymsp
[0].minor
.yy180
= yylhsminor
.yy180
;
3524 case 169: /* set_exps ::= set_exp */
3525 #line 1014 "src/parser_proc.y"
3527 yylhsminor
.yy179
= psi_plist_add(psi_plist_init((psi_plist_dtor
) psi_set_exp_free
),
3528 &yymsp
[0].minor
.yy180
);
3530 #line 3531 "src/parser_proc.c"
3531 yymsp
[0].minor
.yy179
= yylhsminor
.yy179
;
3533 case 170: /* set_exps ::= set_exps COMMA set_exp */
3534 #line 1018 "src/parser_proc.y"
3536 yylhsminor
.yy179
= psi_plist_add(yymsp
[-2].minor
.yy179
, &yymsp
[0].minor
.yy180
);
3538 #line 3539 "src/parser_proc.c"
3539 yy_destructor(yypParser
,88,&yymsp
[-1].minor
);
3540 yymsp
[-2].minor
.yy179
= yylhsminor
.yy179
;
3542 case 171: /* set_exp ::= impl_var EQUALS set_exp */
3543 #line 1021 "src/parser_proc.y"
3545 yylhsminor
.yy180
= yymsp
[0].minor
.yy180
;
3546 yylhsminor
.yy180
->var
= yymsp
[-2].minor
.yy370
;
3548 #line 3549 "src/parser_proc.c"
3549 yy_destructor(yypParser
,98,&yymsp
[-1].minor
);
3550 yymsp
[-2].minor
.yy180
= yylhsminor
.yy180
;
3552 case 172: /* set_stmt ::= SET set_exp EOS */
3553 #line 1025 "src/parser_proc.y"
3555 yylhsminor
.yy358
= psi_set_stmt_init(yymsp
[-1].minor
.yy180
);
3556 yylhsminor
.yy358
->token
= yymsp
[-2].minor
.yy0
;
3558 #line 3559 "src/parser_proc.c"
3559 yy_destructor(yypParser
,75,&yymsp
[0].minor
);
3560 yymsp
[-2].minor
.yy358
= yylhsminor
.yy358
;
3562 case 173: /* return_stmt ::= RETURN set_func EOS */
3563 #line 1029 "src/parser_proc.y"
3565 yylhsminor
.yy342
= psi_return_stmt_init(psi_set_exp_init(PSI_SET_FUNC
, yymsp
[-1].minor
.yy362
));
3566 yylhsminor
.yy342
->token
= yymsp
[-2].minor
.yy0
;
3568 #line 3569 "src/parser_proc.c"
3569 yy_destructor(yypParser
,75,&yymsp
[0].minor
);
3570 yymsp
[-2].minor
.yy342
= yylhsminor
.yy342
;
3572 case 174: /* free_stmt ::= FREE free_exps EOS */
3573 #line 1033 "src/parser_proc.y"
3575 yylhsminor
.yy220
= psi_free_stmt_init(yymsp
[-1].minor
.yy179
);
3576 yylhsminor
.yy220
->token
= yymsp
[-2].minor
.yy0
;
3578 #line 3579 "src/parser_proc.c"
3579 yy_destructor(yypParser
,75,&yymsp
[0].minor
);
3580 yymsp
[-2].minor
.yy220
= yylhsminor
.yy220
;
3582 case 175: /* free_exps ::= free_exp */
3583 #line 1037 "src/parser_proc.y"
3585 yylhsminor
.yy179
= psi_plist_add(psi_plist_init((psi_plist_dtor
) psi_free_exp_free
),
3586 &yymsp
[0].minor
.yy146
);
3588 #line 3589 "src/parser_proc.c"
3589 yymsp
[0].minor
.yy179
= yylhsminor
.yy179
;
3591 case 176: /* free_exps ::= free_exps COMMA free_exp */
3592 #line 1041 "src/parser_proc.y"
3594 yylhsminor
.yy179
= psi_plist_add(yymsp
[-2].minor
.yy179
, &yymsp
[0].minor
.yy146
);
3596 #line 3597 "src/parser_proc.c"
3597 yy_destructor(yypParser
,88,&yymsp
[-1].minor
);
3598 yymsp
[-2].minor
.yy179
= yylhsminor
.yy179
;
3600 case 177: /* free_exp ::= NAME LPAREN decl_vars RPAREN */
3601 #line 1044 "src/parser_proc.y"
3603 yylhsminor
.yy146
= psi_free_exp_init(yymsp
[-3].minor
.yy0
->text
, yymsp
[-1].minor
.yy179
);
3604 yylhsminor
.yy146
->token
= yymsp
[-3].minor
.yy0
;
3606 #line 3607 "src/parser_proc.c"
3607 yy_destructor(yypParser
,86,&yymsp
[-2].minor
);
3608 yy_destructor(yypParser
,87,&yymsp
[0].minor
);
3609 yymsp
[-3].minor
.yy146
= yylhsminor
.yy146
;
3611 case 178: /* assert_stmt ::= PRE_ASSERT|POST_ASSERT num_exp EOS */
3612 #line 1048 "src/parser_proc.y"
3614 yylhsminor
.yy201
= psi_assert_stmt_init(yymsp
[-2].minor
.yy0
->type
, yymsp
[-1].minor
.yy207
);
3615 yylhsminor
.yy201
->token
= yymsp
[-2].minor
.yy0
;
3617 #line 3618 "src/parser_proc.c"
3618 yy_destructor(yypParser
,75,&yymsp
[0].minor
);
3619 yymsp
[-2].minor
.yy201
= yylhsminor
.yy201
;
3621 case 179: /* reference ::= */
3622 #line 1052 "src/parser_proc.y"
3624 yymsp
[1].minor
.yy89
= false;
3626 #line 3627 "src/parser_proc.c"
3628 case 180: /* reference ::= AMPERSAND */
3629 { yy_destructor(yypParser
,23,&yymsp
[0].minor
);
3630 #line 1055 "src/parser_proc.y"
3632 yymsp
[0].minor
.yy89
= true;
3634 #line 3635 "src/parser_proc.c"
3637 case 181: /* indirection ::= */
3638 #line 1058 "src/parser_proc.y"
3640 yymsp
[1].minor
.yy382
= 0;
3642 #line 3643 "src/parser_proc.c"
3644 case 182: /* indirection ::= pointers */
3645 #line 1061 "src/parser_proc.y"
3647 yylhsminor
.yy382
= yymsp
[0].minor
.yy382
;
3649 #line 3650 "src/parser_proc.c"
3650 yymsp
[0].minor
.yy382
= yylhsminor
.yy382
;
3652 case 183: /* pointers ::= ASTERISK */
3653 { yy_destructor(yypParser
,28,&yymsp
[0].minor
);
3654 #line 1064 "src/parser_proc.y"
3656 yymsp
[0].minor
.yy382
= 1;
3658 #line 3659 "src/parser_proc.c"
3661 case 184: /* pointers ::= pointers ASTERISK */
3662 #line 1067 "src/parser_proc.y"
3664 yylhsminor
.yy382
= yymsp
[-1].minor
.yy382
+1;
3666 #line 3667 "src/parser_proc.c"
3667 yy_destructor(yypParser
,28,&yymsp
[0].minor
);
3668 yymsp
[-1].minor
.yy382
= yylhsminor
.yy382
;
3670 case 185: /* file ::= blocks */
3671 { yy_destructor(yypParser
,180,&yymsp
[0].minor
);
3672 #line 193 "src/parser_proc.y"
3675 #line 3676 "src/parser_proc.c"
3678 case 186: /* blocks ::= block */
3679 { yy_destructor(yypParser
,181,&yymsp
[0].minor
);
3680 #line 194 "src/parser_proc.y"
3683 #line 3684 "src/parser_proc.c"
3686 case 187: /* blocks ::= blocks block */
3687 { yy_destructor(yypParser
,180,&yymsp
[-1].minor
);
3688 #line 195 "src/parser_proc.y"
3691 #line 3692 "src/parser_proc.c"
3692 yy_destructor(yypParser
,181,&yymsp
[0].minor
);
3695 case 188: /* block ::= EOS */
3696 { yy_destructor(yypParser
,75,&yymsp
[0].minor
);
3697 #line 196 "src/parser_proc.y"
3700 #line 3701 "src/parser_proc.c"
3703 case 189: /* block ::= EOL */
3704 { yy_destructor(yypParser
,76,&yymsp
[0].minor
);
3705 #line 197 "src/parser_proc.y"
3708 #line 3709 "src/parser_proc.c"
3711 case 190: /* block ::= COMMENT */
3712 { yy_destructor(yypParser
,77,&yymsp
[0].minor
);
3713 #line 198 "src/parser_proc.y"
3716 #line 3717 "src/parser_proc.c"
3721 /********** End reduce actions ************************************************/
3723 assert( yyruleno
<sizeof(yyRuleInfo
)/sizeof(yyRuleInfo
[0]) );
3724 yygoto
= yyRuleInfo
[yyruleno
].lhs
;
3725 yysize
= yyRuleInfo
[yyruleno
].nrhs
;
3726 yyact
= yy_find_reduce_action(yymsp
[-yysize
].stateno
,(YYCODETYPE
)yygoto
);
3727 if( yyact
<= YY_MAX_SHIFTREDUCE
){
3728 if( yyact
>YY_MAX_SHIFT
){
3729 yyact
+= YY_MIN_REDUCE
- YY_MIN_SHIFTREDUCE
;
3732 yypParser
->yytos
= yymsp
;
3733 yymsp
->stateno
= (YYACTIONTYPE
)yyact
;
3734 yymsp
->major
= (YYCODETYPE
)yygoto
;
3735 yyTraceShift(yypParser
, yyact
);
3737 assert( yyact
== YY_ACCEPT_ACTION
);
3738 yypParser
->yytos
-= yysize
;
3739 yy_accept(yypParser
);
3744 ** The following code executes when the parse fails
3746 #ifndef YYNOERRORRECOVERY
3747 static void yy_parse_failed(
3748 yyParser
*yypParser
/* The parser */
3753 fprintf(yyTraceFILE
,"%sFail!\n",yyTracePrompt
);
3756 while( yypParser
->yytos
>yypParser
->yystack
) yy_pop_parser_stack(yypParser
);
3757 /* Here code is inserted which will be executed whenever the
3759 /************ Begin %parse_failure code ***************************************/
3760 /************ End %parse_failure code *****************************************/
3761 ParseARG_STORE
; /* Suppress warning about unused %extra_argument variable */
3763 #endif /* YYNOERRORRECOVERY */
3766 ** The following code executes when a syntax error first occurs.
3768 static void yy_syntax_error(
3769 yyParser
*yypParser
, /* The parser */
3770 int yymajor
, /* The major type of the error token */
3771 ParseTOKENTYPE yyminor
/* The minor type of the error token */
3774 #define TOKEN yyminor
3775 /************ Begin %syntax_error code ****************************************/
3776 #line 40 "src/parser_proc.y"
3777 ++P
->errors
; if (TOKEN
) { psi_error(PSI_WARNING
, TOKEN
->file
, TOKEN
->line
, "PSI syntax error: Unexpected token '%s' at pos %u", TOKEN
->text
, TOKEN
->col
); } else { psi_error(PSI_WARNING
, P
->file
.fn
, P
->line
, "PSI syntax error: Unexpected end of input"); }
3778 #line 3779 "src/parser_proc.c"
3779 /************ End %syntax_error code ******************************************/
3780 ParseARG_STORE
; /* Suppress warning about unused %extra_argument variable */
3784 ** The following is executed when the parser accepts
3786 static void yy_accept(
3787 yyParser
*yypParser
/* The parser */
3792 fprintf(yyTraceFILE
,"%sAccept!\n",yyTracePrompt
);
3795 #ifndef YYNOERRORRECOVERY
3796 yypParser
->yyerrcnt
= -1;
3798 assert( yypParser
->yytos
==yypParser
->yystack
);
3799 /* Here code is inserted which will be executed whenever the
3800 ** parser accepts */
3801 /*********** Begin %parse_accept code *****************************************/
3802 /*********** End %parse_accept code *******************************************/
3803 ParseARG_STORE
; /* Suppress warning about unused %extra_argument variable */
3806 /* The main parser program.
3807 ** The first argument is a pointer to a structure obtained from
3808 ** "ParseAlloc" which describes the current state of the parser.
3809 ** The second argument is the major token number. The third is
3810 ** the minor token. The fourth optional argument is whatever the
3811 ** user wants (and specified in the grammar) and is available for
3812 ** use by the action routines.
3816 ** <li> A pointer to the parser (an opaque structure.)
3817 ** <li> The major token number.
3818 ** <li> The minor token number.
3819 ** <li> An option argument of a grammar-specified type.
3826 void *yyp
, /* The parser */
3827 int yymajor
, /* The major token code number */
3828 ParseTOKENTYPE yyminor
/* The value for the token */
3829 ParseARG_PDECL
/* Optional %extra_argument parameter */
3831 YYMINORTYPE yyminorunion
;
3832 unsigned int yyact
; /* The parser action. */
3833 #if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY)
3834 int yyendofinput
; /* True if we are at the end of input */
3836 #ifdef YYERRORSYMBOL
3837 int yyerrorhit
= 0; /* True if yymajor has invoked an error */
3839 yyParser
*yypParser
; /* The parser */
3841 yypParser
= (yyParser
*)yyp
;
3842 assert( yypParser
->yytos
!=0 );
3843 #if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY)
3844 yyendofinput
= (yymajor
==0);
3850 fprintf(yyTraceFILE
,"%sInput '%s'\n",yyTracePrompt
,yyTokenName
[yymajor
]);
3855 yyact
= yy_find_shift_action(yypParser
,(YYCODETYPE
)yymajor
);
3856 if( yyact
<= YY_MAX_SHIFTREDUCE
){
3857 yy_shift(yypParser
,yyact
,yymajor
,yyminor
);
3858 #ifndef YYNOERRORRECOVERY
3859 yypParser
->yyerrcnt
--;
3862 }else if( yyact
<= YY_MAX_REDUCE
){
3863 yy_reduce(yypParser
,yyact
-YY_MIN_REDUCE
);
3865 assert( yyact
== YY_ERROR_ACTION
);
3866 yyminorunion
.yy0
= yyminor
;
3867 #ifdef YYERRORSYMBOL
3872 fprintf(yyTraceFILE
,"%sSyntax Error!\n",yyTracePrompt
);
3875 #ifdef YYERRORSYMBOL
3876 /* A syntax error has occurred.
3877 ** The response to an error depends upon whether or not the
3878 ** grammar defines an error token "ERROR".
3880 ** This is what we do if the grammar does define ERROR:
3882 ** * Call the %syntax_error function.
3884 ** * Begin popping the stack until we enter a state where
3885 ** it is legal to shift the error symbol, then shift
3886 ** the error symbol.
3888 ** * Set the error count to three.
3890 ** * Begin accepting and shifting new tokens. No new error
3891 ** processing will occur until three tokens have been
3892 ** shifted successfully.
3895 if( yypParser
->yyerrcnt
<0 ){
3896 yy_syntax_error(yypParser
,yymajor
,yyminor
);
3898 yymx
= yypParser
->yytos
->major
;
3899 if( yymx
==YYERRORSYMBOL
|| yyerrorhit
){
3902 fprintf(yyTraceFILE
,"%sDiscard input token %s\n",
3903 yyTracePrompt
,yyTokenName
[yymajor
]);
3906 yy_destructor(yypParser
, (YYCODETYPE
)yymajor
, &yyminorunion
);
3909 while( yypParser
->yytos
>= yypParser
->yystack
3910 && yymx
!= YYERRORSYMBOL
3911 && (yyact
= yy_find_reduce_action(
3912 yypParser
->yytos
->stateno
,
3913 YYERRORSYMBOL
)) >= YY_MIN_REDUCE
3915 yy_pop_parser_stack(yypParser
);
3917 if( yypParser
->yytos
< yypParser
->yystack
|| yymajor
==0 ){
3918 yy_destructor(yypParser
,(YYCODETYPE
)yymajor
,&yyminorunion
);
3919 yy_parse_failed(yypParser
);
3920 #ifndef YYNOERRORRECOVERY
3921 yypParser
->yyerrcnt
= -1;
3924 }else if( yymx
!=YYERRORSYMBOL
){
3925 yy_shift(yypParser
,yyact
,YYERRORSYMBOL
,yyminor
);
3928 yypParser
->yyerrcnt
= 3;
3930 #elif defined(YYNOERRORRECOVERY)
3931 /* If the YYNOERRORRECOVERY macro is defined, then do not attempt to
3932 ** do any kind of error recovery. Instead, simply invoke the syntax
3933 ** error routine and continue going as if nothing had happened.
3935 ** Applications can set this macro (for example inside %include) if
3936 ** they intend to abandon the parse upon the first syntax error seen.
3938 yy_syntax_error(yypParser
,yymajor
, yyminor
);
3939 yy_destructor(yypParser
,(YYCODETYPE
)yymajor
,&yyminorunion
);
3942 #else /* YYERRORSYMBOL is not defined */
3943 /* This is what we do if the grammar does not define ERROR:
3945 ** * Report an error message, and throw away the input token.
3947 ** * If the input token is $, then fail the parse.
3949 ** As before, subsequent error messages are suppressed until
3950 ** three input tokens have been successfully shifted.
3952 if( yypParser
->yyerrcnt
<=0 ){
3953 yy_syntax_error(yypParser
,yymajor
, yyminor
);
3955 yypParser
->yyerrcnt
= 3;
3956 yy_destructor(yypParser
,(YYCODETYPE
)yymajor
,&yyminorunion
);
3958 yy_parse_failed(yypParser
);
3959 #ifndef YYNOERRORRECOVERY
3960 yypParser
->yyerrcnt
= -1;
3966 }while( yymajor
!=YYNOCODE
&& yypParser
->yytos
>yypParser
->yystack
);
3971 fprintf(yyTraceFILE
,"%sReturn. Stack=",yyTracePrompt
);
3972 for(i
=&yypParser
->yystack
[1]; i
<=yypParser
->yytos
; i
++){
3973 fprintf(yyTraceFILE
,"%c%s", cDiv
, yyTokenName
[i
->major
]);
3976 fprintf(yyTraceFILE
,"]\n");