Lines Matching refs:sym
36 static void yy_error_sym(const char *msg, int sym);
246 #define YY_IN_SET(sym, set, bitset) \ argument
247 (bitset[sym>>3] & (1 << (sym & 0x7)))
249 static int skip_EOL(int sym);
250 static int skip_WS(int sym);
251 static int skip_ONE_LINE_COMMENT(int sym);
252 static int skip_COMMENT(int sym);
254 static int check_nested_declarator_start(int sym);
255 static int check_type_name_start(int sym);
256 static int check_ID(int sym);
257 static int parse_declarations(int sym);
258 static int parse_declaration_specifiers(int sym, zend_ffi_dcl *dcl);
259 static int parse_specifier_qualifier_list(int sym, zend_ffi_dcl *dcl);
260 static int parse_type_qualifier_list(int sym, zend_ffi_dcl *dcl);
261 static int parse_type_qualifier(int sym, zend_ffi_dcl *dcl);
262 static int parse_type_specifier(int sym, zend_ffi_dcl *dcl);
263 static int parse_struct_or_union_specifier(int sym, zend_ffi_dcl *dcl);
264 static int parse_struct_contents(int sym, zend_ffi_dcl *dcl);
265 static int parse_struct_declaration(int sym, zend_ffi_dcl *struct_dcl);
266 static int parse_struct_declarator(int sym, zend_ffi_dcl *struct_dcl, zend_ffi_dcl *field_dcl);
267 static int parse_enum_specifier(int sym, zend_ffi_dcl *dcl);
268 static int parse_enumerator_list(int sym, zend_ffi_dcl *enum_dcl);
269 static int parse_enumerator(int sym, zend_ffi_dcl *enum_dcl, int64_t *min, int64_t *max, int64_t *l…
270 static int parse_declarator(int sym, zend_ffi_dcl *dcl, const char **name, size_t *name_len);
271 static int parse_abstract_declarator(int sym, zend_ffi_dcl *dcl);
272 static int parse_parameter_declarator(int sym, zend_ffi_dcl *dcl, const char **name, size_t *name_l…
273 static int parse_pointer(int sym, zend_ffi_dcl *dcl);
274 static int parse_array_or_function_declarators(int sym, zend_ffi_dcl *dcl, zend_ffi_dcl *nested_dcl…
275 static int parse_parameter_declaration(int sym, HashTable **args);
276 static int parse_type_name(int sym, zend_ffi_dcl *dcl);
277 static int parse_attributes(int sym, zend_ffi_dcl *dcl);
278 static int parse_attrib(int sym, zend_ffi_dcl *dcl);
279 static int parse_initializer(int sym);
280 static int parse_designation(int sym);
281 static int parse_expr_list(int sym);
282 static int parse_expression(int sym, zend_ffi_val *val);
283 static int parse_assignment_expression(int sym, zend_ffi_val *val);
284 static int parse_constant_expression(int sym, zend_ffi_val *val);
285 static int parse_conditional_expression(int sym, zend_ffi_val *val);
286 static int parse_logical_or_expression(int sym, zend_ffi_val *val);
287 static int parse_logical_and_expression(int sym, zend_ffi_val *val);
288 static int parse_inclusive_or_expression(int sym, zend_ffi_val *val);
289 static int parse_exclusive_or_expression(int sym, zend_ffi_val *val);
290 static int parse_and_expression(int sym, zend_ffi_val *val);
291 static int parse_equality_expression(int sym, zend_ffi_val *val);
292 static int parse_relational_expression(int sym, zend_ffi_val *val);
293 static int parse_shift_expression(int sym, zend_ffi_val *val);
294 static int parse_additive_expression(int sym, zend_ffi_val *val);
295 static int parse_multiplicative_expression(int sym, zend_ffi_val *val);
296 static int parse_cast_expression(int sym, zend_ffi_val *val);
297 static int parse_unary_expression(int sym, zend_ffi_val *val);
298 static int parse_ID(int sym, const char **name, size_t *name_len);
299 static int parse_OCTNUMBER(int sym, zend_ffi_val *val);
300 static int parse_DECNUMBER(int sym, zend_ffi_val *val);
301 static int parse_HEXNUMBER(int sym, zend_ffi_val *val);
302 static int parse_FLOATNUMBER(int sym, zend_ffi_val *val);
303 static int parse_STRING(int sym, zend_ffi_val *val);
304 static int parse_CHARACTER(int sym, zend_ffi_val *val);
305 static int synpred_1(int sym);
306 static int synpred_2(int sym);
307 static int synpred_3(int sym);
308 static int synpred_4(int sym);
309 static int synpred_5(int sym);
310 static int synpred_6(int sym);
1681 static int skip_EOL(int sym) { in skip_EOL() argument
1682 if (sym != YY_EOL) { in skip_EOL()
1683 yy_error_sym("<EOL> expected, got", sym); in skip_EOL()
1685 sym = get_skip_sym(); in skip_EOL()
1686 return sym; in skip_EOL()
1689 static int skip_WS(int sym) { in skip_WS() argument
1690 if (sym != YY_WS) { in skip_WS()
1691 yy_error_sym("<WS> expected, got", sym); in skip_WS()
1693 sym = get_skip_sym(); in skip_WS()
1694 return sym; in skip_WS()
1697 static int skip_ONE_LINE_COMMENT(int sym) { in skip_ONE_LINE_COMMENT() argument
1698 if (sym != YY_ONE_LINE_COMMENT) { in skip_ONE_LINE_COMMENT()
1699 yy_error_sym("<ONE_LINE_COMMENT> expected, got", sym); in skip_ONE_LINE_COMMENT()
1701 sym = get_skip_sym(); in skip_ONE_LINE_COMMENT()
1702 return sym; in skip_ONE_LINE_COMMENT()
1705 static int skip_COMMENT(int sym) { in skip_COMMENT() argument
1706 if (sym != YY_COMMENT) { in skip_COMMENT()
1707 yy_error_sym("<COMMENT> expected, got", sym); in skip_COMMENT()
1709 sym = get_skip_sym(); in skip_COMMENT()
1710 return sym; in skip_COMMENT()
1714 int sym; in get_sym() local
1715 sym = get_skip_sym(); in get_sym()
1716 while (sym == YY_EOL || sym == YY_WS || sym == YY_ONE_LINE_COMMENT || sym == YY_COMMENT) { in get_sym()
1717 if (sym == YY_EOL) { in get_sym()
1718 sym = skip_EOL(sym); in get_sym()
1719 } else if (sym == YY_WS) { in get_sym()
1720 sym = skip_WS(sym); in get_sym()
1721 } else if (sym == YY_ONE_LINE_COMMENT) { in get_sym()
1722 sym = skip_ONE_LINE_COMMENT(sym); in get_sym()
1724 sym = skip_COMMENT(sym); in get_sym()
1727 return sym; in get_sym()
1730 static int check_nested_declarator_start(int sym) { in check_nested_declarator_start() argument
1731 if (sym != YY__LPAREN) { in check_nested_declarator_start()
1734 sym = get_sym(); in check_nested_declarator_start()
1735 if ((sym == YY_ID) && (!zend_ffi_is_typedef_name((const char*)yy_text, yy_pos - yy_text))) { in check_nested_declarator_start()
1736 sym = check_ID(sym); in check_nested_declarator_start()
1737 if (sym == -1) { in check_nested_declarator_start()
1741 switch (sym) { in check_nested_declarator_start()
1743 sym = get_sym(); in check_nested_declarator_start()
1746 sym = get_sym(); in check_nested_declarator_start()
1749 sym = get_sym(); in check_nested_declarator_start()
1752 sym = get_sym(); in check_nested_declarator_start()
1755 sym = get_sym(); in check_nested_declarator_start()
1758 sym = get_sym(); in check_nested_declarator_start()
1764 return sym; in check_nested_declarator_start()
1767 static int check_type_name_start(int sym) { in check_type_name_start() argument
1768 if ((sym == YY_ID) && (zend_ffi_is_typedef_name((const char*)yy_text, yy_pos - yy_text))) { in check_type_name_start()
1769 sym = check_ID(sym); in check_type_name_start()
1770 if (sym == -1) { in check_type_name_start()
1774 switch (sym) { in check_type_name_start()
1776 sym = get_sym(); in check_type_name_start()
1779 sym = get_sym(); in check_type_name_start()
1782 sym = get_sym(); in check_type_name_start()
1785 sym = get_sym(); in check_type_name_start()
1788 sym = get_sym(); in check_type_name_start()
1791 sym = get_sym(); in check_type_name_start()
1794 sym = get_sym(); in check_type_name_start()
1797 sym = get_sym(); in check_type_name_start()
1800 sym = get_sym(); in check_type_name_start()
1803 sym = get_sym(); in check_type_name_start()
1806 sym = get_sym(); in check_type_name_start()
1809 sym = get_sym(); in check_type_name_start()
1812 sym = get_sym(); in check_type_name_start()
1815 sym = get_sym(); in check_type_name_start()
1818 sym = get_sym(); in check_type_name_start()
1821 sym = get_sym(); in check_type_name_start()
1824 sym = get_sym(); in check_type_name_start()
1827 sym = get_sym(); in check_type_name_start()
1830 sym = get_sym(); in check_type_name_start()
1833 sym = get_sym(); in check_type_name_start()
1836 sym = get_sym(); in check_type_name_start()
1839 sym = get_sym(); in check_type_name_start()
1842 sym = get_sym(); in check_type_name_start()
1845 sym = get_sym(); in check_type_name_start()
1848 sym = get_sym(); in check_type_name_start()
1851 sym = get_sym(); in check_type_name_start()
1854 sym = get_sym(); in check_type_name_start()
1857 sym = get_sym(); in check_type_name_start()
1860 sym = get_sym(); in check_type_name_start()
1863 sym = get_sym(); in check_type_name_start()
1869 return sym; in check_type_name_start()
1872 static int check_ID(int sym) { in check_ID() argument
1873 if (sym != YY_ID) { in check_ID()
1876 sym = get_sym(); in check_ID()
1877 return sym; in check_ID()
1880 static int synpred_1(int sym) { in synpred_1() argument
1889 ret = check_type_name_start(sym) != -1; in synpred_1()
1896 static int synpred_2(int sym) { in synpred_2() argument
1905 ret = check_nested_declarator_start(sym) != -1; in synpred_2()
1912 static int synpred_3(int sym) { in synpred_3() argument
1921 ret = check_nested_declarator_start(sym) != -1; in synpred_3()
1928 static int _synpred_4(int sym) { in _synpred_4() argument
1929 if (sym != YY__LPAREN) { in _synpred_4()
1932 sym = get_sym(); in _synpred_4()
1933 sym = check_type_name_start(sym); in _synpred_4()
1934 if (sym == -1) { in _synpred_4()
1937 return sym; in _synpred_4()
1940 static int synpred_4(int sym) { in synpred_4() argument
1949 ret = _synpred_4(sym) != -1; in synpred_4()
1956 static int _synpred_5(int sym) { in _synpred_5() argument
1957 if (sym != YY__LPAREN) { in _synpred_5()
1960 sym = get_sym(); in _synpred_5()
1961 sym = check_type_name_start(sym); in _synpred_5()
1962 if (sym == -1) { in _synpred_5()
1965 return sym; in _synpred_5()
1968 static int synpred_5(int sym) { in synpred_5() argument
1977 ret = _synpred_5(sym) != -1; in synpred_5()
1984 static int _synpred_6(int sym) { in _synpred_6() argument
1985 if (sym != YY__LPAREN) { in _synpred_6()
1988 sym = get_sym(); in _synpred_6()
1989 sym = check_type_name_start(sym); in _synpred_6()
1990 if (sym == -1) { in _synpred_6()
1993 return sym; in _synpred_6()
1996 static int synpred_6(int sym) { in synpred_6() argument
2005 ret = _synpred_6(sym) != -1; in synpred_6()
2012 static int parse_declarations(int sym) { in parse_declarations() argument
2013 …while (YY_IN_SET(sym, (YY___EXTENSION__,YY_TYPEDEF,YY_EXTERN,YY_STATIC,YY_AUTO,YY_REGISTER,YY_INLI… in parse_declarations()
2015 if (sym == YY___EXTENSION__) { in parse_declarations()
2016 sym = get_sym(); in parse_declarations()
2018 sym = parse_declaration_specifiers(sym, &common_dcl); in parse_declarations()
2019 if (sym == YY__STAR || sym == YY_ID || sym == YY__LPAREN) { in parse_declarations()
2024 sym = parse_declarator(sym, &dcl, &name, &name_len); in parse_declarations()
2025 if (sym == YY___ASM__) { in parse_declarations()
2027 sym = get_sym(); in parse_declarations()
2028 if (sym != YY__LPAREN) { in parse_declarations()
2029 yy_error_sym("'(' expected, got", sym); in parse_declarations()
2031 sym = get_sym(); in parse_declarations()
2033 sym = parse_STRING(sym, &asm_str); in parse_declarations()
2034 } while (sym == YY_STRING); in parse_declarations()
2035 if (sym != YY__RPAREN) { in parse_declarations()
2036 yy_error_sym("')' expected, got", sym); in parse_declarations()
2038 sym = get_sym(); in parse_declarations()
2040 …if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FAS… in parse_declarations()
2041 sym = parse_attributes(sym, &dcl); in parse_declarations()
2043 if (sym == YY__EQUAL) { in parse_declarations()
2044 sym = parse_initializer(sym); in parse_declarations()
2047 while (sym == YY__COMMA) { in parse_declarations()
2048 sym = get_sym(); in parse_declarations()
2050 sym = parse_declarator(sym, &dcl, &name, &name_len); in parse_declarations()
2051 …if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FAS… in parse_declarations()
2052 sym = parse_attributes(sym, &dcl); in parse_declarations()
2054 if (sym == YY__EQUAL) { in parse_declarations()
2055 sym = parse_initializer(sym); in parse_declarations()
2060 if (sym != YY__SEMICOLON) { in parse_declarations()
2061 yy_error_sym("';' expected, got", sym); in parse_declarations()
2063 sym = get_sym(); in parse_declarations()
2065 return sym; in parse_declarations()
2068 static int parse_declaration_specifiers(int sym, zend_ffi_dcl *dcl) { in parse_declaration_specifiers() argument
2070 switch (sym) { in parse_declaration_specifiers()
2072 if (dcl->flags & ZEND_FFI_DCL_STORAGE_CLASS) yy_error_sym("unexpected", sym); in parse_declaration_specifiers()
2073 sym = get_sym(); in parse_declaration_specifiers()
2077 if (dcl->flags & ZEND_FFI_DCL_STORAGE_CLASS) yy_error_sym("unexpected", sym); in parse_declaration_specifiers()
2078 sym = get_sym(); in parse_declaration_specifiers()
2082 if (dcl->flags & ZEND_FFI_DCL_STORAGE_CLASS) yy_error_sym("unexpected", sym); in parse_declaration_specifiers()
2083 sym = get_sym(); in parse_declaration_specifiers()
2087 if (dcl->flags & ZEND_FFI_DCL_STORAGE_CLASS) yy_error_sym("unexpected", sym); in parse_declaration_specifiers()
2088 sym = get_sym(); in parse_declaration_specifiers()
2092 if (dcl->flags & ZEND_FFI_DCL_STORAGE_CLASS) yy_error_sym("unexpected", sym); in parse_declaration_specifiers()
2093 sym = get_sym(); in parse_declaration_specifiers()
2099 sym = get_sym(); in parse_declaration_specifiers()
2103 sym = get_sym(); in parse_declaration_specifiers()
2107 sym = get_sym(); in parse_declaration_specifiers()
2108 if (sym != YY__LPAREN) { in parse_declaration_specifiers()
2109 yy_error_sym("'(' expected, got", sym); in parse_declaration_specifiers()
2111 sym = get_sym(); in parse_declaration_specifiers()
2112 …sym, (YY___EXTENSION__,YY_VOID,YY_CHAR,YY_SHORT,YY_INT,YY_LONG,YY_FLOAT,YY_DOUBLE,YY_SIGNED,YY_UNS… in parse_declaration_specifiers()
2114 sym = parse_type_name(sym, &align_dcl); in parse_declaration_specifiers()
2116 …} else if (YY_IN_SET(sym, (YY__LPAREN,YY_ID,YY_OCTNUMBER,YY_DECNUMBER,YY_HEXNUMBER,YY_FLOATNUMBER,… in parse_declaration_specifiers()
2118 sym = parse_constant_expression(sym, &align_val); in parse_declaration_specifiers()
2121 yy_error_sym("unexpected", sym); in parse_declaration_specifiers()
2123 if (sym != YY__RPAREN) { in parse_declaration_specifiers()
2124 yy_error_sym("')' expected, got", sym); in parse_declaration_specifiers()
2126 sym = get_sym(); in parse_declaration_specifiers()
2136 sym = parse_attributes(sym, dcl); in parse_declaration_specifiers()
2148 sym = parse_type_qualifier(sym, dcl); in parse_declaration_specifiers()
2168 sym = parse_type_specifier(sym, dcl); in parse_declaration_specifiers()
2171 yy_error_sym("unexpected", sym); in parse_declaration_specifiers()
2173 …sym, (YY_TYPEDEF,YY_EXTERN,YY_STATIC,YY_AUTO,YY_REGISTER,YY_INLINE,YY___INLINE,YY___INLINE__,YY__N… in parse_declaration_specifiers()
2174 return sym; in parse_declaration_specifiers()
2177 static int parse_specifier_qualifier_list(int sym, zend_ffi_dcl *dcl) { in parse_specifier_qualifier_list() argument
2178 if (sym == YY___EXTENSION__) { in parse_specifier_qualifier_list()
2179 sym = get_sym(); in parse_specifier_qualifier_list()
2182 …if (YY_IN_SET(sym, (YY_VOID,YY_CHAR,YY_SHORT,YY_INT,YY_LONG,YY_FLOAT,YY_DOUBLE,YY_SIGNED,YY_UNSIGN… in parse_specifier_qualifier_list()
2183 sym = parse_type_specifier(sym, dcl); in parse_specifier_qualifier_list()
2184 …} else if (YY_IN_SET(sym, (YY_CONST,YY___CONST,YY___CONST__,YY_RESTRICT,YY___RESTRICT,YY___RESTRIC… in parse_specifier_qualifier_list()
2185 sym = parse_type_qualifier(sym, dcl); in parse_specifier_qualifier_list()
2186 …} else if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,Y… in parse_specifier_qualifier_list()
2187 sym = parse_attributes(sym, dcl); in parse_specifier_qualifier_list()
2189 yy_error_sym("unexpected", sym); in parse_specifier_qualifier_list()
2191 …sym, (YY_VOID,YY_CHAR,YY_SHORT,YY_INT,YY_LONG,YY_FLOAT,YY_DOUBLE,YY_SIGNED,YY_UNSIGNED,YY__BOOL,YY… in parse_specifier_qualifier_list()
2192 return sym; in parse_specifier_qualifier_list()
2195 static int parse_type_qualifier_list(int sym, zend_ffi_dcl *dcl) { in parse_type_qualifier_list() argument
2197 …if (YY_IN_SET(sym, (YY_CONST,YY___CONST,YY___CONST__,YY_RESTRICT,YY___RESTRICT,YY___RESTRICT__,YY_… in parse_type_qualifier_list()
2198 sym = parse_type_qualifier(sym, dcl); in parse_type_qualifier_list()
2199 …} else if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,Y… in parse_type_qualifier_list()
2200 sym = parse_attributes(sym, dcl); in parse_type_qualifier_list()
2202 yy_error_sym("unexpected", sym); in parse_type_qualifier_list()
2204 …} while (YY_IN_SET(sym, (YY_CONST,YY___CONST,YY___CONST__,YY_RESTRICT,YY___RESTRICT,YY___RESTRICT_… in parse_type_qualifier_list()
2205 return sym; in parse_type_qualifier_list()
2208 static int parse_type_qualifier(int sym, zend_ffi_dcl *dcl) { in parse_type_qualifier() argument
2209 if (sym == YY_CONST || sym == YY___CONST || sym == YY___CONST__) { in parse_type_qualifier()
2210 sym = get_sym(); in parse_type_qualifier()
2213 } else if (sym == YY_RESTRICT || sym == YY___RESTRICT || sym == YY___RESTRICT__) { in parse_type_qualifier()
2214 sym = get_sym(); in parse_type_qualifier()
2216 } else if (sym == YY_VOLATILE || sym == YY___VOLATILE || sym == YY___VOLATILE__) { in parse_type_qualifier()
2217 sym = get_sym(); in parse_type_qualifier()
2219 } else if (sym == YY__ATOMIC) { in parse_type_qualifier()
2220 sym = get_sym(); in parse_type_qualifier()
2223 yy_error_sym("unexpected", sym); in parse_type_qualifier()
2225 return sym; in parse_type_qualifier()
2228 static int parse_type_specifier(int sym, zend_ffi_dcl *dcl) { in parse_type_specifier() argument
2231 switch (sym) { in parse_type_specifier()
2233 if (dcl->flags & ZEND_FFI_DCL_TYPE_SPECIFIERS) yy_error_sym("unexpected", sym); in parse_type_specifier()
2234 sym = get_sym(); in parse_type_specifier()
2238 …_DCL_TYPE_SPECIFIERS-(ZEND_FFI_DCL_SIGNED|ZEND_FFI_DCL_UNSIGNED))) yy_error_sym("unexpected", sym); in parse_type_specifier()
2239 sym = get_sym(); in parse_type_specifier()
2243 …ERS-(ZEND_FFI_DCL_SIGNED|ZEND_FFI_DCL_UNSIGNED|ZEND_FFI_DCL_INT))) yy_error_sym("unexpected", sym); in parse_type_specifier()
2244 sym = get_sym(); in parse_type_specifier()
2248 …NED|ZEND_FFI_DCL_SHORT|ZEND_FFI_DCL_LONG|ZEND_FFI_DCL_LONG_LONG))) yy_error_sym("unexpected", sym); in parse_type_specifier()
2249 sym = get_sym(); in parse_type_specifier()
2254 …LONG|ZEND_FFI_DCL_SIGNED|ZEND_FFI_DCL_UNSIGNED|ZEND_FFI_DCL_INT))) yy_error_sym("unexpected", sym); in parse_type_specifier()
2257 …IGNED|ZEND_FFI_DCL_INT|ZEND_FFI_DCL_DOUBLE|ZEND_FFI_DCL_COMPLEX))) yy_error_sym("unexpected", sym); in parse_type_specifier()
2260 sym = get_sym(); in parse_type_specifier()
2263 …cl->flags & (ZEND_FFI_DCL_TYPE_SPECIFIERS-(ZEND_FFI_DCL_COMPLEX))) yy_error_sym("unexpected", sym); in parse_type_specifier()
2264 sym = get_sym(); in parse_type_specifier()
2268 …FFI_DCL_TYPE_SPECIFIERS-(ZEND_FFI_DCL_LONG|ZEND_FFI_DCL_COMPLEX))) yy_error_sym("unexpected", sym); in parse_type_specifier()
2269 sym = get_sym(); in parse_type_specifier()
2273 …SHORT|ZEND_FFI_DCL_LONG|ZEND_FFI_DCL_LONG_LONG|ZEND_FFI_DCL_INT))) yy_error_sym("unexpected", sym); in parse_type_specifier()
2274 sym = get_sym(); in parse_type_specifier()
2278 …SHORT|ZEND_FFI_DCL_LONG|ZEND_FFI_DCL_LONG_LONG|ZEND_FFI_DCL_INT))) yy_error_sym("unexpected", sym); in parse_type_specifier()
2279 sym = get_sym(); in parse_type_specifier()
2283 if (dcl->flags & ZEND_FFI_DCL_TYPE_SPECIFIERS) yy_error_sym("unexpected", sym); in parse_type_specifier()
2284 sym = get_sym(); in parse_type_specifier()
2291 …FIERS-(ZEND_FFI_DCL_FLOAT|ZEND_FFI_DCL_DOUBLE|ZEND_FFI_DCL_LONG))) yy_error_sym("unexpected", sym); in parse_type_specifier()
2292 sym = get_sym(); in parse_type_specifier()
2297 if (dcl->flags & ZEND_FFI_DCL_TYPE_SPECIFIERS) yy_error_sym("unexpected", sym); in parse_type_specifier()
2298 sym = parse_struct_or_union_specifier(sym, dcl); in parse_type_specifier()
2301 if (dcl->flags & ZEND_FFI_DCL_TYPE_SPECIFIERS) yy_error_sym("unexpected", sym); in parse_type_specifier()
2302 sym = parse_enum_specifier(sym, dcl); in parse_type_specifier()
2305 if (dcl->flags & ZEND_FFI_DCL_TYPE_SPECIFIERS) yy_error_sym("unexpected", sym); in parse_type_specifier()
2307 sym = parse_ID(sym, &name, &name_len); in parse_type_specifier()
2312 yy_error_sym("unexpected", sym); in parse_type_specifier()
2314 return sym; in parse_type_specifier()
2317 static int parse_struct_or_union_specifier(int sym, zend_ffi_dcl *dcl) { in parse_struct_or_union_specifier() argument
2318 if (sym == YY_STRUCT) { in parse_struct_or_union_specifier()
2319 sym = get_sym(); in parse_struct_or_union_specifier()
2321 } else if (sym == YY_UNION) { in parse_struct_or_union_specifier()
2322 sym = get_sym(); in parse_struct_or_union_specifier()
2325 yy_error_sym("unexpected", sym); in parse_struct_or_union_specifier()
2327 …if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FAS… in parse_struct_or_union_specifier()
2328 sym = parse_attributes(sym, dcl); in parse_struct_or_union_specifier()
2330 if (sym == YY_ID) { in parse_struct_or_union_specifier()
2333 sym = parse_ID(sym, &name, &name_len); in parse_struct_or_union_specifier()
2335 if (sym == YY__LBRACE) { in parse_struct_or_union_specifier()
2336 sym = parse_struct_contents(sym, dcl); in parse_struct_or_union_specifier()
2339 } else if (sym == YY__LBRACE) { in parse_struct_or_union_specifier()
2341 sym = parse_struct_contents(sym, dcl); in parse_struct_or_union_specifier()
2343 yy_error_sym("unexpected", sym); in parse_struct_or_union_specifier()
2345 return sym; in parse_struct_or_union_specifier()
2348 static int parse_struct_contents(int sym, zend_ffi_dcl *dcl) { in parse_struct_contents() argument
2354 if (sym != YY__LBRACE) { in parse_struct_contents()
2355 yy_error_sym("'{' expected, got", sym); in parse_struct_contents()
2357 sym = get_sym(); in parse_struct_contents()
2358 …if (YY_IN_SET(sym, (YY___EXTENSION__,YY_VOID,YY_CHAR,YY_SHORT,YY_INT,YY_LONG,YY_FLOAT,YY_DOUBLE,YY… in parse_struct_contents()
2359 sym = parse_struct_declaration(sym, dcl); in parse_struct_contents()
2365 sym2 = sym; in parse_struct_contents()
2392 sym = get_sym(); in parse_struct_contents()
2393 sym = parse_struct_declaration(sym, dcl); in parse_struct_contents()
2396 sym = get_sym(); in parse_struct_contents()
2399 if (sym != YY__RBRACE) { in parse_struct_contents()
2400 yy_error_sym("'}' expected, got", sym); in parse_struct_contents()
2402 sym = get_sym(); in parse_struct_contents()
2403 …if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FAS… in parse_struct_contents()
2404 sym = parse_attributes(sym, dcl); in parse_struct_contents()
2407 return sym; in parse_struct_contents()
2410 static int parse_struct_declaration(int sym, zend_ffi_dcl *struct_dcl) { in parse_struct_declaration() argument
2412 sym = parse_specifier_qualifier_list(sym, &common_field_dcl); in parse_struct_declaration()
2413 if (sym == YY__SEMICOLON || sym == YY__RBRACE) { in parse_struct_declaration()
2415 } else if (sym == YY__STAR || sym == YY_ID || sym == YY__LPAREN || sym == YY__COLON) { in parse_struct_declaration()
2416 sym = parse_struct_declarator(sym, struct_dcl, &common_field_dcl); in parse_struct_declaration()
2417 while (sym == YY__COMMA) { in parse_struct_declaration()
2418 sym = get_sym(); in parse_struct_declaration()
2420 …if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FAS… in parse_struct_declaration()
2421 sym = parse_attributes(sym, &field_dcl); in parse_struct_declaration()
2423 sym = parse_struct_declarator(sym, struct_dcl, &field_dcl); in parse_struct_declaration()
2426 yy_error_sym("unexpected", sym); in parse_struct_declaration()
2428 return sym; in parse_struct_declaration()
2431 static int parse_struct_declarator(int sym, zend_ffi_dcl *struct_dcl, zend_ffi_dcl *field_dcl) { in parse_struct_declarator() argument
2435 if (sym == YY__STAR || sym == YY_ID || sym == YY__LPAREN) { in parse_struct_declarator()
2436 sym = parse_declarator(sym, field_dcl, &name, &name_len); in parse_struct_declarator()
2437 if (sym == YY__COLON) { in parse_struct_declarator()
2438 sym = get_sym(); in parse_struct_declarator()
2439 sym = parse_constant_expression(sym, &bits); in parse_struct_declarator()
2440 …if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FAS… in parse_struct_declarator()
2441 sym = parse_attributes(sym, field_dcl); in parse_struct_declarator()
2444 …} else if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,Y… in parse_struct_declarator()
2445 …if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FAS… in parse_struct_declarator()
2446 sym = parse_attributes(sym, field_dcl); in parse_struct_declarator()
2450 yy_error_sym("unexpected", sym); in parse_struct_declarator()
2452 } else if (sym == YY__COLON) { in parse_struct_declarator()
2453 sym = get_sym(); in parse_struct_declarator()
2454 sym = parse_constant_expression(sym, &bits); in parse_struct_declarator()
2457 yy_error_sym("unexpected", sym); in parse_struct_declarator()
2459 return sym; in parse_struct_declarator()
2462 static int parse_enum_specifier(int sym, zend_ffi_dcl *dcl) { in parse_enum_specifier() argument
2463 if (sym != YY_ENUM) { in parse_enum_specifier()
2464 yy_error_sym("'enum' expected, got", sym); in parse_enum_specifier()
2466 sym = get_sym(); in parse_enum_specifier()
2468 …if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FAS… in parse_enum_specifier()
2469 sym = parse_attributes(sym, dcl); in parse_enum_specifier()
2471 if (sym == YY_ID) { in parse_enum_specifier()
2474 sym = parse_ID(sym, &name, &name_len); in parse_enum_specifier()
2475 if (sym == YY__LBRACE) { in parse_enum_specifier()
2477 sym = get_sym(); in parse_enum_specifier()
2478 sym = parse_enumerator_list(sym, dcl); in parse_enum_specifier()
2479 if (sym != YY__RBRACE) { in parse_enum_specifier()
2480 yy_error_sym("'}' expected, got", sym); in parse_enum_specifier()
2482 sym = get_sym(); in parse_enum_specifier()
2483 …if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FAS… in parse_enum_specifier()
2484 sym = parse_attributes(sym, dcl); in parse_enum_specifier()
2486 …} else if (YY_IN_SET(sym, (YY_TYPEDEF,YY_EXTERN,YY_STATIC,YY_AUTO,YY_REGISTER,YY_INLINE,YY___INLIN… in parse_enum_specifier()
2489 yy_error_sym("unexpected", sym); in parse_enum_specifier()
2491 } else if (sym == YY__LBRACE) { in parse_enum_specifier()
2492 sym = get_sym(); in parse_enum_specifier()
2494 sym = parse_enumerator_list(sym, dcl); in parse_enum_specifier()
2495 if (sym != YY__RBRACE) { in parse_enum_specifier()
2496 yy_error_sym("'}' expected, got", sym); in parse_enum_specifier()
2498 sym = get_sym(); in parse_enum_specifier()
2499 …if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FAS… in parse_enum_specifier()
2500 sym = parse_attributes(sym, dcl); in parse_enum_specifier()
2503 yy_error_sym("unexpected", sym); in parse_enum_specifier()
2505 return sym; in parse_enum_specifier()
2508 static int parse_enumerator_list(int sym, zend_ffi_dcl *enum_dcl) { in parse_enumerator_list() argument
2515 sym = parse_enumerator(sym, enum_dcl, &min, &max, &last); in parse_enumerator_list()
2521 sym2 = sym; in parse_enumerator_list()
2548 sym = get_sym(); in parse_enumerator_list()
2549 sym = parse_enumerator(sym, enum_dcl, &min, &max, &last); in parse_enumerator_list()
2552 sym = get_sym(); in parse_enumerator_list()
2554 return sym; in parse_enumerator_list()
2557 static int parse_enumerator(int sym, zend_ffi_dcl *enum_dcl, int64_t *min, int64_t *max, int64_t *l… in parse_enumerator() argument
2561 sym = parse_ID(sym, &name, &name_len); in parse_enumerator()
2562 if (sym == YY__EQUAL) { in parse_enumerator()
2563 sym = get_sym(); in parse_enumerator()
2564 sym = parse_constant_expression(sym, &val); in parse_enumerator()
2567 return sym; in parse_enumerator()
2570 static int parse_declarator(int sym, zend_ffi_dcl *dcl, const char **name, size_t *name_len) { in parse_declarator() argument
2573 if (sym == YY__STAR) { in parse_declarator()
2574 sym = parse_pointer(sym, dcl); in parse_declarator()
2576 if (sym == YY_ID) { in parse_declarator()
2577 sym = parse_ID(sym, name, name_len); in parse_declarator()
2578 } else if (sym == YY__LPAREN) { in parse_declarator()
2579 sym = get_sym(); in parse_declarator()
2580 …if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FAS… in parse_declarator()
2581 sym = parse_attributes(sym, &nested_dcl); in parse_declarator()
2583 sym = parse_declarator(sym, &nested_dcl, name, name_len); in parse_declarator()
2584 if (sym != YY__RPAREN) { in parse_declarator()
2585 yy_error_sym("')' expected, got", sym); in parse_declarator()
2587 sym = get_sym(); in parse_declarator()
2590 yy_error_sym("unexpected", sym); in parse_declarator()
2592 if (sym == YY__LBRACK || sym == YY__LPAREN) { in parse_declarator()
2593 sym = parse_array_or_function_declarators(sym, dcl, &nested_dcl); in parse_declarator()
2596 return sym; in parse_declarator()
2599 static int parse_abstract_declarator(int sym, zend_ffi_dcl *dcl) { in parse_abstract_declarator() argument
2602 if (sym == YY__STAR) { in parse_abstract_declarator()
2603 sym = parse_pointer(sym, dcl); in parse_abstract_declarator()
2605 if ((sym == YY__LPAREN) && synpred_2(sym)) { in parse_abstract_declarator()
2606 sym = get_sym(); in parse_abstract_declarator()
2607 …if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FAS… in parse_abstract_declarator()
2608 sym = parse_attributes(sym, &nested_dcl); in parse_abstract_declarator()
2610 sym = parse_abstract_declarator(sym, &nested_dcl); in parse_abstract_declarator()
2611 if (sym != YY__RPAREN) { in parse_abstract_declarator()
2612 yy_error_sym("')' expected, got", sym); in parse_abstract_declarator()
2614 sym = get_sym(); in parse_abstract_declarator()
2617 if (sym == YY__LBRACK || sym == YY__LPAREN) { in parse_abstract_declarator()
2618 sym = parse_array_or_function_declarators(sym, dcl, &nested_dcl); in parse_abstract_declarator()
2621 return sym; in parse_abstract_declarator()
2624 static int parse_parameter_declarator(int sym, zend_ffi_dcl *dcl, const char **name, size_t *name_l… in parse_parameter_declarator() argument
2627 if (sym == YY__STAR) { in parse_parameter_declarator()
2628 sym = parse_pointer(sym, dcl); in parse_parameter_declarator()
2630 if ((sym == YY__LPAREN) && synpred_3(sym)) { in parse_parameter_declarator()
2631 sym = get_sym(); in parse_parameter_declarator()
2632 …if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FAS… in parse_parameter_declarator()
2633 sym = parse_attributes(sym, &nested_dcl); in parse_parameter_declarator()
2635 sym = parse_parameter_declarator(sym, &nested_dcl, name, name_len); in parse_parameter_declarator()
2636 if (sym != YY__RPAREN) { in parse_parameter_declarator()
2637 yy_error_sym("')' expected, got", sym); in parse_parameter_declarator()
2639 sym = get_sym(); in parse_parameter_declarator()
2641 } else if (sym == YY_ID) { in parse_parameter_declarator()
2642 sym = parse_ID(sym, name, name_len); in parse_parameter_declarator()
2643 } else if (sym == YY__LBRACK || sym == YY__LPAREN || sym == YY__RPAREN || sym == YY__COMMA) { in parse_parameter_declarator()
2645 yy_error_sym("unexpected", sym); in parse_parameter_declarator()
2647 if (sym == YY__LBRACK || sym == YY__LPAREN) { in parse_parameter_declarator()
2648 sym = parse_array_or_function_declarators(sym, dcl, &nested_dcl); in parse_parameter_declarator()
2651 return sym; in parse_parameter_declarator()
2654 static int parse_pointer(int sym, zend_ffi_dcl *dcl) { in parse_pointer() argument
2655 if (sym != YY__STAR) { in parse_pointer()
2656 yy_error_sym("'*' expected, got", sym); in parse_pointer()
2659 sym = get_sym(); in parse_pointer()
2661 …if (YY_IN_SET(sym, (YY_CONST,YY___CONST,YY___CONST__,YY_RESTRICT,YY___RESTRICT,YY___RESTRICT__,YY_… in parse_pointer()
2662 sym = parse_type_qualifier_list(sym, dcl); in parse_pointer()
2664 } while (sym == YY__STAR); in parse_pointer()
2665 return sym; in parse_pointer()
2668 static int parse_array_or_function_declarators(int sym, zend_ffi_dcl *dcl, zend_ffi_dcl *nested_dcl… in parse_array_or_function_declarators() argument
2680 if (sym == YY__LBRACK) { in parse_array_or_function_declarators()
2681 sym = get_sym(); in parse_array_or_function_declarators()
2686 sym2 = sym; in parse_array_or_function_declarators()
2720 sym = get_sym(); in parse_array_or_function_declarators()
2721 …if (YY_IN_SET(sym, (YY_CONST,YY___CONST,YY___CONST__,YY_RESTRICT,YY___RESTRICT,YY___RESTRICT__,YY_… in parse_array_or_function_declarators()
2722 sym = parse_type_qualifier_list(sym, &dummy); in parse_array_or_function_declarators()
2724 sym = parse_assignment_expression(sym, &len); in parse_array_or_function_declarators()
2726 sym = parse_type_qualifier_list(sym, &dummy); in parse_array_or_function_declarators()
2731 sym2 = sym; in parse_array_or_function_declarators()
2762 sym = get_sym(); in parse_array_or_function_declarators()
2763 sym = parse_assignment_expression(sym, &len); in parse_array_or_function_declarators()
2767 sym = get_sym(); in parse_array_or_function_declarators()
2770 sym = parse_assignment_expression(sym, &len); in parse_array_or_function_declarators()
2772 yy_error_sym("unexpected", sym); in parse_array_or_function_declarators()
2778 sym = get_sym(); in parse_array_or_function_declarators()
2781 sym = parse_assignment_expression(sym, &len); in parse_array_or_function_declarators()
2784 yy_error_sym("unexpected", sym); in parse_array_or_function_declarators()
2786 if (sym != YY__RBRACK) { in parse_array_or_function_declarators()
2787 yy_error_sym("']' expected, got", sym); in parse_array_or_function_declarators()
2789 sym = get_sym(); in parse_array_or_function_declarators()
2790 if (sym == YY__LBRACK || sym == YY__LPAREN) { in parse_array_or_function_declarators()
2791 sym = parse_array_or_function_declarators(sym, dcl, nested_dcl); in parse_array_or_function_declarators()
2795 } else if (sym == YY__LPAREN) { in parse_array_or_function_declarators()
2796 sym = get_sym(); in parse_array_or_function_declarators()
2797 …if (YY_IN_SET(sym, (YY___EXTENSION__,YY_VOID,YY_CHAR,YY_SHORT,YY_INT,YY_LONG,YY_FLOAT,YY_DOUBLE,YY… in parse_array_or_function_declarators()
2798 …if (YY_IN_SET(sym, (YY___EXTENSION__,YY_VOID,YY_CHAR,YY_SHORT,YY_INT,YY_LONG,YY_FLOAT,YY_DOUBLE,YY… in parse_array_or_function_declarators()
2799 sym = parse_parameter_declaration(sym, &args); in parse_array_or_function_declarators()
2805 sym2 = sym; in parse_array_or_function_declarators()
2832 sym = get_sym(); in parse_array_or_function_declarators()
2833 sym = parse_parameter_declaration(sym, &args); in parse_array_or_function_declarators()
2836 sym = get_sym(); in parse_array_or_function_declarators()
2837 if (sym != YY__POINT_POINT_POINT) { in parse_array_or_function_declarators()
2838 yy_error_sym("'...' expected, got", sym); in parse_array_or_function_declarators()
2840 sym = get_sym(); in parse_array_or_function_declarators()
2844 sym = get_sym(); in parse_array_or_function_declarators()
2848 if (sym != YY__RPAREN) { in parse_array_or_function_declarators()
2849 yy_error_sym("')' expected, got", sym); in parse_array_or_function_declarators()
2851 sym = get_sym(); in parse_array_or_function_declarators()
2852 if (sym == YY__LBRACK || sym == YY__LPAREN) { in parse_array_or_function_declarators()
2853 sym = parse_array_or_function_declarators(sym, dcl, nested_dcl); in parse_array_or_function_declarators()
2858 yy_error_sym("unexpected", sym); in parse_array_or_function_declarators()
2860 return sym; in parse_array_or_function_declarators()
2863 static int parse_parameter_declaration(int sym, HashTable **args) { in parse_parameter_declaration() argument
2869 sym = parse_specifier_qualifier_list(sym, ¶m_dcl); in parse_parameter_declaration()
2870 sym = parse_parameter_declarator(sym, ¶m_dcl, &name, &name_len); in parse_parameter_declaration()
2873 return sym; in parse_parameter_declaration()
2876 static int parse_type_name(int sym, zend_ffi_dcl *dcl) { in parse_type_name() argument
2877 sym = parse_specifier_qualifier_list(sym, dcl); in parse_type_name()
2878 sym = parse_abstract_declarator(sym, dcl); in parse_type_name()
2879 return sym; in parse_type_name()
2882 static int parse_attributes(int sym, zend_ffi_dcl *dcl) { in parse_attributes() argument
2887 switch (sym) { in parse_attributes()
2890 sym = get_sym(); in parse_attributes()
2891 if (sym != YY__LPAREN) { in parse_attributes()
2892 yy_error_sym("'(' expected, got", sym); in parse_attributes()
2894 sym = get_sym(); in parse_attributes()
2895 if (sym != YY__LPAREN) { in parse_attributes()
2896 yy_error_sym("'(' expected, got", sym); in parse_attributes()
2898 sym = get_sym(); in parse_attributes()
2899 sym = parse_attrib(sym, dcl); in parse_attributes()
2900 while (sym == YY__COMMA) { in parse_attributes()
2901 sym = get_sym(); in parse_attributes()
2902 sym = parse_attrib(sym, dcl); in parse_attributes()
2904 if (sym != YY__RPAREN) { in parse_attributes()
2905 yy_error_sym("')' expected, got", sym); in parse_attributes()
2907 sym = get_sym(); in parse_attributes()
2908 if (sym != YY__RPAREN) { in parse_attributes()
2909 yy_error_sym("')' expected, got", sym); in parse_attributes()
2911 sym = get_sym(); in parse_attributes()
2914 sym = get_sym(); in parse_attributes()
2915 if (sym != YY__LPAREN) { in parse_attributes()
2916 yy_error_sym("'(' expected, got", sym); in parse_attributes()
2918 sym = get_sym(); in parse_attributes()
2920 sym = parse_ID(sym, &name, &name_len); in parse_attributes()
2921 if (sym == YY__LPAREN) { in parse_attributes()
2922 sym = get_sym(); in parse_attributes()
2923 sym = parse_assignment_expression(sym, &val); in parse_attributes()
2925 if (sym != YY__RPAREN) { in parse_attributes()
2926 yy_error_sym("')' expected, got", sym); in parse_attributes()
2928 sym = get_sym(); in parse_attributes()
2930 } while (sym == YY_ID); in parse_attributes()
2931 if (sym != YY__RPAREN) { in parse_attributes()
2932 yy_error_sym("')' expected, got", sym); in parse_attributes()
2934 sym = get_sym(); in parse_attributes()
2937 sym = get_sym(); in parse_attributes()
2941 sym = get_sym(); in parse_attributes()
2945 sym = get_sym(); in parse_attributes()
2949 sym = get_sym(); in parse_attributes()
2953 sym = get_sym(); in parse_attributes()
2957 yy_error_sym("unexpected", sym); in parse_attributes()
2959 …} while (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY_… in parse_attributes()
2960 return sym; in parse_attributes()
2963 static int parse_attrib(int sym, zend_ffi_dcl *dcl) { in parse_attrib() argument
2969 if (sym == YY_ID || sym == YY_CONST || sym == YY___CONST || sym == YY___CONST__) { in parse_attrib()
2970 if (sym == YY_ID) { in parse_attrib()
2971 sym = parse_ID(sym, &name, &name_len); in parse_attrib()
2972 if (sym == YY__COMMA || sym == YY__RPAREN) { in parse_attrib()
2974 } else if (sym == YY__LPAREN) { in parse_attrib()
2975 sym = get_sym(); in parse_attrib()
2978 sym = parse_assignment_expression(sym, &val); in parse_attrib()
2981 while (sym == YY__COMMA) { in parse_attrib()
2982 sym = get_sym(); in parse_attrib()
2983 sym = parse_assignment_expression(sym, &val); in parse_attrib()
2987 if (sym != YY__RPAREN) { in parse_attrib()
2988 yy_error_sym("')' expected, got", sym); in parse_attrib()
2990 sym = get_sym(); in parse_attrib()
2992 yy_error_sym("unexpected", sym); in parse_attrib()
2994 } else if (sym == YY_CONST) { in parse_attrib()
2995 sym = get_sym(); in parse_attrib()
2996 } else if (sym == YY___CONST) { in parse_attrib()
2997 sym = get_sym(); in parse_attrib()
2999 sym = get_sym(); in parse_attrib()
3002 return sym; in parse_attrib()
3005 static int parse_initializer(int sym) { in parse_initializer() argument
3012 if (sym != YY__EQUAL) { in parse_initializer()
3013 yy_error_sym("'=' expected, got", sym); in parse_initializer()
3015 sym = get_sym(); in parse_initializer()
3016 …if (YY_IN_SET(sym, (YY__LPAREN,YY_ID,YY_OCTNUMBER,YY_DECNUMBER,YY_HEXNUMBER,YY_FLOATNUMBER,YY_STRI… in parse_initializer()
3017 sym = parse_assignment_expression(sym, &dummy); in parse_initializer()
3018 } else if (sym == YY__LBRACE) { in parse_initializer()
3019 sym = get_sym(); in parse_initializer()
3020 if (sym == YY__LBRACK || sym == YY__POINT) { in parse_initializer()
3021 sym = parse_designation(sym); in parse_initializer()
3023 sym = parse_initializer(sym); in parse_initializer()
3029 sym2 = sym; in parse_initializer()
3056 sym = get_sym(); in parse_initializer()
3057 if (sym == YY__LBRACK || sym == YY__POINT) { in parse_initializer()
3058 sym = parse_designation(sym); in parse_initializer()
3060 sym = parse_initializer(sym); in parse_initializer()
3063 sym = get_sym(); in parse_initializer()
3065 if (sym != YY__RBRACE) { in parse_initializer()
3066 yy_error_sym("'}' expected, got", sym); in parse_initializer()
3068 sym = get_sym(); in parse_initializer()
3070 yy_error_sym("unexpected", sym); in parse_initializer()
3072 return sym; in parse_initializer()
3075 static int parse_designation(int sym) { in parse_designation() argument
3080 if (sym == YY__LBRACK) { in parse_designation()
3081 sym = get_sym(); in parse_designation()
3082 sym = parse_constant_expression(sym, &dummy); in parse_designation()
3083 if (sym != YY__RBRACK) { in parse_designation()
3084 yy_error_sym("']' expected, got", sym); in parse_designation()
3086 sym = get_sym(); in parse_designation()
3087 } else if (sym == YY__POINT) { in parse_designation()
3088 sym = get_sym(); in parse_designation()
3089 sym = parse_ID(sym, &name, &name_len); in parse_designation()
3091 yy_error_sym("unexpected", sym); in parse_designation()
3093 } while (sym == YY__LBRACK || sym == YY__POINT); in parse_designation()
3094 if (sym != YY__EQUAL) { in parse_designation()
3095 yy_error_sym("'=' expected, got", sym); in parse_designation()
3097 sym = get_sym(); in parse_designation()
3098 return sym; in parse_designation()
3101 static int parse_expr_list(int sym) { in parse_expr_list() argument
3103 sym = parse_assignment_expression(sym, &dummy); in parse_expr_list()
3104 while (sym == YY__COMMA) { in parse_expr_list()
3105 sym = get_sym(); in parse_expr_list()
3106 sym = parse_assignment_expression(sym, &dummy); in parse_expr_list()
3108 return sym; in parse_expr_list()
3111 static int parse_expression(int sym, zend_ffi_val *val) { in parse_expression() argument
3112 sym = parse_assignment_expression(sym, val); in parse_expression()
3113 while (sym == YY__COMMA) { in parse_expression()
3114 sym = get_sym(); in parse_expression()
3115 sym = parse_assignment_expression(sym, val); in parse_expression()
3117 return sym; in parse_expression()
3120 static int parse_assignment_expression(int sym, zend_ffi_val *val) { in parse_assignment_expression() argument
3121 sym = parse_conditional_expression(sym, val); in parse_assignment_expression()
3122 return sym; in parse_assignment_expression()
3125 static int parse_constant_expression(int sym, zend_ffi_val *val) { in parse_constant_expression() argument
3126 sym = parse_conditional_expression(sym, val); in parse_constant_expression()
3127 return sym; in parse_constant_expression()
3130 static int parse_conditional_expression(int sym, zend_ffi_val *val) { in parse_conditional_expression() argument
3132 sym = parse_logical_or_expression(sym, val); in parse_conditional_expression()
3133 if (sym == YY__QUERY) { in parse_conditional_expression()
3134 sym = get_sym(); in parse_conditional_expression()
3135 sym = parse_expression(sym, &op2); in parse_conditional_expression()
3136 if (sym != YY__COLON) { in parse_conditional_expression()
3137 yy_error_sym("':' expected, got", sym); in parse_conditional_expression()
3139 sym = get_sym(); in parse_conditional_expression()
3140 sym = parse_conditional_expression(sym, &op3); in parse_conditional_expression()
3143 return sym; in parse_conditional_expression()
3146 static int parse_logical_or_expression(int sym, zend_ffi_val *val) { in parse_logical_or_expression() argument
3148 sym = parse_logical_and_expression(sym, val); in parse_logical_or_expression()
3149 while (sym == YY__BAR_BAR) { in parse_logical_or_expression()
3150 sym = get_sym(); in parse_logical_or_expression()
3151 sym = parse_logical_and_expression(sym, &op2); in parse_logical_or_expression()
3154 return sym; in parse_logical_or_expression()
3157 static int parse_logical_and_expression(int sym, zend_ffi_val *val) { in parse_logical_and_expression() argument
3159 sym = parse_inclusive_or_expression(sym, val); in parse_logical_and_expression()
3160 while (sym == YY__AND_AND) { in parse_logical_and_expression()
3161 sym = get_sym(); in parse_logical_and_expression()
3162 sym = parse_inclusive_or_expression(sym, &op2); in parse_logical_and_expression()
3165 return sym; in parse_logical_and_expression()
3168 static int parse_inclusive_or_expression(int sym, zend_ffi_val *val) { in parse_inclusive_or_expression() argument
3170 sym = parse_exclusive_or_expression(sym, val); in parse_inclusive_or_expression()
3171 while (sym == YY__BAR) { in parse_inclusive_or_expression()
3172 sym = get_sym(); in parse_inclusive_or_expression()
3173 sym = parse_exclusive_or_expression(sym, &op2); in parse_inclusive_or_expression()
3176 return sym; in parse_inclusive_or_expression()
3179 static int parse_exclusive_or_expression(int sym, zend_ffi_val *val) { in parse_exclusive_or_expression() argument
3181 sym = parse_and_expression(sym, val); in parse_exclusive_or_expression()
3182 while (sym == YY__UPARROW) { in parse_exclusive_or_expression()
3183 sym = get_sym(); in parse_exclusive_or_expression()
3184 sym = parse_and_expression(sym, &op2); in parse_exclusive_or_expression()
3187 return sym; in parse_exclusive_or_expression()
3190 static int parse_and_expression(int sym, zend_ffi_val *val) { in parse_and_expression() argument
3192 sym = parse_equality_expression(sym, val); in parse_and_expression()
3193 while (sym == YY__AND) { in parse_and_expression()
3194 sym = get_sym(); in parse_and_expression()
3195 sym = parse_equality_expression(sym, &op2); in parse_and_expression()
3198 return sym; in parse_and_expression()
3201 static int parse_equality_expression(int sym, zend_ffi_val *val) { in parse_equality_expression() argument
3203 sym = parse_relational_expression(sym, val); in parse_equality_expression()
3204 while (sym == YY__EQUAL_EQUAL || sym == YY__BANG_EQUAL) { in parse_equality_expression()
3205 if (sym == YY__EQUAL_EQUAL) { in parse_equality_expression()
3206 sym = get_sym(); in parse_equality_expression()
3207 sym = parse_relational_expression(sym, &op2); in parse_equality_expression()
3210 sym = get_sym(); in parse_equality_expression()
3211 sym = parse_relational_expression(sym, &op2); in parse_equality_expression()
3215 return sym; in parse_equality_expression()
3218 static int parse_relational_expression(int sym, zend_ffi_val *val) { in parse_relational_expression() argument
3220 sym = parse_shift_expression(sym, val); in parse_relational_expression()
3221 …while (sym == YY__LESS || sym == YY__GREATER || sym == YY__LESS_EQUAL || sym == YY__GREATER_EQUAL)… in parse_relational_expression()
3222 if (sym == YY__LESS) { in parse_relational_expression()
3223 sym = get_sym(); in parse_relational_expression()
3224 sym = parse_shift_expression(sym, &op2); in parse_relational_expression()
3226 } else if (sym == YY__GREATER) { in parse_relational_expression()
3227 sym = get_sym(); in parse_relational_expression()
3228 sym = parse_shift_expression(sym, &op2); in parse_relational_expression()
3230 } else if (sym == YY__LESS_EQUAL) { in parse_relational_expression()
3231 sym = get_sym(); in parse_relational_expression()
3232 sym = parse_shift_expression(sym, &op2); in parse_relational_expression()
3235 sym = get_sym(); in parse_relational_expression()
3236 sym = parse_shift_expression(sym, &op2); in parse_relational_expression()
3240 return sym; in parse_relational_expression()
3243 static int parse_shift_expression(int sym, zend_ffi_val *val) { in parse_shift_expression() argument
3245 sym = parse_additive_expression(sym, val); in parse_shift_expression()
3246 while (sym == YY__LESS_LESS || sym == YY__GREATER_GREATER) { in parse_shift_expression()
3247 if (sym == YY__LESS_LESS) { in parse_shift_expression()
3248 sym = get_sym(); in parse_shift_expression()
3249 sym = parse_additive_expression(sym, &op2); in parse_shift_expression()
3252 sym = get_sym(); in parse_shift_expression()
3253 sym = parse_additive_expression(sym, &op2); in parse_shift_expression()
3257 return sym; in parse_shift_expression()
3260 static int parse_additive_expression(int sym, zend_ffi_val *val) { in parse_additive_expression() argument
3262 sym = parse_multiplicative_expression(sym, val); in parse_additive_expression()
3263 while (sym == YY__PLUS || sym == YY__MINUS) { in parse_additive_expression()
3264 if (sym == YY__PLUS) { in parse_additive_expression()
3265 sym = get_sym(); in parse_additive_expression()
3266 sym = parse_multiplicative_expression(sym, &op2); in parse_additive_expression()
3269 sym = get_sym(); in parse_additive_expression()
3270 sym = parse_multiplicative_expression(sym, &op2); in parse_additive_expression()
3274 return sym; in parse_additive_expression()
3277 static int parse_multiplicative_expression(int sym, zend_ffi_val *val) { in parse_multiplicative_expression() argument
3279 sym = parse_cast_expression(sym, val); in parse_multiplicative_expression()
3280 while (sym == YY__STAR || sym == YY__SLASH || sym == YY__PERCENT) { in parse_multiplicative_expression()
3281 if (sym == YY__STAR) { in parse_multiplicative_expression()
3282 sym = get_sym(); in parse_multiplicative_expression()
3283 sym = parse_cast_expression(sym, &op2); in parse_multiplicative_expression()
3285 } else if (sym == YY__SLASH) { in parse_multiplicative_expression()
3286 sym = get_sym(); in parse_multiplicative_expression()
3287 sym = parse_cast_expression(sym, &op2); in parse_multiplicative_expression()
3290 sym = get_sym(); in parse_multiplicative_expression()
3291 sym = parse_cast_expression(sym, &op2); in parse_multiplicative_expression()
3295 return sym; in parse_multiplicative_expression()
3298 static int parse_cast_expression(int sym, zend_ffi_val *val) { in parse_cast_expression() argument
3301 if ((sym == YY__LPAREN) && synpred_4(sym)) { in parse_cast_expression()
3302 sym = get_sym(); in parse_cast_expression()
3303 sym = parse_type_name(sym, &dcl); in parse_cast_expression()
3304 if (sym != YY__RPAREN) { in parse_cast_expression()
3305 yy_error_sym("')' expected, got", sym); in parse_cast_expression()
3307 sym = get_sym(); in parse_cast_expression()
3310 sym = parse_unary_expression(sym, val); in parse_cast_expression()
3312 return sym; in parse_cast_expression()
3315 static int parse_unary_expression(int sym, zend_ffi_val *val) { in parse_unary_expression() argument
3319 switch (sym) { in parse_unary_expression()
3321 sym = parse_ID(sym, &name, &name_len); in parse_unary_expression()
3323 …while (YY_IN_SET(sym, (YY__LBRACK,YY__LPAREN,YY__POINT,YY__MINUS_GREATER,YY__PLUS_PLUS,YY__MINUS_M… in parse_unary_expression()
3324 switch (sym) { in parse_unary_expression()
3326 sym = get_sym(); in parse_unary_expression()
3327 sym = parse_expr_list(sym); in parse_unary_expression()
3328 if (sym != YY__RBRACK) { in parse_unary_expression()
3329 yy_error_sym("']' expected, got", sym); in parse_unary_expression()
3331 sym = get_sym(); in parse_unary_expression()
3334 sym = get_sym(); in parse_unary_expression()
3335 …if (YY_IN_SET(sym, (YY__LPAREN,YY_ID,YY_OCTNUMBER,YY_DECNUMBER,YY_HEXNUMBER,YY_FLOATNUMBER,YY_STRI… in parse_unary_expression()
3336 sym = parse_expr_list(sym); in parse_unary_expression()
3338 if (sym != YY__RPAREN) { in parse_unary_expression()
3339 yy_error_sym("')' expected, got", sym); in parse_unary_expression()
3341 sym = get_sym(); in parse_unary_expression()
3344 sym = get_sym(); in parse_unary_expression()
3345 sym = parse_ID(sym, &name, &name_len); in parse_unary_expression()
3348 sym = get_sym(); in parse_unary_expression()
3349 sym = parse_ID(sym, &name, &name_len); in parse_unary_expression()
3352 sym = get_sym(); in parse_unary_expression()
3355 sym = get_sym(); in parse_unary_expression()
3362 sym = parse_OCTNUMBER(sym, val); in parse_unary_expression()
3365 sym = parse_DECNUMBER(sym, val); in parse_unary_expression()
3368 sym = parse_HEXNUMBER(sym, val); in parse_unary_expression()
3371 sym = parse_FLOATNUMBER(sym, val); in parse_unary_expression()
3374 sym = parse_STRING(sym, val); in parse_unary_expression()
3377 sym = parse_CHARACTER(sym, val); in parse_unary_expression()
3380 sym = get_sym(); in parse_unary_expression()
3381 sym = parse_expression(sym, val); in parse_unary_expression()
3382 if (sym != YY__RPAREN) { in parse_unary_expression()
3383 yy_error_sym("')' expected, got", sym); in parse_unary_expression()
3385 sym = get_sym(); in parse_unary_expression()
3388 sym = get_sym(); in parse_unary_expression()
3389 sym = parse_unary_expression(sym, val); in parse_unary_expression()
3393 sym = get_sym(); in parse_unary_expression()
3394 sym = parse_unary_expression(sym, val); in parse_unary_expression()
3398 sym = get_sym(); in parse_unary_expression()
3399 sym = parse_cast_expression(sym, val); in parse_unary_expression()
3403 sym = get_sym(); in parse_unary_expression()
3404 sym = parse_cast_expression(sym, val); in parse_unary_expression()
3408 sym = get_sym(); in parse_unary_expression()
3409 sym = parse_cast_expression(sym, val); in parse_unary_expression()
3413 sym = get_sym(); in parse_unary_expression()
3414 sym = parse_cast_expression(sym, val); in parse_unary_expression()
3418 sym = get_sym(); in parse_unary_expression()
3419 sym = parse_cast_expression(sym, val); in parse_unary_expression()
3423 sym = get_sym(); in parse_unary_expression()
3424 sym = parse_cast_expression(sym, val); in parse_unary_expression()
3428 sym = get_sym(); in parse_unary_expression()
3429 if ((sym == YY__LPAREN) && synpred_5(sym)) { in parse_unary_expression()
3430 sym = get_sym(); in parse_unary_expression()
3431 sym = parse_type_name(sym, &dcl); in parse_unary_expression()
3432 if (sym != YY__RPAREN) { in parse_unary_expression()
3433 yy_error_sym("')' expected, got", sym); in parse_unary_expression()
3435 sym = get_sym(); in parse_unary_expression()
3437 …} else if (YY_IN_SET(sym, (YY_ID,YY_OCTNUMBER,YY_DECNUMBER,YY_HEXNUMBER,YY_FLOATNUMBER,YY_STRING,Y… in parse_unary_expression()
3438 sym = parse_unary_expression(sym, val); in parse_unary_expression()
3441 yy_error_sym("unexpected", sym); in parse_unary_expression()
3445 sym = get_sym(); in parse_unary_expression()
3446 if (sym != YY__LPAREN) { in parse_unary_expression()
3447 yy_error_sym("'(' expected, got", sym); in parse_unary_expression()
3449 sym = get_sym(); in parse_unary_expression()
3450 sym = parse_type_name(sym, &dcl); in parse_unary_expression()
3451 if (sym != YY__RPAREN) { in parse_unary_expression()
3452 yy_error_sym("')' expected, got", sym); in parse_unary_expression()
3454 sym = get_sym(); in parse_unary_expression()
3459 sym = get_sym(); in parse_unary_expression()
3460 if ((sym == YY__LPAREN) && synpred_6(sym)) { in parse_unary_expression()
3461 sym = get_sym(); in parse_unary_expression()
3462 sym = parse_type_name(sym, &dcl); in parse_unary_expression()
3463 if (sym != YY__RPAREN) { in parse_unary_expression()
3464 yy_error_sym("')' expected, got", sym); in parse_unary_expression()
3466 sym = get_sym(); in parse_unary_expression()
3468 …} else if (YY_IN_SET(sym, (YY_ID,YY_OCTNUMBER,YY_DECNUMBER,YY_HEXNUMBER,YY_FLOATNUMBER,YY_STRING,Y… in parse_unary_expression()
3469 sym = parse_unary_expression(sym, val); in parse_unary_expression()
3472 yy_error_sym("unexpected", sym); in parse_unary_expression()
3476 yy_error_sym("unexpected", sym); in parse_unary_expression()
3478 return sym; in parse_unary_expression()
3481 static int parse_ID(int sym, const char **name, size_t *name_len) { in parse_ID() argument
3482 if (sym != YY_ID) { in parse_ID()
3483 yy_error_sym("<ID> expected, got", sym); in parse_ID()
3486 sym = get_sym(); in parse_ID()
3487 return sym; in parse_ID()
3490 static int parse_OCTNUMBER(int sym, zend_ffi_val *val) { in parse_OCTNUMBER() argument
3491 if (sym != YY_OCTNUMBER) { in parse_OCTNUMBER()
3492 yy_error_sym("<OCTNUMBER> expected, got", sym); in parse_OCTNUMBER()
3495 sym = get_sym(); in parse_OCTNUMBER()
3496 return sym; in parse_OCTNUMBER()
3499 static int parse_DECNUMBER(int sym, zend_ffi_val *val) { in parse_DECNUMBER() argument
3500 if (sym != YY_DECNUMBER) { in parse_DECNUMBER()
3501 yy_error_sym("<DECNUMBER> expected, got", sym); in parse_DECNUMBER()
3504 sym = get_sym(); in parse_DECNUMBER()
3505 return sym; in parse_DECNUMBER()
3508 static int parse_HEXNUMBER(int sym, zend_ffi_val *val) { in parse_HEXNUMBER() argument
3509 if (sym != YY_HEXNUMBER) { in parse_HEXNUMBER()
3510 yy_error_sym("<HEXNUMBER> expected, got", sym); in parse_HEXNUMBER()
3513 sym = get_sym(); in parse_HEXNUMBER()
3514 return sym; in parse_HEXNUMBER()
3517 static int parse_FLOATNUMBER(int sym, zend_ffi_val *val) { in parse_FLOATNUMBER() argument
3518 if (sym != YY_FLOATNUMBER) { in parse_FLOATNUMBER()
3519 yy_error_sym("<FLOATNUMBER> expected, got", sym); in parse_FLOATNUMBER()
3522 sym = get_sym(); in parse_FLOATNUMBER()
3523 return sym; in parse_FLOATNUMBER()
3526 static int parse_STRING(int sym, zend_ffi_val *val) { in parse_STRING() argument
3527 if (sym != YY_STRING) { in parse_STRING()
3528 yy_error_sym("<STRING> expected, got", sym); in parse_STRING()
3531 sym = get_sym(); in parse_STRING()
3532 return sym; in parse_STRING()
3535 static int parse_CHARACTER(int sym, zend_ffi_val *val) { in parse_CHARACTER() argument
3536 if (sym != YY_CHARACTER) { in parse_CHARACTER()
3537 yy_error_sym("<CHARACTER> expected, got", sym); in parse_CHARACTER()
3540 sym = get_sym(); in parse_CHARACTER()
3541 return sym; in parse_CHARACTER()
3545 int sym; in parse() local
3549 sym = parse_declarations(get_sym()); in parse()
3550 if (sym != YY_EOF) { in parse()
3551 yy_error_sym("<EOF> expected, got", sym); in parse()
3569 int sym; in zend_ffi_parse_type() local
3577 sym = parse_type_name(get_sym(), dcl); in zend_ffi_parse_type()
3578 if (sym != YY_EOF) { in zend_ffi_parse_type()
3579 yy_error_sym("<EOF> expected, got", sym); in zend_ffi_parse_type()
3592 static void yy_error_sym(const char *msg, int sym) { in yy_error_sym() argument
3593 zend_ffi_parser_error("%s '%s' at line %d", msg, sym_name[sym], yy_line); in yy_error_sym()