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)
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);
43#define YY___EXTENSION__ 1
48#define YY__SEMICOLON 6
56#define YY___INLINE__ 14
57#define YY__NORETURN 15
61#define YY___CONST__ 19
63#define YY___RESTRICT 21
64#define YY___RESTRICT__ 22
66#define YY___VOLATILE 24
67#define YY___VOLATILE__ 25
81#define YY___COMPLEX 39
82#define YY___COMPLEX__ 40
93#define YY__POINT_POINT_POINT 51
94#define YY___ATTRIBUTE 52
95#define YY___ATTRIBUTE__ 53
96#define YY___DECLSPEC 54
98#define YY___STDCALL 56
99#define YY___FASTCALL 57
100#define YY___THISCALL 58
101#define YY___VECTORCALL 59
104#define YY__BAR_BAR 62
105#define YY__AND_AND 63
107#define YY__UPARROW 65
109#define YY__EQUAL_EQUAL 67
110#define YY__BANG_EQUAL 68
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
120#define YY__PERCENT 78
121#define YY__MINUS_GREATER 79
122#define YY__PLUS_PLUS 80
123#define YY__MINUS_MINUS 81
127#define YY__ALIGNOF 85
128#define YY___ALIGNOF 86
129#define YY___ALIGNOF__ 87
130#define YY___RESTICT 88
132#define YY_OCTNUMBER 90
133#define YY_DECNUMBER 91
134#define YY_HEXNUMBER 92
135#define YY_FLOATNUMBER 93
137#define YY_CHARACTER 95
140#define YY_ONE_LINE_COMMENT 98
143static const char * sym_name[] = {
242 "<ONE_LINE_COMMENT>",
247#define YY_IN_SET(sym, set, bitset) \
248 (bitset[sym>>3] & (1 << (sym & 0x7)))
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;
269 buf[1] =
'0' + ((
ch >> 6) % 8);
270 buf[2] =
'0' + ((
ch >> 3) % 8);
271 buf[3] =
'0' + (
ch % 8);
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);
323static int parse_struct_declaration(
int sym,
zend_ffi_dcl *struct_dcl);
326static int parse_enumerator_list(
int sym,
zend_ffi_dcl *enum_dcl);
328static int parse_declarator(
int sym,
zend_ffi_dcl *
dcl,
const char **
name,
size_t *name_len);
330static int parse_parameter_declarator(
int sym,
zend_ffi_dcl *
dcl,
const char **
name,
size_t *name_len);
333static int parse_parameter_declaration(
int sym,
HashTable **
args);
337static int parse_initializer(
int sym);
338static int parse_designation(
int sym);
339static int parse_expr_list(
int sym);
356static int parse_ID(
int sym,
const char **
name,
size_t *name_len);
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);
370static int get_skip_sym(
void) {
375 const unsigned char *accept_pos;
376 const unsigned char *cpos =
yy_pos;
377 const unsigned char *cend =
yy_end;
391 if (
ch !=
'x')
goto _yy_tunnel_9;
393 if (
ch !=
't')
goto _yy_tunnel_9;
395 if (
ch !=
'e')
goto _yy_tunnel_9;
397 if (
ch !=
'n')
goto _yy_tunnel_9;
399 if (
ch !=
's')
goto _yy_tunnel_9;
401 if (
ch !=
'i')
goto _yy_tunnel_9;
403 if (
ch !=
'o')
goto _yy_tunnel_9;
405 if (
ch !=
'n')
goto _yy_tunnel_9;
407 if (
ch !=
'_')
goto _yy_tunnel_9;
409 if (
ch !=
'_')
goto _yy_tunnel_9;
414 if (
ch !=
'n')
goto _yy_tunnel_9;
416 if (
ch !=
'l')
goto _yy_tunnel_9;
418 if (
ch !=
'i')
goto _yy_tunnel_9;
420 if (
ch !=
'n')
goto _yy_tunnel_9;
422 if (
ch !=
'e')
goto _yy_tunnel_9;
426 if (
ch !=
'_')
goto _yy_tunnel_9;
433 if (
ch !=
'i')
goto _yy_tunnel_9;
435 if (
ch !=
'g')
goto _yy_tunnel_9;
437 if (
ch !=
'n')
goto _yy_tunnel_9;
439 if (
ch !=
'o')
goto _yy_tunnel_9;
441 if (
ch !=
'f')
goto _yy_tunnel_9;
445 if (
ch !=
'_')
goto _yy_tunnel_9;
448 }
else if (
ch ==
's') {
450 if (
ch !=
'm')
goto _yy_tunnel_9;
452 if (
ch !=
'_')
goto _yy_tunnel_9;
454 if (
ch !=
'_')
goto _yy_tunnel_9;
457 }
else if (
ch ==
't') {
459 if (
ch !=
't')
goto _yy_tunnel_9;
461 if (
ch !=
'r')
goto _yy_tunnel_9;
463 if (
ch !=
'i')
goto _yy_tunnel_9;
465 if (
ch !=
'b')
goto _yy_tunnel_9;
467 if (
ch !=
'u')
goto _yy_tunnel_9;
469 if (
ch !=
't')
goto _yy_tunnel_9;
471 if (
ch !=
'e')
goto _yy_tunnel_9;
475 if (
ch !=
'_')
goto _yy_tunnel_9;
485 if (
ch !=
'e')
goto _yy_tunnel_9;
487 if (
ch !=
'c')
goto _yy_tunnel_9;
489 if (
ch !=
'l')
goto _yy_tunnel_9;
492 }
else if (
ch ==
'o') {
496 if (
ch !=
'p')
goto _yy_tunnel_9;
498 if (
ch !=
'l')
goto _yy_tunnel_9;
500 if (
ch !=
'e')
goto _yy_tunnel_9;
502 if (
ch !=
'x')
goto _yy_tunnel_9;
506 if (
ch !=
'_')
goto _yy_tunnel_9;
509 }
else if (
ch ==
'n') {
511 if (
ch !=
's')
goto _yy_tunnel_9;
513 if (
ch !=
't')
goto _yy_tunnel_9;
517 if (
ch !=
'_')
goto _yy_tunnel_9;
528 if (
ch !=
'e')
goto _yy_tunnel_9;
530 if (
ch !=
'c')
goto _yy_tunnel_9;
532 if (
ch !=
'l')
goto _yy_tunnel_9;
534 if (
ch !=
's')
goto _yy_tunnel_9;
536 if (
ch !=
'p')
goto _yy_tunnel_9;
538 if (
ch !=
'e')
goto _yy_tunnel_9;
540 if (
ch !=
'c')
goto _yy_tunnel_9;
545 if (
ch !=
'a')
goto _yy_tunnel_9;
547 if (
ch !=
's')
goto _yy_tunnel_9;
549 if (
ch !=
't')
goto _yy_tunnel_9;
551 if (
ch !=
'c')
goto _yy_tunnel_9;
553 if (
ch !=
'a')
goto _yy_tunnel_9;
555 if (
ch !=
'l')
goto _yy_tunnel_9;
557 if (
ch !=
'l')
goto _yy_tunnel_9;
562 if (
ch !=
'e')
goto _yy_tunnel_9;
564 if (
ch !=
's')
goto _yy_tunnel_9;
566 if (
ch !=
't')
goto _yy_tunnel_9;
570 if (
ch !=
'c')
goto _yy_tunnel_9;
572 if (
ch !=
't')
goto _yy_tunnel_9;
575 }
else if (
ch ==
'r') {
577 if (
ch !=
'i')
goto _yy_tunnel_9;
579 if (
ch !=
'c')
goto _yy_tunnel_9;
581 if (
ch !=
't')
goto _yy_tunnel_9;
585 if (
ch !=
'_')
goto _yy_tunnel_9;
593 if (
ch !=
't')
goto _yy_tunnel_9;
595 if (
ch !=
'd')
goto _yy_tunnel_9;
597 if (
ch !=
'c')
goto _yy_tunnel_9;
599 if (
ch !=
'a')
goto _yy_tunnel_9;
601 if (
ch !=
'l')
goto _yy_tunnel_9;
603 if (
ch !=
'l')
goto _yy_tunnel_9;
608 if (
ch !=
'h')
goto _yy_tunnel_9;
610 if (
ch !=
'i')
goto _yy_tunnel_9;
612 if (
ch !=
's')
goto _yy_tunnel_9;
614 if (
ch !=
'c')
goto _yy_tunnel_9;
616 if (
ch !=
'a')
goto _yy_tunnel_9;
618 if (
ch !=
'l')
goto _yy_tunnel_9;
620 if (
ch !=
'l')
goto _yy_tunnel_9;
627 if (
ch !=
'c')
goto _yy_tunnel_9;
629 if (
ch !=
't')
goto _yy_tunnel_9;
631 if (
ch !=
'o')
goto _yy_tunnel_9;
633 if (
ch !=
'r')
goto _yy_tunnel_9;
635 if (
ch !=
'c')
goto _yy_tunnel_9;
637 if (
ch !=
'a')
goto _yy_tunnel_9;
639 if (
ch !=
'l')
goto _yy_tunnel_9;
641 if (
ch !=
'l')
goto _yy_tunnel_9;
644 }
else if (
ch ==
'o') {
646 if (
ch !=
'l')
goto _yy_tunnel_9;
648 if (
ch !=
'a')
goto _yy_tunnel_9;
650 if (
ch !=
't')
goto _yy_tunnel_9;
652 if (
ch !=
'i')
goto _yy_tunnel_9;
654 if (
ch !=
'l')
goto _yy_tunnel_9;
656 if (
ch !=
'e')
goto _yy_tunnel_9;
660 if (
ch !=
'_')
goto _yy_tunnel_9;
671 if (
ch !=
'o')
goto _yy_tunnel_9;
673 if (
ch !=
'r')
goto _yy_tunnel_9;
675 if (
ch !=
'e')
goto _yy_tunnel_9;
677 if (
ch !=
't')
goto _yy_tunnel_9;
679 if (
ch !=
'u')
goto _yy_tunnel_9;
681 if (
ch !=
'r')
goto _yy_tunnel_9;
683 if (
ch !=
'n')
goto _yy_tunnel_9;
690 if (
ch !=
'i')
goto _yy_tunnel_9;
692 if (
ch !=
'g')
goto _yy_tunnel_9;
694 if (
ch !=
'n')
goto _yy_tunnel_9;
698 if (
ch !=
's')
goto _yy_tunnel_9;
701 }
else if (
ch ==
'o') {
703 if (
ch !=
'f')
goto _yy_tunnel_9;
709 }
else if (
ch ==
't') {
711 if (
ch !=
'o')
goto _yy_tunnel_9;
713 if (
ch !=
'm')
goto _yy_tunnel_9;
715 if (
ch !=
'i')
goto _yy_tunnel_9;
717 if (
ch !=
'c')
goto _yy_tunnel_9;
725 if (
ch !=
'o')
goto _yy_tunnel_9;
727 if (
ch !=
'o')
goto _yy_tunnel_9;
729 if (
ch !=
'l')
goto _yy_tunnel_9;
734 if (
ch !=
'o')
goto _yy_tunnel_9;
736 if (
ch !=
'm')
goto _yy_tunnel_9;
738 if (
ch !=
'p')
goto _yy_tunnel_9;
740 if (
ch !=
'l')
goto _yy_tunnel_9;
742 if (
ch !=
'e')
goto _yy_tunnel_9;
744 if (
ch !=
'x')
goto _yy_tunnel_9;
752 if (
ch !=
'y')
goto _yy_tunnel_9;
754 if (
ch !=
'p')
goto _yy_tunnel_9;
756 if (
ch !=
'e')
goto _yy_tunnel_9;
758 if (
ch !=
'd')
goto _yy_tunnel_9;
760 if (
ch !=
'e')
goto _yy_tunnel_9;
762 if (
ch !=
'f')
goto _yy_tunnel_9;
769 if (
ch !=
't')
goto _yy_tunnel_9;
771 if (
ch !=
'e')
goto _yy_tunnel_9;
773 if (
ch !=
'r')
goto _yy_tunnel_9;
775 if (
ch !=
'n')
goto _yy_tunnel_9;
778 }
else if (
ch ==
'n') {
780 if (
ch !=
'u')
goto _yy_tunnel_9;
782 if (
ch !=
'm')
goto _yy_tunnel_9;
794 if (
ch !=
't')
goto _yy_tunnel_9;
796 if (
ch !=
'i')
goto _yy_tunnel_9;
798 if (
ch !=
'c')
goto _yy_tunnel_9;
801 }
else if (
ch ==
'r') {
803 if (
ch !=
'u')
goto _yy_tunnel_9;
805 if (
ch !=
'c')
goto _yy_tunnel_9;
807 if (
ch !=
't')
goto _yy_tunnel_9;
813 }
else if (
ch ==
'h') {
815 if (
ch !=
'o')
goto _yy_tunnel_9;
817 if (
ch !=
'r')
goto _yy_tunnel_9;
819 if (
ch !=
't')
goto _yy_tunnel_9;
822 }
else if (
ch ==
'i') {
826 if (
ch !=
'n')
goto _yy_tunnel_9;
828 if (
ch !=
'e')
goto _yy_tunnel_9;
830 if (
ch !=
'd')
goto _yy_tunnel_9;
833 }
else if (
ch ==
'z') {
835 if (
ch !=
'e')
goto _yy_tunnel_9;
837 if (
ch !=
'o')
goto _yy_tunnel_9;
839 if (
ch !=
'f')
goto _yy_tunnel_9;
850 if (
ch !=
'u')
goto _yy_tunnel_9;
852 if (
ch !=
't')
goto _yy_tunnel_9;
854 if (
ch !=
'o')
goto _yy_tunnel_9;
859 if (
ch !=
'e')
goto _yy_tunnel_9;
863 if (
ch !=
'i')
goto _yy_tunnel_9;
865 if (
ch !=
's')
goto _yy_tunnel_9;
867 if (
ch !=
't')
goto _yy_tunnel_9;
869 if (
ch !=
'e')
goto _yy_tunnel_9;
871 if (
ch !=
'r')
goto _yy_tunnel_9;
874 }
else if (
ch ==
's') {
876 if (
ch !=
't')
goto _yy_tunnel_9;
878 if (
ch !=
'r')
goto _yy_tunnel_9;
880 if (
ch !=
'i')
goto _yy_tunnel_9;
882 if (
ch !=
'c')
goto _yy_tunnel_9;
884 if (
ch !=
't')
goto _yy_tunnel_9;
892 if (
ch !=
'n')
goto _yy_tunnel_9;
896 if (
ch !=
'i')
goto _yy_tunnel_9;
898 if (
ch !=
'n')
goto _yy_tunnel_9;
900 if (
ch !=
'e')
goto _yy_tunnel_9;
903 }
else if (
ch ==
't') {
957 }
else if (
ch ==
'\'') {
966 if (
ch !=
'a')
goto _yy_tunnel_9;
968 if (
ch !=
'r')
goto _yy_tunnel_9;
971 }
else if (
ch ==
'o') {
975 if (
ch !=
'p')
goto _yy_tunnel_9;
977 if (
ch !=
'l')
goto _yy_tunnel_9;
979 if (
ch !=
'e')
goto _yy_tunnel_9;
981 if (
ch !=
'x')
goto _yy_tunnel_9;
984 }
else if (
ch ==
'n') {
986 if (
ch !=
's')
goto _yy_tunnel_9;
988 if (
ch !=
't')
goto _yy_tunnel_9;
999 if (
ch !=
'o')
goto _yy_tunnel_9;
1001 if (
ch !=
'u')
goto _yy_tunnel_9;
1003 if (
ch !=
'b')
goto _yy_tunnel_9;
1005 if (
ch !=
'l')
goto _yy_tunnel_9;
1007 if (
ch !=
'e')
goto _yy_tunnel_9;
1012 if (
ch !=
'l')
goto _yy_tunnel_9;
1014 if (
ch !=
'o')
goto _yy_tunnel_9;
1016 if (
ch !=
'a')
goto _yy_tunnel_9;
1018 if (
ch !=
't')
goto _yy_tunnel_9;
1023 if (
ch !=
'o')
goto _yy_tunnel_9;
1025 if (
ch !=
'n')
goto _yy_tunnel_9;
1027 if (
ch !=
'g')
goto _yy_tunnel_9;
1036 if (
ch !=
'o')
goto _yy_tunnel_9;
1038 if (
ch !=
'n')
goto _yy_tunnel_9;
1041 }
else if (
ch ==
's') {
1043 if (
ch !=
'i')
goto _yy_tunnel_9;
1045 if (
ch !=
'g')
goto _yy_tunnel_9;
1047 if (
ch !=
'n')
goto _yy_tunnel_9;
1049 if (
ch !=
'e')
goto _yy_tunnel_9;
1051 if (
ch !=
'd')
goto _yy_tunnel_9;
1057 }
else if (
ch ==
'8') {
1059 if (
ch !=
'"')
goto _yy_tunnel_9;
1061 }
else if (
ch ==
'"') {
1063 }
else if (
ch ==
'\'') {
1070 if (
ch !=
'o')
goto _yy_tunnel_9;
1074 if (
ch !=
'd')
goto _yy_tunnel_9;
1077 }
else if (
ch ==
'l') {
1079 if (
ch !=
'a')
goto _yy_tunnel_9;
1081 if (
ch !=
't')
goto _yy_tunnel_9;
1083 if (
ch !=
'i')
goto _yy_tunnel_9;
1085 if (
ch !=
'l')
goto _yy_tunnel_9;
1087 if (
ch !=
'e')
goto _yy_tunnel_9;
1113 if ((
ch >=
'0' &&
ch <=
'9')) {
1115 }
else if (
ch ==
'.') {
1122 goto _yy_state_error;
1134 }
else if (
ch ==
'-') {
1154 if (
ch !=
'X' &&
ch !=
'x')
goto _yy_tunnel_78;
1156 if ((
ch >=
'0' &&
ch <=
'9') || (
ch >=
'A' &&
ch <=
'F') || (
ch >=
'a' &&
ch <=
'f')) {
1159 goto _yy_state_error;
1209 }
else if (
ch ==
'/') {
1225 }
else if (
ch ==
'=') {
1239 }
else if (
ch ==
'=') {
1320 goto _yy_state_error;
1325 if ((
ch >=
'0' &&
ch <=
'9') || (
ch >=
'A' &&
ch <=
'Z') ||
ch ==
'_' || (
ch >=
'a' &&
ch <=
'z')) {
1349 }
else if (
ch ==
'l') {
1363 }
else if (
ch ==
'U' ||
ch ==
'u') {
1375 if (
ch ==
'U' ||
ch ==
'u') {
1379 }
else if (
ch ==
'l') {
1415 goto _yy_state_error;
1417 }
else if (
ch ==
'"') {
1427 goto _yy_state_error;
1439 goto _yy_state_error;
1441 }
else if (
ch ==
'\'') {
1451 goto _yy_state_error;
1455 if (
ch ==
'\t' ||
ch ==
'\v' ||
ch ==
'\f' ||
ch ==
' ') {
1474 }
else if (
ch ==
'\n') {
1479 }
else if (
YYPOS <
YYEND && (
ch <=
'\t' ||
ch ==
'\v' ||
ch ==
'\f' ||
ch >=
'\016')) {
1482 goto _yy_state_error;
1488 if ((
ch >=
'0' &&
ch <=
'9')) {
1490 }
else if (
ch ==
'F' ||
ch ==
'L' ||
ch ==
'f' ||
ch ==
'l') {
1494 }
else if (
ch ==
'E' ||
ch ==
'e') {
1528 }
else if (
ch ==
'l') {
1542 }
else if (
ch ==
'U' ||
ch ==
'u') {
1556 }
else if (
ch ==
'U' ||
ch ==
'u') {
1578 if ((
ch >=
'0' &&
ch <=
'9')) {
1580 }
else if (
ch ==
'E' ||
ch ==
'e') {
1582 }
else if (
ch ==
'.') {
1585 goto _yy_state_error;
1589 if (
ch ==
'+' ||
ch ==
'-') {
1591 if ((
ch >=
'0' &&
ch <=
'9')) {
1594 goto _yy_state_error;
1596 }
else if ((
ch >=
'0' &&
ch <=
'9')) {
1599 goto _yy_state_error;
1606 if (
ch !=
'/')
goto _yy_tunnel_99;
1616 goto _yy_state_error;
1620 if (
ch ==
'U' ||
ch ==
'u') {
1625 goto _yy_state_error;
1629 if (
ch ==
'U' ||
ch ==
'u') {
1641 }
else if (
ch ==
'l') {
1649 }
else if (
ch ==
'L') {
1655 }
else if (
ch ==
'U' ||
ch ==
'u') {
1663 }
else if (
ch ==
'l') {
1667 if (
ch ==
'U' ||
ch ==
'u') {
1671 }
else if (
ch ==
'l') {
1677 }
else if ((
ch >=
'0' &&
ch <=
'9') || (
ch >=
'A' &&
ch <=
'F') || (
ch >=
'a' &&
ch <=
'f')) {
1685 if ((
ch >=
'0' &&
ch <=
'9')) {
1687 }
else if (
ch ==
'F' ||
ch ==
'L' ||
ch ==
'f' ||
ch ==
'l') {
1697 if (
ch ==
'U' ||
ch ==
'u') {
1702 goto _yy_state_error;
1706 if (
ch ==
'U' ||
ch ==
'u') {
1711 goto _yy_state_error;
1716 if ((
ch >=
'0' &&
ch <=
'9') || (
ch >=
'A' &&
ch <=
'Z') ||
ch ==
'_' || (
ch >=
'a' &&
ch <=
'z')) {
1727 yy_error(
"unexpected <EOF>");
1734 goto _yy_state_start;
1740static int skip_EOL(
int sym) {
1742 yy_error_sym(
"<EOL> expected, got", sym);
1744 sym = get_skip_sym();
1748static int skip_WS(
int sym) {
1750 yy_error_sym(
"<WS> expected, got", sym);
1752 sym = get_skip_sym();
1756static int skip_ONE_LINE_COMMENT(
int sym) {
1758 yy_error_sym(
"<ONE_LINE_COMMENT> expected, got", sym);
1760 sym = get_skip_sym();
1764static int skip_COMMENT(
int sym) {
1766 yy_error_sym(
"<COMMENT> expected, got", sym);
1768 sym = get_skip_sym();
1772static int get_sym(
void) {
1774 sym = get_skip_sym();
1777 sym = skip_EOL(sym);
1778 }
else if (sym ==
YY_WS) {
1781 sym = skip_ONE_LINE_COMMENT(sym);
1783 sym = skip_COMMENT(sym);
1789static int check_nested_declarator_start(
int sym) {
1795 sym = check_ID(sym);
1826static int check_type_name_start(
int sym) {
1828 sym = check_ID(sym);
1931static int check_ID(
int sym) {
1939static int synpred_1(
int sym) {
1941 const unsigned char *save_pos;
1942 const unsigned char *save_text;
1948 ret = check_type_name_start(sym) != -1;
1955static int synpred_2(
int sym) {
1957 const unsigned char *save_pos;
1958 const unsigned char *save_text;
1964 ret = check_nested_declarator_start(sym) != -1;
1971static int synpred_3(
int sym) {
1973 const unsigned char *save_pos;
1974 const unsigned char *save_text;
1980 ret = check_nested_declarator_start(sym) != -1;
1987static int _synpred_4(
int sym) {
1992 sym = check_type_name_start(sym);
1999static int synpred_4(
int sym) {
2001 const unsigned char *save_pos;
2002 const unsigned char *save_text;
2008 ret = _synpred_4(sym) != -1;
2015static int _synpred_5(
int sym) {
2020 sym = check_type_name_start(sym);
2027static int synpred_5(
int sym) {
2029 const unsigned char *save_pos;
2030 const unsigned char *save_text;
2036 ret = _synpred_5(sym) != -1;
2043static int _synpred_6(
int sym) {
2048 sym = check_type_name_start(sym);
2055static int synpred_6(
int sym) {
2057 const unsigned char *save_pos;
2058 const unsigned char *save_text;
2064 ret = _synpred_6(sym) != -1;
2071static int parse_declarations(
int sym) {
2072 while (
YY_IN_SET(sym, (
YY___EXTENSION__,
YY_TYPEDEF,
YY_EXTERN,
YY_STATIC,
YY_AUTO,
YY_REGISTER,
YY_INLINE,
YY___INLINE,
YY___INLINE__,
YY__NORETURN,
YY__ALIGNAS,
YY___ATTRIBUTE,
YY___ATTRIBUTE__,
YY___DECLSPEC,
YY___CDECL,
YY___STDCALL,
YY___FASTCALL,
YY___THISCALL,
YY___VECTORCALL,
YY_CONST,
YY___CONST,
YY___CONST__,
YY_RESTRICT,
YY___RESTRICT,
YY___RESTRICT__,
YY_VOLATILE,
YY___VOLATILE,
YY___VOLATILE__,
YY__ATOMIC,
YY_VOID,
YY_CHAR,
YY_SHORT,
YY_INT,
YY_LONG,
YY_FLOAT,
YY_DOUBLE,
YY_SIGNED,
YY_UNSIGNED,
YY__BOOL,
YY__COMPLEX,
YY_COMPLEX,
YY___COMPLEX,
YY___COMPLEX__,
YY_STRUCT,
YY_UNION,
YY_ENUM,
YY_ID),
"\202\377\377\377\377\107\360\017\000\000\000\002\000")) {
2077 sym = parse_declaration_specifiers(sym, &common_dcl);
2083 sym = parse_declarator(sym, &
dcl, &
name, &name_len);
2088 yy_error_sym(
"'(' expected, got", sym);
2092 sym = parse_STRING(sym, &asm_str);
2095 yy_error_sym(
"')' expected, got", sym);
2100 sym = parse_attributes(sym, &
dcl);
2103 sym = parse_initializer(sym);
2109 sym = parse_declarator(sym, &
dcl, &
name, &name_len);
2111 sym = parse_attributes(sym, &
dcl);
2114 sym = parse_initializer(sym);
2121 yy_error_sym(
"unexpected", sym);
2124 yy_error_sym(
"';' expected, got", sym);
2172 yy_error_sym(
"'(' expected, got", sym);
2175 if ((
YY_IN_SET(sym, (
YY___EXTENSION__,
YY_VOID,
YY_CHAR,
YY_SHORT,
YY_INT,
YY_LONG,
YY_FLOAT,
YY_DOUBLE,
YY_SIGNED,
YY_UNSIGNED,
YY__BOOL,
YY__COMPLEX,
YY_COMPLEX,
YY___COMPLEX,
YY___COMPLEX__,
YY_STRUCT,
YY_UNION,
YY_ENUM,
YY_ID,
YY_CONST,
YY___CONST,
YY___CONST__,
YY_RESTRICT,
YY___RESTRICT,
YY___RESTRICT__,
YY_VOLATILE,
YY___VOLATILE,
YY___VOLATILE__,
YY__ATOMIC,
YY___ATTRIBUTE,
YY___ATTRIBUTE__,
YY___DECLSPEC,
YY___CDECL,
YY___STDCALL,
YY___FASTCALL,
YY___THISCALL,
YY___VECTORCALL),
"\002\000\376\377\377\107\360\017\000\000\000\002\000")) && synpred_1(sym)) {
2177 sym = parse_type_name(sym, &align_dcl);
2179 }
else if (
YY_IN_SET(sym, (
YY__LPAREN,
YY_ID,
YY_OCTNUMBER,
YY_DECNUMBER,
YY_HEXNUMBER,
YY_FLOATNUMBER,
YY_STRING,
YY_CHARACTER,
YY__PLUS_PLUS,
YY__MINUS_MINUS,
YY__AND,
YY__STAR,
YY__PLUS,
YY__MINUS,
YY__TILDE,
YY__BANG,
YY_SIZEOF,
YY__ALIGNOF,
YY___ALIGNOF,
YY___ALIGNOF__),
"\010\000\000\000\000\000\001\000\004\030\377\376\000")) {
2181 sym = parse_constant_expression(sym, &align_val);
2184 yy_error_sym(
"unexpected", sym);
2187 yy_error_sym(
"')' expected, got", sym);
2199 sym = parse_attributes(sym,
dcl);
2211 sym = parse_type_qualifier(sym,
dcl);
2231 sym = parse_type_specifier(sym,
dcl);
2234 yy_error_sym(
"unexpected", sym);
2236 }
while ((
YY_IN_SET(sym, (
YY_TYPEDEF,
YY_EXTERN,
YY_STATIC,
YY_AUTO,
YY_REGISTER,
YY_INLINE,
YY___INLINE,
YY___INLINE__,
YY__NORETURN,
YY__ALIGNAS,
YY___ATTRIBUTE,
YY___ATTRIBUTE__,
YY___DECLSPEC,
YY___CDECL,
YY___STDCALL,
YY___FASTCALL,
YY___THISCALL,
YY___VECTORCALL,
YY_CONST,
YY___CONST,
YY___CONST__,
YY_RESTRICT,
YY___RESTRICT,
YY___RESTRICT__,
YY_VOLATILE,
YY___VOLATILE,
YY___VOLATILE__,
YY__ATOMIC,
YY_VOID,
YY_CHAR,
YY_SHORT,
YY_INT,
YY_LONG,
YY_FLOAT,
YY_DOUBLE,
YY_SIGNED,
YY_UNSIGNED,
YY__BOOL,
YY__COMPLEX,
YY_COMPLEX,
YY___COMPLEX,
YY___COMPLEX__,
YY_STRUCT,
YY_UNION,
YY_ENUM,
YY_ID),
"\200\377\377\377\377\107\360\017\000\000\000\002\000")) && (sym !=
YY_ID || !(
dcl->flags &
ZEND_FFI_DCL_TYPE_SPECIFIERS)));
2240static int parse_specifier_qualifier_list(
int sym,
zend_ffi_dcl *
dcl) {
2245 if (
YY_IN_SET(sym, (
YY_VOID,
YY_CHAR,
YY_SHORT,
YY_INT,
YY_LONG,
YY_FLOAT,
YY_DOUBLE,
YY_SIGNED,
YY_UNSIGNED,
YY__BOOL,
YY__COMPLEX,
YY_COMPLEX,
YY___COMPLEX,
YY___COMPLEX__,
YY_STRUCT,
YY_UNION,
YY_ENUM,
YY_ID),
"\000\000\000\370\377\107\000\000\000\000\000\002\000")) {
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);
2250 sym = parse_attributes(sym,
dcl);
2252 yy_error_sym(
"unexpected", sym);
2254 }
while ((
YY_IN_SET(sym, (
YY_VOID,
YY_CHAR,
YY_SHORT,
YY_INT,
YY_LONG,
YY_FLOAT,
YY_DOUBLE,
YY_SIGNED,
YY_UNSIGNED,
YY__BOOL,
YY__COMPLEX,
YY_COMPLEX,
YY___COMPLEX,
YY___COMPLEX__,
YY_STRUCT,
YY_UNION,
YY_ENUM,
YY_ID,
YY_CONST,
YY___CONST,
YY___CONST__,
YY_RESTRICT,
YY___RESTRICT,
YY___RESTRICT__,
YY_VOLATILE,
YY___VOLATILE,
YY___VOLATILE__,
YY__ATOMIC,
YY___ATTRIBUTE,
YY___ATTRIBUTE__,
YY___DECLSPEC,
YY___CDECL,
YY___STDCALL,
YY___FASTCALL,
YY___THISCALL,
YY___VECTORCALL),
"\000\000\376\377\377\107\360\017\000\000\000\002\000")) && (sym !=
YY_ID ||
zend_ffi_is_typedef_name((
const char*)
yy_text,
yy_pos -
yy_text) || (
dcl->flags &
ZEND_FFI_DCL_TYPE_SPECIFIERS) == 0));
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);
2263 sym = parse_attributes(sym,
dcl);
2265 yy_error_sym(
"unexpected", sym);
2267 }
while (
YY_IN_SET(sym, (
YY_CONST,
YY___CONST,
YY___CONST__,
YY_RESTRICT,
YY___RESTRICT,
YY___RESTRICT__,
YY_VOLATILE,
YY___VOLATILE,
YY___VOLATILE__,
YY__ATOMIC,
YY___ATTRIBUTE,
YY___ATTRIBUTE__,
YY___DECLSPEC,
YY___CDECL,
YY___STDCALL,
YY___FASTCALL,
YY___THISCALL,
YY___VECTORCALL),
"\000\000\376\007\000\000\360\017\000\000\000\000\000"));
2286 yy_error_sym(
"unexpected", sym);
2361 sym = parse_struct_or_union_specifier(sym,
dcl);
2365 sym = parse_enum_specifier(sym,
dcl);
2370 sym = parse_ID(sym, &
name, &name_len);
2375 yy_error_sym(
"unexpected", sym);
2380static int parse_struct_or_union_specifier(
int sym,
zend_ffi_dcl *
dcl) {
2388 yy_error_sym(
"unexpected", sym);
2391 sym = parse_attributes(sym,
dcl);
2396 sym = parse_ID(sym, &
name, &name_len);
2399 sym = parse_struct_contents(sym,
dcl);
2404 sym = parse_struct_contents(sym,
dcl);
2406 yy_error_sym(
"unexpected", sym);
2413 const unsigned char *save_pos;
2414 const unsigned char *save_text;
2418 yy_error_sym(
"'{' expected, got", sym);
2421 if (
YY_IN_SET(sym, (
YY___EXTENSION__,
YY_VOID,
YY_CHAR,
YY_SHORT,
YY_INT,
YY_LONG,
YY_FLOAT,
YY_DOUBLE,
YY_SIGNED,
YY_UNSIGNED,
YY__BOOL,
YY__COMPLEX,
YY_COMPLEX,
YY___COMPLEX,
YY___COMPLEX__,
YY_STRUCT,
YY_UNION,
YY_ENUM,
YY_ID,
YY_CONST,
YY___CONST,
YY___CONST__,
YY_RESTRICT,
YY___RESTRICT,
YY___RESTRICT__,
YY_VOLATILE,
YY___VOLATILE,
YY___VOLATILE__,
YY__ATOMIC,
YY___ATTRIBUTE,
YY___ATTRIBUTE__,
YY___DECLSPEC,
YY___CDECL,
YY___STDCALL,
YY___FASTCALL,
YY___THISCALL,
YY___VECTORCALL),
"\002\000\376\377\377\107\360\017\000\000\000\002\000")) {
2422 sym = parse_struct_declaration(sym,
dcl);
2436 yy_error_sym(
"unexpected", sym2);
2439 if (
YY_IN_SET(sym2, (
YY___EXTENSION__,
YY_VOID,
YY_CHAR,
YY_SHORT,
YY_INT,
YY_LONG,
YY_FLOAT,
YY_DOUBLE,
YY_SIGNED,
YY_UNSIGNED,
YY__BOOL,
YY__COMPLEX,
YY_COMPLEX,
YY___COMPLEX,
YY___COMPLEX__,
YY_STRUCT,
YY_UNION,
YY_ENUM,
YY_ID,
YY_CONST,
YY___CONST,
YY___CONST__,
YY_RESTRICT,
YY___RESTRICT,
YY___RESTRICT__,
YY_VOLATILE,
YY___VOLATILE,
YY___VOLATILE__,
YY__ATOMIC,
YY___ATTRIBUTE,
YY___ATTRIBUTE__,
YY___DECLSPEC,
YY___CDECL,
YY___STDCALL,
YY___FASTCALL,
YY___THISCALL,
YY___VECTORCALL),
"\002\000\376\377\377\107\360\017\000\000\000\002\000")) {
2446 yy_error_sym(
"unexpected", sym2);
2456 sym = parse_struct_declaration(sym,
dcl);
2463 yy_error_sym(
"'}' expected, got", sym);
2467 sym = parse_attributes(sym,
dcl);
2473static int parse_struct_declaration(
int sym,
zend_ffi_dcl *struct_dcl) {
2476 sym = parse_specifier_qualifier_list(sym, &common_field_dcl);
2477 base_field_dcl = common_field_dcl;
2481 sym = parse_struct_declarator(sym, struct_dcl, &common_field_dcl);
2486 sym = parse_attributes(sym, &field_dcl);
2488 sym = parse_struct_declarator(sym, struct_dcl, &field_dcl);
2491 yy_error_sym(
"unexpected", sym);
2498 size_t name_len = 0;
2501 sym = parse_declarator(sym, field_dcl, &
name, &name_len);
2504 sym = parse_constant_expression(sym, &bits);
2506 sym = parse_attributes(sym, field_dcl);
2509 }
else if (
YY_IN_SET(sym, (
YY___ATTRIBUTE,
YY___ATTRIBUTE__,
YY___DECLSPEC,
YY___CDECL,
YY___STDCALL,
YY___FASTCALL,
YY___THISCALL,
YY___VECTORCALL,
YY__COMMA,
YY__SEMICOLON,
YY__RBRACE),
"\140\000\000\000\000\020\360\017\000\000\000\000\000")) {
2511 sym = parse_attributes(sym, field_dcl);
2515 yy_error_sym(
"unexpected", sym);
2519 sym = parse_constant_expression(sym, &bits);
2522 yy_error_sym(
"unexpected", sym);
2529 yy_error_sym(
"'enum' expected, got", sym);
2534 sym = parse_attributes(sym,
dcl);
2539 sym = parse_ID(sym, &
name, &name_len);
2543 sym = parse_enumerator_list(sym,
dcl);
2545 yy_error_sym(
"'}' expected, got", sym);
2549 sym = parse_attributes(sym,
dcl);
2551 }
else if (
YY_IN_SET(sym, (
YY_TYPEDEF,
YY_EXTERN,
YY_STATIC,
YY_AUTO,
YY_REGISTER,
YY_INLINE,
YY___INLINE,
YY___INLINE__,
YY__NORETURN,
YY__ALIGNAS,
YY___ATTRIBUTE,
YY___ATTRIBUTE__,
YY___DECLSPEC,
YY___CDECL,
YY___STDCALL,
YY___FASTCALL,
YY___THISCALL,
YY___VECTORCALL,
YY_CONST,
YY___CONST,
YY___CONST__,
YY_RESTRICT,
YY___RESTRICT,
YY___RESTRICT__,
YY_VOLATILE,
YY___VOLATILE,
YY___VOLATILE__,
YY__ATOMIC,
YY_VOID,
YY_CHAR,
YY_SHORT,
YY_INT,
YY_LONG,
YY_FLOAT,
YY_DOUBLE,
YY_SIGNED,
YY_UNSIGNED,
YY__BOOL,
YY__COMPLEX,
YY_COMPLEX,
YY___COMPLEX,
YY___COMPLEX__,
YY_STRUCT,
YY_UNION,
YY_ENUM,
YY_ID,
YY__STAR,
YY__LPAREN,
YY__SEMICOLON,
YY__COLON,
YY__LBRACK,
YY__RBRACE,
YY__COMMA,
YY__RPAREN,
YY_EOF),
"\371\377\377\377\377\167\363\017\000\000\000\002\000")) {
2554 yy_error_sym(
"unexpected", sym);
2559 sym = parse_enumerator_list(sym,
dcl);
2561 yy_error_sym(
"'}' expected, got", sym);
2565 sym = parse_attributes(sym,
dcl);
2568 yy_error_sym(
"unexpected", sym);
2573static int parse_enumerator_list(
int sym,
zend_ffi_dcl *enum_dcl) {
2575 const unsigned char *save_pos;
2576 const unsigned char *save_text;
2580 sym = parse_enumerator(sym, enum_dcl, &
min, &
max, &
last);
2589 goto _yy_state_250_1;
2594 yy_error_sym(
"unexpected", sym2);
2597 if (sym2 ==
YY_ID) {
2604 yy_error_sym(
"unexpected", sym2);
2610 if (alt250 != 251) {
2614 sym = parse_enumerator(sym, enum_dcl, &
min, &
max, &
last);
2616 if (alt250 == 253) {
2626 sym = parse_ID(sym, &
name, &name_len);
2629 sym = parse_constant_expression(sym, &
val);
2635static int parse_declarator(
int sym,
zend_ffi_dcl *
dcl,
const char **
name,
size_t *name_len) {
2639 sym = parse_pointer(sym,
dcl);
2642 sym = parse_ID(sym,
name, name_len);
2646 sym = parse_attributes(sym, &nested_dcl);
2648 sym = parse_declarator(sym, &nested_dcl,
name, name_len);
2650 yy_error_sym(
"')' expected, got", sym);
2655 yy_error_sym(
"unexpected", sym);
2658 sym = parse_array_or_function_declarators(sym,
dcl, &nested_dcl);
2668 sym = parse_pointer(sym,
dcl);
2673 sym = parse_attributes(sym, &nested_dcl);
2675 sym = parse_abstract_declarator(sym, &nested_dcl);
2677 yy_error_sym(
"')' expected, got", sym);
2683 sym = parse_array_or_function_declarators(sym,
dcl, &nested_dcl);
2689static int parse_parameter_declarator(
int sym,
zend_ffi_dcl *
dcl,
const char **
name,
size_t *name_len) {
2693 sym = parse_pointer(sym,
dcl);
2698 sym = parse_attributes(sym, &nested_dcl);
2700 sym = parse_parameter_declarator(sym, &nested_dcl,
name, name_len);
2702 yy_error_sym(
"')' expected, got", sym);
2706 }
else if (sym ==
YY_ID) {
2707 sym = parse_ID(sym,
name, name_len);
2710 yy_error_sym(
"unexpected", sym);
2713 sym = parse_array_or_function_declarators(sym,
dcl, &nested_dcl);
2721 yy_error_sym(
"'*' expected, got", sym);
2726 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,
YY___ATTRIBUTE,
YY___ATTRIBUTE__,
YY___DECLSPEC,
YY___CDECL,
YY___STDCALL,
YY___FASTCALL,
YY___THISCALL,
YY___VECTORCALL),
"\000\000\376\007\000\000\360\017\000\000\000\000\000")) {
2727 sym = parse_type_qualifier_list(sym,
dcl);
2735 const unsigned char *save_pos;
2736 const unsigned char *save_text;
2755 }
else if (
YY_IN_SET(sym2, (
YY_CONST,
YY___CONST,
YY___CONST__,
YY_RESTRICT,
YY___RESTRICT,
YY___RESTRICT__,
YY_VOLATILE,
YY___VOLATILE,
YY___VOLATILE__,
YY__ATOMIC,
YY___ATTRIBUTE,
YY___ATTRIBUTE__,
YY___DECLSPEC,
YY___CDECL,
YY___STDCALL,
YY___FASTCALL,
YY___THISCALL,
YY___VECTORCALL),
"\000\000\376\007\000\000\360\017\000\000\000\000\000")) {
2760 goto _yy_state_105_20;
2761 }
else if (
YY_IN_SET(sym2, (
YY__LPAREN,
YY__PLUS_PLUS,
YY__MINUS_MINUS,
YY__AND,
YY__PLUS,
YY__MINUS,
YY__TILDE,
YY__BANG,
YY_SIZEOF,
YY__ALIGNOF,
YY___ALIGNOF,
YY___ALIGNOF__,
YY_ID,
YY_OCTNUMBER,
YY_DECNUMBER,
YY_HEXNUMBER,
YY_FLOATNUMBER,
YY_STRING,
YY_CHARACTER),
"\010\000\000\000\000\000\000\000\004\030\377\376\000")) {
2768 yy_error_sym(
"unexpected", sym2);
2774 }
else if (
YY_IN_SET(sym2, (
YY__LPAREN,
YY__PLUS_PLUS,
YY__MINUS_MINUS,
YY__AND,
YY__PLUS,
YY__MINUS,
YY__TILDE,
YY__BANG,
YY_SIZEOF,
YY__ALIGNOF,
YY___ALIGNOF,
YY___ALIGNOF__,
YY_ID,
YY_OCTNUMBER,
YY_DECNUMBER,
YY_HEXNUMBER,
YY_FLOATNUMBER,
YY_STRING,
YY_CHARACTER,
YY__STAR),
"\010\000\000\000\000\000\001\000\004\030\377\376\000")) {
2778 yy_error_sym(
"unexpected", sym2);
2784 if (alt105 == 106) {
2786 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,
YY___ATTRIBUTE,
YY___ATTRIBUTE__,
YY___DECLSPEC,
YY___CDECL,
YY___STDCALL,
YY___FASTCALL,
YY___THISCALL,
YY___VECTORCALL),
"\000\000\376\007\000\000\360\017\000\000\000\000\000")) {
2787 sym = parse_type_qualifier_list(sym, &dummy);
2789 sym = parse_assignment_expression(sym, &
len);
2790 }
else if (alt105 == 109) {
2791 sym = parse_type_qualifier_list(sym, &dummy);
2802 goto _yy_state_109_2;
2803 }
else if (
YY_IN_SET(sym2, (
YY__LPAREN,
YY__PLUS_PLUS,
YY__MINUS_MINUS,
YY__AND,
YY__PLUS,
YY__MINUS,
YY__TILDE,
YY__BANG,
YY_SIZEOF,
YY__ALIGNOF,
YY___ALIGNOF,
YY___ALIGNOF__,
YY_ID,
YY_OCTNUMBER,
YY_DECNUMBER,
YY_HEXNUMBER,
YY_FLOATNUMBER,
YY_STRING,
YY_CHARACTER),
"\010\000\000\000\000\000\000\000\004\030\377\376\000")) {
2810 yy_error_sym(
"unexpected", sym2);
2816 }
else if (
YY_IN_SET(sym2, (
YY__LPAREN,
YY__PLUS_PLUS,
YY__MINUS_MINUS,
YY__AND,
YY__PLUS,
YY__MINUS,
YY__TILDE,
YY__BANG,
YY_SIZEOF,
YY__ALIGNOF,
YY___ALIGNOF,
YY___ALIGNOF__,
YY_ID,
YY_OCTNUMBER,
YY_DECNUMBER,
YY_HEXNUMBER,
YY_FLOATNUMBER,
YY_STRING,
YY_CHARACTER,
YY__STAR),
"\010\000\000\000\000\000\001\000\004\030\377\376\000")) {
2820 yy_error_sym(
"unexpected", sym2);
2826 if (alt109 == 110) {
2828 sym = parse_assignment_expression(sym, &
len);
2829 }
else if (alt109 == 116) {
2831 }
else if (alt109 == 112) {
2834 }
else if (alt109 == 113) {
2835 sym = parse_assignment_expression(sym, &
len);
2837 yy_error_sym(
"unexpected", sym);
2839 }
else if (alt105 == 116 || alt105 == 114 || alt105 == 115) {
2840 if (alt105 == 116) {
2842 }
else if (alt105 == 114) {
2846 sym = parse_assignment_expression(sym, &
len);
2849 yy_error_sym(
"unexpected", sym);
2852 yy_error_sym(
"']' expected, got", sym);
2856 sym = parse_array_or_function_declarators(sym,
dcl, nested_dcl);
2862 if (
YY_IN_SET(sym, (
YY___EXTENSION__,
YY_VOID,
YY_CHAR,
YY_SHORT,
YY_INT,
YY_LONG,
YY_FLOAT,
YY_DOUBLE,
YY_SIGNED,
YY_UNSIGNED,
YY__BOOL,
YY__COMPLEX,
YY_COMPLEX,
YY___COMPLEX,
YY___COMPLEX__,
YY_STRUCT,
YY_UNION,
YY_ENUM,
YY_ID,
YY_CONST,
YY___CONST,
YY___CONST__,
YY_RESTRICT,
YY___RESTRICT,
YY___RESTRICT__,
YY_VOLATILE,
YY___VOLATILE,
YY___VOLATILE__,
YY__ATOMIC,
YY___ATTRIBUTE,
YY___ATTRIBUTE__,
YY___DECLSPEC,
YY___CDECL,
YY___STDCALL,
YY___FASTCALL,
YY___THISCALL,
YY___VECTORCALL,
YY__POINT_POINT_POINT),
"\002\000\376\377\377\107\370\017\000\000\000\002\000")) {
2863 if (
YY_IN_SET(sym, (
YY___EXTENSION__,
YY_VOID,
YY_CHAR,
YY_SHORT,
YY_INT,
YY_LONG,
YY_FLOAT,
YY_DOUBLE,
YY_SIGNED,
YY_UNSIGNED,
YY__BOOL,
YY__COMPLEX,
YY_COMPLEX,
YY___COMPLEX,
YY___COMPLEX__,
YY_STRUCT,
YY_UNION,
YY_ENUM,
YY_ID,
YY_CONST,
YY___CONST,
YY___CONST__,
YY_RESTRICT,
YY___RESTRICT,
YY___RESTRICT__,
YY_VOLATILE,
YY___VOLATILE,
YY___VOLATILE__,
YY__ATOMIC,
YY___ATTRIBUTE,
YY___ATTRIBUTE__,
YY___DECLSPEC,
YY___CDECL,
YY___STDCALL,
YY___FASTCALL,
YY___THISCALL,
YY___VECTORCALL),
"\002\000\376\377\377\107\360\017\000\000\000\002\000")) {
2864 sym = parse_parameter_declaration(sym, &
args);
2873 goto _yy_state_119_1;
2878 yy_error_sym(
"unexpected", sym2);
2881 if (
YY_IN_SET(sym2, (
YY___EXTENSION__,
YY_VOID,
YY_CHAR,
YY_SHORT,
YY_INT,
YY_LONG,
YY_FLOAT,
YY_DOUBLE,
YY_SIGNED,
YY_UNSIGNED,
YY__BOOL,
YY__COMPLEX,
YY_COMPLEX,
YY___COMPLEX,
YY___COMPLEX__,
YY_STRUCT,
YY_UNION,
YY_ENUM,
YY_ID,
YY_CONST,
YY___CONST,
YY___CONST__,
YY_RESTRICT,
YY___RESTRICT,
YY___RESTRICT__,
YY_VOLATILE,
YY___VOLATILE,
YY___VOLATILE__,
YY__ATOMIC,
YY___ATTRIBUTE,
YY___ATTRIBUTE__,
YY___DECLSPEC,
YY___CDECL,
YY___STDCALL,
YY___FASTCALL,
YY___THISCALL,
YY___VECTORCALL),
"\002\000\376\377\377\107\360\017\000\000\000\002\000")) {
2888 yy_error_sym(
"unexpected", sym2);
2894 if (alt119 != 120) {
2898 sym = parse_parameter_declaration(sym, &
args);
2900 if (alt119 == 122) {
2903 yy_error_sym(
"'...' expected, got", sym);
2914 yy_error_sym(
"')' expected, got", sym);
2918 sym = parse_array_or_function_declarators(sym,
dcl, nested_dcl);
2923 yy_error_sym(
"unexpected", sym);
2928static int parse_parameter_declaration(
int sym,
HashTable **
args) {
2930 size_t name_len = 0;
2934 sym = parse_specifier_qualifier_list(sym, ¶m_dcl);
2935 sym = parse_parameter_declarator(sym, ¶m_dcl, &
name, &name_len);
2942 sym = parse_specifier_qualifier_list(sym,
dcl);
2943 sym = parse_abstract_declarator(sym,
dcl);
2957 yy_error_sym(
"'(' expected, got", sym);
2961 yy_error_sym(
"'(' expected, got", sym);
2964 sym = parse_attrib(sym,
dcl);
2967 sym = parse_attrib(sym,
dcl);
2970 yy_error_sym(
"')' expected, got", sym);
2974 yy_error_sym(
"')' expected, got", sym);
2981 yy_error_sym(
"'(' expected, got", sym);
2985 sym = parse_ID(sym, &
name, &name_len);
2988 sym = parse_assignment_expression(sym, &
val);
2991 yy_error_sym(
"')' expected, got", sym);
2995 }
while (sym ==
YY_ID);
2997 yy_error_sym(
"')' expected, got", sym);
3022 yy_error_sym(
"unexpected", sym);
3033 bool orig_attribute_parsing;
3036 sym = parse_ID(sym, &
name, &name_len);
3043 sym = parse_assignment_expression(sym, &
val);
3048 sym = parse_assignment_expression(sym, &
val);
3053 yy_error_sym(
"')' expected, got", sym);
3057 yy_error_sym(
"unexpected", sym);
3070static int parse_initializer(
int sym) {
3072 const unsigned char *save_pos;
3073 const unsigned char *save_text;
3078 yy_error_sym(
"'=' expected, got", sym);
3081 if (
YY_IN_SET(sym, (
YY__LPAREN,
YY_ID,
YY_OCTNUMBER,
YY_DECNUMBER,
YY_HEXNUMBER,
YY_FLOATNUMBER,
YY_STRING,
YY_CHARACTER,
YY__PLUS_PLUS,
YY__MINUS_MINUS,
YY__AND,
YY__STAR,
YY__PLUS,
YY__MINUS,
YY__TILDE,
YY__BANG,
YY_SIZEOF,
YY__ALIGNOF,
YY___ALIGNOF,
YY___ALIGNOF__),
"\010\000\000\000\000\000\001\000\004\030\377\376\000")) {
3082 sym = parse_assignment_expression(sym, &dummy);
3086 sym = parse_designation(sym);
3088 sym = parse_initializer(sym);
3097 goto _yy_state_343_1;
3102 yy_error_sym(
"unexpected", sym2);
3112 yy_error_sym(
"unexpected", sym2);
3118 if (alt343 != 344) {
3123 sym = parse_designation(sym);
3125 sym = parse_initializer(sym);
3127 if (alt343 == 347) {
3131 yy_error_sym(
"'}' expected, got", sym);
3135 yy_error_sym(
"unexpected", sym);
3140static int parse_designation(
int sym) {
3147 sym = parse_constant_expression(sym, &dummy);
3149 yy_error_sym(
"']' expected, got", sym);
3154 sym = parse_ID(sym, &
name, &name_len);
3156 yy_error_sym(
"unexpected", sym);
3160 yy_error_sym(
"'=' expected, got", sym);
3166static int parse_expr_list(
int sym) {
3168 sym = parse_assignment_expression(sym, &dummy);
3171 sym = parse_assignment_expression(sym, &dummy);
3177 sym = parse_assignment_expression(sym,
val);
3180 sym = parse_assignment_expression(sym,
val);
3186 sym = parse_conditional_expression(sym,
val);
3191 sym = parse_conditional_expression(sym,
val);
3197 sym = parse_logical_or_expression(sym,
val);
3200 sym = parse_expression(sym, &
op2);
3202 yy_error_sym(
"':' expected, got", sym);
3205 sym = parse_conditional_expression(sym, &op3);
3213 sym = parse_logical_and_expression(sym,
val);
3216 sym = parse_logical_and_expression(sym, &
op2);
3224 sym = parse_inclusive_or_expression(sym,
val);
3227 sym = parse_inclusive_or_expression(sym, &
op2);
3235 sym = parse_exclusive_or_expression(sym,
val);
3238 sym = parse_exclusive_or_expression(sym, &
op2);
3246 sym = parse_and_expression(sym,
val);
3249 sym = parse_and_expression(sym, &
op2);
3257 sym = parse_equality_expression(sym,
val);
3260 sym = parse_equality_expression(sym, &
op2);
3268 sym = parse_relational_expression(sym,
val);
3272 sym = parse_relational_expression(sym, &
op2);
3276 sym = parse_relational_expression(sym, &
op2);
3285 sym = parse_shift_expression(sym,
val);
3289 sym = parse_shift_expression(sym, &
op2);
3293 sym = parse_shift_expression(sym, &
op2);
3297 sym = parse_shift_expression(sym, &
op2);
3301 sym = parse_shift_expression(sym, &
op2);
3310 sym = parse_additive_expression(sym,
val);
3314 sym = parse_additive_expression(sym, &
op2);
3318 sym = parse_additive_expression(sym, &
op2);
3327 sym = parse_multiplicative_expression(sym,
val);
3331 sym = parse_multiplicative_expression(sym, &
op2);
3335 sym = parse_multiplicative_expression(sym, &
op2);
3342static int parse_multiplicative_expression(
int sym,
zend_ffi_val *
val) {
3344 sym = parse_cast_expression(sym,
val);
3348 sym = parse_cast_expression(sym, &
op2);
3352 sym = parse_cast_expression(sym, &
op2);
3356 sym = parse_cast_expression(sym, &
op2);
3368 sym = parse_type_name(sym, &
dcl);
3370 yy_error_sym(
"')' expected, got", sym);
3375 sym = parse_unary_expression(sym,
val);
3386 sym = parse_ID(sym, &
name, &name_len);
3392 sym = parse_expr_list(sym);
3394 yy_error_sym(
"']' expected, got", sym);
3400 if (
YY_IN_SET(sym, (
YY__LPAREN,
YY_ID,
YY_OCTNUMBER,
YY_DECNUMBER,
YY_HEXNUMBER,
YY_FLOATNUMBER,
YY_STRING,
YY_CHARACTER,
YY__PLUS_PLUS,
YY__MINUS_MINUS,
YY__AND,
YY__STAR,
YY__PLUS,
YY__MINUS,
YY__TILDE,
YY__BANG,
YY_SIZEOF,
YY__ALIGNOF,
YY___ALIGNOF,
YY___ALIGNOF__),
"\010\000\000\000\000\000\001\000\004\030\377\376\000")) {
3401 sym = parse_expr_list(sym);
3404 yy_error_sym(
"')' expected, got", sym);
3410 sym = parse_ID(sym, &
name, &name_len);
3414 sym = parse_ID(sym, &
name, &name_len);
3423 zend_ffi_val_error(
val);
3427 sym = parse_OCTNUMBER(sym,
val);
3430 sym = parse_DECNUMBER(sym,
val);
3433 sym = parse_HEXNUMBER(sym,
val);
3436 sym = parse_FLOATNUMBER(sym,
val);
3439 sym = parse_STRING(sym,
val);
3442 sym = parse_CHARACTER(sym,
val);
3446 sym = parse_expression(sym,
val);
3448 yy_error_sym(
"')' expected, got", sym);
3454 sym = parse_unary_expression(sym,
val);
3455 zend_ffi_val_error(
val);
3459 sym = parse_unary_expression(sym,
val);
3460 zend_ffi_val_error(
val);
3464 sym = parse_cast_expression(sym,
val);
3465 zend_ffi_val_error(
val);
3469 sym = parse_cast_expression(sym,
val);
3470 zend_ffi_val_error(
val);
3474 sym = parse_cast_expression(sym,
val);
3479 sym = parse_cast_expression(sym,
val);
3484 sym = parse_cast_expression(sym,
val);
3489 sym = parse_cast_expression(sym,
val);
3496 sym = parse_type_name(sym, &
dcl);
3498 yy_error_sym(
"')' expected, got", sym);
3502 }
else if (
YY_IN_SET(sym, (
YY_ID,
YY_OCTNUMBER,
YY_DECNUMBER,
YY_HEXNUMBER,
YY_FLOATNUMBER,
YY_STRING,
YY_CHARACTER,
YY__LPAREN,
YY__PLUS_PLUS,
YY__MINUS_MINUS,
YY__AND,
YY__STAR,
YY__PLUS,
YY__MINUS,
YY__TILDE,
YY__BANG,
YY_SIZEOF,
YY__ALIGNOF,
YY___ALIGNOF,
YY___ALIGNOF__),
"\010\000\000\000\000\000\001\000\004\030\377\376\000")) {
3503 sym = parse_unary_expression(sym,
val);
3506 yy_error_sym(
"unexpected", sym);
3512 yy_error_sym(
"'(' expected, got", sym);
3515 sym = parse_type_name(sym, &
dcl);
3517 yy_error_sym(
"')' expected, got", sym);
3527 sym = parse_type_name(sym, &
dcl);
3529 yy_error_sym(
"')' expected, got", sym);
3533 }
else if (
YY_IN_SET(sym, (
YY_ID,
YY_OCTNUMBER,
YY_DECNUMBER,
YY_HEXNUMBER,
YY_FLOATNUMBER,
YY_STRING,
YY_CHARACTER,
YY__LPAREN,
YY__PLUS_PLUS,
YY__MINUS_MINUS,
YY__AND,
YY__STAR,
YY__PLUS,
YY__MINUS,
YY__TILDE,
YY__BANG,
YY_SIZEOF,
YY__ALIGNOF,
YY___ALIGNOF,
YY___ALIGNOF__),
"\010\000\000\000\000\000\001\000\004\030\377\376\000")) {
3534 sym = parse_unary_expression(sym,
val);
3537 yy_error_sym(
"unexpected", sym);
3541 yy_error_sym(
"unexpected", sym);
3546static int parse_ID(
int sym,
const char **
name,
size_t *name_len) {
3548 yy_error_sym(
"<ID> expected, got", sym);
3557 yy_error_sym(
"<OCTNUMBER> expected, got", sym);
3566 yy_error_sym(
"<DECNUMBER> expected, got", sym);
3575 yy_error_sym(
"<HEXNUMBER> expected, got", sym);
3584 yy_error_sym(
"<FLOATNUMBER> expected, got", sym);
3593 yy_error_sym(
"<STRING> expected, got", sym);
3602 yy_error_sym(
"<CHARACTER> expected, got", sym);
3609static void parse(
void) {
3614 sym = parse_declarations(get_sym());
3616 yy_error_sym(
"<EOF> expected, got", sym);
3624 yy_buf = (
unsigned char*)str;
3642 sym = parse_type_name(get_sym(),
dcl);
3644 yy_error_sym(
"<EOF> expected, got", sym);
3653static void yy_error(
const char *
msg) {
3657static void yy_error_sym(
const char *
msg,
int sym) {
3661static void yy_error_str(
const char *
msg,
const char *str) {
void zend_ffi_resolve_typedef(const char *name, size_t name_len, zend_ffi_dcl *dcl)
void zend_ffi_add_arg(HashTable **args, const char *name, size_t name_len, zend_ffi_dcl *arg_dcl)
void zend_ffi_expr_cast(zend_ffi_val *val, zend_ffi_dcl *dcl)
bool zend_ffi_is_typedef_name(const char *name, size_t name_len)
void zend_ffi_expr_plus(zend_ffi_val *val)
void zend_ffi_expr_sizeof_val(zend_ffi_val *val)
void zend_ffi_cleanup_dcl(zend_ffi_dcl *dcl)
void zend_ffi_align_as_val(zend_ffi_dcl *dcl, zend_ffi_val *align_val)
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)
void zend_ffi_expr_alignof_val(zend_ffi_val *val)
void zend_ffi_expr_neg(zend_ffi_val *val)
void zend_ffi_expr_alignof_type(zend_ffi_val *val, zend_ffi_dcl *dcl)
void zend_ffi_expr_bool_or(zend_ffi_val *val, zend_ffi_val *op2)
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)
void zend_ffi_adjust_struct_size(zend_ffi_dcl *dcl)
void zend_ffi_expr_div(zend_ffi_val *val, zend_ffi_val *op2)
void zend_ffi_expr_shift_left(zend_ffi_val *val, zend_ffi_val *op2)
void zend_ffi_expr_bw_or(zend_ffi_val *val, zend_ffi_val *op2)
void zend_ffi_expr_is_less_or_equal(zend_ffi_val *val, zend_ffi_val *op2)
void zend_ffi_make_pointer_type(zend_ffi_dcl *dcl)
void zend_ffi_add_anonymous_field(zend_ffi_dcl *struct_dcl, zend_ffi_dcl *field_dcl)
void zend_ffi_expr_is_not_equal(zend_ffi_val *val, zend_ffi_val *op2)
void zend_ffi_expr_bw_not(zend_ffi_val *val)
void zend_ffi_declare(const char *name, size_t name_len, zend_ffi_dcl *dcl)
void zend_ffi_nested_declaration(zend_ffi_dcl *dcl, zend_ffi_dcl *nested_dcl)
void zend_ffi_expr_is_greater_or_equal(zend_ffi_val *val, zend_ffi_val *op2)
void zend_ffi_expr_sizeof_type(zend_ffi_val *val, zend_ffi_dcl *dcl)
void zend_ffi_expr_mul(zend_ffi_val *val, zend_ffi_val *op2)
void zend_ffi_add_attribute_value(zend_ffi_dcl *dcl, const char *name, size_t name_len, int n, zend_ffi_val *val)
void zend_ffi_parser_error(const char *format,...)
void zend_ffi_expr_mod(zend_ffi_val *val, zend_ffi_val *op2)
void zend_ffi_expr_bool_and(zend_ffi_val *val, zend_ffi_val *op2)
void zend_ffi_expr_shift_right(zend_ffi_val *val, zend_ffi_val *op2)
void zend_ffi_make_struct_type(zend_ffi_dcl *dcl)
void zend_ffi_expr_is_less(zend_ffi_val *val, zend_ffi_val *op2)
void zend_ffi_expr_bw_xor(zend_ffi_val *val, zend_ffi_val *op2)
void zend_ffi_make_func_type(zend_ffi_dcl *dcl, HashTable *args, zend_ffi_dcl *nested_dcl)
void zend_ffi_val_character(zend_ffi_val *val, const char *str, size_t str_len)
void zend_ffi_validate_type_name(zend_ffi_dcl *dcl)
void zend_ffi_expr_bw_and(zend_ffi_val *val, zend_ffi_val *op2)
void zend_ffi_set_abi(zend_ffi_dcl *dcl, uint16_t abi)
void zend_ffi_make_enum_type(zend_ffi_dcl *dcl)
void zend_ffi_resolve_const(const char *name, size_t name_len, zend_ffi_val *val)
void zend_ffi_declare_tag(const char *name, size_t name_len, zend_ffi_dcl *dcl, bool incomplete)
void zend_ffi_val_number(zend_ffi_val *val, int base, const char *str, size_t str_len)
void zend_ffi_add_field(zend_ffi_dcl *struct_dcl, const char *name, size_t name_len, zend_ffi_dcl *field_dcl)
void zend_ffi_val_float_number(zend_ffi_val *val, const char *str, size_t str_len)
void zend_ffi_expr_is_greater(zend_ffi_val *val, zend_ffi_val *op2)
void zend_ffi_expr_bool_not(zend_ffi_val *val)
void zend_ffi_val_string(zend_ffi_val *val, const char *str, size_t str_len)
void zend_ffi_add_msvc_attribute_value(zend_ffi_dcl *dcl, const char *name, size_t name_len, zend_ffi_val *val)
void zend_ffi_expr_sub(zend_ffi_val *val, zend_ffi_val *op2)
void zend_ffi_add_attribute(zend_ffi_dcl *dcl, const char *name, size_t name_len)
zend_ffi_ctype_name_buf buf
void zend_ffi_make_array_type(zend_ffi_dcl *dcl, zend_ffi_val *len)
void zend_ffi_expr_conditional(zend_ffi_val *val, zend_ffi_val *op2, zend_ffi_val *op3)
void zend_ffi_expr_is_equal(zend_ffi_val *val, zend_ffi_val *op2)
void zend_ffi_align_as_type(zend_ffi_dcl *dcl, zend_ffi_dcl *align_dcl)
void zend_ffi_expr_add(zend_ffi_val *val, zend_ffi_val *op2)
const char * yy_escape_string(char *buf, size_t size, const unsigned char *str, size_t n)
zend_result zend_ffi_parse_decl(const char *str, size_t len)
zend_result zend_ffi_parse_type(const char *str, size_t len, zend_ffi_dcl *dcl)
#define YY__GREATER_GREATER
#define YY__POINT_POINT_POINT
const char * yy_escape_char(char *buf, unsigned char ch)
#define YY__MINUS_GREATER
#define YY__GREATER_EQUAL
size_t yy_escape(char *buf, unsigned char ch)
#define YY_ONE_LINE_COMMENT
#define YY_IN_SET(sym, set, bitset)
#define ZEND_FFI_ATTR_VARIADIC
#define ZEND_FFI_ABI_THISCALL
#define ZEND_FFI_DCL_SHORT
#define ZEND_FFI_DCL_STORAGE_CLASS
#define ZEND_FFI_DCL_SIGNED
#define ZEND_FFI_DCL_TYPEDEF_NAME
#define ZEND_FFI_DCL_LONG_LONG
#define ZEND_FFI_ATTR_INCOMPLETE_ARRAY
#define ZEND_FFI_DCL_UNSIGNED
#define ZEND_FFI_DCL_VOLATILE
#define ZEND_FFI_DCL_NO_RETURN
#define ZEND_FFI_DCL_REGISTER
#define ZEND_FFI_ATTR_INIT
#define ZEND_FFI_DCL_VOID
#define ZEND_FFI_DCL_BOOL
#define ZEND_FFI_DCL_DOUBLE
#define ZEND_FFI_DCL_TYPE_SPECIFIERS
struct _zend_ffi_val zend_ffi_val
#define ZEND_FFI_DCL_CHAR
#define ZEND_FFI_DCL_LONG
#define ZEND_FFI_ABI_VECTORCALL
#define ZEND_FFI_DCL_ATOMIC
#define ZEND_FFI_ABI_CDECL
unsigned const char * pos
#define ZEND_FFI_ATTR_CONST
#define ZEND_FFI_ATTR_VLA
struct _zend_ffi_dcl zend_ffi_dcl
#define ZEND_FFI_DCL_UNION
#define ZEND_FFI_DCL_CONST
#define ZEND_FFI_DCL_RESTRICT
#define ZEND_FFI_DCL_ENUM
#define ZEND_FFI_ABI_STDCALL
#define ZEND_FFI_DCL_INLINE
#define ZEND_FFI_DCL_FLOAT
#define ZEND_FFI_DCL_STRUCT
#define ZEND_FFI_DCL_COMPLEX
#define ZEND_FFI_DCL_TYPEDEF
#define ZEND_FFI_DCL_STATIC
#define ZEND_FFI_DCL_AUTO
#define ZEND_FFI_DCL_EXTERN
#define ZEND_FFI_ABI_FASTCALL
struct _zend_array HashTable
ZEND_RESULT_CODE zend_result