Lines Matching refs:sym

36 static void yy_error_sym(const char *msg, int sym);
247 #define YY_IN_SET(sym, set, bitset) \ argument
248 (bitset[sym>>3] & (1 << (sym & 0x7)))
307 static int skip_EOL(int sym);
308 static int skip_WS(int sym);
309 static int skip_ONE_LINE_COMMENT(int sym);
310 static int skip_COMMENT(int sym);
312 static int check_nested_declarator_start(int sym);
313 static int check_type_name_start(int sym);
314 static int check_ID(int sym);
315 static int parse_declarations(int sym);
316 static int parse_declaration_specifiers(int sym, zend_ffi_dcl *dcl);
317 static int parse_specifier_qualifier_list(int sym, zend_ffi_dcl *dcl);
318 static int parse_type_qualifier_list(int sym, zend_ffi_dcl *dcl);
319 static int parse_type_qualifier(int sym, zend_ffi_dcl *dcl);
320 static int parse_type_specifier(int sym, zend_ffi_dcl *dcl);
321 static int parse_struct_or_union_specifier(int sym, zend_ffi_dcl *dcl);
322 static int parse_struct_contents(int sym, zend_ffi_dcl *dcl);
323 static int parse_struct_declaration(int sym, zend_ffi_dcl *struct_dcl);
324 static int parse_struct_declarator(int sym, zend_ffi_dcl *struct_dcl, zend_ffi_dcl *field_dcl);
325 static int parse_enum_specifier(int sym, zend_ffi_dcl *dcl);
326 static int parse_enumerator_list(int sym, zend_ffi_dcl *enum_dcl);
327 static int parse_enumerator(int sym, zend_ffi_dcl *enum_dcl, int64_t *min, int64_t *max, int64_t *l…
328 static int parse_declarator(int sym, zend_ffi_dcl *dcl, const char **name, size_t *name_len);
329 static int parse_abstract_declarator(int sym, zend_ffi_dcl *dcl);
330 static int parse_parameter_declarator(int sym, zend_ffi_dcl *dcl, const char **name, size_t *name_l…
331 static int parse_pointer(int sym, zend_ffi_dcl *dcl);
332 static int parse_array_or_function_declarators(int sym, zend_ffi_dcl *dcl, zend_ffi_dcl *nested_dcl…
333 static int parse_parameter_declaration(int sym, HashTable **args);
334 static int parse_type_name(int sym, zend_ffi_dcl *dcl);
335 static int parse_attributes(int sym, zend_ffi_dcl *dcl);
336 static int parse_attrib(int sym, zend_ffi_dcl *dcl);
337 static int parse_initializer(int sym);
338 static int parse_designation(int sym);
339 static int parse_expr_list(int sym);
340 static int parse_expression(int sym, zend_ffi_val *val);
341 static int parse_assignment_expression(int sym, zend_ffi_val *val);
342 static int parse_constant_expression(int sym, zend_ffi_val *val);
343 static int parse_conditional_expression(int sym, zend_ffi_val *val);
344 static int parse_logical_or_expression(int sym, zend_ffi_val *val);
345 static int parse_logical_and_expression(int sym, zend_ffi_val *val);
346 static int parse_inclusive_or_expression(int sym, zend_ffi_val *val);
347 static int parse_exclusive_or_expression(int sym, zend_ffi_val *val);
348 static int parse_and_expression(int sym, zend_ffi_val *val);
349 static int parse_equality_expression(int sym, zend_ffi_val *val);
350 static int parse_relational_expression(int sym, zend_ffi_val *val);
351 static int parse_shift_expression(int sym, zend_ffi_val *val);
352 static int parse_additive_expression(int sym, zend_ffi_val *val);
353 static int parse_multiplicative_expression(int sym, zend_ffi_val *val);
354 static int parse_cast_expression(int sym, zend_ffi_val *val);
355 static int parse_unary_expression(int sym, zend_ffi_val *val);
356 static int parse_ID(int sym, const char **name, size_t *name_len);
357 static int parse_OCTNUMBER(int sym, zend_ffi_val *val);
358 static int parse_DECNUMBER(int sym, zend_ffi_val *val);
359 static int parse_HEXNUMBER(int sym, zend_ffi_val *val);
360 static int parse_FLOATNUMBER(int sym, zend_ffi_val *val);
361 static int parse_STRING(int sym, zend_ffi_val *val);
362 static int parse_CHARACTER(int sym, zend_ffi_val *val);
363 static int synpred_1(int sym);
364 static int synpred_2(int sym);
365 static int synpred_3(int sym);
366 static int synpred_4(int sym);
367 static int synpred_5(int sym);
368 static int synpred_6(int sym);
1740 static int skip_EOL(int sym) { in skip_EOL() argument
1741 if (sym != YY_EOL) { in skip_EOL()
1742 yy_error_sym("<EOL> expected, got", sym); in skip_EOL()
1744 sym = get_skip_sym(); in skip_EOL()
1745 return sym; in skip_EOL()
1748 static int skip_WS(int sym) { in skip_WS() argument
1749 if (sym != YY_WS) { in skip_WS()
1750 yy_error_sym("<WS> expected, got", sym); in skip_WS()
1752 sym = get_skip_sym(); in skip_WS()
1753 return sym; in skip_WS()
1756 static int skip_ONE_LINE_COMMENT(int sym) { in skip_ONE_LINE_COMMENT() argument
1757 if (sym != YY_ONE_LINE_COMMENT) { in skip_ONE_LINE_COMMENT()
1758 yy_error_sym("<ONE_LINE_COMMENT> expected, got", sym); in skip_ONE_LINE_COMMENT()
1760 sym = get_skip_sym(); in skip_ONE_LINE_COMMENT()
1761 return sym; in skip_ONE_LINE_COMMENT()
1764 static int skip_COMMENT(int sym) { in skip_COMMENT() argument
1765 if (sym != YY_COMMENT) { in skip_COMMENT()
1766 yy_error_sym("<COMMENT> expected, got", sym); in skip_COMMENT()
1768 sym = get_skip_sym(); in skip_COMMENT()
1769 return sym; in skip_COMMENT()
1773 int sym; in get_sym() local
1774 sym = get_skip_sym(); in get_sym()
1775 while (sym == YY_EOL || sym == YY_WS || sym == YY_ONE_LINE_COMMENT || sym == YY_COMMENT) { in get_sym()
1776 if (sym == YY_EOL) { in get_sym()
1777 sym = skip_EOL(sym); in get_sym()
1778 } else if (sym == YY_WS) { in get_sym()
1779 sym = skip_WS(sym); in get_sym()
1780 } else if (sym == YY_ONE_LINE_COMMENT) { in get_sym()
1781 sym = skip_ONE_LINE_COMMENT(sym); in get_sym()
1783 sym = skip_COMMENT(sym); in get_sym()
1786 return sym; in get_sym()
1789 static int check_nested_declarator_start(int sym) { in check_nested_declarator_start() argument
1790 if (sym != YY__LPAREN) { in check_nested_declarator_start()
1793 sym = get_sym(); in check_nested_declarator_start()
1794 if ((sym == YY_ID) && (!zend_ffi_is_typedef_name((const char*)yy_text, yy_pos - yy_text))) { in check_nested_declarator_start()
1795 sym = check_ID(sym); in check_nested_declarator_start()
1796 if (sym == -1) { in check_nested_declarator_start()
1800 switch (sym) { in check_nested_declarator_start()
1802 sym = get_sym(); in check_nested_declarator_start()
1805 sym = get_sym(); in check_nested_declarator_start()
1808 sym = get_sym(); in check_nested_declarator_start()
1811 sym = get_sym(); in check_nested_declarator_start()
1814 sym = get_sym(); in check_nested_declarator_start()
1817 sym = get_sym(); in check_nested_declarator_start()
1823 return sym; in check_nested_declarator_start()
1826 static int check_type_name_start(int sym) { in check_type_name_start() argument
1827 if ((sym == YY_ID) && (zend_ffi_is_typedef_name((const char*)yy_text, yy_pos - yy_text))) { in check_type_name_start()
1828 sym = check_ID(sym); in check_type_name_start()
1829 if (sym == -1) { in check_type_name_start()
1833 switch (sym) { in check_type_name_start()
1835 sym = get_sym(); in check_type_name_start()
1838 sym = get_sym(); in check_type_name_start()
1841 sym = get_sym(); in check_type_name_start()
1844 sym = get_sym(); in check_type_name_start()
1847 sym = get_sym(); in check_type_name_start()
1850 sym = get_sym(); in check_type_name_start()
1853 sym = get_sym(); in check_type_name_start()
1856 sym = get_sym(); in check_type_name_start()
1859 sym = get_sym(); in check_type_name_start()
1862 sym = get_sym(); in check_type_name_start()
1865 sym = get_sym(); in check_type_name_start()
1868 sym = get_sym(); in check_type_name_start()
1871 sym = get_sym(); in check_type_name_start()
1874 sym = get_sym(); in check_type_name_start()
1877 sym = get_sym(); in check_type_name_start()
1880 sym = get_sym(); in check_type_name_start()
1883 sym = get_sym(); in check_type_name_start()
1886 sym = get_sym(); in check_type_name_start()
1889 sym = get_sym(); in check_type_name_start()
1892 sym = get_sym(); in check_type_name_start()
1895 sym = get_sym(); in check_type_name_start()
1898 sym = get_sym(); in check_type_name_start()
1901 sym = get_sym(); in check_type_name_start()
1904 sym = get_sym(); in check_type_name_start()
1907 sym = get_sym(); in check_type_name_start()
1910 sym = get_sym(); in check_type_name_start()
1913 sym = get_sym(); in check_type_name_start()
1916 sym = get_sym(); in check_type_name_start()
1919 sym = get_sym(); in check_type_name_start()
1922 sym = get_sym(); in check_type_name_start()
1928 return sym; in check_type_name_start()
1931 static int check_ID(int sym) { in check_ID() argument
1932 if (sym != YY_ID) { in check_ID()
1935 sym = get_sym(); in check_ID()
1936 return sym; in check_ID()
1939 static int synpred_1(int sym) { in synpred_1() argument
1948 ret = check_type_name_start(sym) != -1; in synpred_1()
1955 static int synpred_2(int sym) { in synpred_2() argument
1964 ret = check_nested_declarator_start(sym) != -1; in synpred_2()
1971 static int synpred_3(int sym) { in synpred_3() argument
1980 ret = check_nested_declarator_start(sym) != -1; in synpred_3()
1987 static int _synpred_4(int sym) { in _synpred_4() argument
1988 if (sym != YY__LPAREN) { in _synpred_4()
1991 sym = get_sym(); in _synpred_4()
1992 sym = check_type_name_start(sym); in _synpred_4()
1993 if (sym == -1) { in _synpred_4()
1996 return sym; in _synpred_4()
1999 static int synpred_4(int sym) { in synpred_4() argument
2008 ret = _synpred_4(sym) != -1; in synpred_4()
2015 static int _synpred_5(int sym) { in _synpred_5() argument
2016 if (sym != YY__LPAREN) { in _synpred_5()
2019 sym = get_sym(); in _synpred_5()
2020 sym = check_type_name_start(sym); in _synpred_5()
2021 if (sym == -1) { in _synpred_5()
2024 return sym; in _synpred_5()
2027 static int synpred_5(int sym) { in synpred_5() argument
2036 ret = _synpred_5(sym) != -1; in synpred_5()
2043 static int _synpred_6(int sym) { in _synpred_6() argument
2044 if (sym != YY__LPAREN) { in _synpred_6()
2047 sym = get_sym(); in _synpred_6()
2048 sym = check_type_name_start(sym); in _synpred_6()
2049 if (sym == -1) { in _synpred_6()
2052 return sym; in _synpred_6()
2055 static int synpred_6(int sym) { in synpred_6() argument
2064 ret = _synpred_6(sym) != -1; in synpred_6()
2071 static int parse_declarations(int sym) { in parse_declarations() argument
2072 …while (YY_IN_SET(sym, (YY___EXTENSION__,YY_TYPEDEF,YY_EXTERN,YY_STATIC,YY_AUTO,YY_REGISTER,YY_INLI… in parse_declarations()
2074 if (sym == YY___EXTENSION__) { in parse_declarations()
2075 sym = get_sym(); in parse_declarations()
2077 sym = parse_declaration_specifiers(sym, &common_dcl); in parse_declarations()
2078 if (sym == YY__STAR || sym == YY_ID || sym == YY__LPAREN) { in parse_declarations()
2083 sym = parse_declarator(sym, &dcl, &name, &name_len); in parse_declarations()
2084 if (sym == YY___ASM__) { in parse_declarations()
2086 sym = get_sym(); in parse_declarations()
2087 if (sym != YY__LPAREN) { in parse_declarations()
2088 yy_error_sym("'(' expected, got", sym); in parse_declarations()
2090 sym = get_sym(); in parse_declarations()
2092 sym = parse_STRING(sym, &asm_str); in parse_declarations()
2093 } while (sym == YY_STRING); in parse_declarations()
2094 if (sym != YY__RPAREN) { in parse_declarations()
2095 yy_error_sym("')' expected, got", sym); in parse_declarations()
2097 sym = get_sym(); in parse_declarations()
2099 …if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FAS… in parse_declarations()
2100 sym = parse_attributes(sym, &dcl); in parse_declarations()
2102 if (sym == YY__EQUAL) { in parse_declarations()
2103 sym = parse_initializer(sym); in parse_declarations()
2106 while (sym == YY__COMMA) { in parse_declarations()
2107 sym = get_sym(); in parse_declarations()
2109 sym = parse_declarator(sym, &dcl, &name, &name_len); in parse_declarations()
2110 …if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FAS… in parse_declarations()
2111 sym = parse_attributes(sym, &dcl); in parse_declarations()
2113 if (sym == YY__EQUAL) { in parse_declarations()
2114 sym = parse_initializer(sym); in parse_declarations()
2118 } else if (sym == YY__SEMICOLON) { in parse_declarations()
2121 yy_error_sym("unexpected", sym); in parse_declarations()
2123 if (sym != YY__SEMICOLON) { in parse_declarations()
2124 yy_error_sym("';' expected, got", sym); in parse_declarations()
2126 sym = get_sym(); in parse_declarations()
2128 return sym; in parse_declarations()
2131 static int parse_declaration_specifiers(int sym, zend_ffi_dcl *dcl) { in parse_declaration_specifiers() argument
2133 switch (sym) { in parse_declaration_specifiers()
2135 if (dcl->flags & ZEND_FFI_DCL_STORAGE_CLASS) yy_error_sym("unexpected", sym); in parse_declaration_specifiers()
2136 sym = get_sym(); in parse_declaration_specifiers()
2140 if (dcl->flags & ZEND_FFI_DCL_STORAGE_CLASS) yy_error_sym("unexpected", sym); in parse_declaration_specifiers()
2141 sym = get_sym(); in parse_declaration_specifiers()
2145 if (dcl->flags & ZEND_FFI_DCL_STORAGE_CLASS) yy_error_sym("unexpected", sym); in parse_declaration_specifiers()
2146 sym = get_sym(); in parse_declaration_specifiers()
2150 if (dcl->flags & ZEND_FFI_DCL_STORAGE_CLASS) yy_error_sym("unexpected", sym); in parse_declaration_specifiers()
2151 sym = get_sym(); in parse_declaration_specifiers()
2155 if (dcl->flags & ZEND_FFI_DCL_STORAGE_CLASS) yy_error_sym("unexpected", sym); in parse_declaration_specifiers()
2156 sym = get_sym(); in parse_declaration_specifiers()
2162 sym = get_sym(); in parse_declaration_specifiers()
2166 sym = get_sym(); in parse_declaration_specifiers()
2170 sym = get_sym(); in parse_declaration_specifiers()
2171 if (sym != YY__LPAREN) { in parse_declaration_specifiers()
2172 yy_error_sym("'(' expected, got", sym); in parse_declaration_specifiers()
2174 sym = get_sym(); in parse_declaration_specifiers()
2175sym, (YY___EXTENSION__,YY_VOID,YY_CHAR,YY_SHORT,YY_INT,YY_LONG,YY_FLOAT,YY_DOUBLE,YY_SIGNED,YY_UNS… in parse_declaration_specifiers()
2177 sym = parse_type_name(sym, &align_dcl); in parse_declaration_specifiers()
2179 …} else if (YY_IN_SET(sym, (YY__LPAREN,YY_ID,YY_OCTNUMBER,YY_DECNUMBER,YY_HEXNUMBER,YY_FLOATNUMBER,… in parse_declaration_specifiers()
2181 sym = parse_constant_expression(sym, &align_val); in parse_declaration_specifiers()
2184 yy_error_sym("unexpected", sym); in parse_declaration_specifiers()
2186 if (sym != YY__RPAREN) { in parse_declaration_specifiers()
2187 yy_error_sym("')' expected, got", sym); in parse_declaration_specifiers()
2189 sym = get_sym(); in parse_declaration_specifiers()
2199 sym = parse_attributes(sym, dcl); in parse_declaration_specifiers()
2211 sym = parse_type_qualifier(sym, dcl); in parse_declaration_specifiers()
2231 sym = parse_type_specifier(sym, dcl); in parse_declaration_specifiers()
2234 yy_error_sym("unexpected", sym); in parse_declaration_specifiers()
2236sym, (YY_TYPEDEF,YY_EXTERN,YY_STATIC,YY_AUTO,YY_REGISTER,YY_INLINE,YY___INLINE,YY___INLINE__,YY__N… in parse_declaration_specifiers()
2237 return sym; in parse_declaration_specifiers()
2240 static int parse_specifier_qualifier_list(int sym, zend_ffi_dcl *dcl) { in parse_specifier_qualifier_list() argument
2241 if (sym == YY___EXTENSION__) { in parse_specifier_qualifier_list()
2242 sym = get_sym(); in parse_specifier_qualifier_list()
2245 …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()
2246 sym = parse_type_specifier(sym, dcl); in parse_specifier_qualifier_list()
2247 …} else if (YY_IN_SET(sym, (YY_CONST,YY___CONST,YY___CONST__,YY_RESTRICT,YY___RESTRICT,YY___RESTRIC… in parse_specifier_qualifier_list()
2248 sym = parse_type_qualifier(sym, dcl); in parse_specifier_qualifier_list()
2249 …} else if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,Y… in parse_specifier_qualifier_list()
2250 sym = parse_attributes(sym, dcl); in parse_specifier_qualifier_list()
2252 yy_error_sym("unexpected", sym); in parse_specifier_qualifier_list()
2254sym, (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()
2255 return sym; in parse_specifier_qualifier_list()
2258 static int parse_type_qualifier_list(int sym, zend_ffi_dcl *dcl) { in parse_type_qualifier_list() argument
2260 …if (YY_IN_SET(sym, (YY_CONST,YY___CONST,YY___CONST__,YY_RESTRICT,YY___RESTRICT,YY___RESTRICT__,YY_… in parse_type_qualifier_list()
2261 sym = parse_type_qualifier(sym, dcl); in parse_type_qualifier_list()
2262 …} else if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,Y… in parse_type_qualifier_list()
2263 sym = parse_attributes(sym, dcl); in parse_type_qualifier_list()
2265 yy_error_sym("unexpected", sym); in parse_type_qualifier_list()
2267 …} while (YY_IN_SET(sym, (YY_CONST,YY___CONST,YY___CONST__,YY_RESTRICT,YY___RESTRICT,YY___RESTRICT_… in parse_type_qualifier_list()
2268 return sym; in parse_type_qualifier_list()
2271 static int parse_type_qualifier(int sym, zend_ffi_dcl *dcl) { in parse_type_qualifier() argument
2272 if (sym == YY_CONST || sym == YY___CONST || sym == YY___CONST__) { in parse_type_qualifier()
2273 sym = get_sym(); in parse_type_qualifier()
2276 } else if (sym == YY_RESTRICT || sym == YY___RESTRICT || sym == YY___RESTRICT__) { in parse_type_qualifier()
2277 sym = get_sym(); in parse_type_qualifier()
2279 } else if (sym == YY_VOLATILE || sym == YY___VOLATILE || sym == YY___VOLATILE__) { in parse_type_qualifier()
2280 sym = get_sym(); in parse_type_qualifier()
2282 } else if (sym == YY__ATOMIC) { in parse_type_qualifier()
2283 sym = get_sym(); in parse_type_qualifier()
2286 yy_error_sym("unexpected", sym); in parse_type_qualifier()
2288 return sym; in parse_type_qualifier()
2291 static int parse_type_specifier(int sym, zend_ffi_dcl *dcl) { in parse_type_specifier() argument
2294 switch (sym) { in parse_type_specifier()
2296 if (dcl->flags & ZEND_FFI_DCL_TYPE_SPECIFIERS) yy_error_sym("unexpected", sym); in parse_type_specifier()
2297 sym = get_sym(); in parse_type_specifier()
2301 …_DCL_TYPE_SPECIFIERS-(ZEND_FFI_DCL_SIGNED|ZEND_FFI_DCL_UNSIGNED))) yy_error_sym("unexpected", sym); in parse_type_specifier()
2302 sym = get_sym(); in parse_type_specifier()
2306 …ERS-(ZEND_FFI_DCL_SIGNED|ZEND_FFI_DCL_UNSIGNED|ZEND_FFI_DCL_INT))) yy_error_sym("unexpected", sym); in parse_type_specifier()
2307 sym = get_sym(); in parse_type_specifier()
2311 …NED|ZEND_FFI_DCL_SHORT|ZEND_FFI_DCL_LONG|ZEND_FFI_DCL_LONG_LONG))) yy_error_sym("unexpected", sym); in parse_type_specifier()
2312 sym = get_sym(); in parse_type_specifier()
2317 …LONG|ZEND_FFI_DCL_SIGNED|ZEND_FFI_DCL_UNSIGNED|ZEND_FFI_DCL_INT))) yy_error_sym("unexpected", sym); in parse_type_specifier()
2320 …IGNED|ZEND_FFI_DCL_INT|ZEND_FFI_DCL_DOUBLE|ZEND_FFI_DCL_COMPLEX))) yy_error_sym("unexpected", sym); in parse_type_specifier()
2323 sym = get_sym(); in parse_type_specifier()
2326 …cl->flags & (ZEND_FFI_DCL_TYPE_SPECIFIERS-(ZEND_FFI_DCL_COMPLEX))) yy_error_sym("unexpected", sym); in parse_type_specifier()
2327 sym = get_sym(); in parse_type_specifier()
2331 …FFI_DCL_TYPE_SPECIFIERS-(ZEND_FFI_DCL_LONG|ZEND_FFI_DCL_COMPLEX))) yy_error_sym("unexpected", sym); in parse_type_specifier()
2332 sym = get_sym(); in parse_type_specifier()
2336 …SHORT|ZEND_FFI_DCL_LONG|ZEND_FFI_DCL_LONG_LONG|ZEND_FFI_DCL_INT))) yy_error_sym("unexpected", sym); in parse_type_specifier()
2337 sym = get_sym(); in parse_type_specifier()
2341 …SHORT|ZEND_FFI_DCL_LONG|ZEND_FFI_DCL_LONG_LONG|ZEND_FFI_DCL_INT))) yy_error_sym("unexpected", sym); in parse_type_specifier()
2342 sym = get_sym(); in parse_type_specifier()
2346 if (dcl->flags & ZEND_FFI_DCL_TYPE_SPECIFIERS) yy_error_sym("unexpected", sym); in parse_type_specifier()
2347 sym = get_sym(); in parse_type_specifier()
2354 …FIERS-(ZEND_FFI_DCL_FLOAT|ZEND_FFI_DCL_DOUBLE|ZEND_FFI_DCL_LONG))) yy_error_sym("unexpected", sym); in parse_type_specifier()
2355 sym = get_sym(); in parse_type_specifier()
2360 if (dcl->flags & ZEND_FFI_DCL_TYPE_SPECIFIERS) yy_error_sym("unexpected", sym); in parse_type_specifier()
2361 sym = parse_struct_or_union_specifier(sym, dcl); in parse_type_specifier()
2364 if (dcl->flags & ZEND_FFI_DCL_TYPE_SPECIFIERS) yy_error_sym("unexpected", sym); in parse_type_specifier()
2365 sym = parse_enum_specifier(sym, dcl); in parse_type_specifier()
2368 if (dcl->flags & ZEND_FFI_DCL_TYPE_SPECIFIERS) yy_error_sym("unexpected", sym); in parse_type_specifier()
2370 sym = parse_ID(sym, &name, &name_len); in parse_type_specifier()
2375 yy_error_sym("unexpected", sym); in parse_type_specifier()
2377 return sym; in parse_type_specifier()
2380 static int parse_struct_or_union_specifier(int sym, zend_ffi_dcl *dcl) { in parse_struct_or_union_specifier() argument
2381 if (sym == YY_STRUCT) { in parse_struct_or_union_specifier()
2382 sym = get_sym(); in parse_struct_or_union_specifier()
2384 } else if (sym == YY_UNION) { in parse_struct_or_union_specifier()
2385 sym = get_sym(); in parse_struct_or_union_specifier()
2388 yy_error_sym("unexpected", sym); in parse_struct_or_union_specifier()
2390 …if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FAS… in parse_struct_or_union_specifier()
2391 sym = parse_attributes(sym, dcl); in parse_struct_or_union_specifier()
2393 if (sym == YY_ID) { in parse_struct_or_union_specifier()
2396 sym = parse_ID(sym, &name, &name_len); in parse_struct_or_union_specifier()
2398 if (sym == YY__LBRACE) { in parse_struct_or_union_specifier()
2399 sym = parse_struct_contents(sym, dcl); in parse_struct_or_union_specifier()
2402 } else if (sym == YY__LBRACE) { in parse_struct_or_union_specifier()
2404 sym = parse_struct_contents(sym, dcl); in parse_struct_or_union_specifier()
2406 yy_error_sym("unexpected", sym); in parse_struct_or_union_specifier()
2408 return sym; in parse_struct_or_union_specifier()
2411 static int parse_struct_contents(int sym, zend_ffi_dcl *dcl) { in parse_struct_contents() argument
2417 if (sym != YY__LBRACE) { in parse_struct_contents()
2418 yy_error_sym("'{' expected, got", sym); in parse_struct_contents()
2420 sym = get_sym(); in parse_struct_contents()
2421 …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()
2422 sym = parse_struct_declaration(sym, dcl); in parse_struct_contents()
2428 sym2 = sym; in parse_struct_contents()
2455 sym = get_sym(); in parse_struct_contents()
2456 sym = parse_struct_declaration(sym, dcl); in parse_struct_contents()
2459 sym = get_sym(); in parse_struct_contents()
2462 if (sym != YY__RBRACE) { in parse_struct_contents()
2463 yy_error_sym("'}' expected, got", sym); in parse_struct_contents()
2465 sym = get_sym(); in parse_struct_contents()
2466 …if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FAS… in parse_struct_contents()
2467 sym = parse_attributes(sym, dcl); in parse_struct_contents()
2470 return sym; in parse_struct_contents()
2473 static int parse_struct_declaration(int sym, zend_ffi_dcl *struct_dcl) { in parse_struct_declaration() argument
2475 sym = parse_specifier_qualifier_list(sym, &common_field_dcl); in parse_struct_declaration()
2476 if (sym == YY__SEMICOLON || sym == YY__RBRACE) { in parse_struct_declaration()
2478 } else if (sym == YY__STAR || sym == YY_ID || sym == YY__LPAREN || sym == YY__COLON) { in parse_struct_declaration()
2479 sym = parse_struct_declarator(sym, struct_dcl, &common_field_dcl); in parse_struct_declaration()
2480 while (sym == YY__COMMA) { in parse_struct_declaration()
2481 sym = get_sym(); in parse_struct_declaration()
2483 …if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FAS… in parse_struct_declaration()
2484 sym = parse_attributes(sym, &field_dcl); in parse_struct_declaration()
2486 sym = parse_struct_declarator(sym, struct_dcl, &field_dcl); in parse_struct_declaration()
2489 yy_error_sym("unexpected", sym); in parse_struct_declaration()
2491 return sym; in parse_struct_declaration()
2494 static int parse_struct_declarator(int sym, zend_ffi_dcl *struct_dcl, zend_ffi_dcl *field_dcl) { in parse_struct_declarator() argument
2498 if (sym == YY__STAR || sym == YY_ID || sym == YY__LPAREN) { in parse_struct_declarator()
2499 sym = parse_declarator(sym, field_dcl, &name, &name_len); in parse_struct_declarator()
2500 if (sym == YY__COLON) { in parse_struct_declarator()
2501 sym = get_sym(); in parse_struct_declarator()
2502 sym = parse_constant_expression(sym, &bits); in parse_struct_declarator()
2503 …if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FAS… in parse_struct_declarator()
2504 sym = parse_attributes(sym, field_dcl); in parse_struct_declarator()
2507 …} else if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,Y… in parse_struct_declarator()
2508 …if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FAS… in parse_struct_declarator()
2509 sym = parse_attributes(sym, field_dcl); in parse_struct_declarator()
2513 yy_error_sym("unexpected", sym); in parse_struct_declarator()
2515 } else if (sym == YY__COLON) { in parse_struct_declarator()
2516 sym = get_sym(); in parse_struct_declarator()
2517 sym = parse_constant_expression(sym, &bits); in parse_struct_declarator()
2520 yy_error_sym("unexpected", sym); in parse_struct_declarator()
2522 return sym; in parse_struct_declarator()
2525 static int parse_enum_specifier(int sym, zend_ffi_dcl *dcl) { in parse_enum_specifier() argument
2526 if (sym != YY_ENUM) { in parse_enum_specifier()
2527 yy_error_sym("'enum' expected, got", sym); in parse_enum_specifier()
2529 sym = get_sym(); in parse_enum_specifier()
2531 …if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FAS… in parse_enum_specifier()
2532 sym = parse_attributes(sym, dcl); in parse_enum_specifier()
2534 if (sym == YY_ID) { in parse_enum_specifier()
2537 sym = parse_ID(sym, &name, &name_len); in parse_enum_specifier()
2538 if (sym == YY__LBRACE) { in parse_enum_specifier()
2540 sym = get_sym(); in parse_enum_specifier()
2541 sym = parse_enumerator_list(sym, dcl); in parse_enum_specifier()
2542 if (sym != YY__RBRACE) { in parse_enum_specifier()
2543 yy_error_sym("'}' expected, got", sym); in parse_enum_specifier()
2545 sym = get_sym(); in parse_enum_specifier()
2546 …if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FAS… in parse_enum_specifier()
2547 sym = parse_attributes(sym, dcl); in parse_enum_specifier()
2549 …} else if (YY_IN_SET(sym, (YY_TYPEDEF,YY_EXTERN,YY_STATIC,YY_AUTO,YY_REGISTER,YY_INLINE,YY___INLIN… in parse_enum_specifier()
2552 yy_error_sym("unexpected", sym); in parse_enum_specifier()
2554 } else if (sym == YY__LBRACE) { in parse_enum_specifier()
2555 sym = get_sym(); in parse_enum_specifier()
2557 sym = parse_enumerator_list(sym, dcl); in parse_enum_specifier()
2558 if (sym != YY__RBRACE) { in parse_enum_specifier()
2559 yy_error_sym("'}' expected, got", sym); in parse_enum_specifier()
2561 sym = get_sym(); in parse_enum_specifier()
2562 …if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FAS… in parse_enum_specifier()
2563 sym = parse_attributes(sym, dcl); in parse_enum_specifier()
2566 yy_error_sym("unexpected", sym); in parse_enum_specifier()
2568 return sym; in parse_enum_specifier()
2571 static int parse_enumerator_list(int sym, zend_ffi_dcl *enum_dcl) { in parse_enumerator_list() argument
2578 sym = parse_enumerator(sym, enum_dcl, &min, &max, &last); in parse_enumerator_list()
2584 sym2 = sym; in parse_enumerator_list()
2611 sym = get_sym(); in parse_enumerator_list()
2612 sym = parse_enumerator(sym, enum_dcl, &min, &max, &last); in parse_enumerator_list()
2615 sym = get_sym(); in parse_enumerator_list()
2617 return sym; in parse_enumerator_list()
2620 static int parse_enumerator(int sym, zend_ffi_dcl *enum_dcl, int64_t *min, int64_t *max, int64_t *l… in parse_enumerator() argument
2624 sym = parse_ID(sym, &name, &name_len); in parse_enumerator()
2625 if (sym == YY__EQUAL) { in parse_enumerator()
2626 sym = get_sym(); in parse_enumerator()
2627 sym = parse_constant_expression(sym, &val); in parse_enumerator()
2630 return sym; in parse_enumerator()
2633 static int parse_declarator(int sym, zend_ffi_dcl *dcl, const char **name, size_t *name_len) { in parse_declarator() argument
2636 if (sym == YY__STAR) { in parse_declarator()
2637 sym = parse_pointer(sym, dcl); in parse_declarator()
2639 if (sym == YY_ID) { in parse_declarator()
2640 sym = parse_ID(sym, name, name_len); in parse_declarator()
2641 } else if (sym == YY__LPAREN) { in parse_declarator()
2642 sym = get_sym(); in parse_declarator()
2643 …if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FAS… in parse_declarator()
2644 sym = parse_attributes(sym, &nested_dcl); in parse_declarator()
2646 sym = parse_declarator(sym, &nested_dcl, name, name_len); in parse_declarator()
2647 if (sym != YY__RPAREN) { in parse_declarator()
2648 yy_error_sym("')' expected, got", sym); in parse_declarator()
2650 sym = get_sym(); in parse_declarator()
2653 yy_error_sym("unexpected", sym); in parse_declarator()
2655 if (sym == YY__LBRACK || sym == YY__LPAREN) { in parse_declarator()
2656 sym = parse_array_or_function_declarators(sym, dcl, &nested_dcl); in parse_declarator()
2659 return sym; in parse_declarator()
2662 static int parse_abstract_declarator(int sym, zend_ffi_dcl *dcl) { in parse_abstract_declarator() argument
2665 if (sym == YY__STAR) { in parse_abstract_declarator()
2666 sym = parse_pointer(sym, dcl); in parse_abstract_declarator()
2668 if ((sym == YY__LPAREN) && synpred_2(sym)) { in parse_abstract_declarator()
2669 sym = get_sym(); in parse_abstract_declarator()
2670 …if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FAS… in parse_abstract_declarator()
2671 sym = parse_attributes(sym, &nested_dcl); in parse_abstract_declarator()
2673 sym = parse_abstract_declarator(sym, &nested_dcl); in parse_abstract_declarator()
2674 if (sym != YY__RPAREN) { in parse_abstract_declarator()
2675 yy_error_sym("')' expected, got", sym); in parse_abstract_declarator()
2677 sym = get_sym(); in parse_abstract_declarator()
2680 if (sym == YY__LBRACK || sym == YY__LPAREN) { in parse_abstract_declarator()
2681 sym = parse_array_or_function_declarators(sym, dcl, &nested_dcl); in parse_abstract_declarator()
2684 return sym; in parse_abstract_declarator()
2687 static int parse_parameter_declarator(int sym, zend_ffi_dcl *dcl, const char **name, size_t *name_l… in parse_parameter_declarator() argument
2690 if (sym == YY__STAR) { in parse_parameter_declarator()
2691 sym = parse_pointer(sym, dcl); in parse_parameter_declarator()
2693 if ((sym == YY__LPAREN) && synpred_3(sym)) { in parse_parameter_declarator()
2694 sym = get_sym(); in parse_parameter_declarator()
2695 …if (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY___FAS… in parse_parameter_declarator()
2696 sym = parse_attributes(sym, &nested_dcl); in parse_parameter_declarator()
2698 sym = parse_parameter_declarator(sym, &nested_dcl, name, name_len); in parse_parameter_declarator()
2699 if (sym != YY__RPAREN) { in parse_parameter_declarator()
2700 yy_error_sym("')' expected, got", sym); in parse_parameter_declarator()
2702 sym = get_sym(); in parse_parameter_declarator()
2704 } else if (sym == YY_ID) { in parse_parameter_declarator()
2705 sym = parse_ID(sym, name, name_len); in parse_parameter_declarator()
2706 } else if (sym == YY__LBRACK || sym == YY__LPAREN || sym == YY__RPAREN || sym == YY__COMMA) { in parse_parameter_declarator()
2708 yy_error_sym("unexpected", sym); in parse_parameter_declarator()
2710 if (sym == YY__LBRACK || sym == YY__LPAREN) { in parse_parameter_declarator()
2711 sym = parse_array_or_function_declarators(sym, dcl, &nested_dcl); in parse_parameter_declarator()
2714 return sym; in parse_parameter_declarator()
2717 static int parse_pointer(int sym, zend_ffi_dcl *dcl) { in parse_pointer() argument
2718 if (sym != YY__STAR) { in parse_pointer()
2719 yy_error_sym("'*' expected, got", sym); in parse_pointer()
2722 sym = get_sym(); in parse_pointer()
2724 …if (YY_IN_SET(sym, (YY_CONST,YY___CONST,YY___CONST__,YY_RESTRICT,YY___RESTRICT,YY___RESTRICT__,YY_… in parse_pointer()
2725 sym = parse_type_qualifier_list(sym, dcl); in parse_pointer()
2727 } while (sym == YY__STAR); in parse_pointer()
2728 return sym; in parse_pointer()
2731 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
2743 if (sym == YY__LBRACK) { in parse_array_or_function_declarators()
2744 sym = get_sym(); in parse_array_or_function_declarators()
2749 sym2 = sym; in parse_array_or_function_declarators()
2783 sym = get_sym(); in parse_array_or_function_declarators()
2784 …if (YY_IN_SET(sym, (YY_CONST,YY___CONST,YY___CONST__,YY_RESTRICT,YY___RESTRICT,YY___RESTRICT__,YY_… in parse_array_or_function_declarators()
2785 sym = parse_type_qualifier_list(sym, &dummy); in parse_array_or_function_declarators()
2787 sym = parse_assignment_expression(sym, &len); in parse_array_or_function_declarators()
2789 sym = parse_type_qualifier_list(sym, &dummy); in parse_array_or_function_declarators()
2794 sym2 = sym; in parse_array_or_function_declarators()
2825 sym = get_sym(); in parse_array_or_function_declarators()
2826 sym = parse_assignment_expression(sym, &len); in parse_array_or_function_declarators()
2830 sym = get_sym(); in parse_array_or_function_declarators()
2833 sym = parse_assignment_expression(sym, &len); in parse_array_or_function_declarators()
2835 yy_error_sym("unexpected", sym); in parse_array_or_function_declarators()
2841 sym = get_sym(); in parse_array_or_function_declarators()
2844 sym = parse_assignment_expression(sym, &len); in parse_array_or_function_declarators()
2847 yy_error_sym("unexpected", sym); in parse_array_or_function_declarators()
2849 if (sym != YY__RBRACK) { in parse_array_or_function_declarators()
2850 yy_error_sym("']' expected, got", sym); in parse_array_or_function_declarators()
2852 sym = get_sym(); in parse_array_or_function_declarators()
2853 if (sym == YY__LBRACK || sym == YY__LPAREN) { in parse_array_or_function_declarators()
2854 sym = parse_array_or_function_declarators(sym, dcl, nested_dcl); in parse_array_or_function_declarators()
2858 } else if (sym == YY__LPAREN) { in parse_array_or_function_declarators()
2859 sym = get_sym(); in parse_array_or_function_declarators()
2860 …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()
2861 …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()
2862 sym = parse_parameter_declaration(sym, &args); in parse_array_or_function_declarators()
2868 sym2 = sym; in parse_array_or_function_declarators()
2895 sym = get_sym(); in parse_array_or_function_declarators()
2896 sym = parse_parameter_declaration(sym, &args); in parse_array_or_function_declarators()
2899 sym = get_sym(); in parse_array_or_function_declarators()
2900 if (sym != YY__POINT_POINT_POINT) { in parse_array_or_function_declarators()
2901 yy_error_sym("'...' expected, got", sym); in parse_array_or_function_declarators()
2903 sym = get_sym(); in parse_array_or_function_declarators()
2907 sym = get_sym(); in parse_array_or_function_declarators()
2911 if (sym != YY__RPAREN) { in parse_array_or_function_declarators()
2912 yy_error_sym("')' expected, got", sym); in parse_array_or_function_declarators()
2914 sym = get_sym(); in parse_array_or_function_declarators()
2915 if (sym == YY__LBRACK || sym == YY__LPAREN) { in parse_array_or_function_declarators()
2916 sym = parse_array_or_function_declarators(sym, dcl, nested_dcl); in parse_array_or_function_declarators()
2921 yy_error_sym("unexpected", sym); in parse_array_or_function_declarators()
2923 return sym; in parse_array_or_function_declarators()
2926 static int parse_parameter_declaration(int sym, HashTable **args) { in parse_parameter_declaration() argument
2932 sym = parse_specifier_qualifier_list(sym, &param_dcl); in parse_parameter_declaration()
2933 sym = parse_parameter_declarator(sym, &param_dcl, &name, &name_len); in parse_parameter_declaration()
2936 return sym; in parse_parameter_declaration()
2939 static int parse_type_name(int sym, zend_ffi_dcl *dcl) { in parse_type_name() argument
2940 sym = parse_specifier_qualifier_list(sym, dcl); in parse_type_name()
2941 sym = parse_abstract_declarator(sym, dcl); in parse_type_name()
2942 return sym; in parse_type_name()
2945 static int parse_attributes(int sym, zend_ffi_dcl *dcl) { in parse_attributes() argument
2950 switch (sym) { in parse_attributes()
2953 sym = get_sym(); in parse_attributes()
2954 if (sym != YY__LPAREN) { in parse_attributes()
2955 yy_error_sym("'(' expected, got", sym); in parse_attributes()
2957 sym = get_sym(); in parse_attributes()
2958 if (sym != YY__LPAREN) { in parse_attributes()
2959 yy_error_sym("'(' expected, got", sym); in parse_attributes()
2961 sym = get_sym(); in parse_attributes()
2962 sym = parse_attrib(sym, dcl); in parse_attributes()
2963 while (sym == YY__COMMA) { in parse_attributes()
2964 sym = get_sym(); in parse_attributes()
2965 sym = parse_attrib(sym, dcl); in parse_attributes()
2967 if (sym != YY__RPAREN) { in parse_attributes()
2968 yy_error_sym("')' expected, got", sym); in parse_attributes()
2970 sym = get_sym(); in parse_attributes()
2971 if (sym != YY__RPAREN) { in parse_attributes()
2972 yy_error_sym("')' expected, got", sym); in parse_attributes()
2974 sym = get_sym(); in parse_attributes()
2977 sym = get_sym(); in parse_attributes()
2978 if (sym != YY__LPAREN) { in parse_attributes()
2979 yy_error_sym("'(' expected, got", sym); in parse_attributes()
2981 sym = get_sym(); in parse_attributes()
2983 sym = parse_ID(sym, &name, &name_len); in parse_attributes()
2984 if (sym == YY__LPAREN) { in parse_attributes()
2985 sym = get_sym(); in parse_attributes()
2986 sym = parse_assignment_expression(sym, &val); in parse_attributes()
2988 if (sym != YY__RPAREN) { in parse_attributes()
2989 yy_error_sym("')' expected, got", sym); in parse_attributes()
2991 sym = get_sym(); in parse_attributes()
2993 } while (sym == YY_ID); in parse_attributes()
2994 if (sym != YY__RPAREN) { in parse_attributes()
2995 yy_error_sym("')' expected, got", sym); in parse_attributes()
2997 sym = get_sym(); in parse_attributes()
3000 sym = get_sym(); in parse_attributes()
3004 sym = get_sym(); in parse_attributes()
3008 sym = get_sym(); in parse_attributes()
3012 sym = get_sym(); in parse_attributes()
3016 sym = get_sym(); in parse_attributes()
3020 yy_error_sym("unexpected", sym); in parse_attributes()
3022 …} while (YY_IN_SET(sym, (YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY___CDECL,YY___STDCALL,YY_… in parse_attributes()
3023 return sym; in parse_attributes()
3026 static int parse_attrib(int sym, zend_ffi_dcl *dcl) { in parse_attrib() argument
3032 if (sym == YY_ID || sym == YY_CONST || sym == YY___CONST || sym == YY___CONST__) { in parse_attrib()
3033 if (sym == YY_ID) { in parse_attrib()
3034 sym = parse_ID(sym, &name, &name_len); in parse_attrib()
3035 if (sym == YY__COMMA || sym == YY__RPAREN) { in parse_attrib()
3037 } else if (sym == YY__LPAREN) { in parse_attrib()
3038 sym = get_sym(); in parse_attrib()
3041 sym = parse_assignment_expression(sym, &val); in parse_attrib()
3044 while (sym == YY__COMMA) { in parse_attrib()
3045 sym = get_sym(); in parse_attrib()
3046 sym = parse_assignment_expression(sym, &val); in parse_attrib()
3050 if (sym != YY__RPAREN) { in parse_attrib()
3051 yy_error_sym("')' expected, got", sym); in parse_attrib()
3053 sym = get_sym(); in parse_attrib()
3055 yy_error_sym("unexpected", sym); in parse_attrib()
3057 } else if (sym == YY_CONST) { in parse_attrib()
3058 sym = get_sym(); in parse_attrib()
3059 } else if (sym == YY___CONST) { in parse_attrib()
3060 sym = get_sym(); in parse_attrib()
3062 sym = get_sym(); in parse_attrib()
3065 return sym; in parse_attrib()
3068 static int parse_initializer(int sym) { in parse_initializer() argument
3075 if (sym != YY__EQUAL) { in parse_initializer()
3076 yy_error_sym("'=' expected, got", sym); in parse_initializer()
3078 sym = get_sym(); in parse_initializer()
3079 …if (YY_IN_SET(sym, (YY__LPAREN,YY_ID,YY_OCTNUMBER,YY_DECNUMBER,YY_HEXNUMBER,YY_FLOATNUMBER,YY_STRI… in parse_initializer()
3080 sym = parse_assignment_expression(sym, &dummy); in parse_initializer()
3081 } else if (sym == YY__LBRACE) { in parse_initializer()
3082 sym = get_sym(); in parse_initializer()
3083 if (sym == YY__LBRACK || sym == YY__POINT) { in parse_initializer()
3084 sym = parse_designation(sym); in parse_initializer()
3086 sym = parse_initializer(sym); in parse_initializer()
3092 sym2 = sym; in parse_initializer()
3119 sym = get_sym(); in parse_initializer()
3120 if (sym == YY__LBRACK || sym == YY__POINT) { in parse_initializer()
3121 sym = parse_designation(sym); in parse_initializer()
3123 sym = parse_initializer(sym); in parse_initializer()
3126 sym = get_sym(); in parse_initializer()
3128 if (sym != YY__RBRACE) { in parse_initializer()
3129 yy_error_sym("'}' expected, got", sym); in parse_initializer()
3131 sym = get_sym(); in parse_initializer()
3133 yy_error_sym("unexpected", sym); in parse_initializer()
3135 return sym; in parse_initializer()
3138 static int parse_designation(int sym) { in parse_designation() argument
3143 if (sym == YY__LBRACK) { in parse_designation()
3144 sym = get_sym(); in parse_designation()
3145 sym = parse_constant_expression(sym, &dummy); in parse_designation()
3146 if (sym != YY__RBRACK) { in parse_designation()
3147 yy_error_sym("']' expected, got", sym); in parse_designation()
3149 sym = get_sym(); in parse_designation()
3150 } else if (sym == YY__POINT) { in parse_designation()
3151 sym = get_sym(); in parse_designation()
3152 sym = parse_ID(sym, &name, &name_len); in parse_designation()
3154 yy_error_sym("unexpected", sym); in parse_designation()
3156 } while (sym == YY__LBRACK || sym == YY__POINT); in parse_designation()
3157 if (sym != YY__EQUAL) { in parse_designation()
3158 yy_error_sym("'=' expected, got", sym); in parse_designation()
3160 sym = get_sym(); in parse_designation()
3161 return sym; in parse_designation()
3164 static int parse_expr_list(int sym) { in parse_expr_list() argument
3166 sym = parse_assignment_expression(sym, &dummy); in parse_expr_list()
3167 while (sym == YY__COMMA) { in parse_expr_list()
3168 sym = get_sym(); in parse_expr_list()
3169 sym = parse_assignment_expression(sym, &dummy); in parse_expr_list()
3171 return sym; in parse_expr_list()
3174 static int parse_expression(int sym, zend_ffi_val *val) { in parse_expression() argument
3175 sym = parse_assignment_expression(sym, val); in parse_expression()
3176 while (sym == YY__COMMA) { in parse_expression()
3177 sym = get_sym(); in parse_expression()
3178 sym = parse_assignment_expression(sym, val); in parse_expression()
3180 return sym; in parse_expression()
3183 static int parse_assignment_expression(int sym, zend_ffi_val *val) { in parse_assignment_expression() argument
3184 sym = parse_conditional_expression(sym, val); in parse_assignment_expression()
3185 return sym; in parse_assignment_expression()
3188 static int parse_constant_expression(int sym, zend_ffi_val *val) { in parse_constant_expression() argument
3189 sym = parse_conditional_expression(sym, val); in parse_constant_expression()
3190 return sym; in parse_constant_expression()
3193 static int parse_conditional_expression(int sym, zend_ffi_val *val) { in parse_conditional_expression() argument
3195 sym = parse_logical_or_expression(sym, val); in parse_conditional_expression()
3196 if (sym == YY__QUERY) { in parse_conditional_expression()
3197 sym = get_sym(); in parse_conditional_expression()
3198 sym = parse_expression(sym, &op2); in parse_conditional_expression()
3199 if (sym != YY__COLON) { in parse_conditional_expression()
3200 yy_error_sym("':' expected, got", sym); in parse_conditional_expression()
3202 sym = get_sym(); in parse_conditional_expression()
3203 sym = parse_conditional_expression(sym, &op3); in parse_conditional_expression()
3206 return sym; in parse_conditional_expression()
3209 static int parse_logical_or_expression(int sym, zend_ffi_val *val) { in parse_logical_or_expression() argument
3211 sym = parse_logical_and_expression(sym, val); in parse_logical_or_expression()
3212 while (sym == YY__BAR_BAR) { in parse_logical_or_expression()
3213 sym = get_sym(); in parse_logical_or_expression()
3214 sym = parse_logical_and_expression(sym, &op2); in parse_logical_or_expression()
3217 return sym; in parse_logical_or_expression()
3220 static int parse_logical_and_expression(int sym, zend_ffi_val *val) { in parse_logical_and_expression() argument
3222 sym = parse_inclusive_or_expression(sym, val); in parse_logical_and_expression()
3223 while (sym == YY__AND_AND) { in parse_logical_and_expression()
3224 sym = get_sym(); in parse_logical_and_expression()
3225 sym = parse_inclusive_or_expression(sym, &op2); in parse_logical_and_expression()
3228 return sym; in parse_logical_and_expression()
3231 static int parse_inclusive_or_expression(int sym, zend_ffi_val *val) { in parse_inclusive_or_expression() argument
3233 sym = parse_exclusive_or_expression(sym, val); in parse_inclusive_or_expression()
3234 while (sym == YY__BAR) { in parse_inclusive_or_expression()
3235 sym = get_sym(); in parse_inclusive_or_expression()
3236 sym = parse_exclusive_or_expression(sym, &op2); in parse_inclusive_or_expression()
3239 return sym; in parse_inclusive_or_expression()
3242 static int parse_exclusive_or_expression(int sym, zend_ffi_val *val) { in parse_exclusive_or_expression() argument
3244 sym = parse_and_expression(sym, val); in parse_exclusive_or_expression()
3245 while (sym == YY__UPARROW) { in parse_exclusive_or_expression()
3246 sym = get_sym(); in parse_exclusive_or_expression()
3247 sym = parse_and_expression(sym, &op2); in parse_exclusive_or_expression()
3250 return sym; in parse_exclusive_or_expression()
3253 static int parse_and_expression(int sym, zend_ffi_val *val) { in parse_and_expression() argument
3255 sym = parse_equality_expression(sym, val); in parse_and_expression()
3256 while (sym == YY__AND) { in parse_and_expression()
3257 sym = get_sym(); in parse_and_expression()
3258 sym = parse_equality_expression(sym, &op2); in parse_and_expression()
3261 return sym; in parse_and_expression()
3264 static int parse_equality_expression(int sym, zend_ffi_val *val) { in parse_equality_expression() argument
3266 sym = parse_relational_expression(sym, val); in parse_equality_expression()
3267 while (sym == YY__EQUAL_EQUAL || sym == YY__BANG_EQUAL) { in parse_equality_expression()
3268 if (sym == YY__EQUAL_EQUAL) { in parse_equality_expression()
3269 sym = get_sym(); in parse_equality_expression()
3270 sym = parse_relational_expression(sym, &op2); in parse_equality_expression()
3273 sym = get_sym(); in parse_equality_expression()
3274 sym = parse_relational_expression(sym, &op2); in parse_equality_expression()
3278 return sym; in parse_equality_expression()
3281 static int parse_relational_expression(int sym, zend_ffi_val *val) { in parse_relational_expression() argument
3283 sym = parse_shift_expression(sym, val); in parse_relational_expression()
3284 …while (sym == YY__LESS || sym == YY__GREATER || sym == YY__LESS_EQUAL || sym == YY__GREATER_EQUAL)… in parse_relational_expression()
3285 if (sym == YY__LESS) { in parse_relational_expression()
3286 sym = get_sym(); in parse_relational_expression()
3287 sym = parse_shift_expression(sym, &op2); in parse_relational_expression()
3289 } else if (sym == YY__GREATER) { in parse_relational_expression()
3290 sym = get_sym(); in parse_relational_expression()
3291 sym = parse_shift_expression(sym, &op2); in parse_relational_expression()
3293 } else if (sym == YY__LESS_EQUAL) { in parse_relational_expression()
3294 sym = get_sym(); in parse_relational_expression()
3295 sym = parse_shift_expression(sym, &op2); in parse_relational_expression()
3298 sym = get_sym(); in parse_relational_expression()
3299 sym = parse_shift_expression(sym, &op2); in parse_relational_expression()
3303 return sym; in parse_relational_expression()
3306 static int parse_shift_expression(int sym, zend_ffi_val *val) { in parse_shift_expression() argument
3308 sym = parse_additive_expression(sym, val); in parse_shift_expression()
3309 while (sym == YY__LESS_LESS || sym == YY__GREATER_GREATER) { in parse_shift_expression()
3310 if (sym == YY__LESS_LESS) { in parse_shift_expression()
3311 sym = get_sym(); in parse_shift_expression()
3312 sym = parse_additive_expression(sym, &op2); in parse_shift_expression()
3315 sym = get_sym(); in parse_shift_expression()
3316 sym = parse_additive_expression(sym, &op2); in parse_shift_expression()
3320 return sym; in parse_shift_expression()
3323 static int parse_additive_expression(int sym, zend_ffi_val *val) { in parse_additive_expression() argument
3325 sym = parse_multiplicative_expression(sym, val); in parse_additive_expression()
3326 while (sym == YY__PLUS || sym == YY__MINUS) { in parse_additive_expression()
3327 if (sym == YY__PLUS) { in parse_additive_expression()
3328 sym = get_sym(); in parse_additive_expression()
3329 sym = parse_multiplicative_expression(sym, &op2); in parse_additive_expression()
3332 sym = get_sym(); in parse_additive_expression()
3333 sym = parse_multiplicative_expression(sym, &op2); in parse_additive_expression()
3337 return sym; in parse_additive_expression()
3340 static int parse_multiplicative_expression(int sym, zend_ffi_val *val) { in parse_multiplicative_expression() argument
3342 sym = parse_cast_expression(sym, val); in parse_multiplicative_expression()
3343 while (sym == YY__STAR || sym == YY__SLASH || sym == YY__PERCENT) { in parse_multiplicative_expression()
3344 if (sym == YY__STAR) { in parse_multiplicative_expression()
3345 sym = get_sym(); in parse_multiplicative_expression()
3346 sym = parse_cast_expression(sym, &op2); in parse_multiplicative_expression()
3348 } else if (sym == YY__SLASH) { in parse_multiplicative_expression()
3349 sym = get_sym(); in parse_multiplicative_expression()
3350 sym = parse_cast_expression(sym, &op2); in parse_multiplicative_expression()
3353 sym = get_sym(); in parse_multiplicative_expression()
3354 sym = parse_cast_expression(sym, &op2); in parse_multiplicative_expression()
3358 return sym; in parse_multiplicative_expression()
3361 static int parse_cast_expression(int sym, zend_ffi_val *val) { in parse_cast_expression() argument
3364 if ((sym == YY__LPAREN) && synpred_4(sym)) { in parse_cast_expression()
3365 sym = get_sym(); in parse_cast_expression()
3366 sym = parse_type_name(sym, &dcl); in parse_cast_expression()
3367 if (sym != YY__RPAREN) { in parse_cast_expression()
3368 yy_error_sym("')' expected, got", sym); in parse_cast_expression()
3370 sym = get_sym(); in parse_cast_expression()
3373 sym = parse_unary_expression(sym, val); in parse_cast_expression()
3375 return sym; in parse_cast_expression()
3378 static int parse_unary_expression(int sym, zend_ffi_val *val) { in parse_unary_expression() argument
3382 switch (sym) { in parse_unary_expression()
3384 sym = parse_ID(sym, &name, &name_len); in parse_unary_expression()
3386 …while (YY_IN_SET(sym, (YY__LBRACK,YY__LPAREN,YY__POINT,YY__MINUS_GREATER,YY__PLUS_PLUS,YY__MINUS_M… in parse_unary_expression()
3387 switch (sym) { in parse_unary_expression()
3389 sym = get_sym(); in parse_unary_expression()
3390 sym = parse_expr_list(sym); in parse_unary_expression()
3391 if (sym != YY__RBRACK) { in parse_unary_expression()
3392 yy_error_sym("']' expected, got", sym); in parse_unary_expression()
3394 sym = get_sym(); in parse_unary_expression()
3397 sym = get_sym(); in parse_unary_expression()
3398 …if (YY_IN_SET(sym, (YY__LPAREN,YY_ID,YY_OCTNUMBER,YY_DECNUMBER,YY_HEXNUMBER,YY_FLOATNUMBER,YY_STRI… in parse_unary_expression()
3399 sym = parse_expr_list(sym); in parse_unary_expression()
3401 if (sym != YY__RPAREN) { in parse_unary_expression()
3402 yy_error_sym("')' expected, got", sym); in parse_unary_expression()
3404 sym = get_sym(); in parse_unary_expression()
3407 sym = get_sym(); in parse_unary_expression()
3408 sym = parse_ID(sym, &name, &name_len); in parse_unary_expression()
3411 sym = get_sym(); in parse_unary_expression()
3412 sym = parse_ID(sym, &name, &name_len); in parse_unary_expression()
3415 sym = get_sym(); in parse_unary_expression()
3418 sym = get_sym(); in parse_unary_expression()
3425 sym = parse_OCTNUMBER(sym, val); in parse_unary_expression()
3428 sym = parse_DECNUMBER(sym, val); in parse_unary_expression()
3431 sym = parse_HEXNUMBER(sym, val); in parse_unary_expression()
3434 sym = parse_FLOATNUMBER(sym, val); in parse_unary_expression()
3437 sym = parse_STRING(sym, val); in parse_unary_expression()
3440 sym = parse_CHARACTER(sym, val); in parse_unary_expression()
3443 sym = get_sym(); in parse_unary_expression()
3444 sym = parse_expression(sym, val); in parse_unary_expression()
3445 if (sym != YY__RPAREN) { in parse_unary_expression()
3446 yy_error_sym("')' expected, got", sym); in parse_unary_expression()
3448 sym = get_sym(); in parse_unary_expression()
3451 sym = get_sym(); in parse_unary_expression()
3452 sym = parse_unary_expression(sym, val); in parse_unary_expression()
3456 sym = get_sym(); in parse_unary_expression()
3457 sym = parse_unary_expression(sym, val); in parse_unary_expression()
3461 sym = get_sym(); in parse_unary_expression()
3462 sym = parse_cast_expression(sym, val); in parse_unary_expression()
3466 sym = get_sym(); in parse_unary_expression()
3467 sym = parse_cast_expression(sym, val); in parse_unary_expression()
3471 sym = get_sym(); in parse_unary_expression()
3472 sym = parse_cast_expression(sym, val); in parse_unary_expression()
3476 sym = get_sym(); in parse_unary_expression()
3477 sym = parse_cast_expression(sym, val); in parse_unary_expression()
3481 sym = get_sym(); in parse_unary_expression()
3482 sym = parse_cast_expression(sym, val); in parse_unary_expression()
3486 sym = get_sym(); in parse_unary_expression()
3487 sym = parse_cast_expression(sym, val); in parse_unary_expression()
3491 sym = get_sym(); in parse_unary_expression()
3492 if ((sym == YY__LPAREN) && synpred_5(sym)) { in parse_unary_expression()
3493 sym = get_sym(); in parse_unary_expression()
3494 sym = parse_type_name(sym, &dcl); in parse_unary_expression()
3495 if (sym != YY__RPAREN) { in parse_unary_expression()
3496 yy_error_sym("')' expected, got", sym); in parse_unary_expression()
3498 sym = get_sym(); in parse_unary_expression()
3500 …} else if (YY_IN_SET(sym, (YY_ID,YY_OCTNUMBER,YY_DECNUMBER,YY_HEXNUMBER,YY_FLOATNUMBER,YY_STRING,Y… in parse_unary_expression()
3501 sym = parse_unary_expression(sym, val); in parse_unary_expression()
3504 yy_error_sym("unexpected", sym); in parse_unary_expression()
3508 sym = get_sym(); in parse_unary_expression()
3509 if (sym != YY__LPAREN) { in parse_unary_expression()
3510 yy_error_sym("'(' expected, got", sym); in parse_unary_expression()
3512 sym = get_sym(); in parse_unary_expression()
3513 sym = parse_type_name(sym, &dcl); in parse_unary_expression()
3514 if (sym != YY__RPAREN) { in parse_unary_expression()
3515 yy_error_sym("')' expected, got", sym); in parse_unary_expression()
3517 sym = get_sym(); in parse_unary_expression()
3522 sym = get_sym(); in parse_unary_expression()
3523 if ((sym == YY__LPAREN) && synpred_6(sym)) { in parse_unary_expression()
3524 sym = get_sym(); in parse_unary_expression()
3525 sym = parse_type_name(sym, &dcl); in parse_unary_expression()
3526 if (sym != YY__RPAREN) { in parse_unary_expression()
3527 yy_error_sym("')' expected, got", sym); in parse_unary_expression()
3529 sym = get_sym(); in parse_unary_expression()
3531 …} else if (YY_IN_SET(sym, (YY_ID,YY_OCTNUMBER,YY_DECNUMBER,YY_HEXNUMBER,YY_FLOATNUMBER,YY_STRING,Y… in parse_unary_expression()
3532 sym = parse_unary_expression(sym, val); in parse_unary_expression()
3535 yy_error_sym("unexpected", sym); in parse_unary_expression()
3539 yy_error_sym("unexpected", sym); in parse_unary_expression()
3541 return sym; in parse_unary_expression()
3544 static int parse_ID(int sym, const char **name, size_t *name_len) { in parse_ID() argument
3545 if (sym != YY_ID) { in parse_ID()
3546 yy_error_sym("<ID> expected, got", sym); in parse_ID()
3549 sym = get_sym(); in parse_ID()
3550 return sym; in parse_ID()
3553 static int parse_OCTNUMBER(int sym, zend_ffi_val *val) { in parse_OCTNUMBER() argument
3554 if (sym != YY_OCTNUMBER) { in parse_OCTNUMBER()
3555 yy_error_sym("<OCTNUMBER> expected, got", sym); in parse_OCTNUMBER()
3558 sym = get_sym(); in parse_OCTNUMBER()
3559 return sym; in parse_OCTNUMBER()
3562 static int parse_DECNUMBER(int sym, zend_ffi_val *val) { in parse_DECNUMBER() argument
3563 if (sym != YY_DECNUMBER) { in parse_DECNUMBER()
3564 yy_error_sym("<DECNUMBER> expected, got", sym); in parse_DECNUMBER()
3567 sym = get_sym(); in parse_DECNUMBER()
3568 return sym; in parse_DECNUMBER()
3571 static int parse_HEXNUMBER(int sym, zend_ffi_val *val) { in parse_HEXNUMBER() argument
3572 if (sym != YY_HEXNUMBER) { in parse_HEXNUMBER()
3573 yy_error_sym("<HEXNUMBER> expected, got", sym); in parse_HEXNUMBER()
3576 sym = get_sym(); in parse_HEXNUMBER()
3577 return sym; in parse_HEXNUMBER()
3580 static int parse_FLOATNUMBER(int sym, zend_ffi_val *val) { in parse_FLOATNUMBER() argument
3581 if (sym != YY_FLOATNUMBER) { in parse_FLOATNUMBER()
3582 yy_error_sym("<FLOATNUMBER> expected, got", sym); in parse_FLOATNUMBER()
3585 sym = get_sym(); in parse_FLOATNUMBER()
3586 return sym; in parse_FLOATNUMBER()
3589 static int parse_STRING(int sym, zend_ffi_val *val) { in parse_STRING() argument
3590 if (sym != YY_STRING) { in parse_STRING()
3591 yy_error_sym("<STRING> expected, got", sym); in parse_STRING()
3594 sym = get_sym(); in parse_STRING()
3595 return sym; in parse_STRING()
3598 static int parse_CHARACTER(int sym, zend_ffi_val *val) { in parse_CHARACTER() argument
3599 if (sym != YY_CHARACTER) { in parse_CHARACTER()
3600 yy_error_sym("<CHARACTER> expected, got", sym); in parse_CHARACTER()
3603 sym = get_sym(); in parse_CHARACTER()
3604 return sym; in parse_CHARACTER()
3608 int sym; in parse() local
3612 sym = parse_declarations(get_sym()); in parse()
3613 if (sym != YY_EOF) { in parse()
3614 yy_error_sym("<EOF> expected, got", sym); in parse()
3632 int sym; in zend_ffi_parse_type() local
3640 sym = parse_type_name(get_sym(), dcl); in zend_ffi_parse_type()
3641 if (sym != YY_EOF) { in zend_ffi_parse_type()
3642 yy_error_sym("<EOF> expected, got", sym); in zend_ffi_parse_type()
3655 static void yy_error_sym(const char *msg, int sym) { in yy_error_sym() argument
3656 zend_ffi_parser_error("%s '%s' at line %d", msg, sym_name[sym], yy_line); in yy_error_sym()