Lines Matching refs:first
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);
61 fprintf(stderr, "{%s#%s}\n", s.first.c_str(), s.second.c_str()); in print_stack()
71 fprintf(stderr, "{%s#%s}", s.first.c_str(), s.second.c_str()); in print_stack()
87 fprintf(stderr, "{%s#%s}", s.first.c_str(), s.second.c_str()); in print_stack()
97 print_state(const char* msg, const char* first, const char* last, const C& db) in print_state() argument
100 for (; first != last; ++first) in print_state()
101 fprintf(stderr, "%c", *first); in print_state()
109 parse_number(const char* first, const char* last) in parse_number() argument
111 if (first != last) in parse_number()
113 const char* t = first; in parse_number()
120 first = t+1; in parse_number()
124 first = t+1; in parse_number()
125 while (first != last && std::isdigit(*first)) in parse_number()
126 ++first; in parse_number()
130 return first; in parse_number()
174 parse_floating_number(const char* first, const char* last, C& db) in parse_floating_number() argument
177 if (static_cast<std::size_t>(last - first) > N) in parse_floating_number()
179 last = first + N; in parse_floating_number()
185 const char* t = first; in parse_floating_number()
190 return first; in parse_floating_number()
206 return first; in parse_floating_number()
208 first = t+1; in parse_floating_number()
211 return first; in parse_floating_number()
218 parse_source_name(const char* first, const char* last, C& db) in parse_source_name() argument
220 if (first != last) in parse_source_name()
222 char c = *first; in parse_source_name()
223 if (isdigit(c) && first+1 != last) in parse_source_name()
225 const char* t = first+1; in parse_source_name()
231 return first; in parse_source_name()
240 first = t + n; in parse_source_name()
244 return first; in parse_source_name()
260 parse_substitution(const char* first, const char* last, C& db) in parse_substitution() argument
262 if (last - first >= 2) in parse_substitution()
264 if (*first == 'S') in parse_substitution()
266 switch (first[1]) in parse_substitution()
270 first += 2; in parse_substitution()
274 first += 2; in parse_substitution()
278 first += 2; in parse_substitution()
282 first += 2; in parse_substitution()
286 first += 2; in parse_substitution()
290 first += 2; in parse_substitution()
297 first += 2; in parse_substitution()
301 if (std::isdigit(first[1]) || std::isupper(first[1])) in parse_substitution()
304 const char* t = first+1; in parse_substitution()
318 return first; in parse_substitution()
324 first = t+1; in parse_substitution()
331 return first; in parse_substitution()
368 parse_builtin_type(const char* first, const char* last, C& db) in parse_builtin_type() argument
370 if (first != last) in parse_builtin_type()
372 switch (*first) in parse_builtin_type()
376 ++first; in parse_builtin_type()
380 ++first; in parse_builtin_type()
384 ++first; in parse_builtin_type()
388 ++first; in parse_builtin_type()
392 ++first; in parse_builtin_type()
396 ++first; in parse_builtin_type()
400 ++first; in parse_builtin_type()
404 ++first; in parse_builtin_type()
408 ++first; in parse_builtin_type()
412 ++first; in parse_builtin_type()
416 ++first; in parse_builtin_type()
420 ++first; in parse_builtin_type()
424 ++first; in parse_builtin_type()
428 ++first; in parse_builtin_type()
432 ++first; in parse_builtin_type()
436 ++first; in parse_builtin_type()
440 ++first; in parse_builtin_type()
444 ++first; in parse_builtin_type()
448 ++first; in parse_builtin_type()
452 ++first; in parse_builtin_type()
456 ++first; in parse_builtin_type()
460 const char*t = parse_source_name(first+1, last, db); in parse_builtin_type()
461 if (t != first+1) in parse_builtin_type()
462 first = t; in parse_builtin_type()
466 if (first+1 != last) in parse_builtin_type()
468 switch (first[1]) in parse_builtin_type()
472 first += 2; in parse_builtin_type()
476 first += 2; in parse_builtin_type()
480 first += 2; in parse_builtin_type()
484 first += 2; in parse_builtin_type()
488 first += 2; in parse_builtin_type()
492 first += 2; in parse_builtin_type()
496 first += 2; in parse_builtin_type()
500 first += 2; in parse_builtin_type()
504 first += 2; in parse_builtin_type()
511 return first; in parse_builtin_type()
517 parse_cv_qualifiers(const char* first, const char* last, unsigned& cv) in parse_cv_qualifiers() argument
520 if (first != last) in parse_cv_qualifiers()
522 if (*first == 'r') in parse_cv_qualifiers()
525 ++first; in parse_cv_qualifiers()
527 if (*first == 'V') in parse_cv_qualifiers()
530 ++first; in parse_cv_qualifiers()
532 if (*first == 'K') in parse_cv_qualifiers()
535 ++first; in parse_cv_qualifiers()
538 return first; in parse_cv_qualifiers()
546 parse_template_param(const char* first, const char* last, C& db) in parse_template_param() argument
548 if (last - first >= 2) in parse_template_param()
550 if (*first == 'T') in parse_template_param()
552 if (first[1] == '_') in parse_template_param()
555 return first; in parse_template_param()
560 first += 2; in parse_template_param()
565 first += 2; in parse_template_param()
569 else if (isdigit(first[1])) in parse_template_param()
571 const char* t = first+1; in parse_template_param()
579 return first; in parse_template_param()
585 first = t+1; in parse_template_param()
589 db.names.push_back(typename C::String(first, t+1)); in parse_template_param()
590 first = t+1; in parse_template_param()
596 return first; in parse_template_param()
603 parse_const_cast_expr(const char* first, const char* last, C& db) in parse_const_cast_expr() argument
605 if (last - first >= 3 && first[0] == 'c' && first[1] == 'c') in parse_const_cast_expr()
607 const char* t = parse_type(first+2, last, db); in parse_const_cast_expr()
608 if (t != first+2) in parse_const_cast_expr()
614 return first; in parse_const_cast_expr()
618 first = t1; in parse_const_cast_expr()
622 return first; in parse_const_cast_expr()
629 parse_dynamic_cast_expr(const char* first, const char* last, C& db) in parse_dynamic_cast_expr() argument
631 if (last - first >= 3 && first[0] == 'd' && first[1] == 'c') in parse_dynamic_cast_expr()
633 const char* t = parse_type(first+2, last, db); in parse_dynamic_cast_expr()
634 if (t != first+2) in parse_dynamic_cast_expr()
640 return first; in parse_dynamic_cast_expr()
644 first = t1; in parse_dynamic_cast_expr()
648 return first; in parse_dynamic_cast_expr()
655 parse_reinterpret_cast_expr(const char* first, const char* last, C& db) in parse_reinterpret_cast_expr() argument
657 if (last - first >= 3 && first[0] == 'r' && first[1] == 'c') in parse_reinterpret_cast_expr()
659 const char* t = parse_type(first+2, last, db); in parse_reinterpret_cast_expr()
660 if (t != first+2) in parse_reinterpret_cast_expr()
666 return first; in parse_reinterpret_cast_expr()
670 first = t1; in parse_reinterpret_cast_expr()
674 return first; in parse_reinterpret_cast_expr()
681 parse_static_cast_expr(const char* first, const char* last, C& db) in parse_static_cast_expr() argument
683 if (last - first >= 3 && first[0] == 's' && first[1] == 'c') in parse_static_cast_expr()
685 const char* t = parse_type(first+2, last, db); in parse_static_cast_expr()
686 if (t != first+2) in parse_static_cast_expr()
692 return first; in parse_static_cast_expr()
696 first = t1; in parse_static_cast_expr()
700 return first; in parse_static_cast_expr()
707 parse_pack_expansion(const char* first, const char* last, C& db) in parse_pack_expansion() argument
709 if (last - first >= 3 && first[0] == 's' && first[1] == 'p') in parse_pack_expansion()
711 const char* t = parse_expression(first+2, last, db); in parse_pack_expansion()
712 if (t != first+2) in parse_pack_expansion()
713 first = t; in parse_pack_expansion()
715 return first; in parse_pack_expansion()
722 parse_sizeof_type_expr(const char* first, const char* last, C& db) in parse_sizeof_type_expr() argument
724 if (last - first >= 3 && first[0] == 's' && first[1] == 't') in parse_sizeof_type_expr()
726 const char* t = parse_type(first+2, last, db); in parse_sizeof_type_expr()
727 if (t != first+2) in parse_sizeof_type_expr()
730 return first; in parse_sizeof_type_expr()
732 first = t; in parse_sizeof_type_expr()
735 return first; in parse_sizeof_type_expr()
742 parse_sizeof_expr_expr(const char* first, const char* last, C& db) in parse_sizeof_expr_expr() argument
744 if (last - first >= 3 && first[0] == 's' && first[1] == 'z') in parse_sizeof_expr_expr()
746 const char* t = parse_expression(first+2, last, db); in parse_sizeof_expr_expr()
747 if (t != first+2) in parse_sizeof_expr_expr()
750 return first; in parse_sizeof_expr_expr()
752 first = t; in parse_sizeof_expr_expr()
755 return first; in parse_sizeof_expr_expr()
762 parse_sizeof_param_pack_expr(const char* first, const char* last, C& db) in parse_sizeof_param_pack_expr() argument
764 if (last - first >= 3 && first[0] == 's' && first[1] == 'Z' && first[2] == 'T') in parse_sizeof_param_pack_expr()
767 const char* t = parse_template_param(first+2, last, db); in parse_sizeof_param_pack_expr()
769 if (t != first+2) in parse_sizeof_param_pack_expr()
783 first = t; in parse_sizeof_param_pack_expr()
786 return first; in parse_sizeof_param_pack_expr()
796 parse_function_param(const char* first, const char* last, C& db) in parse_function_param() argument
798 if (last - first >= 3 && *first == 'f') in parse_function_param()
800 if (first[1] == 'p') in parse_function_param()
803 const char* t = parse_cv_qualifiers(first+2, last, cv); in parse_function_param()
808 first = t1+1; in parse_function_param()
811 else if (first[1] == 'L') in parse_function_param()
814 const char* t0 = parse_number(first+2, last); in parse_function_param()
823 first = t1+1; in parse_function_param()
828 return first; in parse_function_param()
835 parse_sizeof_function_param_pack_expr(const char* first, const char* last, C& db) in parse_sizeof_function_param_pack_expr() argument
837 if (last - first >= 3 && first[0] == 's' && first[1] == 'Z' && first[2] == 'f') in parse_sizeof_function_param_pack_expr()
839 const char* t = parse_function_param(first+2, last, db); in parse_sizeof_function_param_pack_expr()
840 if (t != first+2) in parse_sizeof_function_param_pack_expr()
843 return first; in parse_sizeof_function_param_pack_expr()
845 first = t; in parse_sizeof_function_param_pack_expr()
848 return first; in parse_sizeof_function_param_pack_expr()
856 parse_typeid_expr(const char* first, const char* last, C& db) in parse_typeid_expr() argument
858 if (last - first >= 3 && first[0] == 't' && (first[1] == 'e' || first[1] == 'i')) in parse_typeid_expr()
861 if (first[1] == 'e') in parse_typeid_expr()
862 t = parse_expression(first+2, last, db); in parse_typeid_expr()
864 t = parse_type(first+2, last, db); in parse_typeid_expr()
865 if (t != first+2) in parse_typeid_expr()
868 return first; in parse_typeid_expr()
870 first = t; in parse_typeid_expr()
873 return first; in parse_typeid_expr()
880 parse_throw_expr(const char* first, const char* last, C& db) in parse_throw_expr() argument
882 if (last - first >= 3 && first[0] == 't' && first[1] == 'w') in parse_throw_expr()
884 const char* t = parse_expression(first+2, last, db); in parse_throw_expr()
885 if (t != first+2) in parse_throw_expr()
888 return first; in parse_throw_expr()
890 first = t; in parse_throw_expr()
893 return first; in parse_throw_expr()
900 parse_dot_star_expr(const char* first, const char* last, C& db) in parse_dot_star_expr() argument
902 if (last - first >= 3 && first[0] == 'd' && first[1] == 's') in parse_dot_star_expr()
904 const char* t = parse_expression(first+2, last, db); in parse_dot_star_expr()
905 if (t != first+2) in parse_dot_star_expr()
911 return first; in parse_dot_star_expr()
914 db.names.back().first += ".*" + expr; in parse_dot_star_expr()
915 first = t1; in parse_dot_star_expr()
919 return first; in parse_dot_star_expr()
926 parse_simple_id(const char* first, const char* last, C& db) in parse_simple_id() argument
928 if (first != last) in parse_simple_id()
930 const char* t = parse_source_name(first, last, db); in parse_simple_id()
931 if (t != first) in parse_simple_id()
937 return first; in parse_simple_id()
940 db.names.back().first += std::move(args); in parse_simple_id()
942 first = t1; in parse_simple_id()
945 first = t; in parse_simple_id()
947 return first; in parse_simple_id()
956 parse_unresolved_type(const char* first, const char* last, C& db) in parse_unresolved_type() argument
958 if (first != last) in parse_unresolved_type()
960 const char* t = first; in parse_unresolved_type()
961 switch (*first) in parse_unresolved_type()
966 t = parse_template_param(first, last, db); in parse_unresolved_type()
968 if (t != first && k1 == k0 + 1) in parse_unresolved_type()
971 first = t; in parse_unresolved_type()
981 t = parse_decltype(first, last, db); in parse_unresolved_type()
982 if (t != first) in parse_unresolved_type()
985 return first; in parse_unresolved_type()
987 first = t; in parse_unresolved_type()
991 t = parse_substitution(first, last, db); in parse_unresolved_type()
992 if (t != first) in parse_unresolved_type()
993 first = t; in parse_unresolved_type()
996 if (last - first > 2 && first[1] == 't') in parse_unresolved_type()
998 t = parse_unqualified_name(first+2, last, db); in parse_unresolved_type()
999 if (t != first+2) in parse_unresolved_type()
1002 return first; in parse_unresolved_type()
1003 db.names.back().first.insert(0, "std::"); in parse_unresolved_type()
1005 first = t; in parse_unresolved_type()
1012 return first; in parse_unresolved_type()
1020 parse_destructor_name(const char* first, const char* last, C& db) in parse_destructor_name() argument
1022 if (first != last) in parse_destructor_name()
1024 const char* t = parse_unresolved_type(first, last, db); in parse_destructor_name()
1025 if (t == first) in parse_destructor_name()
1026 t = parse_simple_id(first, last, db); in parse_destructor_name()
1027 if (t != first) in parse_destructor_name()
1030 return first; in parse_destructor_name()
1031 db.names.back().first.insert(0, "~"); in parse_destructor_name()
1032 first = t; in parse_destructor_name()
1035 return first; in parse_destructor_name()
1048 parse_base_unresolved_name(const char* first, const char* last, C& db) in parse_base_unresolved_name() argument
1050 if (last - first >= 2) in parse_base_unresolved_name()
1052 if ((first[0] == 'o' || first[0] == 'd') && first[1] == 'n') in parse_base_unresolved_name()
1054 if (first[0] == 'o') in parse_base_unresolved_name()
1056 const char* t = parse_operator_name(first+2, last, db); in parse_base_unresolved_name()
1057 if (t != first+2) in parse_base_unresolved_name()
1059 first = parse_template_args(t, last, db); in parse_base_unresolved_name()
1060 if (first != t) in parse_base_unresolved_name()
1063 return first; in parse_base_unresolved_name()
1066 db.names.back().first += std::move(args); in parse_base_unresolved_name()
1072 const char* t = parse_destructor_name(first+2, last, db); in parse_base_unresolved_name()
1073 if (t != first+2) in parse_base_unresolved_name()
1074 first = t; in parse_base_unresolved_name()
1079 const char* t = parse_simple_id(first, last, db); in parse_base_unresolved_name()
1080 if (t == first) in parse_base_unresolved_name()
1082 t = parse_operator_name(first, last, db); in parse_base_unresolved_name()
1083 if (t != first) in parse_base_unresolved_name()
1085 first = parse_template_args(t, last, db); in parse_base_unresolved_name()
1086 if (first != t) in parse_base_unresolved_name()
1089 return first; in parse_base_unresolved_name()
1092 db.names.back().first += std::move(args); in parse_base_unresolved_name()
1097 first = t; in parse_base_unresolved_name()
1100 return first; in parse_base_unresolved_name()
1107 parse_unresolved_qualifier_level(const char* first, const char* last, C& db) in parse_unresolved_qualifier_level() argument
1109 return parse_simple_id(first, last, db); in parse_unresolved_qualifier_level()
1124 parse_unresolved_name(const char* first, const char* last, C& db) in parse_unresolved_name() argument
1126 if (last - first > 2) in parse_unresolved_name()
1128 const char* t = first; in parse_unresolved_name()
1141 return first; in parse_unresolved_name()
1142 db.names.back().first.insert(0, "::"); in parse_unresolved_name()
1144 first = t2; in parse_unresolved_name()
1153 return first; in parse_unresolved_name()
1159 return first; in parse_unresolved_name()
1162 db.names.back().first += std::move(args); in parse_unresolved_name()
1167 return first; in parse_unresolved_name()
1174 return first; in parse_unresolved_name()
1177 db.names.back().first += "::" + std::move(s); in parse_unresolved_name()
1186 return first; in parse_unresolved_name()
1189 return first; in parse_unresolved_name()
1192 db.names.back().first += "::" + std::move(s); in parse_unresolved_name()
1193 first = t1; in parse_unresolved_name()
1206 return first; in parse_unresolved_name()
1209 db.names.back().first += std::move(args); in parse_unresolved_name()
1217 return first; in parse_unresolved_name()
1220 return first; in parse_unresolved_name()
1223 db.names.back().first += "::" + std::move(s); in parse_unresolved_name()
1224 first = t1; in parse_unresolved_name()
1230 return first; in parse_unresolved_name()
1235 return first; in parse_unresolved_name()
1236 db.names.back().first.insert(0, "::"); in parse_unresolved_name()
1242 return first; in parse_unresolved_name()
1245 db.names.back().first += "::" + std::move(s); in parse_unresolved_name()
1254 return first; in parse_unresolved_name()
1257 return first; in parse_unresolved_name()
1260 db.names.back().first += "::" + std::move(s); in parse_unresolved_name()
1261 first = t1; in parse_unresolved_name()
1266 return first; in parse_unresolved_name()
1273 parse_dot_expr(const char* first, const char* last, C& db) in parse_dot_expr() argument
1275 if (last - first >= 3 && first[0] == 'd' && first[1] == 't') in parse_dot_expr()
1277 const char* t = parse_expression(first+2, last, db); in parse_dot_expr()
1278 if (t != first+2) in parse_dot_expr()
1284 return first; in parse_dot_expr()
1287 db.names.back().first += "." + name; in parse_dot_expr()
1288 first = t1; in parse_dot_expr()
1292 return first; in parse_dot_expr()
1299 parse_call_expr(const char* first, const char* last, C& db) in parse_call_expr() argument
1301 if (last - first >= 4 && first[0] == 'c' && first[1] == 'l') in parse_call_expr()
1303 const char* t = parse_expression(first+2, last, db); in parse_call_expr()
1304 if (t != first+2) in parse_call_expr()
1307 return first; in parse_call_expr()
1309 return first; in parse_call_expr()
1310 db.names.back().first += db.names.back().second; in parse_call_expr()
1312 db.names.back().first.append("("); in parse_call_expr()
1318 return first; in parse_call_expr()
1320 return first; in parse_call_expr()
1326 return first; in parse_call_expr()
1329 db.names.back().first.append(", "); in parse_call_expr()
1332 db.names.back().first.append(tmp); in parse_call_expr()
1338 return first; in parse_call_expr()
1339 db.names.back().first.append(")"); in parse_call_expr()
1340 first = t; in parse_call_expr()
1343 return first; in parse_call_expr()
1354 parse_new_expr(const char* first, const char* last, C& db) in parse_new_expr() argument
1356 if (last - first >= 4) in parse_new_expr()
1358 const char* t = first; in parse_new_expr()
1370 return first; in parse_new_expr()
1377 return first; in parse_new_expr()
1382 return first; in parse_new_expr()
1388 return first; in parse_new_expr()
1389 db.names.back().first.append(", "); in parse_new_expr()
1390 db.names.back().first.append(tmp); in parse_new_expr()
1399 return first; in parse_new_expr()
1411 return first; in parse_new_expr()
1415 return first; in parse_new_expr()
1421 return first; in parse_new_expr()
1422 db.names.back().first.append(", "); in parse_new_expr()
1423 db.names.back().first.append(tmp); in parse_new_expr()
1431 return first; in parse_new_expr()
1436 return first; in parse_new_expr()
1441 return first; in parse_new_expr()
1448 return first; in parse_new_expr()
1465 first = t+1; in parse_new_expr()
1468 return first; in parse_new_expr()
1476 parse_conversion_expr(const char* first, const char* last, C& db) in parse_conversion_expr() argument
1478 if (last - first >= 3 && first[0] == 'c' && first[1] == 'v') in parse_conversion_expr()
1482 const char* t = parse_type(first+2, last, db); in parse_conversion_expr()
1484 if (t != first+2 && t != last) in parse_conversion_expr()
1490 return first; in parse_conversion_expr()
1497 return first; in parse_conversion_expr()
1507 return first; in parse_conversion_expr()
1511 return first; in parse_conversion_expr()
1517 return first; in parse_conversion_expr()
1518 db.names.back().first.append(", "); in parse_conversion_expr()
1519 db.names.back().first.append(tmp); in parse_conversion_expr()
1529 return first; in parse_conversion_expr()
1533 first = t; in parse_conversion_expr()
1536 return first; in parse_conversion_expr()
1543 parse_arrow_expr(const char* first, const char* last, C& db) in parse_arrow_expr() argument
1545 if (last - first >= 3 && first[0] == 'p' && first[1] == 't') in parse_arrow_expr()
1547 const char* t = parse_expression(first+2, last, db); in parse_arrow_expr()
1548 if (t != first+2) in parse_arrow_expr()
1554 return first; in parse_arrow_expr()
1557 db.names.back().first += "->"; in parse_arrow_expr()
1558 db.names.back().first += tmp; in parse_arrow_expr()
1559 first = t1; in parse_arrow_expr()
1563 return first; in parse_arrow_expr()
1573 parse_function_type(const char* first, const char* last, C& db) in parse_function_type() argument
1575 if (first != last && *first == 'F') in parse_function_type()
1577 const char* t = first+1; in parse_function_type()
1584 return first; in parse_function_type()
1597 return first; in parse_function_type()
1625 return first; in parse_function_type()
1647 return first; in parse_function_type()
1648 db.names.back().first += " "; in parse_function_type()
1650 first = t; in parse_function_type()
1654 return first; in parse_function_type()
1661 parse_pointer_to_member_type(const char* first, const char* last, C& db) in parse_pointer_to_member_type() argument
1663 if (first != last && *first == 'M') in parse_pointer_to_member_type()
1665 const char* t = parse_type(first+1, last, db); in parse_pointer_to_member_type()
1666 if (t != first+1) in parse_pointer_to_member_type()
1672 return first; in parse_pointer_to_member_type()
1678 … db.names.back().first = std::move(func.first) + "(" + class_type.move_full() + "::*"; in parse_pointer_to_member_type()
1683 … db.names.back().first = std::move(func.first) + " " + class_type.move_full() + "::*"; in parse_pointer_to_member_type()
1686 first = t2; in parse_pointer_to_member_type()
1690 return first; in parse_pointer_to_member_type()
1698 parse_array_type(const char* first, const char* last, C& db) in parse_array_type() argument
1700 if (first != last && *first == 'A' && first+1 != last) in parse_array_type()
1702 if (first[1] == '_') in parse_array_type()
1704 const char* t = parse_type(first+2, last, db); in parse_array_type()
1705 if (t != first+2) in parse_array_type()
1708 return first; in parse_array_type()
1712 first = t; in parse_array_type()
1715 else if ('1' <= first[1] && first[1] <= '9') in parse_array_type()
1717 const char* t = parse_number(first+1, last); in parse_array_type()
1724 return first; in parse_array_type()
1727 db.names.back().second.insert(0, " [" + typename C::String(first+1, t) + "]"); in parse_array_type()
1728 first = t2; in parse_array_type()
1734 const char* t = parse_expression(first+1, last, db); in parse_array_type()
1735 if (t != first+1 && t != last && *t == '_') in parse_array_type()
1741 return first; in parse_array_type()
1745 db.names.back().first = std::move(type.first); in parse_array_type()
1749 first = t2; in parse_array_type()
1754 return first; in parse_array_type()
1762 parse_decltype(const char* first, const char* last, C& db) in parse_decltype() argument
1764 if (last - first >= 4 && first[0] == 'D') in parse_decltype()
1766 switch (first[1]) in parse_decltype()
1771 const char* t = parse_expression(first+2, last, db); in parse_decltype()
1772 if (t != first+2 && t != last && *t == 'E') in parse_decltype()
1775 return first; in parse_decltype()
1777 first = t+1; in parse_decltype()
1783 return first; in parse_decltype()
1795 parse_vector_type(const char* first, const char* last, C& db) in parse_vector_type() argument
1797 if (last - first > 3 && first[0] == 'D' && first[1] == 'v') in parse_vector_type()
1799 if ('1' <= first[2] && first[2] <= '9') in parse_vector_type()
1801 const char* t = parse_number(first+2, last); in parse_vector_type()
1803 return first; in parse_vector_type()
1804 const char* num = first + 2; in parse_vector_type()
1814 return first; in parse_vector_type()
1815 db.names.back().first += " vector[" + typename C::String(num, sz) + "]"; in parse_vector_type()
1816 first = t1; in parse_vector_type()
1823 first = t; in parse_vector_type()
1830 const char* t1 = first+2; in parse_vector_type()
1837 return first; in parse_vector_type()
1849 return first; in parse_vector_type()
1850 db.names.back().first += " vector[" + num + "]"; in parse_vector_type()
1851 first = t; in parse_vector_type()
1856 return first; in parse_vector_type()
1884 parse_type(const char* first, const char* last, C& db) in parse_type() argument
1886 if (first != last) in parse_type()
1888 switch (*first) in parse_type()
1895 const char* t = parse_cv_qualifiers(first, last, cv); in parse_type()
1896 if (t != first) in parse_type()
1932 db.names[k].first.append(" const"); in parse_type()
1934 db.names[k].first.append(" volatile"); in parse_type()
1936 db.names[k].first.append(" restrict"); in parse_type()
1940 first = t1; in parse_type()
1947 const char* t = parse_builtin_type(first, last, db); in parse_type()
1948 if (t != first) in parse_type()
1950 first = t; in parse_type()
1954 switch (*first) in parse_type()
1957 t = parse_array_type(first, last, db); in parse_type()
1958 if (t != first) in parse_type()
1961 return first; in parse_type()
1962 first = t; in parse_type()
1967 t = parse_type(first+1, last, db); in parse_type()
1968 if (t != first+1) in parse_type()
1971 return first; in parse_type()
1972 db.names.back().first.append(" complex"); in parse_type()
1973 first = t; in parse_type()
1978 t = parse_function_type(first, last, db); in parse_type()
1979 if (t != first) in parse_type()
1982 return first; in parse_type()
1983 first = t; in parse_type()
1988 t = parse_type(first+1, last, db); in parse_type()
1989 if (t != first+1) in parse_type()
1992 return first; in parse_type()
1993 db.names.back().first.append(" imaginary"); in parse_type()
1994 first = t; in parse_type()
1999 t = parse_pointer_to_member_type(first, last, db); in parse_type()
2000 if (t != first) in parse_type()
2003 return first; in parse_type()
2004 first = t; in parse_type()
2011 t = parse_type(first+1, last, db); in parse_type()
2013 if (t != first+1) in parse_type()
2020 db.names[k].first += " ("; in parse_type()
2026 db.names[k].first += "("; in parse_type()
2029 db.names[k].first.append("&&"); in parse_type()
2032 first = t; in parse_type()
2039 t = parse_type(first+1, last, db); in parse_type()
2041 if (t != first+1) in parse_type()
2048 db.names[k].first += " ("; in parse_type()
2054 db.names[k].first += "("; in parse_type()
2057 … if (first[1] != 'U' || db.names[k].first.substr(0, 12) != "objc_object<") in parse_type()
2059 db.names[k].first.append("*"); in parse_type()
2063 db.names[k].first.replace(0, 11, "id"); in parse_type()
2067 first = t; in parse_type()
2074 t = parse_type(first+1, last, db); in parse_type()
2076 if (t != first+1) in parse_type()
2083 db.names[k].first += " ("; in parse_type()
2089 db.names[k].first += "("; in parse_type()
2092 db.names[k].first.append("&"); in parse_type()
2095 first = t; in parse_type()
2102 t = parse_template_param(first, last, db); in parse_type()
2104 if (t != first) in parse_type()
2116 db.names.back().first += std::move(args); in parse_type()
2121 first = t; in parse_type()
2126 if (first+1 != last) in parse_type()
2128 t = parse_source_name(first+1, last, db); in parse_type()
2129 if (t != first+1) in parse_type()
2135 return first; in parse_type()
2138 if (db.names.back().first.substr(0, 9) != "objcproto") in parse_type()
2157 first = t2; in parse_type()
2163 if (first+1 != last && first[1] == 't') in parse_type()
2165 t = parse_name(first, last, db); in parse_type()
2166 if (t != first) in parse_type()
2169 return first; in parse_type()
2171 first = t; in parse_type()
2176 t = parse_substitution(first, last, db); in parse_type()
2177 if (t != first) in parse_type()
2179 first = t; in parse_type()
2182 t = parse_template_args(first, last, db); in parse_type()
2183 if (t != first) in parse_type()
2186 return first; in parse_type()
2189 db.names.back().first += template_args; in parse_type()
2192 first = t; in parse_type()
2198 if (first+1 != last) in parse_type()
2200 switch (first[1]) in parse_type()
2205 t = parse_type(first+2, last, db); in parse_type()
2207 if (t != first+2) in parse_type()
2212 first = t; in parse_type()
2213 return first; in parse_type()
2219 t = parse_decltype(first, last, db); in parse_type()
2220 if (t != first) in parse_type()
2223 return first; in parse_type()
2225 first = t; in parse_type()
2226 return first; in parse_type()
2230 t = parse_vector_type(first, last, db); in parse_type()
2231 if (t != first) in parse_type()
2234 return first; in parse_type()
2236 first = t; in parse_type()
2237 return first; in parse_type()
2246 t = parse_builtin_type(first, last, db); in parse_type()
2247 if (t != first) in parse_type()
2249 first = t; in parse_type()
2253 t = parse_name(first, last, db); in parse_type()
2254 if (t != first) in parse_type()
2257 return first; in parse_type()
2259 first = t; in parse_type()
2269 return first; in parse_type()
2326 parse_operator_name(const char* first, const char* last, C& db) in parse_operator_name() argument
2328 if (last - first >= 2) in parse_operator_name()
2330 switch (first[0]) in parse_operator_name()
2333 switch (first[1]) in parse_operator_name()
2337 first += 2; in parse_operator_name()
2342 first += 2; in parse_operator_name()
2346 first += 2; in parse_operator_name()
2350 first += 2; in parse_operator_name()
2355 switch (first[1]) in parse_operator_name()
2359 first += 2; in parse_operator_name()
2363 first += 2; in parse_operator_name()
2367 first += 2; in parse_operator_name()
2373 const char* t = parse_type(first+2, last, db); in parse_operator_name()
2375 if (t != first+2) in parse_operator_name()
2378 return first; in parse_operator_name()
2379 db.names.back().first.insert(0, "operator "); in parse_operator_name()
2381 first = t; in parse_operator_name()
2388 switch (first[1]) in parse_operator_name()
2392 first += 2; in parse_operator_name()
2396 first += 2; in parse_operator_name()
2400 first += 2; in parse_operator_name()
2404 first += 2; in parse_operator_name()
2408 first += 2; in parse_operator_name()
2413 switch (first[1]) in parse_operator_name()
2417 first += 2; in parse_operator_name()
2421 first += 2; in parse_operator_name()
2425 first += 2; in parse_operator_name()
2430 switch (first[1]) in parse_operator_name()
2434 first += 2; in parse_operator_name()
2438 first += 2; in parse_operator_name()
2443 if (first[1] == 'x') in parse_operator_name()
2446 first += 2; in parse_operator_name()
2450 switch (first[1]) in parse_operator_name()
2454 first += 2; in parse_operator_name()
2458 const char* t = parse_source_name(first+2, last, db); in parse_operator_name()
2459 if (t != first+2) in parse_operator_name()
2462 return first; in parse_operator_name()
2463 db.names.back().first.insert(0, "operator\"\" "); in parse_operator_name()
2464 first = t; in parse_operator_name()
2470 first += 2; in parse_operator_name()
2474 first += 2; in parse_operator_name()
2478 first += 2; in parse_operator_name()
2483 switch (first[1]) in parse_operator_name()
2487 first += 2; in parse_operator_name()
2491 first += 2; in parse_operator_name()
2495 first += 2; in parse_operator_name()
2499 first += 2; in parse_operator_name()
2503 first += 2; in parse_operator_name()
2508 switch (first[1]) in parse_operator_name()
2512 first += 2; in parse_operator_name()
2516 first += 2; in parse_operator_name()
2520 first += 2; in parse_operator_name()
2524 first += 2; in parse_operator_name()
2528 first += 2; in parse_operator_name()
2533 switch (first[1]) in parse_operator_name()
2537 first += 2; in parse_operator_name()
2541 first += 2; in parse_operator_name()
2545 first += 2; in parse_operator_name()
2550 switch (first[1]) in parse_operator_name()
2554 first += 2; in parse_operator_name()
2558 first += 2; in parse_operator_name()
2562 first += 2; in parse_operator_name()
2566 first += 2; in parse_operator_name()
2570 first += 2; in parse_operator_name()
2574 first += 2; in parse_operator_name()
2579 if (first[1] == 'u') in parse_operator_name()
2582 first += 2; in parse_operator_name()
2586 switch (first[1]) in parse_operator_name()
2590 first += 2; in parse_operator_name()
2594 first += 2; in parse_operator_name()
2598 first += 2; in parse_operator_name()
2602 first += 2; in parse_operator_name()
2607 if (std::isdigit(first[1])) in parse_operator_name()
2609 const char* t = parse_source_name(first+2, last, db); in parse_operator_name()
2610 if (t != first+2) in parse_operator_name()
2613 return first; in parse_operator_name()
2614 db.names.back().first.insert(0, "operator "); in parse_operator_name()
2615 first = t; in parse_operator_name()
2621 return first; in parse_operator_name()
2626 parse_integer_literal(const char* first, const char* last, const typename C::String& lit, C& db) in parse_integer_literal() argument
2628 const char* t = parse_number(first, last); in parse_integer_literal()
2629 if (t != first && t != last && *t == 'E') in parse_integer_literal()
2635 if (*first == 'n') in parse_integer_literal()
2637 db.names.back().first += '-'; in parse_integer_literal()
2638 ++first; in parse_integer_literal()
2640 db.names.back().first.append(first, t); in parse_integer_literal()
2642 db.names.back().first += lit; in parse_integer_literal()
2643 first = t+1; in parse_integer_literal()
2645 return first; in parse_integer_literal()
2657 parse_expr_primary(const char* first, const char* last, C& db) in parse_expr_primary() argument
2659 if (last - first >= 4 && *first == 'L') in parse_expr_primary()
2661 switch (first[1]) in parse_expr_primary()
2665 const char* t = parse_integer_literal(first+2, last, "wchar_t", db); in parse_expr_primary()
2666 if (t != first+2) in parse_expr_primary()
2667 first = t; in parse_expr_primary()
2671 if (first[3] == 'E') in parse_expr_primary()
2673 switch (first[2]) in parse_expr_primary()
2677 first += 4; in parse_expr_primary()
2681 first += 4; in parse_expr_primary()
2688 const char* t = parse_integer_literal(first+2, last, "char", db); in parse_expr_primary()
2689 if (t != first+2) in parse_expr_primary()
2690 first = t; in parse_expr_primary()
2695 const char* t = parse_integer_literal(first+2, last, "signed char", db); in parse_expr_primary()
2696 if (t != first+2) in parse_expr_primary()
2697 first = t; in parse_expr_primary()
2702 const char* t = parse_integer_literal(first+2, last, "unsigned char", db); in parse_expr_primary()
2703 if (t != first+2) in parse_expr_primary()
2704 first = t; in parse_expr_primary()
2709 const char* t = parse_integer_literal(first+2, last, "short", db); in parse_expr_primary()
2710 if (t != first+2) in parse_expr_primary()
2711 first = t; in parse_expr_primary()
2716 const char* t = parse_integer_literal(first+2, last, "unsigned short", db); in parse_expr_primary()
2717 if (t != first+2) in parse_expr_primary()
2718 first = t; in parse_expr_primary()
2723 const char* t = parse_integer_literal(first+2, last, "", db); in parse_expr_primary()
2724 if (t != first+2) in parse_expr_primary()
2725 first = t; in parse_expr_primary()
2730 const char* t = parse_integer_literal(first+2, last, "u", db); in parse_expr_primary()
2731 if (t != first+2) in parse_expr_primary()
2732 first = t; in parse_expr_primary()
2737 const char* t = parse_integer_literal(first+2, last, "l", db); in parse_expr_primary()
2738 if (t != first+2) in parse_expr_primary()
2739 first = t; in parse_expr_primary()
2744 const char* t = parse_integer_literal(first+2, last, "ul", db); in parse_expr_primary()
2745 if (t != first+2) in parse_expr_primary()
2746 first = t; in parse_expr_primary()
2751 const char* t = parse_integer_literal(first+2, last, "ll", db); in parse_expr_primary()
2752 if (t != first+2) in parse_expr_primary()
2753 first = t; in parse_expr_primary()
2758 const char* t = parse_integer_literal(first+2, last, "ull", db); in parse_expr_primary()
2759 if (t != first+2) in parse_expr_primary()
2760 first = t; in parse_expr_primary()
2765 const char* t = parse_integer_literal(first+2, last, "__int128", db); in parse_expr_primary()
2766 if (t != first+2) in parse_expr_primary()
2767 first = t; in parse_expr_primary()
2772 const char* t = parse_integer_literal(first+2, last, "unsigned __int128", db); in parse_expr_primary()
2773 if (t != first+2) in parse_expr_primary()
2774 first = t; in parse_expr_primary()
2779 const char* t = parse_floating_number<float>(first+2, last, db); in parse_expr_primary()
2780 if (t != first+2) in parse_expr_primary()
2781 first = t; in parse_expr_primary()
2786 const char* t = parse_floating_number<double>(first+2, last, db); in parse_expr_primary()
2787 if (t != first+2) in parse_expr_primary()
2788 first = t; in parse_expr_primary()
2793 const char* t = parse_floating_number<long double>(first+2, last, db); in parse_expr_primary()
2794 if (t != first+2) in parse_expr_primary()
2795 first = t; in parse_expr_primary()
2799 if (first[2] == 'Z') in parse_expr_primary()
2801 const char* t = parse_encoding(first+3, last, db); in parse_expr_primary()
2802 if (t != first+3 && t != last && *t == 'E') in parse_expr_primary()
2803 first = t+1; in parse_expr_primary()
2813 const char* t = parse_type(first+1, last, db); in parse_expr_primary()
2814 if (t != first+1 && t != last) in parse_expr_primary()
2824 return first; in parse_expr_primary()
2826 first = n+1; in parse_expr_primary()
2832 first = t+1; in parse_expr_primary()
2839 return first; in parse_expr_primary()
2912 parse_ctor_dtor_name(const char* first, const char* last, C& db) in parse_ctor_dtor_name() argument
2914 if (last-first >= 2 && !db.names.empty()) in parse_ctor_dtor_name()
2916 switch (first[0]) in parse_ctor_dtor_name()
2919 switch (first[1]) in parse_ctor_dtor_name()
2926 return first; in parse_ctor_dtor_name()
2927 db.names.push_back(base_name(db.names.back().first)); in parse_ctor_dtor_name()
2928 first += 2; in parse_ctor_dtor_name()
2934 switch (first[1]) in parse_ctor_dtor_name()
2941 return first; in parse_ctor_dtor_name()
2942 db.names.push_back("~" + base_name(db.names.back().first)); in parse_ctor_dtor_name()
2943 first += 2; in parse_ctor_dtor_name()
2950 return first; in parse_ctor_dtor_name()
2962 parse_unnamed_type_name(const char* first, const char* last, C& db) in parse_unnamed_type_name() argument
2964 if (last - first > 2 && first[0] == 'U') in parse_unnamed_type_name()
2966 char type = first[1]; in parse_unnamed_type_name()
2972 const char* t0 = first+2; in parse_unnamed_type_name()
2976 return first; in parse_unnamed_type_name()
2983 db.names.back().first.append(t0, t1); in parse_unnamed_type_name()
2986 db.names.back().first.push_back('\''); in parse_unnamed_type_name()
2990 return first; in parse_unnamed_type_name()
2992 first = t0 + 1; in parse_unnamed_type_name()
2998 const char* t0 = first+2; in parse_unnamed_type_name()
2999 if (first[2] == 'v') in parse_unnamed_type_name()
3001 db.names.back().first += ')'; in parse_unnamed_type_name()
3010 return first; in parse_unnamed_type_name()
3013 return first; in parse_unnamed_type_name()
3016 db.names.back().first.append(tmp); in parse_unnamed_type_name()
3024 return first; in parse_unnamed_type_name()
3029 db.names.back().first.append(", "); in parse_unnamed_type_name()
3030 db.names.back().first.append(tmp); in parse_unnamed_type_name()
3034 db.names.back().first.append(")"); in parse_unnamed_type_name()
3039 return first; in parse_unnamed_type_name()
3045 return first; in parse_unnamed_type_name()
3052 db.names.back().first.insert(db.names.back().first.begin()+7, t0, t1); in parse_unnamed_type_name()
3058 return first; in parse_unnamed_type_name()
3060 first = t0 + 1; in parse_unnamed_type_name()
3065 return first; in parse_unnamed_type_name()
3075 parse_unqualified_name(const char* first, const char* last, C& db) in parse_unqualified_name() argument
3077 if (first != last) in parse_unqualified_name()
3080 switch (*first) in parse_unqualified_name()
3084 t = parse_ctor_dtor_name(first, last, db); in parse_unqualified_name()
3085 if (t != first) in parse_unqualified_name()
3086 first = t; in parse_unqualified_name()
3089 t = parse_unnamed_type_name(first, last, db); in parse_unqualified_name()
3090 if (t != first) in parse_unqualified_name()
3091 first = t; in parse_unqualified_name()
3102 t = parse_source_name(first, last, db); in parse_unqualified_name()
3103 if (t != first) in parse_unqualified_name()
3104 first = t; in parse_unqualified_name()
3107 t = parse_operator_name(first, last, db); in parse_unqualified_name()
3108 if (t != first) in parse_unqualified_name()
3109 first = t; in parse_unqualified_name()
3113 return first; in parse_unqualified_name()
3122 parse_unscoped_name(const char* first, const char* last, C& db) in parse_unscoped_name() argument
3124 if (last - first >= 2) in parse_unscoped_name()
3126 const char* t0 = first; in parse_unscoped_name()
3128 if (first[0] == 'S' && first[1] == 't') in parse_unscoped_name()
3141 return first; in parse_unscoped_name()
3142 db.names.back().first.insert(0, "std::"); in parse_unscoped_name()
3144 first = t1; in parse_unscoped_name()
3147 return first; in parse_unscoped_name()
3154 parse_alignof_type(const char* first, const char* last, C& db) in parse_alignof_type() argument
3156 if (last - first >= 3 && first[0] == 'a' && first[1] == 't') in parse_alignof_type()
3158 const char* t = parse_type(first+2, last, db); in parse_alignof_type()
3159 if (t != first+2) in parse_alignof_type()
3162 return first; in parse_alignof_type()
3163 db.names.back().first = "alignof (" + db.names.back().move_full() + ")"; in parse_alignof_type()
3164 first = t; in parse_alignof_type()
3167 return first; in parse_alignof_type()
3174 parse_alignof_expr(const char* first, const char* last, C& db) in parse_alignof_expr() argument
3176 if (last - first >= 3 && first[0] == 'a' && first[1] == 'z') in parse_alignof_expr()
3178 const char* t = parse_expression(first+2, last, db); in parse_alignof_expr()
3179 if (t != first+2) in parse_alignof_expr()
3182 return first; in parse_alignof_expr()
3183 db.names.back().first = "alignof (" + db.names.back().move_full() + ")"; in parse_alignof_expr()
3184 first = t; in parse_alignof_expr()
3187 return first; in parse_alignof_expr()
3192 parse_noexcept_expression(const char* first, const char* last, C& db) in parse_noexcept_expression() argument
3194 const char* t1 = parse_expression(first, last, db); in parse_noexcept_expression()
3195 if (t1 != first) in parse_noexcept_expression()
3198 return first; in parse_noexcept_expression()
3199 db.names.back().first = "noexcept (" + db.names.back().move_full() + ")"; in parse_noexcept_expression()
3200 first = t1; in parse_noexcept_expression()
3202 return first; in parse_noexcept_expression()
3207 parse_prefix_expression(const char* first, const char* last, const typename C::String& op, C& db) in parse_prefix_expression() argument
3209 const char* t1 = parse_expression(first, last, db); in parse_prefix_expression()
3210 if (t1 != first) in parse_prefix_expression()
3213 return first; in parse_prefix_expression()
3214 db.names.back().first = op + "(" + db.names.back().move_full() + ")"; in parse_prefix_expression()
3215 first = t1; in parse_prefix_expression()
3217 return first; in parse_prefix_expression()
3222 parse_binary_expression(const char* first, const char* last, const typename C::String& op, C& db) in parse_binary_expression() argument
3224 const char* t1 = parse_expression(first, last, db); in parse_binary_expression()
3225 if (t1 != first) in parse_binary_expression()
3231 return first; in parse_binary_expression()
3235 auto& nm = db.names.back().first; in parse_binary_expression()
3242 first = t2; in parse_binary_expression()
3247 return first; in parse_binary_expression()
3292 parse_expression(const char* first, const char* last, C& db) in parse_expression() argument
3294 if (last - first >= 2) in parse_expression()
3296 const char* t = first; in parse_expression()
3298 if (last - first >= 4 && t[0] == 'g' && t[1] == 's') in parse_expression()
3306 first = parse_expr_primary(first, last, db); in parse_expression()
3309 first = parse_template_param(first, last, db); in parse_expression()
3312 first = parse_function_param(first, last, db); in parse_expression()
3318 t = parse_binary_expression(first+2, last, "&&", db); in parse_expression()
3319 if (t != first+2) in parse_expression()
3320 first = t; in parse_expression()
3323 t = parse_prefix_expression(first+2, last, "&", db); in parse_expression()
3324 if (t != first+2) in parse_expression()
3325 first = t; in parse_expression()
3328 t = parse_binary_expression(first+2, last, "&", db); in parse_expression()
3329 if (t != first+2) in parse_expression()
3330 first = t; in parse_expression()
3333 t = parse_binary_expression(first+2, last, "&=", db); in parse_expression()
3334 if (t != first+2) in parse_expression()
3335 first = t; in parse_expression()
3338 t = parse_binary_expression(first+2, last, "=", db); in parse_expression()
3339 if (t != first+2) in parse_expression()
3340 first = t; in parse_expression()
3343 first = parse_alignof_type(first, last, db); in parse_expression()
3346 first = parse_alignof_expr(first, last, db); in parse_expression()
3354 first = parse_const_cast_expr(first, last, db); in parse_expression()
3357 first = parse_call_expr(first, last, db); in parse_expression()
3360 t = parse_binary_expression(first+2, last, ",", db); in parse_expression()
3361 if (t != first+2) in parse_expression()
3362 first = t; in parse_expression()
3365 t = parse_prefix_expression(first+2, last, "~", db); in parse_expression()
3366 if (t != first+2) in parse_expression()
3367 first = t; in parse_expression()
3370 first = parse_conversion_expr(first, last, db); in parse_expression()
3383 return first; in parse_expression()
3384 … db.names.back().first = (parsed_gs ? typename C::String("::") : typename C::String()) + in parse_expression()
3386 first = t1; in parse_expression()
3391 first = parse_dynamic_cast_expr(first, last, db); in parse_expression()
3394 t = parse_prefix_expression(first+2, last, "*", db); in parse_expression()
3395 if (t != first+2) in parse_expression()
3396 first = t; in parse_expression()
3404 return first; in parse_expression()
3405 … db.names.back().first = (parsed_gs ? typename C::String("::") : typename C::String()) + in parse_expression()
3407 first = t1; in parse_expression()
3412 return parse_unresolved_name(first, last, db); in parse_expression()
3414 first = parse_dot_star_expr(first, last, db); in parse_expression()
3417 first = parse_dot_expr(first, last, db); in parse_expression()
3420 t = parse_binary_expression(first+2, last, "/", db); in parse_expression()
3421 if (t != first+2) in parse_expression()
3422 first = t; in parse_expression()
3425 t = parse_binary_expression(first+2, last, "/=", db); in parse_expression()
3426 if (t != first+2) in parse_expression()
3427 first = t; in parse_expression()
3435 t = parse_binary_expression(first+2, last, "^", db); in parse_expression()
3436 if (t != first+2) in parse_expression()
3437 first = t; in parse_expression()
3440 t = parse_binary_expression(first+2, last, "^=", db); in parse_expression()
3441 if (t != first+2) in parse_expression()
3442 first = t; in parse_expression()
3445 t = parse_binary_expression(first+2, last, "==", db); in parse_expression()
3446 if (t != first+2) in parse_expression()
3447 first = t; in parse_expression()
3455 t = parse_binary_expression(first+2, last, ">=", db); in parse_expression()
3456 if (t != first+2) in parse_expression()
3457 first = t; in parse_expression()
3460 t = parse_binary_expression(first+2, last, ">", db); in parse_expression()
3461 if (t != first+2) in parse_expression()
3462 first = t; in parse_expression()
3469 const char* t1 = parse_expression(first+2, last, db); in parse_expression()
3470 if (t1 != first+2) in parse_expression()
3476 return first; in parse_expression()
3481 first = t2; in parse_expression()
3492 t = parse_binary_expression(first+2, last, "<=", db); in parse_expression()
3493 if (t != first+2) in parse_expression()
3494 first = t; in parse_expression()
3497 t = parse_binary_expression(first+2, last, "<<", db); in parse_expression()
3498 if (t != first+2) in parse_expression()
3499 first = t; in parse_expression()
3502 t = parse_binary_expression(first+2, last, "<<=", db); in parse_expression()
3503 if (t != first+2) in parse_expression()
3504 first = t; in parse_expression()
3507 t = parse_binary_expression(first+2, last, "<", db); in parse_expression()
3508 if (t != first+2) in parse_expression()
3509 first = t; in parse_expression()
3517 t = parse_binary_expression(first+2, last, "-", db); in parse_expression()
3518 if (t != first+2) in parse_expression()
3519 first = t; in parse_expression()
3522 t = parse_binary_expression(first+2, last, "-=", db); in parse_expression()
3523 if (t != first+2) in parse_expression()
3524 first = t; in parse_expression()
3527 t = parse_binary_expression(first+2, last, "*", db); in parse_expression()
3528 if (t != first+2) in parse_expression()
3529 first = t; in parse_expression()
3532 t = parse_binary_expression(first+2, last, "*=", db); in parse_expression()
3533 if (t != first+2) in parse_expression()
3534 first = t; in parse_expression()
3537 if (first+2 != last && first[2] == '_') in parse_expression()
3539 t = parse_prefix_expression(first+3, last, "--", db); in parse_expression()
3540 if (t != first+3) in parse_expression()
3541 first = t; in parse_expression()
3545 const char* t1 = parse_expression(first+2, last, db); in parse_expression()
3546 if (t1 != first+2) in parse_expression()
3549 return first; in parse_expression()
3551 first = t1; in parse_expression()
3562 first = parse_new_expr(first, last, db); in parse_expression()
3565 t = parse_binary_expression(first+2, last, "!=", db); in parse_expression()
3566 if (t != first+2) in parse_expression()
3567 first = t; in parse_expression()
3570 t = parse_prefix_expression(first+2, last, "-", db); in parse_expression()
3571 if (t != first+2) in parse_expression()
3572 first = t; in parse_expression()
3575 t = parse_prefix_expression(first+2, last, "!", db); in parse_expression()
3576 if (t != first+2) in parse_expression()
3577 first = t; in parse_expression()
3580 t = parse_noexcept_expression(first+2, last, db); in parse_expression()
3581 if (t != first+2) in parse_expression()
3582 first = t; in parse_expression()
3590 return parse_unresolved_name(first, last, db); in parse_expression()
3592 t = parse_binary_expression(first+2, last, "||", db); in parse_expression()
3593 if (t != first+2) in parse_expression()
3594 first = t; in parse_expression()
3597 t = parse_binary_expression(first+2, last, "|", db); in parse_expression()
3598 if (t != first+2) in parse_expression()
3599 first = t; in parse_expression()
3602 t = parse_binary_expression(first+2, last, "|=", db); in parse_expression()
3603 if (t != first+2) in parse_expression()
3604 first = t; in parse_expression()
3612 t = parse_binary_expression(first+2, last, "->*", db); in parse_expression()
3613 if (t != first+2) in parse_expression()
3614 first = t; in parse_expression()
3617 t = parse_binary_expression(first+2, last, "+", db); in parse_expression()
3618 if (t != first+2) in parse_expression()
3619 first = t; in parse_expression()
3622 t = parse_binary_expression(first+2, last, "+=", db); in parse_expression()
3623 if (t != first+2) in parse_expression()
3624 first = t; in parse_expression()
3627 if (first+2 != last && first[2] == '_') in parse_expression()
3629 t = parse_prefix_expression(first+3, last, "++", db); in parse_expression()
3630 if (t != first+3) in parse_expression()
3631 first = t; in parse_expression()
3635 const char* t1 = parse_expression(first+2, last, db); in parse_expression()
3636 if (t1 != first+2) in parse_expression()
3639 return first; in parse_expression()
3641 first = t1; in parse_expression()
3646 t = parse_prefix_expression(first+2, last, "+", db); in parse_expression()
3647 if (t != first+2) in parse_expression()
3648 first = t; in parse_expression()
3651 first = parse_arrow_expr(first, last, db); in parse_expression()
3658 const char* t1 = parse_expression(first+2, last, db); in parse_expression()
3659 if (t1 != first+2) in parse_expression()
3668 return first; in parse_expression()
3675 first = t3; in parse_expression()
3692 first = parse_reinterpret_cast_expr(first, last, db); in parse_expression()
3695 t = parse_binary_expression(first+2, last, "%", db); in parse_expression()
3696 if (t != first+2) in parse_expression()
3697 first = t; in parse_expression()
3700 t = parse_binary_expression(first+2, last, "%=", db); in parse_expression()
3701 if (t != first+2) in parse_expression()
3702 first = t; in parse_expression()
3705 t = parse_binary_expression(first+2, last, ">>", db); in parse_expression()
3706 if (t != first+2) in parse_expression()
3707 first = t; in parse_expression()
3710 t = parse_binary_expression(first+2, last, ">>=", db); in parse_expression()
3711 if (t != first+2) in parse_expression()
3712 first = t; in parse_expression()
3720 first = parse_static_cast_expr(first, last, db); in parse_expression()
3723 first = parse_pack_expansion(first, last, db); in parse_expression()
3726 return parse_unresolved_name(first, last, db); in parse_expression()
3728 first = parse_sizeof_type_expr(first, last, db); in parse_expression()
3731 first = parse_sizeof_expr_expr(first, last, db); in parse_expression()
3739 first = parse_sizeof_param_pack_expr(first, last, db); in parse_expression()
3742 first = parse_sizeof_function_param_pack_expr(first, last, db); in parse_expression()
3754 first = parse_typeid_expr(first, last, db); in parse_expression()
3758 first += 2; in parse_expression()
3761 first = parse_throw_expr(first, last, db); in parse_expression()
3774 return parse_unresolved_name(first, last, db); in parse_expression()
3777 return first; in parse_expression()
3788 parse_template_arg(const char* first, const char* last, C& db) in parse_template_arg() argument
3790 if (first != last) in parse_template_arg()
3793 switch (*first) in parse_template_arg()
3796 t = parse_expression(first+1, last, db); in parse_template_arg()
3797 if (t != first+1) in parse_template_arg()
3800 first = t+1; in parse_template_arg()
3804 t = first+1; in parse_template_arg()
3806 return first; in parse_template_arg()
3811 return first; in parse_template_arg()
3814 first = t+1; in parse_template_arg()
3818 if (first+1 != last && first[1] == 'Z') in parse_template_arg()
3820 t = parse_encoding(first+2, last, db); in parse_template_arg()
3821 if (t != first+2 && t != last && *t == 'E') in parse_template_arg()
3822 first = t+1; in parse_template_arg()
3825 first = parse_expr_primary(first, last, db); in parse_template_arg()
3829 first = parse_type(first, last, db); in parse_template_arg()
3833 return first; in parse_template_arg()
3841 parse_template_args(const char* first, const char* last, C& db) in parse_template_args() argument
3843 if (last - first >= 2 && *first == 'I') in parse_template_args()
3847 const char* t = first+1; in parse_template_args()
3859 return first; in parse_template_args()
3876 first = t + 1; in parse_template_args()
3884 return first; in parse_template_args()
3905 parse_nested_name(const char* first, const char* last, C& db, in parse_nested_name() argument
3908 if (first != last && *first == 'N') in parse_nested_name()
3911 const char* t0 = parse_cv_qualifiers(first+1, last, cv); in parse_nested_name()
3913 return first; in parse_nested_name()
3929 db.names.back().first = "std"; in parse_nested_name()
3934 return first; in parse_nested_name()
3952 if (!db.names.back().first.empty()) in parse_nested_name()
3954 db.names.back().first += "::" + name; in parse_nested_name()
3958 db.names.back().first = name; in parse_nested_name()
3963 return first; in parse_nested_name()
3971 if (!db.names.back().first.empty()) in parse_nested_name()
3972 db.names.back().first += "::" + name; in parse_nested_name()
3974 db.names.back().first = name; in parse_nested_name()
3980 return first; in parse_nested_name()
3990 if (!db.names.back().first.empty()) in parse_nested_name()
3991 db.names.back().first += "::" + name; in parse_nested_name()
3993 db.names.back().first = name; in parse_nested_name()
3999 return first; in parse_nested_name()
4007 db.names.back().first += name; in parse_nested_name()
4013 return first; in parse_nested_name()
4017 return first; in parse_nested_name()
4026 if (!db.names.back().first.empty()) in parse_nested_name()
4027 db.names.back().first += "::" + name; in parse_nested_name()
4029 db.names.back().first = name; in parse_nested_name()
4035 return first; in parse_nested_name()
4038 first = t0 + 1; in parse_nested_name()
4045 return first; in parse_nested_name()
4053 parse_discriminator(const char* first, const char* last) in parse_discriminator() argument
4056 if (first != last) in parse_discriminator()
4058 if (*first == '_') in parse_discriminator()
4060 const char* t1 = first+1; in parse_discriminator()
4064 first = t1+1; in parse_discriminator()
4070 first = t1 + 1; in parse_discriminator()
4074 else if (std::isdigit(*first)) in parse_discriminator()
4076 const char* t1 = first+1; in parse_discriminator()
4079 first = t1; in parse_discriminator()
4082 return first; in parse_discriminator()
4091 parse_local_name(const char* first, const char* last, C& db, in parse_local_name() argument
4094 if (first != last && *first == 'Z') in parse_local_name()
4096 const char* t = parse_encoding(first+1, last, db); in parse_local_name()
4097 if (t != first+1 && t != last && *t == 'E' && ++t != last) in parse_local_name()
4102 first = parse_discriminator(t+1, last); in parse_local_name()
4104 return first; in parse_local_name()
4105 db.names.back().first.append("::string literal"); in parse_local_name()
4119 return first; in parse_local_name()
4122 db.names.back().first.append("::"); in parse_local_name()
4123 db.names.back().first.append(name); in parse_local_name()
4124 first = t1; in parse_local_name()
4138 first = parse_discriminator(t1, last); in parse_local_name()
4140 return first; in parse_local_name()
4143 db.names.back().first.append("::"); in parse_local_name()
4144 db.names.back().first.append(name); in parse_local_name()
4153 return first; in parse_local_name()
4166 parse_name(const char* first, const char* last, C& db, in parse_name() argument
4169 if (last - first >= 2) in parse_name()
4171 const char* t0 = first; in parse_name()
4182 first = t1; in parse_name()
4190 first = t1; in parse_name()
4201 return first; in parse_name()
4208 return first; in parse_name()
4211 db.names.back().first += tmp; in parse_name()
4212 first = t1; in parse_name()
4218 first = t1; in parse_name()
4230 return first; in parse_name()
4233 db.names.back().first += tmp; in parse_name()
4234 first = t1; in parse_name()
4244 return first; in parse_name()
4257 parse_call_offset(const char* first, const char* last) in parse_call_offset() argument
4259 if (first != last) in parse_call_offset()
4261 switch (*first) in parse_call_offset()
4265 const char* t = parse_number(first + 1, last); in parse_call_offset()
4266 if (t != first + 1 && t != last && *t == '_') in parse_call_offset()
4267 first = t + 1; in parse_call_offset()
4272 const char* t = parse_number(first + 1, last); in parse_call_offset()
4273 if (t != first + 1 && t != last && *t == '_') in parse_call_offset()
4277 first = t2 + 1; in parse_call_offset()
4283 return first; in parse_call_offset()
4303 parse_special_name(const char* first, const char* last, C& db) in parse_special_name() argument
4305 if (last - first > 2) in parse_special_name()
4308 switch (*first) in parse_special_name()
4311 switch (first[1]) in parse_special_name()
4315 t = parse_type(first+2, last, db); in parse_special_name()
4316 if (t != first+2) in parse_special_name()
4319 return first; in parse_special_name()
4320 db.names.back().first.insert(0, "vtable for "); in parse_special_name()
4321 first = t; in parse_special_name()
4326 t = parse_type(first+2, last, db); in parse_special_name()
4327 if (t != first+2) in parse_special_name()
4330 return first; in parse_special_name()
4331 db.names.back().first.insert(0, "VTT for "); in parse_special_name()
4332 first = t; in parse_special_name()
4337 t = parse_type(first+2, last, db); in parse_special_name()
4338 if (t != first+2) in parse_special_name()
4341 return first; in parse_special_name()
4342 db.names.back().first.insert(0, "typeinfo for "); in parse_special_name()
4343 first = t; in parse_special_name()
4348 t = parse_type(first+2, last, db); in parse_special_name()
4349 if (t != first+2) in parse_special_name()
4352 return first; in parse_special_name()
4353 db.names.back().first.insert(0, "typeinfo name for "); in parse_special_name()
4354 first = t; in parse_special_name()
4360 const char* t0 = parse_call_offset(first+2, last); in parse_special_name()
4361 if (t0 == first+2) in parse_special_name()
4370 return first; in parse_special_name()
4371 db.names.back().first.insert(0, "covariant return thunk to "); in parse_special_name()
4372 first = t; in parse_special_name()
4378 t = parse_type(first+2, last, db); in parse_special_name()
4379 if (t != first+2) in parse_special_name()
4388 return first; in parse_special_name()
4391 db.names.back().first = "construction vtable for " + in parse_special_name()
4394 first = t1; in parse_special_name()
4402 const char* t0 = parse_call_offset(first+1, last); in parse_special_name()
4403 if (t0 == first+1) in parse_special_name()
4409 return first; in parse_special_name()
4410 if (first[2] == 'v') in parse_special_name()
4412 db.names.back().first.insert(0, "virtual thunk to "); in parse_special_name()
4413 first = t; in parse_special_name()
4417 db.names.back().first.insert(0, "non-virtual thunk to "); in parse_special_name()
4418 first = t; in parse_special_name()
4426 switch (first[1]) in parse_special_name()
4430 t = parse_name(first+2, last, db); in parse_special_name()
4431 if (t != first+2) in parse_special_name()
4434 return first; in parse_special_name()
4435 db.names.back().first.insert(0, "guard variable for "); in parse_special_name()
4436 first = t; in parse_special_name()
4441 t = parse_name(first+2, last, db); in parse_special_name()
4442 if (t != first+2) in parse_special_name()
4445 return first; in parse_special_name()
4446 db.names.back().first.insert(0, "reference temporary for "); in parse_special_name()
4447 first = t; in parse_special_name()
4454 return first; in parse_special_name()
4483 parse_encoding(const char* first, const char* last, C& db) in parse_encoding() argument
4485 if (first != last) in parse_encoding()
4492 switch (*first) in parse_encoding()
4496 first = parse_special_name(first, last, db); in parse_encoding()
4501 const char* t = parse_name(first, last, db, in parse_encoding()
4505 if (t != first) in parse_encoding()
4514 return first; in parse_encoding()
4515 const typename C::String& nm = db.names.back().first; in parse_encoding()
4517 return first; in parse_encoding()
4522 return first; in parse_encoding()
4524 return first; in parse_encoding()
4525 auto ret1 = std::move(db.names.back().first); in parse_encoding()
4530 db.names.back().first.insert(0, ret1); in parse_encoding()
4533 db.names.back().first += '('; in parse_encoding()
4562 return first; in parse_encoding()
4564 db.names.back().first += ", "; in parse_encoding()
4567 db.names.back().first += tmp; in parse_encoding()
4574 return first; in parse_encoding()
4575 db.names.back().first += ')'; in parse_encoding()
4577 db.names.back().first.append(" const"); in parse_encoding()
4579 db.names.back().first.append(" volatile"); in parse_encoding()
4581 db.names.back().first.append(" restrict"); in parse_encoding()
4583 db.names.back().first.append(" &"); in parse_encoding()
4585 db.names.back().first.append(" &&"); in parse_encoding()
4586 db.names.back().first += ret2; in parse_encoding()
4587 first = t; in parse_encoding()
4590 first = t; in parse_encoding()
4596 return first; in parse_encoding()
4605 parse_block_invoke(const char* first, const char* last, C& db) in parse_block_invoke() argument
4607 if (last - first >= 13) in parse_block_invoke()
4610 const char* t = first; in parse_block_invoke()
4614 return first; in parse_block_invoke()
4622 return first; in parse_block_invoke()
4630 return first; in parse_block_invoke()
4631 db.names.back().first.insert(0, "invocation function for block in "); in parse_block_invoke()
4632 first = t; in parse_block_invoke()
4634 return first; in parse_block_invoke()
4642 parse_dot_suffix(const char* first, const char* last, C& db) in parse_dot_suffix() argument
4644 if (first != last && *first == '.') in parse_dot_suffix()
4647 return first; in parse_dot_suffix()
4648 db.names.back().first += " (" + typename C::String(first, last) + ")"; in parse_dot_suffix()
4649 first = last; in parse_dot_suffix()
4651 return first; in parse_dot_suffix()
4662 demangle(const char* first, const char* last, C& db, int& status) in demangle() argument
4664 if (first >= last) in demangle()
4669 if (*first == '_') in demangle()
4671 if (last - first >= 4) in demangle()
4673 if (first[1] == 'Z') in demangle()
4675 const char* t = parse_encoding(first+2, last, db); in demangle()
4676 if (t != first+2 && t != last && *t == '.') in demangle()
4681 else if (first[1] == '_' && first[2] == '_' && first[3] == 'Z') in demangle()
4683 const char* t = parse_encoding(first+4, last, db); in demangle()
4684 if (t != first+4 && t != last) in demangle()
4701 const char* t = parse_type(first, last, db); in demangle()
4858 StrT first; member
4862 string_pair(StrT f) : first(std::move(f)) {} in string_pair()
4864 : first(std::move(f)), second(std::move(s)) {} in string_pair()
4866 string_pair(const char (&s)[N]) : first(s, N-1) {} in string_pair()
4868 size_t size() const {return first.size() + second.size();} in size()
4869 StrT full() const {return first + second;} in full()
4870 StrT move_full() {return std::move(first) + std::move(second);} in move_full()
4957 db.names.back().first += db.names.back().second; in __cxa_demangle()
4958 std::memcpy(buf, db.names.back().first.data(), sz-1); in __cxa_demangle()