• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/contrib/llvm-project/clang/lib/Parse/

Lines Matching refs:tok

52   case tok::kw_asm:
54 case tok::kw_namespace:
57 case tok::kw_using:
59 case tok::kw_static_assert:
60 case tok::kw__Static_assert:
156 case tok::kw__Atomic:
157 if (NextToken().isNot(tok::l_paren)) {
162 case tok::kw_typeof:
163 case tok::kw___attribute:
164 case tok::kw___underlying_type: {
166 if (Tok.isNot(tok::l_paren))
169 if (!SkipUntil(tok::r_paren))
174 case tok::kw_class:
175 case tok::kw_struct:
176 case tok::kw_union:
177 case tok::kw___interface:
178 case tok::kw_enum:
194 if (Tok.is(tok::annot_cxxscope))
196 if (Tok.is(tok::identifier))
198 else if (Tok.is(tok::annot_template_id))
204 case tok::annot_cxxscope:
210 if (getLangOpts().ObjC && Tok.is(tok::less))
233 if (Tok.isNot(tok::l_paren)) {
246 if (Tok.isNot(tok::semi) && (!AllowForRangeDecl || Tok.isNot(tok::colon)))
287 if (Tok.isOneOf(tok::kw_asm, tok::kw___attribute))
291 if (Tok.is(tok::l_paren)) {
294 if (!SkipUntil(tok::r_paren, StopAtSemi))
296 } else if (Tok.is(tok::l_brace)) {
300 } else if (Tok.is(tok::equal) || isTokIdentifier_in()) {
320 if (!TryConsumeToken(tok::comma))
358 P.SkipUntil({tok::r_paren, tok::semi, tok::question, tok::colon},
360 if (P.Tok.is(tok::question))
362 else if (P.Tok.is(tok::colon)) {
377 P.SkipUntil(tok::r_paren, tok::semi, StopBeforeMatch);
379 if (P.Tok.isNot(tok::r_paren))
381 if (P.Tok.isNot(tok::semi))
432 assert(Tok.is(tok::colon) && "should be looking at the ':'");
453 if (Tok.is(tok::l_brace) || (AllowSemi && Tok.is(tok::semi)))
495 assert(Tok.is(tok::l_paren) && "Expected '('");
505 if (Tok.isOneOf(tok::equal, tok::kw_asm, tok::kw___attribute) ||
506 (getLangOpts().CPlusPlus11 && Tok.is(tok::l_brace))) {
512 if (State.CanBeForRangeDecl && Tok.is(tok::colon))
526 if (Tok.is(tok::l_paren)) {
528 SkipUntil(tok::r_paren, StopAtSemi);
531 if (!TryConsumeToken(tok::comma))
536 if (State.CanBeCondition && Tok.is(tok::r_paren))
538 else if (State.CanBeInitStatement && Tok.is(tok::semi))
587 assert(Tok.is(tok::l_paren) && "Expected '('");
599 if (Context == TypeIdInParens && Tok.is(tok::r_paren)) {
608 (Tok.isOneOf(tok::greater, tok::comma) ||
610 (Tok.isOneOf(tok::greatergreater,
611 tok::greatergreatergreater) ||
612 (Tok.is(tok::ellipsis) &&
613 NextToken().isOneOf(tok::greater, tok::greatergreater,
614 tok::greatergreatergreater,
615 tok::comma)))))) {
663 if (Tok.is(tok::kw_alignas))
666 if (Tok.isNot(tok::l_square) || NextToken().isNot(tok::l_square))
674 if (GetLookAheadToken(2).is(tok::kw_using))
685 bool IsAttribute = SkipUntil(tok::r_square);
686 IsAttribute &= Tok.is(tok::r_square);
723 if (Tok.is(tok::r_square))
746 while (Tok.isNot(tok::r_square)) {
747 if (Tok.is(tok::comma)) {
762 if (Tok.is(tok::coloncolon)) {
771 if (Tok.is(tok::l_paren)) {
773 if (!SkipUntil(tok::r_paren)) {
779 TryConsumeToken(tok::ellipsis);
781 if (!TryConsumeToken(tok::comma))
787 if (Tok.is(tok::r_square)) {
789 IsAttribute = Tok.is(tok::r_square);
804 while (Tok.isOneOf(tok::l_square, tok::kw___attribute, tok::kw___declspec,
805 tok::kw_alignas)) {
806 if (Tok.is(tok::l_square)) {
808 if (Tok.isNot(tok::l_square))
811 if (!SkipUntil(tok::r_square) || Tok.isNot(tok::r_square))
818 if (Tok.isNot(tok::l_paren))
821 if (!SkipUntil(tok::r_paren))
834 if (Tok.isOneOf(tok::star, tok::amp, tok::caret, tok::ampamp) ||
835 (Tok.is(tok::annot_cxxscope) && NextToken().is(tok::star))) {
843 while (Tok.isOneOf(tok::kw_const, tok::kw_volatile, tok::kw_restrict,
844 tok::kw__Nonnull, tok::kw__Nullable,
845 tok::kw__Null_unspecified, tok::kw__Atomic))
872 assert(Tok.is(tok::kw_operator));
877 case tok::kw_new: case tok::kw_delete:
879 if (Tok.is(tok::l_square) && NextToken().is(tok::r_square)) {
886 case tok::Token:
892 case tok::l_square:
893 if (NextToken().is(tok::r_square)) {
900 case tok::l_paren:
901 if (NextToken().is(tok::r_paren)) {
921 if (Tok.is(tok::identifier))
1011 if (Tok.is(tok::ellipsis))
1014 if ((Tok.isOneOf(tok::identifier, tok::kw_operator) ||
1015 (Tok.is(tok::annot_cxxscope) && (NextToken().is(tok::identifier) ||
1016 NextToken().is(tok::kw_operator)))) &&
1019 if (Tok.is(tok::annot_cxxscope)) {
1026 } else if (Tok.is(tok::identifier)) {
1029 if (Tok.is(tok::kw_operator)) {
1034 } else if (Tok.is(tok::l_paren)) {
1037 (Tok.is(tok::r_paren) || // 'int()' is a function.
1039 (Tok.is(tok::ellipsis) && NextToken().is(tok::r_paren)) ||
1050 if (Tok.isOneOf(tok::kw___attribute, tok::kw___declspec, tok::kw___cdecl,
1051 tok::kw___stdcall, tok::kw___fastcall, tok::kw___thiscall,
1052 tok::kw___regcall, tok::kw___vectorcall))
1057 if (Tok.isNot(tok::r_paren))
1071 if (Tok.is(tok::l_paren)) {
1083 } else if (Tok.is(tok::l_square)) {
1087 } else if (Tok.is(tok::kw_requires)) {
1114 Next.isOneOf(tok::l_paren, tok::r_paren, tok::greater, tok::l_brace,
1115 tok::identifier, tok::comma);
1254 GetLookAheadToken(Lookahead + 1).isOneOf(tok::kw_auto, tok::kw_decltype,
1259 tok::identifier);
1262 case tok::identifier: {
1270 if (!getLangOpts().ObjC && Next.is(tok::identifier))
1273 if (Next.isNot(tok::coloncolon) && Next.isNot(tok::less)) {
1301 if (Tok.isNot(tok::identifier))
1313 assert(Tok.isNot(tok::identifier) &&
1325 if (Tok.is(tok::identifier))
1333 case tok::kw_typename: // typename T::type
1340 case tok::coloncolon: { // ::foo::bar
1342 if (Next.isOneOf(tok::kw_new, // ::new
1343 tok::kw_delete)) // ::delete
1347 case tok::kw___super:
1348 case tok::kw_decltype:
1362 case tok::kw_friend:
1363 case tok::kw_typedef:
1364 case tok::kw_constexpr:
1365 case tok::kw_consteval:
1366 case tok::kw_constinit:
1368 case tok::kw_register:
1369 case tok::kw_static:
1370 case tok::kw_extern:
1371 case tok::kw_mutable:
1372 case tok::kw_auto:
1373 case tok::kw___thread:
1374 case tok::kw_thread_local:
1375 case tok::kw__Thread_local:
1377 case tok::kw_inline:
1378 case tok::kw_virtual:
1379 case tok::kw_explicit:
1382 case tok::kw___module_private__:
1385 case tok::kw___unknown_anytype:
1397 case tok::kw_class:
1398 case tok::kw_struct:
1399 case tok::kw_union:
1400 case tok::kw___interface:
1402 case tok::kw_enum:
1404 case tok::kw_const:
1405 case tok::kw_volatile:
1409 case tok::kw_private:
1413 case tok::kw___private:
1414 case tok::kw___local:
1415 case tok::kw___global:
1416 case tok::kw___constant:
1417 case tok::kw___generic:
1419 case tok::kw___read_only:
1420 case tok::kw___write_only:
1421 case tok::kw___read_write:
1423 case tok::kw_pipe:
1426 case tok::kw_restrict:
1427 case tok::kw__Complex:
1428 case tok::kw___attribute:
1429 case tok::kw___auto_type:
1433 case tok::kw___declspec:
1434 case tok::kw___cdecl:
1435 case tok::kw___stdcall:
1436 case tok::kw___fastcall:
1437 case tok::kw___thiscall:
1438 case tok::kw___regcall:
1439 case tok::kw___vectorcall:
1440 case tok::kw___w64:
1441 case tok::kw___sptr:
1442 case tok::kw___uptr:
1443 case tok::kw___ptr64:
1444 case tok::kw___ptr32:
1445 case tok::kw___forceinline:
1446 case tok::kw___unaligned:
1447 case tok::kw__Nonnull:
1448 case tok::kw__Nullable:
1449 case tok::kw__Null_unspecified:
1450 case tok::kw___kindof:
1454 case tok::kw___pascal:
1458 case tok::kw___vector:
1461 case tok::annot_template_id: {
1472 *InvalidAsDeclSpec = NextToken().is(tok::l_paren);
1483 assert(Tok.is(tok::annot_typename));
1487 case tok::annot_cxxscope: // foo::bar or ::foo::bar, but already parsed
1491 if (!Tok.is(tok::annot_typename)) {
1492 if (Tok.is(tok::annot_cxxscope) &&
1493 NextToken().is(tok::annot_template_id)) {
1498 *InvalidAsDeclSpec = NextToken().is(tok::l_paren);
1508 if (Tok.is(tok::annot_cxxscope) && NextToken().is(tok::identifier)) {
1517 bool isIdentifier = Tok.is(tok::identifier);
1537 if (((Tok.is(tok::amp) || Tok.is(tok::star)) &&
1538 (NextToken().is(tok::r_paren) ||
1539 NextToken().is(tok::greater))) ||
1540 (Tok.is(tok::ampamp) && NextToken().is(tok::greater)))
1558 if (Tok.isNot(tok::identifier))
1575 assert(Tok.isNot(tok::annot_cxxscope) ||
1576 NextToken().isNot(tok::identifier));
1603 case tok::annot_typename:
1606 if (getLangOpts().ObjC && NextToken().is(tok::less)) {
1612 bool isFollowedByParen = Tok.is(tok::l_paren);
1613 bool isFollowedByBrace = Tok.is(tok::l_brace);
1628 case tok::kw_char:
1629 case tok::kw_wchar_t:
1630 case tok::kw_char8_t:
1631 case tok::kw_char16_t:
1632 case tok::kw_char32_t:
1633 case tok::kw_bool:
1634 case tok::kw_short:
1635 case tok::kw_int:
1636 case tok::kw_long:
1637 case tok::kw___int64:
1638 case tok::kw___int128:
1639 case tok::kw_signed:
1640 case tok::kw_unsigned:
1641 case tok::kw_half:
1642 case tok::kw_float:
1643 case tok::kw_double:
1644 case tok::kw___bf16:
1645 case tok::kw__Float16:
1646 case tok::kw___float128:
1647 case tok::kw_void:
1648 case tok::annot_decltype:
1649 #define GENERIC_IMAGE_TYPE(ImgType, Id) case tok::kw_##ImgType##_t:
1651 if (NextToken().is(tok::l_paren))
1660 if (getLangOpts().CPlusPlus11 && NextToken().is(tok::l_brace))
1669 case tok::kw_typeof: {
1670 if (NextToken().isNot(tok::l_paren))
1676 bool isFollowedByParen = Tok.is(tok::l_paren);
1677 bool isFollowedByBrace = Tok.is(tok::l_brace);
1692 case tok::kw___underlying_type:
1696 case tok::kw__Atomic:
1699 case tok::kw__ExtInt: {
1700 if (NextToken().isNot(tok::l_paren))
1706 if (!SkipUntil(tok::r_paren, StopAtSemi))
1709 if (Tok.is(tok::l_paren))
1712 if (getLangOpts().CPlusPlus11 && Tok.is(tok::l_brace))
1725 case tok::annot_decltype:
1726 case tok::annot_template_id:
1727 case tok::annot_typename:
1728 case tok::kw_typeof:
1729 case tok::kw___underlying_type:
1733 case tok::kw_class:
1734 case tok::kw_struct:
1735 case tok::kw_union:
1736 case tok::kw___interface:
1737 case tok::kw_enum:
1741 case tok::kw_char:
1742 case tok::kw_wchar_t:
1743 case tok::kw_char8_t:
1744 case tok::kw_char16_t:
1745 case tok::kw_char32_t:
1746 case tok::kw_bool:
1747 case tok::kw_short:
1748 case tok::kw_int:
1749 case tok::kw__ExtInt:
1750 case tok::kw_long:
1751 case tok::kw___int64:
1752 case tok::kw___int128:
1753 case tok::kw_signed:
1754 case tok::kw_unsigned:
1755 case tok::kw_half:
1756 case tok::kw_float:
1757 case tok::kw_double:
1758 case tok::kw___bf16:
1759 case tok::kw__Float16:
1760 case tok::kw___float128:
1761 case tok::kw_void:
1762 case tok::kw___unknown_anytype:
1763 case tok::kw___auto_type:
1764 #define GENERIC_IMAGE_TYPE(ImgType, Id) case tok::kw_##ImgType##_t:
1768 case tok::kw_auto:
1771 case tok::kw__Atomic:
1773 return NextToken().is(tok::l_paren);
1785 assert(Tok.is(tok::kw_typeof) && "Expected 'typeof'!");
1788 assert(Tok.is(tok::l_paren) && "Expected '('");
1791 if (!SkipUntil(tok::r_paren, StopAtSemi))
1800 assert(Tok.is(tok::less) && "Expected '<' for qualifier list");
1803 if (Tok.isNot(tok::identifier))
1807 if (Tok.is(tok::comma)) {
1812 if (Tok.is(tok::greater)) {
1848 if (Tok.isNot(tok::r_paren))
1852 if (Next.isOneOf(tok::amp, tok::ampamp, tok::kw_const, tok::kw_volatile,
1853 tok::kw_throw, tok::kw_noexcept, tok::l_square,
1854 tok::l_brace, tok::kw_try, tok::equal, tok::arrow) ||
1894 if (Tok.is(tok::r_paren))
1906 if (Tok.is(tok::ellipsis)) {
1908 if (Tok.is(tok::r_paren))
1940 if (SeenType && Tok.is(tok::identifier))
1960 if (Tok.is(tok::kw___attribute))
1973 return Tok.is(tok::equal) ? TPResult::True : TPResult::False;
1975 if (Tok.is(tok::equal)) {
1978 if (!SkipUntil(tok::comma, tok::r_paren, StopAtSemi | StopBeforeMatch))
1982 if (Tok.is(tok::ellipsis)) {
1984 if (Tok.is(tok::r_paren))
1990 if (!TryConsumeToken(tok::comma))
2013 if (TPR == TPResult::Ambiguous && Tok.isNot(tok::r_paren))
2020 if (!SkipUntil(tok::r_paren, StopAtSemi))
2024 while (Tok.isOneOf(tok::kw_const, tok::kw_volatile, tok::kw___unaligned,
2025 tok::kw_restrict))
2029 if (Tok.isOneOf(tok::amp, tok::ampamp))
2033 if (Tok.is(tok::kw_throw)) {
2035 if (Tok.isNot(tok::l_paren))
2040 if (!SkipUntil(tok::r_paren, StopAtSemi))
2043 if (Tok.is(tok::kw_noexcept)) {
2046 if (Tok.is(tok::l_paren)) {
2049 if (!SkipUntil(tok::r_paren, StopAtSemi))
2064 if (Tok.is(tok::l_brace))
2067 if (!SkipUntil(tok::r_square, tok::comma, StopAtSemi | StopBeforeMatch))
2072 if (Tok.isNot(tok::r_square))
2085 if (Tok.isNot(tok::less))
2087 if (NextToken().is(tok::greater))
2098 if (!TryConsumeToken(tok::less))
2124 if (SkipUntil({tok::greater, tok::greatergreater, tok::greatergreatergreater},
2133 assert(Tok.is(tok::l_paren) && "expected to be looking at a '(' token");
2143 while (Tok.is(tok::l_paren))
2152 if (Tok.is(tok::annot_cxxscope)) {
2161 if (Tok.is(tok::kw_operator))
2165 if (Tok.isNot(tok::identifier) && Tok.isNot(tok::annot_template_id))
2167 if (!Actions.isCurrentClassName(Tok.is(tok::identifier)
2176 if (!NextToken().is(tok::r_paren) &&