Lines Matching refs:first
220 demangle(const char *first, const char *last, cpp_db_t *db) in demangle() argument
224 if (first >= last) { in demangle()
229 if (first[0] != '_') { in demangle()
230 t = parse_type(first, last, db); in demangle()
231 if (t == first) { in demangle()
238 if (last - first < 4) { in demangle()
243 if (first[1] == 'Z') { in demangle()
244 t = parse_encoding(first + 2, last, db); in demangle()
246 if (t != first + 2 && t != last && t[0] == '.') { in demangle()
255 if (first[1] != '_' || first[2] != '_' || first[3] != 'Z') in demangle()
258 t = parse_encoding(first + 4, last, db); in demangle()
259 if (t != first + 4 && 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()
273 return (first); in parse_dot_suffix()
276 return (first); in parse_dot_suffix()
278 nadd_l(db, first, RLEN(first, 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()
295 return (first); in parse_block_invoke()
298 const char *t = first; in parse_block_invoke()
300 if (strncmp(first, test, sizeof (test) - 1) != 0) in parse_block_invoke()
301 return (first); in parse_block_invoke()
310 return (first); in parse_block_invoke()
319 return (first); 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()
336 return (first); in parse_encoding()
347 if (first[0] == 'G' || first[0] == 'T') { 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()
354 if (t == first) in parse_encoding()
437 return (first); 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()
464 const char *t = first; in parse_special_name()
468 if (last - first < 2) in parse_special_name()
469 return (first); 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()
494 return (first); in parse_special_name()
497 return (first); in parse_special_name()
500 return (first); in parse_special_name()
503 t = parse_type(first + 2, last, db); in parse_special_name()
504 if (t == first + 2) in parse_special_name()
505 return (first); in parse_special_name()
508 return (first); in parse_special_name()
511 return (first); 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()
524 if (first[1] == 'v') { in parse_special_name()
530 t = parse_call_offset(first + 1, last); in parse_special_name()
531 if (t == first + 1) in parse_special_name()
532 return (first); in parse_special_name()
535 return (first); in parse_special_name()
541 switch (first[1]) { 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()
551 return (first); in parse_special_name()
555 return (first); in parse_special_name()
559 if (t == first + 2 || amt < 2) in parse_special_name()
560 return (first); 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()
585 return (first); in parse_call_offset()
587 if (first[0] != 'h' && first[0] != 'v') in parse_call_offset()
588 return (first); 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()
592 return (first); in parse_call_offset()
597 if (first[0] == 'h') in parse_call_offset()
602 return (first); in parse_call_offset()
620 parse_name(const char *first, const char *last, in parse_name() argument
623 VERIFY3P(first, <=, last); in parse_name()
625 const char *t = first; in parse_name()
628 if (last - first < 2) in parse_name()
629 return (first); in parse_name()
638 return ((t == t1) ? first : t1); in parse_name()
641 return ((t == t1) ? first : t1); in parse_name()
658 return (first); in parse_name()
665 return (first); 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()
693 return (first); 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()
697 return (first); in parse_local_name()
712 return (first); in parse_local_name()
720 return (first); 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()
757 return (first); in parse_nested_name()
760 const char *t = parse_cv_qualifiers(first + 1, last, &cv); in parse_nested_name()
763 return (first); 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()
780 return (first); in parse_nested_name()
802 return (first); in parse_nested_name()
820 return (first); in parse_nested_name()
840 return (first); in parse_nested_name()
861 return (first); in parse_nested_name()
865 return (first); in parse_nested_name()
876 return (first); in parse_nested_name()
886 return (first); in parse_nested_name()
903 return (first); in parse_nested_name()
913 return (first); 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()
934 return (first); in parse_template_arg()
936 switch (first[0]) { in parse_template_arg()
938 t = parse_expression(first + 1, last, db); in parse_template_arg()
939 if (t == first + 1 || t[0] != 'E') in parse_template_arg()
940 return (first); in parse_template_arg()
947 t = first + 1; in parse_template_arg()
949 return (first); in parse_template_arg()
954 return (first); 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()
968 return (first); 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()
1131 return (first); in parse_expression()
1134 if (strncmp(expr_tbl[i].code, first, 2) != 0) 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()
1146 switch (first[0]) { 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()
1165 return (first); 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()
1175 return (first); in parse_binary_expr()
1179 const char *t1 = parse_expression(first + 2, last, db); in parse_binary_expr()
1180 if (t1 == first + 2) in parse_binary_expr()
1181 return (first); in parse_binary_expr()
1187 return (first); in parse_binary_expr()
1190 return (first); 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()
1208 return (first); in parse_prefix_expr()
1212 const char *t = parse_expression(first + 2, last, db); in parse_prefix_expr()
1213 if (t == first + 2) { in parse_prefix_expr()
1214 return (first); 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()
1231 return (first); in parse_gs()
1233 if (first[2] == 'n' && (first[3] == 'a' || first[3] == 'w')) in parse_gs()
1234 t = parse_new_expr(first + 2, last, db); in parse_gs()
1235 else if (first[2] == 'd' && (first[3] == 'l' || first[3] == 'a')) in parse_gs()
1236 t = parse_del_expr(first + 2, last, db); in parse_gs()
1238 return (first); in parse_gs()
1240 if (t == first + 2) in parse_gs()
1241 return (first); 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()
1263 return (first); in parse_new_expr()
1265 VERIFY3U(first[0], ==, 'n'); in parse_new_expr()
1266 VERIFY(first[1] == 'a' || first[1] == 'w'); in parse_new_expr()
1268 const char *t1 = first + 2; in parse_new_expr()
1272 nadd_l(db, (first[1] == 'w') ? "new" : "new[]", 0); in parse_new_expr()
1278 return (first); in parse_new_expr()
1282 return (first); in parse_new_expr()
1291 return (first); in parse_new_expr()
1295 return (first); in parse_new_expr()
1297 return (first); in parse_new_expr()
1307 return (first); in parse_new_expr()
1311 return (first); 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()
1329 return (first); in parse_del_expr()
1331 VERIFY3U(first[0], ==, 'd'); in parse_del_expr()
1332 VERIFY(first[1] == 'l' || first[1] == 'a'); in parse_del_expr()
1335 const char *t = parse_expression(first + 2, last, db); in parse_del_expr()
1336 if (t == first + 2 || NAMT(db, n) != 1) in parse_del_expr()
1337 return (first); in parse_del_expr()
1339 nfmt(db, (first[1] == 'a') ? "delete[] {0}" : "delete {0}", NULL); 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()
1347 VERIFY3U(first[0], ==, 'i'); in parse_idx_expr()
1348 VERIFY3U(first[1], ==, 'x'); in parse_idx_expr()
1351 const char *t1 = parse_expression(first + 2, last, db); in parse_idx_expr()
1352 if (t1 == first + 2) in parse_idx_expr()
1353 return (first); in parse_idx_expr()
1357 return (first); 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()
1370 return (first); in parse_ppmm_expr()
1375 if (first[2] == '_') { in parse_ppmm_expr()
1376 t = parse_binary_expr(first + 3, last, "--", db); in parse_ppmm_expr()
1377 if (t == first + 3) in parse_ppmm_expr()
1378 return (first); in parse_ppmm_expr()
1382 t = parse_expression(first + 2, last, db); in parse_ppmm_expr()
1383 if (t == first + 2 || NAMT(db, n) < 1) in parse_ppmm_expr()
1384 return (first); 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()
1394 VERIFY3U(first[0], ==, 'm'); in parse_mm_expr()
1395 VERIFY3U(first[1], ==, 'm'); 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()
1405 VERIFY3U(first[0], ==, 'p'); in parse_pp_expr()
1406 VERIFY3U(first[0], ==, 'p'); 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()
1420 return (first); in parse_trinary_expr()
1422 t1 = parse_expression(first + 2, last, db); in parse_trinary_expr()
1423 if (t1 == first + 2) in parse_trinary_expr()
1424 return (first); in parse_trinary_expr()
1427 return (first); in parse_trinary_expr()
1430 return (first); in parse_trinary_expr()
1433 return (first); 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()
1445 return (first); in parse_noexcept_expr()
1448 const char *t = parse_expression(first + 2, last, db); in parse_noexcept_expr()
1449 if (t == first + 2 || NAMT(db, n) != 1) in parse_noexcept_expr()
1450 return (first); 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()
1468 return (first); in parse_cast_expr()
1471 switch (first[0]) { in parse_cast_expr()
1485 return (first); in parse_cast_expr()
1488 VERIFY3U(first[1], ==, 'c'); in parse_cast_expr()
1490 const char *t1 = parse_type(first + 2, last, db); in parse_cast_expr()
1491 if (t1 == first + 2) in parse_cast_expr()
1492 return (first); in parse_cast_expr()
1496 return (first); 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()
1511 return (first); in parse_arrow_expr()
1515 const char *t1 = parse_expression(first + 2, last, db); in parse_arrow_expr()
1516 if (t1 == first + 2) in parse_arrow_expr()
1517 return (first); in parse_arrow_expr()
1521 return (first); 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()
1576 return (first); in parse_type()
1578 switch (first[0]) { in parse_type()
1582 return (parse_qual_type(first, last, db)); in parse_type()
1585 const char *t = first; in parse_type()
1591 t = parse_builtin_type(first, last, db); in parse_type()
1592 if (t != first) in parse_type()
1595 switch (first[0]) { in parse_type()
1597 t = parse_array_type(first, last, db); in parse_type()
1598 if (t == first || NAMT(db, n) == 0) in parse_type()
1599 return (first); in parse_type()
1604 t = parse_type(first + 1, last, db); in parse_type()
1605 if (t == first + 1 || NAMT(db, n) == 0) in parse_type()
1606 return (first); in parse_type()
1613 t = parse_function_type(first, last, db); in parse_type()
1614 if (t == first || NAMT(db, n) == 0) in parse_type()
1615 return (first); in parse_type()
1620 t = parse_type(first + 1, last, db); in parse_type()
1621 if (t == first + 1 || NAMT(db, n) == 0) in parse_type()
1622 return (first); in parse_type()
1629 t = parse_pointer_to_member_type(first, last, db); in parse_type()
1630 if (t == first || NAMT(db, n) == 0) in parse_type()
1631 return (first); in parse_type()
1636 t = parse_type(first + 1, last, db); in parse_type()
1638 if (t == first + 1 || amt == 0) in parse_type()
1639 return (first); in parse_type()
1652 t = parse_type(first + 1, last, db); in parse_type()
1654 if (t == first + 1 || amt == 0) in parse_type()
1655 return (first); in parse_type()
1665 if (first[1] != 'U' || in parse_type()
1677 t = parse_type(first + 1, last, db); in parse_type()
1679 if (t == first + 1 || amt == 0) in parse_type()
1680 return (first); in parse_type()
1696 t = parse_template_param(first, last, db); in parse_type()
1697 if (t == first) in parse_type()
1698 return (first); in parse_type()
1714 if (first + 1 == last) in parse_type()
1715 return (first); in parse_type()
1717 t = parse_source_name(first + 1, last, db); in parse_type()
1718 if (t == first + 1) in parse_type()
1719 return (first); in parse_type()
1725 return (first); 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()
1757 if (t == first || NAMT(db, n) == 0) in parse_type()
1758 return (first); in parse_type()
1764 t = parse_substitution(first, last, db); in parse_type()
1765 if (t == first) in parse_type()
1766 return (first); in parse_type()
1784 if (first + 1 == last) in parse_type()
1785 return (first); in parse_type()
1787 switch (first[1]) { in parse_type()
1789 t = parse_type(first + 2, last, db); in parse_type()
1790 if (t == first + 2) in parse_type()
1798 t = parse_decltype(first, last, db); in parse_type()
1799 if (first == t) in parse_type()
1806 t = parse_vector_type(first, last, db); in parse_type()
1807 if (first == t) in parse_type()
1811 return (first); in parse_type()
1823 t = parse_builtin_type(first, last, db); in parse_type()
1824 if (t != first) in parse_type()
1827 t = parse_name(first, last, NULL, db); in parse_type()
1828 if (t == first || NAMT(db, n) == 0) in parse_type()
1829 return (first); 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()
1845 if (t == first) in parse_qual_type()
1846 return (first); in parse_qual_type()
1854 return (first); 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()
1916 return (first); in parse_alignof()
1920 fn = (first[1] == 't') ? parse_type : parse_expression; in parse_alignof()
1923 const char *t = fn(first + 2, last, db); in parse_alignof()
1924 if (t == first + 2 || NAMT(db, n) != 1) in parse_alignof()
1925 return (first); 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()
1941 return (first); in parse_sizeof()
1943 VERIFY3U(first[0], ==, 's'); in parse_sizeof()
1948 switch (first[1]) { 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()
1956 return (first); in parse_sizeof()
1958 if (t == first + 2 || NAMT(db, n) != 1) in parse_sizeof()
1959 return (first); 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()
1979 return (first); in parse_function_param()
1981 const char *t1 = first + 2; in parse_function_param()
1985 if (first[1] == 'L') { in parse_function_param()
1988 return (first); in parse_function_param()
1992 if (first[1] != 'p') in parse_function_param()
1993 return (first); in parse_function_param()
1998 return (first); 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()
2019 return (first); in parse_sizeof_param_pack_expr()
2021 VERIFY3U(first[0], ==, 's'); in parse_sizeof_param_pack_expr()
2022 VERIFY3U(first[1], ==, 'Z'); in parse_sizeof_param_pack_expr()
2024 if (first[2] != 'T' && first[2] != 'f') in parse_sizeof_param_pack_expr()
2025 return (first); in parse_sizeof_param_pack_expr()
2030 if (first[2] == 'T') 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()
2035 if (t == first + 2) in parse_sizeof_param_pack_expr()
2036 return (first); 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()
2053 return (first); in parse_typeid_expr()
2055 VERIFY3U(first[0], ==, 't'); in parse_typeid_expr()
2056 VERIFY(first[1] == 'e' || first[1] == 'i'); in parse_typeid_expr()
2061 if (first[1] == 'e') 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()
2066 if (t == first + 2 || NAMT(db, n) != 1) in parse_typeid_expr()
2067 return (first); 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()
2083 return (first); in parse_throw_expr()
2085 VERIFY3U(first[0], ==, 't'); in parse_throw_expr()
2086 VERIFY(first[1] == 'w' || first[1] == 'r'); in parse_throw_expr()
2088 if (first[1] == 'r') { in parse_throw_expr()
2090 return (first + 2); in parse_throw_expr()
2094 const char *t = parse_expression(first + 2, last, db); in parse_throw_expr()
2095 if (t == first + 2 || NAMT(db, n) != 1) in parse_throw_expr()
2096 return (first); 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()
2109 return (first); in parse_dot_star_expr()
2111 VERIFY3U(first[0], ==, 'd'); in parse_dot_star_expr()
2112 VERIFY3U(first[1], ==, 's'); in parse_dot_star_expr()
2115 const char *t = parse_expression(first + 2, last, db); in parse_dot_star_expr()
2116 if (t == first + 2) in parse_dot_star_expr()
2117 return (first); in parse_dot_star_expr()
2121 return (first); 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()
2134 return (first); in parse_dot_expr()
2136 VERIFY3U(first[0], ==, 'd'); in parse_dot_expr()
2137 VERIFY3U(first[1], ==, 't'); in parse_dot_expr()
2139 const char *t = parse_expression(first + 2, last, db); in parse_dot_expr()
2140 if (t == first + 2) in parse_dot_expr()
2141 return (first); in parse_dot_expr()
2145 return (first); 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()
2158 return (first); in parse_call_expr()
2160 VERIFY3U(first[0], ==, 'c'); in parse_call_expr()
2161 VERIFY3U(first[1], ==, 'l'); in parse_call_expr()
2163 const char *t = first + 2; in parse_call_expr()
2167 for (t = first + 2; t != last && t[0] != 'E'; t = t1) { in parse_call_expr()
2170 return (first); in parse_call_expr()
2176 return (first); 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()
2197 return (first); in parse_conv_expr()
2199 VERIFY3U(first[0], ==, 'c'); in parse_conv_expr()
2200 VERIFY3U(first[1], ==, 'v'); in parse_conv_expr()
2210 t = parse_type(first + 2, last, db); in parse_conv_expr()
2213 if (t == first + 2) in parse_conv_expr()
2214 return (first); in parse_conv_expr()
2219 return (first); in parse_conv_expr()
2230 return (first); in parse_conv_expr()
2241 return (first); 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()
2254 if (t == first) 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()
2276 return (first); in parse_unresolved_type()
2278 const char *t = first; in parse_unresolved_type()
2281 switch (first[0]) { in parse_unresolved_type()
2283 t = parse_template_param(first, last, db); in parse_unresolved_type()
2284 if (t == first || NAMT(db, n) != 1) { in parse_unresolved_type()
2287 return (first); in parse_unresolved_type()
2293 t = parse_decltype(first, last, db); in parse_unresolved_type()
2294 if (t == first || NAMT(db, n) == 0) in parse_unresolved_type()
2295 return (first); in parse_unresolved_type()
2300 t = parse_substitution(first, last, db); in parse_unresolved_type()
2301 if (t != first) in parse_unresolved_type()
2304 if (last - first < 2 || first[1] != 't') in parse_unresolved_type()
2305 return (first); in parse_unresolved_type()
2307 t = parse_unqualified_name(first + 2, last, db); in parse_unresolved_type()
2308 if (t == first + 2 || NAMT(db, n) == 0) in parse_unresolved_type()
2309 return (first); in parse_unresolved_type()
2316 return (first); 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()
2326 return (first); in parse_pack_expansion()
2328 VERIFY3U(first[0], ==, 's'); in parse_pack_expansion()
2329 VERIFY3U(first[1], ==, 'p'); in parse_pack_expansion()
2331 const char *t = parse_expression(first + 2, last, db); in parse_pack_expansion()
2332 if (t == first +2) in parse_pack_expansion()
2333 return (first); 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()
2349 return (first); in parse_unscoped_name()
2351 const char *t = first; in parse_unscoped_name()
2355 if (first[0] == 'S' && first[1] == 't') { in parse_unscoped_name()
2357 t = first + 2; in parse_unscoped_name()
2359 if (first + 3 != last && first[2] == 'L') in parse_unscoped_name()
2365 return (first); 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()
2385 return (first); in parse_unqualified_name()
2387 switch (*first) { 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()
2424 return (first); in parse_unnamed_type_name()
2426 if (first[1] != 't' && first[1] != 'l') in parse_unnamed_type_name()
2427 return (first); in parse_unnamed_type_name()
2429 const char *t1 = first + 2; in parse_unnamed_type_name()
2432 if (first[1] == 't') { in parse_unnamed_type_name()
2437 return (first); in parse_unnamed_type_name()
2439 if (t1 == first + 2) in parse_unnamed_type_name()
2442 nadd_l(db, first + 2, (size_t)(t1 - first - 2)); in parse_unnamed_type_name()
2450 if (first[2] != 'v') { in parse_unnamed_type_name()
2454 return (first); in parse_unnamed_type_name()
2459 return (first); in parse_unnamed_type_name()
2462 return (first); in parse_unnamed_type_name()
2466 return (first); in parse_unnamed_type_name()
2478 return (first); in parse_unnamed_type_name()
2482 return (first); 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()
2605 return (first); in parse_ctor_dtor_name()
2607 switch (first[0]) { in parse_ctor_dtor_name()
2609 switch (first[1]) { in parse_ctor_dtor_name()
2617 return (first); in parse_ctor_dtor_name()
2621 switch (first[1]) { in parse_ctor_dtor_name()
2630 return (first); in parse_ctor_dtor_name()
2634 return (first); in parse_ctor_dtor_name()
2638 return (first + 2); 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()
2648 const char *start = first; in parse_integer_literal()
2650 if (t == first || t == last || t[0] != 'E') in parse_integer_literal()
2651 return (first); in parse_integer_literal()
2653 if (first[0] == 'n') in parse_integer_literal()
2657 if (start != first) 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()
2679 VERIFY(first[0] == 'f' || first[0] == 'd' || first[0] == 'e'); in parse_floating_literal()
2684 if (float_info[i].type != first[0]) in parse_floating_literal()
2691 if (fd == NULL || (size_t)(last - first) < fd->mangled_size) in parse_floating_literal()
2692 return (first); in parse_floating_literal()
2712 switch (first[0]) { 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()
2728 return (first); in parse_floating_literal()
2737 for (t = last - 1; t > first; t--, e++) { in parse_floating_literal()
2739 return (first); in parse_floating_literal()
2753 return (first); in parse_floating_literal()
2764 switch (first[0]) { in parse_floating_literal()
2780 return (first); 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()
2827 return (first); in parse_expr_primary()
2832 if (first[1] == int_lits[i].c) { in parse_expr_primary()
2833 t = parse_integer_literal(first + 2, last, in parse_expr_primary()
2835 return ((t == first + 2) ? first : t); in parse_expr_primary()
2839 switch (first[1]) { in parse_expr_primary()
2841 if (first[3] != 'E') in parse_expr_primary()
2842 return (first); in parse_expr_primary()
2844 switch (first[2]) { in parse_expr_primary()
2852 return (first); in parse_expr_primary()
2854 return (first + 4); in parse_expr_primary()
2858 t = parse_floating_literal(first + 1, last, db); in parse_expr_primary()
2859 return ((t == first + 1) ? first : t); in parse_expr_primary()
2868 return (first); in parse_expr_primary()
2870 if (first[2] != 'Z') in parse_expr_primary()
2871 return (first); 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()
2875 return (first); 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()
2882 return (first); in parse_expr_primary()
2891 return (first); 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()
3014 return (first); in parse_operator_name()
3017 if (strncmp(first, op_tbl[i].code, 2) != 0) in parse_operator_name()
3021 return (first + 2); in parse_operator_name()
3026 if (first[0] == 'l' && first[1] == 'i') { in parse_operator_name()
3027 t = parse_source_name(first + 2, last, db); in parse_operator_name()
3028 if (t == first + 2 || nempty(db)) in parse_operator_name()
3029 return (first); in parse_operator_name()
3035 if (first[0] == 'v') { in parse_operator_name()
3036 if (!ISDIGIT(first[1])) in parse_operator_name()
3037 return (first); in parse_operator_name()
3039 t = parse_source_name(first + 2, last, db); in parse_operator_name()
3040 if (t == first + 2) in parse_operator_name()
3041 return (first); in parse_operator_name()
3047 if (first[0] != 'c' && first[1] != 'v') in parse_operator_name()
3048 return (first); in parse_operator_name()
3054 t = parse_type(first + 2, last, db); in parse_operator_name()
3057 if (t == first + 2 || nempty(db)) in parse_operator_name()
3058 return (first); 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()
3112 return (first); in parse_builtin_type()
3117 if (first[0] == type_tbl1[i].code) { in parse_builtin_type()
3119 return (first + 1); in parse_builtin_type()
3123 if (first[0] == 'D') { in parse_builtin_type()
3124 if (first + 1 == last) in parse_builtin_type()
3125 return (first); in parse_builtin_type()
3127 if (first[1] == type_tbl2[i].code) { in parse_builtin_type()
3129 return (first + 2); in parse_builtin_type()
3134 if (first[0] == 'u') { in parse_builtin_type()
3135 const char *t = parse_source_name(first + 1, last, db); in parse_builtin_type()
3136 if (t == first + 1) in parse_builtin_type()
3137 return (first); in parse_builtin_type()
3141 return (first); 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()
3180 return (first); in parse_substitution()
3182 if (first[0] != 'S') in parse_substitution()
3183 return (first); in parse_substitution()
3186 if (first[1] == sub_tbl[i].code) { in parse_substitution()
3188 return (first + 2); in parse_substitution()
3192 const char *t = first + 1; in parse_substitution()
3196 t = parse_base36(first + 1, last, &n); in parse_substitution()
3197 if (t == first + 1 || t[0] != '_') in parse_substitution()
3198 return (first); in parse_substitution()
3209 return (first); 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()
3225 return (first); in parse_source_name()
3230 for (t = first; t != last && ISDIGIT(t[0]); t++) { in parse_source_name()
3234 return (first); in parse_source_name()
3238 return (first); in parse_source_name()
3245 return (first); 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()
3269 return (first); in parse_vector_type()
3271 VERIFY3U(first[0], ==, 'D'); in parse_vector_type()
3272 VERIFY3U(first[1], ==, 'v'); in parse_vector_type()
3274 const char *t = first + 2; in parse_vector_type()
3277 if (ISDIGIT(first[2]) && first[2] != '0') { in parse_vector_type()
3280 return (first); in parse_vector_type()
3290 return (first); in parse_vector_type()
3299 if (first[2] != '_') { 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()
3302 return (first); in parse_vector_type()
3312 return (first); 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()
3330 return (first); in parse_decltype()
3332 VERIFY3U(first[0], ==, 'D'); in parse_decltype()
3334 if (first[1] != 't' && first[1] != 'T') in parse_decltype()
3335 return (first); 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()
3340 return (first); 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()
3356 VERIFY3U(first[0], ==, 'A'); in parse_array_type()
3358 if (last - first < 3) in parse_array_type()
3359 return (first); in parse_array_type()
3361 const char *t = first + 1; in parse_array_type()
3369 return (first); in parse_array_type()
3375 return (first); in parse_array_type()
3379 return (first); in parse_array_type()
3390 return (first); 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()
3411 return (first); in parse_pointer_to_member_type()
3413 VERIFY3U(first[0], ==, 'M'); in parse_pointer_to_member_type()
3415 const char *t1 = first + 1; in parse_pointer_to_member_type()
3421 return (first); in parse_pointer_to_member_type()
3426 return (first); in parse_pointer_to_member_type()
3429 return (first); 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()
3460 return (first); in parse_unresolved_name()
3462 const char *t = first; in parse_unresolved_name()
3472 return (first); in parse_unresolved_name()
3478 return (first); in parse_unresolved_name()
3486 return (first); in parse_unresolved_name()
3493 return (first); in parse_unresolved_name()
3499 return (first); in parse_unresolved_name()
3511 return (first); in parse_unresolved_name()
3521 return (first); in parse_unresolved_name()
3539 return (first); in parse_unresolved_name()
3547 return (first); in parse_unresolved_name()
3556 return (first); in parse_unresolved_name()
3566 return (first); 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()
3598 return (first); in parse_base_unresolved_name()
3603 if ((first[0] != 'o' && first[0] != 'd') || first[1] != 'n') { in parse_base_unresolved_name()
3604 t = parse_simple_id(first, last, db); in parse_base_unresolved_name()
3605 if (t != first) in parse_base_unresolved_name()
3608 t = parse_operator_name(first, last, db); in parse_base_unresolved_name()
3609 if (t == first) in parse_base_unresolved_name()
3610 return (first); in parse_base_unresolved_name()
3615 return (first); in parse_base_unresolved_name()
3622 if (first[0] == 'd') { in parse_base_unresolved_name()
3623 t = parse_destructor_name(first + 2, last, db); in parse_base_unresolved_name()
3624 return ((t != first + 2) ? t : first); in parse_base_unresolved_name()
3627 t = parse_operator_name(first + 2, last, db); in parse_base_unresolved_name()
3628 if (t == first + 2) in parse_base_unresolved_name()
3629 return (first); 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()
3647 return (first); in parse_destructor_name()
3649 const char *t = parse_unresolved_type(first, last, db); in parse_destructor_name()
3651 if (t == first) in parse_destructor_name()
3652 t = parse_simple_id(first, last, db); in parse_destructor_name()
3654 if (t == first) in parse_destructor_name()
3655 return (first); 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()
3673 return (first); in parse_function_type()
3675 VERIFY3U(first[0], ==, 'F'); in parse_function_type()
3677 const char *t = first + 1; in parse_function_type()
3685 return (first); in parse_function_type()
3713 return (first); in parse_function_type()
3719 return (first); 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()
3749 return (first); in parse_template_param()
3751 const char *t = first + 1; in parse_template_param()
3756 return (first); in parse_template_param()
3764 return (first); in parse_template_param()
3774 if (first[1] != '_') in parse_template_param()
3781 return (first); in parse_template_param()
3784 nadd_l(db, first, (size_t)(t - first)); 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()
3803 return (first); in parse_template_args()
3808 const char *t = first + 1; in parse_template_args()
3822 return (first); 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()
3867 return (first); in parse_discriminator()
3869 if (ISDIGIT(first[0])) { in parse_discriminator()
3870 for (t = first; t != last && ISDIGIT(t[0]); t++) in parse_discriminator()
3875 return (first); in parse_discriminator()
3878 } else if (first[0] != '_' || first + 1 == last) { in parse_discriminator()
3879 return (first); in parse_discriminator()
3882 t = first + 1; in parse_discriminator()
3887 return (first); in parse_discriminator()
3892 return (first); 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()
3904 return (first); in parse_cv_qualifiers()
3907 if (first[0] == 'r') { in parse_cv_qualifiers()
3909 first++; in parse_cv_qualifiers()
3911 if (first != last && first[0] == 'V') { in parse_cv_qualifiers()
3913 first++; in parse_cv_qualifiers()
3915 if (first != last && first[0] == 'K') { in parse_cv_qualifiers()
3917 first++; in parse_cv_qualifiers()
3920 return (first); in parse_cv_qualifiers()
3927 parse_number(const char *first, const char *last) in parse_number() argument
3929 VERIFY3P(first, <=, last); in parse_number()
3931 const char *t = first; in parse_number()
3933 if (first == last || (first[0] != 'n' && !ISDIGIT(first[0]))) in parse_number()
3934 return (first); in parse_number()