php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
ffi_parser.c
Go to the documentation of this file.
1/*
2 +----------------------------------------------------------------------+
3 | Copyright (c) The PHP Group |
4 +----------------------------------------------------------------------+
5 | This source file is subject to version 3.01 of the PHP license, |
6 | that is bundled with this package in the file LICENSE, and is |
7 | available through the world-wide-web at the following url: |
8 | https://www.php.net/license/3_01.txt |
9 | If you did not receive a copy of the PHP license and are unable to |
10 | obtain it through the world-wide-web, please send a note to |
11 | license@php.net so we can mail you a copy immediately. |
12 +----------------------------------------------------------------------+
13 | Author: Dmitry Stogov <dmitry@zend.com> |
14 +----------------------------------------------------------------------+
15*/
16
17#ifdef HAVE_CONFIG_H
18# include "config.h"
19#endif
20
21#include "php.h"
22#include "php_ffi.h"
23
24#include <stdio.h>
25#include <stdlib.h>
26#include <string.h>
27
28#define yy_buf FFI_G(buf)
29#define yy_end FFI_G(end)
30#define yy_pos FFI_G(pos)
31#define yy_text FFI_G(text)
32#define yy_line FFI_G(line)
33
34/* forward declarations */
35static void yy_error(const char *msg);
36static void yy_error_sym(const char *msg, int sym);
37static void yy_error_str(const char *msg, const char *str);
38
39#define YYPOS cpos
40#define YYEND cend
41
42#define YY_EOF 0
43#define YY___EXTENSION__ 1
44#define YY___ASM__ 2
45#define YY__LPAREN 3
46#define YY__RPAREN 4
47#define YY__COMMA 5
48#define YY__SEMICOLON 6
49#define YY_TYPEDEF 7
50#define YY_EXTERN 8
51#define YY_STATIC 9
52#define YY_AUTO 10
53#define YY_REGISTER 11
54#define YY_INLINE 12
55#define YY___INLINE 13
56#define YY___INLINE__ 14
57#define YY__NORETURN 15
58#define YY__ALIGNAS 16
59#define YY_CONST 17
60#define YY___CONST 18
61#define YY___CONST__ 19
62#define YY_RESTRICT 20
63#define YY___RESTRICT 21
64#define YY___RESTRICT__ 22
65#define YY_VOLATILE 23
66#define YY___VOLATILE 24
67#define YY___VOLATILE__ 25
68#define YY__ATOMIC 26
69#define YY_VOID 27
70#define YY_CHAR 28
71#define YY_SHORT 29
72#define YY_INT 30
73#define YY_LONG 31
74#define YY_FLOAT 32
75#define YY_DOUBLE 33
76#define YY_SIGNED 34
77#define YY_UNSIGNED 35
78#define YY__BOOL 36
79#define YY__COMPLEX 37
80#define YY_COMPLEX 38
81#define YY___COMPLEX 39
82#define YY___COMPLEX__ 40
83#define YY_STRUCT 41
84#define YY_UNION 42
85#define YY__LBRACE 43
86#define YY__RBRACE 44
87#define YY__COLON 45
88#define YY_ENUM 46
89#define YY__EQUAL 47
90#define YY__STAR 48
91#define YY__LBRACK 49
92#define YY__RBRACK 50
93#define YY__POINT_POINT_POINT 51
94#define YY___ATTRIBUTE 52
95#define YY___ATTRIBUTE__ 53
96#define YY___DECLSPEC 54
97#define YY___CDECL 55
98#define YY___STDCALL 56
99#define YY___FASTCALL 57
100#define YY___THISCALL 58
101#define YY___VECTORCALL 59
102#define YY__POINT 60
103#define YY__QUERY 61
104#define YY__BAR_BAR 62
105#define YY__AND_AND 63
106#define YY__BAR 64
107#define YY__UPARROW 65
108#define YY__AND 66
109#define YY__EQUAL_EQUAL 67
110#define YY__BANG_EQUAL 68
111#define YY__LESS 69
112#define YY__GREATER 70
113#define YY__LESS_EQUAL 71
114#define YY__GREATER_EQUAL 72
115#define YY__LESS_LESS 73
116#define YY__GREATER_GREATER 74
117#define YY__PLUS 75
118#define YY__MINUS 76
119#define YY__SLASH 77
120#define YY__PERCENT 78
121#define YY__MINUS_GREATER 79
122#define YY__PLUS_PLUS 80
123#define YY__MINUS_MINUS 81
124#define YY__TILDE 82
125#define YY__BANG 83
126#define YY_SIZEOF 84
127#define YY__ALIGNOF 85
128#define YY___ALIGNOF 86
129#define YY___ALIGNOF__ 87
130#define YY___RESTICT 88
131#define YY_ID 89
132#define YY_OCTNUMBER 90
133#define YY_DECNUMBER 91
134#define YY_HEXNUMBER 92
135#define YY_FLOATNUMBER 93
136#define YY_STRING 94
137#define YY_CHARACTER 95
138#define YY_EOL 96
139#define YY_WS 97
140#define YY_ONE_LINE_COMMENT 98
141#define YY_COMMENT 99
142
143static const char * sym_name[] = {
144 "<EOF>",
145 "__extension__",
146 "__asm__",
147 "(",
148 ")",
149 ",",
150 ";",
151 "typedef",
152 "extern",
153 "static",
154 "auto",
155 "register",
156 "inline",
157 "__inline",
158 "__inline__",
159 "_Noreturn",
160 "_Alignas",
161 "const",
162 "__const",
163 "__const__",
164 "restrict",
165 "__restrict",
166 "__restrict__",
167 "volatile",
168 "__volatile",
169 "__volatile__",
170 "_Atomic",
171 "void",
172 "char",
173 "short",
174 "int",
175 "long",
176 "float",
177 "double",
178 "signed",
179 "unsigned",
180 "_Bool",
181 "_Complex",
182 "complex",
183 "__complex",
184 "__complex__",
185 "struct",
186 "union",
187 "{",
188 "}",
189 ":",
190 "enum",
191 "=",
192 "*",
193 "[",
194 "]",
195 "...",
196 "__attribute",
197 "__attribute__",
198 "__declspec",
199 "__cdecl",
200 "__stdcall",
201 "__fastcall",
202 "__thiscall",
203 "__vectorcall",
204 ".",
205 "?",
206 "||",
207 "&&",
208 "|",
209 "^",
210 "&",
211 "==",
212 "!=",
213 "<",
214 ">",
215 "<=",
216 ">=",
217 "<<",
218 ">>",
219 "+",
220 "-",
221 "/",
222 "%",
223 "->",
224 "++",
225 "--",
226 "~",
227 "!",
228 "sizeof",
229 "_Alignof",
230 "__alignof",
231 "__alignof__",
232 "__restict",
233 "<ID>",
234 "<OCTNUMBER>",
235 "<DECNUMBER>",
236 "<HEXNUMBER>",
237 "<FLOATNUMBER>",
238 "<STRING>",
239 "<CHARACTER>",
240 "<EOL>",
241 "<WS>",
242 "<ONE_LINE_COMMENT>",
243 "<COMMENT>",
244 NULL
245};
246
247#define YY_IN_SET(sym, set, bitset) \
248 (bitset[sym>>3] & (1 << (sym & 0x7)))
249
250size_t yy_escape(char *buf, unsigned char ch)
251{
252 switch (ch) {
253 case '\\': buf[0] = '\\'; buf[1] = '\\'; return 2;
254 case '\'': buf[0] = '\\'; buf[1] = '\''; return 2;
255 case '\"': buf[0] = '\\'; buf[1] = '\"'; return 2;
256 case '\a': buf[0] = '\\'; buf[1] = '\a'; return 2;
257 case '\b': buf[0] = '\\'; buf[1] = '\b'; return 2;
258 case 27: buf[0] = '\\'; buf[1] = 27; return 2;
259 case '\f': buf[0] = '\\'; buf[1] = '\f'; return 2;
260 case '\n': buf[0] = '\\'; buf[1] = '\n'; return 2;
261 case '\r': buf[0] = '\\'; buf[1] = '\r'; return 2;
262 case '\t': buf[0] = '\\'; buf[1] = '\t'; return 2;
263 case '\v': buf[0] = '\\'; buf[1] = '\v'; return 2;
264 case '\?': buf[0] = '\\'; buf[1] = 0x3f; return 2;
265 default: break;
266 }
267 if (ch < 32 || ch >= 127) {
268 buf[0] = '\\';
269 buf[1] = '0' + ((ch >> 6) % 8);
270 buf[2] = '0' + ((ch >> 3) % 8);
271 buf[3] = '0' + (ch % 8);
272 return 4;
273 } else {
274 buf[0] = ch;
275 return 1;
276 }
277}
278
279const char *yy_escape_char(char *buf, unsigned char ch)
280{
281 size_t len = yy_escape(buf, ch);
282 buf[len] = 0;
283 return buf;
284}
285
286const char *yy_escape_string(char *buf, size_t size, const unsigned char *str, size_t n)
287{
288 size_t i = 0;
289 size_t pos = 0;
290 size_t len;
291
292 while (i < n) {
293 if (pos + 8 > size) {
294 buf[pos++] = '.';
295 buf[pos++] = '.';
296 buf[pos++] = '.';
297 break;
298 }
299 len = yy_escape(buf + pos, str[i]);
300 i++;
301 pos += len;
302 }
303 buf[pos] = 0;
304 return buf;
305}
306
307static int skip_EOL(int sym);
308static int skip_WS(int sym);
309static int skip_ONE_LINE_COMMENT(int sym);
310static int skip_COMMENT(int sym);
311static int get_sym(void);
312static int check_nested_declarator_start(int sym);
313static int check_type_name_start(int sym);
314static int check_ID(int sym);
315static int parse_declarations(int sym);
316static int parse_declaration_specifiers(int sym, zend_ffi_dcl *dcl);
317static int parse_specifier_qualifier_list(int sym, zend_ffi_dcl *dcl);
318static int parse_type_qualifier_list(int sym, zend_ffi_dcl *dcl);
319static int parse_type_qualifier(int sym, zend_ffi_dcl *dcl);
320static int parse_type_specifier(int sym, zend_ffi_dcl *dcl);
321static int parse_struct_or_union_specifier(int sym, zend_ffi_dcl *dcl);
322static int parse_struct_contents(int sym, zend_ffi_dcl *dcl);
323static int parse_struct_declaration(int sym, zend_ffi_dcl *struct_dcl);
324static int parse_struct_declarator(int sym, zend_ffi_dcl *struct_dcl, zend_ffi_dcl *field_dcl);
325static int parse_enum_specifier(int sym, zend_ffi_dcl *dcl);
326static int parse_enumerator_list(int sym, zend_ffi_dcl *enum_dcl);
327static int parse_enumerator(int sym, zend_ffi_dcl *enum_dcl, int64_t *min, int64_t *max, int64_t *last);
328static int parse_declarator(int sym, zend_ffi_dcl *dcl, const char **name, size_t *name_len);
329static int parse_abstract_declarator(int sym, zend_ffi_dcl *dcl);
330static int parse_parameter_declarator(int sym, zend_ffi_dcl *dcl, const char **name, size_t *name_len);
331static int parse_pointer(int sym, zend_ffi_dcl *dcl);
332static int parse_array_or_function_declarators(int sym, zend_ffi_dcl *dcl, zend_ffi_dcl *nested_dcl);
333static int parse_parameter_declaration(int sym, HashTable **args);
334static int parse_type_name(int sym, zend_ffi_dcl *dcl);
335static int parse_attributes(int sym, zend_ffi_dcl *dcl);
336static int parse_attrib(int sym, zend_ffi_dcl *dcl);
337static int parse_initializer(int sym);
338static int parse_designation(int sym);
339static int parse_expr_list(int sym);
340static int parse_expression(int sym, zend_ffi_val *val);
341static int parse_assignment_expression(int sym, zend_ffi_val *val);
342static int parse_constant_expression(int sym, zend_ffi_val *val);
343static int parse_conditional_expression(int sym, zend_ffi_val *val);
344static int parse_logical_or_expression(int sym, zend_ffi_val *val);
345static int parse_logical_and_expression(int sym, zend_ffi_val *val);
346static int parse_inclusive_or_expression(int sym, zend_ffi_val *val);
347static int parse_exclusive_or_expression(int sym, zend_ffi_val *val);
348static int parse_and_expression(int sym, zend_ffi_val *val);
349static int parse_equality_expression(int sym, zend_ffi_val *val);
350static int parse_relational_expression(int sym, zend_ffi_val *val);
351static int parse_shift_expression(int sym, zend_ffi_val *val);
352static int parse_additive_expression(int sym, zend_ffi_val *val);
353static int parse_multiplicative_expression(int sym, zend_ffi_val *val);
354static int parse_cast_expression(int sym, zend_ffi_val *val);
355static int parse_unary_expression(int sym, zend_ffi_val *val);
356static int parse_ID(int sym, const char **name, size_t *name_len);
357static int parse_OCTNUMBER(int sym, zend_ffi_val *val);
358static int parse_DECNUMBER(int sym, zend_ffi_val *val);
359static int parse_HEXNUMBER(int sym, zend_ffi_val *val);
360static int parse_FLOATNUMBER(int sym, zend_ffi_val *val);
361static int parse_STRING(int sym, zend_ffi_val *val);
362static int parse_CHARACTER(int sym, zend_ffi_val *val);
363static int synpred_1(int sym);
364static int synpred_2(int sym);
365static int synpred_3(int sym);
366static int synpred_4(int sym);
367static int synpred_5(int sym);
368static int synpred_6(int sym);
369
370static int get_skip_sym(void) {
371 char buf[64];
372 int ch;
373 int ret;
374 int accept = -1;
375 const unsigned char *accept_pos;
376 const unsigned char *cpos = yy_pos;
377 const unsigned char *cend = yy_end;
378
379_yy_state_start:
380 yy_text = YYPOS;
381 ch = *YYPOS;
382 switch (ch) {
383 case '_':
384 ch = *++YYPOS;
385 switch (ch) {
386 case '_':
387 ch = *++YYPOS;
388 switch (ch) {
389 case 'e':
390 ch = *++YYPOS;
391 if (ch != 'x') goto _yy_tunnel_9;
392 ch = *++YYPOS;
393 if (ch != 't') goto _yy_tunnel_9;
394 ch = *++YYPOS;
395 if (ch != 'e') goto _yy_tunnel_9;
396 ch = *++YYPOS;
397 if (ch != 'n') goto _yy_tunnel_9;
398 ch = *++YYPOS;
399 if (ch != 's') goto _yy_tunnel_9;
400 ch = *++YYPOS;
401 if (ch != 'i') goto _yy_tunnel_9;
402 ch = *++YYPOS;
403 if (ch != 'o') goto _yy_tunnel_9;
404 ch = *++YYPOS;
405 if (ch != 'n') goto _yy_tunnel_9;
406 ch = *++YYPOS;
407 if (ch != '_') goto _yy_tunnel_9;
408 ch = *++YYPOS;
409 if (ch != '_') goto _yy_tunnel_9;
411 goto _yy_state_390;
412 case 'i':
413 ch = *++YYPOS;
414 if (ch != 'n') goto _yy_tunnel_9;
415 ch = *++YYPOS;
416 if (ch != 'l') goto _yy_tunnel_9;
417 ch = *++YYPOS;
418 if (ch != 'i') goto _yy_tunnel_9;
419 ch = *++YYPOS;
420 if (ch != 'n') goto _yy_tunnel_9;
421 ch = *++YYPOS;
422 if (ch != 'e') goto _yy_tunnel_9;
423 ch = *++YYPOS;
424 if (ch != '_') {ret = YY___INLINE; goto _yy_tunnel_390;}
425 ch = *++YYPOS;
426 if (ch != '_') goto _yy_tunnel_9;
428 goto _yy_state_390;
429 case 'a':
430 ch = *++YYPOS;
431 if (ch == 'l') {
432 ch = *++YYPOS;
433 if (ch != 'i') goto _yy_tunnel_9;
434 ch = *++YYPOS;
435 if (ch != 'g') goto _yy_tunnel_9;
436 ch = *++YYPOS;
437 if (ch != 'n') goto _yy_tunnel_9;
438 ch = *++YYPOS;
439 if (ch != 'o') goto _yy_tunnel_9;
440 ch = *++YYPOS;
441 if (ch != 'f') goto _yy_tunnel_9;
442 ch = *++YYPOS;
443 if (ch != '_') {ret = YY___ALIGNOF; goto _yy_tunnel_390;}
444 ch = *++YYPOS;
445 if (ch != '_') goto _yy_tunnel_9;
447 goto _yy_state_390;
448 } else if (ch == 's') {
449 ch = *++YYPOS;
450 if (ch != 'm') goto _yy_tunnel_9;
451 ch = *++YYPOS;
452 if (ch != '_') goto _yy_tunnel_9;
453 ch = *++YYPOS;
454 if (ch != '_') goto _yy_tunnel_9;
455 ret = YY___ASM__;
456 goto _yy_state_390;
457 } else if (ch == 't') {
458 ch = *++YYPOS;
459 if (ch != 't') goto _yy_tunnel_9;
460 ch = *++YYPOS;
461 if (ch != 'r') goto _yy_tunnel_9;
462 ch = *++YYPOS;
463 if (ch != 'i') goto _yy_tunnel_9;
464 ch = *++YYPOS;
465 if (ch != 'b') goto _yy_tunnel_9;
466 ch = *++YYPOS;
467 if (ch != 'u') goto _yy_tunnel_9;
468 ch = *++YYPOS;
469 if (ch != 't') goto _yy_tunnel_9;
470 ch = *++YYPOS;
471 if (ch != 'e') goto _yy_tunnel_9;
472 ch = *++YYPOS;
473 if (ch != '_') {ret = YY___ATTRIBUTE; goto _yy_tunnel_390;}
474 ch = *++YYPOS;
475 if (ch != '_') goto _yy_tunnel_9;
477 goto _yy_state_390;
478 } else {
479 goto _yy_tunnel_9;
480 }
481 case 'c':
482 ch = *++YYPOS;
483 if (ch == 'd') {
484 ch = *++YYPOS;
485 if (ch != 'e') goto _yy_tunnel_9;
486 ch = *++YYPOS;
487 if (ch != 'c') goto _yy_tunnel_9;
488 ch = *++YYPOS;
489 if (ch != 'l') goto _yy_tunnel_9;
490 ret = YY___CDECL;
491 goto _yy_state_390;
492 } else if (ch == 'o') {
493 ch = *++YYPOS;
494 if (ch == 'm') {
495 ch = *++YYPOS;
496 if (ch != 'p') goto _yy_tunnel_9;
497 ch = *++YYPOS;
498 if (ch != 'l') goto _yy_tunnel_9;
499 ch = *++YYPOS;
500 if (ch != 'e') goto _yy_tunnel_9;
501 ch = *++YYPOS;
502 if (ch != 'x') goto _yy_tunnel_9;
503 ch = *++YYPOS;
504 if (ch != '_') {ret = YY___COMPLEX; goto _yy_tunnel_390;}
505 ch = *++YYPOS;
506 if (ch != '_') goto _yy_tunnel_9;
508 goto _yy_state_390;
509 } else if (ch == 'n') {
510 ch = *++YYPOS;
511 if (ch != 's') goto _yy_tunnel_9;
512 ch = *++YYPOS;
513 if (ch != 't') goto _yy_tunnel_9;
514 ch = *++YYPOS;
515 if (ch != '_') {ret = YY___CONST; goto _yy_tunnel_390;}
516 ch = *++YYPOS;
517 if (ch != '_') goto _yy_tunnel_9;
519 goto _yy_state_390;
520 } else {
521 goto _yy_tunnel_9;
522 }
523 } else {
524 goto _yy_tunnel_9;
525 }
526 case 'd':
527 ch = *++YYPOS;
528 if (ch != 'e') goto _yy_tunnel_9;
529 ch = *++YYPOS;
530 if (ch != 'c') goto _yy_tunnel_9;
531 ch = *++YYPOS;
532 if (ch != 'l') goto _yy_tunnel_9;
533 ch = *++YYPOS;
534 if (ch != 's') goto _yy_tunnel_9;
535 ch = *++YYPOS;
536 if (ch != 'p') goto _yy_tunnel_9;
537 ch = *++YYPOS;
538 if (ch != 'e') goto _yy_tunnel_9;
539 ch = *++YYPOS;
540 if (ch != 'c') goto _yy_tunnel_9;
542 goto _yy_state_390;
543 case 'f':
544 ch = *++YYPOS;
545 if (ch != 'a') goto _yy_tunnel_9;
546 ch = *++YYPOS;
547 if (ch != 's') goto _yy_tunnel_9;
548 ch = *++YYPOS;
549 if (ch != 't') goto _yy_tunnel_9;
550 ch = *++YYPOS;
551 if (ch != 'c') goto _yy_tunnel_9;
552 ch = *++YYPOS;
553 if (ch != 'a') goto _yy_tunnel_9;
554 ch = *++YYPOS;
555 if (ch != 'l') goto _yy_tunnel_9;
556 ch = *++YYPOS;
557 if (ch != 'l') goto _yy_tunnel_9;
559 goto _yy_state_390;
560 case 'r':
561 ch = *++YYPOS;
562 if (ch != 'e') goto _yy_tunnel_9;
563 ch = *++YYPOS;
564 if (ch != 's') goto _yy_tunnel_9;
565 ch = *++YYPOS;
566 if (ch != 't') goto _yy_tunnel_9;
567 ch = *++YYPOS;
568 if (ch == 'i') {
569 ch = *++YYPOS;
570 if (ch != 'c') goto _yy_tunnel_9;
571 ch = *++YYPOS;
572 if (ch != 't') goto _yy_tunnel_9;
574 goto _yy_state_390;
575 } else if (ch == 'r') {
576 ch = *++YYPOS;
577 if (ch != 'i') goto _yy_tunnel_9;
578 ch = *++YYPOS;
579 if (ch != 'c') goto _yy_tunnel_9;
580 ch = *++YYPOS;
581 if (ch != 't') goto _yy_tunnel_9;
582 ch = *++YYPOS;
583 if (ch != '_') {ret = YY___RESTRICT; goto _yy_tunnel_390;}
584 ch = *++YYPOS;
585 if (ch != '_') goto _yy_tunnel_9;
587 goto _yy_state_390;
588 } else {
589 goto _yy_tunnel_9;
590 }
591 case 's':
592 ch = *++YYPOS;
593 if (ch != 't') goto _yy_tunnel_9;
594 ch = *++YYPOS;
595 if (ch != 'd') goto _yy_tunnel_9;
596 ch = *++YYPOS;
597 if (ch != 'c') goto _yy_tunnel_9;
598 ch = *++YYPOS;
599 if (ch != 'a') goto _yy_tunnel_9;
600 ch = *++YYPOS;
601 if (ch != 'l') goto _yy_tunnel_9;
602 ch = *++YYPOS;
603 if (ch != 'l') goto _yy_tunnel_9;
605 goto _yy_state_390;
606 case 't':
607 ch = *++YYPOS;
608 if (ch != 'h') goto _yy_tunnel_9;
609 ch = *++YYPOS;
610 if (ch != 'i') goto _yy_tunnel_9;
611 ch = *++YYPOS;
612 if (ch != 's') goto _yy_tunnel_9;
613 ch = *++YYPOS;
614 if (ch != 'c') goto _yy_tunnel_9;
615 ch = *++YYPOS;
616 if (ch != 'a') goto _yy_tunnel_9;
617 ch = *++YYPOS;
618 if (ch != 'l') goto _yy_tunnel_9;
619 ch = *++YYPOS;
620 if (ch != 'l') goto _yy_tunnel_9;
622 goto _yy_state_390;
623 case 'v':
624 ch = *++YYPOS;
625 if (ch == 'e') {
626 ch = *++YYPOS;
627 if (ch != 'c') goto _yy_tunnel_9;
628 ch = *++YYPOS;
629 if (ch != 't') goto _yy_tunnel_9;
630 ch = *++YYPOS;
631 if (ch != 'o') goto _yy_tunnel_9;
632 ch = *++YYPOS;
633 if (ch != 'r') goto _yy_tunnel_9;
634 ch = *++YYPOS;
635 if (ch != 'c') goto _yy_tunnel_9;
636 ch = *++YYPOS;
637 if (ch != 'a') goto _yy_tunnel_9;
638 ch = *++YYPOS;
639 if (ch != 'l') goto _yy_tunnel_9;
640 ch = *++YYPOS;
641 if (ch != 'l') goto _yy_tunnel_9;
643 goto _yy_state_390;
644 } else if (ch == 'o') {
645 ch = *++YYPOS;
646 if (ch != 'l') goto _yy_tunnel_9;
647 ch = *++YYPOS;
648 if (ch != 'a') goto _yy_tunnel_9;
649 ch = *++YYPOS;
650 if (ch != 't') goto _yy_tunnel_9;
651 ch = *++YYPOS;
652 if (ch != 'i') goto _yy_tunnel_9;
653 ch = *++YYPOS;
654 if (ch != 'l') goto _yy_tunnel_9;
655 ch = *++YYPOS;
656 if (ch != 'e') goto _yy_tunnel_9;
657 ch = *++YYPOS;
658 if (ch != '_') {ret = YY___VOLATILE; goto _yy_tunnel_390;}
659 ch = *++YYPOS;
660 if (ch != '_') goto _yy_tunnel_9;
662 goto _yy_state_390;
663 } else {
664 goto _yy_tunnel_9;
665 }
666 default:
667 goto _yy_tunnel_9;
668 }
669 case 'N':
670 ch = *++YYPOS;
671 if (ch != 'o') goto _yy_tunnel_9;
672 ch = *++YYPOS;
673 if (ch != 'r') goto _yy_tunnel_9;
674 ch = *++YYPOS;
675 if (ch != 'e') goto _yy_tunnel_9;
676 ch = *++YYPOS;
677 if (ch != 't') goto _yy_tunnel_9;
678 ch = *++YYPOS;
679 if (ch != 'u') goto _yy_tunnel_9;
680 ch = *++YYPOS;
681 if (ch != 'r') goto _yy_tunnel_9;
682 ch = *++YYPOS;
683 if (ch != 'n') goto _yy_tunnel_9;
685 goto _yy_state_390;
686 case 'A':
687 ch = *++YYPOS;
688 if (ch == 'l') {
689 ch = *++YYPOS;
690 if (ch != 'i') goto _yy_tunnel_9;
691 ch = *++YYPOS;
692 if (ch != 'g') goto _yy_tunnel_9;
693 ch = *++YYPOS;
694 if (ch != 'n') goto _yy_tunnel_9;
695 ch = *++YYPOS;
696 if (ch == 'a') {
697 ch = *++YYPOS;
698 if (ch != 's') goto _yy_tunnel_9;
700 goto _yy_state_390;
701 } else if (ch == 'o') {
702 ch = *++YYPOS;
703 if (ch != 'f') goto _yy_tunnel_9;
705 goto _yy_state_390;
706 } else {
707 goto _yy_tunnel_9;
708 }
709 } else if (ch == 't') {
710 ch = *++YYPOS;
711 if (ch != 'o') goto _yy_tunnel_9;
712 ch = *++YYPOS;
713 if (ch != 'm') goto _yy_tunnel_9;
714 ch = *++YYPOS;
715 if (ch != 'i') goto _yy_tunnel_9;
716 ch = *++YYPOS;
717 if (ch != 'c') goto _yy_tunnel_9;
718 ret = YY__ATOMIC;
719 goto _yy_state_390;
720 } else {
721 goto _yy_tunnel_9;
722 }
723 case 'B':
724 ch = *++YYPOS;
725 if (ch != 'o') goto _yy_tunnel_9;
726 ch = *++YYPOS;
727 if (ch != 'o') goto _yy_tunnel_9;
728 ch = *++YYPOS;
729 if (ch != 'l') goto _yy_tunnel_9;
730 ret = YY__BOOL;
731 goto _yy_state_390;
732 case 'C':
733 ch = *++YYPOS;
734 if (ch != 'o') goto _yy_tunnel_9;
735 ch = *++YYPOS;
736 if (ch != 'm') goto _yy_tunnel_9;
737 ch = *++YYPOS;
738 if (ch != 'p') goto _yy_tunnel_9;
739 ch = *++YYPOS;
740 if (ch != 'l') goto _yy_tunnel_9;
741 ch = *++YYPOS;
742 if (ch != 'e') goto _yy_tunnel_9;
743 ch = *++YYPOS;
744 if (ch != 'x') goto _yy_tunnel_9;
746 goto _yy_state_390;
747 default:
748 goto _yy_tunnel_9;
749 }
750 case 't':
751 ch = *++YYPOS;
752 if (ch != 'y') goto _yy_tunnel_9;
753 ch = *++YYPOS;
754 if (ch != 'p') goto _yy_tunnel_9;
755 ch = *++YYPOS;
756 if (ch != 'e') goto _yy_tunnel_9;
757 ch = *++YYPOS;
758 if (ch != 'd') goto _yy_tunnel_9;
759 ch = *++YYPOS;
760 if (ch != 'e') goto _yy_tunnel_9;
761 ch = *++YYPOS;
762 if (ch != 'f') goto _yy_tunnel_9;
763 ret = YY_TYPEDEF;
764 goto _yy_state_390;
765 case 'e':
766 ch = *++YYPOS;
767 if (ch == 'x') {
768 ch = *++YYPOS;
769 if (ch != 't') goto _yy_tunnel_9;
770 ch = *++YYPOS;
771 if (ch != 'e') goto _yy_tunnel_9;
772 ch = *++YYPOS;
773 if (ch != 'r') goto _yy_tunnel_9;
774 ch = *++YYPOS;
775 if (ch != 'n') goto _yy_tunnel_9;
776 ret = YY_EXTERN;
777 goto _yy_state_390;
778 } else if (ch == 'n') {
779 ch = *++YYPOS;
780 if (ch != 'u') goto _yy_tunnel_9;
781 ch = *++YYPOS;
782 if (ch != 'm') goto _yy_tunnel_9;
783 ret = YY_ENUM;
784 goto _yy_state_390;
785 } else {
786 goto _yy_tunnel_9;
787 }
788 case 's':
789 ch = *++YYPOS;
790 if (ch == 't') {
791 ch = *++YYPOS;
792 if (ch == 'a') {
793 ch = *++YYPOS;
794 if (ch != 't') goto _yy_tunnel_9;
795 ch = *++YYPOS;
796 if (ch != 'i') goto _yy_tunnel_9;
797 ch = *++YYPOS;
798 if (ch != 'c') goto _yy_tunnel_9;
799 ret = YY_STATIC;
800 goto _yy_state_390;
801 } else if (ch == 'r') {
802 ch = *++YYPOS;
803 if (ch != 'u') goto _yy_tunnel_9;
804 ch = *++YYPOS;
805 if (ch != 'c') goto _yy_tunnel_9;
806 ch = *++YYPOS;
807 if (ch != 't') goto _yy_tunnel_9;
808 ret = YY_STRUCT;
809 goto _yy_state_390;
810 } else {
811 goto _yy_tunnel_9;
812 }
813 } else if (ch == 'h') {
814 ch = *++YYPOS;
815 if (ch != 'o') goto _yy_tunnel_9;
816 ch = *++YYPOS;
817 if (ch != 'r') goto _yy_tunnel_9;
818 ch = *++YYPOS;
819 if (ch != 't') goto _yy_tunnel_9;
820 ret = YY_SHORT;
821 goto _yy_state_390;
822 } else if (ch == 'i') {
823 ch = *++YYPOS;
824 if (ch == 'g') {
825 ch = *++YYPOS;
826 if (ch != 'n') goto _yy_tunnel_9;
827 ch = *++YYPOS;
828 if (ch != 'e') goto _yy_tunnel_9;
829 ch = *++YYPOS;
830 if (ch != 'd') goto _yy_tunnel_9;
831 ret = YY_SIGNED;
832 goto _yy_state_390;
833 } else if (ch == 'z') {
834 ch = *++YYPOS;
835 if (ch != 'e') goto _yy_tunnel_9;
836 ch = *++YYPOS;
837 if (ch != 'o') goto _yy_tunnel_9;
838 ch = *++YYPOS;
839 if (ch != 'f') goto _yy_tunnel_9;
840 ret = YY_SIZEOF;
841 goto _yy_state_390;
842 } else {
843 goto _yy_tunnel_9;
844 }
845 } else {
846 goto _yy_tunnel_9;
847 }
848 case 'a':
849 ch = *++YYPOS;
850 if (ch != 'u') goto _yy_tunnel_9;
851 ch = *++YYPOS;
852 if (ch != 't') goto _yy_tunnel_9;
853 ch = *++YYPOS;
854 if (ch != 'o') goto _yy_tunnel_9;
855 ret = YY_AUTO;
856 goto _yy_state_390;
857 case 'r':
858 ch = *++YYPOS;
859 if (ch != 'e') goto _yy_tunnel_9;
860 ch = *++YYPOS;
861 if (ch == 'g') {
862 ch = *++YYPOS;
863 if (ch != 'i') goto _yy_tunnel_9;
864 ch = *++YYPOS;
865 if (ch != 's') goto _yy_tunnel_9;
866 ch = *++YYPOS;
867 if (ch != 't') goto _yy_tunnel_9;
868 ch = *++YYPOS;
869 if (ch != 'e') goto _yy_tunnel_9;
870 ch = *++YYPOS;
871 if (ch != 'r') goto _yy_tunnel_9;
873 goto _yy_state_390;
874 } else if (ch == 's') {
875 ch = *++YYPOS;
876 if (ch != 't') goto _yy_tunnel_9;
877 ch = *++YYPOS;
878 if (ch != 'r') goto _yy_tunnel_9;
879 ch = *++YYPOS;
880 if (ch != 'i') goto _yy_tunnel_9;
881 ch = *++YYPOS;
882 if (ch != 'c') goto _yy_tunnel_9;
883 ch = *++YYPOS;
884 if (ch != 't') goto _yy_tunnel_9;
886 goto _yy_state_390;
887 } else {
888 goto _yy_tunnel_9;
889 }
890 case 'i':
891 ch = *++YYPOS;
892 if (ch != 'n') goto _yy_tunnel_9;
893 ch = *++YYPOS;
894 if (ch == 'l') {
895 ch = *++YYPOS;
896 if (ch != 'i') goto _yy_tunnel_9;
897 ch = *++YYPOS;
898 if (ch != 'n') goto _yy_tunnel_9;
899 ch = *++YYPOS;
900 if (ch != 'e') goto _yy_tunnel_9;
901 ret = YY_INLINE;
902 goto _yy_state_390;
903 } else if (ch == 't') {
904 ret = YY_INT;
905 goto _yy_state_390;
906 } else {
907 goto _yy_tunnel_9;
908 }
909 case '(':
910 YYPOS++;
911 ret = YY__LPAREN;
912 goto _yy_fin;
913 case 'A':
914 case 'B':
915 case 'C':
916 case 'D':
917 case 'E':
918 case 'F':
919 case 'G':
920 case 'H':
921 case 'I':
922 case 'J':
923 case 'K':
924 case 'M':
925 case 'N':
926 case 'O':
927 case 'P':
928 case 'Q':
929 case 'R':
930 case 'S':
931 case 'T':
932 case 'V':
933 case 'W':
934 case 'X':
935 case 'Y':
936 case 'Z':
937 case 'b':
938 case 'g':
939 case 'h':
940 case 'j':
941 case 'k':
942 case 'm':
943 case 'n':
944 case 'o':
945 case 'p':
946 case 'q':
947 case 'w':
948 case 'x':
949 case 'y':
950 case 'z':
951 goto _yy_state_9;
952 case 'L':
953 case 'U':
954 ch = *++YYPOS;
955 if (ch == '"') {
956 goto _yy_state_27;
957 } else if (ch == '\'') {
958 goto _yy_state_28;
959 } else {
960 goto _yy_tunnel_9;
961 }
962 case 'c':
963 ch = *++YYPOS;
964 if (ch == 'h') {
965 ch = *++YYPOS;
966 if (ch != 'a') goto _yy_tunnel_9;
967 ch = *++YYPOS;
968 if (ch != 'r') goto _yy_tunnel_9;
969 ret = YY_CHAR;
970 goto _yy_state_390;
971 } else if (ch == 'o') {
972 ch = *++YYPOS;
973 if (ch == 'm') {
974 ch = *++YYPOS;
975 if (ch != 'p') goto _yy_tunnel_9;
976 ch = *++YYPOS;
977 if (ch != 'l') goto _yy_tunnel_9;
978 ch = *++YYPOS;
979 if (ch != 'e') goto _yy_tunnel_9;
980 ch = *++YYPOS;
981 if (ch != 'x') goto _yy_tunnel_9;
982 ret = YY_COMPLEX;
983 goto _yy_state_390;
984 } else if (ch == 'n') {
985 ch = *++YYPOS;
986 if (ch != 's') goto _yy_tunnel_9;
987 ch = *++YYPOS;
988 if (ch != 't') goto _yy_tunnel_9;
989 ret = YY_CONST;
990 goto _yy_state_390;
991 } else {
992 goto _yy_tunnel_9;
993 }
994 } else {
995 goto _yy_tunnel_9;
996 }
997 case 'd':
998 ch = *++YYPOS;
999 if (ch != 'o') goto _yy_tunnel_9;
1000 ch = *++YYPOS;
1001 if (ch != 'u') goto _yy_tunnel_9;
1002 ch = *++YYPOS;
1003 if (ch != 'b') goto _yy_tunnel_9;
1004 ch = *++YYPOS;
1005 if (ch != 'l') goto _yy_tunnel_9;
1006 ch = *++YYPOS;
1007 if (ch != 'e') goto _yy_tunnel_9;
1008 ret = YY_DOUBLE;
1009 goto _yy_state_390;
1010 case 'f':
1011 ch = *++YYPOS;
1012 if (ch != 'l') goto _yy_tunnel_9;
1013 ch = *++YYPOS;
1014 if (ch != 'o') goto _yy_tunnel_9;
1015 ch = *++YYPOS;
1016 if (ch != 'a') goto _yy_tunnel_9;
1017 ch = *++YYPOS;
1018 if (ch != 't') goto _yy_tunnel_9;
1019 ret = YY_FLOAT;
1020 goto _yy_state_390;
1021 case 'l':
1022 ch = *++YYPOS;
1023 if (ch != 'o') goto _yy_tunnel_9;
1024 ch = *++YYPOS;
1025 if (ch != 'n') goto _yy_tunnel_9;
1026 ch = *++YYPOS;
1027 if (ch != 'g') goto _yy_tunnel_9;
1028 ret = YY_LONG;
1029 goto _yy_state_390;
1030 case 'u':
1031 ch = *++YYPOS;
1032 if (ch == 'n') {
1033 ch = *++YYPOS;
1034 if (ch == 'i') {
1035 ch = *++YYPOS;
1036 if (ch != 'o') goto _yy_tunnel_9;
1037 ch = *++YYPOS;
1038 if (ch != 'n') goto _yy_tunnel_9;
1039 ret = YY_UNION;
1040 goto _yy_state_390;
1041 } else if (ch == 's') {
1042 ch = *++YYPOS;
1043 if (ch != 'i') goto _yy_tunnel_9;
1044 ch = *++YYPOS;
1045 if (ch != 'g') goto _yy_tunnel_9;
1046 ch = *++YYPOS;
1047 if (ch != 'n') goto _yy_tunnel_9;
1048 ch = *++YYPOS;
1049 if (ch != 'e') goto _yy_tunnel_9;
1050 ch = *++YYPOS;
1051 if (ch != 'd') goto _yy_tunnel_9;
1052 ret = YY_UNSIGNED;
1053 goto _yy_state_390;
1054 } else {
1055 goto _yy_tunnel_9;
1056 }
1057 } else if (ch == '8') {
1058 ch = *++YYPOS;
1059 if (ch != '"') goto _yy_tunnel_9;
1060 goto _yy_state_27;
1061 } else if (ch == '"') {
1062 goto _yy_state_27;
1063 } else if (ch == '\'') {
1064 goto _yy_state_28;
1065 } else {
1066 goto _yy_tunnel_9;
1067 }
1068 case 'v':
1069 ch = *++YYPOS;
1070 if (ch != 'o') goto _yy_tunnel_9;
1071 ch = *++YYPOS;
1072 if (ch == 'i') {
1073 ch = *++YYPOS;
1074 if (ch != 'd') goto _yy_tunnel_9;
1075 ret = YY_VOID;
1076 goto _yy_state_390;
1077 } else if (ch == 'l') {
1078 ch = *++YYPOS;
1079 if (ch != 'a') goto _yy_tunnel_9;
1080 ch = *++YYPOS;
1081 if (ch != 't') goto _yy_tunnel_9;
1082 ch = *++YYPOS;
1083 if (ch != 'i') goto _yy_tunnel_9;
1084 ch = *++YYPOS;
1085 if (ch != 'l') goto _yy_tunnel_9;
1086 ch = *++YYPOS;
1087 if (ch != 'e') goto _yy_tunnel_9;
1088 ret = YY_VOLATILE;
1089 goto _yy_state_390;
1090 } else {
1091 goto _yy_tunnel_9;
1092 }
1093 case ')':
1094 YYPOS++;
1095 ret = YY__RPAREN;
1096 goto _yy_fin;
1097 case '[':
1098 YYPOS++;
1099 ret = YY__LBRACK;
1100 goto _yy_fin;
1101 case ',':
1102 YYPOS++;
1103 ret = YY__COMMA;
1104 goto _yy_fin;
1105 case ']':
1106 YYPOS++;
1107 ret = YY__RBRACK;
1108 goto _yy_fin;
1109 case '.':
1110 ch = *++YYPOS;
1111 accept = YY__POINT;
1112 accept_pos = yy_pos;
1113 if ((ch >= '0' && ch <= '9')) {
1114 goto _yy_state_73;
1115 } else if (ch == '.') {
1116 ch = *++YYPOS;
1117 if (ch == '.') {
1118 YYPOS++;
1120 goto _yy_fin;
1121 } else {
1122 goto _yy_state_error;
1123 }
1124 } else {
1125 ret = YY__POINT;
1126 goto _yy_fin;
1127 }
1128 case '-':
1129 ch = *++YYPOS;
1130 if (ch == '>') {
1131 YYPOS++;
1133 goto _yy_fin;
1134 } else if (ch == '-') {
1135 YYPOS++;
1137 goto _yy_fin;
1138 } else {
1139 ret = YY__MINUS;
1140 goto _yy_fin;
1141 }
1142 case '+':
1143 ch = *++YYPOS;
1144 if (ch == '+') {
1145 YYPOS++;
1147 goto _yy_fin;
1148 } else {
1149 ret = YY__PLUS;
1150 goto _yy_fin;
1151 }
1152 case '0':
1153 ch = *++YYPOS;
1154 if (ch != 'X' && ch != 'x') goto _yy_tunnel_78;
1155 ch = *++YYPOS;
1156 if ((ch >= '0' && ch <= '9') || (ch >= 'A' && ch <= 'F') || (ch >= 'a' && ch <= 'f')) {
1157 goto _yy_state_156;
1158 } else {
1159 goto _yy_state_error;
1160 }
1161 case '1':
1162 case '2':
1163 case '3':
1164 case '4':
1165 case '5':
1166 case '6':
1167 case '7':
1168 case '8':
1169 case '9':
1170 goto _yy_state_26;
1171 case '"':
1172 goto _yy_state_27;
1173 case '\'':
1174 goto _yy_state_28;
1175 case '&':
1176 ch = *++YYPOS;
1177 if (ch == '&') {
1178 YYPOS++;
1179 ret = YY__AND_AND;
1180 goto _yy_fin;
1181 } else {
1182 ret = YY__AND;
1183 goto _yy_fin;
1184 }
1185 case '*':
1186 YYPOS++;
1187 ret = YY__STAR;
1188 goto _yy_fin;
1189 case '~':
1190 YYPOS++;
1191 ret = YY__TILDE;
1192 goto _yy_fin;
1193 case '!':
1194 ch = *++YYPOS;
1195 if (ch == '=') {
1196 YYPOS++;
1198 goto _yy_fin;
1199 } else {
1200 ret = YY__BANG;
1201 goto _yy_fin;
1202 }
1203 case '/':
1204 ch = *++YYPOS;
1205 accept = YY__SLASH;
1206 accept_pos = yy_pos;
1207 if (ch == '*') {
1208 goto _yy_state_99;
1209 } else if (ch == '/') {
1210 goto _yy_state_48;
1211 } else {
1212 ret = YY__SLASH;
1213 goto _yy_fin;
1214 }
1215 case '%':
1216 YYPOS++;
1217 ret = YY__PERCENT;
1218 goto _yy_fin;
1219 case '<':
1220 ch = *++YYPOS;
1221 if (ch == '<') {
1222 YYPOS++;
1224 goto _yy_fin;
1225 } else if (ch == '=') {
1226 YYPOS++;
1228 goto _yy_fin;
1229 } else {
1230 ret = YY__LESS;
1231 goto _yy_fin;
1232 }
1233 case '>':
1234 ch = *++YYPOS;
1235 if (ch == '>') {
1236 YYPOS++;
1238 goto _yy_fin;
1239 } else if (ch == '=') {
1240 YYPOS++;
1242 goto _yy_fin;
1243 } else {
1244 ret = YY__GREATER;
1245 goto _yy_fin;
1246 }
1247 case '=':
1248 ch = *++YYPOS;
1249 if (ch == '=') {
1250 YYPOS++;
1252 goto _yy_fin;
1253 } else {
1254 ret = YY__EQUAL;
1255 goto _yy_fin;
1256 }
1257 case '^':
1258 YYPOS++;
1259 ret = YY__UPARROW;
1260 goto _yy_fin;
1261 case '|':
1262 ch = *++YYPOS;
1263 if (ch == '|') {
1264 YYPOS++;
1265 ret = YY__BAR_BAR;
1266 goto _yy_fin;
1267 } else {
1268 ret = YY__BAR;
1269 goto _yy_fin;
1270 }
1271 case '?':
1272 YYPOS++;
1273 ret = YY__QUERY;
1274 goto _yy_fin;
1275 case ':':
1276 YYPOS++;
1277 ret = YY__COLON;
1278 goto _yy_fin;
1279 case '{':
1280 YYPOS++;
1281 ret = YY__LBRACE;
1282 goto _yy_fin;
1283 case ';':
1284 YYPOS++;
1286 goto _yy_fin;
1287 case '}':
1288 YYPOS++;
1289 ret = YY__RBRACE;
1290 goto _yy_fin;
1291 case '\r':
1292 ch = *++YYPOS;
1293 if (ch == '\n') {
1294 yy_line++;
1295 YYPOS++;
1296 ret = YY_EOL;
1297 goto _yy_fin;
1298 } else {
1299 ret = YY_EOL;
1300 goto _yy_fin;
1301 }
1302 case '\n':
1303 yy_line++;
1304 YYPOS++;
1305 ret = YY_EOL;
1306 goto _yy_fin;
1307 case ' ':
1308 case '\t':
1309 case '\f':
1310 case '\v':
1311 goto _yy_state_47;
1312 case '#':
1313 goto _yy_state_48;
1314 case '\0':
1315 if (ch == 0 && YYPOS < YYEND) goto _yy_state_error;
1316 YYPOS++;
1317 ret = YY_EOF;
1318 goto _yy_fin;
1319 default:
1320 goto _yy_state_error;
1321 }
1322_yy_state_9:
1323 ch = *++YYPOS;
1324_yy_tunnel_9:
1325 if ((ch >= '0' && ch <= '9') || (ch >= 'A' && ch <= 'Z') || ch == '_' || (ch >= 'a' && ch <= 'z')) {
1326 goto _yy_state_9;
1327 } else {
1328 ret = YY_ID;
1329 goto _yy_fin;
1330 }
1331_yy_state_26:
1332 ch = *++YYPOS;
1333 accept = YY_DECNUMBER;
1334 accept_pos = yy_pos;
1335 switch (ch) {
1336 case 'U':
1337 case 'u':
1338 ch = *++YYPOS;
1339 if (ch == 'L') {
1340 ch = *++YYPOS;
1341 if (ch == 'L') {
1342 YYPOS++;
1343 ret = YY_DECNUMBER;
1344 goto _yy_fin;
1345 } else {
1346 ret = YY_DECNUMBER;
1347 goto _yy_fin;
1348 }
1349 } else if (ch == 'l') {
1350 YYPOS++;
1351 ret = YY_DECNUMBER;
1352 goto _yy_fin;
1353 } else {
1354 ret = YY_DECNUMBER;
1355 goto _yy_fin;
1356 }
1357 case 'L':
1358 ch = *++YYPOS;
1359 accept = YY_DECNUMBER;
1360 accept_pos = yy_pos;
1361 if (ch == 'L') {
1362 goto _yy_state_163;
1363 } else if (ch == 'U' || ch == 'u') {
1364 YYPOS++;
1365 ret = YY_DECNUMBER;
1366 goto _yy_fin;
1367 } else {
1368 ret = YY_DECNUMBER;
1369 goto _yy_fin;
1370 }
1371 case 'l':
1372 ch = *++YYPOS;
1373 accept = YY_DECNUMBER;
1374 accept_pos = yy_pos;
1375 if (ch == 'U' || ch == 'u') {
1376 YYPOS++;
1377 ret = YY_DECNUMBER;
1378 goto _yy_fin;
1379 } else if (ch == 'l') {
1380 goto _yy_state_163;
1381 } else {
1382 ret = YY_DECNUMBER;
1383 goto _yy_fin;
1384 }
1385 case 'E':
1386 case 'e':
1387 goto _yy_state_85;
1388 case '0':
1389 case '1':
1390 case '2':
1391 case '3':
1392 case '4':
1393 case '5':
1394 case '6':
1395 case '7':
1396 case '8':
1397 case '9':
1398 goto _yy_state_26;
1399 case '.':
1400 goto _yy_state_73;
1401 default:
1402 ret = YY_DECNUMBER;
1403 goto _yy_fin;
1404 }
1405_yy_state_27:
1406 ch = *++YYPOS;
1407 if (ch == '\\') {
1408 ch = *++YYPOS;
1409 if (YYPOS < YYEND) {
1410 if (ch == '\n') {
1411 yy_line++;
1412 }
1413 goto _yy_state_27;
1414 } else {
1415 goto _yy_state_error;
1416 }
1417 } else if (ch == '"') {
1418 YYPOS++;
1419 ret = YY_STRING;
1420 goto _yy_fin;
1421 } else if (YYPOS < YYEND && (ch <= '!' || (ch >= '#' && ch <= '[') || ch >= ']')) {
1422 if (ch == '\n') {
1423 yy_line++;
1424 }
1425 goto _yy_state_27;
1426 } else {
1427 goto _yy_state_error;
1428 }
1429_yy_state_28:
1430 ch = *++YYPOS;
1431 if (ch == '\\') {
1432 ch = *++YYPOS;
1433 if (YYPOS < YYEND) {
1434 if (ch == '\n') {
1435 yy_line++;
1436 }
1437 goto _yy_state_28;
1438 } else {
1439 goto _yy_state_error;
1440 }
1441 } else if (ch == '\'') {
1442 YYPOS++;
1443 ret = YY_CHARACTER;
1444 goto _yy_fin;
1445 } else if (YYPOS < YYEND && (ch <= '&' || (ch >= '(' && ch <= '[') || ch >= ']')) {
1446 if (ch == '\n') {
1447 yy_line++;
1448 }
1449 goto _yy_state_28;
1450 } else {
1451 goto _yy_state_error;
1452 }
1453_yy_state_47:
1454 ch = *++YYPOS;
1455 if (ch == '\t' || ch == '\v' || ch == '\f' || ch == ' ') {
1456 goto _yy_state_47;
1457 } else {
1458 ret = YY_WS;
1459 goto _yy_fin;
1460 }
1461_yy_state_48:
1462 ch = *++YYPOS;
1463 if (ch == '\r') {
1464 ch = *++YYPOS;
1465 if (ch == '\n') {
1466 yy_line++;
1467 YYPOS++;
1469 goto _yy_fin;
1470 } else {
1472 goto _yy_fin;
1473 }
1474 } else if (ch == '\n') {
1475 yy_line++;
1476 YYPOS++;
1478 goto _yy_fin;
1479 } else if (YYPOS < YYEND && (ch <= '\t' || ch == '\v' || ch == '\f' || ch >= '\016')) {
1480 goto _yy_state_48;
1481 } else {
1482 goto _yy_state_error;
1483 }
1484_yy_state_73:
1485 ch = *++YYPOS;
1486 accept = YY_FLOATNUMBER;
1487 accept_pos = yy_pos;
1488 if ((ch >= '0' && ch <= '9')) {
1489 goto _yy_state_73;
1490 } else if (ch == 'F' || ch == 'L' || ch == 'f' || ch == 'l') {
1491 YYPOS++;
1493 goto _yy_fin;
1494 } else if (ch == 'E' || ch == 'e') {
1495 goto _yy_state_85;
1496 } else {
1498 goto _yy_fin;
1499 }
1500_yy_state_78:
1501 ch = *++YYPOS;
1502_yy_tunnel_78:
1503 accept = YY_OCTNUMBER;
1504 accept_pos = yy_pos;
1505 switch (ch) {
1506 case '0':
1507 case '1':
1508 case '2':
1509 case '3':
1510 case '4':
1511 case '5':
1512 case '6':
1513 case '7':
1514 goto _yy_state_78;
1515 case 'U':
1516 case 'u':
1517 ch = *++YYPOS;
1518 if (ch == 'L') {
1519 ch = *++YYPOS;
1520 if (ch == 'L') {
1521 YYPOS++;
1522 ret = YY_OCTNUMBER;
1523 goto _yy_fin;
1524 } else {
1525 ret = YY_OCTNUMBER;
1526 goto _yy_fin;
1527 }
1528 } else if (ch == 'l') {
1529 YYPOS++;
1530 ret = YY_OCTNUMBER;
1531 goto _yy_fin;
1532 } else {
1533 ret = YY_OCTNUMBER;
1534 goto _yy_fin;
1535 }
1536 case 'L':
1537 ch = *++YYPOS;
1538 accept = YY_OCTNUMBER;
1539 accept_pos = yy_pos;
1540 if (ch == 'L') {
1541 goto _yy_state_154;
1542 } else if (ch == 'U' || ch == 'u') {
1543 YYPOS++;
1544 ret = YY_OCTNUMBER;
1545 goto _yy_fin;
1546 } else {
1547 ret = YY_OCTNUMBER;
1548 goto _yy_fin;
1549 }
1550 case 'l':
1551 ch = *++YYPOS;
1552 accept = YY_OCTNUMBER;
1553 accept_pos = yy_pos;
1554 if (ch == 'l') {
1555 goto _yy_state_154;
1556 } else if (ch == 'U' || ch == 'u') {
1557 YYPOS++;
1558 ret = YY_OCTNUMBER;
1559 goto _yy_fin;
1560 } else {
1561 ret = YY_OCTNUMBER;
1562 goto _yy_fin;
1563 }
1564 case '8':
1565 case '9':
1566 goto _yy_state_83;
1567 case 'E':
1568 case 'e':
1569 goto _yy_state_85;
1570 case '.':
1571 goto _yy_state_73;
1572 default:
1573 ret = YY_OCTNUMBER;
1574 goto _yy_fin;
1575 }
1576_yy_state_83:
1577 ch = *++YYPOS;
1578 if ((ch >= '0' && ch <= '9')) {
1579 goto _yy_state_83;
1580 } else if (ch == 'E' || ch == 'e') {
1581 goto _yy_state_85;
1582 } else if (ch == '.') {
1583 goto _yy_state_73;
1584 } else {
1585 goto _yy_state_error;
1586 }
1587_yy_state_85:
1588 ch = *++YYPOS;
1589 if (ch == '+' || ch == '-') {
1590 ch = *++YYPOS;
1591 if ((ch >= '0' && ch <= '9')) {
1592 goto _yy_state_159;
1593 } else {
1594 goto _yy_state_error;
1595 }
1596 } else if ((ch >= '0' && ch <= '9')) {
1597 goto _yy_state_159;
1598 } else {
1599 goto _yy_state_error;
1600 }
1601_yy_state_99:
1602 ch = *++YYPOS;
1603_yy_tunnel_99:
1604 if (ch == '*') {
1605 ch = *++YYPOS;
1606 if (ch != '/') goto _yy_tunnel_99;
1607 YYPOS++;
1608 ret = YY_COMMENT;
1609 goto _yy_fin;
1610 } else if (YYPOS < YYEND && (ch <= ')' || ch >= '+')) {
1611 if (ch == '\n') {
1612 yy_line++;
1613 }
1614 goto _yy_state_99;
1615 } else {
1616 goto _yy_state_error;
1617 }
1618_yy_state_154:
1619 ch = *++YYPOS;
1620 if (ch == 'U' || ch == 'u') {
1621 YYPOS++;
1622 ret = YY_OCTNUMBER;
1623 goto _yy_fin;
1624 } else {
1625 goto _yy_state_error;
1626 }
1627_yy_state_156:
1628 ch = *++YYPOS;
1629 if (ch == 'U' || ch == 'u') {
1630 ch = *++YYPOS;
1631 if (ch == 'L') {
1632 ch = *++YYPOS;
1633 if (ch == 'L') {
1634 YYPOS++;
1635 ret = YY_HEXNUMBER;
1636 goto _yy_fin;
1637 } else {
1638 ret = YY_HEXNUMBER;
1639 goto _yy_fin;
1640 }
1641 } else if (ch == 'l') {
1642 YYPOS++;
1643 ret = YY_HEXNUMBER;
1644 goto _yy_fin;
1645 } else {
1646 ret = YY_HEXNUMBER;
1647 goto _yy_fin;
1648 }
1649 } else if (ch == 'L') {
1650 ch = *++YYPOS;
1651 accept = YY_HEXNUMBER;
1652 accept_pos = yy_pos;
1653 if (ch == 'L') {
1654 goto _yy_state_265;
1655 } else if (ch == 'U' || ch == 'u') {
1656 YYPOS++;
1657 ret = YY_HEXNUMBER;
1658 goto _yy_fin;
1659 } else {
1660 ret = YY_HEXNUMBER;
1661 goto _yy_fin;
1662 }
1663 } else if (ch == 'l') {
1664 ch = *++YYPOS;
1665 accept = YY_HEXNUMBER;
1666 accept_pos = yy_pos;
1667 if (ch == 'U' || ch == 'u') {
1668 YYPOS++;
1669 ret = YY_HEXNUMBER;
1670 goto _yy_fin;
1671 } else if (ch == 'l') {
1672 goto _yy_state_265;
1673 } else {
1674 ret = YY_HEXNUMBER;
1675 goto _yy_fin;
1676 }
1677 } else if ((ch >= '0' && ch <= '9') || (ch >= 'A' && ch <= 'F') || (ch >= 'a' && ch <= 'f')) {
1678 goto _yy_state_156;
1679 } else {
1680 ret = YY_HEXNUMBER;
1681 goto _yy_fin;
1682 }
1683_yy_state_159:
1684 ch = *++YYPOS;
1685 if ((ch >= '0' && ch <= '9')) {
1686 goto _yy_state_159;
1687 } else if (ch == 'F' || ch == 'L' || ch == 'f' || ch == 'l') {
1688 YYPOS++;
1690 goto _yy_fin;
1691 } else {
1693 goto _yy_fin;
1694 }
1695_yy_state_163:
1696 ch = *++YYPOS;
1697 if (ch == 'U' || ch == 'u') {
1698 YYPOS++;
1699 ret = YY_DECNUMBER;
1700 goto _yy_fin;
1701 } else {
1702 goto _yy_state_error;
1703 }
1704_yy_state_265:
1705 ch = *++YYPOS;
1706 if (ch == 'U' || ch == 'u') {
1707 YYPOS++;
1708 ret = YY_HEXNUMBER;
1709 goto _yy_fin;
1710 } else {
1711 goto _yy_state_error;
1712 }
1713_yy_state_390:
1714 ch = *++YYPOS;
1715_yy_tunnel_390:
1716 if ((ch >= '0' && ch <= '9') || (ch >= 'A' && ch <= 'Z') || ch == '_' || (ch >= 'a' && ch <= 'z')) {
1717 goto _yy_state_9;
1718 } else {
1719 goto _yy_fin;
1720 }
1721_yy_state_error:
1722 if (accept >= 0) {
1723 yy_pos = accept_pos;
1724 return accept;
1725 }
1726 if (YYPOS >= YYEND) {
1727 yy_error("unexpected <EOF>");
1728 } else if (YYPOS == yy_text) {
1729 yy_error_str("unexpected character", yy_escape_char(buf, ch));
1730 } else {
1731 yy_error_str("unexpected sequence", yy_escape_string(buf, sizeof(buf), yy_text, 1 + YYPOS - yy_text));
1732 }
1733 YYPOS++;
1734 goto _yy_state_start;
1735_yy_fin:
1736 yy_pos = YYPOS;
1737 return ret;
1738}
1739
1740static int skip_EOL(int sym) {
1741 if (sym != YY_EOL) {
1742 yy_error_sym("<EOL> expected, got", sym);
1743 }
1744 sym = get_skip_sym();
1745 return sym;
1746}
1747
1748static int skip_WS(int sym) {
1749 if (sym != YY_WS) {
1750 yy_error_sym("<WS> expected, got", sym);
1751 }
1752 sym = get_skip_sym();
1753 return sym;
1754}
1755
1756static int skip_ONE_LINE_COMMENT(int sym) {
1757 if (sym != YY_ONE_LINE_COMMENT) {
1758 yy_error_sym("<ONE_LINE_COMMENT> expected, got", sym);
1759 }
1760 sym = get_skip_sym();
1761 return sym;
1762}
1763
1764static int skip_COMMENT(int sym) {
1765 if (sym != YY_COMMENT) {
1766 yy_error_sym("<COMMENT> expected, got", sym);
1767 }
1768 sym = get_skip_sym();
1769 return sym;
1770}
1771
1772static int get_sym(void) {
1773 int sym;
1774 sym = get_skip_sym();
1775 while (sym == YY_EOL || sym == YY_WS || sym == YY_ONE_LINE_COMMENT || sym == YY_COMMENT) {
1776 if (sym == YY_EOL) {
1777 sym = skip_EOL(sym);
1778 } else if (sym == YY_WS) {
1779 sym = skip_WS(sym);
1780 } else if (sym == YY_ONE_LINE_COMMENT) {
1781 sym = skip_ONE_LINE_COMMENT(sym);
1782 } else {
1783 sym = skip_COMMENT(sym);
1784 }
1785 }
1786 return sym;
1787}
1788
1789static int check_nested_declarator_start(int sym) {
1790 if (sym != YY__LPAREN) {
1791 return -1;
1792 }
1793 sym = get_sym();
1794 if ((sym == YY_ID) && (!zend_ffi_is_typedef_name((const char*)yy_text, yy_pos - yy_text))) {
1795 sym = check_ID(sym);
1796 if (sym == -1) {
1797 return -1;
1798 }
1799 } else {
1800 switch (sym) {
1801 case YY___ATTRIBUTE:
1802 sym = get_sym();
1803 break;
1804 case YY___ATTRIBUTE__:
1805 sym = get_sym();
1806 break;
1807 case YY___DECLSPEC:
1808 sym = get_sym();
1809 break;
1810 case YY__STAR:
1811 sym = get_sym();
1812 break;
1813 case YY__LPAREN:
1814 sym = get_sym();
1815 break;
1816 case YY__LBRACK:
1817 sym = get_sym();
1818 break;
1819 default:
1820 return -1;
1821 }
1822 }
1823 return sym;
1824}
1825
1826static int check_type_name_start(int sym) {
1827 if ((sym == YY_ID) && (zend_ffi_is_typedef_name((const char*)yy_text, yy_pos - yy_text))) {
1828 sym = check_ID(sym);
1829 if (sym == -1) {
1830 return -1;
1831 }
1832 } else {
1833 switch (sym) {
1834 case YY_VOID:
1835 sym = get_sym();
1836 break;
1837 case YY_CHAR:
1838 sym = get_sym();
1839 break;
1840 case YY_SHORT:
1841 sym = get_sym();
1842 break;
1843 case YY_INT:
1844 sym = get_sym();
1845 break;
1846 case YY_LONG:
1847 sym = get_sym();
1848 break;
1849 case YY_FLOAT:
1850 sym = get_sym();
1851 break;
1852 case YY_DOUBLE:
1853 sym = get_sym();
1854 break;
1855 case YY_SIGNED:
1856 sym = get_sym();
1857 break;
1858 case YY_UNSIGNED:
1859 sym = get_sym();
1860 break;
1861 case YY__BOOL:
1862 sym = get_sym();
1863 break;
1864 case YY__COMPLEX:
1865 sym = get_sym();
1866 break;
1867 case YY_COMPLEX:
1868 sym = get_sym();
1869 break;
1870 case YY___COMPLEX:
1871 sym = get_sym();
1872 break;
1873 case YY___COMPLEX__:
1874 sym = get_sym();
1875 break;
1876 case YY_STRUCT:
1877 sym = get_sym();
1878 break;
1879 case YY_UNION:
1880 sym = get_sym();
1881 break;
1882 case YY_ENUM:
1883 sym = get_sym();
1884 break;
1885 case YY_CONST:
1886 sym = get_sym();
1887 break;
1888 case YY___CONST:
1889 sym = get_sym();
1890 break;
1891 case YY___CONST__:
1892 sym = get_sym();
1893 break;
1894 case YY_RESTRICT:
1895 sym = get_sym();
1896 break;
1897 case YY___RESTICT:
1898 sym = get_sym();
1899 break;
1900 case YY___RESTRICT__:
1901 sym = get_sym();
1902 break;
1903 case YY_VOLATILE:
1904 sym = get_sym();
1905 break;
1906 case YY___VOLATILE:
1907 sym = get_sym();
1908 break;
1909 case YY___VOLATILE__:
1910 sym = get_sym();
1911 break;
1912 case YY__ATOMIC:
1913 sym = get_sym();
1914 break;
1915 case YY___ATTRIBUTE:
1916 sym = get_sym();
1917 break;
1918 case YY___ATTRIBUTE__:
1919 sym = get_sym();
1920 break;
1921 case YY___DECLSPEC:
1922 sym = get_sym();
1923 break;
1924 default:
1925 return -1;
1926 }
1927 }
1928 return sym;
1929}
1930
1931static int check_ID(int sym) {
1932 if (sym != YY_ID) {
1933 return -1;
1934 }
1935 sym = get_sym();
1936 return sym;
1937}
1938
1939static int synpred_1(int sym) {
1940 int ret;
1941 const unsigned char *save_pos;
1942 const unsigned char *save_text;
1943 int save_line;
1944
1945 save_pos = yy_pos;
1946 save_text = yy_text;
1947 save_line = yy_line;
1948 ret = check_type_name_start(sym) != -1;
1949 yy_pos = save_pos;
1950 yy_text = save_text;
1951 yy_line = save_line;
1952 return ret;
1953}
1954
1955static int synpred_2(int sym) {
1956 int ret;
1957 const unsigned char *save_pos;
1958 const unsigned char *save_text;
1959 int save_line;
1960
1961 save_pos = yy_pos;
1962 save_text = yy_text;
1963 save_line = yy_line;
1964 ret = check_nested_declarator_start(sym) != -1;
1965 yy_pos = save_pos;
1966 yy_text = save_text;
1967 yy_line = save_line;
1968 return ret;
1969}
1970
1971static int synpred_3(int sym) {
1972 int ret;
1973 const unsigned char *save_pos;
1974 const unsigned char *save_text;
1975 int save_line;
1976
1977 save_pos = yy_pos;
1978 save_text = yy_text;
1979 save_line = yy_line;
1980 ret = check_nested_declarator_start(sym) != -1;
1981 yy_pos = save_pos;
1982 yy_text = save_text;
1983 yy_line = save_line;
1984 return ret;
1985}
1986
1987static int _synpred_4(int sym) {
1988 if (sym != YY__LPAREN) {
1989 return -1;
1990 }
1991 sym = get_sym();
1992 sym = check_type_name_start(sym);
1993 if (sym == -1) {
1994 return -1;
1995 }
1996 return sym;
1997}
1998
1999static int synpred_4(int sym) {
2000 int ret;
2001 const unsigned char *save_pos;
2002 const unsigned char *save_text;
2003 int save_line;
2004
2005 save_pos = yy_pos;
2006 save_text = yy_text;
2007 save_line = yy_line;
2008 ret = _synpred_4(sym) != -1;
2009 yy_pos = save_pos;
2010 yy_text = save_text;
2011 yy_line = save_line;
2012 return ret;
2013}
2014
2015static int _synpred_5(int sym) {
2016 if (sym != YY__LPAREN) {
2017 return -1;
2018 }
2019 sym = get_sym();
2020 sym = check_type_name_start(sym);
2021 if (sym == -1) {
2022 return -1;
2023 }
2024 return sym;
2025}
2026
2027static int synpred_5(int sym) {
2028 int ret;
2029 const unsigned char *save_pos;
2030 const unsigned char *save_text;
2031 int save_line;
2032
2033 save_pos = yy_pos;
2034 save_text = yy_text;
2035 save_line = yy_line;
2036 ret = _synpred_5(sym) != -1;
2037 yy_pos = save_pos;
2038 yy_text = save_text;
2039 yy_line = save_line;
2040 return ret;
2041}
2042
2043static int _synpred_6(int sym) {
2044 if (sym != YY__LPAREN) {
2045 return -1;
2046 }
2047 sym = get_sym();
2048 sym = check_type_name_start(sym);
2049 if (sym == -1) {
2050 return -1;
2051 }
2052 return sym;
2053}
2054
2055static int synpred_6(int sym) {
2056 int ret;
2057 const unsigned char *save_pos;
2058 const unsigned char *save_text;
2059 int save_line;
2060
2061 save_pos = yy_pos;
2062 save_text = yy_text;
2063 save_line = yy_line;
2064 ret = _synpred_6(sym) != -1;
2065 yy_pos = save_pos;
2066 yy_text = save_text;
2067 yy_line = save_line;
2068 return ret;
2069}
2070
2071static int parse_declarations(int sym) {
2073 zend_ffi_dcl common_dcl = ZEND_FFI_ATTR_INIT;
2074 if (sym == YY___EXTENSION__) {
2075 sym = get_sym();
2076 }
2077 sym = parse_declaration_specifiers(sym, &common_dcl);
2078 if (sym == YY__STAR || sym == YY_ID || sym == YY__LPAREN) {
2079 const char *name;
2080 size_t name_len;
2082 dcl = common_dcl;
2083 sym = parse_declarator(sym, &dcl, &name, &name_len);
2084 if (sym == YY___ASM__) {
2085 zend_ffi_val asm_str;
2086 sym = get_sym();
2087 if (sym != YY__LPAREN) {
2088 yy_error_sym("'(' expected, got", sym);
2089 }
2090 sym = get_sym();
2091 do {
2092 sym = parse_STRING(sym, &asm_str);
2093 } while (sym == YY_STRING);
2094 if (sym != YY__RPAREN) {
2095 yy_error_sym("')' expected, got", sym);
2096 }
2097 sym = get_sym();
2098 }
2099 if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FASTCALL,YY___THISCALL,YY___VECTORCALL), "\000\000\000\000\000\000\360\017\000\000\000\000\000")) {
2100 sym = parse_attributes(sym, &dcl);
2101 }
2102 if (sym == YY__EQUAL) {
2103 sym = parse_initializer(sym);
2104 }
2105 zend_ffi_declare(name, name_len, &dcl);
2106 while (sym == YY__COMMA) {
2107 sym = get_sym();
2108 dcl = common_dcl;
2109 sym = parse_declarator(sym, &dcl, &name, &name_len);
2110 if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FASTCALL,YY___THISCALL,YY___VECTORCALL), "\000\000\000\000\000\000\360\017\000\000\000\000\000")) {
2111 sym = parse_attributes(sym, &dcl);
2112 }
2113 if (sym == YY__EQUAL) {
2114 sym = parse_initializer(sym);
2115 }
2116 zend_ffi_declare(name, name_len, &dcl);
2117 }
2118 } else if (sym == YY__SEMICOLON) {
2120 } else {
2121 yy_error_sym("unexpected", sym);
2122 }
2123 if (sym != YY__SEMICOLON) {
2124 yy_error_sym("';' expected, got", sym);
2125 }
2126 sym = get_sym();
2127 }
2128 return sym;
2129}
2130
2131static int parse_declaration_specifiers(int sym, zend_ffi_dcl *dcl) {
2132 do {
2133 switch (sym) {
2134 case YY_TYPEDEF:
2135 if (dcl->flags & ZEND_FFI_DCL_STORAGE_CLASS) yy_error_sym("unexpected", sym);
2136 sym = get_sym();
2137 dcl->flags |= ZEND_FFI_DCL_TYPEDEF;
2138 break;
2139 case YY_EXTERN:
2140 if (dcl->flags & ZEND_FFI_DCL_STORAGE_CLASS) yy_error_sym("unexpected", sym);
2141 sym = get_sym();
2142 dcl->flags |= ZEND_FFI_DCL_EXTERN;
2143 break;
2144 case YY_STATIC:
2145 if (dcl->flags & ZEND_FFI_DCL_STORAGE_CLASS) yy_error_sym("unexpected", sym);
2146 sym = get_sym();
2147 dcl->flags |= ZEND_FFI_DCL_STATIC;
2148 break;
2149 case YY_AUTO:
2150 if (dcl->flags & ZEND_FFI_DCL_STORAGE_CLASS) yy_error_sym("unexpected", sym);
2151 sym = get_sym();
2152 dcl->flags |= ZEND_FFI_DCL_AUTO;
2153 break;
2154 case YY_REGISTER:
2155 if (dcl->flags & ZEND_FFI_DCL_STORAGE_CLASS) yy_error_sym("unexpected", sym);
2156 sym = get_sym();
2157 dcl->flags |= ZEND_FFI_DCL_REGISTER;
2158 break;
2159 case YY_INLINE:
2160 case YY___INLINE:
2161 case YY___INLINE__:
2162 sym = get_sym();
2163 dcl->flags |= ZEND_FFI_DCL_INLINE;
2164 break;
2165 case YY__NORETURN:
2166 sym = get_sym();
2167 dcl->flags |= ZEND_FFI_DCL_NO_RETURN;
2168 break;
2169 case YY__ALIGNAS:
2170 sym = get_sym();
2171 if (sym != YY__LPAREN) {
2172 yy_error_sym("'(' expected, got", sym);
2173 }
2174 sym = get_sym();
2176 zend_ffi_dcl align_dcl = ZEND_FFI_ATTR_INIT;
2177 sym = parse_type_name(sym, &align_dcl);
2178 zend_ffi_align_as_type(dcl, &align_dcl);
2180 zend_ffi_val align_val;
2181 sym = parse_constant_expression(sym, &align_val);
2182 zend_ffi_align_as_val(dcl, &align_val);
2183 } else {
2184 yy_error_sym("unexpected", sym);
2185 }
2186 if (sym != YY__RPAREN) {
2187 yy_error_sym("')' expected, got", sym);
2188 }
2189 sym = get_sym();
2190 break;
2191 case YY___ATTRIBUTE:
2192 case YY___ATTRIBUTE__:
2193 case YY___DECLSPEC:
2194 case YY___CDECL:
2195 case YY___STDCALL:
2196 case YY___FASTCALL:
2197 case YY___THISCALL:
2198 case YY___VECTORCALL:
2199 sym = parse_attributes(sym, dcl);
2200 break;
2201 case YY_CONST:
2202 case YY___CONST:
2203 case YY___CONST__:
2204 case YY_RESTRICT:
2205 case YY___RESTRICT:
2206 case YY___RESTRICT__:
2207 case YY_VOLATILE:
2208 case YY___VOLATILE:
2209 case YY___VOLATILE__:
2210 case YY__ATOMIC:
2211 sym = parse_type_qualifier(sym, dcl);
2212 break;
2213 case YY_VOID:
2214 case YY_CHAR:
2215 case YY_SHORT:
2216 case YY_INT:
2217 case YY_LONG:
2218 case YY_FLOAT:
2219 case YY_DOUBLE:
2220 case YY_SIGNED:
2221 case YY_UNSIGNED:
2222 case YY__BOOL:
2223 case YY__COMPLEX:
2224 case YY_COMPLEX:
2225 case YY___COMPLEX:
2226 case YY___COMPLEX__:
2227 case YY_STRUCT:
2228 case YY_UNION:
2229 case YY_ENUM:
2230 case YY_ID:
2231 sym = parse_type_specifier(sym, dcl);
2232 break;
2233 default:
2234 yy_error_sym("unexpected", sym);
2235 }
2237 return sym;
2238}
2239
2240static int parse_specifier_qualifier_list(int sym, zend_ffi_dcl *dcl) {
2241 if (sym == YY___EXTENSION__) {
2242 sym = get_sym();
2243 }
2244 do {
2246 sym = parse_type_specifier(sym, dcl);
2247 } else if (YY_IN_SET(sym, (YY_CONST,YY___CONST,YY___CONST__,YY_RESTRICT,YY___RESTRICT,YY___RESTRICT__,YY_VOLATILE,YY___VOLATILE,YY___VOLATILE__,YY__ATOMIC), "\000\000\376\007\000\000\000\000\000\000\000\000\000")) {
2248 sym = parse_type_qualifier(sym, dcl);
2249 } else if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FASTCALL,YY___THISCALL,YY___VECTORCALL), "\000\000\000\000\000\000\360\017\000\000\000\000\000")) {
2250 sym = parse_attributes(sym, dcl);
2251 } else {
2252 yy_error_sym("unexpected", sym);
2253 }
2255 return sym;
2256}
2257
2258static int parse_type_qualifier_list(int sym, zend_ffi_dcl *dcl) {
2259 do {
2260 if (YY_IN_SET(sym, (YY_CONST,YY___CONST,YY___CONST__,YY_RESTRICT,YY___RESTRICT,YY___RESTRICT__,YY_VOLATILE,YY___VOLATILE,YY___VOLATILE__,YY__ATOMIC), "\000\000\376\007\000\000\000\000\000\000\000\000\000")) {
2261 sym = parse_type_qualifier(sym, dcl);
2262 } else if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FASTCALL,YY___THISCALL,YY___VECTORCALL), "\000\000\000\000\000\000\360\017\000\000\000\000\000")) {
2263 sym = parse_attributes(sym, dcl);
2264 } else {
2265 yy_error_sym("unexpected", sym);
2266 }
2268 return sym;
2269}
2270
2271static int parse_type_qualifier(int sym, zend_ffi_dcl *dcl) {
2272 if (sym == YY_CONST || sym == YY___CONST || sym == YY___CONST__) {
2273 sym = get_sym();
2274 dcl->flags |= ZEND_FFI_DCL_CONST;
2275 dcl->attr |= ZEND_FFI_ATTR_CONST;
2276 } else if (sym == YY_RESTRICT || sym == YY___RESTRICT || sym == YY___RESTRICT__) {
2277 sym = get_sym();
2278 dcl->flags |= ZEND_FFI_DCL_RESTRICT;
2279 } else if (sym == YY_VOLATILE || sym == YY___VOLATILE || sym == YY___VOLATILE__) {
2280 sym = get_sym();
2281 dcl->flags |= ZEND_FFI_DCL_VOLATILE;
2282 } else if (sym == YY__ATOMIC) {
2283 sym = get_sym();
2284 dcl->flags |= ZEND_FFI_DCL_ATOMIC;
2285 } else {
2286 yy_error_sym("unexpected", sym);
2287 }
2288 return sym;
2289}
2290
2291static int parse_type_specifier(int sym, zend_ffi_dcl *dcl) {
2292 const char *name;
2293 size_t name_len;
2294 switch (sym) {
2295 case YY_VOID:
2296 if (dcl->flags & ZEND_FFI_DCL_TYPE_SPECIFIERS) yy_error_sym("unexpected", sym);
2297 sym = get_sym();
2298 dcl->flags |= ZEND_FFI_DCL_VOID;
2299 break;
2300 case YY_CHAR:
2301 if (dcl->flags & (ZEND_FFI_DCL_TYPE_SPECIFIERS-(ZEND_FFI_DCL_SIGNED|ZEND_FFI_DCL_UNSIGNED))) yy_error_sym("unexpected", sym);
2302 sym = get_sym();
2303 dcl->flags |= ZEND_FFI_DCL_CHAR;
2304 break;
2305 case YY_SHORT:
2306 if (dcl->flags & (ZEND_FFI_DCL_TYPE_SPECIFIERS-(ZEND_FFI_DCL_SIGNED|ZEND_FFI_DCL_UNSIGNED|ZEND_FFI_DCL_INT))) yy_error_sym("unexpected", sym);
2307 sym = get_sym();
2308 dcl->flags |= ZEND_FFI_DCL_SHORT;
2309 break;
2310 case YY_INT:
2312 sym = get_sym();
2313 dcl->flags |= ZEND_FFI_DCL_INT;
2314 break;
2315 case YY_LONG:
2316 if (dcl->flags & ZEND_FFI_DCL_LONG) {
2318 dcl->flags |= ZEND_FFI_DCL_LONG_LONG;
2319 } else {
2321 dcl->flags |= ZEND_FFI_DCL_LONG;
2322 }
2323 sym = get_sym();
2324 break;
2325 case YY_FLOAT:
2326 if (dcl->flags & (ZEND_FFI_DCL_TYPE_SPECIFIERS-(ZEND_FFI_DCL_COMPLEX))) yy_error_sym("unexpected", sym);
2327 sym = get_sym();
2328 dcl->flags |= ZEND_FFI_DCL_FLOAT;
2329 break;
2330 case YY_DOUBLE:
2331 if (dcl->flags & (ZEND_FFI_DCL_TYPE_SPECIFIERS-(ZEND_FFI_DCL_LONG|ZEND_FFI_DCL_COMPLEX))) yy_error_sym("unexpected", sym);
2332 sym = get_sym();
2333 dcl->flags |= ZEND_FFI_DCL_DOUBLE;
2334 break;
2335 case YY_SIGNED:
2337 sym = get_sym();
2338 dcl->flags |= ZEND_FFI_DCL_SIGNED;
2339 break;
2340 case YY_UNSIGNED:
2342 sym = get_sym();
2343 dcl->flags |= ZEND_FFI_DCL_UNSIGNED;
2344 break;
2345 case YY__BOOL:
2346 if (dcl->flags & ZEND_FFI_DCL_TYPE_SPECIFIERS) yy_error_sym("unexpected", sym);
2347 sym = get_sym();
2348 dcl->flags |= ZEND_FFI_DCL_BOOL;
2349 break;
2350 case YY__COMPLEX:
2351 case YY_COMPLEX:
2352 case YY___COMPLEX:
2353 case YY___COMPLEX__:
2354 if (dcl->flags & (ZEND_FFI_DCL_TYPE_SPECIFIERS-(ZEND_FFI_DCL_FLOAT|ZEND_FFI_DCL_DOUBLE|ZEND_FFI_DCL_LONG))) yy_error_sym("unexpected", sym);
2355 sym = get_sym();
2356 dcl->flags |= ZEND_FFI_DCL_COMPLEX;
2357 break;
2358 case YY_STRUCT:
2359 case YY_UNION:
2360 if (dcl->flags & ZEND_FFI_DCL_TYPE_SPECIFIERS) yy_error_sym("unexpected", sym);
2361 sym = parse_struct_or_union_specifier(sym, dcl);
2362 break;
2363 case YY_ENUM:
2364 if (dcl->flags & ZEND_FFI_DCL_TYPE_SPECIFIERS) yy_error_sym("unexpected", sym);
2365 sym = parse_enum_specifier(sym, dcl);
2366 break;
2367 case YY_ID:
2368 if (dcl->flags & ZEND_FFI_DCL_TYPE_SPECIFIERS) yy_error_sym("unexpected", sym);
2369 /*redeclaration of '%.*s' ??? */
2370 sym = parse_ID(sym, &name, &name_len);
2372 zend_ffi_resolve_typedef(name, name_len, dcl);
2373 break;
2374 default:
2375 yy_error_sym("unexpected", sym);
2376 }
2377 return sym;
2378}
2379
2380static int parse_struct_or_union_specifier(int sym, zend_ffi_dcl *dcl) {
2381 if (sym == YY_STRUCT) {
2382 sym = get_sym();
2383 dcl->flags |= ZEND_FFI_DCL_STRUCT;
2384 } else if (sym == YY_UNION) {
2385 sym = get_sym();
2386 dcl->flags |= ZEND_FFI_DCL_UNION;
2387 } else {
2388 yy_error_sym("unexpected", sym);
2389 }
2390 if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FASTCALL,YY___THISCALL,YY___VECTORCALL), "\000\000\000\000\000\000\360\017\000\000\000\000\000")) {
2391 sym = parse_attributes(sym, dcl);
2392 }
2393 if (sym == YY_ID) {
2394 const char *name;
2395 size_t name_len;
2396 sym = parse_ID(sym, &name, &name_len);
2397 zend_ffi_declare_tag(name, name_len, dcl, 1);
2398 if (sym == YY__LBRACE) {
2399 sym = parse_struct_contents(sym, dcl);
2400 zend_ffi_declare_tag(name, name_len, dcl, 0);
2401 }
2402 } else if (sym == YY__LBRACE) {
2404 sym = parse_struct_contents(sym, dcl);
2405 } else {
2406 yy_error_sym("unexpected", sym);
2407 }
2408 return sym;
2409}
2410
2411static int parse_struct_contents(int sym, zend_ffi_dcl *dcl) {
2412 int sym2;
2413 const unsigned char *save_pos;
2414 const unsigned char *save_text;
2415 int save_line;
2416 int alt2;
2417 if (sym != YY__LBRACE) {
2418 yy_error_sym("'{' expected, got", sym);
2419 }
2420 sym = get_sym();
2422 sym = parse_struct_declaration(sym, dcl);
2423 while (1) {
2424 save_pos = yy_pos;
2425 save_text = yy_text;
2426 save_line = yy_line;
2427 alt2 = -2;
2428 sym2 = sym;
2429 if (sym2 == YY__SEMICOLON) {
2430 sym2 = get_sym();
2431 goto _yy_state_2_1;
2432 } else if (sym2 == YY__RBRACE) {
2433 alt2 = 6;
2434 goto _yy_state_2;
2435 } else {
2436 yy_error_sym("unexpected", sym2);
2437 }
2438_yy_state_2_1:
2440 alt2 = 3;
2441 goto _yy_state_2;
2442 } else if (sym2 == YY__RBRACE) {
2443 alt2 = 5;
2444 goto _yy_state_2;
2445 } else {
2446 yy_error_sym("unexpected", sym2);
2447 }
2448_yy_state_2:
2449 yy_pos = save_pos;
2450 yy_text = save_text;
2451 yy_line = save_line;
2452 if (alt2 != 3) {
2453 break;
2454 }
2455 sym = get_sym();
2456 sym = parse_struct_declaration(sym, dcl);
2457 }
2458 if (alt2 == 5) {
2459 sym = get_sym();
2460 }
2461 }
2462 if (sym != YY__RBRACE) {
2463 yy_error_sym("'}' expected, got", sym);
2464 }
2465 sym = get_sym();
2466 if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FASTCALL,YY___THISCALL,YY___VECTORCALL), "\000\000\000\000\000\000\360\017\000\000\000\000\000")) {
2467 sym = parse_attributes(sym, dcl);
2468 }
2470 return sym;
2471}
2472
2473static int parse_struct_declaration(int sym, zend_ffi_dcl *struct_dcl) {
2474 zend_ffi_dcl common_field_dcl = ZEND_FFI_ATTR_INIT;
2475 zend_ffi_dcl base_field_dcl = ZEND_FFI_ATTR_INIT;
2476 sym = parse_specifier_qualifier_list(sym, &common_field_dcl);
2477 base_field_dcl = common_field_dcl;
2478 if (sym == YY__SEMICOLON || sym == YY__RBRACE) {
2479 zend_ffi_add_anonymous_field(struct_dcl, &common_field_dcl);
2480 } else if (sym == YY__STAR || sym == YY_ID || sym == YY__LPAREN || sym == YY__COLON) {
2481 sym = parse_struct_declarator(sym, struct_dcl, &common_field_dcl);
2482 while (sym == YY__COMMA) {
2483 sym = get_sym();
2484 zend_ffi_dcl field_dcl = base_field_dcl;
2485 if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FASTCALL,YY___THISCALL,YY___VECTORCALL), "\000\000\000\000\000\000\360\017\000\000\000\000\000")) {
2486 sym = parse_attributes(sym, &field_dcl);
2487 }
2488 sym = parse_struct_declarator(sym, struct_dcl, &field_dcl);
2489 }
2490 } else {
2491 yy_error_sym("unexpected", sym);
2492 }
2493 return sym;
2494}
2495
2496static int parse_struct_declarator(int sym, zend_ffi_dcl *struct_dcl, zend_ffi_dcl *field_dcl) {
2497 const char *name = NULL;
2498 size_t name_len = 0;
2499 zend_ffi_val bits;
2500 if (sym == YY__STAR || sym == YY_ID || sym == YY__LPAREN) {
2501 sym = parse_declarator(sym, field_dcl, &name, &name_len);
2502 if (sym == YY__COLON) {
2503 sym = get_sym();
2504 sym = parse_constant_expression(sym, &bits);
2505 if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FASTCALL,YY___THISCALL,YY___VECTORCALL), "\000\000\000\000\000\000\360\017\000\000\000\000\000")) {
2506 sym = parse_attributes(sym, field_dcl);
2507 }
2508 zend_ffi_add_bit_field(struct_dcl, name, name_len, field_dcl, &bits);
2510 if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FASTCALL,YY___THISCALL,YY___VECTORCALL), "\000\000\000\000\000\000\360\017\000\000\000\000\000")) {
2511 sym = parse_attributes(sym, field_dcl);
2512 }
2513 zend_ffi_add_field(struct_dcl, name, name_len, field_dcl);
2514 } else {
2515 yy_error_sym("unexpected", sym);
2516 }
2517 } else if (sym == YY__COLON) {
2518 sym = get_sym();
2519 sym = parse_constant_expression(sym, &bits);
2520 zend_ffi_add_bit_field(struct_dcl, NULL, 0, field_dcl, &bits);
2521 } else {
2522 yy_error_sym("unexpected", sym);
2523 }
2524 return sym;
2525}
2526
2527static int parse_enum_specifier(int sym, zend_ffi_dcl *dcl) {
2528 if (sym != YY_ENUM) {
2529 yy_error_sym("'enum' expected, got", sym);
2530 }
2531 sym = get_sym();
2532 dcl->flags |= ZEND_FFI_DCL_ENUM;
2533 if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FASTCALL,YY___THISCALL,YY___VECTORCALL), "\000\000\000\000\000\000\360\017\000\000\000\000\000")) {
2534 sym = parse_attributes(sym, dcl);
2535 }
2536 if (sym == YY_ID) {
2537 const char *name;
2538 size_t name_len;
2539 sym = parse_ID(sym, &name, &name_len);
2540 if (sym == YY__LBRACE) {
2541 zend_ffi_declare_tag(name, name_len, dcl, 0);
2542 sym = get_sym();
2543 sym = parse_enumerator_list(sym, dcl);
2544 if (sym != YY__RBRACE) {
2545 yy_error_sym("'}' expected, got", sym);
2546 }
2547 sym = get_sym();
2548 if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FASTCALL,YY___THISCALL,YY___VECTORCALL), "\000\000\000\000\000\000\360\017\000\000\000\000\000")) {
2549 sym = parse_attributes(sym, dcl);
2550 }
2552 zend_ffi_declare_tag(name, name_len, dcl, 1);
2553 } else {
2554 yy_error_sym("unexpected", sym);
2555 }
2556 } else if (sym == YY__LBRACE) {
2557 sym = get_sym();
2559 sym = parse_enumerator_list(sym, dcl);
2560 if (sym != YY__RBRACE) {
2561 yy_error_sym("'}' expected, got", sym);
2562 }
2563 sym = get_sym();
2564 if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FASTCALL,YY___THISCALL,YY___VECTORCALL), "\000\000\000\000\000\000\360\017\000\000\000\000\000")) {
2565 sym = parse_attributes(sym, dcl);
2566 }
2567 } else {
2568 yy_error_sym("unexpected", sym);
2569 }
2570 return sym;
2571}
2572
2573static int parse_enumerator_list(int sym, zend_ffi_dcl *enum_dcl) {
2574 int sym2;
2575 const unsigned char *save_pos;
2576 const unsigned char *save_text;
2577 int save_line;
2578 int alt250;
2579 int64_t min = 0, max = 0, last = -1;
2580 sym = parse_enumerator(sym, enum_dcl, &min, &max, &last);
2581 while (1) {
2582 save_pos = yy_pos;
2583 save_text = yy_text;
2584 save_line = yy_line;
2585 alt250 = -2;
2586 sym2 = sym;
2587 if (sym2 == YY__COMMA) {
2588 sym2 = get_sym();
2589 goto _yy_state_250_1;
2590 } else if (sym2 == YY__RBRACE) {
2591 alt250 = -1;
2592 goto _yy_state_250;
2593 } else {
2594 yy_error_sym("unexpected", sym2);
2595 }
2596_yy_state_250_1:
2597 if (sym2 == YY_ID) {
2598 alt250 = 251;
2599 goto _yy_state_250;
2600 } else if (sym2 == YY__RBRACE) {
2601 alt250 = 253;
2602 goto _yy_state_250;
2603 } else {
2604 yy_error_sym("unexpected", sym2);
2605 }
2606_yy_state_250:
2607 yy_pos = save_pos;
2608 yy_text = save_text;
2609 yy_line = save_line;
2610 if (alt250 != 251) {
2611 break;
2612 }
2613 sym = get_sym();
2614 sym = parse_enumerator(sym, enum_dcl, &min, &max, &last);
2615 }
2616 if (alt250 == 253) {
2617 sym = get_sym();
2618 }
2619 return sym;
2620}
2621
2622static int parse_enumerator(int sym, zend_ffi_dcl *enum_dcl, int64_t *min, int64_t *max, int64_t *last) {
2623 const char *name;
2624 size_t name_len;
2626 sym = parse_ID(sym, &name, &name_len);
2627 if (sym == YY__EQUAL) {
2628 sym = get_sym();
2629 sym = parse_constant_expression(sym, &val);
2630 }
2631 zend_ffi_add_enum_val(enum_dcl, name, name_len, &val, min, max, last);
2632 return sym;
2633}
2634
2635static int parse_declarator(int sym, zend_ffi_dcl *dcl, const char **name, size_t *name_len) {
2636 zend_ffi_dcl nested_dcl = {ZEND_FFI_DCL_CHAR, 0, 0, 0, NULL};
2637 bool nested = 0;
2638 if (sym == YY__STAR) {
2639 sym = parse_pointer(sym, dcl);
2640 }
2641 if (sym == YY_ID) {
2642 sym = parse_ID(sym, name, name_len);
2643 } else if (sym == YY__LPAREN) {
2644 sym = get_sym();
2645 if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FASTCALL,YY___THISCALL,YY___VECTORCALL), "\000\000\000\000\000\000\360\017\000\000\000\000\000")) {
2646 sym = parse_attributes(sym, &nested_dcl);
2647 }
2648 sym = parse_declarator(sym, &nested_dcl, name, name_len);
2649 if (sym != YY__RPAREN) {
2650 yy_error_sym("')' expected, got", sym);
2651 }
2652 sym = get_sym();
2653 nested = 1;
2654 } else {
2655 yy_error_sym("unexpected", sym);
2656 }
2657 if (sym == YY__LBRACK || sym == YY__LPAREN) {
2658 sym = parse_array_or_function_declarators(sym, dcl, &nested_dcl);
2659 }
2660 if (nested) zend_ffi_nested_declaration(dcl, &nested_dcl);
2661 return sym;
2662}
2663
2664static int parse_abstract_declarator(int sym, zend_ffi_dcl *dcl) {
2665 zend_ffi_dcl nested_dcl = {ZEND_FFI_DCL_CHAR, 0, 0, 0, NULL};
2666 bool nested = 0;
2667 if (sym == YY__STAR) {
2668 sym = parse_pointer(sym, dcl);
2669 }
2670 if ((sym == YY__LPAREN) && synpred_2(sym)) {
2671 sym = get_sym();
2672 if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FASTCALL,YY___THISCALL,YY___VECTORCALL), "\000\000\000\000\000\000\360\017\000\000\000\000\000")) {
2673 sym = parse_attributes(sym, &nested_dcl);
2674 }
2675 sym = parse_abstract_declarator(sym, &nested_dcl);
2676 if (sym != YY__RPAREN) {
2677 yy_error_sym("')' expected, got", sym);
2678 }
2679 sym = get_sym();
2680 nested = 1;
2681 }
2682 if (sym == YY__LBRACK || sym == YY__LPAREN) {
2683 sym = parse_array_or_function_declarators(sym, dcl, &nested_dcl);
2684 }
2685 if (nested) zend_ffi_nested_declaration(dcl, &nested_dcl);
2686 return sym;
2687}
2688
2689static int parse_parameter_declarator(int sym, zend_ffi_dcl *dcl, const char **name, size_t *name_len) {
2690 zend_ffi_dcl nested_dcl = {ZEND_FFI_DCL_CHAR, 0, 0, 0, NULL};
2691 bool nested = 0;
2692 if (sym == YY__STAR) {
2693 sym = parse_pointer(sym, dcl);
2694 }
2695 if ((sym == YY__LPAREN) && synpred_3(sym)) {
2696 sym = get_sym();
2697 if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FASTCALL,YY___THISCALL,YY___VECTORCALL), "\000\000\000\000\000\000\360\017\000\000\000\000\000")) {
2698 sym = parse_attributes(sym, &nested_dcl);
2699 }
2700 sym = parse_parameter_declarator(sym, &nested_dcl, name, name_len);
2701 if (sym != YY__RPAREN) {
2702 yy_error_sym("')' expected, got", sym);
2703 }
2704 sym = get_sym();
2705 nested = 1;
2706 } else if (sym == YY_ID) {
2707 sym = parse_ID(sym, name, name_len);
2708 } else if (sym == YY__LBRACK || sym == YY__LPAREN || sym == YY__RPAREN || sym == YY__COMMA) {
2709 } else {
2710 yy_error_sym("unexpected", sym);
2711 }
2712 if (sym == YY__LBRACK || sym == YY__LPAREN) {
2713 sym = parse_array_or_function_declarators(sym, dcl, &nested_dcl);
2714 }
2715 if (nested) zend_ffi_nested_declaration(dcl, &nested_dcl);
2716 return sym;
2717}
2718
2719static int parse_pointer(int sym, zend_ffi_dcl *dcl) {
2720 if (sym != YY__STAR) {
2721 yy_error_sym("'*' expected, got", sym);
2722 }
2723 do {
2724 sym = get_sym();
2727 sym = parse_type_qualifier_list(sym, dcl);
2728 }
2729 } while (sym == YY__STAR);
2730 return sym;
2731}
2732
2733static int parse_array_or_function_declarators(int sym, zend_ffi_dcl *dcl, zend_ffi_dcl *nested_dcl) {
2734 int sym2;
2735 const unsigned char *save_pos;
2736 const unsigned char *save_text;
2737 int save_line;
2738 int alt109;
2739 int alt105;
2740 int alt119;
2743 HashTable *args = NULL;
2744 uint32_t attr = 0;
2745 if (sym == YY__LBRACK) {
2746 sym = get_sym();
2747 save_pos = yy_pos;
2748 save_text = yy_text;
2749 save_line = yy_line;
2750 alt105 = -2;
2751 sym2 = sym;
2752 if (sym2 == YY_STATIC) {
2753 alt105 = 106;
2754 goto _yy_state_105;
2756 alt105 = 109;
2757 goto _yy_state_105;
2758 } else if (sym2 == YY__STAR) {
2759 sym2 = get_sym();
2760 goto _yy_state_105_20;
2762 alt105 = 115;
2763 goto _yy_state_105;
2764 } else if (sym2 == YY__RBRACK) {
2765 alt105 = 116;
2766 goto _yy_state_105;
2767 } else {
2768 yy_error_sym("unexpected", sym2);
2769 }
2770_yy_state_105_20:
2771 if (sym2 == YY__RBRACK) {
2772 alt105 = 114;
2773 goto _yy_state_105;
2775 alt105 = 115;
2776 goto _yy_state_105;
2777 } else {
2778 yy_error_sym("unexpected", sym2);
2779 }
2780_yy_state_105:
2781 yy_pos = save_pos;
2782 yy_text = save_text;
2783 yy_line = save_line;
2784 if (alt105 == 106) {
2785 sym = get_sym();
2787 sym = parse_type_qualifier_list(sym, &dummy);
2788 }
2789 sym = parse_assignment_expression(sym, &len);
2790 } else if (alt105 == 109) {
2791 sym = parse_type_qualifier_list(sym, &dummy);
2792 save_pos = yy_pos;
2793 save_text = yy_text;
2794 save_line = yy_line;
2795 alt109 = -2;
2796 sym2 = sym;
2797 if (sym2 == YY_STATIC) {
2798 alt109 = 110;
2799 goto _yy_state_109;
2800 } else if (sym2 == YY__STAR) {
2801 sym2 = get_sym();
2802 goto _yy_state_109_2;
2804 alt109 = 113;
2805 goto _yy_state_109;
2806 } else if (sym2 == YY__RBRACK) {
2807 alt109 = 116;
2808 goto _yy_state_109;
2809 } else {
2810 yy_error_sym("unexpected", sym2);
2811 }
2812_yy_state_109_2:
2813 if (sym2 == YY__RBRACK) {
2814 alt109 = 112;
2815 goto _yy_state_109;
2817 alt109 = 113;
2818 goto _yy_state_109;
2819 } else {
2820 yy_error_sym("unexpected", sym2);
2821 }
2822_yy_state_109:
2823 yy_pos = save_pos;
2824 yy_text = save_text;
2825 yy_line = save_line;
2826 if (alt109 == 110) {
2827 sym = get_sym();
2828 sym = parse_assignment_expression(sym, &len);
2829 } else if (alt109 == 116) {
2831 } else if (alt109 == 112) {
2832 sym = get_sym();
2834 } else if (alt109 == 113) {
2835 sym = parse_assignment_expression(sym, &len);
2836 } else {
2837 yy_error_sym("unexpected", sym);
2838 }
2839 } else if (alt105 == 116 || alt105 == 114 || alt105 == 115) {
2840 if (alt105 == 116) {
2842 } else if (alt105 == 114) {
2843 sym = get_sym();
2845 } else {
2846 sym = parse_assignment_expression(sym, &len);
2847 }
2848 } else {
2849 yy_error_sym("unexpected", sym);
2850 }
2851 if (sym != YY__RBRACK) {
2852 yy_error_sym("']' expected, got", sym);
2853 }
2854 sym = get_sym();
2855 if (sym == YY__LBRACK || sym == YY__LPAREN) {
2856 sym = parse_array_or_function_declarators(sym, dcl, nested_dcl);
2857 }
2858 dcl->attr |= attr;
2860 } else if (sym == YY__LPAREN) {
2861 sym = get_sym();
2864 sym = parse_parameter_declaration(sym, &args);
2865 while (1) {
2866 save_pos = yy_pos;
2867 save_text = yy_text;
2868 save_line = yy_line;
2869 alt119 = -2;
2870 sym2 = sym;
2871 if (sym2 == YY__COMMA) {
2872 sym2 = get_sym();
2873 goto _yy_state_119_1;
2874 } else if (sym2 == YY__RPAREN) {
2875 alt119 = 125;
2876 goto _yy_state_119;
2877 } else {
2878 yy_error_sym("unexpected", sym2);
2879 }
2880_yy_state_119_1:
2882 alt119 = 120;
2883 goto _yy_state_119;
2884 } else if (sym2 == YY__POINT_POINT_POINT) {
2885 alt119 = 122;
2886 goto _yy_state_119;
2887 } else {
2888 yy_error_sym("unexpected", sym2);
2889 }
2890_yy_state_119:
2891 yy_pos = save_pos;
2892 yy_text = save_text;
2893 yy_line = save_line;
2894 if (alt119 != 120) {
2895 break;
2896 }
2897 sym = get_sym();
2898 sym = parse_parameter_declaration(sym, &args);
2899 }
2900 if (alt119 == 122) {
2901 sym = get_sym();
2902 if (sym != YY__POINT_POINT_POINT) {
2903 yy_error_sym("'...' expected, got", sym);
2904 }
2905 sym = get_sym();
2907 }
2908 } else {
2909 sym = get_sym();
2911 }
2912 }
2913 if (sym != YY__RPAREN) {
2914 yy_error_sym("')' expected, got", sym);
2915 }
2916 sym = get_sym();
2917 if (sym == YY__LBRACK || sym == YY__LPAREN) {
2918 sym = parse_array_or_function_declarators(sym, dcl, nested_dcl);
2919 }
2920 dcl->attr |= attr;
2921 zend_ffi_make_func_type(dcl, args, nested_dcl);
2922 } else {
2923 yy_error_sym("unexpected", sym);
2924 }
2925 return sym;
2926}
2927
2928static int parse_parameter_declaration(int sym, HashTable **args) {
2929 const char *name = NULL;
2930 size_t name_len = 0;
2931 bool old_allow_vla = FFI_G(allow_vla);
2932 FFI_G(allow_vla) = 1;
2933 zend_ffi_dcl param_dcl = ZEND_FFI_ATTR_INIT;
2934 sym = parse_specifier_qualifier_list(sym, &param_dcl);
2935 sym = parse_parameter_declarator(sym, &param_dcl, &name, &name_len);
2936 zend_ffi_add_arg(args, name, name_len, &param_dcl);
2937 FFI_G(allow_vla) = old_allow_vla;
2938 return sym;
2939}
2940
2941static int parse_type_name(int sym, zend_ffi_dcl *dcl) {
2942 sym = parse_specifier_qualifier_list(sym, dcl);
2943 sym = parse_abstract_declarator(sym, dcl);
2944 return sym;
2945}
2946
2947static int parse_attributes(int sym, zend_ffi_dcl *dcl) {
2948 const char *name;
2949 size_t name_len;
2951 do {
2952 switch (sym) {
2953 case YY___ATTRIBUTE:
2954 case YY___ATTRIBUTE__:
2955 sym = get_sym();
2956 if (sym != YY__LPAREN) {
2957 yy_error_sym("'(' expected, got", sym);
2958 }
2959 sym = get_sym();
2960 if (sym != YY__LPAREN) {
2961 yy_error_sym("'(' expected, got", sym);
2962 }
2963 sym = get_sym();
2964 sym = parse_attrib(sym, dcl);
2965 while (sym == YY__COMMA) {
2966 sym = get_sym();
2967 sym = parse_attrib(sym, dcl);
2968 }
2969 if (sym != YY__RPAREN) {
2970 yy_error_sym("')' expected, got", sym);
2971 }
2972 sym = get_sym();
2973 if (sym != YY__RPAREN) {
2974 yy_error_sym("')' expected, got", sym);
2975 }
2976 sym = get_sym();
2977 break;
2978 case YY___DECLSPEC:
2979 sym = get_sym();
2980 if (sym != YY__LPAREN) {
2981 yy_error_sym("'(' expected, got", sym);
2982 }
2983 sym = get_sym();
2984 do {
2985 sym = parse_ID(sym, &name, &name_len);
2986 if (sym == YY__LPAREN) {
2987 sym = get_sym();
2988 sym = parse_assignment_expression(sym, &val);
2990 if (sym != YY__RPAREN) {
2991 yy_error_sym("')' expected, got", sym);
2992 }
2993 sym = get_sym();
2994 }
2995 } while (sym == YY_ID);
2996 if (sym != YY__RPAREN) {
2997 yy_error_sym("')' expected, got", sym);
2998 }
2999 sym = get_sym();
3000 break;
3001 case YY___CDECL:
3002 sym = get_sym();
3004 break;
3005 case YY___STDCALL:
3006 sym = get_sym();
3008 break;
3009 case YY___FASTCALL:
3010 sym = get_sym();
3012 break;
3013 case YY___THISCALL:
3014 sym = get_sym();
3016 break;
3017 case YY___VECTORCALL:
3018 sym = get_sym();
3020 break;
3021 default:
3022 yy_error_sym("unexpected", sym);
3023 }
3024 } while (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FASTCALL,YY___THISCALL,YY___VECTORCALL), "\000\000\000\000\000\000\360\017\000\000\000\000\000"));
3025 return sym;
3026}
3027
3028static int parse_attrib(int sym, zend_ffi_dcl *dcl) {
3029 const char *name;
3030 size_t name_len;
3031 int n;
3033 bool orig_attribute_parsing;
3034 if (sym == YY_ID || sym == YY_CONST || sym == YY___CONST || sym == YY___CONST__) {
3035 if (sym == YY_ID) {
3036 sym = parse_ID(sym, &name, &name_len);
3037 if (sym == YY__COMMA || sym == YY__RPAREN) {
3038 zend_ffi_add_attribute(dcl, name, name_len);
3039 } else if (sym == YY__LPAREN) {
3040 sym = get_sym();
3041 orig_attribute_parsing = FFI_G(attribute_parsing);
3043 sym = parse_assignment_expression(sym, &val);
3044 zend_ffi_add_attribute_value(dcl, name, name_len, 0, &val);
3045 n = 0;
3046 while (sym == YY__COMMA) {
3047 sym = get_sym();
3048 sym = parse_assignment_expression(sym, &val);
3049 zend_ffi_add_attribute_value(dcl, name, name_len, ++n, &val);
3050 }
3051 FFI_G(attribute_parsing) = orig_attribute_parsing;
3052 if (sym != YY__RPAREN) {
3053 yy_error_sym("')' expected, got", sym);
3054 }
3055 sym = get_sym();
3056 } else {
3057 yy_error_sym("unexpected", sym);
3058 }
3059 } else if (sym == YY_CONST) {
3060 sym = get_sym();
3061 } else if (sym == YY___CONST) {
3062 sym = get_sym();
3063 } else {
3064 sym = get_sym();
3065 }
3066 }
3067 return sym;
3068}
3069
3070static int parse_initializer(int sym) {
3071 int sym2;
3072 const unsigned char *save_pos;
3073 const unsigned char *save_text;
3074 int save_line;
3075 int alt343;
3076 zend_ffi_val dummy;
3077 if (sym != YY__EQUAL) {
3078 yy_error_sym("'=' expected, got", sym);
3079 }
3080 sym = get_sym();
3082 sym = parse_assignment_expression(sym, &dummy);
3083 } else if (sym == YY__LBRACE) {
3084 sym = get_sym();
3085 if (sym == YY__LBRACK || sym == YY__POINT) {
3086 sym = parse_designation(sym);
3087 }
3088 sym = parse_initializer(sym);
3089 while (1) {
3090 save_pos = yy_pos;
3091 save_text = yy_text;
3092 save_line = yy_line;
3093 alt343 = -2;
3094 sym2 = sym;
3095 if (sym2 == YY__COMMA) {
3096 sym2 = get_sym();
3097 goto _yy_state_343_1;
3098 } else if (sym2 == YY__RBRACE) {
3099 alt343 = 348;
3100 goto _yy_state_343;
3101 } else {
3102 yy_error_sym("unexpected", sym2);
3103 }
3104_yy_state_343_1:
3105 if (sym2 == YY__LBRACK || sym2 == YY__POINT || sym2 == YY__EQUAL) {
3106 alt343 = 344;
3107 goto _yy_state_343;
3108 } else if (sym2 == YY__RBRACE) {
3109 alt343 = 347;
3110 goto _yy_state_343;
3111 } else {
3112 yy_error_sym("unexpected", sym2);
3113 }
3114_yy_state_343:
3115 yy_pos = save_pos;
3116 yy_text = save_text;
3117 yy_line = save_line;
3118 if (alt343 != 344) {
3119 break;
3120 }
3121 sym = get_sym();
3122 if (sym == YY__LBRACK || sym == YY__POINT) {
3123 sym = parse_designation(sym);
3124 }
3125 sym = parse_initializer(sym);
3126 }
3127 if (alt343 == 347) {
3128 sym = get_sym();
3129 }
3130 if (sym != YY__RBRACE) {
3131 yy_error_sym("'}' expected, got", sym);
3132 }
3133 sym = get_sym();
3134 } else {
3135 yy_error_sym("unexpected", sym);
3136 }
3137 return sym;
3138}
3139
3140static int parse_designation(int sym) {
3141 const char *name;
3142 size_t name_len;
3143 zend_ffi_val dummy;
3144 do {
3145 if (sym == YY__LBRACK) {
3146 sym = get_sym();
3147 sym = parse_constant_expression(sym, &dummy);
3148 if (sym != YY__RBRACK) {
3149 yy_error_sym("']' expected, got", sym);
3150 }
3151 sym = get_sym();
3152 } else if (sym == YY__POINT) {
3153 sym = get_sym();
3154 sym = parse_ID(sym, &name, &name_len);
3155 } else {
3156 yy_error_sym("unexpected", sym);
3157 }
3158 } while (sym == YY__LBRACK || sym == YY__POINT);
3159 if (sym != YY__EQUAL) {
3160 yy_error_sym("'=' expected, got", sym);
3161 }
3162 sym = get_sym();
3163 return sym;
3164}
3165
3166static int parse_expr_list(int sym) {
3167 zend_ffi_val dummy;
3168 sym = parse_assignment_expression(sym, &dummy);
3169 while (sym == YY__COMMA) {
3170 sym = get_sym();
3171 sym = parse_assignment_expression(sym, &dummy);
3172 }
3173 return sym;
3174}
3175
3176static int parse_expression(int sym, zend_ffi_val *val) {
3177 sym = parse_assignment_expression(sym, val);
3178 while (sym == YY__COMMA) {
3179 sym = get_sym();
3180 sym = parse_assignment_expression(sym, val);
3181 }
3182 return sym;
3183}
3184
3185static int parse_assignment_expression(int sym, zend_ffi_val *val) {
3186 sym = parse_conditional_expression(sym, val);
3187 return sym;
3188}
3189
3190static int parse_constant_expression(int sym, zend_ffi_val *val) {
3191 sym = parse_conditional_expression(sym, val);
3192 return sym;
3193}
3194
3195static int parse_conditional_expression(int sym, zend_ffi_val *val) {
3196 zend_ffi_val op2, op3;
3197 sym = parse_logical_or_expression(sym, val);
3198 if (sym == YY__QUERY) {
3199 sym = get_sym();
3200 sym = parse_expression(sym, &op2);
3201 if (sym != YY__COLON) {
3202 yy_error_sym("':' expected, got", sym);
3203 }
3204 sym = get_sym();
3205 sym = parse_conditional_expression(sym, &op3);
3207 }
3208 return sym;
3209}
3210
3211static int parse_logical_or_expression(int sym, zend_ffi_val *val) {
3213 sym = parse_logical_and_expression(sym, val);
3214 while (sym == YY__BAR_BAR) {
3215 sym = get_sym();
3216 sym = parse_logical_and_expression(sym, &op2);
3218 }
3219 return sym;
3220}
3221
3222static int parse_logical_and_expression(int sym, zend_ffi_val *val) {
3224 sym = parse_inclusive_or_expression(sym, val);
3225 while (sym == YY__AND_AND) {
3226 sym = get_sym();
3227 sym = parse_inclusive_or_expression(sym, &op2);
3229 }
3230 return sym;
3231}
3232
3233static int parse_inclusive_or_expression(int sym, zend_ffi_val *val) {
3235 sym = parse_exclusive_or_expression(sym, val);
3236 while (sym == YY__BAR) {
3237 sym = get_sym();
3238 sym = parse_exclusive_or_expression(sym, &op2);
3240 }
3241 return sym;
3242}
3243
3244static int parse_exclusive_or_expression(int sym, zend_ffi_val *val) {
3246 sym = parse_and_expression(sym, val);
3247 while (sym == YY__UPARROW) {
3248 sym = get_sym();
3249 sym = parse_and_expression(sym, &op2);
3251 }
3252 return sym;
3253}
3254
3255static int parse_and_expression(int sym, zend_ffi_val *val) {
3257 sym = parse_equality_expression(sym, val);
3258 while (sym == YY__AND) {
3259 sym = get_sym();
3260 sym = parse_equality_expression(sym, &op2);
3262 }
3263 return sym;
3264}
3265
3266static int parse_equality_expression(int sym, zend_ffi_val *val) {
3268 sym = parse_relational_expression(sym, val);
3269 while (sym == YY__EQUAL_EQUAL || sym == YY__BANG_EQUAL) {
3270 if (sym == YY__EQUAL_EQUAL) {
3271 sym = get_sym();
3272 sym = parse_relational_expression(sym, &op2);
3274 } else {
3275 sym = get_sym();
3276 sym = parse_relational_expression(sym, &op2);
3278 }
3279 }
3280 return sym;
3281}
3282
3283static int parse_relational_expression(int sym, zend_ffi_val *val) {
3285 sym = parse_shift_expression(sym, val);
3286 while (sym == YY__LESS || sym == YY__GREATER || sym == YY__LESS_EQUAL || sym == YY__GREATER_EQUAL) {
3287 if (sym == YY__LESS) {
3288 sym = get_sym();
3289 sym = parse_shift_expression(sym, &op2);
3291 } else if (sym == YY__GREATER) {
3292 sym = get_sym();
3293 sym = parse_shift_expression(sym, &op2);
3295 } else if (sym == YY__LESS_EQUAL) {
3296 sym = get_sym();
3297 sym = parse_shift_expression(sym, &op2);
3299 } else {
3300 sym = get_sym();
3301 sym = parse_shift_expression(sym, &op2);
3303 }
3304 }
3305 return sym;
3306}
3307
3308static int parse_shift_expression(int sym, zend_ffi_val *val) {
3310 sym = parse_additive_expression(sym, val);
3311 while (sym == YY__LESS_LESS || sym == YY__GREATER_GREATER) {
3312 if (sym == YY__LESS_LESS) {
3313 sym = get_sym();
3314 sym = parse_additive_expression(sym, &op2);
3316 } else {
3317 sym = get_sym();
3318 sym = parse_additive_expression(sym, &op2);
3320 }
3321 }
3322 return sym;
3323}
3324
3325static int parse_additive_expression(int sym, zend_ffi_val *val) {
3327 sym = parse_multiplicative_expression(sym, val);
3328 while (sym == YY__PLUS || sym == YY__MINUS) {
3329 if (sym == YY__PLUS) {
3330 sym = get_sym();
3331 sym = parse_multiplicative_expression(sym, &op2);
3333 } else {
3334 sym = get_sym();
3335 sym = parse_multiplicative_expression(sym, &op2);
3337 }
3338 }
3339 return sym;
3340}
3341
3342static int parse_multiplicative_expression(int sym, zend_ffi_val *val) {
3344 sym = parse_cast_expression(sym, val);
3345 while (sym == YY__STAR || sym == YY__SLASH || sym == YY__PERCENT) {
3346 if (sym == YY__STAR) {
3347 sym = get_sym();
3348 sym = parse_cast_expression(sym, &op2);
3350 } else if (sym == YY__SLASH) {
3351 sym = get_sym();
3352 sym = parse_cast_expression(sym, &op2);
3354 } else {
3355 sym = get_sym();
3356 sym = parse_cast_expression(sym, &op2);
3358 }
3359 }
3360 return sym;
3361}
3362
3363static int parse_cast_expression(int sym, zend_ffi_val *val) {
3364 int do_cast = 0;
3366 if ((sym == YY__LPAREN) && synpred_4(sym)) {
3367 sym = get_sym();
3368 sym = parse_type_name(sym, &dcl);
3369 if (sym != YY__RPAREN) {
3370 yy_error_sym("')' expected, got", sym);
3371 }
3372 sym = get_sym();
3373 do_cast = 1;
3374 }
3375 sym = parse_unary_expression(sym, val);
3376 if (do_cast) zend_ffi_expr_cast(val, &dcl);
3377 return sym;
3378}
3379
3380static int parse_unary_expression(int sym, zend_ffi_val *val) {
3381 const char *name;
3382 size_t name_len;
3384 switch (sym) {
3385 case YY_ID:
3386 sym = parse_ID(sym, &name, &name_len);
3387 zend_ffi_resolve_const(name, name_len, val);
3388 while (YY_IN_SET(sym, (YY__LBRACK,YY__LPAREN,YY__POINT,YY__MINUS_GREATER,YY__PLUS_PLUS,YY__MINUS_MINUS), "\010\000\000\000\000\000\002\020\000\200\003\000\000")) {
3389 switch (sym) {
3390 case YY__LBRACK:
3391 sym = get_sym();
3392 sym = parse_expr_list(sym);
3393 if (sym != YY__RBRACK) {
3394 yy_error_sym("']' expected, got", sym);
3395 }
3396 sym = get_sym();
3397 break;
3398 case YY__LPAREN:
3399 sym = get_sym();
3401 sym = parse_expr_list(sym);
3402 }
3403 if (sym != YY__RPAREN) {
3404 yy_error_sym("')' expected, got", sym);
3405 }
3406 sym = get_sym();
3407 break;
3408 case YY__POINT:
3409 sym = get_sym();
3410 sym = parse_ID(sym, &name, &name_len);
3411 break;
3412 case YY__MINUS_GREATER:
3413 sym = get_sym();
3414 sym = parse_ID(sym, &name, &name_len);
3415 break;
3416 case YY__PLUS_PLUS:
3417 sym = get_sym();
3418 break;
3419 default:
3420 sym = get_sym();
3421 break;
3422 }
3423 zend_ffi_val_error(val);
3424 }
3425 break;
3426 case YY_OCTNUMBER:
3427 sym = parse_OCTNUMBER(sym, val);
3428 break;
3429 case YY_DECNUMBER:
3430 sym = parse_DECNUMBER(sym, val);
3431 break;
3432 case YY_HEXNUMBER:
3433 sym = parse_HEXNUMBER(sym, val);
3434 break;
3435 case YY_FLOATNUMBER:
3436 sym = parse_FLOATNUMBER(sym, val);
3437 break;
3438 case YY_STRING:
3439 sym = parse_STRING(sym, val);
3440 break;
3441 case YY_CHARACTER:
3442 sym = parse_CHARACTER(sym, val);
3443 break;
3444 case YY__LPAREN:
3445 sym = get_sym();
3446 sym = parse_expression(sym, val);
3447 if (sym != YY__RPAREN) {
3448 yy_error_sym("')' expected, got", sym);
3449 }
3450 sym = get_sym();
3451 break;
3452 case YY__PLUS_PLUS:
3453 sym = get_sym();
3454 sym = parse_unary_expression(sym, val);
3455 zend_ffi_val_error(val);
3456 break;
3457 case YY__MINUS_MINUS:
3458 sym = get_sym();
3459 sym = parse_unary_expression(sym, val);
3460 zend_ffi_val_error(val);
3461 break;
3462 case YY__AND:
3463 sym = get_sym();
3464 sym = parse_cast_expression(sym, val);
3465 zend_ffi_val_error(val);
3466 break;
3467 case YY__STAR:
3468 sym = get_sym();
3469 sym = parse_cast_expression(sym, val);
3470 zend_ffi_val_error(val);
3471 break;
3472 case YY__PLUS:
3473 sym = get_sym();
3474 sym = parse_cast_expression(sym, val);
3476 break;
3477 case YY__MINUS:
3478 sym = get_sym();
3479 sym = parse_cast_expression(sym, val);
3481 break;
3482 case YY__TILDE:
3483 sym = get_sym();
3484 sym = parse_cast_expression(sym, val);
3486 break;
3487 case YY__BANG:
3488 sym = get_sym();
3489 sym = parse_cast_expression(sym, val);
3491 break;
3492 case YY_SIZEOF:
3493 sym = get_sym();
3494 if ((sym == YY__LPAREN) && synpred_5(sym)) {
3495 sym = get_sym();
3496 sym = parse_type_name(sym, &dcl);
3497 if (sym != YY__RPAREN) {
3498 yy_error_sym("')' expected, got", sym);
3499 }
3500 sym = get_sym();
3503 sym = parse_unary_expression(sym, val);
3505 } else {
3506 yy_error_sym("unexpected", sym);
3507 }
3508 break;
3509 case YY__ALIGNOF:
3510 sym = get_sym();
3511 if (sym != YY__LPAREN) {
3512 yy_error_sym("'(' expected, got", sym);
3513 }
3514 sym = get_sym();
3515 sym = parse_type_name(sym, &dcl);
3516 if (sym != YY__RPAREN) {
3517 yy_error_sym("')' expected, got", sym);
3518 }
3519 sym = get_sym();
3521 break;
3522 case YY___ALIGNOF:
3523 case YY___ALIGNOF__:
3524 sym = get_sym();
3525 if ((sym == YY__LPAREN) && synpred_6(sym)) {
3526 sym = get_sym();
3527 sym = parse_type_name(sym, &dcl);
3528 if (sym != YY__RPAREN) {
3529 yy_error_sym("')' expected, got", sym);
3530 }
3531 sym = get_sym();
3534 sym = parse_unary_expression(sym, val);
3536 } else {
3537 yy_error_sym("unexpected", sym);
3538 }
3539 break;
3540 default:
3541 yy_error_sym("unexpected", sym);
3542 }
3543 return sym;
3544}
3545
3546static int parse_ID(int sym, const char **name, size_t *name_len) {
3547 if (sym != YY_ID) {
3548 yy_error_sym("<ID> expected, got", sym);
3549 }
3550 *name = (const char*)yy_text; *name_len = yy_pos - yy_text;
3551 sym = get_sym();
3552 return sym;
3553}
3554
3555static int parse_OCTNUMBER(int sym, zend_ffi_val *val) {
3556 if (sym != YY_OCTNUMBER) {
3557 yy_error_sym("<OCTNUMBER> expected, got", sym);
3558 }
3559 zend_ffi_val_number(val, 8, (const char*)yy_text, yy_pos - yy_text);
3560 sym = get_sym();
3561 return sym;
3562}
3563
3564static int parse_DECNUMBER(int sym, zend_ffi_val *val) {
3565 if (sym != YY_DECNUMBER) {
3566 yy_error_sym("<DECNUMBER> expected, got", sym);
3567 }
3568 zend_ffi_val_number(val, 10, (const char*)yy_text, yy_pos - yy_text);
3569 sym = get_sym();
3570 return sym;
3571}
3572
3573static int parse_HEXNUMBER(int sym, zend_ffi_val *val) {
3574 if (sym != YY_HEXNUMBER) {
3575 yy_error_sym("<HEXNUMBER> expected, got", sym);
3576 }
3577 zend_ffi_val_number(val, 16, (const char*)yy_text + 2, yy_pos - yy_text - 2);
3578 sym = get_sym();
3579 return sym;
3580}
3581
3582static int parse_FLOATNUMBER(int sym, zend_ffi_val *val) {
3583 if (sym != YY_FLOATNUMBER) {
3584 yy_error_sym("<FLOATNUMBER> expected, got", sym);
3585 }
3587 sym = get_sym();
3588 return sym;
3589}
3590
3591static int parse_STRING(int sym, zend_ffi_val *val) {
3592 if (sym != YY_STRING) {
3593 yy_error_sym("<STRING> expected, got", sym);
3594 }
3595 zend_ffi_val_string(val, (const char*)yy_text, yy_pos - yy_text);
3596 sym = get_sym();
3597 return sym;
3598}
3599
3600static int parse_CHARACTER(int sym, zend_ffi_val *val) {
3601 if (sym != YY_CHARACTER) {
3602 yy_error_sym("<CHARACTER> expected, got", sym);
3603 }
3605 sym = get_sym();
3606 return sym;
3607}
3608
3609static void parse(void) {
3610 int sym;
3611
3612 yy_pos = yy_text = yy_buf;
3613 yy_line = 1;
3614 sym = parse_declarations(get_sym());
3615 if (sym != YY_EOF) {
3616 yy_error_sym("<EOF> expected, got", sym);
3617 }
3618}
3619
3620zend_result zend_ffi_parse_decl(const char *str, size_t len) {
3621 if (SETJMP(FFI_G(bailout))==0) {
3622 FFI_G(allow_vla) = 0;
3624 yy_buf = (unsigned char*)str;
3625 yy_end = yy_buf + len;
3626 parse();
3627 return SUCCESS;
3628 } else {
3629 return FAILURE;
3630 }
3631}
3632
3634 int sym;
3635
3636 if (SETJMP(FFI_G(bailout))==0) {
3637 FFI_G(allow_vla) = 0;
3639 yy_pos = yy_text = yy_buf = (unsigned char*)str;
3640 yy_end = yy_buf + len;
3641 yy_line = 1;
3642 sym = parse_type_name(get_sym(), dcl);
3643 if (sym != YY_EOF) {
3644 yy_error_sym("<EOF> expected, got", sym);
3645 }
3647 return SUCCESS;
3648 } else {
3649 return FAILURE;
3650 };
3651}
3652
3653static void yy_error(const char *msg) {
3654 zend_ffi_parser_error("%s at line %d", msg, yy_line);
3655}
3656
3657static void yy_error_sym(const char *msg, int sym) {
3658 zend_ffi_parser_error("%s '%s' at line %d", msg, sym_name[sym], yy_line);
3659}
3660
3661static void yy_error_str(const char *msg, const char *str) {
3662 zend_ffi_parser_error("%s '%s' at line %d\n", msg, str, yy_line);
3663}
size_t len
Definition apprentice.c:174
#define max(a, b)
Definition exif.c:60
void zend_ffi_resolve_typedef(const char *name, size_t name_len, zend_ffi_dcl *dcl)
Definition ffi.c:5891
void zend_ffi_add_arg(HashTable **args, const char *name, size_t name_len, zend_ffi_dcl *arg_dcl)
Definition ffi.c:6597
void zend_ffi_expr_cast(zend_ffi_val *val, zend_ffi_dcl *dcl)
Definition ffi.c:7498
bool zend_ffi_is_typedef_name(const char *name, size_t name_len)
Definition ffi.c:5872
void zend_ffi_expr_plus(zend_ffi_val *val)
Definition ffi.c:7632
void zend_ffi_expr_sizeof_val(zend_ffi_val *val)
Definition ffi.c:7683
void zend_ffi_cleanup_dcl(zend_ffi_dcl *dcl)
Definition ffi.c:3639
void zend_ffi_align_as_val(zend_ffi_dcl *dcl, zend_ffi_val *align_val)
Definition ffi.c:7121
void zend_ffi_add_enum_val(zend_ffi_dcl *enum_dcl, const char *name, size_t name_len, zend_ffi_val *val, int64_t *min, int64_t *max, int64_t *last)
Definition ffi.c:5975
void zend_ffi_expr_alignof_val(zend_ffi_val *val)
Definition ffi.c:7733
void zend_ffi_expr_neg(zend_ffi_val *val)
Definition ffi.c:7644
void zend_ffi_expr_alignof_type(zend_ffi_val *val, zend_ffi_dcl *dcl)
Definition ffi.c:7764
void zend_ffi_expr_bool_or(zend_ffi_val *val, zend_ffi_val *op2)
Definition ffi.c:7378
void zend_ffi_add_bit_field(zend_ffi_dcl *struct_dcl, const char *name, size_t name_len, zend_ffi_dcl *field_dcl, zend_ffi_val *bits)
Definition ffi.c:6249
void zend_ffi_adjust_struct_size(zend_ffi_dcl *dcl)
Definition ffi.c:6351
zend_long ch
Definition ffi.c:4580
zend_long n
Definition ffi.c:4979
void zend_ffi_expr_div(zend_ffi_val *val, zend_ffi_val *op2)
Definition ffi.c:7486
void zend_ffi_expr_shift_left(zend_ffi_val *val, zend_ffi_val *op2)
Definition ffi.c:7456
void zend_ffi_expr_bw_or(zend_ffi_val *val, zend_ffi_val *op2)
Definition ffi.c:7402
new_type size
Definition ffi.c:4365
void zend_ffi_expr_is_less_or_equal(zend_ffi_val *val, zend_ffi_val *op2)
Definition ffi.c:7444
void zend_ffi_make_pointer_type(zend_ffi_dcl *dcl)
Definition ffi.c:6366
void zend_ffi_add_anonymous_field(zend_ffi_dcl *struct_dcl, zend_ffi_dcl *field_dcl)
Definition ffi.c:6181
void zend_ffi_expr_is_not_equal(zend_ffi_val *val, zend_ffi_val *op2)
Definition ffi.c:7426
void zend_ffi_expr_bw_not(zend_ffi_val *val)
Definition ffi.c:7660
void zend_ffi_declare(const char *name, size_t name_len, zend_ffi_dcl *dcl)
Definition ffi.c:6640
void zend_ffi_nested_declaration(zend_ffi_dcl *dcl, zend_ffi_dcl *nested_dcl)
Definition ffi.c:7098
void zend_ffi_expr_is_greater_or_equal(zend_ffi_val *val, zend_ffi_val *op2)
Definition ffi.c:7450
void zend_ffi_expr_sizeof_type(zend_ffi_val *val, zend_ffi_dcl *dcl)
Definition ffi.c:7721
void zend_ffi_expr_mul(zend_ffi_val *val, zend_ffi_val *op2)
Definition ffi.c:7480
void zend_ffi_add_attribute_value(zend_ffi_dcl *dcl, const char *name, size_t name_len, int n, zend_ffi_val *val)
Definition ffi.c:6924
zend_ffi_dcl dcl
Definition ffi.c:4153
void zend_ffi_parser_error(const char *format,...)
Definition ffi.c:5759
void zend_ffi_expr_mod(zend_ffi_val *val, zend_ffi_val *op2)
Definition ffi.c:7492
void zend_ffi_expr_bool_and(zend_ffi_val *val, zend_ffi_val *op2)
Definition ffi.c:7390
void zend_ffi_expr_shift_right(zend_ffi_val *val, zend_ffi_val *op2)
Definition ffi.c:7462
void zend_ffi_make_struct_type(zend_ffi_dcl *dcl)
Definition ffi.c:6085
new_type attr
Definition ffi.c:4364
zval * val
Definition ffi.c:4262
void zend_ffi_expr_is_less(zend_ffi_val *val, zend_ffi_val *op2)
Definition ffi.c:7432
void zend_ffi_expr_bw_xor(zend_ffi_val *val, zend_ffi_val *op2)
Definition ffi.c:7408
void zend_ffi_make_func_type(zend_ffi_dcl *dcl, HashTable *args, zend_ffi_dcl *nested_dcl)
Definition ffi.c:6459
void zend_ffi_val_character(zend_ffi_val *val, const char *str, size_t str_len)
Definition ffi.c:7844
void zend_ffi_validate_type_name(zend_ffi_dcl *dcl)
Definition ffi.c:3741
void zend_ffi_expr_bw_and(zend_ffi_val *val, zend_ffi_val *op2)
Definition ffi.c:7414
void zend_ffi_set_abi(zend_ffi_dcl *dcl, uint16_t abi)
Definition ffi.c:6807
void zend_ffi_make_enum_type(zend_ffi_dcl *dcl)
Definition ffi.c:5955
void zend_ffi_resolve_const(const char *name, size_t name_len, zend_ffi_val *val)
Definition ffi.c:5915
void zend_ffi_declare_tag(const char *name, size_t name_len, zend_ffi_dcl *dcl, bool incomplete)
Definition ffi.c:6729
void zend_ffi_val_number(zend_ffi_val *val, int base, const char *str, size_t str_len)
Definition ffi.c:7773
void zend_ffi_add_field(zend_ffi_dcl *struct_dcl, const char *name, size_t name_len, zend_ffi_dcl *field_dcl)
Definition ffi.c:6137
void zend_ffi_val_float_number(zend_ffi_val *val, const char *str, size_t str_len)
Definition ffi.c:7819
void zend_ffi_expr_is_greater(zend_ffi_val *val, zend_ffi_val *op2)
Definition ffi.c:7438
void zend_ffi_expr_bool_not(zend_ffi_val *val)
Definition ffi.c:7674
void zend_ffi_val_string(zend_ffi_val *val, const char *str, size_t str_len)
Definition ffi.c:7832
void zend_ffi_add_msvc_attribute_value(zend_ffi_dcl *dcl, const char *name, size_t name_len, zend_ffi_val *val)
Definition ffi.c:7039
void zend_ffi_expr_sub(zend_ffi_val *val, zend_ffi_val *op2)
Definition ffi.c:7474
void zend_ffi_add_attribute(zend_ffi_dcl *dcl, const char *name, size_t name_len)
Definition ffi.c:6841
zend_ffi_ctype_name_buf buf
Definition ffi.c:4685
void zend_ffi_make_array_type(zend_ffi_dcl *dcl, zend_ffi_val *len)
Definition ffi.c:6399
void zend_ffi_expr_conditional(zend_ffi_val *val, zend_ffi_val *op2, zend_ffi_val *op3)
Definition ffi.c:7365
void zend_ffi_expr_is_equal(zend_ffi_val *val, zend_ffi_val *op2)
Definition ffi.c:7420
void zend_ffi_align_as_type(zend_ffi_dcl *dcl, zend_ffi_dcl *align_dcl)
Definition ffi.c:7114
void zend_ffi_expr_add(zend_ffi_val *val, zend_ffi_val *op2)
Definition ffi.c:7468
#define YY__BANG_EQUAL
Definition ffi_parser.c:110
#define YY___RESTICT
Definition ffi_parser.c:130
#define YY__RBRACK
Definition ffi_parser.c:92
const char * yy_escape_string(char *buf, size_t size, const unsigned char *str, size_t n)
Definition ffi_parser.c:286
#define YY__GREATER
Definition ffi_parser.c:112
#define YY__SLASH
Definition ffi_parser.c:119
#define YY__UPARROW
Definition ffi_parser.c:107
#define yy_pos
Definition ffi_parser.c:30
zend_result zend_ffi_parse_decl(const char *str, size_t len)
#define YY__PLUS
Definition ffi_parser.c:117
#define YY_STATIC
Definition ffi_parser.c:51
#define yy_buf
Definition ffi_parser.c:28
zend_result zend_ffi_parse_type(const char *str, size_t len, zend_ffi_dcl *dcl)
#define YY_COMMENT
Definition ffi_parser.c:141
#define YY_ENUM
Definition ffi_parser.c:88
#define YY_UNION
Definition ffi_parser.c:84
#define YY__NORETURN
Definition ffi_parser.c:57
#define YY__LESS_LESS
Definition ffi_parser.c:115
#define YY_OCTNUMBER
Definition ffi_parser.c:132
#define YY_STRING
Definition ffi_parser.c:136
#define yy_end
Definition ffi_parser.c:29
#define YY__LBRACK
Definition ffi_parser.c:91
#define YY_FLOATNUMBER
Definition ffi_parser.c:135
#define YY__AND
Definition ffi_parser.c:108
#define YY__MINUS
Definition ffi_parser.c:118
#define YY__GREATER_GREATER
Definition ffi_parser.c:116
#define YY___COMPLEX
Definition ffi_parser.c:81
#define YYEND
Definition ffi_parser.c:40
#define YY__ALIGNAS
Definition ffi_parser.c:58
#define YY__EQUAL_EQUAL
Definition ffi_parser.c:109
#define YY__POINT
Definition ffi_parser.c:102
#define YY_CONST
Definition ffi_parser.c:59
#define YY___ALIGNOF__
Definition ffi_parser.c:129
#define YY__BAR_BAR
Definition ffi_parser.c:104
#define YY___INLINE
Definition ffi_parser.c:55
#define YY___THISCALL
Definition ffi_parser.c:100
#define YY_WS
Definition ffi_parser.c:139
#define YY__SEMICOLON
Definition ffi_parser.c:48
#define YY__POINT_POINT_POINT
Definition ffi_parser.c:93
#define YY_HEXNUMBER
Definition ffi_parser.c:134
#define YYPOS
Definition ffi_parser.c:39
#define YY___RESTRICT__
Definition ffi_parser.c:64
#define YY_SIGNED
Definition ffi_parser.c:76
#define YY_AUTO
Definition ffi_parser.c:52
#define YY_VOID
Definition ffi_parser.c:69
#define YY___EXTENSION__
Definition ffi_parser.c:43
#define YY_CHARACTER
Definition ffi_parser.c:137
#define YY_VOLATILE
Definition ffi_parser.c:65
#define YY__RBRACE
Definition ffi_parser.c:86
#define YY_STRUCT
Definition ffi_parser.c:83
#define YY__RPAREN
Definition ffi_parser.c:46
#define YY___VECTORCALL
Definition ffi_parser.c:101
#define YY__LPAREN
Definition ffi_parser.c:45
#define YY__LBRACE
Definition ffi_parser.c:85
#define YY_INLINE
Definition ffi_parser.c:54
#define YY__PERCENT
Definition ffi_parser.c:120
#define YY___STDCALL
Definition ffi_parser.c:98
#define YY_EOL
Definition ffi_parser.c:138
#define YY___ALIGNOF
Definition ffi_parser.c:128
#define YY__MINUS_MINUS
Definition ffi_parser.c:123
#define YY___COMPLEX__
Definition ffi_parser.c:82
#define YY_UNSIGNED
Definition ffi_parser.c:77
#define YY_SIZEOF
Definition ffi_parser.c:126
#define YY__COMPLEX
Definition ffi_parser.c:79
#define YY__STAR
Definition ffi_parser.c:90
#define YY__AND_AND
Definition ffi_parser.c:105
#define YY__ALIGNOF
Definition ffi_parser.c:127
#define YY_SHORT
Definition ffi_parser.c:71
#define YY__PLUS_PLUS
Definition ffi_parser.c:122
#define YY___CDECL
Definition ffi_parser.c:97
#define YY___FASTCALL
Definition ffi_parser.c:99
#define YY_DECNUMBER
Definition ffi_parser.c:133
#define YY__BOOL
Definition ffi_parser.c:78
#define YY_CHAR
Definition ffi_parser.c:70
#define YY_LONG
Definition ffi_parser.c:73
const char * yy_escape_char(char *buf, unsigned char ch)
Definition ffi_parser.c:279
#define YY___ASM__
Definition ffi_parser.c:44
#define YY___VOLATILE__
Definition ffi_parser.c:67
#define yy_line
Definition ffi_parser.c:32
#define YY__QUERY
Definition ffi_parser.c:103
#define YY_EOF
Definition ffi_parser.c:42
#define YY__BANG
Definition ffi_parser.c:125
#define YY__MINUS_GREATER
Definition ffi_parser.c:121
#define YY_EXTERN
Definition ffi_parser.c:50
#define YY___CONST
Definition ffi_parser.c:60
#define YY__BAR
Definition ffi_parser.c:106
#define YY_TYPEDEF
Definition ffi_parser.c:49
#define YY__TILDE
Definition ffi_parser.c:124
#define YY__EQUAL
Definition ffi_parser.c:89
#define YY___RESTRICT
Definition ffi_parser.c:63
#define YY__COMMA
Definition ffi_parser.c:47
#define YY_REGISTER
Definition ffi_parser.c:53
#define YY_FLOAT
Definition ffi_parser.c:74
#define YY__ATOMIC
Definition ffi_parser.c:68
#define YY_INT
Definition ffi_parser.c:72
#define YY__COLON
Definition ffi_parser.c:87
#define YY_RESTRICT
Definition ffi_parser.c:62
#define YY__GREATER_EQUAL
Definition ffi_parser.c:114
#define YY___CONST__
Definition ffi_parser.c:61
size_t yy_escape(char *buf, unsigned char ch)
Definition ffi_parser.c:250
#define YY___ATTRIBUTE__
Definition ffi_parser.c:95
#define YY_ONE_LINE_COMMENT
Definition ffi_parser.c:140
#define YY___DECLSPEC
Definition ffi_parser.c:96
#define YY_COMPLEX
Definition ffi_parser.c:80
#define YY__LESS_EQUAL
Definition ffi_parser.c:113
#define YY___INLINE__
Definition ffi_parser.c:56
#define yy_text
Definition ffi_parser.c:31
#define YY_IN_SET(sym, set, bitset)
Definition ffi_parser.c:247
#define YY_DOUBLE
Definition ffi_parser.c:75
#define YY___VOLATILE
Definition ffi_parser.c:66
#define YY__LESS
Definition ffi_parser.c:111
#define YY___ATTRIBUTE
Definition ffi_parser.c:94
#define YY_ID
Definition ffi_parser.c:131
#define NULL
Definition gdcache.h:45
#define SUCCESS
Definition hash_sha3.c:261
#define ZEND_FFI_ATTR_VARIADIC
Definition php_ffi.h:137
#define ZEND_FFI_ABI_THISCALL
Definition php_ffi.h:127
#define ZEND_FFI_DCL_SHORT
Definition php_ffi.h:77
@ ZEND_FFI_VAL_EMPTY
Definition php_ffi.h:175
#define ZEND_FFI_DCL_STORAGE_CLASS
Definition php_ffi.h:107
#define ZEND_FFI_DCL_SIGNED
Definition php_ffi.h:83
#define ZEND_FFI_DCL_TYPEDEF_NAME
Definition php_ffi.h:91
#define ZEND_FFI_DCL_LONG_LONG
Definition php_ffi.h:80
#define ZEND_FFI_ATTR_INCOMPLETE_ARRAY
Definition php_ffi.h:138
#define ZEND_FFI_DCL_UNSIGNED
Definition php_ffi.h:84
#define ZEND_FFI_DCL_VOLATILE
Definition php_ffi.h:113
#define ZEND_FFI_DCL_NO_RETURN
Definition php_ffi.h:121
#define ZEND_FFI_DCL_REGISTER
Definition php_ffi.h:105
#define ZEND_FFI_ATTR_INIT
Definition php_ffi.h:172
#define ZEND_FFI_DCL_VOID
Definition php_ffi.h:75
#define ZEND_FFI_DCL_BOOL
Definition php_ffi.h:85
#define ZEND_FFI_DCL_DOUBLE
Definition php_ffi.h:82
#define ZEND_FFI_DCL_TYPE_SPECIFIERS
Definition php_ffi.h:93
struct _zend_ffi_val zend_ffi_val
#define ZEND_FFI_DCL_CHAR
Definition php_ffi.h:76
#define ZEND_FFI_DCL_LONG
Definition php_ffi.h:79
#define ZEND_FFI_ABI_VECTORCALL
Definition php_ffi.h:133
#define ZEND_FFI_DCL_ATOMIC
Definition php_ffi.h:114
#define ZEND_FFI_ABI_CDECL
Definition php_ffi.h:125
#define ZEND_FFI_DCL_INT
Definition php_ffi.h:78
unsigned const char * pos
Definition php_ffi.h:52
#define ZEND_FFI_ATTR_CONST
Definition php_ffi.h:135
#define ZEND_FFI_ATTR_VLA
Definition php_ffi.h:139
struct _zend_ffi_dcl zend_ffi_dcl
#define ZEND_FFI_DCL_UNION
Definition php_ffi.h:89
#define ZEND_FFI_DCL_CONST
Definition php_ffi.h:111
#define ZEND_FFI_DCL_RESTRICT
Definition php_ffi.h:112
#define ZEND_FFI_DCL_ENUM
Definition php_ffi.h:90
#define ZEND_FFI_ABI_STDCALL
Definition php_ffi.h:128
#define ZEND_FFI_DCL_INLINE
Definition php_ffi.h:120
#define ZEND_FFI_DCL_FLOAT
Definition php_ffi.h:81
JMP_BUF bailout
Definition php_ffi.h:49
#define ZEND_FFI_DCL_STRUCT
Definition php_ffi.h:88
#define ZEND_FFI_DCL_COMPLEX
Definition php_ffi.h:86
bool attribute_parsing
Definition php_ffi.h:58
#define ZEND_FFI_DCL_TYPEDEF
Definition php_ffi.h:101
bool allow_vla
Definition php_ffi.h:57
#define ZEND_FFI_DCL_STATIC
Definition php_ffi.h:103
#define FFI_G(v)
Definition php_ffi.h:73
#define ZEND_FFI_DCL_AUTO
Definition php_ffi.h:104
#define ZEND_FFI_DCL_EXTERN
Definition php_ffi.h:102
#define ZEND_FFI_ABI_FASTCALL
Definition php_ffi.h:126
#define min(a, b)
char * msg
Definition phpdbg.h:289
uint32_t flags
Definition php_ffi.h:165
zval * args
int last
#define SETJMP(a)
struct _zend_array HashTable
Definition zend_types.h:386
@ FAILURE
Definition zend_types.h:61
ZEND_RESULT_CODE zend_result
Definition zend_types.h:64
zend_string * name
op2
zval * ret