Lines Matching refs:last

220 demangle(const char *first, const char *last, cpp_db_t *db)  in demangle()  argument
224 if (first >= last) { in demangle()
230 t = parse_type(first, last, db); in demangle()
238 if (last - first < 4) { in demangle()
244 t = parse_encoding(first + 2, last, db); in demangle()
246 if (t != first + 2 && t != last && t[0] == '.') { in demangle()
247 t = parse_dot_suffix(t, last, db); in demangle()
258 t = parse_encoding(first + 4, last, db); in demangle()
259 if (t != first + 4 && t != last) in demangle()
260 t = parse_block_invoke(t, last, db); in demangle()
263 if (t != last) in demangle()
268 parse_dot_suffix(const char *first, const char *last, cpp_db_t *db) in parse_dot_suffix() argument
270 VERIFY3P(first, <=, last); in parse_dot_suffix()
272 if (first == last || first[0] != '.') in parse_dot_suffix()
278 nadd_l(db, first, RLEN(first, last)); in parse_dot_suffix()
281 return (last); in parse_dot_suffix()
290 parse_block_invoke(const char *first, const char *last, cpp_db_t *db) in parse_block_invoke() argument
292 VERIFY3P(first, <=, last); in parse_block_invoke()
294 if (last - first < 13) in parse_block_invoke()
304 if (t == last) in parse_block_invoke()
309 if (t + 1 == last || ISDIGIT(t[1])) in parse_block_invoke()
314 while (t < last && ISDIGIT(t[0])) in parse_block_invoke()
331 parse_encoding(const char *first, const char *last, cpp_db_t *db) in parse_encoding() argument
333 VERIFY3P(first, <=, last); in parse_encoding()
335 if (first == last) in parse_encoding()
348 t = parse_special_name(first, last, db); in parse_encoding()
353 t = parse_name(first, last, &ends_with_template_args, db); in parse_encoding()
360 if (t == last || t[0] == 'E' || t[0] == '.') in parse_encoding()
368 t2 = parse_type(t, last, db); in parse_encoding()
381 if (t == last || nempty(db)) in parse_encoding()
390 t2 = parse_type(t, last, db); in parse_encoding()
391 if (t2 == t || t == last) in parse_encoding()
460 parse_special_name(const char *first, const char *last, cpp_db_t *db) in parse_special_name() argument
462 VERIFY3P(first, <=, last); in parse_special_name()
468 if (last - first < 2) in parse_special_name()
476 t = parse_type(first + 2, last, db); in parse_special_name()
480 t = parse_type(first + 2, last, db); in parse_special_name()
484 t = parse_type(first + 2, last, db); in parse_special_name()
488 t = parse_type(first + 2, last, db); in parse_special_name()
492 t1 = parse_call_offset(first + 2, last); in parse_special_name()
495 t = parse_call_offset(t1, last); in parse_special_name()
498 t1 = parse_encoding(t, last, db); in parse_special_name()
503 t = parse_type(first + 2, last, db); in parse_special_name()
506 t1 = parse_number(t, last); in parse_special_name()
509 t = parse_type(t1 + 1, last, db); in parse_special_name()
516 t = parse_name(first + 2, last, NULL, db); in parse_special_name()
521 t = parse_name(first + 2, last, NULL, db); in parse_special_name()
530 t = parse_call_offset(first + 1, last); in parse_special_name()
533 t1 = parse_encoding(t, last, db); in parse_special_name()
544 t = parse_name(first + 2, last, NULL, db); in parse_special_name()
548 t = parse_name(first + 2, last, NULL, db); in parse_special_name()
577 parse_call_offset(const char *first, const char *last) in parse_call_offset() argument
579 VERIFY3P(first, <=, last); in parse_call_offset()
584 if (first == last) in parse_call_offset()
590 t = parse_number(first + 1, last); in parse_call_offset()
591 if (t == first + 1 || t == last || t[0] != '_') in parse_call_offset()
600 t1 = parse_number(t, last); in parse_call_offset()
601 if (t == t1 || t1 == last || t1[0] != '_') in parse_call_offset()
620 parse_name(const char *first, const char *last, in parse_name() argument
623 VERIFY3P(first, <=, last); in parse_name()
628 if (last - first < 2) in parse_name()
637 t1 = parse_nested_name(t, last, ends_with_template_args, db); in parse_name()
640 t1 = parse_local_name(t, last, ends_with_template_args, db); in parse_name()
649 t1 = parse_unscoped_name(t, last, db); in parse_name()
656 t1 = parse_substitution(t, last, db); in parse_name()
657 if (t == t1 || t1 == last || t1[0] != 'I') in parse_name()
663 t = parse_template_args(t1, last, db); in parse_name()
683 parse_local_name(const char *first, const char *last, in parse_local_name() argument
686 VERIFY3P(first, <=, last); in parse_local_name()
692 if (first == last || first[0] != 'Z') in parse_local_name()
695 t = parse_encoding(first + 1, last, db); in parse_local_name()
696 if (t == first + 1 || t == last || t[0] != 'E') in parse_local_name()
706 return (parse_discriminator(t, last)); in parse_local_name()
710 t1 = parse_number(t + 1, last); in parse_local_name()
718 t2 = parse_name(t1, last, ends_with_template_args, db); in parse_local_name()
726 t2 = parse_discriminator(t2, last); in parse_local_name()
751 parse_nested_name(const char *first, const char *last, in parse_nested_name() argument
754 VERIFY3P(first, <=, last); in parse_nested_name()
756 if (first == last || first[0] != 'N') in parse_nested_name()
760 const char *t = parse_cv_qualifiers(first + 1, last, &cv); in parse_nested_name()
762 if (t == last) in parse_nested_name()
777 if (last - first < 2 || t[1] != 't') in parse_nested_name()
779 if (last - first == 2) in parse_nested_name()
790 while (t[0] != 'E' && t != last) { in parse_nested_name()
797 if (t + 1 != last && t[1] == 't') in parse_nested_name()
800 t1 = parse_substitution(t, last, db); in parse_nested_name()
801 if (t1 == t || t1 == last || NAMT(db, n) != 1) in parse_nested_name()
818 t1 = parse_template_param(t, last, db); in parse_nested_name()
819 if (t1 == t || t1 == last || NAMT(db, n) != 1) in parse_nested_name()
836 if (t + 1 != last && t[1] != 't' && t[1] != 'T') in parse_nested_name()
838 t1 = parse_decltype(t, last, db); in parse_nested_name()
839 if (t1 == t || t1 == last || NAMT(db, n) != 1) in parse_nested_name()
863 t1 = parse_template_args(t, last, db); in parse_nested_name()
864 if (t1 == t || t1 == last) in parse_nested_name()
875 if (t + 1 == last) in parse_nested_name()
884 t1 = parse_unqualified_name(t, last, db); in parse_nested_name()
885 if (t1 == t || t1 == last || NAMT(db, n) != 1) in parse_nested_name()
926 parse_template_arg(const char *first, const char *last, cpp_db_t *db) in parse_template_arg() argument
928 VERIFY3P(first, <=, last); in parse_template_arg()
933 if (first == last) in parse_template_arg()
938 t = parse_expression(first + 1, last, db); in parse_template_arg()
948 if (t == last) in parse_template_arg()
952 t1 = parse_template_arg(t, last, db); in parse_template_arg()
963 if (first + 1 == last || first[1] != 'Z') { in parse_template_arg()
964 t = parse_expr_primary(first, last, db); in parse_template_arg()
966 t = parse_encoding(first + 2, last, db); in parse_template_arg()
967 if (t == first + 2 || t == last || t[0] != 'E') in parse_template_arg()
976 t = parse_type(first, last, db); in parse_template_arg()
1126 parse_expression(const char *first, const char *last, cpp_db_t *db) in parse_expression() argument
1128 VERIFY3P(first, <=, last); in parse_expression()
1130 if (last - first < 2) in parse_expression()
1138 return (expr_tbl[i].p.parse_expr_arg(first, last, in parse_expression()
1141 return (expr_tbl[i].p.parse_expr_noarg(first, last, in parse_expression()
1148 return (parse_expr_primary(first, last, db)); in parse_expression()
1150 return (parse_template_param(first, last, db)); in parse_expression()
1152 return (parse_function_param(first, last, db)); in parse_expression()
1162 return (parse_unresolved_name(first, last, db)); in parse_expression()
1169 parse_binary_expr(const char *first, const char *last, const char *op, in parse_binary_expr() argument
1172 VERIFY3P(first, <=, last); in parse_binary_expr()
1174 if (last - first < 2) in parse_binary_expr()
1179 const char *t1 = parse_expression(first + 2, last, db); in parse_binary_expr()
1185 const char *t2 = parse_expression(t1, last, db); in parse_binary_expr()
1202 parse_prefix_expr(const char *first, const char *last, const char *op, in parse_prefix_expr() argument
1205 VERIFY3P(first, <=, last); in parse_prefix_expr()
1207 if (last - first < 2) in parse_prefix_expr()
1212 const char *t = parse_expression(first + 2, last, db); in parse_prefix_expr()
1224 parse_gs(const char *first, const char *last, cpp_db_t *db) in parse_gs() argument
1226 VERIFY3P(first, <=, last); in parse_gs()
1230 if (last - first < 4) in parse_gs()
1234 t = parse_new_expr(first + 2, last, db); in parse_gs()
1236 t = parse_del_expr(first + 2, last, db); in parse_gs()
1257 parse_new_expr(const char *first, const char *last, cpp_db_t *db) in parse_new_expr() argument
1259 VERIFY3P(first, <=, last); in parse_new_expr()
1262 if (last - first < 3) in parse_new_expr()
1274 while (t1 != last && t1[0] != '_') { in parse_new_expr()
1275 t2 = parse_expression(t1, last, db); in parse_new_expr()
1281 if (t1 == last) in parse_new_expr()
1289 t2 = parse_type(t1 + 1, last, db); in parse_new_expr()
1294 if (last - t2 < 3) in parse_new_expr()
1303 while (t2[0] != 'E' && t2 != last) { in parse_new_expr()
1304 t3 = parse_expression(t2, last, db); in parse_new_expr()
1310 if (t3 == last || t3[0] != 'E') in parse_new_expr()
1324 parse_del_expr(const char *first, const char *last, cpp_db_t *db) in parse_del_expr() argument
1326 VERIFY3P(first, <=, last); in parse_del_expr()
1328 if (last - first < 3) in parse_del_expr()
1335 const char *t = parse_expression(first + 2, last, db); in parse_del_expr()
1344 parse_idx_expr(const char *first, const char *last, cpp_db_t *db) in parse_idx_expr() argument
1346 VERIFY3P(first, <=, last); in parse_idx_expr()
1351 const char *t1 = parse_expression(first + 2, last, db); in parse_idx_expr()
1355 const char *t2 = parse_expression(t1, last, db); in parse_idx_expr()
1364 parse_ppmm_expr(const char *first, const char *last, const char *fmt, in parse_ppmm_expr() argument
1367 VERIFY3P(first, <=, last); in parse_ppmm_expr()
1369 if (last - first < 3) in parse_ppmm_expr()
1376 t = parse_binary_expr(first + 3, last, "--", db); in parse_ppmm_expr()
1382 t = parse_expression(first + 2, last, db); in parse_ppmm_expr()
1391 parse_mm_expr(const char *first, const char *last, cpp_db_t *db) in parse_mm_expr() argument
1393 VERIFY3P(first, <=, last); in parse_mm_expr()
1397 return (parse_ppmm_expr(first, last, "({0})--", db)); in parse_mm_expr()
1401 parse_pp_expr(const char *first, const char *last, cpp_db_t *db) in parse_pp_expr() argument
1403 VERIFY3P(first, <=, last); in parse_pp_expr()
1408 return (parse_ppmm_expr(first, last, "({0})++", db)); in parse_pp_expr()
1412 parse_trinary_expr(const char *first, const char *last, cpp_db_t *db) in parse_trinary_expr() argument
1414 VERIFY3P(first, <=, last); in parse_trinary_expr()
1419 if (last - first < 2) in parse_trinary_expr()
1422 t1 = parse_expression(first + 2, last, db); in parse_trinary_expr()
1425 t2 = parse_expression(t1, last, db); in parse_trinary_expr()
1428 t3 = parse_expression(t2, last, db); in parse_trinary_expr()
1440 parse_noexcept_expr(const char *first, const char *last, cpp_db_t *db) in parse_noexcept_expr() argument
1442 VERIFY3P(first, <=, last); in parse_noexcept_expr()
1444 if (last - first < 2) in parse_noexcept_expr()
1448 const char *t = parse_expression(first + 2, last, db); in parse_noexcept_expr()
1463 parse_cast_expr(const char *first, const char *last, cpp_db_t *db) in parse_cast_expr() argument
1465 VERIFY3P(first, <=, last); in parse_cast_expr()
1467 if (last - first < 2) in parse_cast_expr()
1490 const char *t1 = parse_type(first + 2, last, db); in parse_cast_expr()
1494 const char *t2 = parse_expression(t1, last, db); in parse_cast_expr()
1506 parse_arrow_expr(const char *first, const char *last, cpp_db_t *db) in parse_arrow_expr() argument
1508 VERIFY3P(first, <=, last); in parse_arrow_expr()
1510 if (last - first < 4) in parse_arrow_expr()
1515 const char *t1 = parse_expression(first + 2, last, db); in parse_arrow_expr()
1519 const char *t2 = parse_expression(t1, last, db); in parse_arrow_expr()
1571 parse_type(const char *first, const char *last, cpp_db_t *db) in parse_type() argument
1573 VERIFY3P(first, <=, last); in parse_type()
1575 if (first == last) in parse_type()
1582 return (parse_qual_type(first, last, db)); in parse_type()
1591 t = parse_builtin_type(first, last, db); in parse_type()
1597 t = parse_array_type(first, last, db); in parse_type()
1604 t = parse_type(first + 1, last, db); in parse_type()
1613 t = parse_function_type(first, last, db); in parse_type()
1620 t = parse_type(first + 1, last, db); in parse_type()
1629 t = parse_pointer_to_member_type(first, last, db); in parse_type()
1636 t = parse_type(first + 1, last, db); in parse_type()
1652 t = parse_type(first + 1, last, db); in parse_type()
1677 t = parse_type(first + 1, last, db); in parse_type()
1696 t = parse_template_param(first, last, db); in parse_type()
1705 t1 = parse_template_args(t, last, db); in parse_type()
1714 if (first + 1 == last) in parse_type()
1717 t = parse_source_name(first + 1, last, db); in parse_type()
1723 t1 = parse_type(t, last, db); in parse_type()
1755 if (first + 1 != last && first[1] == 't') { in parse_type()
1756 t = parse_name(first, last, NULL, db); in parse_type()
1764 t = parse_substitution(first, last, db); in parse_type()
1772 t1 = parse_template_args(t, last, db); in parse_type()
1784 if (first + 1 == last) in parse_type()
1789 t = parse_type(first + 2, last, db); in parse_type()
1798 t = parse_decltype(first, last, db); in parse_type()
1806 t = parse_vector_type(first, last, db); in parse_type()
1823 t = parse_builtin_type(first, last, db); in parse_type()
1827 t = parse_name(first, last, NULL, db); in parse_type()
1836 parse_qual_type(const char *first, const char *last, cpp_db_t *db) in parse_qual_type() argument
1838 VERIFY3P(first, <=, last); in parse_qual_type()
1844 t = parse_cv_qualifiers(first, last, &cv); in parse_qual_type()
1851 t1 = parse_type(t, last, db); in parse_qual_type()
1911 parse_alignof(const char *first, const char *last, cpp_db_t *db) in parse_alignof() argument
1913 VERIFY3P(first, <=, last); in parse_alignof()
1915 if (last - first < 2) in parse_alignof()
1923 const char *t = fn(first + 2, last, db); in parse_alignof()
1936 parse_sizeof(const char *first, const char *last, cpp_db_t *db) in parse_sizeof() argument
1938 VERIFY3P(first, <=, last); in parse_sizeof()
1940 if (last - first < 2) in parse_sizeof()
1950 t = parse_type(first + 2, last, db); in parse_sizeof()
1953 t = parse_expression(first + 2, last, db); in parse_sizeof()
1974 parse_function_param(const char *first, const char *last, cpp_db_t *db) in parse_function_param() argument
1976 VERIFY3P(first, <=, last); in parse_function_param()
1978 if (last - first < 3 || first[0] != 'f') in parse_function_param()
1986 t2 = parse_number(t1, last); in parse_function_param()
1987 if (t2 == last || t2[0] != 'p') in parse_function_param()
1995 t1 = parse_cv_qualifiers(t1, last, &cv); in parse_function_param()
1996 t2 = parse_number(t1, last); in parse_function_param()
1997 if (t2 == last || t2[0] != '_') in parse_function_param()
2014 parse_sizeof_param_pack_expr(const char *first, const char *last, cpp_db_t *db) in parse_sizeof_param_pack_expr() argument
2016 VERIFY3P(first, <=, last); in parse_sizeof_param_pack_expr()
2018 if (last - first < 3) in parse_sizeof_param_pack_expr()
2031 t = parse_template_param(first + 2, last, db); in parse_sizeof_param_pack_expr()
2033 t = parse_function_param(first + 2, last, db); in parse_sizeof_param_pack_expr()
2048 parse_typeid_expr(const char *first, const char *last, cpp_db_t *db) in parse_typeid_expr() argument
2050 VERIFY3P(first, <=, last); in parse_typeid_expr()
2052 if (last - first < 3) in parse_typeid_expr()
2062 t = parse_expression(first + 2, last, db); in parse_typeid_expr()
2064 t = parse_type(first + 2, last, db); in parse_typeid_expr()
2078 parse_throw_expr(const char *first, const char *last, cpp_db_t *db) in parse_throw_expr() argument
2080 VERIFY3P(first, <=, last); in parse_throw_expr()
2082 if (last - first < 3) in parse_throw_expr()
2094 const char *t = parse_expression(first + 2, last, db); in parse_throw_expr()
2104 parse_dot_star_expr(const char *first, const char *last, cpp_db_t *db) in parse_dot_star_expr() argument
2106 VERIFY3P(first, <=, last); in parse_dot_star_expr()
2108 if (last - first < 3) in parse_dot_star_expr()
2115 const char *t = parse_expression(first + 2, last, db); in parse_dot_star_expr()
2119 const char *t2 = parse_expression(t, last, db); in parse_dot_star_expr()
2129 parse_dot_expr(const char *first, const char *last, cpp_db_t *db) in parse_dot_expr() argument
2131 VERIFY3P(first, <=, last); in parse_dot_expr()
2133 if (last - first < 3) in parse_dot_expr()
2139 const char *t = parse_expression(first + 2, last, db); in parse_dot_expr()
2143 const char *t1 = parse_unresolved_name(t, last, db); in parse_dot_expr()
2153 parse_call_expr(const char *first, const char *last, cpp_db_t *db) in parse_call_expr() argument
2155 VERIFY3P(first, <=, last); in parse_call_expr()
2157 if (last - first < 4) in parse_call_expr()
2167 for (t = first + 2; t != last && t[0] != 'E'; t = t1) { in parse_call_expr()
2168 t1 = parse_expression(t, last, db); in parse_call_expr()
2175 if (t == last || amt == 0) in parse_call_expr()
2192 parse_conv_expr(const char *first, const char *last, cpp_db_t *db) in parse_conv_expr() argument
2194 VERIFY3P(first, <=, last); in parse_conv_expr()
2196 if (last - first < 3) in parse_conv_expr()
2210 t = parse_type(first + 2, last, db); in parse_conv_expr()
2217 t1 = parse_expression(t, last, db); in parse_conv_expr()
2227 while (t[0] != 'E' && t != last) { in parse_conv_expr()
2228 t1 = parse_expression(t, last, db); in parse_conv_expr()
2249 parse_simple_id(const char *first, const char *last, cpp_db_t *db) in parse_simple_id() argument
2251 VERIFY3P(first, <=, last); in parse_simple_id()
2253 const char *t = parse_source_name(first, last, db); in parse_simple_id()
2257 const char *t1 = parse_template_args(t, last, db); in parse_simple_id()
2271 parse_unresolved_type(const char *first, const char *last, cpp_db_t *db) in parse_unresolved_type() argument
2273 VERIFY3P(first, <=, last); in parse_unresolved_type()
2275 if (first == last) in parse_unresolved_type()
2283 t = parse_template_param(first, last, db); in parse_unresolved_type()
2293 t = parse_decltype(first, last, db); in parse_unresolved_type()
2300 t = parse_substitution(first, last, db); in parse_unresolved_type()
2304 if (last - first < 2 || first[1] != 't') in parse_unresolved_type()
2307 t = parse_unqualified_name(first + 2, last, db); in parse_unresolved_type()
2321 parse_pack_expansion(const char *first, const char *last, cpp_db_t *db) in parse_pack_expansion() argument
2323 VERIFY3P(first, <=, last); in parse_pack_expansion()
2325 if (last - first < 3) in parse_pack_expansion()
2331 const char *t = parse_expression(first + 2, last, db); in parse_pack_expansion()
2344 parse_unscoped_name(const char *first, const char *last, cpp_db_t *db) in parse_unscoped_name() argument
2346 VERIFY3P(first, <=, last); in parse_unscoped_name()
2348 if (last - first < 2) in parse_unscoped_name()
2359 if (first + 3 != last && first[2] == 'L') in parse_unscoped_name()
2363 t1 = parse_unqualified_name(t, last, db); in parse_unscoped_name()
2380 parse_unqualified_name(const char *first, const char *last, cpp_db_t *db) in parse_unqualified_name() argument
2382 VERIFY3P(first, <=, last); in parse_unqualified_name()
2384 if (first == last) in parse_unqualified_name()
2390 return (parse_ctor_dtor_name(first, last, db)); in parse_unqualified_name()
2392 return (parse_unnamed_type_name(first, last, db)); in parse_unqualified_name()
2403 return (parse_source_name(first, last, db)); in parse_unqualified_name()
2405 return (parse_operator_name(first, last, db)); in parse_unqualified_name()
2419 parse_unnamed_type_name(const char *first, const char *last, cpp_db_t *db) in parse_unnamed_type_name() argument
2421 VERIFY3P(first, <=, last); in parse_unnamed_type_name()
2423 if (last - first < 2 || first[0] != 'U') in parse_unnamed_type_name()
2433 while (t1 != last && t1[0] != '_' && ISDIGIT(t1[0])) in parse_unnamed_type_name()
2452 t2 = parse_type(t1, last, db); in parse_unnamed_type_name()
2456 } while (t1 != last && t1[0] != 'E'); in parse_unnamed_type_name()
2458 if (t1 == last || NAMT(db, n) < 1) in parse_unnamed_type_name()
2475 while (t2 != last && t2[0] != '_') { in parse_unnamed_type_name()
2600 parse_ctor_dtor_name(const char *first, const char *last, cpp_db_t *db) in parse_ctor_dtor_name() argument
2602 VERIFY3P(first, <=, last); in parse_ctor_dtor_name()
2604 if (last - first < 2 || nempty(db) || str_length(TOP_L(db)) == 0) in parse_ctor_dtor_name()
2642 parse_integer_literal(const char *first, const char *last, const char *fmt, in parse_integer_literal() argument
2645 VERIFY3P(first, <=, last); in parse_integer_literal()
2647 const char *t = parse_number(first, last); in parse_integer_literal()
2650 if (t == first || t == last || t[0] != 'E') in parse_integer_literal()
2676 parse_floating_literal(const char *first, const char *last, cpp_db_t *db) in parse_floating_literal() argument
2678 VERIFY3P(first, <=, last); in parse_floating_literal()
2691 if (fd == NULL || (size_t)(last - first) < fd->mangled_size) in parse_floating_literal()
2723 last = first + fd->mangled_size + 1; in parse_floating_literal()
2726 for (t = first + 1; t != last; t++, e++) { in parse_floating_literal()
2737 for (t = last - 1; t > first; t--, e++) { in parse_floating_literal()
2747 t = last; in parse_floating_literal()
2822 parse_expr_primary(const char *first, const char *last, cpp_db_t *db) in parse_expr_primary() argument
2824 VERIFY3P(first, <=, last); in parse_expr_primary()
2826 if (last - first < 4 || first[0] != 'L') in parse_expr_primary()
2833 t = parse_integer_literal(first + 2, last, in parse_expr_primary()
2858 t = parse_floating_literal(first + 1, last, db); in parse_expr_primary()
2873 t = parse_encoding(first + 3, last, db); in parse_expr_primary()
2874 if (t == first + 3 || t == last || t[0] != 'E') in parse_expr_primary()
2880 t = parse_type(first + 1, last, db); in parse_expr_primary()
2881 if (t == first + 1 || t == last) in parse_expr_primary()
2888 for (n = t; n != last && ISDIGIT(n[0]); n++) in parse_expr_primary()
2890 if (n == last || nempty(db) || n[0] != 'E') in parse_expr_primary()
3009 parse_operator_name(const char *first, const char *last, cpp_db_t *db) in parse_operator_name() argument
3011 VERIFY3P(first, <=, last); in parse_operator_name()
3013 if (last - first < 2) in parse_operator_name()
3027 t = parse_source_name(first + 2, last, db); in parse_operator_name()
3039 t = parse_source_name(first + 2, last, db); in parse_operator_name()
3054 t = parse_type(first + 2, last, db); in parse_operator_name()
3107 parse_builtin_type(const char *first, const char *last, cpp_db_t *db) in parse_builtin_type() argument
3109 VERIFY3P(first, <=, last); in parse_builtin_type()
3111 if (first == last) in parse_builtin_type()
3124 if (first + 1 == last) in parse_builtin_type()
3135 const char *t = parse_source_name(first + 1, last, db); in parse_builtin_type()
3145 parse_base36(const char *first, const char *last, size_t *val) in parse_base36() argument
3147 VERIFY3P(first, <=, last); in parse_base36()
3151 for (t = first, *val = 0; t != last; t++) { in parse_base36()
3175 parse_substitution(const char *first, const char *last, cpp_db_t *db) in parse_substitution() argument
3177 VERIFY3P(first, <=, last); in parse_substitution()
3179 if (first == last || last - first < 2) in parse_substitution()
3196 t = parse_base36(first + 1, last, &n); in parse_substitution()
3220 parse_source_name(const char *first, const char *last, cpp_db_t *db) in parse_source_name() argument
3222 VERIFY3P(first, <=, last); in parse_source_name()
3224 if (first == last) in parse_source_name()
3230 for (t = first; t != last && ISDIGIT(t[0]); t++) { in parse_source_name()
3243 if (n == 0 || t == last || t + n > last || in parse_source_name()
3264 parse_vector_type(const char *first, const char *last, cpp_db_t *db) in parse_vector_type() argument
3266 VERIFY3P(first, <=, last); in parse_vector_type()
3268 if (last - first < 3) in parse_vector_type()
3278 t1 = parse_number(t, last); in parse_vector_type()
3279 if (t1 == last || t1 + 1 == last || t1[0] != '_') in parse_vector_type()
3288 t1 = parse_type(t, last, db); in parse_vector_type()
3300 t1 = parse_expression(first + 2, last, db); in parse_vector_type()
3301 if (first == last || t1 == first + 2 || t1[0] != '_') in parse_vector_type()
3310 t1 = parse_type(t, last, db); in parse_vector_type()
3325 parse_decltype(const char *first, const char *last, cpp_db_t *db) in parse_decltype() argument
3327 VERIFY3P(first, <=, last); in parse_decltype()
3329 if (last - first < 4) in parse_decltype()
3338 const char *t = parse_expression(first + 2, last, db); in parse_decltype()
3339 if (NAMT(db, n) != 1 || t == first + 2 || t == last || t[0] != 'E') in parse_decltype()
3353 parse_array_type(const char *first, const char *last, cpp_db_t *db) in parse_array_type() argument
3355 VERIFY3P(first, <=, last); in parse_array_type()
3358 if (last - first < 3) in parse_array_type()
3367 t1 = parse_number(t, last); in parse_array_type()
3368 if (t1 == last) in parse_array_type()
3373 t1 = parse_expression(t, last, db); in parse_array_type()
3374 if (t1 == last || t == t1) in parse_array_type()
3388 t1 = parse_type(t + 1, last, db); in parse_array_type()
3406 parse_pointer_to_member_type(const char *first, const char *last, cpp_db_t *db) in parse_pointer_to_member_type() argument
3408 VERIFY3P(first, <=, last); in parse_pointer_to_member_type()
3410 if (last - first < 3) in parse_pointer_to_member_type()
3419 t2 = parse_type(t1, last, db); in parse_pointer_to_member_type()
3424 t2 = parse_type(t1, last, db); in parse_pointer_to_member_type()
3455 parse_unresolved_name(const char *first, const char *last, cpp_db_t *db) in parse_unresolved_name() argument
3457 VERIFY3P(first, <=, last); in parse_unresolved_name()
3459 if (last - first < 2) in parse_unresolved_name()
3471 if (t == last) in parse_unresolved_name()
3474 t2 = parse_base_unresolved_name(t, last, db); in parse_unresolved_name()
3485 if (t[0] != 's' || t[1] != 'r' || last - t < 2) in parse_unresolved_name()
3491 t2 = parse_unresolved_type(t, last, db); in parse_unresolved_name()
3492 if (t2 == t || t2 == last) in parse_unresolved_name()
3496 t2 = parse_template_args(t, last, db); in parse_unresolved_name()
3498 if (NAMT(db, n) < 2 || t2 == last) in parse_unresolved_name()
3509 t2 = parse_unresolved_qualifier_level(t, last, db); in parse_unresolved_name()
3510 if (t == t2 || t == last || NAMT(db, nn) != 1) in parse_unresolved_name()
3519 t2 = parse_base_unresolved_name(t, last, db); in parse_unresolved_name()
3529 t2 = parse_unresolved_type(t, last, db); in parse_unresolved_name()
3532 t2 = parse_template_args(t, last, db); in parse_unresolved_name()
3537 t2 = parse_base_unresolved_name(t, last, db); in parse_unresolved_name()
3545 t2 = parse_unresolved_qualifier_level(t, last, db); in parse_unresolved_name()
3546 if (t2 == t || t2 == last) in parse_unresolved_name()
3554 t2 = parse_unresolved_qualifier_level(t, last, db); in parse_unresolved_name()
3555 if (t == t2 || t == last || nlen(db) < 2) in parse_unresolved_name()
3564 t2 = parse_base_unresolved_name(t, last, db); in parse_unresolved_name()
3574 parse_unresolved_qualifier_level(const char *first, const char *last, in parse_unresolved_qualifier_level() argument
3577 VERIFY3P(first, <=, last); in parse_unresolved_qualifier_level()
3578 return (parse_simple_id(first, last, db)); in parse_unresolved_qualifier_level()
3593 parse_base_unresolved_name(const char *first, const char *last, cpp_db_t *db) in parse_base_unresolved_name() argument
3595 VERIFY3P(first, <=, last); in parse_base_unresolved_name()
3597 if (last - first < 2) in parse_base_unresolved_name()
3604 t = parse_simple_id(first, last, db); in parse_base_unresolved_name()
3608 t = parse_operator_name(first, last, db); in parse_base_unresolved_name()
3612 t1 = parse_template_args(t, last, db); in parse_base_unresolved_name()
3623 t = parse_destructor_name(first + 2, last, db); in parse_base_unresolved_name()
3627 t = parse_operator_name(first + 2, last, db); in parse_base_unresolved_name()
3631 t1 = parse_template_args(t, last, db); in parse_base_unresolved_name()
3642 parse_destructor_name(const char *first, const char *last, cpp_db_t *db) in parse_destructor_name() argument
3644 VERIFY3P(first, <=, last); in parse_destructor_name()
3646 if (first == last) in parse_destructor_name()
3649 const char *t = parse_unresolved_type(first, last, db); in parse_destructor_name()
3652 t = parse_simple_id(first, last, db); in parse_destructor_name()
3668 parse_function_type(const char *first, const char *last, cpp_db_t *db) in parse_function_type() argument
3670 VERIFY3P(first, <=, last); in parse_function_type()
3672 if (last - first < 2) in parse_function_type()
3683 const char *t1 = parse_type(t, last, db); in parse_function_type()
3692 while (t != last && t[0] != 'E') { in parse_function_type()
3698 if (t[0] == 'R' && t + 1 != last && t[1] == 'E') { in parse_function_type()
3704 if (t[0] == 'O' && t + 1 != last && t[1] == 'E') { in parse_function_type()
3711 t1 = parse_type(t, last, db); in parse_function_type()
3712 if (t1 == t || t == last) in parse_function_type()
3718 if (t == last) in parse_function_type()
3744 parse_template_param(const char *first, const char *last, cpp_db_t *db) in parse_template_param() argument
3746 VERIFY3P(first, <=, last); in parse_template_param()
3748 if (last - first < 2 || first[0] != 'T') in parse_template_param()
3754 while (t != last && t[0] != '_') { in parse_template_param()
3763 if (t == last) in parse_template_param()
3798 parse_template_args(const char *first, const char *last, cpp_db_t *db) in parse_template_args() argument
3800 VERIFY3P(first, <=, last); in parse_template_args()
3802 if (last - first < 2 || first[0] != 'I') in parse_template_args()
3816 const char *t1 = parse_template_arg(t, last, db); in parse_template_args()
3821 if (t1 == t || t == last) in parse_template_args()
3860 parse_discriminator(const char *first, const char *last) in parse_discriminator() argument
3862 VERIFY3P(first, <=, last); in parse_discriminator()
3866 if (first == last) in parse_discriminator()
3870 for (t = first; t != last && ISDIGIT(t[0]); t++) in parse_discriminator()
3874 if (t != last) in parse_discriminator()
3878 } else if (first[0] != '_' || first + 1 == last) { in parse_discriminator()
3886 if (t[0] != '_' || t + 1 == last) in parse_discriminator()
3889 for (t++; t != last && ISDIGIT(t[0]); t++) in parse_discriminator()
3891 if (t == last || t[0] != '_') in parse_discriminator()
3899 parse_cv_qualifiers(const char *first, const char *last, unsigned *cv) in parse_cv_qualifiers() argument
3901 VERIFY3P(first, <=, last); in parse_cv_qualifiers()
3903 if (first == last) in parse_cv_qualifiers()
3911 if (first != last && first[0] == 'V') { in parse_cv_qualifiers()
3915 if (first != last && first[0] == 'K') { in parse_cv_qualifiers()
3927 parse_number(const char *first, const char *last) in parse_number() argument
3929 VERIFY3P(first, <=, last); in parse_number()
3933 if (first == last || (first[0] != 'n' && !ISDIGIT(first[0]))) in parse_number()