Lines Matching refs:tok
37 if (Tok.is(tok::code_completion)) {
44 switch (Tok.getObjCKeywordID()) {
45 case tok::objc_class:
47 case tok::objc_interface: {
52 case tok::objc_protocol: {
56 case tok::objc_implementation:
58 case tok::objc_end:
60 case tok::objc_compatibility_alias:
63 case tok::objc_synthesize:
66 case tok::objc_dynamic:
69 case tok::objc_import:
77 SkipUntil(tok::semi);
96 if (Tok.isNot(tok::identifier)) {
97 Diag(Tok, diag::err_expected_ident);
98 SkipUntil(tok::semi);
101 ClassNames.push_back(Tok.getIdentifierInfo());
102 ClassLocs.push_back(Tok.getLocation());
105 if (Tok.isNot(tok::comma))
112 if (ExpectAndConsume(tok::semi, diag::err_expected_semi_after, "@class"))
170 assert(Tok.isObjCAtKeyword(tok::objc_interface) &&
176 if (Tok.is(tok::code_completion)) {
182 if (Tok.isNot(tok::identifier)) {
183 Diag(Tok, diag::err_expected_ident); // missing class or category name.
188 IdentifierInfo *nameId = Tok.getIdentifierInfo();
190 if (Tok.is(tok::l_paren) &&
193 BalancedDelimiterTracker T(*this, tok::l_paren);
198 if (Tok.is(tok::code_completion)) {
205 if (Tok.is(tok::identifier)) {
206 categoryId = Tok.getIdentifierInfo();
210 Diag(Tok, diag::err_expected_ident); // missing category name.
227 if (Tok.is(tok::less) &&
241 if (Tok.is(tok::l_brace))
242 ParseObjCClassInstanceVariables(CategoryType, tok::objc_private, AtLoc);
244 ParseObjCInterfaceDeclList(tok::objc_not_keyword, CategoryType);
251 if (Tok.is(tok::colon)) { // a super class is specified.
255 if (Tok.is(tok::code_completion)) {
261 if (Tok.isNot(tok::identifier)) {
262 Diag(Tok, diag::err_expected_ident); // missing super class name.
265 superClassId = Tok.getIdentifierInfo();
272 if (Tok.is(tok::less) &&
284 if (Tok.is(tok::l_brace))
285 ParseObjCClassInstanceVariables(ClsType, tok::objc_protected, AtLoc);
287 ParseObjCInterfaceDeclList(tok::objc_interface, ClsType);
302 tok::ObjCKeywordKind MethodImplKind;
308 tok::ObjCKeywordKind MethodImplKind) :
368 void Parser::ParseObjCInterfaceDeclList(tok::ObjCKeywordKind contextKey,
373 tok::ObjCKeywordKind MethodImplKind = tok::objc_not_keyword;
379 if (Tok.is(tok::minus) || Tok.is(tok::plus)) {
387 SkipUntil(tok::at, /*StopAtSemi=*/true, /*DontConsume=*/true);
388 if (Tok.is(tok::semi))
393 if (Tok.is(tok::l_paren)) {
394 Diag(Tok, diag::err_expected_minus_or_plus);
395 ParseObjCMethodDecl(Tok.getLocation(),
396 tok::minus,
401 if (Tok.is(tok::semi)) {
407 if (Tok.is(tok::eof))
411 if (Tok.is(tok::code_completion)) {
419 if (Tok.isNot(tok::at)) {
423 if (Tok.is(tok::r_brace))
432 if (Tok.is(tok::code_completion)) {
437 tok::ObjCKeywordKind DirectiveKind = Tok.getObjCKeywordID();
439 if (DirectiveKind == tok::objc_end) { // @end -> terminate list
441 AtEnd.setEnd(Tok.getLocation());
443 } else if (DirectiveKind == tok::objc_not_keyword) {
444 Diag(Tok, diag::err_objc_unknown_at);
445 SkipUntil(tok::semi);
460 SkipUntil(tok::r_brace, tok::at);
463 case tok::objc_implementation:
464 case tok::objc_interface:
472 case tok::objc_required:
473 case tok::objc_optional:
476 if (contextKey != tok::objc_protocol)
482 case tok::objc_property:
489 if (Tok.is(tok::l_paren)) {
490 LParenLoc = Tok
501 ExpectAndConsume(tok::semi, diag::err_expected_semi_decl_list);
508 if (Tok.is(tok::code_completion)) {
511 } else if (Tok.isObjCAtKeyword(tok::objc_end)) {
514 Diag(Tok, diag::err_objc_missing_end)
515 << FixItHint::CreateInsertion(Tok.getLocation(), "\n@end\n");
518 AtEnd.setBegin(Tok.getLocation());
519 AtEnd.setEnd(Tok.getLocation());
551 assert(Tok.getKind() == tok::l_paren);
552 BalancedDelimiterTracker T(*this, tok::l_paren);
556 if (Tok.is(tok::code_completion)) {
560 const IdentifierInfo *II = Tok.getIdentifierInfo();
597 if (ExpectAndConsume(tok::equal, DiagID, "", tok::r_paren))
600 if (Tok.is(tok::code_completion)) {
613 Diag(Tok, diag::err_objc_expected_selector_for_getter_setter)
615 SkipUntil(tok::r_paren);
623 if (ExpectAndConsume(tok::colon,
625 tok::r_paren))
633 SkipUntil(tok::r_paren);
637 if (Tok.isNot(tok::comma))
656 Decl *Parser::ParseObjCMethodPrototype(tok::ObjCKeywordKind MethodImplKind,
658 assert((Tok.is(tok::minus) || Tok.is(tok::plus)) && "expected +/-");
660 tok::TokenKind methodType = Tok.getKind();
679 switch (Tok.getKind()) {
682 case tok::ampamp:
683 case tok::ampequal:
684 case tok::amp:
685 case tok::pipe:
686 case tok::tilde:
687 case tok::exclaim:
688 case tok::exclaimequal:
689 case tok::pipepipe:
690 case tok::pipeequal:
691 case tok::caret:
692 case tok::caretequal: {
693 std::string ThisTok(PP.getSpelling(Tok));
696 Tok.setKind(tok::identifier);
703 case tok::identifier:
704 case tok::kw_asm:
705 case tok::kw_auto:
706 case tok::kw_bool:
707 case tok::kw_break:
708 case tok::kw_case:
709 case tok::kw_catch:
710 case tok::kw_char:
711 case tok::kw_class:
712 case tok::kw_const:
713 case tok::kw_const_cast:
714 case tok::kw_continue:
715 case tok::kw_default:
716 case tok::kw_delete:
717 case tok::kw_do:
718 case tok::kw_double:
719 case tok::kw_dynamic_cast:
720 case tok::kw_else:
721 case tok::kw_enum:
722 case tok::kw_explicit:
723 case tok::kw_export:
724 case tok::kw_extern:
725 case tok::kw_false:
726 case tok::kw_float:
727 case tok::kw_for:
728 case tok::kw_friend:
729 case tok::kw_goto:
730 case tok::kw_if:
731 case tok::kw_inline:
732 case tok::kw_int:
733 case tok::kw_long:
734 case tok::kw_mutable:
735 case tok::kw_namespace:
736 case tok::kw_new:
737 case tok::kw_operator:
738 case tok::kw_private:
739 case tok::kw_protected:
740 case tok::kw_public:
741 case tok::kw_register:
742 case tok::kw_reinterpret_cast:
743 case tok::kw_restrict:
744 case tok::kw_return:
745 case tok::kw_short:
746 case tok::kw_signed:
747 case tok::kw_sizeof:
748 case tok::kw_static:
749 case tok::kw_static_cast:
750 case tok::kw_struct:
751 case tok::kw_switch:
752 case tok::kw_template:
753 case tok::kw_this:
754 case tok::kw_throw:
755 case tok::kw_true:
756 case tok::kw_try:
757 case tok::kw_typedef:
758 case tok::kw_typeid:
759 case tok::kw_typename:
760 case tok::kw_typeof:
761 case tok::kw_union:
762 case tok::kw_unsigned:
763 case tok::kw_using:
764 case tok::kw_virtual:
765 case tok::kw_void:
766 case tok::kw_volatile:
767 case tok::kw_wchar_t:
768 case tok::kw_while:
769 case tok::kw__Bool:
770 case tok::kw__Complex:
771 case tok::kw___alignof:
772 IdentifierInfo *II = Tok.getIdentifierInfo();
784 return (getLangOpts().ObjC2 && Tok.is(tok::identifier) &&
785 Tok.getIdentifierInfo() == ObjCTypeQuals[objc_in]);
802 if (Tok.is(tok::code_completion)) {
808 if (Tok.isNot(tok::identifier))
811 const IdentifierInfo *II = Tok.getIdentifierInfo();
882 assert(Tok.is(tok::l_paren) && "expected (");
884 BalancedDelimiterTracker T(*this, tok::l_paren);
887 SourceLocation TypeStartLoc = Tok.getLocation();
899 declSpec.SetRangeEnd(Tok.getLocation());
915 Tok.is(tok::identifier)) {
919 if (Tok.getIdentifierInfo() == Ident_instancetype) {
920 Ty = Actions.ActOnObjCInstanceType(Tok.getLocation());
925 if (Tok.is(tok::r_paren))
927 else if (Tok.getLocation() == TypeStartLoc) {
929 Diag(Tok, diag::err_expected_type);
930 SkipUntil(tok::r_paren);
968 tok::TokenKind mType,
969 tok::ObjCKeywordKind MethodImplKind,
973 if (Tok.is(tok::code_completion)) {
974 Actions.CodeCompleteObjCMethodDecl(getCurScope(), mType == tok::minus,
983 if (Tok.is(tok::l_paren))
991 if (Tok.is(tok::code_completion)) {
992 Actions.CodeCompleteObjCMethodDecl(getCurScope(), mType == tok::minus,
1003 Tok.isNot(tok::colon)) { // missing selector name.
1004 Diag(Tok, diag::err_expected_selector_for_method)
1005 << SourceRange(mLoc, Tok.getLocation());
1007 SkipUntil(tok::at, true /*StopAtSemi*/, true /*don't consume*/);
1012 if (Tok.isNot(tok::colon)) {
1019 = Actions.ActOnMethodDeclaration(getCurScope(), mLoc, Tok.getLocation(),
1041 if (Tok.isNot(tok::colon)) {
1042 Diag(Tok, diag::err_expected_colon);
1048 if (Tok.is(tok::l_paren)) // Parse the argument type if present.
1062 if (Tok.is(tok::code_completion)) {
1065 mType == tok::minus,
1074 if (Tok.isNot(tok::identifier)) {
1075 Diag(Tok, diag::err_expected_ident); // missing argument name.
1079 ArgInfo.Name = Tok.getIdentifierInfo();
1080 ArgInfo.NameLoc = Tok.getLocation();
1091 if (Tok.is(tok::code_completion)) {
1093 mType == tok::minus,
1104 if (!SelIdent && Tok.isNot(tok::colon))
1107 SourceLocation ColonLoc = Tok.getLocation();
1120 while (Tok.is(tok::comma)) {
1122 if (Tok.is(tok::ellipsis)) {
1128 Diag(Tok, diag::warn_cstyle_param);
1155 = Actions.ActOnMethodDeclaration(getCurScope(), mLoc, Tok.getLocation(),
1174 assert(Tok.is(tok::less) && "expected <");
1181 if (Tok.is(tok::code_completion)) {
1188 if (Tok.isNot(tok::identifier)) {
1189 Diag(Tok, diag::err_expected_ident);
1190 SkipUntil(tok::greater);
1193 ProtocolIdents.push_back(std::make_pair(Tok.getIdentifierInfo(),
1194 Tok.getLocation()));
1195 ProtocolLocs.push_back(Tok.getLocation());
1198 if (Tok.isNot(tok::comma))
1217 assert(Tok.is(tok::less) && "Protocol qualifiers start with '<'");
1253 tok::ObjCKeywordKind visibility,
1255 assert(Tok.is(tok::l_brace) && "expected {");
1261 BalancedDelimiterTracker T(*this, tok::l_brace);
1265 while (Tok.isNot(tok::r_brace) && Tok.isNot(tok::eof)) {
1269 if (Tok.is(tok::semi)) {
1275 if (Tok.is(tok::at)) { // parse objc-visibility-spec
1278 if (Tok.is(tok::code_completion)) {
1283 switch (Tok.getObjCKeywordID()) {
1284 case tok::objc_private:
1285 case tok::objc_public:
1286 case tok::objc_protected:
1287 case tok::objc_package:
1288 visibility = Tok.getObjCKeywordID();
1292 Diag(Tok, diag::err_objc_illegal_visibility_spec);
1297 if (Tok.is(tok::code_completion)) {
1306 tok::ObjCKeywordKind visibility;
1309 ObjCIvarCallback(Parser &P, Decl *IDecl, tok::ObjCKeywordKind V,
1332 if (Tok.is(tok::semi)) {
1335 Diag(Tok, diag::err_expected_semi_decl_list);
1337 SkipUntil(tok::r_brace, true, true);
1372 assert(Tok.isObjCAtKeyword(tok::objc_protocol) &&
1376 if (Tok.is(tok::code_completion)) {
1382 if (Tok.isNot(tok::identifier)) {
1383 Diag(Tok, diag::err_expected_ident); // missing protocol name.
1387 IdentifierInfo *protocolName = Tok.getIdentifierInfo();
1390 if (Tok.is(tok::semi)) { // forward declaration of one protocol.
1399 if (Tok.is(tok::comma)) { // list of forward declarations.
1406 if (Tok.isNot(tok::identifier)) {
1407 Diag(Tok, diag::err_expected_ident);
1408 SkipUntil(tok::semi);
1411 ProtocolRefs.push_back(IdentifierLocPair(Tok.getIdentifierInfo(),
1412 Tok.getLocation()));
1415 if (Tok.isNot(tok::comma))
1419 if (ExpectAndConsume(tok::semi, diag::err_expected_semi_after, "@protocol"))
1433 if (Tok.is(tok::less) &&
1445 ParseObjCInterfaceDeclList(tok::objc_protocol, ProtoType);
1461 assert(Tok.isObjCAtKeyword(tok::objc_implementation) &&
1467 if (Tok.is(tok::code_completion)) {
1473 if (Tok.isNot(tok::identifier)) {
1474 Diag(Tok, diag::err_expected_ident); // missing class or category name.
1478 IdentifierInfo *nameId = Tok.getIdentifierInfo();
1482 if (Tok.is(tok::l_paren)) {
1488 if (Tok.is(tok::code_completion)) {
1494 if (Tok.is(tok::identifier)) {
1495 categoryId = Tok.getIdentifierInfo();
1498 Diag(Tok, diag::err_expected_ident); // missing category name.
1501 if (Tok.isNot(tok::r_paren)) {
1502 Diag(Tok, diag::err_expected_rparen);
1503 SkipUntil(tok::r_paren, false); // don't stop at ';'
1515 if (Tok.is(tok::colon)) {
1518 if (Tok.isNot(tok::identifier)) {
1519 Diag(Tok, diag::err_expected_ident); // missing super class name.
1522 superClassId = Tok.getIdentifierInfo();
1529 if (Tok.is(tok::l_brace)) // we have ivars
1530 ParseObjCClassInstanceVariables(ObjCImpDecl, tok::objc_private, AtLoc);
1538 while (!ObjCImplParsing.isFinished() && Tok.isNot(tok::eof)) {
1554 assert(Tok.isObjCAtKeyword(tok::objc_end) &&
1567 finish(P.Tok.getLocation());
1568 if (P.Tok.is(tok::eof)) {
1569 P.Diag(P.Tok, diag::err_objc_missing_end)
1570 << FixItHint::CreateInsertion(P.Tok.getLocation(), "\n@end\n");
1607 assert(Tok.isObjCAtKeyword(tok::objc_compatibility_alias) &&
1610 if (Tok.isNot(tok::identifier)) {
1611 Diag(Tok, diag::err_expected_ident);
1614 IdentifierInfo *aliasId = Tok.getIdentifierInfo();
1616 if (Tok.isNot(tok::identifier)) {
1617 Diag(Tok, diag::err_expected_ident);
1620 IdentifierInfo *classId = Tok.getIdentifierInfo();
1622 ExpectAndConsume(tok::semi, diag::err_expected_semi_after,
1640 assert(Tok.isObjCAtKeyword(tok::objc_synthesize) &&
1645 if (Tok.is(tok::code_completion)) {
1651 if (Tok.isNot(tok::identifier)) {
1652 Diag(Tok, diag::err_synthesized_property_name);
1653 SkipUntil(tok::semi);
1658 IdentifierInfo *propertyId = Tok.getIdentifierInfo();
1661 if (Tok.is(tok::equal)) {
1665 if (Tok.is(tok::code_completion)) {
1671 if (Tok.isNot(tok::identifier)) {
1672 Diag(Tok, diag::err_expected_ident);
1675 propertyIvar = Tok.getIdentifierInfo();
1680 if (Tok.isNot(tok::comma))
1684 ExpectAndConsume(tok::semi, diag::err_expected_semi_after, "@synthesize");
1696 assert(Tok.isObjCAtKeyword(tok::objc_dynamic) &&
1700 if (Tok.is(tok::code_completion)) {
1706 if (Tok.isNot(tok::identifier)) {
1707 Diag(Tok, diag::err_expected_ident);
1708 SkipUntil(tok::semi);
1712 IdentifierInfo *propertyId = Tok.getIdentifierInfo();
1717 if (Tok.isNot(tok::comma))
1721 ExpectAndConsume(tok::semi, diag::err_expected_semi_after, "@dynamic");
1731 if (Tok.isNot(tok::semi)) {
1734 SkipUntil(tok::semi);
1739 ExpectAndConsume(tok::semi, diag::err_expected_semi_after, "@throw");
1749 if (Tok.isNot(tok::l_paren)) {
1750 Diag(Tok, diag::err_expected_lparen_after) << "@synchronized";
1758 if (Tok.is(tok::r_paren)) {
1762 Diag(Tok, diag::err_expected_rparen);
1765 SkipUntil(tok::l_brace, true, true);
1769 if (Tok.isNot(tok::l_brace)) {
1771 Diag(Tok, diag::err_expected_lbrace);
1790 body = Actions.ActOnNullStmt(Tok.getLocation());
1810 if (Tok.isNot(tok::l_brace)) {
1811 Diag(Tok, diag::err_expected_lbrace);
1820 TryBody = Actions.ActOnNullStmt(Tok.getLocation());
1822 while (Tok.is(tok::at)) {
1827 if (!AfterAt.isObjCAtKeyword(tok::objc_catch) &&
1828 !AfterAt.isObjCAtKeyword(tok::objc_finally))
1832 if (Tok.isObjCAtKeyword(tok::objc_catch)) {
1835 if (Tok.is(tok::l_paren)) {
1838 if (Tok.isNot(tok::ellipsis)) {
1852 if (Tok.is(tok::r_paren))
1855 SkipUntil(tok::r_paren, true, false);
1858 if (Tok.is(tok::l_brace))
1861 Diag(Tok, diag::err_expected_lbrace);
1863 CatchBody = Actions.ActOnNullStmt(Tok.getLocation());
1879 assert(Tok.isObjCAtKeyword(tok::objc_finally) && "Lookahead confused?");
1884 if (Tok.is(tok::l_brace))
1887 Diag(Tok, diag::err_expected_lbrace);
1889 FinallyBody = Actions.ActOnNullStmt(Tok.getLocation());
1912 if (Tok.isNot(tok::l_brace)) {
1913 Diag(Tok, diag::err_expected_lbrace);
1924 AutoreleasePoolBody = Actions.ActOnNullStmt(Tok.getLocation());
1936 Toks.push_back(Tok);
1937 if (Tok.is(tok::kw_try)) {
1939 if (Tok.is(tok::colon)) {
1940 Toks.push_back(Tok);
1942 while (Tok.isNot(tok::l_brace)) {
1943 ConsumeAndStoreUntil(tok::l_paren, Toks, /*StopAtSemi=*/false);
1944 ConsumeAndStoreUntil(tok::r_paren, Toks, /*StopAtSemi=*/false);
1947 Toks.push_back(Tok); // also store '{'
1949 else if (Tok.is(tok::colon)) {
1951 while (Tok.isNot(tok::l_brace)) {
1952 ConsumeAndStoreUntil(tok::l_paren, Toks, /*StopAtSemi=*/false);
1953 ConsumeAndStoreUntil(tok::r_paren, Toks, /*StopAtSemi=*/false);
1955 Toks.push_back(Tok); // also store '{'
1959 ConsumeAndStoreUntil(tok::r_brace, Toks, /*StopAtSemi=*/false);
1960 while (Tok.is(tok::kw_catch)) {
1961 ConsumeAndStoreUntil(tok::l_brace, Toks, /*StopAtSemi=*/false);
1962 ConsumeAndStoreUntil(tok::r_brace, Toks, /*StopAtSemi=*/false);
1971 PrettyDeclStackTraceEntry CrashInfo(Actions, MDecl, Tok.getLocation(),
1975 if (Tok.is(tok::semi)) {
1977 Diag(Tok, diag::warn_semicolon_before_method_body)
1978 << FixItHint::CreateRemoval(Tok.getLocation());
1984 if (Tok.isNot(tok::l_brace)) {
1985 Diag(Tok, diag::err_expected_method_body);
1988 SkipUntil(tok::l_brace, true, true);
1991 if (Tok.isNot(tok::l_brace))
1997 SkipUntil(tok::r_brace, /*StopAtSemi=*/false);
2011 if (Tok.is(tok::code_completion)) {
2017 if (Tok.isObjCAtKeyword(tok::objc_try))
2020 if (Tok.isObjCAtKeyword(tok::objc_throw))
2023 if (Tok.isObjCAtKeyword(tok::objc_synchronized))
2026 if (Tok.isObjCAtKeyword(tok::objc_autoreleasepool))
2034 SkipUntil(tok::semi);
2044 switch (Tok.getKind()) {
2045 case tok::code_completion:
2050 case tok::minus:
2051 case tok::plus: {
2052 tok::TokenKind Kind = Tok.getKind();
2055 if (!Tok.is(tok::numeric_constant)) {
2058 case tok::minus: Symbol = "-"; break;
2059 case tok::plus: Symbol = "+"; break;
2062 Diag(Tok, diag::err_nsnumber_nonliteral_unary)
2067 ExprResult Lit(Actions.ActOnNumericConstant(Tok));
2081 case tok::string_literal: // primary-expression: string-literal
2082 case tok::wide_string_literal:
2085 case tok::char_constant:
2088 case tok::numeric_constant:
2091 case tok::kw_true: // Objective-C++, etc.
2092 case tok::kw___objc_yes: // c/c++/objc/objc++ __objc_yes
2094 case tok::kw_false: // Objective-C++, etc.
2095 case tok::kw___objc_no: // c/c++/objc/objc++ __objc_no
2098 case tok::l_square:
2102 case tok::l_brace:
2106 case tok::l_paren:
2111 if (Tok.getIdentifierInfo() == 0)
2114 switch (Tok.getIdentifierInfo()->getObjCKeywordID()) {
2115 case tok::objc_encode:
2117 case tok::objc_protocol:
2119 case tok::objc_selector:
2123 if (GetLookAheadToken(1).is(tok::l_brace)) {
2124 char ch = Tok.getIdentifierInfo()->getNameStart()[0];
2131 SourceLocation kwLoc = Tok.getLocation();
2167 if (Tok.is(tok::identifier) || Tok.is(tok::coloncolon) ||
2168 Tok.is(tok::kw_typename) || Tok.is(tok::annot_cxxscope))
2171 if (!Actions.isSimpleTypeSpecifier(Tok.getKind())) {
2190 if (Tok.is(tok::l_paren)) {
2235 assert(Tok.is(tok::l_square) && getLangOpts().ObjC1 &&
2237 return GetLookAheadToken(1).is(tok::identifier) &&
2238 GetLookAheadToken(2).is(tok::identifier);
2242 if (!getLangOpts().ObjC1 || !NextToken().is(tok::identifier) ||
2249 if (Tok.is(tok::annot_typename))
2250 Type = getTypeAnnotation(Tok);
2251 else if (Tok.is(tok::identifier))
2252 Type = Actions.getTypeName(*Tok.getIdentifierInfo(), Tok.getLocation(),
2259 if (AfterNext.is(tok::colon) || AfterNext.is(tok::r_square)) {
2260 if (Tok.is(tok::identifier))
2263 return Tok.is(tok::annot_typename);
2280 assert(Tok.is(tok::l_square) && "'[' expected");
2283 if (Tok.is(tok::code_completion)) {
2298 if (Tok.is(tok::identifier) && Tok.getIdentifierInfo() == Ident_super &&
2299 NextToken().isNot(tok::period) && getCurScope()->isInObjcMethodScope())
2307 SkipUntil(tok::r_square);
2321 if (Tok.is(tok::identifier)) {
2322 IdentifierInfo *Name = Tok.getIdentifierInfo();
2323 SourceLocation NameLoc = Tok.getLocation();
2327 NextToken().is(tok::period),
2335 SkipUntil(tok::r_square);
2353 SkipUntil(tok::r_square);
2406 if (Tok.is(tok::code_completion)) {
2428 if (Tok.is(tok::colon)) {
2434 if (Tok.isNot(tok::colon)) {
2435 Diag(Tok, diag::err_expected_colon);
2439 SkipUntil(tok::r_square);
2446 if (Tok.is(tok::code_completion)) {
2472 SkipUntil(tok::r_square);
2480 if (Tok.is(tok::code_completion)) {
2502 if (!selIdent && Tok.isNot(tok::colon))
2507 while (Tok.is(tok::comma)) {
2512 if (Tok.is(tok::colon)) {
2519 SkipUntil(tok::r_square);
2527 Diag(Tok, diag::err_expected_ident); // missing selector name.
2532 SkipUntil(tok::r_square);
2536 if (Tok.isNot(tok::r_square)) {
2537 if (Tok.is(tok::identifier))
2538 Diag(Tok, diag::err_expected_colon);
2540 Diag(Tok, diag::err_expected_rsquare);
2544 SkipUntil(tok::r_square);
2579 while (Tok.is(tok::at)) {
2584 return ExprError(Diag(Tok, diag::err_objc_concat_string));
2612 ExprResult Lit(Actions.ActOnCharacterConstant(Tok));
2626 ExprResult Lit(Actions.ActOnNumericConstant(Tok));
2639 if (Tok.isNot(tok::l_paren))
2640 return ExprError(Diag(Tok, diag::err_expected_lparen_after) << "@");
2642 BalancedDelimiterTracker T(*this, tok::l_paren);
2663 while (Tok.isNot(tok::r_square)) {
2670 SkipUntil(tok::r_square);
2675 if (Tok.is(tok::ellipsis))
2682 if (Tok.is(tok::comma))
2684 else if (Tok.isNot(tok::r_square))
2685 return ExprError(Diag(Tok, diag::err_expected_rsquare_or_comma));
2695 while (Tok.isNot(tok::r_brace)) {
2705 SkipUntil(tok::r_brace);
2710 if (Tok.is(tok::colon)) {
2713 return ExprError(Diag(Tok, diag::err_expected_colon));
2721 SkipUntil(tok::r_brace);
2727 if (Tok.is(tok::ellipsis) && getLangOpts().CPlusPlus)
2737 if (Tok.is(tok::comma))
2739 else if (Tok.isNot(tok::r_brace))
2740 return ExprError(Diag(Tok, diag::err_expected_rbrace_or_comma));
2753 assert(Tok.isObjCAtKeyword(tok::objc_encode) && "Not an @encode expression!");
2757 if (Tok.isNot(tok::l_paren))
2758 return ExprError(Diag(Tok, diag::err_expected_lparen_after) << "@encode");
2760 BalancedDelimiterTracker T(*this, tok::l_paren);
2780 if (Tok.isNot(tok::l_paren))
2781 return ExprError(Diag(Tok, diag::err_expected_lparen_after) << "@protocol");
2783 BalancedDelimiterTracker T(*this, tok::l_paren);
2786 if (Tok.isNot(tok::identifier))
2787 return ExprError(Diag(Tok, diag::err_expected_ident));
2789 IdentifierInfo *protocolId = Tok.getIdentifierInfo();
2804 if (Tok.isNot(tok::l_paren))
2805 return ExprError(Diag(Tok, diag::err_expected_lparen_after) << "@selector");
2810 BalancedDelimiterTracker T(*this, tok::l_paren);
2813 if (Tok.is(tok::code_completion)) {
2822 Tok.isNot(tok::colon) && Tok.isNot(tok::coloncolon))
2823 return ExprError(Diag(Tok, diag::err_expected_ident));
2827 if (Tok.isNot(tok::r_paren)) {
2829 if (Tok.is(tok::coloncolon)) { // Handle :: in C++.
2832 } else if (Tok.isNot(tok::colon))
2833 return ExprError(Diag(Tok, diag::err_expected_colon));
2837 if (Tok.is(tok::r_paren))
2840 if (Tok.is(tok::code_completion)) {
2851 if (!SelIdent && Tok.isNot(tok::colon) && Tok.isNot(tok::coloncolon))
2872 SourceLocation OrigLoc = Tok.getLocation();
2877 LM.Toks.push_back(Tok);
2883 assert((Tok.is(tok::l_brace) || Tok.is(tok::kw_try) ||
2884 Tok.is(tok::colon)) &&
2898 if (Tok.is(tok::kw_try))
2901 if (Tok.is(tok::colon))
2906 if (Tok.getLocation() != OrigLoc) {
2912 if (PP.getSourceManager().isBeforeInTranslationUnit(Tok.getLocation(),
2914 while (Tok.getLocation() != OrigLoc && Tok.isNot(tok::eof))