Lines Matching refs:kind

418 static inline zend_bool ast_kind_uses_attr(zend_ast_kind kind) {  in ast_kind_uses_attr()  argument
419 return kind == ZEND_AST_PARAM || kind == ZEND_AST_TYPE || kind == ZEND_AST_TRAIT_ALIAS in ast_kind_uses_attr()
420 || kind == ZEND_AST_UNARY_OP || kind == ZEND_AST_BINARY_OP || kind == ZEND_AST_ASSIGN_OP in ast_kind_uses_attr()
421 || kind == ZEND_AST_CAST || kind == ZEND_AST_MAGIC_CONST || kind == ZEND_AST_ARRAY_ELEM in ast_kind_uses_attr()
422 || kind == ZEND_AST_INCLUDE_OR_EVAL || kind == ZEND_AST_USE || kind == ZEND_AST_PROP_DECL in ast_kind_uses_attr()
423 || kind == ZEND_AST_PROP_GROUP in ast_kind_uses_attr()
424 || kind == ZEND_AST_GROUP_USE || kind == ZEND_AST_USE_ELEM in ast_kind_uses_attr()
425 || kind == AST_NAME || kind == AST_CLOSURE_VAR || kind == ZEND_AST_CLASS_CONST_DECL in ast_kind_uses_attr()
426 || kind == ZEND_AST_CLASS_CONST_GROUP in ast_kind_uses_attr()
427 || kind == ZEND_AST_ARRAY || kind == ZEND_AST_DIM || kind == ZEND_AST_CONDITIONAL in ast_kind_uses_attr()
428 || kind == ZEND_AST_VAR; in ast_kind_uses_attr()
432 static inline zend_bool ast_kind_is_decl(zend_ast_kind kind) { in ast_kind_is_decl() argument
433 return kind == ZEND_AST_FUNC_DECL || kind == ZEND_AST_CLOSURE in ast_kind_is_decl()
434 || kind == ZEND_AST_ARROW_FUNC in ast_kind_is_decl()
435 || kind == ZEND_AST_PROPERTY_HOOK in ast_kind_is_decl()
436 || kind == ZEND_AST_METHOD || kind == ZEND_AST_CLASS; in ast_kind_is_decl()
443 if (ast->kind != ZEND_AST_ZVAL || Z_TYPE_P(zend_ast_get_zval(ast)) != IS_STRING) { in ast_is_name()
447 if (parent->kind == ZEND_AST_NAME_LIST) { in ast_is_name()
451 if (parent->kind == ZEND_AST_TYPE_INTERSECTION) { in ast_is_name()
456 if (parent->kind == ZEND_AST_TYPE_UNION) { in ast_is_name()
462 return parent->kind == ZEND_AST_CATCH || parent->kind == ZEND_AST_CLASS in ast_is_name()
463 || parent->kind == ZEND_AST_PARAM || parent->kind == ZEND_AST_METHOD_REFERENCE in ast_is_name()
464 || parent->kind == ZEND_AST_CALL || parent->kind == ZEND_AST_CONST in ast_is_name()
465 || parent->kind == ZEND_AST_NEW || parent->kind == ZEND_AST_STATIC_CALL in ast_is_name()
466 || parent->kind == ZEND_AST_CLASS_CONST || parent->kind == ZEND_AST_STATIC_PROP in ast_is_name()
467 || parent->kind == ZEND_AST_PROP_GROUP || parent->kind == ZEND_AST_CLASS_NAME in ast_is_name()
469 || parent->kind == ZEND_AST_ATTRIBUTE in ast_is_name()
476 return parent->kind == ZEND_AST_CLASS_CONST_GROUP; in ast_is_name()
481 return parent->kind == ZEND_AST_INSTANCEOF; in ast_is_name()
485 return parent->kind == ZEND_AST_FUNC_DECL || parent->kind == ZEND_AST_CLOSURE in ast_is_name()
487 || parent->kind == ZEND_AST_ARROW_FUNC in ast_is_name()
489 || parent->kind == ZEND_AST_METHOD; in ast_is_name()
494 return parent->kind == ZEND_AST_CLASS; in ast_is_name()
504 if (parent->kind == ZEND_AST_TYPE_INTERSECTION) { in ast_is_type()
509 if (parent->kind == ZEND_AST_TYPE_UNION) { in ast_is_type()
514 return parent->kind == ZEND_AST_PARAM in ast_is_type()
516 || parent->kind == ZEND_AST_PROP_GROUP in ast_is_type()
522 return parent->kind == ZEND_AST_CLASS_CONST_GROUP; in ast_is_type()
526 return parent->kind == ZEND_AST_CLOSURE || parent->kind == ZEND_AST_FUNC_DECL in ast_is_type()
528 || parent->kind == ZEND_AST_ARROW_FUNC in ast_is_type()
530 || parent->kind == ZEND_AST_METHOD; in ast_is_type()
534 return parent->kind == ZEND_AST_CLASS; in ast_is_type()
541 return (parent->kind == ZEND_AST_STATIC && i == 0) in ast_is_var_name()
542 || (parent->kind == ZEND_AST_CATCH && i == 1 && ast != NULL); in ast_is_var_name()
547 if (ast && ast->kind == ZEND_AST_STMT_LIST) { in ast_should_normalize_list()
552 return parent->kind == ZEND_AST_DO_WHILE; in ast_should_normalize_list()
555 if (parent->kind == ZEND_AST_DECLARE) { in ast_should_normalize_list()
559 return parent->kind == ZEND_AST_IF_ELEM || parent->kind == ZEND_AST_WHILE; in ast_should_normalize_list()
562 return parent->kind == ZEND_AST_CATCH; in ast_should_normalize_list()
565 return parent->kind == ZEND_AST_FOR || parent->kind == ZEND_AST_FOREACH; in ast_should_normalize_list()
625 if (ast_kind_is_decl(ast->kind)) { in ast_get_children()
628 *count = decl->kind == ZEND_AST_CLASS ? (state->version >= 85 ? 5 : 4) : 5; in ast_get_children()
630 *count = decl->kind == ZEND_AST_CLASS ? 4 : 5; in ast_get_children()
632 *count = decl->kind == ZEND_AST_CLASS ? 3 : 4; in ast_get_children()
648 zval *zv, zend_ast_kind kind, zend_ast_attr attr, uint32_t lineno, in ast_create_virtual_node_ex() argument
657 AST_NODE_SET_PROP_KIND(obj, kind); in ast_create_virtual_node_ex()
667 zend_string *child_name = ast_kind_child_name(kind, i); in ast_create_virtual_node_ex()
678 zval *zv, zend_ast_kind kind, zend_ast_attr attr, zend_ast *child, ast_state_info_t *state) { in ast_create_virtual_node() argument
682 zv, kind, attr, zend_ast_get_lineno(child), state, 1, &child_zv); in ast_create_virtual_node()
730 const zend_ast_kind ast_kind = ast->kind; in ast_fill_children_ht()
737 if (child != NULL && child->kind == ZEND_AST_STMT_LIST) { in ast_fill_children_ht()
810 } else if (child && child->kind == ZEND_AST_TYPE && (child->attr & ZEND_TYPE_NULLABLE)) { in ast_fill_children_ht()
931 if (ast->kind == ZEND_AST_ZVAL) { in ast_to_zval()
936 switch (ast->kind) { in ast_to_zval()
943 ast->kind = ZEND_AST_BINARY_OP; in ast_to_zval()
947 ast->kind = ZEND_AST_BINARY_OP; in ast_to_zval()
951 ast->kind = ZEND_AST_BINARY_OP; in ast_to_zval()
955 ast->kind = ZEND_AST_BINARY_OP; in ast_to_zval()
959 ast->kind = ZEND_AST_BINARY_OP; in ast_to_zval()
963 ast->kind = ZEND_AST_UNARY_OP; in ast_to_zval()
967 ast->kind = ZEND_AST_UNARY_OP; in ast_to_zval()
971 ast->kind = ZEND_AST_UNARY_OP; in ast_to_zval()
998 ast->kind = ZEND_AST_ASSIGN_OP; in ast_to_zval()
1031 if (class_name_ast->kind == ZEND_AST_ZVAL) { in ast_to_zval()
1055 zend_ast_kind kind = ast->kind; in ast_to_zval() local
1056 AST_NODE_SET_PROP_KIND(obj, kind); in ast_to_zval()
1063 if (ast_kind_is_decl(kind)) { in ast_to_zval()
1067 if (kind == ZEND_AST_CLASS) { in ast_to_zval()
1077 if (kind == ZEND_AST_CLOSURE || kind == ZEND_AST_ARROW_FUNC) { in ast_to_zval()
1108 if (ast->kind == ZEND_AST_PROP_DECL && state->version >= 70) { in ast_to_zval()
1126 if (ast->kind == ZEND_AST_CLASS_CONST_DECL && state->version >= 80) { in ast_to_zval()
1273 zend_long kind; in PHP_FUNCTION() local
1276 if (zend_parse_parameters_throw(ZEND_NUM_ARGS(), "l", &kind) == FAILURE) { in PHP_FUNCTION()
1280 name = ast_kind_to_name(kind); in PHP_FUNCTION()
1282 ast_throw_exception(spl_ce_LogicException, "Unknown kind " ZEND_LONG_FMT, kind); in PHP_FUNCTION()
1290 zend_long kind; in PHP_FUNCTION() local
1292 if (zend_parse_parameters_throw(ZEND_NUM_ARGS(), "l", &kind) == FAILURE) { in PHP_FUNCTION()
1296 RETURN_BOOL(ast_kind_uses_attr(kind) || ast_kind_is_decl(kind)); in PHP_FUNCTION()
1314 zend_ast_kind kind = ast_kinds[i]; in ast_build_metadata() local
1315 const ast_flag_info *flag_info = ast_get_flag_info(kind); in ast_build_metadata()
1323 ZVAL_LONG(AST_METADATA_PROP_KIND(obj), kind); in ast_build_metadata()
1326 ZVAL_STRING(AST_METADATA_PROP_NAME(obj), ast_kind_to_name(kind)); in ast_build_metadata()
1341 add_index_zval(result, kind, &info_zv); in ast_build_metadata()
1381 zend_long kind; in PHP_METHOD() local
1389 Z_PARAM_LONG_EX(kind, kindNull, 1, 0) in PHP_METHOD()
1415 AST_NODE_SET_PROP_KIND(obj, kind); in PHP_METHOD()