Lines Matching refs:dcl
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);
325 static int parse_enum_specifier(int sym, zend_ffi_dcl *dcl);
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…
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);
2081 zend_ffi_dcl dcl; in parse_declarations() local
2082 dcl = common_dcl; in parse_declarations()
2083 sym = parse_declarator(sym, &dcl, &name, &name_len); in parse_declarations()
2100 sym = parse_attributes(sym, &dcl); in parse_declarations()
2105 zend_ffi_declare(name, name_len, &dcl); in parse_declarations()
2108 dcl = common_dcl; in parse_declarations()
2109 sym = parse_declarator(sym, &dcl, &name, &name_len); in parse_declarations()
2111 sym = parse_attributes(sym, &dcl); in parse_declarations()
2116 zend_ffi_declare(name, name_len, &dcl); in parse_declarations()
2131 static int parse_declaration_specifiers(int sym, zend_ffi_dcl *dcl) { in parse_declaration_specifiers() argument
2135 if (dcl->flags & ZEND_FFI_DCL_STORAGE_CLASS) yy_error_sym("unexpected", sym); in parse_declaration_specifiers()
2137 dcl->flags |= ZEND_FFI_DCL_TYPEDEF; in parse_declaration_specifiers()
2140 if (dcl->flags & ZEND_FFI_DCL_STORAGE_CLASS) yy_error_sym("unexpected", sym); in parse_declaration_specifiers()
2142 dcl->flags |= ZEND_FFI_DCL_EXTERN; in parse_declaration_specifiers()
2145 if (dcl->flags & ZEND_FFI_DCL_STORAGE_CLASS) yy_error_sym("unexpected", sym); in parse_declaration_specifiers()
2147 dcl->flags |= ZEND_FFI_DCL_STATIC; in parse_declaration_specifiers()
2150 if (dcl->flags & ZEND_FFI_DCL_STORAGE_CLASS) yy_error_sym("unexpected", sym); in parse_declaration_specifiers()
2152 dcl->flags |= ZEND_FFI_DCL_AUTO; in parse_declaration_specifiers()
2155 if (dcl->flags & ZEND_FFI_DCL_STORAGE_CLASS) yy_error_sym("unexpected", sym); in parse_declaration_specifiers()
2157 dcl->flags |= ZEND_FFI_DCL_REGISTER; in parse_declaration_specifiers()
2163 dcl->flags |= ZEND_FFI_DCL_INLINE; in parse_declaration_specifiers()
2167 dcl->flags |= ZEND_FFI_DCL_NO_RETURN; in parse_declaration_specifiers()
2178 zend_ffi_align_as_type(dcl, &align_dcl); in parse_declaration_specifiers()
2182 zend_ffi_align_as_val(dcl, &align_val); 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()
2236 …0\377\377\377\377\107\360\017\000\000\000\002\000")) && (sym != YY_ID || !(dcl->flags & ZEND_FFI_D… in parse_declaration_specifiers()
2240 static int parse_specifier_qualifier_list(int sym, zend_ffi_dcl *dcl) { in parse_specifier_qualifier_list() argument
2246 sym = parse_type_specifier(sym, dcl); in parse_specifier_qualifier_list()
2248 sym = parse_type_qualifier(sym, dcl); in parse_specifier_qualifier_list()
2250 sym = parse_attributes(sym, dcl); in parse_specifier_qualifier_list()
2254 …ID || zend_ffi_is_typedef_name((const char*)yy_text, yy_pos - yy_text) || (dcl->flags & ZEND_FFI_D… in parse_specifier_qualifier_list()
2258 static int parse_type_qualifier_list(int sym, zend_ffi_dcl *dcl) { in parse_type_qualifier_list() argument
2261 sym = parse_type_qualifier(sym, dcl); in parse_type_qualifier_list()
2263 sym = parse_attributes(sym, dcl); in parse_type_qualifier_list()
2271 static int parse_type_qualifier(int sym, zend_ffi_dcl *dcl) { in parse_type_qualifier() argument
2274 dcl->flags |= ZEND_FFI_DCL_CONST; in parse_type_qualifier()
2275 dcl->attr |= ZEND_FFI_ATTR_CONST; in parse_type_qualifier()
2278 dcl->flags |= ZEND_FFI_DCL_RESTRICT; in parse_type_qualifier()
2281 dcl->flags |= ZEND_FFI_DCL_VOLATILE; in parse_type_qualifier()
2284 dcl->flags |= ZEND_FFI_DCL_ATOMIC; in parse_type_qualifier()
2291 static int parse_type_specifier(int sym, zend_ffi_dcl *dcl) { in parse_type_specifier() argument
2296 if (dcl->flags & ZEND_FFI_DCL_TYPE_SPECIFIERS) yy_error_sym("unexpected", sym); in parse_type_specifier()
2298 dcl->flags |= ZEND_FFI_DCL_VOID; in parse_type_specifier()
2301 …if (dcl->flags & (ZEND_FFI_DCL_TYPE_SPECIFIERS-(ZEND_FFI_DCL_SIGNED|ZEND_FFI_DCL_UNSIGNED))) yy_er… in parse_type_specifier()
2303 dcl->flags |= ZEND_FFI_DCL_CHAR; in parse_type_specifier()
2306 …if (dcl->flags & (ZEND_FFI_DCL_TYPE_SPECIFIERS-(ZEND_FFI_DCL_SIGNED|ZEND_FFI_DCL_UNSIGNED|ZEND_FFI… in parse_type_specifier()
2308 dcl->flags |= ZEND_FFI_DCL_SHORT; in parse_type_specifier()
2311 …if (dcl->flags & (ZEND_FFI_DCL_TYPE_SPECIFIERS-(ZEND_FFI_DCL_SIGNED|ZEND_FFI_DCL_UNSIGNED|ZEND_FFI… in parse_type_specifier()
2313 dcl->flags |= ZEND_FFI_DCL_INT; in parse_type_specifier()
2316 if (dcl->flags & ZEND_FFI_DCL_LONG) { in parse_type_specifier()
2317 …if (dcl->flags & (ZEND_FFI_DCL_TYPE_SPECIFIERS-(ZEND_FFI_DCL_LONG|ZEND_FFI_DCL_SIGNED|ZEND_FFI_DCL… in parse_type_specifier()
2318 dcl->flags |= ZEND_FFI_DCL_LONG_LONG; in parse_type_specifier()
2320 …if (dcl->flags & (ZEND_FFI_DCL_TYPE_SPECIFIERS-(ZEND_FFI_DCL_LONG|ZEND_FFI_DCL_SIGNED|ZEND_FFI_DCL… in parse_type_specifier()
2321 dcl->flags |= ZEND_FFI_DCL_LONG; in parse_type_specifier()
2326 …if (dcl->flags & (ZEND_FFI_DCL_TYPE_SPECIFIERS-(ZEND_FFI_DCL_COMPLEX))) yy_error_sym("unexpected",… in parse_type_specifier()
2328 dcl->flags |= ZEND_FFI_DCL_FLOAT; in parse_type_specifier()
2331 …if (dcl->flags & (ZEND_FFI_DCL_TYPE_SPECIFIERS-(ZEND_FFI_DCL_LONG|ZEND_FFI_DCL_COMPLEX))) yy_error… in parse_type_specifier()
2333 dcl->flags |= ZEND_FFI_DCL_DOUBLE; in parse_type_specifier()
2336 …if (dcl->flags & (ZEND_FFI_DCL_TYPE_SPECIFIERS-(ZEND_FFI_DCL_CHAR|ZEND_FFI_DCL_SHORT|ZEND_FFI_DCL_… in parse_type_specifier()
2338 dcl->flags |= ZEND_FFI_DCL_SIGNED; in parse_type_specifier()
2341 …if (dcl->flags & (ZEND_FFI_DCL_TYPE_SPECIFIERS-(ZEND_FFI_DCL_CHAR|ZEND_FFI_DCL_SHORT|ZEND_FFI_DCL_… in parse_type_specifier()
2343 dcl->flags |= ZEND_FFI_DCL_UNSIGNED; in parse_type_specifier()
2346 if (dcl->flags & ZEND_FFI_DCL_TYPE_SPECIFIERS) yy_error_sym("unexpected", sym); in parse_type_specifier()
2348 dcl->flags |= ZEND_FFI_DCL_BOOL; in parse_type_specifier()
2354 …if (dcl->flags & (ZEND_FFI_DCL_TYPE_SPECIFIERS-(ZEND_FFI_DCL_FLOAT|ZEND_FFI_DCL_DOUBLE|ZEND_FFI_DC… in parse_type_specifier()
2356 dcl->flags |= ZEND_FFI_DCL_COMPLEX; 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()
2371 dcl->flags |= ZEND_FFI_DCL_TYPEDEF_NAME; in parse_type_specifier()
2372 zend_ffi_resolve_typedef(name, name_len, dcl); 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
2383 dcl->flags |= ZEND_FFI_DCL_STRUCT; in parse_struct_or_union_specifier()
2386 dcl->flags |= ZEND_FFI_DCL_UNION; in parse_struct_or_union_specifier()
2391 sym = parse_attributes(sym, dcl); in parse_struct_or_union_specifier()
2397 zend_ffi_declare_tag(name, name_len, dcl, 1); in parse_struct_or_union_specifier()
2399 sym = parse_struct_contents(sym, dcl); in parse_struct_or_union_specifier()
2400 zend_ffi_declare_tag(name, name_len, dcl, 0); in parse_struct_or_union_specifier()
2403 zend_ffi_make_struct_type(dcl); in parse_struct_or_union_specifier()
2404 sym = parse_struct_contents(sym, dcl); in parse_struct_or_union_specifier()
2411 static int parse_struct_contents(int sym, zend_ffi_dcl *dcl) { in parse_struct_contents() argument
2422 sym = parse_struct_declaration(sym, dcl); in parse_struct_contents()
2456 sym = parse_struct_declaration(sym, dcl); in parse_struct_contents()
2467 sym = parse_attributes(sym, dcl); in parse_struct_contents()
2469 zend_ffi_adjust_struct_size(dcl); in parse_struct_contents()
2525 static int parse_enum_specifier(int sym, zend_ffi_dcl *dcl) { in parse_enum_specifier() argument
2530 dcl->flags |= ZEND_FFI_DCL_ENUM; in parse_enum_specifier()
2532 sym = parse_attributes(sym, dcl); in parse_enum_specifier()
2539 zend_ffi_declare_tag(name, name_len, dcl, 0); in parse_enum_specifier()
2541 sym = parse_enumerator_list(sym, dcl); in parse_enum_specifier()
2547 sym = parse_attributes(sym, dcl); in parse_enum_specifier()
2550 zend_ffi_declare_tag(name, name_len, dcl, 1); in parse_enum_specifier()
2556 zend_ffi_make_enum_type(dcl); in parse_enum_specifier()
2557 sym = parse_enumerator_list(sym, dcl); in parse_enum_specifier()
2563 sym = parse_attributes(sym, dcl); in parse_enum_specifier()
2633 static int parse_declarator(int sym, zend_ffi_dcl *dcl, const char **name, size_t *name_len) { in parse_declarator() argument
2637 sym = parse_pointer(sym, dcl); in parse_declarator()
2656 sym = parse_array_or_function_declarators(sym, dcl, &nested_dcl); in parse_declarator()
2658 if (nested) zend_ffi_nested_declaration(dcl, &nested_dcl); in parse_declarator()
2662 static int parse_abstract_declarator(int sym, zend_ffi_dcl *dcl) { in parse_abstract_declarator() argument
2666 sym = parse_pointer(sym, dcl); in parse_abstract_declarator()
2681 sym = parse_array_or_function_declarators(sym, dcl, &nested_dcl); in parse_abstract_declarator()
2683 if (nested) zend_ffi_nested_declaration(dcl, &nested_dcl); 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
2691 sym = parse_pointer(sym, dcl); in parse_parameter_declarator()
2711 sym = parse_array_or_function_declarators(sym, dcl, &nested_dcl); in parse_parameter_declarator()
2713 if (nested) zend_ffi_nested_declaration(dcl, &nested_dcl); in parse_parameter_declarator()
2717 static int parse_pointer(int sym, zend_ffi_dcl *dcl) { in parse_pointer() argument
2723 zend_ffi_make_pointer_type(dcl); in parse_pointer()
2725 sym = parse_type_qualifier_list(sym, dcl); 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
2854 sym = parse_array_or_function_declarators(sym, dcl, nested_dcl); in parse_array_or_function_declarators()
2856 dcl->attr |= attr; in parse_array_or_function_declarators()
2857 zend_ffi_make_array_type(dcl, &len); in parse_array_or_function_declarators()
2916 sym = parse_array_or_function_declarators(sym, dcl, nested_dcl); in parse_array_or_function_declarators()
2918 dcl->attr |= attr; in parse_array_or_function_declarators()
2919 zend_ffi_make_func_type(dcl, args, nested_dcl); in parse_array_or_function_declarators()
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()
2945 static int parse_attributes(int sym, zend_ffi_dcl *dcl) { in parse_attributes() argument
2962 sym = parse_attrib(sym, dcl); in parse_attributes()
2965 sym = parse_attrib(sym, dcl); in parse_attributes()
2987 zend_ffi_add_msvc_attribute_value(dcl, name, name_len, &val); in parse_attributes()
3001 zend_ffi_set_abi(dcl, ZEND_FFI_ABI_CDECL); in parse_attributes()
3005 zend_ffi_set_abi(dcl, ZEND_FFI_ABI_STDCALL); in parse_attributes()
3009 zend_ffi_set_abi(dcl, ZEND_FFI_ABI_FASTCALL); in parse_attributes()
3013 zend_ffi_set_abi(dcl, ZEND_FFI_ABI_THISCALL); in parse_attributes()
3017 zend_ffi_set_abi(dcl, ZEND_FFI_ABI_VECTORCALL); in parse_attributes()
3026 static int parse_attrib(int sym, zend_ffi_dcl *dcl) { in parse_attrib() argument
3036 zend_ffi_add_attribute(dcl, name, name_len); in parse_attrib()
3042 zend_ffi_add_attribute_value(dcl, name, name_len, 0, &val); in parse_attrib()
3047 zend_ffi_add_attribute_value(dcl, name, name_len, ++n, &val); in parse_attrib()
3363 zend_ffi_dcl dcl = ZEND_FFI_ATTR_INIT; in parse_cast_expression() local
3366 sym = parse_type_name(sym, &dcl); in parse_cast_expression()
3374 if (do_cast) zend_ffi_expr_cast(val, &dcl); in parse_cast_expression()
3381 zend_ffi_dcl dcl = ZEND_FFI_ATTR_INIT; in parse_unary_expression() local
3494 sym = parse_type_name(sym, &dcl); in parse_unary_expression()
3499 zend_ffi_expr_sizeof_type(val, &dcl); in parse_unary_expression()
3513 sym = parse_type_name(sym, &dcl); in parse_unary_expression()
3518 zend_ffi_expr_alignof_type(val, &dcl); in parse_unary_expression()
3525 sym = parse_type_name(sym, &dcl); in parse_unary_expression()
3530 zend_ffi_expr_alignof_type(val, &dcl); in parse_unary_expression()
3631 zend_result zend_ffi_parse_type(const char *str, size_t len, zend_ffi_dcl *dcl) { in zend_ffi_parse_type() argument
3640 sym = parse_type_name(get_sym(), dcl); in zend_ffi_parse_type()
3644 zend_ffi_validate_type_name(dcl); in zend_ffi_parse_type()