Lines Matching refs:db

37     const char* parse_type(const char* first, const char* last, C& db);
39 const char* parse_encoding(const char* first, const char* last, C& db);
41 const char* parse_name(const char* first, const char* last, C& db,
44 const char* parse_expression(const char* first, const char* last, C& db);
46 const char* parse_template_args(const char* first, const char* last, C& db);
48 const char* parse_operator_name(const char* first, const char* last, C& db);
50 const char* parse_unqualified_name(const char* first, const char* last, C& db);
52 const char* parse_decltype(const char* first, const char* last, C& db);
56 print_stack(const C& db) in print_stack() argument
60 for (auto& s : db.names) in print_stack()
64 for (auto& v : db.subs) in print_stack()
76 for (auto& t : db.template_param) in print_stack()
97 print_state(const char* msg, const char* first, const char* last, const C& db) in print_state() argument
103 print_stack(db); in print_state()
172 parse_floating_number(const char* first, const char* last, C& db) in parse_floating_number() argument
205 db.names.push_back(typename C::String(num, static_cast<std::size_t>(n))); in parse_floating_number()
216 parse_source_name(const char* first, const char* last, C& db) in parse_source_name() argument
235 db.names.push_back("(anonymous namespace)"); in parse_source_name()
237 db.names.push_back(std::move(r)); in parse_source_name()
258 parse_substitution(const char* first, const char* last, C& db) in parse_substitution() argument
267 db.names.push_back("std::allocator"); in parse_substitution()
271 db.names.push_back("std::basic_string"); in parse_substitution()
275 db.names.push_back("std::string"); in parse_substitution()
279 db.names.push_back("std::istream"); in parse_substitution()
283 db.names.push_back("std::ostream"); in parse_substitution()
287 db.names.push_back("std::iostream"); in parse_substitution()
291 if (!db.subs.empty()) in parse_substitution()
293 for (const auto& n : db.subs.front()) in parse_substitution()
294 db.names.push_back(n); in parse_substitution()
318 if (sub < db.subs.size()) in parse_substitution()
320 for (const auto& n : db.subs[sub]) in parse_substitution()
321 db.names.push_back(n); in parse_substitution()
366 parse_builtin_type(const char* first, const char* last, C& db) in parse_builtin_type() argument
373 db.names.push_back("void"); in parse_builtin_type()
377 db.names.push_back("wchar_t"); in parse_builtin_type()
381 db.names.push_back("bool"); in parse_builtin_type()
385 db.names.push_back("char"); in parse_builtin_type()
389 db.names.push_back("signed char"); in parse_builtin_type()
393 db.names.push_back("unsigned char"); in parse_builtin_type()
397 db.names.push_back("short"); in parse_builtin_type()
401 db.names.push_back("unsigned short"); in parse_builtin_type()
405 db.names.push_back("int"); in parse_builtin_type()
409 db.names.push_back("unsigned int"); in parse_builtin_type()
413 db.names.push_back("long"); in parse_builtin_type()
417 db.names.push_back("unsigned long"); in parse_builtin_type()
421 db.names.push_back("long long"); in parse_builtin_type()
425 db.names.push_back("unsigned long long"); in parse_builtin_type()
429 db.names.push_back("__int128"); in parse_builtin_type()
433 db.names.push_back("unsigned __int128"); in parse_builtin_type()
437 db.names.push_back("float"); in parse_builtin_type()
441 db.names.push_back("double"); in parse_builtin_type()
445 db.names.push_back("long double"); in parse_builtin_type()
449 db.names.push_back("__float128"); in parse_builtin_type()
453 db.names.push_back("..."); in parse_builtin_type()
458 const char*t = parse_source_name(first+1, last, db); in parse_builtin_type()
469 db.names.push_back("decimal64"); in parse_builtin_type()
473 db.names.push_back("decimal128"); in parse_builtin_type()
477 db.names.push_back("decimal32"); in parse_builtin_type()
481 db.names.push_back("decimal16"); in parse_builtin_type()
485 db.names.push_back("char32_t"); in parse_builtin_type()
489 db.names.push_back("char16_t"); in parse_builtin_type()
493 db.names.push_back("auto"); in parse_builtin_type()
497 db.names.push_back("decltype(auto)"); in parse_builtin_type()
501 db.names.push_back("std::nullptr_t"); in parse_builtin_type()
544 parse_template_param(const char* first, const char* last, C& db) in parse_template_param() argument
552 if (db.template_param.empty()) in parse_template_param()
554 if (!db.template_param.back().empty()) in parse_template_param()
556 for (auto& t : db.template_param.back().front()) in parse_template_param()
557 db.names.push_back(t); in parse_template_param()
562 db.names.push_back("T_"); in parse_template_param()
564 db.fix_forward_references = true; in parse_template_param()
576 if (t == last || *t != '_' || db.template_param.empty()) in parse_template_param()
579 if (sub < db.template_param.back().size()) in parse_template_param()
581 for (auto& temp : db.template_param.back()[sub]) in parse_template_param()
582 db.names.push_back(temp); in parse_template_param()
587 db.names.push_back(typename C::String(first, t+1)); in parse_template_param()
589 db.fix_forward_references = true; in parse_template_param()
601 parse_const_cast_expr(const char* first, const char* last, C& db) in parse_const_cast_expr() argument
605 const char* t = parse_type(first+2, last, db); in parse_const_cast_expr()
608 const char* t1 = parse_expression(t, last, db); in parse_const_cast_expr()
611 if (db.names.size() < 2) in parse_const_cast_expr()
613 auto expr = db.names.back().move_full(); in parse_const_cast_expr()
614 db.names.pop_back(); in parse_const_cast_expr()
615 db.names.back() = "const_cast<" + db.names.back().move_full() + ">(" + expr + ")"; in parse_const_cast_expr()
627 parse_dynamic_cast_expr(const char* first, const char* last, C& db) in parse_dynamic_cast_expr() argument
631 const char* t = parse_type(first+2, last, db); in parse_dynamic_cast_expr()
634 const char* t1 = parse_expression(t, last, db); in parse_dynamic_cast_expr()
637 if (db.names.size() < 2) in parse_dynamic_cast_expr()
639 auto expr = db.names.back().move_full(); in parse_dynamic_cast_expr()
640 db.names.pop_back(); in parse_dynamic_cast_expr()
641 db.names.back() = "dynamic_cast<" + db.names.back().move_full() + ">(" + expr + ")"; in parse_dynamic_cast_expr()
653 parse_reinterpret_cast_expr(const char* first, const char* last, C& db) in parse_reinterpret_cast_expr() argument
657 const char* t = parse_type(first+2, last, db); in parse_reinterpret_cast_expr()
660 const char* t1 = parse_expression(t, last, db); in parse_reinterpret_cast_expr()
663 if (db.names.size() < 2) in parse_reinterpret_cast_expr()
665 auto expr = db.names.back().move_full(); in parse_reinterpret_cast_expr()
666 db.names.pop_back(); in parse_reinterpret_cast_expr()
667db.names.back() = "reinterpret_cast<" + db.names.back().move_full() + ">(" + expr + ")"; in parse_reinterpret_cast_expr()
679 parse_static_cast_expr(const char* first, const char* last, C& db) in parse_static_cast_expr() argument
683 const char* t = parse_type(first+2, last, db); in parse_static_cast_expr()
686 const char* t1 = parse_expression(t, last, db); in parse_static_cast_expr()
689 if (db.names.size() < 2) in parse_static_cast_expr()
691 auto expr = db.names.back().move_full(); in parse_static_cast_expr()
692 db.names.pop_back(); in parse_static_cast_expr()
693 db.names.back() = "static_cast<" + db.names.back().move_full() + ">(" + expr + ")"; in parse_static_cast_expr()
705 parse_pack_expansion(const char* first, const char* last, C& db) in parse_pack_expansion() argument
709 const char* t = parse_expression(first+2, last, db); in parse_pack_expansion()
720 parse_sizeof_type_expr(const char* first, const char* last, C& db) in parse_sizeof_type_expr() argument
724 const char* t = parse_type(first+2, last, db); in parse_sizeof_type_expr()
727 if (db.names.empty()) in parse_sizeof_type_expr()
729 db.names.back() = "sizeof (" + db.names.back().move_full() + ")"; in parse_sizeof_type_expr()
740 parse_sizeof_expr_expr(const char* first, const char* last, C& db) in parse_sizeof_expr_expr() argument
744 const char* t = parse_expression(first+2, last, db); in parse_sizeof_expr_expr()
747 if (db.names.empty()) in parse_sizeof_expr_expr()
749 db.names.back() = "sizeof (" + db.names.back().move_full() + ")"; in parse_sizeof_expr_expr()
760 parse_sizeof_param_pack_expr(const char* first, const char* last, C& db) in parse_sizeof_param_pack_expr() argument
764 size_t k0 = db.names.size(); in parse_sizeof_param_pack_expr()
765 const char* t = parse_template_param(first+2, last, db); in parse_sizeof_param_pack_expr()
766 size_t k1 = db.names.size(); in parse_sizeof_param_pack_expr()
773 tmp += db.names[k].move_full(); in parse_sizeof_param_pack_expr()
775 tmp += ", " + db.names[k].move_full(); in parse_sizeof_param_pack_expr()
779 db.names.pop_back(); in parse_sizeof_param_pack_expr()
780 db.names.push_back(std::move(tmp)); in parse_sizeof_param_pack_expr()
794 parse_function_param(const char* first, const char* last, C& db) in parse_function_param() argument
805 db.names.push_back("fp" + typename C::String(t, t1)); in parse_function_param()
820 db.names.push_back("fp" + typename C::String(t, t1)); in parse_function_param()
833 parse_sizeof_function_param_pack_expr(const char* first, const char* last, C& db) in parse_sizeof_function_param_pack_expr() argument
837 const char* t = parse_function_param(first+2, last, db); in parse_sizeof_function_param_pack_expr()
840 if (db.names.empty()) in parse_sizeof_function_param_pack_expr()
842 db.names.back() = "sizeof...(" + db.names.back().move_full() + ")"; in parse_sizeof_function_param_pack_expr()
854 parse_typeid_expr(const char* first, const char* last, C& db) in parse_typeid_expr() argument
860 t = parse_expression(first+2, last, db); in parse_typeid_expr()
862 t = parse_type(first+2, last, db); in parse_typeid_expr()
865 if (db.names.empty()) in parse_typeid_expr()
867 db.names.back() = "typeid(" + db.names.back().move_full() + ")"; in parse_typeid_expr()
878 parse_throw_expr(const char* first, const char* last, C& db) in parse_throw_expr() argument
882 const char* t = parse_expression(first+2, last, db); in parse_throw_expr()
885 if (db.names.empty()) in parse_throw_expr()
887 db.names.back() = "throw " + db.names.back().move_full(); in parse_throw_expr()
898 parse_dot_star_expr(const char* first, const char* last, C& db) in parse_dot_star_expr() argument
902 const char* t = parse_expression(first+2, last, db); in parse_dot_star_expr()
905 const char* t1 = parse_expression(t, last, db); in parse_dot_star_expr()
908 if (db.names.size() < 2) in parse_dot_star_expr()
910 auto expr = db.names.back().move_full(); in parse_dot_star_expr()
911 db.names.pop_back(); in parse_dot_star_expr()
912 db.names.back().first += ".*" + expr; in parse_dot_star_expr()
924 parse_simple_id(const char* first, const char* last, C& db) in parse_simple_id() argument
928 const char* t = parse_source_name(first, last, db); in parse_simple_id()
931 const char* t1 = parse_template_args(t, last, db); in parse_simple_id()
934 if (db.names.size() < 2) in parse_simple_id()
936 auto args = db.names.back().move_full(); in parse_simple_id()
937 db.names.pop_back(); in parse_simple_id()
938 db.names.back().first += std::move(args); in parse_simple_id()
954 parse_unresolved_type(const char* first, const char* last, C& db) in parse_unresolved_type() argument
963 size_t k0 = db.names.size(); in parse_unresolved_type()
964 t = parse_template_param(first, last, db); in parse_unresolved_type()
965 size_t k1 = db.names.size(); in parse_unresolved_type()
968db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator())); in parse_unresolved_type()
974 db.names.pop_back(); in parse_unresolved_type()
979 t = parse_decltype(first, last, db); in parse_unresolved_type()
982 if (db.names.empty()) in parse_unresolved_type()
984db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator())); in parse_unresolved_type()
989 t = parse_substitution(first, last, db); in parse_unresolved_type()
996 t = parse_unqualified_name(first+2, last, db); in parse_unresolved_type()
999 if (db.names.empty()) in parse_unresolved_type()
1001 db.names.back().first.insert(0, "std::"); in parse_unresolved_type()
1002db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator())); in parse_unresolved_type()
1018 parse_destructor_name(const char* first, const char* last, C& db) in parse_destructor_name() argument
1022 const char* t = parse_unresolved_type(first, last, db); in parse_destructor_name()
1024 t = parse_simple_id(first, last, db); in parse_destructor_name()
1027 if (db.names.empty()) in parse_destructor_name()
1029 db.names.back().first.insert(0, "~"); in parse_destructor_name()
1046 parse_base_unresolved_name(const char* first, const char* last, C& db) in parse_base_unresolved_name() argument
1054 const char* t = parse_operator_name(first+2, last, db); in parse_base_unresolved_name()
1057 first = parse_template_args(t, last, db); in parse_base_unresolved_name()
1060 if (db.names.size() < 2) in parse_base_unresolved_name()
1062 auto args = db.names.back().move_full(); in parse_base_unresolved_name()
1063 db.names.pop_back(); in parse_base_unresolved_name()
1064 db.names.back().first += std::move(args); in parse_base_unresolved_name()
1070 const char* t = parse_destructor_name(first+2, last, db); in parse_base_unresolved_name()
1077 const char* t = parse_simple_id(first, last, db); in parse_base_unresolved_name()
1080 t = parse_operator_name(first, last, db); in parse_base_unresolved_name()
1083 first = parse_template_args(t, last, db); in parse_base_unresolved_name()
1086 if (db.names.size() < 2) in parse_base_unresolved_name()
1088 auto args = db.names.back().move_full(); in parse_base_unresolved_name()
1089 db.names.pop_back(); in parse_base_unresolved_name()
1090 db.names.back().first += std::move(args); in parse_base_unresolved_name()
1105 parse_unresolved_qualifier_level(const char* first, const char* last, C& db) in parse_unresolved_qualifier_level() argument
1107 return parse_simple_id(first, last, db); in parse_unresolved_qualifier_level()
1122 parse_unresolved_name(const char* first, const char* last, C& db) in parse_unresolved_name() argument
1133 const char* t2 = parse_base_unresolved_name(t, last, db); in parse_unresolved_name()
1138 if (db.names.empty()) in parse_unresolved_name()
1140 db.names.back().first.insert(0, "::"); in parse_unresolved_name()
1149 const char* t1 = parse_unresolved_type(t, last, db); in parse_unresolved_name()
1153 t1 = parse_template_args(t, last, db); in parse_unresolved_name()
1156 if (db.names.size() < 2) in parse_unresolved_name()
1158 auto args = db.names.back().move_full(); in parse_unresolved_name()
1159 db.names.pop_back(); in parse_unresolved_name()
1160 db.names.back().first += std::move(args); in parse_unresolved_name()
1164 db.names.pop_back(); in parse_unresolved_name()
1170 t1 = parse_unresolved_qualifier_level(t, last, db); in parse_unresolved_name()
1171 if (t1 == t || t1 == last || db.names.size() < 2) in parse_unresolved_name()
1173 auto s = db.names.back().move_full(); in parse_unresolved_name()
1174 db.names.pop_back(); in parse_unresolved_name()
1175 db.names.back().first += "::" + std::move(s); in parse_unresolved_name()
1179 t1 = parse_base_unresolved_name(t, last, db); in parse_unresolved_name()
1182 if (!db.names.empty()) in parse_unresolved_name()
1183 db.names.pop_back(); in parse_unresolved_name()
1186 if (db.names.size() < 2) in parse_unresolved_name()
1188 auto s = db.names.back().move_full(); in parse_unresolved_name()
1189 db.names.pop_back(); in parse_unresolved_name()
1190 db.names.back().first += "::" + std::move(s); in parse_unresolved_name()
1196 const char* t1 = parse_unresolved_type(t, last, db); in parse_unresolved_name()
1200 t1 = parse_template_args(t, last, db); in parse_unresolved_name()
1203 if (db.names.size() < 2) in parse_unresolved_name()
1205 auto args = db.names.back().move_full(); in parse_unresolved_name()
1206 db.names.pop_back(); in parse_unresolved_name()
1207 db.names.back().first += std::move(args); in parse_unresolved_name()
1210 t1 = parse_base_unresolved_name(t, last, db); in parse_unresolved_name()
1213 if (!db.names.empty()) in parse_unresolved_name()
1214 db.names.pop_back(); in parse_unresolved_name()
1217 if (db.names.size() < 2) in parse_unresolved_name()
1219 auto s = db.names.back().move_full(); in parse_unresolved_name()
1220 db.names.pop_back(); in parse_unresolved_name()
1221 db.names.back().first += "::" + std::move(s); in parse_unresolved_name()
1226 t1 = parse_unresolved_qualifier_level(t, last, db); in parse_unresolved_name()
1232 if (db.names.empty()) in parse_unresolved_name()
1234 db.names.back().first.insert(0, "::"); in parse_unresolved_name()
1238 t1 = parse_unresolved_qualifier_level(t, last, db); in parse_unresolved_name()
1239 if (t1 == t || t1 == last || db.names.size() < 2) in parse_unresolved_name()
1241 auto s = db.names.back().move_full(); in parse_unresolved_name()
1242 db.names.pop_back(); in parse_unresolved_name()
1243 db.names.back().first += "::" + std::move(s); in parse_unresolved_name()
1247 t1 = parse_base_unresolved_name(t, last, db); in parse_unresolved_name()
1250 if (!db.names.empty()) in parse_unresolved_name()
1251 db.names.pop_back(); in parse_unresolved_name()
1254 if (db.names.size() < 2) in parse_unresolved_name()
1256 auto s = db.names.back().move_full(); in parse_unresolved_name()
1257 db.names.pop_back(); in parse_unresolved_name()
1258 db.names.back().first += "::" + std::move(s); in parse_unresolved_name()
1271 parse_dot_expr(const char* first, const char* last, C& db) in parse_dot_expr() argument
1275 const char* t = parse_expression(first+2, last, db); in parse_dot_expr()
1278 const char* t1 = parse_unresolved_name(t, last, db); in parse_dot_expr()
1281 if (db.names.size() < 2) in parse_dot_expr()
1283 auto name = db.names.back().move_full(); in parse_dot_expr()
1284 db.names.pop_back(); in parse_dot_expr()
1285 db.names.back().first += "." + name; in parse_dot_expr()
1297 parse_call_expr(const char* first, const char* last, C& db) in parse_call_expr() argument
1301 const char* t = parse_expression(first+2, last, db); in parse_call_expr()
1306 if (db.names.empty()) in parse_call_expr()
1308 db.names.back().first += db.names.back().second; in parse_call_expr()
1309 db.names.back().second = typename C::String(); in parse_call_expr()
1310 db.names.back().first.append("("); in parse_call_expr()
1314 const char* t1 = parse_expression(t, last, db); in parse_call_expr()
1317 if (db.names.empty()) in parse_call_expr()
1319 auto tmp = db.names.back().move_full(); in parse_call_expr()
1320 db.names.pop_back(); in parse_call_expr()
1323 if (db.names.empty()) in parse_call_expr()
1327 db.names.back().first.append(", "); in parse_call_expr()
1330 db.names.back().first.append(tmp); in parse_call_expr()
1335 if (db.names.empty()) in parse_call_expr()
1337 db.names.back().first.append(")"); in parse_call_expr()
1352 parse_new_expr(const char* first, const char* last, C& db) in parse_new_expr() argument
1373 const char* t1 = parse_expression(t, last, db); in parse_new_expr()
1379 if (db.names.empty()) in parse_new_expr()
1381 auto tmp = db.names.back().move_full(); in parse_new_expr()
1382 db.names.pop_back(); in parse_new_expr()
1385 if (db.names.empty()) in parse_new_expr()
1387 db.names.back().first.append(", "); in parse_new_expr()
1388 db.names.back().first.append(tmp); in parse_new_expr()
1395 const char* t1 = parse_type(t, last, db); in parse_new_expr()
1407 t1 = parse_expression(t, last, db); in parse_new_expr()
1412 if (db.names.empty()) in parse_new_expr()
1414 auto tmp = db.names.back().move_full(); in parse_new_expr()
1415 db.names.pop_back(); in parse_new_expr()
1418 if (db.names.empty()) in parse_new_expr()
1420 db.names.back().first.append(", "); in parse_new_expr()
1421 db.names.back().first.append(tmp); in parse_new_expr()
1433 if (db.names.empty()) in parse_new_expr()
1435 init_list = db.names.back().move_full(); in parse_new_expr()
1436 db.names.pop_back(); in parse_new_expr()
1438 if (db.names.empty()) in parse_new_expr()
1440 auto type = db.names.back().move_full(); in parse_new_expr()
1441 db.names.pop_back(); in parse_new_expr()
1445 if (db.names.empty()) in parse_new_expr()
1447 expr_list = db.names.back().move_full(); in parse_new_expr()
1448 db.names.pop_back(); in parse_new_expr()
1462 db.names.push_back(std::move(r)); in parse_new_expr()
1474 parse_conversion_expr(const char* first, const char* last, C& db) in parse_conversion_expr() argument
1478 bool try_to_parse_template_args = db.try_to_parse_template_args; in parse_conversion_expr()
1479 db.try_to_parse_template_args = false; in parse_conversion_expr()
1480 const char* t = parse_type(first+2, last, db); in parse_conversion_expr()
1481 db.try_to_parse_template_args = try_to_parse_template_args; in parse_conversion_expr()
1486 const char* t1 = parse_expression(t, last, db); in parse_conversion_expr()
1497 db.names.emplace_back(); in parse_conversion_expr()
1503 const char* t1 = parse_expression(t, last, db); in parse_conversion_expr()
1508 if (db.names.empty()) in parse_conversion_expr()
1510 auto tmp = db.names.back().move_full(); in parse_conversion_expr()
1511 db.names.pop_back(); in parse_conversion_expr()
1514 if (db.names.empty()) in parse_conversion_expr()
1516 db.names.back().first.append(", "); in parse_conversion_expr()
1517 db.names.back().first.append(tmp); in parse_conversion_expr()
1526 if (db.names.size() < 2) in parse_conversion_expr()
1528 auto tmp = db.names.back().move_full(); in parse_conversion_expr()
1529 db.names.pop_back(); in parse_conversion_expr()
1530 db.names.back() = "(" + db.names.back().move_full() + ")(" + tmp + ")"; in parse_conversion_expr()
1541 parse_arrow_expr(const char* first, const char* last, C& db) in parse_arrow_expr() argument
1545 const char* t = parse_expression(first+2, last, db); in parse_arrow_expr()
1548 const char* t1 = parse_expression(t, last, db); in parse_arrow_expr()
1551 if (db.names.size() < 2) in parse_arrow_expr()
1553 auto tmp = db.names.back().move_full(); in parse_arrow_expr()
1554 db.names.pop_back(); in parse_arrow_expr()
1555 db.names.back().first += "->"; in parse_arrow_expr()
1556 db.names.back().first += tmp; in parse_arrow_expr()
1571 parse_function_type(const char* first, const char* last, C& db) in parse_function_type() argument
1585 const char* t1 = parse_type(t, last, db); in parse_function_type()
1595 db.names.pop_back(); in parse_function_type()
1620 size_t k0 = db.names.size(); in parse_function_type()
1621 t1 = parse_type(t, last, db); in parse_function_type()
1622 size_t k1 = db.names.size(); in parse_function_type()
1629 sig += db.names[k].move_full(); in parse_function_type()
1632 db.names.pop_back(); in parse_function_type()
1645 if (db.names.empty()) in parse_function_type()
1647 db.names.back().first += " "; in parse_function_type()
1648 db.names.back().second.insert(0, sig); in parse_function_type()
1660 parse_pointer_to_member_type(const char* first, const char* last, C& db) in parse_pointer_to_member_type() argument
1664 const char* t = parse_type(first+1, last, db); in parse_pointer_to_member_type()
1667 const char* t2 = parse_type(t, last, db); in parse_pointer_to_member_type()
1670 if (db.names.size() < 2) in parse_pointer_to_member_type()
1672 auto func = std::move(db.names.back()); in parse_pointer_to_member_type()
1673 db.names.pop_back(); in parse_pointer_to_member_type()
1674 auto class_type = std::move(db.names.back()); in parse_pointer_to_member_type()
1677db.names.back().first = std::move(func.first) + "(" + class_type.move_full() + "::*"; in parse_pointer_to_member_type()
1678 db.names.back().second = ")" + std::move(func.second); in parse_pointer_to_member_type()
1682db.names.back().first = std::move(func.first) + " " + class_type.move_full() + "::*"; in parse_pointer_to_member_type()
1683 db.names.back().second = std::move(func.second); in parse_pointer_to_member_type()
1697 parse_array_type(const char* first, const char* last, C& db) in parse_array_type() argument
1703 const char* t = parse_type(first+2, last, db); in parse_array_type()
1706 if (db.names.empty()) in parse_array_type()
1708 if (db.names.back().second.substr(0, 2) == " [") in parse_array_type()
1709 db.names.back().second.erase(0, 1); in parse_array_type()
1710 db.names.back().second.insert(0, " []"); in parse_array_type()
1719 const char* t2 = parse_type(t+1, last, db); in parse_array_type()
1722 if (db.names.empty()) in parse_array_type()
1724 if (db.names.back().second.substr(0, 2) == " [") in parse_array_type()
1725 db.names.back().second.erase(0, 1); in parse_array_type()
1726 db.names.back().second.insert(0, " [" + typename C::String(first+1, t) + "]"); in parse_array_type()
1733 const char* t = parse_expression(first+1, last, db); in parse_array_type()
1736 const char* t2 = parse_type(++t, last, db); in parse_array_type()
1739 if (db.names.size() < 2) in parse_array_type()
1741 auto type = std::move(db.names.back()); in parse_array_type()
1742 db.names.pop_back(); in parse_array_type()
1743 auto expr = std::move(db.names.back()); in parse_array_type()
1744 db.names.back().first = std::move(type.first); in parse_array_type()
1747 db.names.back().second = " [" + expr.move_full() + "]" + std::move(type.second); in parse_array_type()
1761 parse_decltype(const char* first, const char* last, C& db) in parse_decltype() argument
1770 const char* t = parse_expression(first+2, last, db); in parse_decltype()
1773 if (db.names.empty()) in parse_decltype()
1775 db.names.back() = "decltype(" + db.names.back().move_full() + ")"; in parse_decltype()
1794 parse_vector_type(const char* first, const char* last, C& db) in parse_vector_type() argument
1809 const char* t1 = parse_type(t, last, db); in parse_vector_type()
1812 if (db.names.empty()) in parse_vector_type()
1814 db.names.back().first += " vector[" + typename C::String(num, sz) + "]"; in parse_vector_type()
1821 db.names.push_back("pixel vector[" + typename C::String(num, sz) + "]"); in parse_vector_type()
1832 const char* t = parse_expression(t1, last, db); in parse_vector_type()
1835 if (db.names.empty()) in parse_vector_type()
1837 num = db.names.back().move_full(); in parse_vector_type()
1838 db.names.pop_back(); in parse_vector_type()
1844 const char* t = parse_type(t1, last, db); in parse_vector_type()
1847 if (db.names.empty()) in parse_vector_type()
1849 db.names.back().first += " vector[" + num + "]"; in parse_vector_type()
1883 parse_type(const char* first, const char* last, C& db) in parse_type() argument
1898 size_t k0 = db.names.size(); in parse_type()
1899 const char* t1 = parse_type(t, last, db); in parse_type()
1900 size_t k1 = db.names.size(); in parse_type()
1904 db.subs.pop_back(); in parse_type()
1905 db.subs.emplace_back(db.names.get_allocator()); in parse_type()
1910 size_t p = db.names[k].second.size(); in parse_type()
1911 if (db.names[k].second[p-2] == '&') in parse_type()
1913 else if (db.names[k].second.back() == '&') in parse_type()
1917 db.names[k].second.insert(p, " const"); in parse_type()
1922 db.names[k].second.insert(p, " volatile"); in parse_type()
1926 db.names[k].second.insert(p, " restrict"); in parse_type()
1931 db.names[k].first.append(" const"); in parse_type()
1933 db.names[k].first.append(" volatile"); in parse_type()
1935 db.names[k].first.append(" restrict"); in parse_type()
1937 db.subs.back().push_back(db.names[k]); in parse_type()
1946 const char* t = parse_builtin_type(first, last, db); in parse_type()
1956 t = parse_array_type(first, last, db); in parse_type()
1959 if (db.names.empty()) in parse_type()
1962db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator())); in parse_type()
1966 t = parse_type(first+1, last, db); in parse_type()
1969 if (db.names.empty()) in parse_type()
1971 db.names.back().first.append(" complex"); in parse_type()
1973db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator())); in parse_type()
1977 t = parse_function_type(first, last, db); in parse_type()
1980 if (db.names.empty()) in parse_type()
1983db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator())); in parse_type()
1987 t = parse_type(first+1, last, db); in parse_type()
1990 if (db.names.empty()) in parse_type()
1992 db.names.back().first.append(" imaginary"); in parse_type()
1994db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator())); in parse_type()
1998 t = parse_pointer_to_member_type(first, last, db); in parse_type()
2001 if (db.names.empty()) in parse_type()
2004db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator())); in parse_type()
2009 size_t k0 = db.names.size(); in parse_type()
2010 t = parse_type(first+1, last, db); in parse_type()
2011 size_t k1 = db.names.size(); in parse_type()
2014 db.subs.emplace_back(db.names.get_allocator()); in parse_type()
2017 if (db.names[k].second.substr(0, 2) == " [") in parse_type()
2019 db.names[k].first += " ("; in parse_type()
2020 db.names[k].second.insert(0, ")"); in parse_type()
2022 else if (db.names[k].second.front() == '(') in parse_type()
2024 db.names[k].first += "("; in parse_type()
2025 db.names[k].second.insert(0, ")"); in parse_type()
2027 db.names[k].first.append("&&"); in parse_type()
2028 db.subs.back().push_back(db.names[k]); in parse_type()
2036 size_t k0 = db.names.size(); in parse_type()
2037 t = parse_type(first+1, last, db); in parse_type()
2038 size_t k1 = db.names.size(); in parse_type()
2041 db.subs.emplace_back(db.names.get_allocator()); in parse_type()
2044 if (db.names[k].second.substr(0, 2) == " [") in parse_type()
2046 db.names[k].first += " ("; in parse_type()
2047 db.names[k].second.insert(0, ")"); in parse_type()
2049 else if (db.names[k].second.front() == '(') in parse_type()
2051 db.names[k].first += "("; in parse_type()
2052 db.names[k].second.insert(0, ")"); in parse_type()
2054 … if (first[1] != 'U' || db.names[k].first.substr(0, 12) != "objc_object<") in parse_type()
2056 db.names[k].first.append("*"); in parse_type()
2060 db.names[k].first.replace(0, 11, "id"); in parse_type()
2062 db.subs.back().push_back(db.names[k]); in parse_type()
2070 size_t k0 = db.names.size(); in parse_type()
2071 t = parse_type(first+1, last, db); in parse_type()
2072 size_t k1 = db.names.size(); in parse_type()
2075 db.subs.emplace_back(db.names.get_allocator()); in parse_type()
2078 if (db.names[k].second.substr(0, 2) == " [") in parse_type()
2080 db.names[k].first += " ("; in parse_type()
2081 db.names[k].second.insert(0, ")"); in parse_type()
2083 else if (db.names[k].second.front() == '(') in parse_type()
2085 db.names[k].first += "("; in parse_type()
2086 db.names[k].second.insert(0, ")"); in parse_type()
2088 db.names[k].first.append("&"); in parse_type()
2089 db.subs.back().push_back(db.names[k]); in parse_type()
2097 size_t k0 = db.names.size(); in parse_type()
2098 t = parse_template_param(first, last, db); in parse_type()
2099 size_t k1 = db.names.size(); in parse_type()
2102 db.subs.emplace_back(db.names.get_allocator()); in parse_type()
2104 db.subs.back().push_back(db.names[k]); in parse_type()
2105 if (db.try_to_parse_template_args && k1 == k0+1) in parse_type()
2107 const char* t1 = parse_template_args(t, last, db); in parse_type()
2110 auto args = db.names.back().move_full(); in parse_type()
2111 db.names.pop_back(); in parse_type()
2112 db.names.back().first += std::move(args); in parse_type()
2113db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator())); in parse_type()
2124 t = parse_source_name(first+1, last, db); in parse_type()
2127 const char* t2 = parse_type(t, last, db); in parse_type()
2130 if (db.names.size() < 2) in parse_type()
2132 auto type = db.names.back().move_full(); in parse_type()
2133 db.names.pop_back(); in parse_type()
2134 if (db.names.back().first.substr(0, 9) != "objcproto") in parse_type()
2136 db.names.back() = type + " " + db.names.back().move_full(); in parse_type()
2140 auto proto = db.names.back().move_full(); in parse_type()
2141 db.names.pop_back(); in parse_type()
2142 … t = parse_source_name(proto.data() + 9, proto.data() + proto.size(), db); in parse_type()
2145db.names.back() = type + "<" + db.names.back().move_full() + ">"; in parse_type()
2149 db.names.push_back(type + " " + proto); in parse_type()
2152db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator())); in parse_type()
2161 t = parse_name(first, last, db); in parse_type()
2164 if (db.names.empty()) in parse_type()
2166db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator())); in parse_type()
2172 t = parse_substitution(first, last, db); in parse_type()
2178 t = parse_template_args(first, last, db); in parse_type()
2181 if (db.names.size() < 2) in parse_type()
2183 auto template_args = db.names.back().move_full(); in parse_type()
2184 db.names.pop_back(); in parse_type()
2185 db.names.back().first += template_args; in parse_type()
2187db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator())); in parse_type()
2200 size_t k0 = db.names.size(); in parse_type()
2201 t = parse_type(first+2, last, db); in parse_type()
2202 size_t k1 = db.names.size(); in parse_type()
2205 db.subs.emplace_back(db.names.get_allocator()); in parse_type()
2207 db.subs.back().push_back(db.names[k]); in parse_type()
2215 t = parse_decltype(first, last, db); in parse_type()
2218 if (db.names.empty()) in parse_type()
2220db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator())); in parse_type()
2226 t = parse_vector_type(first, last, db); in parse_type()
2229 if (db.names.empty()) in parse_type()
2231db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator())); in parse_type()
2242 t = parse_builtin_type(first, last, db); in parse_type()
2249 t = parse_name(first, last, db); in parse_type()
2252 if (db.names.empty()) in parse_type()
2254db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator())); in parse_type()
2322 parse_operator_name(const char* first, const char* last, C& db) in parse_operator_name() argument
2332 db.names.push_back("operator&&"); in parse_operator_name()
2337 db.names.push_back("operator&"); in parse_operator_name()
2341 db.names.push_back("operator&="); in parse_operator_name()
2345 db.names.push_back("operator="); in parse_operator_name()
2354 db.names.push_back("operator()"); in parse_operator_name()
2358 db.names.push_back("operator,"); in parse_operator_name()
2362 db.names.push_back("operator~"); in parse_operator_name()
2367 bool try_to_parse_template_args = db.try_to_parse_template_args; in parse_operator_name()
2368 db.try_to_parse_template_args = false; in parse_operator_name()
2369 const char* t = parse_type(first+2, last, db); in parse_operator_name()
2370 db.try_to_parse_template_args = try_to_parse_template_args; in parse_operator_name()
2373 if (db.names.empty()) in parse_operator_name()
2375 db.names.back().first.insert(0, "operator "); in parse_operator_name()
2376 db.parsed_ctor_dtor_cv = true; in parse_operator_name()
2387 db.names.push_back("operator delete[]"); in parse_operator_name()
2391 db.names.push_back("operator*"); in parse_operator_name()
2395 db.names.push_back("operator delete"); in parse_operator_name()
2399 db.names.push_back("operator/"); in parse_operator_name()
2403 db.names.push_back("operator/="); in parse_operator_name()
2412 db.names.push_back("operator^"); in parse_operator_name()
2416 db.names.push_back("operator^="); in parse_operator_name()
2420 db.names.push_back("operator=="); in parse_operator_name()
2429 db.names.push_back("operator>="); in parse_operator_name()
2433 db.names.push_back("operator>"); in parse_operator_name()
2441 db.names.push_back("operator[]"); in parse_operator_name()
2449 db.names.push_back("operator<="); in parse_operator_name()
2454 const char* t = parse_source_name(first+2, last, db); in parse_operator_name()
2457 if (db.names.empty()) in parse_operator_name()
2459 db.names.back().first.insert(0, "operator\"\" "); in parse_operator_name()
2465 db.names.push_back("operator<<"); in parse_operator_name()
2469 db.names.push_back("operator<<="); in parse_operator_name()
2473 db.names.push_back("operator<"); in parse_operator_name()
2482 db.names.push_back("operator-"); in parse_operator_name()
2486 db.names.push_back("operator-="); in parse_operator_name()
2490 db.names.push_back("operator*"); in parse_operator_name()
2494 db.names.push_back("operator*="); in parse_operator_name()
2498 db.names.push_back("operator--"); in parse_operator_name()
2507 db.names.push_back("operator new[]"); in parse_operator_name()
2511 db.names.push_back("operator!="); in parse_operator_name()
2515 db.names.push_back("operator-"); in parse_operator_name()
2519 db.names.push_back("operator!"); in parse_operator_name()
2523 db.names.push_back("operator new"); in parse_operator_name()
2532 db.names.push_back("operator||"); in parse_operator_name()
2536 db.names.push_back("operator|"); in parse_operator_name()
2540 db.names.push_back("operator|="); in parse_operator_name()
2549 db.names.push_back("operator->*"); in parse_operator_name()
2553 db.names.push_back("operator+"); in parse_operator_name()
2557 db.names.push_back("operator+="); in parse_operator_name()
2561 db.names.push_back("operator++"); in parse_operator_name()
2565 db.names.push_back("operator+"); in parse_operator_name()
2569 db.names.push_back("operator->"); in parse_operator_name()
2577 db.names.push_back("operator?"); in parse_operator_name()
2585 db.names.push_back("operator%"); in parse_operator_name()
2589 db.names.push_back("operator%="); in parse_operator_name()
2593 db.names.push_back("operator>>"); in parse_operator_name()
2597 db.names.push_back("operator>>="); in parse_operator_name()
2605 const char* t = parse_source_name(first+2, last, db); in parse_operator_name()
2608 if (db.names.empty()) in parse_operator_name()
2610 db.names.back().first.insert(0, "operator "); in parse_operator_name()
2622 parse_integer_literal(const char* first, const char* last, const typename C::String& lit, C& db) in parse_integer_literal() argument
2628 db.names.push_back("(" + lit + ")"); in parse_integer_literal()
2630 db.names.emplace_back(); in parse_integer_literal()
2633 db.names.back().first += '-'; in parse_integer_literal()
2636 db.names.back().first.append(first, t); in parse_integer_literal()
2638 db.names.back().first += lit; in parse_integer_literal()
2653 parse_expr_primary(const char* first, const char* last, C& db) in parse_expr_primary() argument
2661 const char* t = parse_integer_literal(first+2, last, "wchar_t", db); in parse_expr_primary()
2672 db.names.push_back("false"); in parse_expr_primary()
2676 db.names.push_back("true"); in parse_expr_primary()
2684 const char* t = parse_integer_literal(first+2, last, "char", db); in parse_expr_primary()
2691 const char* t = parse_integer_literal(first+2, last, "signed char", db); in parse_expr_primary()
2698 const char* t = parse_integer_literal(first+2, last, "unsigned char", db); in parse_expr_primary()
2705 const char* t = parse_integer_literal(first+2, last, "short", db); in parse_expr_primary()
2712 const char* t = parse_integer_literal(first+2, last, "unsigned short", db); in parse_expr_primary()
2719 const char* t = parse_integer_literal(first+2, last, "", db); in parse_expr_primary()
2726 const char* t = parse_integer_literal(first+2, last, "u", db); in parse_expr_primary()
2733 const char* t = parse_integer_literal(first+2, last, "l", db); in parse_expr_primary()
2740 const char* t = parse_integer_literal(first+2, last, "ul", db); in parse_expr_primary()
2747 const char* t = parse_integer_literal(first+2, last, "ll", db); in parse_expr_primary()
2754 const char* t = parse_integer_literal(first+2, last, "ull", db); in parse_expr_primary()
2761 const char* t = parse_integer_literal(first+2, last, "__int128", db); in parse_expr_primary()
2768 const char* t = parse_integer_literal(first+2, last, "unsigned __int128", db); in parse_expr_primary()
2775 const char* t = parse_floating_number<float>(first+2, last, db); in parse_expr_primary()
2782 const char* t = parse_floating_number<double>(first+2, last, db); in parse_expr_primary()
2789 const char* t = parse_floating_number<long double>(first+2, last, db); in parse_expr_primary()
2797 const char* t = parse_encoding(first+3, last, db); in parse_expr_primary()
2809 const char* t = parse_type(first+1, last, db); in parse_expr_primary()
2819 if (db.names.empty()) in parse_expr_primary()
2821db.names.back() = "(" + db.names.back().move_full() + ")" + typename C::String(t, n); in parse_expr_primary()
2908 parse_ctor_dtor_name(const char* first, const char* last, C& db) in parse_ctor_dtor_name() argument
2910 if (last-first >= 2 && !db.names.empty()) in parse_ctor_dtor_name()
2921 if (db.names.empty()) in parse_ctor_dtor_name()
2923 db.names.push_back(base_name(db.names.back().first)); in parse_ctor_dtor_name()
2925 db.parsed_ctor_dtor_cv = true; in parse_ctor_dtor_name()
2936 if (db.names.empty()) in parse_ctor_dtor_name()
2938 db.names.push_back("~" + base_name(db.names.back().first)); in parse_ctor_dtor_name()
2940 db.parsed_ctor_dtor_cv = true; in parse_ctor_dtor_name()
2958 parse_unnamed_type_name(const char* first, const char* last, C& db) in parse_unnamed_type_name() argument
2967 db.names.push_back(typename C::String("'unnamed")); in parse_unnamed_type_name()
2971 db.names.pop_back(); in parse_unnamed_type_name()
2979 db.names.back().first.append(t0, t1); in parse_unnamed_type_name()
2982 db.names.back().first.push_back('\''); in parse_unnamed_type_name()
2985 db.names.pop_back(); in parse_unnamed_type_name()
2993 db.names.push_back(typename C::String("'lambda'(")); in parse_unnamed_type_name()
2997 db.names.back().first += ')'; in parse_unnamed_type_name()
3002 const char* t1 = parse_type(t0, last, db); in parse_unnamed_type_name()
3005 db.names.pop_back(); in parse_unnamed_type_name()
3008 if (db.names.size() < 2) in parse_unnamed_type_name()
3010 auto tmp = db.names.back().move_full(); in parse_unnamed_type_name()
3011 db.names.pop_back(); in parse_unnamed_type_name()
3012 db.names.back().first.append(tmp); in parse_unnamed_type_name()
3016 t1 = parse_type(t0, last, db); in parse_unnamed_type_name()
3019 if (db.names.size() < 2) in parse_unnamed_type_name()
3021 tmp = db.names.back().move_full(); in parse_unnamed_type_name()
3022 db.names.pop_back(); in parse_unnamed_type_name()
3025 db.names.back().first.append(", "); in parse_unnamed_type_name()
3026 db.names.back().first.append(tmp); in parse_unnamed_type_name()
3030 db.names.back().first.append(")"); in parse_unnamed_type_name()
3034 db.names.pop_back(); in parse_unnamed_type_name()
3040 db.names.pop_back(); in parse_unnamed_type_name()
3048 db.names.back().first.insert(db.names.back().first.begin()+7, t0, t1); in parse_unnamed_type_name()
3053 db.names.pop_back(); in parse_unnamed_type_name()
3071 parse_unqualified_name(const char* first, const char* last, C& db) in parse_unqualified_name() argument
3080 t = parse_ctor_dtor_name(first, last, db); in parse_unqualified_name()
3085 t = parse_unnamed_type_name(first, last, db); in parse_unqualified_name()
3098 t = parse_source_name(first, last, db); in parse_unqualified_name()
3103 t = parse_operator_name(first, last, db); in parse_unqualified_name()
3118 parse_unscoped_name(const char* first, const char* last, C& db) in parse_unscoped_name() argument
3131 const char* t1 = parse_unqualified_name(t0, last, db); in parse_unscoped_name()
3136 if (db.names.empty()) in parse_unscoped_name()
3138 db.names.back().first.insert(0, "std::"); in parse_unscoped_name()
3150 parse_alignof_type(const char* first, const char* last, C& db) in parse_alignof_type() argument
3154 const char* t = parse_type(first+2, last, db); in parse_alignof_type()
3157 if (db.names.empty()) in parse_alignof_type()
3159 db.names.back().first = "alignof (" + db.names.back().move_full() + ")"; in parse_alignof_type()
3170 parse_alignof_expr(const char* first, const char* last, C& db) in parse_alignof_expr() argument
3174 const char* t = parse_expression(first+2, last, db); in parse_alignof_expr()
3177 if (db.names.empty()) in parse_alignof_expr()
3179 db.names.back().first = "alignof (" + db.names.back().move_full() + ")"; in parse_alignof_expr()
3188 parse_noexcept_expression(const char* first, const char* last, C& db) in parse_noexcept_expression() argument
3190 const char* t1 = parse_expression(first, last, db); in parse_noexcept_expression()
3193 if (db.names.empty()) in parse_noexcept_expression()
3195 db.names.back().first = "noexcept (" + db.names.back().move_full() + ")"; in parse_noexcept_expression()
3203 parse_prefix_expression(const char* first, const char* last, const typename C::String& op, C& db) in parse_prefix_expression() argument
3205 const char* t1 = parse_expression(first, last, db); in parse_prefix_expression()
3208 if (db.names.empty()) in parse_prefix_expression()
3210 db.names.back().first = op + "(" + db.names.back().move_full() + ")"; in parse_prefix_expression()
3218 parse_binary_expression(const char* first, const char* last, const typename C::String& op, C& db) in parse_binary_expression() argument
3220 const char* t1 = parse_expression(first, last, db); in parse_binary_expression()
3223 const char* t2 = parse_expression(t1, last, db); in parse_binary_expression()
3226 if (db.names.size() < 2) in parse_binary_expression()
3228 auto op2 = db.names.back().move_full(); in parse_binary_expression()
3229 db.names.pop_back(); in parse_binary_expression()
3230 auto op1 = db.names.back().move_full(); in parse_binary_expression()
3231 auto& nm = db.names.back().first; in parse_binary_expression()
3241 db.names.pop_back(); in parse_binary_expression()
3288 parse_expression(const char* first, const char* last, C& db) in parse_expression() argument
3302 first = parse_expr_primary(first, last, db); in parse_expression()
3305 first = parse_template_param(first, last, db); in parse_expression()
3308 first = parse_function_param(first, last, db); in parse_expression()
3314 t = parse_binary_expression(first+2, last, "&&", db); in parse_expression()
3319 t = parse_prefix_expression(first+2, last, "&", db); in parse_expression()
3324 t = parse_binary_expression(first+2, last, "&", db); in parse_expression()
3329 t = parse_binary_expression(first+2, last, "&=", db); in parse_expression()
3334 t = parse_binary_expression(first+2, last, "=", db); in parse_expression()
3339 first = parse_alignof_type(first, last, db); in parse_expression()
3342 first = parse_alignof_expr(first, last, db); in parse_expression()
3350 first = parse_const_cast_expr(first, last, db); in parse_expression()
3353 first = parse_call_expr(first, last, db); in parse_expression()
3356 t = parse_binary_expression(first+2, last, ",", db); in parse_expression()
3361 t = parse_prefix_expression(first+2, last, "~", db); in parse_expression()
3366 first = parse_conversion_expr(first, last, db); in parse_expression()
3375 const char* t1 = parse_expression(t+2, last, db); in parse_expression()
3378 if (db.names.empty()) in parse_expression()
3380db.names.back().first = (parsed_gs ? typename C::String("::") : typename C::String()) + in parse_expression()
3381 "delete[] " + db.names.back().move_full(); in parse_expression()
3387 first = parse_dynamic_cast_expr(first, last, db); in parse_expression()
3390 t = parse_prefix_expression(first+2, last, "*", db); in parse_expression()
3396 const char* t1 = parse_expression(t+2, last, db); in parse_expression()
3399 if (db.names.empty()) in parse_expression()
3401db.names.back().first = (parsed_gs ? typename C::String("::") : typename C::String()) + in parse_expression()
3402 "delete " + db.names.back().move_full(); in parse_expression()
3408 return parse_unresolved_name(first, last, db); in parse_expression()
3410 first = parse_dot_star_expr(first, last, db); in parse_expression()
3413 first = parse_dot_expr(first, last, db); in parse_expression()
3416 t = parse_binary_expression(first+2, last, "/", db); in parse_expression()
3421 t = parse_binary_expression(first+2, last, "/=", db); in parse_expression()
3431 t = parse_binary_expression(first+2, last, "^", db); in parse_expression()
3436 t = parse_binary_expression(first+2, last, "^=", db); in parse_expression()
3441 t = parse_binary_expression(first+2, last, "==", db); in parse_expression()
3451 t = parse_binary_expression(first+2, last, ">=", db); in parse_expression()
3456 t = parse_binary_expression(first+2, last, ">", db); in parse_expression()
3465 const char* t1 = parse_expression(first+2, last, db); in parse_expression()
3468 const char* t2 = parse_expression(t1, last, db); in parse_expression()
3471 if (db.names.size() < 2) in parse_expression()
3473 auto op2 = db.names.back().move_full(); in parse_expression()
3474 db.names.pop_back(); in parse_expression()
3475 auto op1 = db.names.back().move_full(); in parse_expression()
3476 db.names.back() = "(" + op1 + ")[" + op2 + "]"; in parse_expression()
3480 db.names.pop_back(); in parse_expression()
3488 t = parse_binary_expression(first+2, last, "<=", db); in parse_expression()
3493 t = parse_binary_expression(first+2, last, "<<", db); in parse_expression()
3498 t = parse_binary_expression(first+2, last, "<<=", db); in parse_expression()
3503 t = parse_binary_expression(first+2, last, "<", db); in parse_expression()
3513 t = parse_binary_expression(first+2, last, "-", db); in parse_expression()
3518 t = parse_binary_expression(first+2, last, "-=", db); in parse_expression()
3523 t = parse_binary_expression(first+2, last, "*", db); in parse_expression()
3528 t = parse_binary_expression(first+2, last, "*=", db); in parse_expression()
3535 t = parse_prefix_expression(first+3, last, "--", db); in parse_expression()
3541 const char* t1 = parse_expression(first+2, last, db); in parse_expression()
3544 if (db.names.empty()) in parse_expression()
3546 db.names.back() = "(" + db.names.back().move_full() + ")--"; in parse_expression()
3558 first = parse_new_expr(first, last, db); in parse_expression()
3561 t = parse_binary_expression(first+2, last, "!=", db); in parse_expression()
3566 t = parse_prefix_expression(first+2, last, "-", db); in parse_expression()
3571 t = parse_prefix_expression(first+2, last, "!", db); in parse_expression()
3576 t = parse_noexcept_expression(first+2, last, db); in parse_expression()
3586 return parse_unresolved_name(first, last, db); in parse_expression()
3588 t = parse_binary_expression(first+2, last, "||", db); in parse_expression()
3593 t = parse_binary_expression(first+2, last, "|", db); in parse_expression()
3598 t = parse_binary_expression(first+2, last, "|=", db); in parse_expression()
3608 t = parse_binary_expression(first+2, last, "->*", db); in parse_expression()
3613 t = parse_binary_expression(first+2, last, "+", db); in parse_expression()
3618 t = parse_binary_expression(first+2, last, "+=", db); in parse_expression()
3625 t = parse_prefix_expression(first+3, last, "++", db); in parse_expression()
3631 const char* t1 = parse_expression(first+2, last, db); in parse_expression()
3634 if (db.names.empty()) in parse_expression()
3636 db.names.back() = "(" + db.names.back().move_full() + ")++"; in parse_expression()
3642 t = parse_prefix_expression(first+2, last, "+", db); in parse_expression()
3647 first = parse_arrow_expr(first, last, db); in parse_expression()
3654 const char* t1 = parse_expression(first+2, last, db); in parse_expression()
3657 const char* t2 = parse_expression(t1, last, db); in parse_expression()
3660 const char* t3 = parse_expression(t2, last, db); in parse_expression()
3663 if (db.names.size() < 3) in parse_expression()
3665 auto op3 = db.names.back().move_full(); in parse_expression()
3666 db.names.pop_back(); in parse_expression()
3667 auto op2 = db.names.back().move_full(); in parse_expression()
3668 db.names.pop_back(); in parse_expression()
3669 auto op1 = db.names.back().move_full(); in parse_expression()
3670 db.names.back() = "(" + op1 + ") ? (" + op2 + ") : (" + op3 + ")"; in parse_expression()
3675 db.names.pop_back(); in parse_expression()
3676 db.names.pop_back(); in parse_expression()
3680 db.names.pop_back(); in parse_expression()
3688 first = parse_reinterpret_cast_expr(first, last, db); in parse_expression()
3691 t = parse_binary_expression(first+2, last, "%", db); in parse_expression()
3696 t = parse_binary_expression(first+2, last, "%=", db); in parse_expression()
3701 t = parse_binary_expression(first+2, last, ">>", db); in parse_expression()
3706 t = parse_binary_expression(first+2, last, ">>=", db); in parse_expression()
3716 first = parse_static_cast_expr(first, last, db); in parse_expression()
3719 first = parse_pack_expansion(first, last, db); in parse_expression()
3722 return parse_unresolved_name(first, last, db); in parse_expression()
3724 first = parse_sizeof_type_expr(first, last, db); in parse_expression()
3727 first = parse_sizeof_expr_expr(first, last, db); in parse_expression()
3735 first = parse_sizeof_param_pack_expr(first, last, db); in parse_expression()
3738 first = parse_sizeof_function_param_pack_expr(first, last, db); in parse_expression()
3750 first = parse_typeid_expr(first, last, db); in parse_expression()
3753 db.names.push_back("throw"); in parse_expression()
3757 first = parse_throw_expr(first, last, db); in parse_expression()
3770 return parse_unresolved_name(first, last, db); in parse_expression()
3784 parse_template_arg(const char* first, const char* last, C& db) in parse_template_arg() argument
3792 t = parse_expression(first+1, last, db); in parse_template_arg()
3805 const char* t1 = parse_template_arg(t, last, db); in parse_template_arg()
3816 t = parse_encoding(first+2, last, db); in parse_template_arg()
3821 first = parse_expr_primary(first, last, db); in parse_template_arg()
3825 first = parse_type(first, last, db); in parse_template_arg()
3837 parse_template_args(const char* first, const char* last, C& db) in parse_template_args() argument
3841 if (db.tag_templates) in parse_template_args()
3842 db.template_param.back().clear(); in parse_template_args()
3847 if (db.tag_templates) in parse_template_args()
3848 db.template_param.emplace_back(db.names.get_allocator()); in parse_template_args()
3849 size_t k0 = db.names.size(); in parse_template_args()
3850 const char* t1 = parse_template_arg(t, last, db); in parse_template_args()
3851 size_t k1 = db.names.size(); in parse_template_args()
3852 if (db.tag_templates) in parse_template_args()
3853 db.template_param.pop_back(); in parse_template_args()
3856 if (db.tag_templates) in parse_template_args()
3858 db.template_param.back().emplace_back(db.names.get_allocator()); in parse_template_args()
3860 db.template_param.back().back().push_back(db.names[k]); in parse_template_args()
3866 args += db.names[k].move_full(); in parse_template_args()
3869 db.names.pop_back(); in parse_template_args()
3877 db.names.push_back(std::move(args)); in parse_template_args()
3901 parse_nested_name(const char* first, const char* last, C& db, in parse_nested_name() argument
3910 db.ref = 0; in parse_nested_name()
3913 db.ref = 1; in parse_nested_name()
3918 db.ref = 2; in parse_nested_name()
3921 db.names.emplace_back(); in parse_nested_name()
3925 db.names.back().first = "std"; in parse_nested_name()
3929 db.names.pop_back(); in parse_nested_name()
3943 t1 = parse_substitution(t0, last, db); in parse_nested_name()
3946 auto name = db.names.back().move_full(); in parse_nested_name()
3947 db.names.pop_back(); in parse_nested_name()
3948 if (!db.names.back().first.empty()) in parse_nested_name()
3950 db.names.back().first += "::" + name; in parse_nested_name()
3951db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator())); in parse_nested_name()
3954 db.names.back().first = name; in parse_nested_name()
3962 t1 = parse_template_param(t0, last, db); in parse_nested_name()
3965 auto name = db.names.back().move_full(); in parse_nested_name()
3966 db.names.pop_back(); in parse_nested_name()
3967 if (!db.names.back().first.empty()) in parse_nested_name()
3968 db.names.back().first += "::" + name; in parse_nested_name()
3970 db.names.back().first = name; in parse_nested_name()
3971db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator())); in parse_nested_name()
3981 t1 = parse_decltype(t0, last, db); in parse_nested_name()
3984 auto name = db.names.back().move_full(); in parse_nested_name()
3985 db.names.pop_back(); in parse_nested_name()
3986 if (!db.names.back().first.empty()) in parse_nested_name()
3987 db.names.back().first += "::" + name; in parse_nested_name()
3989 db.names.back().first = name; in parse_nested_name()
3990db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator())); in parse_nested_name()
3998 t1 = parse_template_args(t0, last, db); in parse_nested_name()
4001 auto name = db.names.back().move_full(); in parse_nested_name()
4002 db.names.pop_back(); in parse_nested_name()
4003 db.names.back().first += name; in parse_nested_name()
4004db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator())); in parse_nested_name()
4017 t1 = parse_unqualified_name(t0, last, db); in parse_nested_name()
4020 auto name = db.names.back().move_full(); in parse_nested_name()
4021 db.names.pop_back(); in parse_nested_name()
4022 if (!db.names.back().first.empty()) in parse_nested_name()
4023 db.names.back().first += "::" + name; in parse_nested_name()
4025 db.names.back().first = name; in parse_nested_name()
4026db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator())); in parse_nested_name()
4035 db.cv = cv; in parse_nested_name()
4036 if (pop_subs && !db.subs.empty()) in parse_nested_name()
4037 db.subs.pop_back(); in parse_nested_name()
4087 parse_local_name(const char* first, const char* last, C& db, in parse_local_name() argument
4092 const char* t = parse_encoding(first+1, last, db); in parse_local_name()
4099 if (db.names.empty()) in parse_local_name()
4101 db.names.back().first.append("::string literal"); in parse_local_name()
4110 t1 = parse_name(t, last, db, in parse_local_name()
4114 if (db.names.size() < 2) in parse_local_name()
4116 auto name = db.names.back().move_full(); in parse_local_name()
4117 db.names.pop_back(); in parse_local_name()
4118 db.names.back().first.append("::"); in parse_local_name()
4119 db.names.back().first.append(name); in parse_local_name()
4123 db.names.pop_back(); in parse_local_name()
4129 const char* t1 = parse_name(t, last, db, in parse_local_name()
4135 if (db.names.size() < 2) in parse_local_name()
4137 auto name = db.names.back().move_full(); in parse_local_name()
4138 db.names.pop_back(); in parse_local_name()
4139 db.names.back().first.append("::"); in parse_local_name()
4140 db.names.back().first.append(name); in parse_local_name()
4143 db.names.pop_back(); in parse_local_name()
4162 parse_name(const char* first, const char* last, C& db, in parse_name() argument
4175 const char* t1 = parse_nested_name(t0, last, db, in parse_name()
4183 const char* t1 = parse_local_name(t0, last, db, in parse_name()
4191 const char* t1 = parse_unscoped_name(t0, last, db); in parse_name()
4196 if (db.names.empty()) in parse_name()
4198db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator())); in parse_name()
4200 t1 = parse_template_args(t0, last, db); in parse_name()
4203 if (db.names.size() < 2) in parse_name()
4205 auto tmp = db.names.back().move_full(); in parse_name()
4206 db.names.pop_back(); in parse_name()
4207 db.names.back().first += tmp; in parse_name()
4218 t1 = parse_substitution(t0, last, db); in parse_name()
4222 t1 = parse_template_args(t0, last, db); in parse_name()
4225 if (db.names.size() < 2) in parse_name()
4227 auto tmp = db.names.back().move_full(); in parse_name()
4228 db.names.pop_back(); in parse_name()
4229 db.names.back().first += tmp; in parse_name()
4299 parse_special_name(const char* first, const char* last, C& db) in parse_special_name() argument
4311 t = parse_type(first+2, last, db); in parse_special_name()
4314 if (db.names.empty()) in parse_special_name()
4316 db.names.back().first.insert(0, "vtable for "); in parse_special_name()
4322 t = parse_type(first+2, last, db); in parse_special_name()
4325 if (db.names.empty()) in parse_special_name()
4327 db.names.back().first.insert(0, "VTT for "); in parse_special_name()
4333 t = parse_type(first+2, last, db); in parse_special_name()
4336 if (db.names.empty()) in parse_special_name()
4338 db.names.back().first.insert(0, "typeinfo for "); in parse_special_name()
4344 t = parse_type(first+2, last, db); in parse_special_name()
4347 if (db.names.empty()) in parse_special_name()
4349 db.names.back().first.insert(0, "typeinfo name for "); in parse_special_name()
4362 t = parse_encoding(t1, last, db); in parse_special_name()
4365 if (db.names.empty()) in parse_special_name()
4367 db.names.back().first.insert(0, "covariant return thunk to "); in parse_special_name()
4374 t = parse_type(first+2, last, db); in parse_special_name()
4380 const char* t1 = parse_type(++t0, last, db); in parse_special_name()
4383 if (db.names.size() < 2) in parse_special_name()
4385 auto left = db.names.back().move_full(); in parse_special_name()
4386 db.names.pop_back(); in parse_special_name()
4387 db.names.back().first = "construction vtable for " + in parse_special_name()
4389 db.names.back().move_full(); in parse_special_name()
4401 t = parse_encoding(t0, last, db); in parse_special_name()
4404 if (db.names.empty()) in parse_special_name()
4408 db.names.back().first.insert(0, "virtual thunk to "); in parse_special_name()
4413 db.names.back().first.insert(0, "non-virtual thunk to "); in parse_special_name()
4426 t = parse_name(first+2, last, db); in parse_special_name()
4429 if (db.names.empty()) in parse_special_name()
4431 db.names.back().first.insert(0, "guard variable for "); in parse_special_name()
4437 t = parse_name(first+2, last, db); in parse_special_name()
4440 if (db.names.empty()) in parse_special_name()
4442 db.names.back().first.insert(0, "reference temporary for "); in parse_special_name()
4479 parse_encoding(const char* first, const char* last, C& db) in parse_encoding() argument
4483 save_value<decltype(db.encoding_depth)> su(db.encoding_depth); in parse_encoding()
4484 ++db.encoding_depth; in parse_encoding()
4485 save_value<decltype(db.tag_templates)> sb(db.tag_templates); in parse_encoding()
4486 if (db.encoding_depth > 1) in parse_encoding()
4487 db.tag_templates = true; in parse_encoding()
4492 first = parse_special_name(first, last, db); in parse_encoding()
4497 const char* t = parse_name(first, last, db, in parse_encoding()
4499 unsigned cv = db.cv; in parse_encoding()
4500 unsigned ref = db.ref; in parse_encoding()
4505 save_value<bool> sb2(db.tag_templates); in parse_encoding()
4506 db.tag_templates = false; in parse_encoding()
4509 if (db.names.empty()) in parse_encoding()
4511 const typename C::String& nm = db.names.back().first; in parse_encoding()
4514 if (!db.parsed_ctor_dtor_cv && ends_with_template_args) in parse_encoding()
4516 t2 = parse_type(t, last, db); in parse_encoding()
4519 if (db.names.size() < 2) in parse_encoding()
4521 auto ret1 = std::move(db.names.back().first); in parse_encoding()
4522 ret2 = std::move(db.names.back().second); in parse_encoding()
4525 db.names.pop_back(); in parse_encoding()
4526 db.names.back().first.insert(0, ret1); in parse_encoding()
4529 db.names.back().first += '('; in parse_encoding()
4539 size_t k0 = db.names.size(); in parse_encoding()
4540 t2 = parse_type(t, last, db); in parse_encoding()
4541 size_t k1 = db.names.size(); in parse_encoding()
4551 tmp += db.names[k].move_full(); in parse_encoding()
4554 db.names.pop_back(); in parse_encoding()
4557 if (db.names.empty()) in parse_encoding()
4560 db.names.back().first += ", "; in parse_encoding()
4563 db.names.back().first += tmp; in parse_encoding()
4569 if (db.names.empty()) in parse_encoding()
4571 db.names.back().first += ')'; in parse_encoding()
4573 db.names.back().first.append(" const"); in parse_encoding()
4575 db.names.back().first.append(" volatile"); in parse_encoding()
4577 db.names.back().first.append(" restrict"); in parse_encoding()
4579 db.names.back().first.append(" &"); in parse_encoding()
4581 db.names.back().first.append(" &&"); in parse_encoding()
4582 db.names.back().first += ret2; in parse_encoding()
4601 parse_block_invoke(const char* first, const char* last, C& db) in parse_block_invoke() argument
4625 if (db.names.empty()) in parse_block_invoke()
4627 db.names.back().first.insert(0, "invocation function for block in "); in parse_block_invoke()
4638 parse_dot_suffix(const char* first, const char* last, C& db) in parse_dot_suffix() argument
4642 if (db.names.empty()) in parse_dot_suffix()
4644 db.names.back().first += " (" + typename C::String(first, last) + ")"; in parse_dot_suffix()
4658 demangle(const char* first, const char* last, C& db, int& status) in demangle() argument
4671 const char* t = parse_encoding(first+2, last, db); in demangle()
4673 t = parse_dot_suffix(t, last, db); in demangle()
4679 const char* t = parse_encoding(first+4, last, db); in demangle()
4682 const char* t1 = parse_block_invoke(t, last, db); in demangle()
4697 const char* t = parse_type(first, last, db); in demangle()
4701 if (status == success && db.names.empty()) in demangle()
4909 Db db(a); in __cxa_demangle() local
4910 db.cv = 0; in __cxa_demangle()
4911 db.ref = 0; in __cxa_demangle()
4912 db.encoding_depth = 0; in __cxa_demangle()
4913 db.parsed_ctor_dtor_cv = false; in __cxa_demangle()
4914 db.tag_templates = true; in __cxa_demangle()
4915 db.template_param.emplace_back(a); in __cxa_demangle()
4916 db.fix_forward_references = false; in __cxa_demangle()
4917 db.try_to_parse_template_args = true; in __cxa_demangle()
4920 demangle(mangled_name, mangled_name + len, db, in __cxa_demangle()
4922 if (internal_status == success && db.fix_forward_references && in __cxa_demangle()
4923 !db.template_param.empty() && !db.template_param.front().empty()) in __cxa_demangle()
4925 db.fix_forward_references = false; in __cxa_demangle()
4926 db.tag_templates = false; in __cxa_demangle()
4927 db.names.clear(); in __cxa_demangle()
4928 db.subs.clear(); in __cxa_demangle()
4929 demangle(mangled_name, mangled_name + len, db, internal_status); in __cxa_demangle()
4930 if (db.fix_forward_references) in __cxa_demangle()
4935 size_t sz = db.names.back().size() + 1; in __cxa_demangle()
4953 db.names.back().first += db.names.back().second; in __cxa_demangle()
4954 std::memcpy(buf, db.names.back().first.data(), sz-1); in __cxa_demangle()