parser: NAME fallback ERROR,WARNING
[m6w6/ext-psi] / src / parser_proc.c
1 /*
2 ** 2000-05-29
3 **
4 ** The author disclaims copyright to this source code. In place of
5 ** a legal notice, here is a blessing:
6 **
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.
10 **
11 *************************************************************************
12 ** Driver template for the LEMON parser generator.
13 **
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
20 ** source file.
21 **
22 ** The following is the concatenation of all %include directives from the
23 ** input grammar file:
24 */
25 #include <stdio.h>
26 /************ Begin %include sections from the grammar ************************/
27 #line 1 "src/parser_proc.y"
28
29 #include "php_psi_stdinc.h"
30
31 #include <assert.h>
32 #include <stdarg.h>
33
34 #include "plist.h"
35 #include "parser.h"
36
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
42
43 /* fwd decls */
44 void *ParseAlloc(void *(*mallocProc)(size_t));
45 void ParseFree(void *p, void (*freeProc)(void*));
46
47 /* wrappers */
48 void *psi_parser_proc_init(void)
49 {
50 return ParseAlloc(malloc);
51 }
52
53 void psi_parser_proc_free(void **parser_proc)
54 {
55 if (*parser_proc) {
56 ParseFree(*parser_proc, free);
57 *parser_proc = NULL;
58 }
59 }
60
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 ***************************/
68
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
84 ** token.
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
93 ** symbols.
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
115 */
116 #ifndef INTERFACE
117 # define INTERFACE 1
118 #endif
119 /************* Begin control #defines *****************************************/
120 #define YYCODETYPE unsigned char
121 #define YYNOCODE 193
122 #define YYACTIONTYPE unsigned short int
123 #define YYWILDCARD 74
124 #define ParseTOKENTYPE struct psi_token *
125 typedef union {
126 int yyinit;
127 ParseTOKENTYPE yy0;
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;
137 bool yy89;
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;
167 unsigned yy382;
168 } YYMINORTYPE;
169 #ifndef YYSTACKDEPTH
170 #define YYSTACKDEPTH 100
171 #endif
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
176 #define YYFALLBACK 1
177 #define YYNSTATE 233
178 #define YYNRULE 191
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 *******************************************/
188
189 /* Define the yytestcase() macro to be a no-op if is not already defined
190 ** otherwise.
191 **
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
195 ** for testing.
196 */
197 #ifndef yytestcase
198 # define yytestcase(X)
199 #endif
200
201
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
205 ** action integer.
206 **
207 ** Suppose the action integer is N. Then the action is determined as
208 ** follows
209 **
210 ** 0 <= N <= YY_MAX_SHIFT Shift N. That is, push the lookahead
211 ** token onto the stack and goto state N.
212 **
213 ** N between YY_MIN_SHIFTREDUCE Shift to an arbitrary state then
214 ** and YY_MAX_SHIFTREDUCE reduce by rule N-YY_MIN_SHIFTREDUCE.
215 **
216 ** N between YY_MIN_REDUCE Reduce by rule N-YY_MIN_REDUCE
217 ** and YY_MAX_REDUCE
218 **
219 ** N == YY_ERROR_ACTION A syntax error has occurred.
220 **
221 ** N == YY_ACCEPT_ACTION The parser accepts its input.
222 **
223 ** N == YY_NO_ACTION No such action. Denotes unused
224 ** slots in the yy_action[] table.
225 **
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:
228 **
229 ** (A) N = yy_action[ yy_shift_ofst[S] + X ]
230 ** (B) N = yy_default[S]
231 **
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.)
239 **
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.
245 **
246 ** The following are the tables generated in this section:
247 **
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.
256 **
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,
373 /* 1130 */ 578, 142,
374 };
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,
489 /* 1130 */ 192, 178,
490 };
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,
520 };
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,
537 };
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,
563 };
564 /********** End of lemon-generated parsing tables *****************************/
565
566 /* The next table maps tokens (terminal symbols) into fallback tokens.
567 ** If a construct like the following:
568 **
569 ** %fallback ID X Y Z.
570 **
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.
575 **
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
578 ** it appears.
579 */
580 #ifdef YYFALLBACK
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 */
656 };
657 #endif /* YYFALLBACK */
658
659 /* The following structure represents a single element of the
660 ** parser's stack. Information stored includes:
661 **
662 ** + The state number for the parser at this level of the stack.
663 **
664 ** + The value of the token stored at this level of the stack.
665 ** (In other words, the "major" token.)
666 **
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.
670 **
671 ** After the "shift" half of a SHIFTREDUCE action, the stateno field
672 ** actually contains the reduce action for the second half of the
673 ** SHIFTREDUCE.
674 */
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 */
681 };
682 typedef struct yyStackEntry yyStackEntry;
683
684 /* The state of the parser is completely contained in an instance of
685 ** the following structure */
686 struct yyParser {
687 yyStackEntry *yytos; /* Pointer to top element of the stack */
688 #ifdef YYTRACKMAXSTACKDEPTH
689 int yyhwm; /* High-water mark of the stack */
690 #endif
691 #ifndef YYNOERRORRECOVERY
692 int yyerrcnt; /* Shifts left before out of the error */
693 #endif
694 ParseARG_SDECL /* A place to hold %extra_argument */
695 #if YYSTACKDEPTH<=0
696 int yystksz; /* Current side of the stack */
697 yyStackEntry *yystack; /* The parser's stack */
698 yyStackEntry yystk0; /* First stack entry */
699 #else
700 yyStackEntry yystack[YYSTACKDEPTH]; /* The parser's stack */
701 #endif
702 };
703 typedef struct yyParser yyParser;
704
705 #ifndef NDEBUG
706 #include <stdio.h>
707 static FILE *yyTraceFILE = 0;
708 static char *yyTracePrompt = 0;
709 #endif /* NDEBUG */
710
711 #ifndef NDEBUG
712 /*
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
716 **
717 ** Inputs:
718 ** <ul>
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
723 ** turned off.
724 ** </ul>
725 **
726 ** Outputs:
727 ** None.
728 */
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;
734 }
735 #endif /* NDEBUG */
736
737 #ifndef NDEBUG
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",
789 };
790 #endif /* NDEBUG */
791
792 #ifndef NDEBUG
793 /* For tracing reduce actions, the names of all rules are required.
794 */
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",
987 };
988 #endif /* NDEBUG */
989
990
991 #if YYSTACKDEPTH<=0
992 /*
993 ** Try to increase the size of the parser stack. Return the number
994 ** of errors. Return 0 on success.
995 */
996 static int yyGrowStack(yyParser *p){
997 int newSize;
998 int idx;
999 yyStackEntry *pNew;
1000
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;
1006 }else{
1007 pNew = realloc(p->yystack, newSize*sizeof(pNew[0]));
1008 }
1009 if( pNew ){
1010 p->yystack = pNew;
1011 p->yytos = &p->yystack[idx];
1012 #ifndef NDEBUG
1013 if( yyTraceFILE ){
1014 fprintf(yyTraceFILE,"%sStack grows from %d to %d entries.\n",
1015 yyTracePrompt, p->yystksz, newSize);
1016 }
1017 #endif
1018 p->yystksz = newSize;
1019 }
1020 return pNew==0;
1021 }
1022 #endif
1023
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
1027 ** grammar.
1028 */
1029 #ifndef YYMALLOCARGTYPE
1030 # define YYMALLOCARGTYPE size_t
1031 #endif
1032
1033 /* Initialize a new parser that has already been allocated.
1034 */
1035 void ParseInit(void *yypParser){
1036 yyParser *pParser = (yyParser*)yypParser;
1037 #ifdef YYTRACKMAXSTACKDEPTH
1038 pParser->yyhwm = 0;
1039 #endif
1040 #if YYSTACKDEPTH<=0
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;
1047 }
1048 #endif
1049 #ifndef YYNOERRORRECOVERY
1050 pParser->yyerrcnt = -1;
1051 #endif
1052 pParser->yytos = pParser->yystack;
1053 pParser->yystack[0].stateno = 0;
1054 pParser->yystack[0].major = 0;
1055 }
1056
1057 #ifndef Parse_ENGINEALWAYSONSTACK
1058 /*
1059 ** This function allocates a new parser.
1060 ** The only argument is a pointer to a function which works like
1061 ** malloc.
1062 **
1063 ** Inputs:
1064 ** A pointer to the function used to allocate memory.
1065 **
1066 ** Outputs:
1067 ** A pointer to a parser. This pointer is used in subsequent calls
1068 ** to Parse and ParseFree.
1069 */
1070 void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE)){
1071 yyParser *pParser;
1072 pParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) );
1073 if( pParser ) ParseInit(pParser);
1074 return pParser;
1075 }
1076 #endif /* Parse_ENGINEALWAYSONSTACK */
1077
1078
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.
1085 */
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 */
1090 ){
1091 ParseARG_FETCH;
1092 switch( yymajor ){
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.
1098 **
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.
1102 */
1103 /********* Begin destructor definitions ***************************************/
1104 /* TERMINAL Destructor */
1105 case 1: /* BOOL */
1106 case 2: /* INT */
1107 case 3: /* FLOAT */
1108 case 4: /* STRING */
1109 case 5: /* DOUBLE */
1110 case 6: /* INT8 */
1111 case 7: /* UINT8 */
1112 case 8: /* INT16 */
1113 case 9: /* UINT16 */
1114 case 10: /* INT32 */
1115 case 11: /* UINT32 */
1116 case 12: /* INT64 */
1117 case 13: /* UINT64 */
1118 case 14: /* NAME */
1119 case 15: /* NULL */
1120 case 16: /* NUMBER */
1121 case 17: /* TRUE */
1122 case 18: /* FALSE */
1123 case 19: /* QUOTED_STRING */
1124 case 20: /* NSNAME */
1125 case 21: /* PIPE */
1126 case 22: /* CARET */
1127 case 23: /* AMPERSAND */
1128 case 24: /* LSHIFT */
1129 case 25: /* RSHIFT */
1130 case 26: /* PLUS */
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 */
1139 case 35: /* OR */
1140 case 36: /* AND */
1141 case 37: /* CMP_EQ */
1142 case 38: /* CMP_NE */
1143 case 39: /* TILDE */
1144 case 40: /* NOT */
1145 case 41: /* ZVAL */
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 */
1161 case 57: /* VOID */
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 */
1170 case 66: /* TEMP */
1171 case 67: /* FREE */
1172 case 68: /* SET */
1173 case 69: /* LET */
1174 case 70: /* RETURN */
1175 case 71: /* CALLOC */
1176 case 72: /* CALLBACK */
1177 case 73: /* LIB */
1178 case 74: /* ANY */
1179 case 75: /* EOS */
1180 case 76: /* EOL */
1181 case 77: /* COMMENT */
1182 case 78: /* HASH */
1183 case 79: /* IFDEF */
1184 case 80: /* IFNDEF */
1185 case 81: /* ENDIF */
1186 case 82: /* ELSE */
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 */
1193 case 89: /* IF */
1194 case 90: /* ELIF */
1195 case 91: /* DEFINED */
1196 case 92: /* COLON */
1197 case 93: /* ENUM */
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 */
1216 {
1217 #line 37 "src/parser_proc.y"
1218 free((yypminor->yy0));
1219 #line 1220 "src/parser_proc.c"
1220 }
1221 break;
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 */
1241 {
1242 #line 38 "src/parser_proc.y"
1243 (void)P;
1244 #line 1245 "src/parser_proc.c"
1245 }
1246 break;
1247 case 113: /* decl_enum */
1248 {
1249 #line 66 "src/parser_proc.y"
1250 psi_decl_enum_free(&(yypminor->yy323));
1251 #line 1252 "src/parser_proc.c"
1252 }
1253 break;
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 */
1271 {
1272 #line 68 "src/parser_proc.y"
1273 psi_plist_free((yypminor->yy179));
1274 #line 1275 "src/parser_proc.c"
1275 }
1276 break;
1277 case 115: /* decl_enum_item */
1278 {
1279 #line 70 "src/parser_proc.y"
1280 psi_decl_enum_item_free(&(yypminor->yy169));
1281 #line 1282 "src/parser_proc.c"
1282 }
1283 break;
1284 case 118: /* decl_struct */
1285 {
1286 #line 76 "src/parser_proc.y"
1287 psi_decl_struct_free(&(yypminor->yy324));
1288 #line 1289 "src/parser_proc.c"
1289 }
1290 break;
1291 case 120: /* decl_union */
1292 {
1293 #line 79 "src/parser_proc.y"
1294 psi_decl_union_free(&(yypminor->yy15));
1295 #line 1296 "src/parser_proc.c"
1296 }
1297 break;
1298 case 121: /* const_type */
1299 {
1300 #line 81 "src/parser_proc.y"
1301 psi_const_type_free(&(yypminor->yy351));
1302 #line 1303 "src/parser_proc.c"
1303 }
1304 break;
1305 case 122: /* constant */
1306 {
1307 #line 83 "src/parser_proc.y"
1308 psi_const_free(&(yypminor->yy38));
1309 #line 1310 "src/parser_proc.c"
1310 }
1311 break;
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 */
1318 {
1319 #line 85 "src/parser_proc.y"
1320 psi_decl_arg_free(&(yypminor->yy320));
1321 #line 1322 "src/parser_proc.c"
1322 }
1323 break;
1324 case 127: /* decl */
1325 {
1326 #line 93 "src/parser_proc.y"
1327 psi_decl_free(&(yypminor->yy303));
1328 #line 1329 "src/parser_proc.c"
1329 }
1330 break;
1331 case 129: /* decl_abi */
1332 {
1333 #line 97 "src/parser_proc.y"
1334 psi_decl_abi_free(&(yypminor->yy26));
1335 #line 1336 "src/parser_proc.c"
1336 }
1337 break;
1338 case 130: /* decl_var */
1339 {
1340 #line 99 "src/parser_proc.y"
1341 psi_decl_var_free(&(yypminor->yy271));
1342 #line 1343 "src/parser_proc.c"
1343 }
1344 break;
1345 case 136: /* decl_layout */
1346 {
1347 #line 111 "src/parser_proc.y"
1348 psi_layout_free(&(yypminor->yy369));
1349 #line 1350 "src/parser_proc.c"
1350 }
1351 break;
1352 case 137: /* decl_type */
1353 case 138: /* const_decl_type */
1354 {
1355 #line 113 "src/parser_proc.y"
1356 psi_decl_type_free(&(yypminor->yy172));
1357 #line 1358 "src/parser_proc.c"
1358 }
1359 break;
1360 case 139: /* impl */
1361 {
1362 #line 117 "src/parser_proc.y"
1363 psi_impl_free(&(yypminor->yy49));
1364 #line 1365 "src/parser_proc.c"
1365 }
1366 break;
1367 case 140: /* impl_func */
1368 {
1369 #line 119 "src/parser_proc.y"
1370 psi_impl_func_free(&(yypminor->yy56));
1371 #line 1372 "src/parser_proc.c"
1372 }
1373 break;
1374 case 141: /* impl_def_val */
1375 {
1376 #line 121 "src/parser_proc.y"
1377 psi_impl_def_val_free(&(yypminor->yy145));
1378 #line 1379 "src/parser_proc.c"
1379 }
1380 break;
1381 case 142: /* impl_var */
1382 {
1383 #line 123 "src/parser_proc.y"
1384 psi_impl_var_free(&(yypminor->yy370));
1385 #line 1386 "src/parser_proc.c"
1386 }
1387 break;
1388 case 143: /* impl_arg */
1389 case 145: /* impl_vararg */
1390 {
1391 #line 125 "src/parser_proc.y"
1392 psi_impl_arg_free(&(yypminor->yy34));
1393 #line 1394 "src/parser_proc.c"
1394 }
1395 break;
1396 case 147: /* impl_stmt */
1397 {
1398 #line 133 "src/parser_proc.y"
1399 psi_impl_stmt_free(&(yypminor->yy238));
1400 #line 1401 "src/parser_proc.c"
1401 }
1402 break;
1403 case 148: /* number */
1404 {
1405 #line 135 "src/parser_proc.y"
1406 psi_number_free(&(yypminor->yy57));
1407 #line 1408 "src/parser_proc.c"
1408 }
1409 break;
1410 case 149: /* num_exp */
1411 case 171: /* cpp_macro_exp */
1412 {
1413 #line 137 "src/parser_proc.y"
1414 psi_num_exp_free(&(yypminor->yy207));
1415 #line 1416 "src/parser_proc.c"
1416 }
1417 break;
1418 case 150: /* let_stmt */
1419 {
1420 #line 139 "src/parser_proc.y"
1421 psi_let_stmt_free(&(yypminor->yy319));
1422 #line 1423 "src/parser_proc.c"
1423 }
1424 break;
1425 case 151: /* let_calloc */
1426 {
1427 #line 141 "src/parser_proc.y"
1428 psi_let_calloc_free(&(yypminor->yy45));
1429 #line 1430 "src/parser_proc.c"
1430 }
1431 break;
1432 case 152: /* let_func */
1433 {
1434 #line 143 "src/parser_proc.y"
1435 psi_let_func_free(&(yypminor->yy67));
1436 #line 1437 "src/parser_proc.c"
1437 }
1438 break;
1439 case 153: /* callback_arg_list */
1440 case 154: /* callback_args */
1441 {
1442 #line 145 "src/parser_proc.y"
1443 psi_plist_free((yypminor->yy243));
1444 #line 1445 "src/parser_proc.c"
1445 }
1446 break;
1447 case 155: /* let_callback */
1448 {
1449 #line 149 "src/parser_proc.y"
1450 psi_let_callback_free(&(yypminor->yy120));
1451 #line 1452 "src/parser_proc.c"
1452 }
1453 break;
1454 case 156: /* let_exp */
1455 {
1456 #line 151 "src/parser_proc.y"
1457 psi_let_exp_free(&(yypminor->yy200));
1458 #line 1459 "src/parser_proc.c"
1459 }
1460 break;
1461 case 158: /* assert_stmt */
1462 {
1463 #line 155 "src/parser_proc.y"
1464 psi_assert_stmt_free(&(yypminor->yy201));
1465 #line 1466 "src/parser_proc.c"
1466 }
1467 break;
1468 case 159: /* set_stmt */
1469 {
1470 #line 157 "src/parser_proc.y"
1471 psi_set_stmt_free(&(yypminor->yy358));
1472 #line 1473 "src/parser_proc.c"
1473 }
1474 break;
1475 case 160: /* set_exp */
1476 {
1477 #line 159 "src/parser_proc.y"
1478 psi_set_exp_free(&(yypminor->yy180));
1479 #line 1480 "src/parser_proc.c"
1480 }
1481 break;
1482 case 162: /* set_func */
1483 {
1484 #line 163 "src/parser_proc.y"
1485 psi_set_func_free(&(yypminor->yy362));
1486 #line 1487 "src/parser_proc.c"
1487 }
1488 break;
1489 case 163: /* return_stmt */
1490 {
1491 #line 165 "src/parser_proc.y"
1492 psi_return_stmt_free(&(yypminor->yy342));
1493 #line 1494 "src/parser_proc.c"
1494 }
1495 break;
1496 case 164: /* free_stmt */
1497 {
1498 #line 167 "src/parser_proc.y"
1499 psi_free_stmt_free(&(yypminor->yy220));
1500 #line 1501 "src/parser_proc.c"
1501 }
1502 break;
1503 case 166: /* free_exp */
1504 {
1505 #line 171 "src/parser_proc.y"
1506 psi_free_exp_free(&(yypminor->yy146));
1507 #line 1508 "src/parser_proc.c"
1508 }
1509 break;
1510 case 167: /* impl_type */
1511 {
1512 #line 173 "src/parser_proc.y"
1513 psi_impl_type_free(&(yypminor->yy246));
1514 #line 1515 "src/parser_proc.c"
1515 }
1516 break;
1517 case 168: /* cpp_exp */
1518 {
1519 #line 175 "src/parser_proc.y"
1520 psi_cpp_exp_free(&(yypminor->yy274));
1521 #line 1522 "src/parser_proc.c"
1522 }
1523 break;
1524 case 169: /* cpp_macro_decl */
1525 {
1526 #line 177 "src/parser_proc.y"
1527 psi_cpp_macro_decl_free(&(yypminor->yy134));
1528 #line 1529 "src/parser_proc.c"
1529 }
1530 break;
1531 /********* End destructor definitions *****************************************/
1532 default: break; /* If no destructor action specified: do nothing */
1533 }
1534 }
1535
1536 /*
1537 ** Pop the parser's stack once.
1538 **
1539 ** If there is a destructor routine associated with the token which
1540 ** is popped from the stack, then call it.
1541 */
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--;
1547 #ifndef NDEBUG
1548 if( yyTraceFILE ){
1549 fprintf(yyTraceFILE,"%sPopping %s\n",
1550 yyTracePrompt,
1551 yyTokenName[yytos->major]);
1552 }
1553 #endif
1554 yy_destructor(pParser, yytos->major, &yytos->minor);
1555 }
1556
1557 /*
1558 ** Clear all secondary memory allocations from the parser
1559 */
1560 void ParseFinalize(void *p){
1561 yyParser *pParser = (yyParser*)p;
1562 while( pParser->yytos>pParser->yystack ) yy_pop_parser_stack(pParser);
1563 #if YYSTACKDEPTH<=0
1564 if( pParser->yystack!=&pParser->yystk0 ) free(pParser->yystack);
1565 #endif
1566 }
1567
1568 #ifndef Parse_ENGINEALWAYSONSTACK
1569 /*
1570 ** Deallocate and destroy a parser. Destructors are called for
1571 ** all stack elements before shutting the parser down.
1572 **
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.
1576 */
1577 void ParseFree(
1578 void *p, /* The parser to be deleted */
1579 void (*freeProc)(void*) /* Function used to reclaim memory */
1580 ){
1581 #ifndef YYPARSEFREENEVERNULL
1582 if( p==0 ) return;
1583 #endif
1584 ParseFinalize(p);
1585 (*freeProc)(p);
1586 }
1587 #endif /* Parse_ENGINEALWAYSONSTACK */
1588
1589 /*
1590 ** Return the peak depth of the stack for a parser.
1591 */
1592 #ifdef YYTRACKMAXSTACKDEPTH
1593 int ParseStackPeak(void *p){
1594 yyParser *pParser = (yyParser*)p;
1595 return pParser->yyhwm;
1596 }
1597 #endif
1598
1599 /*
1600 ** Find the appropriate action for a parser given the terminal
1601 ** look-ahead token iLookAhead.
1602 */
1603 static unsigned int yy_find_shift_action(
1604 yyParser *pParser, /* The parser */
1605 YYCODETYPE iLookAhead /* The look-ahead token */
1606 ){
1607 int i;
1608 int stateno = pParser->yytos->stateno;
1609
1610 if( stateno>=YY_MIN_REDUCE ) return stateno;
1611 assert( stateno <= YY_SHIFT_COUNT );
1612 do{
1613 i = yy_shift_ofst[stateno];
1614 assert( iLookAhead!=YYNOCODE );
1615 i += iLookAhead;
1616 if( i<0 || i>=YY_ACTTAB_COUNT || yy_lookahead[i]!=iLookAhead ){
1617 #ifdef YYFALLBACK
1618 YYCODETYPE iFallback; /* Fallback token */
1619 if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0])
1620 && (iFallback = yyFallback[iLookAhead])!=0 ){
1621 #ifndef NDEBUG
1622 if( yyTraceFILE ){
1623 fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n",
1624 yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]);
1625 }
1626 #endif
1627 assert( yyFallback[iFallback]==0 ); /* Fallback loop must terminate */
1628 iLookAhead = iFallback;
1629 continue;
1630 }
1631 #endif
1632 #ifdef YYWILDCARD
1633 {
1634 int j = i - iLookAhead + YYWILDCARD;
1635 if(
1636 #if YY_SHIFT_MIN+YYWILDCARD<0
1637 j>=0 &&
1638 #endif
1639 #if YY_SHIFT_MAX+YYWILDCARD>=YY_ACTTAB_COUNT
1640 j<YY_ACTTAB_COUNT &&
1641 #endif
1642 yy_lookahead[j]==YYWILDCARD && iLookAhead>0
1643 ){
1644 #ifndef NDEBUG
1645 if( yyTraceFILE ){
1646 fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n",
1647 yyTracePrompt, yyTokenName[iLookAhead],
1648 yyTokenName[YYWILDCARD]);
1649 }
1650 #endif /* NDEBUG */
1651 return yy_action[j];
1652 }
1653 }
1654 #endif /* YYWILDCARD */
1655 return yy_default[stateno];
1656 }else{
1657 return yy_action[i];
1658 }
1659 }while(1);
1660 }
1661
1662 /*
1663 ** Find the appropriate action for a parser given the non-terminal
1664 ** look-ahead token iLookAhead.
1665 */
1666 static int yy_find_reduce_action(
1667 int stateno, /* Current state number */
1668 YYCODETYPE iLookAhead /* The look-ahead token */
1669 ){
1670 int i;
1671 #ifdef YYERRORSYMBOL
1672 if( stateno>YY_REDUCE_COUNT ){
1673 return yy_default[stateno];
1674 }
1675 #else
1676 assert( stateno<=YY_REDUCE_COUNT );
1677 #endif
1678 i = yy_reduce_ofst[stateno];
1679 assert( i!=YY_REDUCE_USE_DFLT );
1680 assert( iLookAhead!=YYNOCODE );
1681 i += iLookAhead;
1682 #ifdef YYERRORSYMBOL
1683 if( i<0 || i>=YY_ACTTAB_COUNT || yy_lookahead[i]!=iLookAhead ){
1684 return yy_default[stateno];
1685 }
1686 #else
1687 assert( i>=0 && i<YY_ACTTAB_COUNT );
1688 assert( yy_lookahead[i]==iLookAhead );
1689 #endif
1690 return yy_action[i];
1691 }
1692
1693 /*
1694 ** The following routine is called if the stack overflows.
1695 */
1696 static void yyStackOverflow(yyParser *yypParser){
1697 ParseARG_FETCH;
1698 #ifndef NDEBUG
1699 if( yyTraceFILE ){
1700 fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt);
1701 }
1702 #endif
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 */
1709 }
1710
1711 /*
1712 ** Print tracing information for a SHIFT action
1713 */
1714 #ifndef NDEBUG
1715 static void yyTraceShift(yyParser *yypParser, int yyNewState){
1716 if( yyTraceFILE ){
1717 if( yyNewState<YYNSTATE ){
1718 fprintf(yyTraceFILE,"%sShift '%s', go to state %d\n",
1719 yyTracePrompt,yyTokenName[yypParser->yytos->major],
1720 yyNewState);
1721 }else{
1722 fprintf(yyTraceFILE,"%sShift '%s'\n",
1723 yyTracePrompt,yyTokenName[yypParser->yytos->major]);
1724 }
1725 }
1726 }
1727 #else
1728 # define yyTraceShift(X,Y)
1729 #endif
1730
1731 /*
1732 ** Perform a shift action.
1733 */
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 */
1739 ){
1740 yyStackEntry *yytos;
1741 yypParser->yytos++;
1742 #ifdef YYTRACKMAXSTACKDEPTH
1743 if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){
1744 yypParser->yyhwm++;
1745 assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack) );
1746 }
1747 #endif
1748 #if YYSTACKDEPTH>0
1749 if( yypParser->yytos>=&yypParser->yystack[YYSTACKDEPTH] ){
1750 yypParser->yytos--;
1751 yyStackOverflow(yypParser);
1752 return;
1753 }
1754 #else
1755 if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz] ){
1756 if( yyGrowStack(yypParser) ){
1757 yypParser->yytos--;
1758 yyStackOverflow(yypParser);
1759 return;
1760 }
1761 }
1762 #endif
1763 if( yyNewState > YY_MAX_SHIFT ){
1764 yyNewState += YY_MIN_REDUCE - YY_MIN_SHIFTREDUCE;
1765 }
1766 yytos = yypParser->yytos;
1767 yytos->stateno = (YYACTIONTYPE)yyNewState;
1768 yytos->major = (YYCODETYPE)yyMajor;
1769 yytos->minor.yy0 = yyMinor;
1770 yyTraceShift(yypParser, yyNewState);
1771 }
1772
1773 /* The following table contains information about every rule that
1774 ** is used during the reduce.
1775 */
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 */
1779 } yyRuleInfo[] = {
1780 { 181, 3 },
1781 { 168, 2 },
1782 { 168, 2 },
1783 { 168, 2 },
1784 { 168, 1 },
1785 { 168, 1 },
1786 { 168, 2 },
1787 { 168, 3 },
1788 { 169, 0 },
1789 { 169, 1 },
1790 { 169, 2 },
1791 { 172, 4 },
1792 { 173, 0 },
1793 { 173, 1 },
1794 { 173, 3 },
1795 { 169, 1 },
1796 { 170, 1 },
1797 { 170, 2 },
1798 { 168, 2 },
1799 { 168, 2 },
1800 { 171, 3 },
1801 { 171, 2 },
1802 { 171, 3 },
1803 { 171, 2 },
1804 { 171, 4 },
1805 { 171, 1 },
1806 { 171, 1 },
1807 { 171, 4 },
1808 { 175, 0 },
1809 { 175, 1 },
1810 { 175, 3 },
1811 { 181, 3 },
1812 { 181, 1 },
1813 { 181, 1 },
1814 { 181, 1 },
1815 { 181, 1 },
1816 { 181, 1 },
1817 { 181, 1 },
1818 { 181, 1 },
1819 { 182, 0 },
1820 { 182, 1 },
1821 { 119, 0 },
1822 { 119, 7 },
1823 { 183, 2 },
1824 { 184, 2 },
1825 { 185, 2 },
1826 { 113, 4 },
1827 { 114, 1 },
1828 { 114, 3 },
1829 { 115, 3 },
1830 { 115, 1 },
1831 { 116, 3 },
1832 { 117, 1 },
1833 { 117, 1 },
1834 { 118, 4 },
1835 { 120, 4 },
1836 { 121, 1 },
1837 { 122, 6 },
1838 { 123, 3 },
1839 { 124, 4 },
1840 { 124, 4 },
1841 { 124, 2 },
1842 { 125, 1 },
1843 { 126, 3 },
1844 { 125, 2 },
1845 { 125, 1 },
1846 { 127, 6 },
1847 { 127, 8 },
1848 { 128, 1 },
1849 { 128, 2 },
1850 { 125, 7 },
1851 { 125, 8 },
1852 { 129, 1 },
1853 { 186, 0 },
1854 { 186, 3 },
1855 { 130, 2 },
1856 { 130, 3 },
1857 { 131, 1 },
1858 { 131, 3 },
1859 { 132, 2 },
1860 { 125, 7 },
1861 { 132, 3 },
1862 { 132, 4 },
1863 { 133, 0 },
1864 { 133, 1 },
1865 { 133, 1 },
1866 { 133, 3 },
1867 { 134, 1 },
1868 { 134, 2 },
1869 { 135, 2 },
1870 { 135, 3 },
1871 { 136, 0 },
1872 { 136, 7 },
1873 { 187, 1 },
1874 { 187, 2 },
1875 { 188, 0 },
1876 { 188, 1 },
1877 { 187, 1 },
1878 { 187, 2 },
1879 { 189, 0 },
1880 { 189, 1 },
1881 { 189, 2 },
1882 { 190, 0 },
1883 { 190, 1 },
1884 { 137, 2 },
1885 { 137, 2 },
1886 { 137, 1 },
1887 { 137, 1 },
1888 { 137, 1 },
1889 { 137, 2 },
1890 { 137, 2 },
1891 { 137, 2 },
1892 { 137, 1 },
1893 { 138, 1 },
1894 { 138, 2 },
1895 { 139, 4 },
1896 { 139, 5 },
1897 { 140, 7 },
1898 { 140, 8 },
1899 { 140, 13 },
1900 { 141, 1 },
1901 { 142, 2 },
1902 { 167, 1 },
1903 { 143, 2 },
1904 { 143, 4 },
1905 { 144, 1 },
1906 { 144, 3 },
1907 { 146, 1 },
1908 { 146, 2 },
1909 { 147, 1 },
1910 { 147, 1 },
1911 { 147, 1 },
1912 { 147, 1 },
1913 { 147, 1 },
1914 { 148, 1 },
1915 { 148, 1 },
1916 { 149, 1 },
1917 { 149, 3 },
1918 { 149, 3 },
1919 { 149, 2 },
1920 { 156, 1 },
1921 { 156, 2 },
1922 { 156, 1 },
1923 { 156, 1 },
1924 { 156, 2 },
1925 { 156, 1 },
1926 { 156, 2 },
1927 { 156, 1 },
1928 { 156, 2 },
1929 { 156, 3 },
1930 { 150, 3 },
1931 { 150, 6 },
1932 { 155, 8 },
1933 { 151, 6 },
1934 { 152, 4 },
1935 { 152, 6 },
1936 { 157, 1 },
1937 { 157, 3 },
1938 { 153, 0 },
1939 { 153, 1 },
1940 { 154, 1 },
1941 { 154, 3 },
1942 { 191, 1 },
1943 { 191, 1 },
1944 { 162, 4 },
1945 { 162, 6 },
1946 { 162, 6 },
1947 { 160, 1 },
1948 { 160, 1 },
1949 { 161, 1 },
1950 { 161, 3 },
1951 { 160, 3 },
1952 { 159, 3 },
1953 { 163, 3 },
1954 { 164, 3 },
1955 { 165, 1 },
1956 { 165, 3 },
1957 { 166, 4 },
1958 { 158, 3 },
1959 { 176, 0 },
1960 { 176, 1 },
1961 { 177, 0 },
1962 { 177, 1 },
1963 { 178, 1 },
1964 { 178, 2 },
1965 { 179, 1 },
1966 { 180, 1 },
1967 { 180, 2 },
1968 { 181, 1 },
1969 { 181, 1 },
1970 { 181, 1 },
1971 };
1972
1973 static void yy_accept(yyParser*); /* Forward Declaration */
1974
1975 /*
1976 ** Perform a reduce action and the shift that must immediately
1977 ** follow the reduce.
1978 */
1979 static void yy_reduce(
1980 yyParser *yypParser, /* The parser */
1981 unsigned int yyruleno /* Number of the rule by which to reduce */
1982 ){
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 */
1987 ParseARG_FETCH;
1988 yymsp = yypParser->yytos;
1989 #ifndef NDEBUG
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);
1994 }
1995 #endif /* NDEBUG */
1996
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 ){
2003 yypParser->yyhwm++;
2004 assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack));
2005 }
2006 #endif
2007 #if YYSTACKDEPTH>0
2008 if( yypParser->yytos>=&yypParser->yystack[YYSTACKDEPTH-1] ){
2009 yyStackOverflow(yypParser);
2010 return;
2011 }
2012 #else
2013 if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){
2014 if( yyGrowStack(yypParser) ){
2015 yyStackOverflow(yypParser);
2016 return;
2017 }
2018 yymsp = yypParser->yytos;
2019 }
2020 #endif
2021 }
2022
2023 switch( yyruleno ){
2024 /* Beginning here are the reduction cases. A typical example
2025 ** follows:
2026 ** case 0:
2027 ** #line <lineno> <grammarfile>
2028 ** { ... } // User supplied code
2029 ** #line <lineno> <thisfile>
2030 ** break;
2031 */
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"
2037 {
2038 P->cpp.exp = yymsp[-1].minor.yy274;
2039 }
2040 #line 2041 "src/parser_proc.c"
2041 yy_destructor(yypParser,76,&yymsp[0].minor);
2042 }
2043 break;
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"
2049 {
2050 yylhsminor.yy274 = psi_cpp_exp_init(yymsp[-1].minor.yy0->type, yymsp[0].minor.yy0);
2051 yylhsminor.yy274->token = yymsp[-1].minor.yy0;
2052 }
2053 #line 2054 "src/parser_proc.c"
2054 yymsp[-1].minor.yy274 = yylhsminor.yy274;
2055 break;
2056 case 4: /* cpp_exp ::= ENDIF */
2057 case 5: /* cpp_exp ::= ELSE */ yytestcase(yyruleno==5);
2058 #line 214 "src/parser_proc.y"
2059 {
2060 yylhsminor.yy274 = psi_cpp_exp_init(yymsp[0].minor.yy0->type, NULL);
2061 yylhsminor.yy274->token = yymsp[0].minor.yy0;
2062 }
2063 #line 2064 "src/parser_proc.c"
2064 yymsp[0].minor.yy274 = yylhsminor.yy274;
2065 break;
2066 case 7: /* cpp_exp ::= DEFINE NAME cpp_macro_decl */
2067 #line 226 "src/parser_proc.y"
2068 {
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;
2072 }
2073 #line 2074 "src/parser_proc.c"
2074 yymsp[-2].minor.yy274 = yylhsminor.yy274;
2075 break;
2076 case 8: /* cpp_macro_decl ::= */
2077 #line 231 "src/parser_proc.y"
2078 {
2079 yymsp[1].minor.yy134 = psi_cpp_macro_decl_init(NULL, NULL, NULL);
2080 }
2081 #line 2082 "src/parser_proc.c"
2082 break;
2083 case 9: /* cpp_macro_decl ::= cpp_macro_sig */
2084 #line 234 "src/parser_proc.y"
2085 {
2086 yylhsminor.yy134 = psi_cpp_macro_decl_init(yymsp[0].minor.yy179, NULL, NULL);
2087 }
2088 #line 2089 "src/parser_proc.c"
2089 yymsp[0].minor.yy134 = yylhsminor.yy134;
2090 break;
2091 case 10: /* cpp_macro_decl ::= cpp_macro_sig cpp_macro_decl_tokens */
2092 #line 237 "src/parser_proc.y"
2093 {
2094 yylhsminor.yy134 = psi_cpp_macro_decl_init(yymsp[-1].minor.yy179, yymsp[0].minor.yy179, NULL);
2095 }
2096 #line 2097 "src/parser_proc.c"
2097 yymsp[-1].minor.yy134 = yylhsminor.yy134;
2098 break;
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"
2102 {
2103 yymsp[-3].minor.yy179 = yymsp[-1].minor.yy179;
2104 }
2105 #line 2106 "src/parser_proc.c"
2106 yy_destructor(yypParser,86,&yymsp[-2].minor);
2107 yy_destructor(yypParser,87,&yymsp[0].minor);
2108 }
2109 break;
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"
2114 {
2115 yymsp[1].minor.yy179 = NULL;
2116 }
2117 #line 2118 "src/parser_proc.c"
2118 break;
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"
2122 {
2123 yylhsminor.yy179 = psi_plist_add(psi_plist_init((void (*)(void *)) psi_token_free), &yymsp[0].minor.yy0);
2124 }
2125 #line 2126 "src/parser_proc.c"
2126 yymsp[0].minor.yy179 = yylhsminor.yy179;
2127 break;
2128 case 14: /* cpp_macro_sig_args ::= cpp_macro_sig_args COMMA NAME */
2129 #line 249 "src/parser_proc.y"
2130 {
2131 yylhsminor.yy179 = psi_plist_add(yymsp[-2].minor.yy179, &yymsp[0].minor.yy0);
2132 }
2133 #line 2134 "src/parser_proc.c"
2134 yy_destructor(yypParser,88,&yymsp[-1].minor);
2135 yymsp[-2].minor.yy179 = yylhsminor.yy179;
2136 break;
2137 case 15: /* cpp_macro_decl ::= cpp_macro_decl_tokens */
2138 #line 252 "src/parser_proc.y"
2139 {
2140 yylhsminor.yy134 = psi_cpp_macro_decl_init(NULL, yymsp[0].minor.yy179, NULL);
2141 }
2142 #line 2143 "src/parser_proc.c"
2143 yymsp[0].minor.yy134 = yylhsminor.yy134;
2144 break;
2145 case 17: /* cpp_macro_decl_tokens ::= cpp_macro_decl_tokens ANY */
2146 #line 258 "src/parser_proc.y"
2147 {
2148 yylhsminor.yy179 = psi_plist_add(yymsp[-1].minor.yy179, &yymsp[0].minor.yy0);
2149 }
2150 #line 2151 "src/parser_proc.c"
2151 yymsp[-1].minor.yy179 = yylhsminor.yy179;
2152 break;
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"
2156 {
2157 yylhsminor.yy274 = psi_cpp_exp_init(yymsp[-1].minor.yy0->type, yymsp[0].minor.yy207);
2158 yylhsminor.yy274->token = yymsp[-1].minor.yy0;
2159 }
2160 #line 2161 "src/parser_proc.c"
2161 yymsp[-1].minor.yy274 = yylhsminor.yy274;
2162 break;
2163 case 20: /* cpp_macro_exp ::= LPAREN cpp_macro_exp RPAREN */
2164 #line 269 "src/parser_proc.y"
2165 {
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;
2168 }
2169 #line 2170 "src/parser_proc.c"
2170 yy_destructor(yypParser,87,&yymsp[0].minor);
2171 yymsp[-2].minor.yy207 = yylhsminor.yy207;
2172 break;
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"
2176 {
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;
2179 }
2180 #line 2181 "src/parser_proc.c"
2181 yymsp[-1].minor.yy207 = yylhsminor.yy207;
2182 break;
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"
2186 {
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;
2189 }
2190 #line 2191 "src/parser_proc.c"
2191 yymsp[-2].minor.yy207 = yylhsminor.yy207;
2192 break;
2193 case 23: /* cpp_macro_exp ::= DEFINED NAME */
2194 { yy_destructor(yypParser,91,&yymsp[-1].minor);
2195 #line 281 "src/parser_proc.y"
2196 {
2197 {
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;
2201 }
2202 }
2203 #line 2204 "src/parser_proc.c"
2204 }
2205 break;
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"
2209 {
2210 {
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;
2214 }
2215 }
2216 #line 2217 "src/parser_proc.c"
2217 yy_destructor(yypParser,86,&yymsp[-2].minor);
2218 yy_destructor(yypParser,87,&yymsp[0].minor);
2219 }
2220 break;
2221 case 25: /* cpp_macro_exp ::= NUMBER|NSNAME */
2222 #line 295 "src/parser_proc.y"
2223 {
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);
2227 }
2228 #line 2229 "src/parser_proc.c"
2229 yymsp[0].minor.yy207 = yylhsminor.yy207;
2230 break;
2231 case 26: /* cpp_macro_exp ::= NAME */
2232 #line 300 "src/parser_proc.y"
2233 {
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);
2237 }
2238 #line 2239 "src/parser_proc.c"
2239 yymsp[0].minor.yy207 = yylhsminor.yy207;
2240 break;
2241 case 27: /* cpp_macro_exp ::= NAME LPAREN cpp_macro_call_args RPAREN */
2242 #line 305 "src/parser_proc.y"
2243 {
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;
2247 }
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;
2252 break;
2253 case 29: /* cpp_macro_call_args ::= cpp_macro_exp */
2254 #line 313 "src/parser_proc.y"
2255 {
2256 yylhsminor.yy179 = psi_plist_add(psi_plist_init((void (*)(void *)) psi_num_exp_free), &yymsp[0].minor.yy207);
2257 }
2258 #line 2259 "src/parser_proc.c"
2259 yymsp[0].minor.yy179 = yylhsminor.yy179;
2260 break;
2261 case 30: /* cpp_macro_call_args ::= cpp_macro_call_args COMMA cpp_macro_exp */
2262 #line 316 "src/parser_proc.y"
2263 {
2264 yylhsminor.yy179 = psi_plist_add(yymsp[-2].minor.yy179, &yymsp[0].minor.yy207);
2265 }
2266 #line 2267 "src/parser_proc.c"
2267 yy_destructor(yypParser,88,&yymsp[-1].minor);
2268 yymsp[-2].minor.yy179 = yylhsminor.yy179;
2269 break;
2270 case 31: /* block ::= LIB QUOTED_STRING EOS */
2271 #line 319 "src/parser_proc.y"
2272 {
2273 if (P->file.ln) {
2274 P->error(PSI_DATA(P), yymsp[-2].minor.yy0, PSI_WARNING, "Extra 'lib %s' statement has no effect", yymsp[-1].minor.yy0->text);
2275 } else {
2276 P->file.ln = strndup(yymsp[-1].minor.yy0->text + 1, yymsp[-1].minor.yy0->size - 2);
2277 }
2278 free(yymsp[-1].minor.yy0);
2279 free(yymsp[-2].minor.yy0);
2280 }
2281 #line 2282 "src/parser_proc.c"
2282 yy_destructor(yypParser,75,&yymsp[0].minor);
2283 break;
2284 case 32: /* block ::= decl */
2285 #line 328 "src/parser_proc.y"
2286 {
2287 if (!P->decls) {
2288 P->decls = psi_plist_init((psi_plist_dtor) psi_decl_free);
2289 }
2290 P->decls = psi_plist_add(P->decls, &yymsp[0].minor.yy303);
2291 }
2292 #line 2293 "src/parser_proc.c"
2293 break;
2294 case 33: /* block ::= impl */
2295 #line 334 "src/parser_proc.y"
2296 {
2297 if (!P->impls) {
2298 P->impls = psi_plist_init((psi_plist_dtor) psi_impl_free);
2299 }
2300 P->impls = psi_plist_add(P->impls, &yymsp[0].minor.yy49);
2301 }
2302 #line 2303 "src/parser_proc.c"
2303 break;
2304 case 34: /* block ::= decl_typedef */
2305 #line 340 "src/parser_proc.y"
2306 {
2307 if (!P->types) {
2308 P->types = psi_plist_init((psi_plist_dtor) psi_decl_arg_free);
2309 }
2310 P->types = psi_plist_add(P->types, &yymsp[0].minor.yy320);
2311 switch (yymsp[0].minor.yy320->type->type) {
2312 case PSI_T_STRUCT:
2313 if (yymsp[0].minor.yy320->type->real.strct) {
2314 if (!P->structs) {
2315 P->structs = psi_plist_init((psi_plist_dtor) psi_decl_struct_free);
2316 }
2317 P->structs = psi_plist_add(P->structs, &yymsp[0].minor.yy320->type->real.strct);
2318 }
2319 break;
2320 case PSI_T_UNION:
2321 if (yymsp[0].minor.yy320->type->real.unn) {
2322 if (!P->unions) {
2323 P->unions = psi_plist_init((psi_plist_dtor) psi_decl_union_free);
2324 }
2325 P->unions = psi_plist_add(P->unions, &yymsp[0].minor.yy320->type->real.unn);
2326 }
2327 break;
2328 case PSI_T_ENUM:
2329 if (yymsp[0].minor.yy320->type->real.enm) {
2330 if (!P->enums) {
2331 P->enums = psi_plist_init((psi_plist_dtor) psi_decl_enum_free);
2332 }
2333 P->enums = psi_plist_add(P->enums, &yymsp[0].minor.yy320->type->real.enm);
2334 }
2335 break;
2336 }
2337 }
2338 #line 2339 "src/parser_proc.c"
2339 break;
2340 case 35: /* block ::= constant */
2341 #line 372 "src/parser_proc.y"
2342 {
2343 if (!P->consts) {
2344 P->consts = psi_plist_init((psi_plist_dtor) psi_const_free);
2345 }
2346 P->consts = psi_plist_add(P->consts, &yymsp[0].minor.yy38);
2347 }
2348 #line 2349 "src/parser_proc.c"
2349 break;
2350 case 36: /* block ::= decl_struct */
2351 #line 378 "src/parser_proc.y"
2352 {
2353 if (!P->structs) {
2354 P->structs = psi_plist_init((psi_plist_dtor) psi_decl_struct_free);
2355 }
2356 P->structs = psi_plist_add(P->structs, &yymsp[0].minor.yy324);
2357 }
2358 #line 2359 "src/parser_proc.c"
2359 break;
2360 case 37: /* block ::= decl_union */
2361 #line 384 "src/parser_proc.y"
2362 {
2363 if (!P->unions) {
2364 P->unions = psi_plist_init((psi_plist_dtor) psi_decl_union_free);
2365 }
2366 P->unions = psi_plist_add(P->unions, &yymsp[0].minor.yy15);
2367 }
2368 #line 2369 "src/parser_proc.c"
2369 break;
2370 case 38: /* block ::= decl_enum */
2371 #line 390 "src/parser_proc.y"
2372 {
2373 if (!P->enums) {
2374 P->enums = psi_plist_init((psi_plist_dtor) psi_decl_enum_free);
2375 }
2376 P->enums = psi_plist_add(P->enums, &yymsp[0].minor.yy323);
2377 }
2378 #line 2379 "src/parser_proc.c"
2379 break;
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"
2386 {
2387 yymsp[1].minor.yy0 = NULL;
2388 }
2389 #line 2390 "src/parser_proc.c"
2390 break;
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"
2400 {
2401 yylhsminor.yy0 = yymsp[0].minor.yy0;
2402 }
2403 #line 2404 "src/parser_proc.c"
2404 yymsp[0].minor.yy0 = yylhsminor.yy0;
2405 break;
2406 case 41: /* align_and_size ::= */
2407 #line 402 "src/parser_proc.y"
2408 {
2409 yymsp[1].minor.yy239.pos = 0;
2410 yymsp[1].minor.yy239.len = 0;
2411 }
2412 #line 2413 "src/parser_proc.c"
2413 break;
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"
2417 {
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);
2422 }
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);
2428 }
2429 break;
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"
2434 {
2435 if (yymsp[0].minor.yy0) {
2436 yylhsminor.yy0 = yymsp[0].minor.yy0;
2437 free(yymsp[-1].minor.yy0);
2438 } else {
2439 char digest[17];
2440 psi_token_hash(yymsp[-1].minor.yy0, digest);
2441 yylhsminor.yy0 = psi_token_append("@", yymsp[-1].minor.yy0, 1, digest);
2442 }
2443 }
2444 #line 2445 "src/parser_proc.c"
2445 yymsp[-1].minor.yy0 = yylhsminor.yy0;
2446 break;
2447 case 46: /* decl_enum ::= enum_name LBRACE decl_enum_items RBRACE */
2448 #line 442 "src/parser_proc.y"
2449 {
2450 yylhsminor.yy323 = psi_decl_enum_init(yymsp[-3].minor.yy0->text, yymsp[-1].minor.yy179);
2451 yylhsminor.yy323->token = yymsp[-3].minor.yy0;
2452 }
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;
2457 break;
2458 case 47: /* decl_enum_items ::= decl_enum_item */
2459 #line 446 "src/parser_proc.y"
2460 {
2461 yylhsminor.yy179 = psi_plist_add(psi_plist_init((psi_plist_dtor) psi_decl_enum_item_free),
2462 &yymsp[0].minor.yy169);
2463 }
2464 #line 2465 "src/parser_proc.c"
2465 yymsp[0].minor.yy179 = yylhsminor.yy179;
2466 break;
2467 case 48: /* decl_enum_items ::= decl_enum_items COMMA decl_enum_item */
2468 #line 450 "src/parser_proc.y"
2469 {
2470 yylhsminor.yy179 = psi_plist_add(yymsp[-2].minor.yy179, &yymsp[0].minor.yy169);
2471 }
2472 #line 2473 "src/parser_proc.c"
2473 yy_destructor(yypParser,88,&yymsp[-1].minor);
2474 yymsp[-2].minor.yy179 = yylhsminor.yy179;
2475 break;
2476 case 49: /* decl_enum_item ::= NAME EQUALS num_exp */
2477 #line 453 "src/parser_proc.y"
2478 {
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;
2481 }
2482 #line 2483 "src/parser_proc.c"
2483 yy_destructor(yypParser,98,&yymsp[-1].minor);
2484 yymsp[-2].minor.yy169 = yylhsminor.yy169;
2485 break;
2486 case 50: /* decl_enum_item ::= NAME */
2487 #line 457 "src/parser_proc.y"
2488 {
2489 yylhsminor.yy169 = psi_decl_enum_item_init(yymsp[0].minor.yy0->text, NULL);
2490 yylhsminor.yy169->token = yymsp[0].minor.yy0;
2491 }
2492 #line 2493 "src/parser_proc.c"
2493 yymsp[0].minor.yy169 = yylhsminor.yy169;
2494 break;
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"
2498 {
2499 yymsp[-2].minor.yy179 = yymsp[-1].minor.yy179;
2500 }
2501 #line 2502 "src/parser_proc.c"
2502 yy_destructor(yypParser,97,&yymsp[0].minor);
2503 }
2504 break;
2505 case 52: /* decl_struct_args ::= decl_struct_args_block */
2506 #line 464 "src/parser_proc.y"
2507 {
2508 yylhsminor.yy179 = yymsp[0].minor.yy179;
2509 }
2510 #line 2511 "src/parser_proc.c"
2511 yymsp[0].minor.yy179 = yylhsminor.yy179;
2512 break;
2513 case 53: /* decl_struct_args ::= EOS */
2514 { yy_destructor(yypParser,75,&yymsp[0].minor);
2515 #line 467 "src/parser_proc.y"
2516 {
2517 yymsp[0].minor.yy179 = psi_plist_init((psi_plist_dtor) psi_decl_arg_free);
2518 }
2519 #line 2520 "src/parser_proc.c"
2520 }
2521 break;
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"
2525 {
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;
2530 }
2531 #line 2532 "src/parser_proc.c"
2532 }
2533 break;
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"
2537 {
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;
2542 }
2543 #line 2544 "src/parser_proc.c"
2544 }
2545 break;
2546 case 56: /* const_type ::= BOOL|INT|FLOAT|STRING */
2547 #line 482 "src/parser_proc.y"
2548 {
2549 yylhsminor.yy351 = psi_const_type_init(yymsp[0].minor.yy0->type, yymsp[0].minor.yy0->text);
2550 free(yymsp[0].minor.yy0);
2551 }
2552 #line 2553 "src/parser_proc.c"
2553 yymsp[0].minor.yy351 = yylhsminor.yy351;
2554 break;
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"
2558 {
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;
2561 }
2562 #line 2563 "src/parser_proc.c"
2563 yy_destructor(yypParser,98,&yymsp[-2].minor);
2564 yy_destructor(yypParser,75,&yymsp[0].minor);
2565 }
2566 break;
2567 case 58: /* decl_typedef ::= TYPEDEF decl_typedef_body EOS */
2568 #line 490 "src/parser_proc.y"
2569 {
2570 yylhsminor.yy320 = yymsp[-1].minor.yy320;
2571 yylhsminor.yy320->token = yymsp[-2].minor.yy0;
2572 }
2573 #line 2574 "src/parser_proc.c"
2574 yy_destructor(yypParser,75,&yymsp[0].minor);
2575 yymsp[-2].minor.yy320 = yylhsminor.yy320;
2576 break;
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"
2579 {
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;
2586 }
2587 #line 2588 "src/parser_proc.c"
2588 yymsp[-3].minor.yy320 = yylhsminor.yy320;
2589 break;
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"
2592 {
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;
2599 }
2600 #line 2601 "src/parser_proc.c"
2601 yymsp[-3].minor.yy320 = yylhsminor.yy320;
2602 break;
2603 case 61: /* decl_typedef_body_ex ::= decl_enum NAME */
2604 #line 510 "src/parser_proc.y"
2605 {
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;
2610 }
2611 #line 2612 "src/parser_proc.c"
2612 yymsp[-1].minor.yy320 = yylhsminor.yy320;
2613 break;
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"
2618 {
2619 yylhsminor.yy320 = yymsp[0].minor.yy320;
2620 }
2621 #line 2622 "src/parser_proc.c"
2622 yymsp[0].minor.yy320 = yylhsminor.yy320;
2623 break;
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"
2627 {
2628 yymsp[-2].minor.yy179 = yymsp[-1].minor.yy179;
2629 }
2630 #line 2631 "src/parser_proc.c"
2631 yy_destructor(yypParser,87,&yymsp[0].minor);
2632 }
2633 break;
2634 case 64: /* decl_typedef_body ::= decl_func decl_typedef_body_fn_args */
2635 #line 522 "src/parser_proc.y"
2636 {
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);
2640 }
2641 #line 2642 "src/parser_proc.c"
2642 yymsp[-1].minor.yy320 = yylhsminor.yy320;
2643 break;
2644 case 66