Lines Matching refs:Tok
28 if (Tok.is(tok::kw___attribute)) { in MaybeSkipAttributes()
30 Diag(Tok, diag::err_objc_postfix_attribute_hint) in MaybeSkipAttributes()
33 Diag(Tok, diag::err_objc_postfix_attribute); in MaybeSkipAttributes()
49 if (Tok.is(tok::code_completion)) { in ParseObjCAtDirectives()
56 switch (Tok.getObjCKeywordID()) { in ParseObjCAtDirectives()
109 if (Tok.isNot(tok::identifier)) { in ParseObjCAtClassDeclaration()
110 Diag(Tok, diag::err_expected) << tok::identifier; in ParseObjCAtClassDeclaration()
114 ClassNames.push_back(Tok.getIdentifierInfo()); in ParseObjCAtClassDeclaration()
115 ClassLocs.push_back(Tok.getLocation()); in ParseObjCAtClassDeclaration()
181 assert(Tok.isObjCAtKeyword(tok::objc_interface) && in ParseObjCAtInterfaceDeclaration()
187 if (Tok.is(tok::code_completion)) { in ParseObjCAtInterfaceDeclaration()
195 if (Tok.isNot(tok::identifier)) { in ParseObjCAtInterfaceDeclaration()
196 Diag(Tok, diag::err_expected) in ParseObjCAtInterfaceDeclaration()
202 IdentifierInfo *nameId = Tok.getIdentifierInfo(); in ParseObjCAtInterfaceDeclaration()
204 if (Tok.is(tok::l_paren) && in ParseObjCAtInterfaceDeclaration()
212 if (Tok.is(tok::code_completion)) { in ParseObjCAtInterfaceDeclaration()
219 if (Tok.is(tok::identifier)) { in ParseObjCAtInterfaceDeclaration()
220 categoryId = Tok.getIdentifierInfo(); in ParseObjCAtInterfaceDeclaration()
224 Diag(Tok, diag::err_expected) in ParseObjCAtInterfaceDeclaration()
242 if (Tok.is(tok::less) && in ParseObjCAtInterfaceDeclaration()
256 if (Tok.is(tok::l_brace)) in ParseObjCAtInterfaceDeclaration()
266 if (Tok.is(tok::colon)) { // a super class is specified. in ParseObjCAtInterfaceDeclaration()
270 if (Tok.is(tok::code_completion)) { in ParseObjCAtInterfaceDeclaration()
276 if (Tok.isNot(tok::identifier)) { in ParseObjCAtInterfaceDeclaration()
277 Diag(Tok, diag::err_expected) in ParseObjCAtInterfaceDeclaration()
281 superClassId = Tok.getIdentifierInfo(); in ParseObjCAtInterfaceDeclaration()
288 if (Tok.is(tok::less) && in ParseObjCAtInterfaceDeclaration()
293 if (Tok.isNot(tok::less)) in ParseObjCAtInterfaceDeclaration()
303 if (Tok.is(tok::l_brace)) in ParseObjCAtInterfaceDeclaration()
333 if (Tok.is(tok::minus) || Tok.is(tok::plus)) { in ParseObjCInterfaceDeclList()
342 if (Tok.is(tok::semi)) in ParseObjCInterfaceDeclList()
347 if (Tok.is(tok::l_paren)) { in ParseObjCInterfaceDeclList()
348 Diag(Tok, diag::err_expected_minus_or_plus); in ParseObjCInterfaceDeclList()
349 ParseObjCMethodDecl(Tok.getLocation(), in ParseObjCInterfaceDeclList()
355 if (Tok.is(tok::semi)) { in ParseObjCInterfaceDeclList()
365 if (Tok.is(tok::code_completion)) { in ParseObjCInterfaceDeclList()
373 if (Tok.isNot(tok::at)) { in ParseObjCInterfaceDeclList()
377 if (Tok.is(tok::r_brace)) in ParseObjCInterfaceDeclList()
386 if (Tok.is(tok::code_completion)) { in ParseObjCInterfaceDeclList()
391 tok::ObjCKeywordKind DirectiveKind = Tok.getObjCKeywordID(); in ParseObjCInterfaceDeclList()
395 AtEnd.setEnd(Tok.getLocation()); in ParseObjCInterfaceDeclList()
398 Diag(Tok, diag::err_objc_unknown_at); in ParseObjCInterfaceDeclList()
443 if (Tok.is(tok::l_paren)) { in ParseObjCInterfaceDeclList()
444 LParenLoc = Tok.getLocation(); in ParseObjCInterfaceDeclList()
494 if (Tok.is(tok::code_completion)) { in ParseObjCInterfaceDeclList()
497 } else if (Tok.isObjCAtKeyword(tok::objc_end)) { in ParseObjCInterfaceDeclList()
500 Diag(Tok, diag::err_objc_missing_end) in ParseObjCInterfaceDeclList()
501 << FixItHint::CreateInsertion(Tok.getLocation(), "\n@end\n"); in ParseObjCInterfaceDeclList()
504 AtEnd.setBegin(Tok.getLocation()); in ParseObjCInterfaceDeclList()
505 AtEnd.setEnd(Tok.getLocation()); in ParseObjCInterfaceDeclList()
534 assert(Tok.getKind() == tok::l_paren); in ParseObjCPropertyAttribute()
539 if (Tok.is(tok::code_completion)) { in ParseObjCPropertyAttribute()
543 const IdentifierInfo *II = Tok.getIdentifierInfo(); in ParseObjCPropertyAttribute()
585 if (Tok.is(tok::code_completion)) { in ParseObjCPropertyAttribute()
598 Diag(Tok, diag::err_objc_expected_selector_for_getter_setter) in ParseObjCPropertyAttribute()
623 if (Tok.isNot(tok::comma)) in ParseObjCPropertyAttribute()
644 assert((Tok.is(tok::minus) || Tok.is(tok::plus)) && "expected +/-"); in ParseObjCMethodPrototype()
646 tok::TokenKind methodType = Tok.getKind(); in ParseObjCMethodPrototype()
665 switch (Tok.getKind()) { in ParseObjCSelectorPiece()
679 std::string ThisTok(PP.getSpelling(Tok)); in ParseObjCSelectorPiece()
682 Tok.setKind(tok::identifier); in ParseObjCSelectorPiece()
758 IdentifierInfo *II = Tok.getIdentifierInfo(); in ParseObjCSelectorPiece()
770 return (getLangOpts().ObjC2 && Tok.is(tok::identifier) && in isTokIdentifier_in()
771 Tok.getIdentifierInfo() == ObjCTypeQuals[objc_in]); in isTokIdentifier_in()
788 if (Tok.is(tok::code_completion)) { in ParseObjCTypeQualifierList()
794 if (Tok.isNot(tok::identifier)) in ParseObjCTypeQualifierList()
797 const IdentifierInfo *II = Tok.getIdentifierInfo(); in ParseObjCTypeQualifierList()
869 assert(Tok.is(tok::l_paren) && "expected ("); in ParseObjCTypeName()
874 SourceLocation TypeStartLoc = Tok.getLocation(); in ParseObjCTypeName()
886 declSpec.SetRangeEnd(Tok.getLocation()); in ParseObjCTypeName()
902 Tok.is(tok::identifier)) { in ParseObjCTypeName()
906 if (Tok.getIdentifierInfo() == Ident_instancetype) { in ParseObjCTypeName()
907 Ty = Actions.ActOnObjCInstanceType(Tok.getLocation()); in ParseObjCTypeName()
912 if (Tok.is(tok::r_paren)) in ParseObjCTypeName()
914 else if (Tok.getLocation() == TypeStartLoc) { in ParseObjCTypeName()
916 Diag(Tok, diag::err_expected_type); in ParseObjCTypeName()
960 if (Tok.is(tok::code_completion)) { in ParseObjCMethodDecl()
970 if (Tok.is(tok::l_paren)) in ParseObjCMethodDecl()
979 if (Tok.is(tok::code_completion)) { in ParseObjCMethodDecl()
991 if (!SelIdent && Tok.isNot(tok::colon)) { // missing selector name. in ParseObjCMethodDecl()
992 Diag(Tok, diag::err_expected_selector_for_method) in ParseObjCMethodDecl()
993 << SourceRange(mLoc, Tok.getLocation()); in ParseObjCMethodDecl()
1000 if (Tok.isNot(tok::colon)) { in ParseObjCMethodDecl()
1007 = Actions.ActOnMethodDeclaration(getCurScope(), mLoc, Tok.getLocation(), in ParseObjCMethodDecl()
1033 if (Tok.is(tok::l_paren)) // Parse the argument type if present. in ParseObjCMethodDecl()
1047 if (Tok.is(tok::code_completion)) { in ParseObjCMethodDecl()
1057 if (Tok.isNot(tok::identifier)) { in ParseObjCMethodDecl()
1058 Diag(Tok, diag::err_expected) in ParseObjCMethodDecl()
1063 ArgInfo.Name = Tok.getIdentifierInfo(); in ParseObjCMethodDecl()
1064 ArgInfo.NameLoc = Tok.getLocation(); in ParseObjCMethodDecl()
1075 if (Tok.is(tok::code_completion)) { in ParseObjCMethodDecl()
1086 if (!SelIdent && Tok.isNot(tok::colon)) in ParseObjCMethodDecl()
1089 SourceLocation ColonLoc = Tok.getLocation(); in ParseObjCMethodDecl()
1102 while (Tok.is(tok::comma)) { in ParseObjCMethodDecl()
1104 if (Tok.is(tok::ellipsis)) { in ParseObjCMethodDecl()
1110 Diag(Tok, diag::warn_cstyle_param); in ParseObjCMethodDecl()
1137 = Actions.ActOnMethodDeclaration(getCurScope(), mLoc, Tok.getLocation(), in ParseObjCMethodDecl()
1156 assert(Tok.is(tok::less) && "expected <"); in ParseObjCProtocolReferences()
1163 if (Tok.is(tok::code_completion)) { in ParseObjCProtocolReferences()
1170 if (Tok.isNot(tok::identifier)) { in ParseObjCProtocolReferences()
1171 Diag(Tok, diag::err_expected) << tok::identifier; in ParseObjCProtocolReferences()
1175 ProtocolIdents.push_back(std::make_pair(Tok.getIdentifierInfo(), in ParseObjCProtocolReferences()
1176 Tok.getLocation())); in ParseObjCProtocolReferences()
1177 ProtocolLocs.push_back(Tok.getLocation()); in ParseObjCProtocolReferences()
1198 assert(Tok.is(tok::less) && "Protocol qualifiers start with '<'"); in ParseObjCProtocolQualifiers()
1252 assert(Tok.is(tok::l_brace) && "expected {"); in ParseObjCClassInstanceVariables()
1261 while (Tok.isNot(tok::r_brace) && !isEofOrEom()) { in ParseObjCClassInstanceVariables()
1265 if (Tok.is(tok::semi)) { in ParseObjCClassInstanceVariables()
1272 if (Tok.is(tok::code_completion)) { in ParseObjCClassInstanceVariables()
1277 switch (Tok.getObjCKeywordID()) { in ParseObjCClassInstanceVariables()
1282 visibility = Tok.getObjCKeywordID(); in ParseObjCClassInstanceVariables()
1287 Diag(Tok, diag::err_objc_unexpected_atend); in ParseObjCClassInstanceVariables()
1288 Tok.setLocation(Tok.getLocation().getLocWithOffset(-1)); in ParseObjCClassInstanceVariables()
1289 Tok.setKind(tok::at); in ParseObjCClassInstanceVariables()
1290 Tok.setLength(1); in ParseObjCClassInstanceVariables()
1291 PP.EnterToken(Tok); in ParseObjCClassInstanceVariables()
1297 Diag(Tok, diag::err_objc_illegal_visibility_spec); in ParseObjCClassInstanceVariables()
1302 if (Tok.is(tok::code_completion)) { in ParseObjCClassInstanceVariables()
1324 if (Tok.is(tok::semi)) { in ParseObjCClassInstanceVariables()
1327 Diag(Tok, diag::err_expected_semi_decl_list); in ParseObjCClassInstanceVariables()
1356 assert(Tok.isObjCAtKeyword(tok::objc_protocol) && in ParseObjCAtProtocolDeclaration()
1360 if (Tok.is(tok::code_completion)) { in ParseObjCAtProtocolDeclaration()
1368 if (Tok.isNot(tok::identifier)) { in ParseObjCAtProtocolDeclaration()
1369 Diag(Tok, diag::err_expected) << tok::identifier; // missing protocol name. in ParseObjCAtProtocolDeclaration()
1373 IdentifierInfo *protocolName = Tok.getIdentifierInfo(); in ParseObjCAtProtocolDeclaration()
1384 if (Tok.is(tok::comma)) { // list of forward declarations. in ParseObjCAtProtocolDeclaration()
1391 if (Tok.isNot(tok::identifier)) { in ParseObjCAtProtocolDeclaration()
1392 Diag(Tok, diag::err_expected) << tok::identifier; in ParseObjCAtProtocolDeclaration()
1396 ProtocolRefs.push_back(IdentifierLocPair(Tok.getIdentifierInfo(), in ParseObjCAtProtocolDeclaration()
1397 Tok.getLocation())); in ParseObjCAtProtocolDeclaration()
1400 if (Tok.isNot(tok::comma)) in ParseObjCAtProtocolDeclaration()
1418 if (Tok.is(tok::less) && in ParseObjCAtProtocolDeclaration()
1446 assert(Tok.isObjCAtKeyword(tok::objc_implementation) && in ParseObjCAtImplementationDeclaration()
1452 if (Tok.is(tok::code_completion)) { in ParseObjCAtImplementationDeclaration()
1460 if (Tok.isNot(tok::identifier)) { in ParseObjCAtImplementationDeclaration()
1461 Diag(Tok, diag::err_expected) in ParseObjCAtImplementationDeclaration()
1466 IdentifierInfo *nameId = Tok.getIdentifierInfo(); in ParseObjCAtImplementationDeclaration()
1470 if (Tok.is(tok::l_paren)) { in ParseObjCAtImplementationDeclaration()
1476 if (Tok.is(tok::code_completion)) { in ParseObjCAtImplementationDeclaration()
1482 if (Tok.is(tok::identifier)) { in ParseObjCAtImplementationDeclaration()
1483 categoryId = Tok.getIdentifierInfo(); in ParseObjCAtImplementationDeclaration()
1486 Diag(Tok, diag::err_expected) in ParseObjCAtImplementationDeclaration()
1490 if (Tok.isNot(tok::r_paren)) { in ParseObjCAtImplementationDeclaration()
1491 Diag(Tok, diag::err_expected) << tok::r_paren; in ParseObjCAtImplementationDeclaration()
1496 if (Tok.is(tok::less)) { // we have illegal '<' try to recover in ParseObjCAtImplementationDeclaration()
1497 Diag(Tok, diag::err_unexpected_protocol_qualifier); in ParseObjCAtImplementationDeclaration()
1512 if (Tok.isNot(tok::identifier)) { in ParseObjCAtImplementationDeclaration()
1513 Diag(Tok, diag::err_expected) in ParseObjCAtImplementationDeclaration()
1517 superClassId = Tok.getIdentifierInfo(); in ParseObjCAtImplementationDeclaration()
1524 if (Tok.is(tok::l_brace)) // we have ivars in ParseObjCAtImplementationDeclaration()
1526 else if (Tok.is(tok::less)) { // we have illegal '<' try to recover in ParseObjCAtImplementationDeclaration()
1527 Diag(Tok, diag::err_unexpected_protocol_qualifier); in ParseObjCAtImplementationDeclaration()
1556 assert(Tok.isObjCAtKeyword(tok::objc_end) && in ParseObjCAtEndDeclaration()
1569 finish(P.Tok.getLocation()); in ~ObjCImplParsingDataRAII()
1571 P.Diag(P.Tok, diag::err_objc_missing_end) in ~ObjCImplParsingDataRAII()
1572 << FixItHint::CreateInsertion(P.Tok.getLocation(), "\n@end\n"); in ~ObjCImplParsingDataRAII()
1609 assert(Tok.isObjCAtKeyword(tok::objc_compatibility_alias) && in ParseObjCAtAliasDeclaration()
1612 if (Tok.isNot(tok::identifier)) { in ParseObjCAtAliasDeclaration()
1613 Diag(Tok, diag::err_expected) << tok::identifier; in ParseObjCAtAliasDeclaration()
1616 IdentifierInfo *aliasId = Tok.getIdentifierInfo(); in ParseObjCAtAliasDeclaration()
1618 if (Tok.isNot(tok::identifier)) { in ParseObjCAtAliasDeclaration()
1619 Diag(Tok, diag::err_expected) << tok::identifier; in ParseObjCAtAliasDeclaration()
1622 IdentifierInfo *classId = Tok.getIdentifierInfo(); in ParseObjCAtAliasDeclaration()
1641 assert(Tok.isObjCAtKeyword(tok::objc_synthesize) && in ParseObjCPropertySynthesize()
1646 if (Tok.is(tok::code_completion)) { in ParseObjCPropertySynthesize()
1652 if (Tok.isNot(tok::identifier)) { in ParseObjCPropertySynthesize()
1653 Diag(Tok, diag::err_synthesized_property_name); in ParseObjCPropertySynthesize()
1659 IdentifierInfo *propertyId = Tok.getIdentifierInfo(); in ParseObjCPropertySynthesize()
1664 if (Tok.is(tok::code_completion)) { in ParseObjCPropertySynthesize()
1670 if (Tok.isNot(tok::identifier)) { in ParseObjCPropertySynthesize()
1671 Diag(Tok, diag::err_expected) << tok::identifier; in ParseObjCPropertySynthesize()
1674 propertyIvar = Tok.getIdentifierInfo(); in ParseObjCPropertySynthesize()
1679 if (Tok.isNot(tok::comma)) in ParseObjCPropertySynthesize()
1695 assert(Tok.isObjCAtKeyword(tok::objc_dynamic) && in ParseObjCPropertyDynamic()
1699 if (Tok.is(tok::code_completion)) { in ParseObjCPropertyDynamic()
1705 if (Tok.isNot(tok::identifier)) { in ParseObjCPropertyDynamic()
1706 Diag(Tok, diag::err_expected) << tok::identifier; in ParseObjCPropertyDynamic()
1711 IdentifierInfo *propertyId = Tok.getIdentifierInfo(); in ParseObjCPropertyDynamic()
1716 if (Tok.isNot(tok::comma)) in ParseObjCPropertyDynamic()
1730 if (Tok.isNot(tok::semi)) { in ParseObjCThrowStmt()
1748 if (Tok.isNot(tok::l_paren)) { in ParseObjCSynchronizedStmt()
1749 Diag(Tok, diag::err_expected_lparen_after) << "@synchronized"; in ParseObjCSynchronizedStmt()
1757 if (Tok.is(tok::r_paren)) { in ParseObjCSynchronizedStmt()
1761 Diag(Tok, diag::err_expected) << tok::r_paren; in ParseObjCSynchronizedStmt()
1768 if (Tok.isNot(tok::l_brace)) { in ParseObjCSynchronizedStmt()
1770 Diag(Tok, diag::err_expected) << tok::l_brace; in ParseObjCSynchronizedStmt()
1789 body = Actions.ActOnNullStmt(Tok.getLocation()); in ParseObjCSynchronizedStmt()
1809 if (Tok.isNot(tok::l_brace)) { in ParseObjCTryStmt()
1810 Diag(Tok, diag::err_expected) << tok::l_brace; in ParseObjCTryStmt()
1819 TryBody = Actions.ActOnNullStmt(Tok.getLocation()); in ParseObjCTryStmt()
1821 while (Tok.is(tok::at)) { in ParseObjCTryStmt()
1831 if (Tok.isObjCAtKeyword(tok::objc_catch)) { in ParseObjCTryStmt()
1834 if (Tok.is(tok::l_paren)) { in ParseObjCTryStmt()
1837 if (Tok.isNot(tok::ellipsis)) { in ParseObjCTryStmt()
1851 if (Tok.is(tok::r_paren)) in ParseObjCTryStmt()
1857 if (Tok.is(tok::l_brace)) in ParseObjCTryStmt()
1860 Diag(Tok, diag::err_expected) << tok::l_brace; in ParseObjCTryStmt()
1862 CatchBody = Actions.ActOnNullStmt(Tok.getLocation()); in ParseObjCTryStmt()
1878 assert(Tok.isObjCAtKeyword(tok::objc_finally) && "Lookahead confused?"); in ParseObjCTryStmt()
1883 if (Tok.is(tok::l_brace)) in ParseObjCTryStmt()
1886 Diag(Tok, diag::err_expected) << tok::l_brace; in ParseObjCTryStmt()
1888 FinallyBody = Actions.ActOnNullStmt(Tok.getLocation()); in ParseObjCTryStmt()
1911 if (Tok.isNot(tok::l_brace)) { in ParseObjCAutoreleasePoolStmt()
1912 Diag(Tok, diag::err_expected) << tok::l_brace; in ParseObjCAutoreleasePoolStmt()
1923 AutoreleasePoolBody = Actions.ActOnNullStmt(Tok.getLocation()); in ParseObjCAutoreleasePoolStmt()
1935 Toks.push_back(Tok); in StashAwayMethodOrFunctionBodyTokens()
1936 if (Tok.is(tok::kw_try)) { in StashAwayMethodOrFunctionBodyTokens()
1938 if (Tok.is(tok::colon)) { in StashAwayMethodOrFunctionBodyTokens()
1939 Toks.push_back(Tok); in StashAwayMethodOrFunctionBodyTokens()
1941 while (Tok.isNot(tok::l_brace)) { in StashAwayMethodOrFunctionBodyTokens()
1946 Toks.push_back(Tok); // also store '{' in StashAwayMethodOrFunctionBodyTokens()
1948 else if (Tok.is(tok::colon)) { in StashAwayMethodOrFunctionBodyTokens()
1950 while (Tok.isNot(tok::l_brace)) { in StashAwayMethodOrFunctionBodyTokens()
1954 Toks.push_back(Tok); // also store '{' in StashAwayMethodOrFunctionBodyTokens()
1959 while (Tok.is(tok::kw_catch)) { in StashAwayMethodOrFunctionBodyTokens()
1970 PrettyDeclStackTraceEntry CrashInfo(Actions, MDecl, Tok.getLocation(), in ParseObjCMethodDefinition()
1974 if (Tok.is(tok::semi)) { in ParseObjCMethodDefinition()
1976 Diag(Tok, diag::warn_semicolon_before_method_body) in ParseObjCMethodDefinition()
1977 << FixItHint::CreateRemoval(Tok.getLocation()); in ParseObjCMethodDefinition()
1983 if (Tok.isNot(tok::l_brace)) { in ParseObjCMethodDefinition()
1984 Diag(Tok, diag::err_expected_method_body); in ParseObjCMethodDefinition()
1990 if (Tok.isNot(tok::l_brace)) in ParseObjCMethodDefinition()
2010 if (Tok.is(tok::code_completion)) { in ParseObjCAtStatement()
2016 if (Tok.isObjCAtKeyword(tok::objc_try)) in ParseObjCAtStatement()
2019 if (Tok.isObjCAtKeyword(tok::objc_throw)) in ParseObjCAtStatement()
2022 if (Tok.isObjCAtKeyword(tok::objc_synchronized)) in ParseObjCAtStatement()
2025 if (Tok.isObjCAtKeyword(tok::objc_autoreleasepool)) in ParseObjCAtStatement()
2028 if (Tok.isObjCAtKeyword(tok::objc_import) && in ParseObjCAtStatement()
2031 return Actions.ActOnNullStmt(Tok.getLocation()); in ParseObjCAtStatement()
2049 switch (Tok.getKind()) { in ParseObjCAtExpression()
2057 tok::TokenKind Kind = Tok.getKind(); in ParseObjCAtExpression()
2060 if (!Tok.is(tok::numeric_constant)) { in ParseObjCAtExpression()
2067 Diag(Tok, diag::err_nsnumber_nonliteral_unary) in ParseObjCAtExpression()
2072 ExprResult Lit(Actions.ActOnNumericConstant(Tok)); in ParseObjCAtExpression()
2116 if (Tok.getIdentifierInfo() == nullptr) in ParseObjCAtExpression()
2119 switch (Tok.getIdentifierInfo()->getObjCKeywordID()) { in ParseObjCAtExpression()
2129 char ch = Tok.getIdentifierInfo()->getNameStart()[0]; in ParseObjCAtExpression()
2136 SourceLocation kwLoc = Tok.getLocation(); in ParseObjCAtExpression()
2172 if (Tok.is(tok::identifier) || Tok.is(tok::coloncolon) || in ParseObjCXXMessageReceiver()
2173 Tok.is(tok::kw_typename) || Tok.is(tok::annot_cxxscope)) in ParseObjCXXMessageReceiver()
2176 if (!Actions.isSimpleTypeSpecifier(Tok.getKind())) { in ParseObjCXXMessageReceiver()
2198 if (Tok.is(tok::l_paren)) { in ParseObjCXXMessageReceiver()
2243 assert(Tok.is(tok::l_square) && getLangOpts().ObjC1 && in isSimpleObjCMessageExpression()
2257 if (Tok.is(tok::annot_typename)) in isStartOfObjCClassMessageMissingOpenBracket()
2258 Type = getTypeAnnotation(Tok); in isStartOfObjCClassMessageMissingOpenBracket()
2259 else if (Tok.is(tok::identifier)) in isStartOfObjCClassMessageMissingOpenBracket()
2260 Type = Actions.getTypeName(*Tok.getIdentifierInfo(), Tok.getLocation(), in isStartOfObjCClassMessageMissingOpenBracket()
2268 if (Tok.is(tok::identifier)) in isStartOfObjCClassMessageMissingOpenBracket()
2271 return Tok.is(tok::annot_typename); in isStartOfObjCClassMessageMissingOpenBracket()
2288 assert(Tok.is(tok::l_square) && "'[' expected"); in ParseObjCMessageExpression()
2291 if (Tok.is(tok::code_completion)) { in ParseObjCMessageExpression()
2306 if (Tok.is(tok::identifier) && Tok.getIdentifierInfo() == Ident_super && in ParseObjCMessageExpression()
2329 if (Tok.is(tok::identifier)) { in ParseObjCMessageExpression()
2330 IdentifierInfo *Name = Tok.getIdentifierInfo(); in ParseObjCMessageExpression()
2331 SourceLocation NameLoc = Tok.getLocation(); in ParseObjCMessageExpression()
2414 if (Tok.is(tok::code_completion)) { in ParseObjCMessageExpressionBody()
2436 if (Tok.is(tok::colon)) { in ParseObjCMessageExpressionBody()
2452 if (Tok.is(tok::code_completion)) { in ParseObjCMessageExpressionBody()
2471 if (getLangOpts().CPlusPlus11 && Tok.is(tok::l_brace)) { in ParseObjCMessageExpressionBody()
2472 Diag(Tok, diag::warn_cxx98_compat_generalized_initializer_lists); in ParseObjCMessageExpressionBody()
2490 if (Tok.is(tok::code_completion)) { in ParseObjCMessageExpressionBody()
2509 if (!selIdent && Tok.isNot(tok::colon)) in ParseObjCMessageExpressionBody()
2514 while (Tok.is(tok::comma)) { in ParseObjCMessageExpressionBody()
2518 if (Tok.is(tok::colon)) in ParseObjCMessageExpressionBody()
2521 if (Tok.is(tok::colon)) { in ParseObjCMessageExpressionBody()
2536 Diag(Tok, diag::err_expected) << tok::identifier; // missing selector name. in ParseObjCMessageExpressionBody()
2545 if (Tok.isNot(tok::r_square)) { in ParseObjCMessageExpressionBody()
2546 Diag(Tok, diag::err_expected) in ParseObjCMessageExpressionBody()
2547 << (Tok.is(tok::identifier) ? tok::colon : tok::r_square); in ParseObjCMessageExpressionBody()
2586 while (Tok.is(tok::at)) { in ParseObjCStringLiteral()
2591 return ExprError(Diag(Tok, diag::err_objc_concat_string)); in ParseObjCStringLiteral()
2619 ExprResult Lit(Actions.ActOnCharacterConstant(Tok)); in ParseObjCCharacterLiteral()
2633 ExprResult Lit(Actions.ActOnNumericConstant(Tok)); in ParseObjCNumericLiteral()
2646 if (Tok.isNot(tok::l_paren)) in ParseObjCBoxedExpr()
2647 return ExprError(Diag(Tok, diag::err_expected_lparen_after) << "@"); in ParseObjCBoxedExpr()
2670 while (Tok.isNot(tok::r_square)) { in ParseObjCArrayLiteral()
2682 if (Tok.is(tok::ellipsis)) in ParseObjCArrayLiteral()
2689 if (Tok.is(tok::comma)) in ParseObjCArrayLiteral()
2691 else if (Tok.isNot(tok::r_square)) in ParseObjCArrayLiteral()
2692 return ExprError(Diag(Tok, diag::err_expected_either) << tok::r_square in ParseObjCArrayLiteral()
2703 while (Tok.isNot(tok::r_brace)) { in ParseObjCDictionaryLiteral()
2744 if (!TryConsumeToken(tok::comma) && Tok.isNot(tok::r_brace)) in ParseObjCDictionaryLiteral()
2745 return ExprError(Diag(Tok, diag::err_expected_either) << tok::r_brace in ParseObjCDictionaryLiteral()
2759 assert(Tok.isObjCAtKeyword(tok::objc_encode) && "Not an @encode expression!"); in ParseObjCEncodeExpression()
2763 if (Tok.isNot(tok::l_paren)) in ParseObjCEncodeExpression()
2764 return ExprError(Diag(Tok, diag::err_expected_lparen_after) << "@encode"); in ParseObjCEncodeExpression()
2786 if (Tok.isNot(tok::l_paren)) in ParseObjCProtocolExpression()
2787 return ExprError(Diag(Tok, diag::err_expected_lparen_after) << "@protocol"); in ParseObjCProtocolExpression()
2792 if (Tok.isNot(tok::identifier)) in ParseObjCProtocolExpression()
2793 return ExprError(Diag(Tok, diag::err_expected) << tok::identifier); in ParseObjCProtocolExpression()
2795 IdentifierInfo *protocolId = Tok.getIdentifierInfo(); in ParseObjCProtocolExpression()
2810 if (Tok.isNot(tok::l_paren)) in ParseObjCSelectorExpression()
2811 return ExprError(Diag(Tok, diag::err_expected_lparen_after) << "@selector"); in ParseObjCSelectorExpression()
2818 bool HasOptionalParen = Tok.is(tok::l_paren); in ParseObjCSelectorExpression()
2822 if (Tok.is(tok::code_completion)) { in ParseObjCSelectorExpression()
2830 Tok.isNot(tok::colon) && Tok.isNot(tok::coloncolon)) in ParseObjCSelectorExpression()
2831 return ExprError(Diag(Tok, diag::err_expected) << tok::identifier); in ParseObjCSelectorExpression()
2836 if (Tok.isNot(tok::r_paren)) { in ParseObjCSelectorExpression()
2845 if (Tok.is(tok::r_paren)) in ParseObjCSelectorExpression()
2848 if (Tok.is(tok::code_completion)) { in ParseObjCSelectorExpression()
2858 if (!SelIdent && Tok.isNot(tok::colon) && Tok.isNot(tok::coloncolon)) in ParseObjCSelectorExpression()
2862 if (HasOptionalParen && Tok.is(tok::r_paren)) in ParseObjCSelectorExpression()
2882 SourceLocation OrigLoc = Tok.getLocation(); in ParseLexedObjCMethodDefs()
2887 LM.Toks.push_back(Tok); in ParseLexedObjCMethodDefs()
2893 assert((Tok.is(tok::l_brace) || Tok.is(tok::kw_try) || in ParseLexedObjCMethodDefs()
2894 Tok.is(tok::colon)) && in ParseLexedObjCMethodDefs()
2908 if (Tok.is(tok::kw_try)) in ParseLexedObjCMethodDefs()
2911 if (Tok.is(tok::colon)) in ParseLexedObjCMethodDefs()
2916 if (Tok.getLocation() != OrigLoc) { in ParseLexedObjCMethodDefs()
2922 if (PP.getSourceManager().isBeforeInTranslationUnit(Tok.getLocation(), in ParseLexedObjCMethodDefs()
2924 while (Tok.getLocation() != OrigLoc && Tok.isNot(tok::eof)) in ParseLexedObjCMethodDefs()