Home | History | Annotate | Download | only in Parse

Lines Matching refs:Tok

107   assert(Tok.is(tok::kw___attribute) && "Not a GNU attribute list!");
109 while (Tok.is(tok::kw___attribute)) {
111 if (ExpectAndConsume(tok::l_paren, diag::err_expected_lparen_after,
113 SkipUntil(tok::r_paren, true); // skip until ) or ;
116 if (ExpectAndConsume(tok::l_paren, diag::err_expected_lparen_after, "(")) {
117 SkipUntil(tok::r_paren, true); // skip until ) or ;
121 while (Tok.is(tok::identifier) || isDeclarationSpecifier() ||
122 Tok.is(tok::comma)) {
123 if (Tok.is(tok::comma)) {
129 IdentifierInfo *AttrName = Tok.getIdentifierInfo();
132 if (Tok.is(tok::l_paren)) {
144 ConsumeAndStoreUntil(tok::r_paren, LA->Toks, true, false);
148 Eof.setLocation(Tok.getLocation());
158 if (ExpectAndConsume(tok::r_paren, diag::err_expected_rparen))
159 SkipUntil(tok::r_paren, false);
160 SourceLocation Loc = Tok.getLocation();
161 if (ExpectAndConsume(tok::r_paren, diag::err_expected_rparen)) {
162 SkipUntil(tok::r_paren, false);
176 assert(Tok.is(tok::l_paren) && "Attribute arg list not starting with '('");
196 switch (Tok.getKind()) {
197 case tok::kw_char:
198 case tok::kw_wchar_t:
199 case tok::kw_char16_t:
200 case tok::kw_char32_t:
201 case tok::kw_bool:
202 case tok::kw_short:
203 case tok::kw_int:
204 case tok::kw_long:
205 case tok::kw___int64:
206 case tok::kw_signed:
207 case tok::kw_unsigned:
208 case tok::kw_float:
209 case tok::kw_double:
210 case tok::kw_void:
211 case tok::kw_typeof:
218 case tok::identifier:
219 ParmName = Tok.getIdentifierInfo();
230 (ParmLoc.isValid() ? Tok.is(tok::comma) : Tok.isNot(tok::r_paren))) {
239 SkipUntil(tok::r_paren);
243 if (Tok.isNot(tok::comma))
248 else if (Tok.is(tok::less) && AttrName->isStr("iboutletcollection")) {
249 if (!ExpectAndConsume(tok::less, diag::err_expected_less_after, "<",
250 tok::greater)) {
251 while (Tok.is(tok::identifier)) {
253 if (Tok.is(tok::greater))
255 if (Tok.is(tok::comma)) {
260 if (Tok.isNot(tok::greater))
261 Diag(Tok, diag::err_iboutletcollection_with_protocol);
262 SkipUntil(tok::r_paren, false, true); // skip until ')'
266 SourceLocation RParen = Tok.getLocation();
267 if (!ExpectAndConsume(tok::r_paren, diag::err_expected_rparen)) {
272 Diag(Tok, diag::err_iboutletcollection_builtintype);
287 assert(Tok.is(tok::kw___declspec) && "Not a declspec!");
290 if (ExpectAndConsume(tok::l_paren, diag::err_expected_lparen_after,
292 SkipUntil(tok::r_paren, true); // skip until ) or ;
296 while (Tok.getIdentifierInfo()) {
297 IdentifierInfo *AttrName = Tok.getIdentifierInfo();
304 SkipUntil(tok::r_paren);
306 if (Tok.is(tok::l_paren)) {
316 if (ExpectAndConsume(tok::r_paren, diag::err_expected_rparen))
317 SkipUntil(tok::r_paren, false);
323 if (ExpectAndConsume(tok::r_paren, diag::err_expected_rparen))
324 SkipUntil(tok::r_paren, false);
331 while (Tok.is(tok::kw___fastcall) || Tok.is(tok::kw___stdcall) ||
332 Tok.is(tok::kw___thiscall) || Tok.is(tok::kw___cdecl) ||
333 Tok.is(tok::kw___ptr64) || Tok.is(tok::kw___w64) ||
334 Tok.is(tok::kw___ptr32) ||
335 Tok.is(tok::kw___unaligned)) {
336 IdentifierInfo *AttrName = Tok.getIdentifierInfo();
338 if (Tok.is(tok::kw___ptr64) || Tok.is(tok::kw___w64) ||
339 Tok.is(tok::kw___ptr32))
349 while (Tok.is(tok::kw___pascal)) {
350 IdentifierInfo *AttrName = Tok.getIdentifierInfo();
359 while (Tok.is(tok::kw___kernel)) {
368 SourceLocation Loc = Tok.getLocation();
369 switch(Tok.getKind()) {
371 case tok::kw___private:
372 case tok::kw_private:
378 case tok::kw___global:
384 case tok::kw___local:
390 case tok::kw___constant:
396 case tok::kw___read_only:
402 case tok::kw___write_only:
408 case tok::kw___read_write:
424 Range = Tok.getLocation();
426 if (!Tok.is(tok::numeric_constant)) {
427 Diag(Tok, diag::err_expected_version);
428 SkipUntil(tok::comma, tok::r_paren, true, true, true);
437 Buffer.resize(Tok.getLength()+1);
442 unsigned ActualLength = PP.getSpelling(Tok, ThisTokBegin, &Invalid);
455 Diag(Tok, diag::err_expected_version);
456 SkipUntil(tok::comma, tok::r_paren, true, true, true);
465 Diag(Tok, diag::err_zero_version);
473 Diag(Tok, diag::err_expected_version);
474 SkipUntil(tok::comma, tok::r_paren, true, true, true);
491 Diag(Tok, diag::err_zero_version);
500 Diag(Tok, diag::err_expected_version);
501 SkipUntil(tok::comma, tok::r_paren, true, true, true);
514 Diag(Tok, diag::err_expected_version);
515 SkipUntil(tok::comma, tok::r_paren, true, true, true);
550 BalancedDelimiterTracker T(*this, tok::l_paren);
552 Diag(Tok, diag::err_expected_lparen);
557 if (Tok.isNot(tok::identifier)) {
558 Diag(Tok, diag::err_availability_expected_platform);
559 SkipUntil(tok::r_paren);
562 Platform = Tok.getIdentifierInfo();
566 if (ExpectAndConsume(tok::comma, diag::err_expected_comma, "", tok::r_paren))
581 if (Tok.isNot(tok::identifier)) {
582 Diag(Tok, diag::err_availability_expected_change);
583 SkipUntil(tok::r_paren);
586 IdentifierInfo *Keyword = Tok.getIdentifierInfo();
596 if (Tok.isNot(tok::comma))
603 if (Tok.isNot(tok::equal)) {
604 Diag(Tok, diag::err_expected_equal_after)
606 SkipUntil(tok::r_paren);
615 SkipUntil(tok::r_paren);
645 if (Tok.isNot(tok::comma))
731 SourceLocation OrigLoc = Tok.getLocation();
735 LA.Toks.push_back(Tok);
770 if (Tok.getLocation() != OrigLoc) {
775 if (PP.getSourceManager().isBeforeInTranslationUnit(Tok.getLocation(),
777 while (Tok.getLocation() != OrigLoc && Tok.isNot(tok::eof))
823 assert(Tok.is(tok::l_paren) && "Attribute arg list not starting with '('");
825 BalancedDelimiterTracker T(*this, tok::l_paren);
841 if (Tok.isNot(tok::comma))
886 switch (Tok.getKind()) {
887 case tok::kw_template:
888 case tok::kw_export:
892 case tok::kw_inline:
894 if (getLang().CPlusPlus && NextToken().is(tok::kw_namespace)) {
902 case tok::kw_namespace:
906 case tok::kw_using:
910 case tok::kw_static_assert:
911 case tok::kw__Static_assert:
957 if (Tok.is(tok::semi)) {
983 SkipUntil(tok::r_brace, true, true);
984 if (Tok.is(tok::semi))
998 Diag(Tok, diag::err_function_declared_typedef);
1015 Diag(Tok, diag::err_expected_fn_body);
1016 SkipUntil(tok::semi);
1027 if (FRI && Tok.is(tok::colon)) {
1029 if (Tok.is(tok::l_brace))
1047 while (Tok.is(tok::comma)) {
1072 *DeclEnd = Tok.getLocation();
1075 ExpectAndConsume(tok::semi,
1083 SkipUntil(tok::r_brace, true, true);
1084 if (Tok.is(tok::semi))
1098 if (Tok.is(tok::kw_asm)) {
1102 SkipUntil(tok::semi, true, true);
1169 SkipUntil(tok::semi, true, true);
1185 if (Tok.is(tok::kw_delete)) {
1191 } else if (Tok.is(tok::kw_default)) {
1193 Diag(Tok, diag::err_default_delete_in_multiple_declaration)
1203 if (Tok.is(tok::code_completion)) {
1217 SkipUntil(tok::comma, true, true);
1223 } else if (Tok.is(tok::l_paren)) {
1225 BalancedDelimiterTracker T(*this, tok::l_paren);
1237 SkipUntil(tok::r_paren);
1260 } else if (getLang().CPlusPlus0x && Tok.is(tok::l_brace)) {
1262 Diag(Tok, diag::warn_cxx98_compat_generalized_initializer_lists);
1307 Diag(Tok, diag::err_typename_requires_specqual);
1349 return T.is(tok::l_square) || T.is(tok::l_paren) || T.is(tok::r_paren) ||
1350 T.is(tok::semi) || T.is(tok::comma) || T.is(tok::equal) ||
1351 T.is(tok::kw_asm) || T.is(tok::l_brace) || T.is(tok::colon);
1367 assert(Tok.is(tok::identifier) && "should have identifier");
1369 SourceLocation Loc = Tok.getLocation();
1401 tok::TokenKind TagKind = tok::unknown;
1403 switch (Actions.isTagName(*Tok.getIdentifierInfo(), getCurScope())) {
1406 TagName="enum" ; FixitTagName = "enum " ; TagKind=tok::kw_enum ;break;
1408 TagName="union" ; FixitTagName = "union " ;TagKind=tok::kw_union ;break;
1410 TagName="struct"; FixitTagName = "struct ";TagKind=tok::kw_struct;break;
1412 TagName="class" ; FixitTagName = "class " ;TagKind=tok::kw_class ;break;
1417 << Tok.getIdentifierInfo() << TagName << getLang().CPlusPlus
1418 << FixItHint::CreateInsertion(Tok.getLocation(),FixitTagName);
1421 if (TagKind == tok::kw_enum)
1432 if (Actions.DiagnoseUnknownTypeName(*Tok.getIdentifierInfo(), Loc,
1442 DS.SetRangeEnd(Tok.getLocation());
1454 Diag(Loc, diag::err_unknown_typename) << Tok.getIdentifierInfo() << R;
1461 DS.SetRangeEnd(Tok.getLocation());
1495 SourceLocation TypeLoc = Tok.getLocation();
1497 SourceRange TypeRange(Start, Tok.getLocation());
1514 assert((Tok.is(tok::kw_alignas) || Tok.is(tok::kw__Alignas)) &&
1517 SourceLocation KWLoc = Tok.getLocation();
1520 BalancedDelimiterTracker T(*this, tok::l_paren);
1526 SkipUntil(tok::r_paren);
1571 DS.SetRangeStart(Tok.getLocation());
1572 DS.SetRangeEnd(Tok.getLocation());
1580 SourceLocation Loc = Tok.getLocation();
1582 switch (Tok.getKind()) {
1593 case tok::code_completion: {
1626 case tok::coloncolon: // ::foo::bar
1633 if (Tok.is(tok::coloncolon)) // ::new or ::delete
1637 case tok::annot_cxxscope: {
1642 Actions.RestoreNestedNameSpecifierAnnotation(Tok.getAnnotationValue(),
1643 Tok.getAnnotationRange(),
1648 if (Next.is(tok::annot_template_id) &&
1696 assert(Tok.is(tok::annot_template_id) &&
1702 if (Next.is(tok::annot_typename)) {
1705 if (Tok.getAnnotationValue()) {
1706 ParsedType T = getTypeAnnotation(Tok);
1708 Tok.getAnnotationEndLoc(),
1713 DS.SetRangeEnd(Tok.getAnnotationEndLoc());
1717 if (Next.isNot(tok::identifier))
1763 DS.SetRangeEnd(Tok.getLocation());
1769 case tok::annot_typename: {
1770 if (Tok.getAnnotationValue()) {
1771 ParsedType T = getTypeAnnotation(Tok);
1780 DS.SetRangeEnd(Tok.getAnnotationEndLoc());
1786 if (Tok.is(tok::less) && getLang().ObjC1)
1792 case tok::kw___is_signed:
1803 Tok.getIdentifierInfo()->RevertTokenIDToIdentifier();
1804 Tok.setKind(tok::identifier);
1811 case tok::identifier: {
1820 if (!Tok.is(tok::identifier))
1836 Actions.getTypeName(*Tok.getIdentifierInfo(),
1837 Tok.getLocation(), getCurScope());
1849 Actions.isCurrentClassName(*Tok.getIdentifierInfo(), getCurScope()) &&
1858 DS.SetRangeEnd(Tok.getLocation());
1864 if (Tok.is(tok::less) && getLang().ObjC1)
1873 case tok::annot_template_id: {
1874 TemplateIdAnnotation *TemplateId = takeTemplateIdAnnotation(Tok);
1896 case tok::kw___attribute:
1901 case tok::kw___declspec:
1906 case tok::kw___forceinline:
1910 case tok::kw___ptr64:
1911 case tok::kw___ptr32:
1912 case tok::kw___w64:
1913 case tok::kw___cdecl:
1914 case tok::kw___stdcall:
1915 case tok::kw___fastcall:
1916 case tok::kw___thiscall:
1917 case tok::kw___unaligned:
1922 case tok::kw___pascal:
1927 case tok::kw___kernel:
1932 case tok::kw_typedef:
1936 case tok::kw_extern:
1938 Diag(Tok, diag::ext_thread_before) << "extern";
1942 case tok::kw___private_extern__:
1946 case tok::kw_static:
1948 Diag(Tok, diag::ext_thread_before) << "static";
1952 case tok::kw_auto:
1958 Diag(Tok, diag::ext_auto_storage_class)
1967 case tok::kw_register:
1971 case tok::kw_mutable:
1975 case tok::kw___thread:
1980 case tok::kw_inline:
1983 case tok::kw_virtual:
1986 case tok::kw_explicit:
1991 case tok::kw__Alignas:
1993 Diag(Tok, diag::ext_c1x_alignas);
1998 case tok::kw_friend:
2009 case tok::kw___module_private__:
2014 case tok::kw_constexpr:
2019 case tok::kw_short:
2023 case tok::kw_long:
2031 case tok::kw___int64:
2035 case tok::kw_signed:
2039 case tok::kw_unsigned:
2043 case tok::kw__Complex:
2047 case tok::kw__Imaginary:
2051 case tok::kw_void:
2055 case tok::kw_char:
2059 case tok::kw_int:
2063 case tok::kw_half:
2067 case tok::kw_float:
2071 case tok::kw_double:
2075 case tok::kw_wchar_t:
2079 case tok::kw_char16_t:
2083 case tok::kw_char32_t:
2087 case tok::kw_bool:
2088 case tok::kw__Bool:
2089 if (Tok.is(tok::kw_bool) &&
2095 Tok.setKind(tok::identifier);
2102 case tok::kw__Decimal32:
2106 case tok::kw__Decimal64:
2110 case tok::kw__Decimal128:
2114 case tok::kw___vector:
2117 case tok::kw___pixel:
2120 case tok::kw___unknown_anytype:
2126 case tok::kw_class:
2127 case tok::kw_struct:
2128 case tok::kw_union: {
2129 tok::TokenKind Kind = Tok.getKind();
2136 case tok::kw_enum:
2142 case tok::kw_const:
2146 case tok::kw_volatile:
2150 case tok::kw_restrict:
2156 case tok::kw_typename:
2161 if (!Tok.is(tok::kw_typename))
2166 case tok::kw_typeof:
2170 case tok::kw_decltype:
2174 case tok::kw___underlying_type:
2178 case tok::kw__Atomic:
2183 case tok::kw_private:
2186 case tok::kw___private:
2187 case tok::kw___global:
2188 case tok::kw___local:
2189 case tok::kw___constant:
2190 case tok::kw___read_only:
2191 case tok::kw___write_only:
2192 case tok::kw___read_write:
2196 case tok::less:
2218 Diag(Tok, DiagID)
2219 << PrevSpec << FixItHint::CreateRemoval(Tok.getLocation());
2221 Diag(Tok, DiagID) << PrevSpec;
2224 DS.SetRangeEnd(Tok.getLocation());
2279 SourceLocation Loc = Tok.getLocation();
2281 switch (Tok.getKind()) {
2282 case tok::identifier: // foo::bar
2292 case tok::kw_typename: // typename foo::bar
2298 if (Tok.is(tok::identifier))
2302 case tok::coloncolon: // ::foo::bar
2303 if (NextToken().is(tok::kw_new) || // ::new
2304 NextToken().is(tok::kw_delete)) // ::delete
2316 case tok::annot_typename: {
2317 if (ParsedType T = getTypeAnnotation(Tok)) {
2319 Tok.getAnnotationEndLoc(), PrevSpec,
2323 DS.SetRangeEnd(Tok.getAnnotationEndLoc());
2330 if (Tok.is(tok::less) && getLang().ObjC1)
2336 case tok::kw_short:
2339 case tok::kw_long:
2347 case tok::kw___int64:
2351 case tok::kw_signed:
2354 case tok::kw_unsigned:
2358 case tok::kw__Complex:
2362 case tok::kw__Imaginary:
2366 case tok::kw_void:
2369 case tok::kw_char:
2372 case tok::kw_int:
2375 case tok::kw_half:
2378 case tok::kw_float:
2381 case tok::kw_double:
2384 case tok::kw_wchar_t:
2387 case tok::kw_char16_t:
2390 case tok::kw_char32_t:
2393 case tok::kw_bool:
2394 case tok::kw__Bool:
2397 case tok::kw__Decimal32:
2401 case tok::kw__Decimal64:
2405 case tok::kw__Decimal128:
2409 case tok::kw___vector:
2412 case tok::kw___pixel:
2417 case tok::kw_class:
2418 case tok::kw_struct:
2419 case tok::kw_union: {
2420 tok::TokenKind Kind = Tok.getKind();
2428 case tok::kw_enum:
2434 case tok::kw_const:
2438 case tok::kw_volatile:
2442 case tok::kw_restrict:
2448 case tok::kw_typeof:
2453 case tok::kw_decltype:
2458 case tok::kw___underlying_type:
2462 case tok::kw__Atomic:
2467 case tok::kw_private:
2470 case tok::kw___private:
2471 case tok::kw___global:
2472 case tok::kw___local:
2473 case tok::kw___constant:
2474 case tok::kw___read_only:
2475 case tok::kw___write_only:
2476 case tok::kw___read_write:
2481 case tok::kw_auto:
2492 case tok::kw___ptr64:
2493 case tok::kw___ptr32:
2494 case tok::kw___w64:
2495 case tok::kw___cdecl:
2496 case tok::kw___stdcall:
2497 case tok::kw___fastcall:
2498 case tok::kw___thiscall:
2499 case tok::kw___unaligned:
2503 case tok::kw___pascal:
2516 Diag(Tok, DiagID) << PrevSpec;
2518 DS.SetRangeEnd(Tok.getLocation());
2543 if (Tok.is(tok::kw___extension__)) {
2555 if (Tok.is(tok::semi)) {
2572 if (Tok.isNot(tok::colon)) {
2578 if (Tok.is(tok::colon)) {
2582 SkipUntil(tok::semi, true, true);
2596 if (Tok.isNot(tok::comma))
2621 BalancedDelimiterTracker T(*this, tok::l_brace);
2630 if (Tok.is(tok::r_brace) && !getLang().CPlusPlus)
2631 Diag(Tok, diag::ext_empty_struct_union)
2637 while (Tok.isNot(tok::r_brace) && Tok.isNot(tok::eof)) {
2641 if (Tok.is(tok::semi)) {
2642 Diag(Tok, diag::ext_extra_struct_semi)
2644 << FixItHint::CreateRemoval(Tok.getLocation());
2652 if (!Tok.is(tok::at)) {
2675 if (!Tok.isObjCAtKeyword(tok::objc_defs)) {
2676 Diag(Tok, diag::err_unexpected_at);
2677 SkipUntil(tok::semi, true);
2681 ExpectAndConsume(tok::l_paren, diag::err_expected_lparen);
2682 if (!Tok.is(tok::identifier)) {
2683 Diag(Tok, diag::err_expected_ident);
2684 SkipUntil(tok::semi, true);
2688 Actions.ActOnDefs(getCurScope(), TagDecl, Tok.getLocation(),
2689 Tok.getIdentifierInfo(), Fields);
2692 ExpectAndConsume(tok::r_paren, diag::err_expected_rparen);
2695 if (Tok.is(tok::semi)) {
2697 } else if (Tok.is(tok::r_brace)) {
2698 ExpectAndConsume(tok::semi, diag::ext_expected_semi_decl_list);
2701 ExpectAndConsume(tok::semi, diag::err_expected_semi_decl_list);
2703 SkipUntil(tok::r_brace, true, true);
2705 if (Tok.is(tok::semi)) ConsumeToken();
2755 if (Tok.is(tok::code_completion)) {
2765 (Tok.is(tok::kw_class) || Tok.is(tok::kw_struct))) {
2766 Diag(Tok, diag::warn_cxx98_compat_scoped_enum);
2768 IsScopedUsingClassTag = Tok.is(tok::kw_class);
2788 if (SS.isSet() && Tok.isNot(tok::identifier)) {
2789 Diag(Tok, diag::err_expected_ident);
2790 if (Tok.isNot(tok::l_brace)) {
2793 SkipUntil(tok::comma, true);
2800 if (Tok.isNot(tok::identifier) && Tok.isNot(tok::l_brace) &&
2801 (AllowFixedUnderlyingType && Tok.isNot(tok::colon))) {
2802 Diag(Tok, diag::err_expected_ident_lbrace);
2805 SkipUntil(tok::comma, true);
2812 if (Tok.is(tok::identifier)) {
2813 Name = Tok.getIdentifierInfo();
2820 Diag(Tok, diag::err_scoped_enum_missing_identifier);
2828 if (AllowFixedUnderlyingType && Tok.is(tok::colon)) {
2848 GetLookAheadToken(2).getKind() == tok::semi) {
2897 if (Tok.is(tok::l_brace))
2899 else if (Tok.is(tok::semi))
2908 Diag(Tok, diag::err_enum_template);
2911 SkipUntil(tok::comma, true);
2916 Diag(Tok, diag::err_enumerator_unnamed_no_def);
2919 SkipUntil(tok::comma, true);
2939 Diag(Tok, diag::err_expected_type_name_after_typename);
2962 if (Tok.is(tok::l_brace)) {
2964 SkipUntil(tok::r_brace);
2971 if (Tok.is(tok::l_brace))
2995 BalancedDelimiterTracker T(*this, tok::l_brace);
2999 if (Tok.is(tok::r_brace) && !getLang().CPlusPlus)
3000 Diag(Tok, diag::error_empty_enum);
3007 while (Tok.is(tok::identifier)) {
3008 IdentifierInfo *Ident = Tok.getIdentifierInfo();
3017 if (Tok.is(tok::equal)) {
3021 SkipUntil(tok::comma, tok::r_brace, true, true);
3033 if (Tok.is(tok::identifier)) {
3041 if (Tok.isNot(tok::comma))
3045 if (Tok.isNot(tok::identifier)) {
3076 switch (Tok.getKind()) {
3080 case tok::kw_private:
3084 case tok::kw_const:
3085 case tok::kw_volatile:
3086 case tok::kw_restrict:
3087 case tok::kw___private:
3088 case tok::kw___local:
3089 case tok::kw___global:
3090 case tok::kw___constant:
3091 case tok::kw___read_only:
3092 case tok::kw___read_write:
3093 case tok::kw___write_only:
3101 bool Parser::isKnownToBeTypeSpecifier(const Token &Tok) const {
3102 switch (Tok.getKind()) {
3105 case tok::kw_short:
3106 case tok::kw_long:
3107 case tok::kw___int64:
3108 case tok::kw_signed:
3109 case tok::kw_unsigned:
3110 case tok::kw__Complex:
3111 case tok::kw__Imaginary:
3112 case tok::kw_void:
3113 case tok::kw_char:
3114 case tok::kw_wchar_t:
3115 case tok::kw_char16_t:
3116 case tok::kw_char32_t:
3117 case tok::kw_int:
3118 case tok::kw_half:
3119 case tok::kw_float:
3120 case tok::kw_double:
3121 case tok::kw_bool:
3122 case tok::kw__Bool:
3123 case tok::kw__Decimal32:
3124 case tok::kw__Decimal64:
3125 case tok::kw__Decimal128:
3126 case tok::kw___vector:
3129 case tok::kw_class:
3130 case tok::kw_struct:
3131 case tok::kw_union:
3133 case tok::kw_enum:
3136 case tok::annot_typename:
3144 switch (Tok.getKind()) {
3147 case tok::identifier: // foo::bar
3151 case tok::kw_typename: // typename T::type
3156 if (Tok.is(tok::identifier))
3160 case tok::coloncolon: // ::foo::bar
3161 if (NextToken().is(tok::kw_new) || // ::new
3162 NextToken().is(tok::kw_delete)) // ::delete
3170 case tok::kw___attribute:
3172 case tok::kw_typeof:
3175 case tok::kw_short:
3176 case tok::kw_long:
3177 case tok::kw___int64:
3178 case tok::kw_signed:
3179 case tok::kw_unsigned:
3180 case tok::kw__Complex:
3181 case tok::kw__Imaginary:
3182 case tok::kw_void:
3183 case tok::kw_char:
3184 case tok::kw_wchar_t:
3185 case tok::kw_char16_t:
3186 case tok::kw_char32_t:
3187 case tok::kw_int:
3188 case tok::kw_half:
3189 case tok::kw_float:
3190 case tok::kw_double:
3191 case tok::kw_bool:
3192 case tok::kw__Bool:
3193 case tok::kw__Decimal32:
3194 case tok::kw__Decimal64:
3195 case tok::kw__Decimal128:
3196 case tok::kw___vector:
3199 case tok::kw_class:
3200 case tok::kw_struct:
3201 case tok::kw_union:
3203 case tok::kw_enum:
3206 case tok::kw_const:
3207 case tok::kw_volatile:
3208 case tok::kw_restrict:
3211 case tok::annot_typename:
3215 case tok::less:
3218 case tok::kw___cdecl:
3219 case tok::kw___stdcall:
3220 case tok::kw___fastcall:
3221 case tok::kw___thiscall:
3222 case tok::kw___w64:
3223 case tok::kw___ptr64:
3224 case tok::kw___ptr32:
3225 case tok::kw___pascal:
3226 case tok::kw___unaligned:
3228 case tok::kw___private:
3229 case tok::kw___local:
3230 case tok::kw___global:
3231 case tok::kw___constant:
3232 case tok::kw___read_only:
3233 case tok::kw___read_write:
3234 case tok::kw___write_only:
3238 case tok::kw_private:
3242 case tok::kw__Atomic:
3253 switch (Tok.getKind()) {
3256 case tok::kw_private:
3259 case tok::identifier: // foo::bar
3261 if (getLang().ObjC1 && NextToken().is(tok::period))
3266 case tok::kw_typename: // typename T::type
3271 if (Tok.is(tok::identifier))
3285 case tok::coloncolon: // ::foo::bar
3286 if (NextToken().is(tok::kw_new) || // ::new
3287 NextToken().is(tok::kw_delete)) // ::delete
3297 case tok::kw_typedef:
3298 case tok::kw_extern:
3299 case tok::kw___private_extern__:
3300 case tok::kw_static:
3301 case tok::kw_auto:
3302 case tok::kw_register:
3303 case tok::kw___thread:
3306 case tok::kw___module_private__:
3309 case tok::kw_short:
3310 case tok::kw_long:
3311 case tok::kw___int64:
3312 case tok::kw_signed:
3313 case tok::kw_unsigned:
3314 case tok::kw__Complex:
3315 case tok::kw__Imaginary:
3316 case tok::kw_void:
3317 case tok::kw_char:
3318 case tok::kw_wchar_t:
3319 case tok::kw_char16_t:
3320 case tok::kw_char32_t:
3322 case tok::kw_int:
3323 case tok::kw_half:
3324 case tok::kw_float:
3325 case tok::kw_double:
3326 case tok::kw_bool:
3327 case tok::kw__Bool:
3328 case tok::kw__Decimal32:
3329 case tok::kw__Decimal64:
3330 case tok::kw__Decimal128:
3331 case tok::kw___vector:
3334 case tok::kw_class:
3335 case tok::kw_struct:
3336 case tok::kw_union:
3338 case tok::kw_enum:
3341 case tok::kw_const:
3342 case tok::kw_volatile:
3343 case tok::kw_restrict:
3346 case tok::kw_inline:
3347 case tok::kw_virtual:
3348 case tok::kw_explicit:
3351 case tok::kw__Static_assert:
3354 case tok::kw_typeof:
3357 case tok::kw___attribute:
3361 case tok::kw_decltype:
3365 case tok::kw__Atomic:
3369 case tok::less:
3373 case tok::annot_typename:
3377 case tok::kw___declspec:
3378 case tok::kw___cdecl:
3379 case tok::kw___stdcall:
3380 case tok::kw___fastcall:
3381 case tok::kw___thiscall:
3382 case tok::kw___w64:
3383 case tok::kw___ptr64:
3384 case tok::kw___ptr32:
3385 case tok::kw___forceinline:
3386 case tok::kw___pascal:
3387 case tok::kw___unaligned:
3389 case tok::kw___private:
3390 case tok::kw___local:
3391 case tok::kw___global:
3392 case tok::kw___constant:
3393 case tok::kw___read_only:
3394 case tok::kw___read_write:
3395 case tok::kw___write_only:
3412 if (Tok.is(tok::identifier) || Tok.is(tok::annot_template_id)) {
3422 if (Tok.isNot(tok::l_paren)) {
3429 if (Tok.is(tok::r_paren) || Tok.is(tok::ellipsis)) {
3467 SourceLocation Loc = Tok.getLocation();
3482 SourceLocation Loc = Tok.getLocation();
3484 switch (Tok.getKind()) {
3485 case tok::code_completion:
3489 case tok::kw_const:
3493 case tok::kw_volatile:
3497 case tok::kw_restrict:
3503 case tok::kw_private:
3506 case tok::kw___private:
3507 case tok::kw___global:
3508 case tok::kw___local:
3509 case tok::kw___constant:
3510 case tok::kw___read_only:
3511 case tok::kw___write_only:
3512 case tok::kw___read_write:
3516 case tok::kw___w64:
3517 case tok::kw___ptr64:
3518 case tok::kw___ptr32:
3519 case tok::kw___cdecl:
3520 case tok::kw___stdcall:
3521 case tok::kw___fastcall:
3522 case tok::kw___thiscall:
3523 case tok::kw___unaligned:
3529 case tok::kw___pascal:
3535 case tok::kw___attribute:
3554 Diag(Tok, DiagID) << PrevSpec;
3599 (Tok.is(tok::coloncolon) || Tok.is(tok::identifier) ||
3600 Tok.is(tok::annot_cxxscope))) {
3605 if (Tok.isNot(tok::star)) {
3632 tok::TokenKind Kind = Tok.getKind();
3634 if (Kind != tok::star && Kind != tok::caret &&
3635 (Kind != tok::amp || !getLang().CPlusPlus) &&
3637 (Kind != tok::ampamp || !getLang().CPlusPlus)) {
3648 if (Kind == tok::star || Kind == tok::caret) {
3657 if (Kind == tok::star)
3677 if (Kind == tok::ampamp)
3723 Kind == tok::amp),
3785 if (Tok.is(tok::ellipsis) &&
3788 NextToken().is(tok::r_paren) &&
3792 if (Tok.is(tok::identifier) || Tok.is(tok::kw_operator) ||
3793 Tok.is(tok::annot_template_id) || Tok.is(tok::tilde)) {
3816 D.SetIdentifier(0, Tok.getLocation());
3826 } else if (Tok.is(tok::identifier) && D.mayHaveIdentifier()) {
3828 "There's a C++-specific check for tok::identifier above");
3829 assert(Tok.getIdentifierInfo() && "Not an identifier?");
3830 D.SetIdentifier(Tok.getIdentifierInfo(), Tok.getLocation());
3835 if (Tok.is(tok::l_paren)) {
3856 D.SetIdentifier(0, Tok.getLocation());
3859 Diag(Tok, diag::err_expected_member_name_or_semi)
3862 Diag(Tok, diag::err_expected_unqualified_id) << getLang().CPlusPlus;
3864 Diag(Tok, diag::err_expected_ident_lparen);
3865 D.SetIdentifier(0, Tok.getLocation());
3878 if (Tok.is(tok::l_paren)) {
3890 BalancedDelimiterTracker T(*this, tok::l_paren);
3893 } else if (Tok.is(tok::l_square)) {
3915 BalancedDelimiterTracker T(*this, tok::l_paren);
3932 if (Tok.is(tok::kw___attribute)) {
3940 if (Tok.is(tok::kw___cdecl) || Tok.is(tok::kw___stdcall) ||
3941 Tok.is(tok::kw___thiscall) || Tok.is(tok::kw___fastcall) ||
3942 Tok.is(tok::kw___w64) || Tok.is(tok::kw___ptr64) ||
3943 Tok.is(tok::kw___ptr32) || Tok.is(tok::kw___unaligned)) {
3947 if (Tok.is(tok::kw___pascal))
3960 } else if (Tok.is(tok::r_paren) || // 'int()' is a function.
3961 (getLang().CPlusPlus && Tok.is(tok::ellipsis)) || // C++ int(...)
3993 D.SetIdentifier(0, Tok.getLocation());
4046 Diag(Tok, diag::err_argument_required_after_attribute);
4058 if (Tok.isNot(tok::r_paren))
4061 Diag(Tok, diag::err_argument_required_after_attribute);
4081 if (Tok.is(tok::amp) || Tok.is(tok::ampamp)) {
4082 Diag(Tok, getLang().CPlusPlus0x ?
4086 RefQualifierIsLValueRef = Tok.is(tok::amp);
4100 if (getLang().CPlusPlus0x && Tok.is(tok::arrow)) {
4101 Diag(Tok, diag::warn_cxx98_compat_trailing_return_type);
4142 && Tok.is(tok::identifier)
4146 && (TryAnnotateTypeOrScopeToken() || !Tok.is(tok::annot_typename))
4159 && (NextToken().is(tok::comma) || NextToken().is(tok::r_paren));
4179 Diag(Tok, diag::ext_ident_list_in_param);
4186 if (Tok.isNot(tok::identifier)) {
4187 Diag(Tok, diag::err_expected_ident);
4188 SkipUntil(tok::r_paren, /*StopAtSemi=*/true, /*DontConsume=*/true);
4194 IdentifierInfo *ParmII = Tok.getIdentifierInfo();
4197 if (Actions.getTypeName(*ParmII, Tok.getLocation(), getCurScope()))
4198 Diag(Tok, diag::err_unexpected_typedef_ident) << ParmII;
4202 Diag(Tok, diag::err_param_redefinition) << ParmII;
4206 Tok.getLocation(),
4214 if (Tok.isNot(tok::comma))
4256 if (Tok.is(tok::ellipsis)) {
4266 if (getLang().MicrosoftExt && Tok.is(tok::l_square))
4269 SourceLocation DSStart = Tok.getLocation();
4315 if (Tok.is(tok::equal)) {
4316 SourceLocation EqualLoc = Tok.getLocation();
4327 if (!ConsumeAndStoreUntil(tok::comma, tok::r_paren, *DefArgToks,
4338 DefArgEnd.setKind(tok::cxx_defaultarg_end);
4339 DefArgEnd.setLocation(Tok.getLocation());
4356 SkipUntil(tok::comma, tok::r_paren, true, true);
4371 if (Tok.isNot(tok::comma)) {
4372 if (Tok.is(tok::ellipsis)) {
4398 BalancedDelimiterTracker T(*this, tok::l_square);
4403 if (Tok.getKind() == tok::r_square) {
4415 } else if (Tok.getKind() == tok::numeric_constant &&
4416 GetLookAheadToken(1).is(tok::r_square)) {
4418 ExprResult ExprRes(Actions.ActOnNumericConstant(Tok));
4436 if (Tok.is(tok::kw_static))
4446 if (!StaticLoc.isValid() && Tok.is(tok::kw_static))
4457 if (Tok.is(tok::star) && GetLookAheadToken(1).is(tok::r_square)) {
4465 } else if (Tok.isNot(tok::r_square)) {
4483 SkipUntil(tok::r_square);
4507 assert(Tok.is(tok::kw_typeof) && "Not a typeof specifier");
4508 Token OpTok = Tok;
4511 const bool hasParens = Tok.is(tok::l_paren);
4523 DS.SetRangeEnd(Tok.getLocation());
4560 assert(Tok.is(tok::kw__Atomic) && "Not an atomic specifier");
4563 BalancedDelimiterTracker T(*this, tok::l_paren);
4565 SkipUntil(tok::r_paren);
4571 SkipUntil(tok::r_paren);
4598 case tok::kw_short:
4599 case tok::kw_long:
4600 case tok::kw_signed:
4601 case tok::kw_unsigned:
4602 case tok::kw_void:
4603 case tok::kw_char:
4604 case tok::kw_int:
4605 case tok::kw_float:
4606 case tok::kw_double:
4607 case tok::kw_bool:
4608 case tok::kw___pixel:
4609 Tok.setKind(tok::kw___vector);
4611 case tok::identifier:
4613 Tok.setKind(tok::kw___vector);
4623 if (Tok.getIdentifierInfo() == Ident_vector) {
4626 case tok::kw_short:
4627 case tok::kw_long:
4628 case tok::kw_signed:
4629 case tok::kw_unsigned:
4630 case tok::kw_void:
4631 case tok::kw_char:
4632 case tok::kw_int:
4633 case tok::kw_float:
4634 case tok::kw_double:
4635 case tok::kw_bool:
4636 case tok::kw___pixel:
4639 case tok::identifier:
4648 } else if ((Tok.getIdentifierInfo() == Ident_pixel) &&