Lines Matching refs:tok
27 void Parser::MaybeSkipAttributes(tok::ObjCKeywordKind Kind) { in MaybeSkipAttributes()
29 if (Tok.is(tok::kw___attribute)) { in MaybeSkipAttributes()
30 if (Kind == tok::objc_interface || Kind == tok::objc_protocol) in MaybeSkipAttributes()
32 << (Kind == tok::objc_protocol); in MaybeSkipAttributes()
50 if (Tok.is(tok::code_completion)) { in ParseObjCAtDirectives()
58 case tok::objc_class: in ParseObjCAtDirectives()
60 case tok::objc_interface: { in ParseObjCAtDirectives()
65 case tok::objc_protocol: { in ParseObjCAtDirectives()
69 case tok::objc_implementation: in ParseObjCAtDirectives()
71 case tok::objc_end: in ParseObjCAtDirectives()
73 case tok::objc_compatibility_alias: in ParseObjCAtDirectives()
76 case tok::objc_synthesize: in ParseObjCAtDirectives()
79 case tok::objc_dynamic: in ParseObjCAtDirectives()
82 case tok::objc_import: in ParseObjCAtDirectives()
86 SkipUntil(tok::semi); in ParseObjCAtDirectives()
90 SkipUntil(tok::semi); in ParseObjCAtDirectives()
134 MaybeSkipAttributes(tok::objc_class); in ParseObjCAtClassDeclaration()
135 if (Tok.isNot(tok::identifier)) { in ParseObjCAtClassDeclaration()
136 Diag(Tok, diag::err_expected) << tok::identifier; in ParseObjCAtClassDeclaration()
137 SkipUntil(tok::semi); in ParseObjCAtClassDeclaration()
146 if (Tok.is(tok::less)) in ParseObjCAtClassDeclaration()
149 if (!TryConsumeToken(tok::comma)) in ParseObjCAtClassDeclaration()
154 if (ExpectAndConsume(tok::semi, diag::err_expected_after, "@class")) in ParseObjCAtClassDeclaration()
213 assert(Tok.isObjCAtKeyword(tok::objc_interface) && in ParseObjCAtInterfaceDeclaration()
219 if (Tok.is(tok::code_completion)) { in ParseObjCAtInterfaceDeclaration()
225 MaybeSkipAttributes(tok::objc_interface); in ParseObjCAtInterfaceDeclaration()
227 if (Tok.isNot(tok::identifier)) { in ParseObjCAtInterfaceDeclaration()
229 << tok::identifier; // missing class or category name. in ParseObjCAtInterfaceDeclaration()
244 if (Tok.is(tok::less)) in ParseObjCAtInterfaceDeclaration()
248 if (Tok.is(tok::l_paren) && in ParseObjCAtInterfaceDeclaration()
251 BalancedDelimiterTracker T(*this, tok::l_paren); in ParseObjCAtInterfaceDeclaration()
256 if (Tok.is(tok::code_completion)) { in ParseObjCAtInterfaceDeclaration()
263 if (Tok.is(tok::identifier)) { in ParseObjCAtInterfaceDeclaration()
269 << tok::identifier; // missing category name. in ParseObjCAtInterfaceDeclaration()
286 if (Tok.is(tok::less) && in ParseObjCAtInterfaceDeclaration()
302 if (Tok.is(tok::l_brace)) in ParseObjCAtInterfaceDeclaration()
303 ParseObjCClassInstanceVariables(CategoryType, tok::objc_private, AtLoc); in ParseObjCAtInterfaceDeclaration()
305 ParseObjCInterfaceDeclList(tok::objc_not_keyword, CategoryType); in ParseObjCAtInterfaceDeclaration()
317 if (Tok.is(tok::colon)) { // a super class is specified. in ParseObjCAtInterfaceDeclaration()
321 if (Tok.is(tok::code_completion)) { in ParseObjCAtInterfaceDeclaration()
327 if (Tok.isNot(tok::identifier)) { in ParseObjCAtInterfaceDeclaration()
329 << tok::identifier; // missing super class name. in ParseObjCAtInterfaceDeclaration()
336 if (Tok.is(tok::less)) { in ParseObjCAtInterfaceDeclaration()
362 } else if (protocols.empty() && Tok.is(tok::less) && in ParseObjCAtInterfaceDeclaration()
369 if (Tok.isNot(tok::less)) in ParseObjCAtInterfaceDeclaration()
383 if (Tok.is(tok::l_brace)) in ParseObjCAtInterfaceDeclaration()
384 ParseObjCClassInstanceVariables(ClsType, tok::objc_protected, AtLoc); in ParseObjCAtInterfaceDeclaration()
386 ParseObjCInterfaceDeclList(tok::objc_interface, ClsType); in ParseObjCAtInterfaceDeclaration()
450 assert(Tok.is(tok::less) && "Not at the beginning of a type parameter list"); in parseObjCTypeParamListOrProtocolRefs()
485 if (Tok.is(tok::kw___covariant) || Tok.is(tok::kw___contravariant)) { in parseObjCTypeParamListOrProtocolRefs()
486 variance = Tok.is(tok::kw___covariant) in parseObjCTypeParamListOrProtocolRefs()
501 if (!Tok.is(tok::identifier)) { in parseObjCTypeParamListOrProtocolRefs()
503 if (Tok.is(tok::code_completion)) { in parseObjCTypeParamListOrProtocolRefs()
525 if (TryConsumeToken(tok::colon, colonLoc)) { in parseObjCTypeParamListOrProtocolRefs()
558 } while (TryConsumeToken(tok::comma)); in parseObjCTypeParamListOrProtocolRefs()
562 SkipUntil(tok::greater, tok::at, StopBeforeMatch); in parseObjCTypeParamListOrProtocolRefs()
563 if (Tok.is(tok::greater)) in parseObjCTypeParamListOrProtocolRefs()
569 SkipUntil({tok::greater, tok::greaterequal, tok::at, tok::minus, in parseObjCTypeParamListOrProtocolRefs()
570 tok::minus, tok::plus, tok::colon, tok::l_paren, tok::l_brace, in parseObjCTypeParamListOrProtocolRefs()
571 tok::comma, tok::semi }, in parseObjCTypeParamListOrProtocolRefs()
573 if (Tok.is(tok::greater)) in parseObjCTypeParamListOrProtocolRefs()
582 if (Tok.isNot(tok::colon) && Tok.isNot(tok::l_paren)) { in parseObjCTypeParamListOrProtocolRefs()
633 void Parser::ParseObjCInterfaceDeclList(tok::ObjCKeywordKind contextKey, in ParseObjCInterfaceDeclList()
637 tok::ObjCKeywordKind MethodImplKind = tok::objc_not_keyword; in ParseObjCInterfaceDeclList()
643 if (Tok.isOneOf(tok::minus, tok::plus)) { in ParseObjCInterfaceDeclList()
651 SkipUntil(tok::at, StopAtSemi | StopBeforeMatch); in ParseObjCInterfaceDeclList()
652 if (Tok.is(tok::semi)) in ParseObjCInterfaceDeclList()
657 if (Tok.is(tok::l_paren)) { in ParseObjCInterfaceDeclList()
660 tok::minus, in ParseObjCInterfaceDeclList()
665 if (Tok.is(tok::semi)) { in ParseObjCInterfaceDeclList()
675 if (Tok.is(tok::code_completion)) { in ParseObjCInterfaceDeclList()
683 if (Tok.isNot(tok::at)) { in ParseObjCInterfaceDeclList()
687 if (Tok.is(tok::r_brace)) in ParseObjCInterfaceDeclList()
696 if (Tok.is(tok::code_completion)) { in ParseObjCInterfaceDeclList()
701 tok::ObjCKeywordKind DirectiveKind = Tok.getObjCKeywordID(); in ParseObjCInterfaceDeclList()
703 if (DirectiveKind == tok::objc_end) { // @end -> terminate list in ParseObjCInterfaceDeclList()
707 } else if (DirectiveKind == tok::objc_not_keyword) { in ParseObjCInterfaceDeclList()
709 SkipUntil(tok::semi); in ParseObjCInterfaceDeclList()
724 SkipUntil(tok::r_brace, tok::at, StopAtSemi); in ParseObjCInterfaceDeclList()
727 case tok::objc_implementation: in ParseObjCInterfaceDeclList()
728 case tok::objc_interface: in ParseObjCInterfaceDeclList()
736 case tok::objc_required: in ParseObjCInterfaceDeclList()
737 case tok::objc_optional: in ParseObjCInterfaceDeclList()
740 if (contextKey != tok::objc_protocol) in ParseObjCInterfaceDeclList()
746 case tok::objc_property: in ParseObjCInterfaceDeclList()
753 if (Tok.is(tok::l_paren)) { in ParseObjCInterfaceDeclList()
802 ExpectAndConsume(tok::semi, diag::err_expected_semi_decl_list); in ParseObjCInterfaceDeclList()
809 if (Tok.is(tok::code_completion)) { in ParseObjCInterfaceDeclList()
812 } else if (Tok.isObjCAtKeyword(tok::objc_end)) { in ParseObjCInterfaceDeclList()
871 assert(Tok.getKind() == tok::l_paren); in ParseObjCPropertyAttribute()
872 BalancedDelimiterTracker T(*this, tok::l_paren); in ParseObjCPropertyAttribute()
876 if (Tok.is(tok::code_completion)) { in ParseObjCPropertyAttribute()
917 if (ExpectAndConsume(tok::equal, DiagID)) { in ParseObjCPropertyAttribute()
918 SkipUntil(tok::r_paren, StopAtSemi); in ParseObjCPropertyAttribute()
922 if (Tok.is(tok::code_completion)) { in ParseObjCPropertyAttribute()
936 SkipUntil(tok::r_paren, StopAtSemi); in ParseObjCPropertyAttribute()
944 if (ExpectAndConsume(tok::colon, in ParseObjCPropertyAttribute()
946 SkipUntil(tok::r_paren, StopAtSemi); in ParseObjCPropertyAttribute()
986 SkipUntil(tok::r_paren, StopAtSemi); in ParseObjCPropertyAttribute()
990 if (Tok.isNot(tok::comma)) in ParseObjCPropertyAttribute()
1009 Decl *Parser::ParseObjCMethodPrototype(tok::ObjCKeywordKind MethodImplKind, in ParseObjCMethodPrototype()
1011 assert(Tok.isOneOf(tok::minus, tok::plus) && "expected +/-"); in ParseObjCMethodPrototype()
1013 tok::TokenKind methodType = Tok.getKind(); in ParseObjCMethodPrototype()
1035 case tok::ampamp: in ParseObjCSelectorPiece()
1036 case tok::ampequal: in ParseObjCSelectorPiece()
1037 case tok::amp: in ParseObjCSelectorPiece()
1038 case tok::pipe: in ParseObjCSelectorPiece()
1039 case tok::tilde: in ParseObjCSelectorPiece()
1040 case tok::exclaim: in ParseObjCSelectorPiece()
1041 case tok::exclaimequal: in ParseObjCSelectorPiece()
1042 case tok::pipepipe: in ParseObjCSelectorPiece()
1043 case tok::pipeequal: in ParseObjCSelectorPiece()
1044 case tok::caret: in ParseObjCSelectorPiece()
1045 case tok::caretequal: { in ParseObjCSelectorPiece()
1049 Tok.setKind(tok::identifier); in ParseObjCSelectorPiece()
1056 case tok::identifier: in ParseObjCSelectorPiece()
1057 case tok::kw_asm: in ParseObjCSelectorPiece()
1058 case tok::kw_auto: in ParseObjCSelectorPiece()
1059 case tok::kw_bool: in ParseObjCSelectorPiece()
1060 case tok::kw_break: in ParseObjCSelectorPiece()
1061 case tok::kw_case: in ParseObjCSelectorPiece()
1062 case tok::kw_catch: in ParseObjCSelectorPiece()
1063 case tok::kw_char: in ParseObjCSelectorPiece()
1064 case tok::kw_class: in ParseObjCSelectorPiece()
1065 case tok::kw_const: in ParseObjCSelectorPiece()
1066 case tok::kw_const_cast: in ParseObjCSelectorPiece()
1067 case tok::kw_continue: in ParseObjCSelectorPiece()
1068 case tok::kw_default: in ParseObjCSelectorPiece()
1069 case tok::kw_delete: in ParseObjCSelectorPiece()
1070 case tok::kw_do: in ParseObjCSelectorPiece()
1071 case tok::kw_double: in ParseObjCSelectorPiece()
1072 case tok::kw_dynamic_cast: in ParseObjCSelectorPiece()
1073 case tok::kw_else: in ParseObjCSelectorPiece()
1074 case tok::kw_enum: in ParseObjCSelectorPiece()
1075 case tok::kw_explicit: in ParseObjCSelectorPiece()
1076 case tok::kw_export: in ParseObjCSelectorPiece()
1077 case tok::kw_extern: in ParseObjCSelectorPiece()
1078 case tok::kw_false: in ParseObjCSelectorPiece()
1079 case tok::kw_float: in ParseObjCSelectorPiece()
1080 case tok::kw_for: in ParseObjCSelectorPiece()
1081 case tok::kw_friend: in ParseObjCSelectorPiece()
1082 case tok::kw_goto: in ParseObjCSelectorPiece()
1083 case tok::kw_if: in ParseObjCSelectorPiece()
1084 case tok::kw_inline: in ParseObjCSelectorPiece()
1085 case tok::kw_int: in ParseObjCSelectorPiece()
1086 case tok::kw_long: in ParseObjCSelectorPiece()
1087 case tok::kw_mutable: in ParseObjCSelectorPiece()
1088 case tok::kw_namespace: in ParseObjCSelectorPiece()
1089 case tok::kw_new: in ParseObjCSelectorPiece()
1090 case tok::kw_operator: in ParseObjCSelectorPiece()
1091 case tok::kw_private: in ParseObjCSelectorPiece()
1092 case tok::kw_protected: in ParseObjCSelectorPiece()
1093 case tok::kw_public: in ParseObjCSelectorPiece()
1094 case tok::kw_register: in ParseObjCSelectorPiece()
1095 case tok::kw_reinterpret_cast: in ParseObjCSelectorPiece()
1096 case tok::kw_restrict: in ParseObjCSelectorPiece()
1097 case tok::kw_return: in ParseObjCSelectorPiece()
1098 case tok::kw_short: in ParseObjCSelectorPiece()
1099 case tok::kw_signed: in ParseObjCSelectorPiece()
1100 case tok::kw_sizeof: in ParseObjCSelectorPiece()
1101 case tok::kw_static: in ParseObjCSelectorPiece()
1102 case tok::kw_static_cast: in ParseObjCSelectorPiece()
1103 case tok::kw_struct: in ParseObjCSelectorPiece()
1104 case tok::kw_switch: in ParseObjCSelectorPiece()
1105 case tok::kw_template: in ParseObjCSelectorPiece()
1106 case tok::kw_this: in ParseObjCSelectorPiece()
1107 case tok::kw_throw: in ParseObjCSelectorPiece()
1108 case tok::kw_true: in ParseObjCSelectorPiece()
1109 case tok::kw_try: in ParseObjCSelectorPiece()
1110 case tok::kw_typedef: in ParseObjCSelectorPiece()
1111 case tok::kw_typeid: in ParseObjCSelectorPiece()
1112 case tok::kw_typename: in ParseObjCSelectorPiece()
1113 case tok::kw_typeof: in ParseObjCSelectorPiece()
1114 case tok::kw_union: in ParseObjCSelectorPiece()
1115 case tok::kw_unsigned: in ParseObjCSelectorPiece()
1116 case tok::kw_using: in ParseObjCSelectorPiece()
1117 case tok::kw_virtual: in ParseObjCSelectorPiece()
1118 case tok::kw_void: in ParseObjCSelectorPiece()
1119 case tok::kw_volatile: in ParseObjCSelectorPiece()
1120 case tok::kw_wchar_t: in ParseObjCSelectorPiece()
1121 case tok::kw_while: in ParseObjCSelectorPiece()
1122 case tok::kw__Bool: in ParseObjCSelectorPiece()
1123 case tok::kw__Complex: in ParseObjCSelectorPiece()
1124 case tok::kw___alignof: in ParseObjCSelectorPiece()
1125 case tok::kw___auto_type: in ParseObjCSelectorPiece()
1138 return (getLangOpts().ObjC2 && Tok.is(tok::identifier) && in isTokIdentifier_in()
1167 if (Tok.is(tok::code_completion)) { in ParseObjCTypeQualifierList()
1173 if (Tok.isNot(tok::identifier)) in ParseObjCTypeQualifierList()
1179 NextToken().is(tok::less) || in ParseObjCTypeQualifierList()
1180 NextToken().is(tok::coloncolon)) in ParseObjCTypeQualifierList()
1271 assert(Tok.is(tok::l_paren) && "expected ("); in ParseObjCTypeName()
1273 BalancedDelimiterTracker T(*this, tok::l_paren); in ParseObjCTypeName()
1316 if (Tok.is(tok::r_paren)) in ParseObjCTypeName()
1321 SkipUntil(tok::r_paren, StopAtSemi); in ParseObjCTypeName()
1359 tok::TokenKind mType, in ParseObjCMethodDecl()
1360 tok::ObjCKeywordKind MethodImplKind, in ParseObjCMethodDecl()
1364 if (Tok.is(tok::code_completion)) { in ParseObjCMethodDecl()
1365 Actions.CodeCompleteObjCMethodDecl(getCurScope(), mType == tok::minus, in ParseObjCMethodDecl()
1374 if (Tok.is(tok::l_paren)) in ParseObjCMethodDecl()
1383 if (Tok.is(tok::code_completion)) { in ParseObjCMethodDecl()
1384 Actions.CodeCompleteObjCMethodDecl(getCurScope(), mType == tok::minus, in ParseObjCMethodDecl()
1395 if (!SelIdent && Tok.isNot(tok::colon)) { // missing selector name. in ParseObjCMethodDecl()
1399 SkipUntil(tok::at, StopAtSemi | StopBeforeMatch); in ParseObjCMethodDecl()
1404 if (Tok.isNot(tok::colon)) { in ParseObjCMethodDecl()
1433 if (ExpectAndConsume(tok::colon)) in ParseObjCMethodDecl()
1437 if (Tok.is(tok::l_paren)) // Parse the argument type if present. in ParseObjCMethodDecl()
1451 if (Tok.is(tok::code_completion)) { in ParseObjCMethodDecl()
1454 mType == tok::minus, in ParseObjCMethodDecl()
1461 if (Tok.isNot(tok::identifier)) { in ParseObjCMethodDecl()
1463 << tok::identifier; // missing argument name. in ParseObjCMethodDecl()
1479 if (Tok.is(tok::code_completion)) { in ParseObjCMethodDecl()
1481 mType == tok::minus, in ParseObjCMethodDecl()
1490 if (!SelIdent && Tok.isNot(tok::colon)) in ParseObjCMethodDecl()
1506 while (Tok.is(tok::comma)) { in ParseObjCMethodDecl()
1508 if (Tok.is(tok::ellipsis)) { in ParseObjCMethodDecl()
1561 assert(Tok.is(tok::less) && "expected <"); in ParseObjCProtocolReferences()
1568 if (Tok.is(tok::code_completion)) { in ParseObjCProtocolReferences()
1575 if (Tok.isNot(tok::identifier)) { in ParseObjCProtocolReferences()
1576 Diag(Tok, diag::err_expected) << tok::identifier; in ParseObjCProtocolReferences()
1577 SkipUntil(tok::greater, StopAtSemi); in ParseObjCProtocolReferences()
1585 if (!TryConsumeToken(tok::comma)) in ParseObjCProtocolReferences()
1601 assert(Tok.is(tok::less) && "Protocol qualifiers start with '<'"); in parseObjCProtocolQualifierType()
1639 assert(Tok.is(tok::less) && "Not at the start of type args or protocols"); in parseObjCTypeArgsOrProtocolQualifiers()
1652 if (Tok.is(tok::identifier) && in parseObjCTypeArgsOrProtocolQualifiers()
1653 (NextToken().is(tok::comma) || in parseObjCTypeArgsOrProtocolQualifiers()
1654 NextToken().is(tok::greater) || in parseObjCTypeArgsOrProtocolQualifiers()
1655 NextToken().is(tok::greatergreater))) { in parseObjCTypeArgsOrProtocolQualifiers()
1661 if (Tok.is(tok::code_completion)) { in parseObjCTypeArgsOrProtocolQualifiers()
1682 } while (TryConsumeToken(tok::comma)); in parseObjCTypeArgsOrProtocolQualifiers()
1742 TryConsumeToken(tok::ellipsis, ellipsisLoc); in parseObjCTypeArgsOrProtocolQualifiers()
1752 } while (TryConsumeToken(tok::comma)); in parseObjCTypeArgsOrProtocolQualifiers()
1779 assert(Tok.is(tok::less)); in parseObjCTypeArgsAndProtocolQualifiers()
1796 if ((consumeLastToken && Tok.is(tok::less)) || in parseObjCTypeArgsAndProtocolQualifiers()
1797 (!consumeLastToken && NextToken().is(tok::less))) { in parseObjCTypeArgsAndProtocolQualifiers()
1809 SkipUntil(tok::greater, tok::greatergreater, skipFlags); in parseObjCTypeArgsAndProtocolQualifiers()
1825 assert(Tok.is(tok::less)); in parseObjCTypeArgsAndProtocolQualifiers()
1897 tok::ObjCKeywordKind visibility, in ParseObjCClassInstanceVariables()
1899 assert(Tok.is(tok::l_brace) && "expected {"); in ParseObjCClassInstanceVariables()
1905 BalancedDelimiterTracker T(*this, tok::l_brace); in ParseObjCClassInstanceVariables()
1908 while (Tok.isNot(tok::r_brace) && !isEofOrEom()) { in ParseObjCClassInstanceVariables()
1912 if (Tok.is(tok::semi)) { in ParseObjCClassInstanceVariables()
1918 if (TryConsumeToken(tok::at)) { // parse objc-visibility-spec in ParseObjCClassInstanceVariables()
1919 if (Tok.is(tok::code_completion)) { in ParseObjCClassInstanceVariables()
1925 case tok::objc_private: in ParseObjCClassInstanceVariables()
1926 case tok::objc_public: in ParseObjCClassInstanceVariables()
1927 case tok::objc_protected: in ParseObjCClassInstanceVariables()
1928 case tok::objc_package: in ParseObjCClassInstanceVariables()
1933 case tok::objc_end: in ParseObjCClassInstanceVariables()
1936 Tok.setKind(tok::at); in ParseObjCClassInstanceVariables()
1949 if (Tok.is(tok::code_completion)) { in ParseObjCClassInstanceVariables()
1972 if (Tok.is(tok::semi)) { in ParseObjCClassInstanceVariables()
1977 SkipUntil(tok::r_brace, StopAtSemi | StopBeforeMatch); in ParseObjCClassInstanceVariables()
2004 assert(Tok.isObjCAtKeyword(tok::objc_protocol) && in ParseObjCAtProtocolDeclaration()
2008 if (Tok.is(tok::code_completion)) { in ParseObjCAtProtocolDeclaration()
2014 MaybeSkipAttributes(tok::objc_protocol); in ParseObjCAtProtocolDeclaration()
2016 if (Tok.isNot(tok::identifier)) { in ParseObjCAtProtocolDeclaration()
2017 Diag(Tok, diag::err_expected) << tok::identifier; // missing protocol name. in ParseObjCAtProtocolDeclaration()
2024 if (TryConsumeToken(tok::semi)) { // forward declaration of one protocol. in ParseObjCAtProtocolDeclaration()
2032 if (Tok.is(tok::comma)) { // list of forward declarations. in ParseObjCAtProtocolDeclaration()
2039 if (Tok.isNot(tok::identifier)) { in ParseObjCAtProtocolDeclaration()
2040 Diag(Tok, diag::err_expected) << tok::identifier; in ParseObjCAtProtocolDeclaration()
2041 SkipUntil(tok::semi); in ParseObjCAtProtocolDeclaration()
2048 if (Tok.isNot(tok::comma)) in ParseObjCAtProtocolDeclaration()
2052 if (ExpectAndConsume(tok::semi, diag::err_expected_after, "@protocol")) in ParseObjCAtProtocolDeclaration()
2064 if (Tok.is(tok::less) && in ParseObjCAtProtocolDeclaration()
2077 ParseObjCInterfaceDeclList(tok::objc_protocol, ProtoType); in ParseObjCAtProtocolDeclaration()
2093 assert(Tok.isObjCAtKeyword(tok::objc_implementation) && in ParseObjCAtImplementationDeclaration()
2099 if (Tok.is(tok::code_completion)) { in ParseObjCAtImplementationDeclaration()
2105 MaybeSkipAttributes(tok::objc_implementation); in ParseObjCAtImplementationDeclaration()
2107 if (Tok.isNot(tok::identifier)) { in ParseObjCAtImplementationDeclaration()
2109 << tok::identifier; // missing class or category name. in ParseObjCAtImplementationDeclaration()
2119 if (Tok.is(tok::less)) { in ParseObjCAtImplementationDeclaration()
2134 if (Tok.is(tok::l_paren)) { in ParseObjCAtImplementationDeclaration()
2140 if (Tok.is(tok::code_completion)) { in ParseObjCAtImplementationDeclaration()
2146 if (Tok.is(tok::identifier)) { in ParseObjCAtImplementationDeclaration()
2151 << tok::identifier; // missing category name. in ParseObjCAtImplementationDeclaration()
2154 if (Tok.isNot(tok::r_paren)) { in ParseObjCAtImplementationDeclaration()
2155 Diag(Tok, diag::err_expected) << tok::r_paren; in ParseObjCAtImplementationDeclaration()
2156 SkipUntil(tok::r_paren); // don't stop at ';' in ParseObjCAtImplementationDeclaration()
2160 if (Tok.is(tok::less)) { // we have illegal '<' try to recover in ParseObjCAtImplementationDeclaration()
2179 if (TryConsumeToken(tok::colon)) { in ParseObjCAtImplementationDeclaration()
2181 if (Tok.isNot(tok::identifier)) { in ParseObjCAtImplementationDeclaration()
2183 << tok::identifier; // missing super class name. in ParseObjCAtImplementationDeclaration()
2193 if (Tok.is(tok::l_brace)) // we have ivars in ParseObjCAtImplementationDeclaration()
2194 ParseObjCClassInstanceVariables(ObjCImpDecl, tok::objc_private, AtLoc); in ParseObjCAtImplementationDeclaration()
2195 else if (Tok.is(tok::less)) { // we have illegal '<' try to recover in ParseObjCAtImplementationDeclaration()
2230 assert(Tok.isObjCAtKeyword(tok::objc_end) && in ParseObjCAtEndDeclaration()
2283 assert(Tok.isObjCAtKeyword(tok::objc_compatibility_alias) && in ParseObjCAtAliasDeclaration()
2286 if (Tok.isNot(tok::identifier)) { in ParseObjCAtAliasDeclaration()
2287 Diag(Tok, diag::err_expected) << tok::identifier; in ParseObjCAtAliasDeclaration()
2292 if (Tok.isNot(tok::identifier)) { in ParseObjCAtAliasDeclaration()
2293 Diag(Tok, diag::err_expected) << tok::identifier; in ParseObjCAtAliasDeclaration()
2298 ExpectAndConsume(tok::semi, diag::err_expected_after, "@compatibility_alias"); in ParseObjCAtAliasDeclaration()
2315 assert(Tok.isObjCAtKeyword(tok::objc_synthesize) && in ParseObjCPropertySynthesize()
2320 if (Tok.is(tok::code_completion)) { in ParseObjCPropertySynthesize()
2326 if (Tok.isNot(tok::identifier)) { in ParseObjCPropertySynthesize()
2328 SkipUntil(tok::semi); in ParseObjCPropertySynthesize()
2336 if (TryConsumeToken(tok::equal)) { in ParseObjCPropertySynthesize()
2338 if (Tok.is(tok::code_completion)) { in ParseObjCPropertySynthesize()
2344 if (Tok.isNot(tok::identifier)) { in ParseObjCPropertySynthesize()
2345 Diag(Tok, diag::err_expected) << tok::identifier; in ParseObjCPropertySynthesize()
2353 if (Tok.isNot(tok::comma)) in ParseObjCPropertySynthesize()
2357 ExpectAndConsume(tok::semi, diag::err_expected_after, "@synthesize"); in ParseObjCPropertySynthesize()
2369 assert(Tok.isObjCAtKeyword(tok::objc_dynamic) && in ParseObjCPropertyDynamic()
2373 if (Tok.is(tok::code_completion)) { in ParseObjCPropertyDynamic()
2379 if (Tok.isNot(tok::identifier)) { in ParseObjCPropertyDynamic()
2380 Diag(Tok, diag::err_expected) << tok::identifier; in ParseObjCPropertyDynamic()
2381 SkipUntil(tok::semi); in ParseObjCPropertyDynamic()
2390 if (Tok.isNot(tok::comma)) in ParseObjCPropertyDynamic()
2394 ExpectAndConsume(tok::semi, diag::err_expected_after, "@dynamic"); in ParseObjCPropertyDynamic()
2404 if (Tok.isNot(tok::semi)) { in ParseObjCThrowStmt()
2407 SkipUntil(tok::semi); in ParseObjCThrowStmt()
2412 ExpectAndConsume(tok::semi, diag::err_expected_after, "@throw"); in ParseObjCThrowStmt()
2422 if (Tok.isNot(tok::l_paren)) { in ParseObjCSynchronizedStmt()
2431 if (Tok.is(tok::r_paren)) { in ParseObjCSynchronizedStmt()
2435 Diag(Tok, diag::err_expected) << tok::r_paren; in ParseObjCSynchronizedStmt()
2438 SkipUntil(tok::l_brace, StopAtSemi | StopBeforeMatch); in ParseObjCSynchronizedStmt()
2442 if (Tok.isNot(tok::l_brace)) { in ParseObjCSynchronizedStmt()
2444 Diag(Tok, diag::err_expected) << tok::l_brace; in ParseObjCSynchronizedStmt()
2483 if (Tok.isNot(tok::l_brace)) { in ParseObjCTryStmt()
2484 Diag(Tok, diag::err_expected) << tok::l_brace; in ParseObjCTryStmt()
2495 while (Tok.is(tok::at)) { in ParseObjCTryStmt()
2500 if (!AfterAt.isObjCAtKeyword(tok::objc_catch) && in ParseObjCTryStmt()
2501 !AfterAt.isObjCAtKeyword(tok::objc_finally)) in ParseObjCTryStmt()
2505 if (Tok.isObjCAtKeyword(tok::objc_catch)) { in ParseObjCTryStmt()
2508 if (Tok.is(tok::l_paren)) { in ParseObjCTryStmt()
2511 if (Tok.isNot(tok::ellipsis)) { in ParseObjCTryStmt()
2525 if (Tok.is(tok::r_paren)) in ParseObjCTryStmt()
2528 SkipUntil(tok::r_paren, StopAtSemi); in ParseObjCTryStmt()
2531 if (Tok.is(tok::l_brace)) in ParseObjCTryStmt()
2534 Diag(Tok, diag::err_expected) << tok::l_brace; in ParseObjCTryStmt()
2552 assert(Tok.isObjCAtKeyword(tok::objc_finally) && "Lookahead confused?"); in ParseObjCTryStmt()
2557 if (Tok.is(tok::l_brace)) in ParseObjCTryStmt()
2560 Diag(Tok, diag::err_expected) << tok::l_brace; in ParseObjCTryStmt()
2585 if (Tok.isNot(tok::l_brace)) { in ParseObjCAutoreleasePoolStmt()
2586 Diag(Tok, diag::err_expected) << tok::l_brace; in ParseObjCAutoreleasePoolStmt()
2610 if (Tok.is(tok::kw_try)) { in StashAwayMethodOrFunctionBodyTokens()
2612 if (Tok.is(tok::colon)) { in StashAwayMethodOrFunctionBodyTokens()
2615 while (Tok.isNot(tok::l_brace)) { in StashAwayMethodOrFunctionBodyTokens()
2616 ConsumeAndStoreUntil(tok::l_paren, Toks, /*StopAtSemi=*/false); in StashAwayMethodOrFunctionBodyTokens()
2617 ConsumeAndStoreUntil(tok::r_paren, Toks, /*StopAtSemi=*/false); in StashAwayMethodOrFunctionBodyTokens()
2622 else if (Tok.is(tok::colon)) { in StashAwayMethodOrFunctionBodyTokens()
2625 while (Tok.isNot(tok::l_brace)) { in StashAwayMethodOrFunctionBodyTokens()
2626 ConsumeAndStoreUntil(tok::l_paren, Toks, /*StopAtSemi=*/false); in StashAwayMethodOrFunctionBodyTokens()
2627 ConsumeAndStoreUntil(tok::r_paren, Toks, /*StopAtSemi=*/false); in StashAwayMethodOrFunctionBodyTokens()
2633 ConsumeAndStoreUntil(tok::r_brace, Toks, /*StopAtSemi=*/false); in StashAwayMethodOrFunctionBodyTokens()
2634 while (Tok.is(tok::kw_catch)) { in StashAwayMethodOrFunctionBodyTokens()
2635 ConsumeAndStoreUntil(tok::l_brace, Toks, /*StopAtSemi=*/false); in StashAwayMethodOrFunctionBodyTokens()
2636 ConsumeAndStoreUntil(tok::r_brace, Toks, /*StopAtSemi=*/false); in StashAwayMethodOrFunctionBodyTokens()
2649 if (Tok.is(tok::semi)) { in ParseObjCMethodDefinition()
2658 if (Tok.isNot(tok::l_brace)) { in ParseObjCMethodDefinition()
2662 SkipUntil(tok::l_brace, StopAtSemi | StopBeforeMatch); in ParseObjCMethodDefinition()
2665 if (Tok.isNot(tok::l_brace)) in ParseObjCMethodDefinition()
2671 SkipUntil(tok::r_brace); in ParseObjCMethodDefinition()
2685 if (Tok.is(tok::code_completion)) { in ParseObjCAtStatement()
2691 if (Tok.isObjCAtKeyword(tok::objc_try)) in ParseObjCAtStatement()
2694 if (Tok.isObjCAtKeyword(tok::objc_throw)) in ParseObjCAtStatement()
2697 if (Tok.isObjCAtKeyword(tok::objc_synchronized)) in ParseObjCAtStatement()
2700 if (Tok.isObjCAtKeyword(tok::objc_autoreleasepool)) in ParseObjCAtStatement()
2703 if (Tok.isObjCAtKeyword(tok::objc_import) && in ParseObjCAtStatement()
2705 SkipUntil(tok::semi); in ParseObjCAtStatement()
2714 SkipUntil(tok::semi); in ParseObjCAtStatement()
2725 case tok::code_completion: in ParseObjCAtExpression()
2730 case tok::minus: in ParseObjCAtExpression()
2731 case tok::plus: { in ParseObjCAtExpression()
2732 tok::TokenKind Kind = Tok.getKind(); in ParseObjCAtExpression()
2735 if (!Tok.is(tok::numeric_constant)) { in ParseObjCAtExpression()
2738 case tok::minus: Symbol = "-"; break; in ParseObjCAtExpression()
2739 case tok::plus: Symbol = "+"; break; in ParseObjCAtExpression()
2761 case tok::string_literal: // primary-expression: string-literal in ParseObjCAtExpression()
2762 case tok::wide_string_literal: in ParseObjCAtExpression()
2765 case tok::char_constant: in ParseObjCAtExpression()
2768 case tok::numeric_constant: in ParseObjCAtExpression()
2771 case tok::kw_true: // Objective-C++, etc. in ParseObjCAtExpression()
2772 case tok::kw___objc_yes: // c/c++/objc/objc++ __objc_yes in ParseObjCAtExpression()
2774 case tok::kw_false: // Objective-C++, etc. in ParseObjCAtExpression()
2775 case tok::kw___objc_no: // c/c++/objc/objc++ __objc_no in ParseObjCAtExpression()
2778 case tok::l_square: in ParseObjCAtExpression()
2782 case tok::l_brace: in ParseObjCAtExpression()
2786 case tok::l_paren: in ParseObjCAtExpression()
2795 case tok::objc_encode: in ParseObjCAtExpression()
2797 case tok::objc_protocol: in ParseObjCAtExpression()
2799 case tok::objc_selector: in ParseObjCAtExpression()
2803 if (GetLookAheadToken(1).is(tok::l_brace)) { in ParseObjCAtExpression()
2847 if (Tok.isOneOf(tok::identifier, tok::coloncolon, tok::kw_typename, in ParseObjCXXMessageReceiver()
2848 tok::annot_cxxscope)) in ParseObjCXXMessageReceiver()
2873 if (Tok.is(tok::l_paren)) { in ParseObjCXXMessageReceiver()
2918 assert(Tok.is(tok::l_square) && getLangOpts().ObjC1 && in isSimpleObjCMessageExpression()
2920 return GetLookAheadToken(1).is(tok::identifier) && in isSimpleObjCMessageExpression()
2921 GetLookAheadToken(2).is(tok::identifier); in isSimpleObjCMessageExpression()
2925 if (!getLangOpts().ObjC1 || !NextToken().is(tok::identifier) || in isStartOfObjCClassMessageMissingOpenBracket()
2932 if (Tok.is(tok::annot_typename)) in isStartOfObjCClassMessageMissingOpenBracket()
2934 else if (Tok.is(tok::identifier)) in isStartOfObjCClassMessageMissingOpenBracket()
2942 if (AfterNext.isOneOf(tok::colon, tok::r_square)) { in isStartOfObjCClassMessageMissingOpenBracket()
2943 if (Tok.is(tok::identifier)) in isStartOfObjCClassMessageMissingOpenBracket()
2946 return Tok.is(tok::annot_typename); in isStartOfObjCClassMessageMissingOpenBracket()
2963 assert(Tok.is(tok::l_square) && "'[' expected"); in ParseObjCMessageExpression()
2966 if (Tok.is(tok::code_completion)) { in ParseObjCMessageExpression()
2981 if (Tok.is(tok::identifier) && Tok.getIdentifierInfo() == Ident_super && in ParseObjCMessageExpression()
2982 NextToken().isNot(tok::period) && getCurScope()->isInObjcMethodScope()) in ParseObjCMessageExpression()
2990 SkipUntil(tok::r_square, StopAtSemi); in ParseObjCMessageExpression()
3004 if (Tok.is(tok::identifier)) { in ParseObjCMessageExpression()
3010 NextToken().is(tok::period), in ParseObjCMessageExpression()
3018 SkipUntil(tok::r_square, StopAtSemi); in ParseObjCMessageExpression()
3025 if (Tok.is(tok::less)) { in ParseObjCMessageExpression()
3032 SkipUntil(tok::r_square, StopAtSemi); in ParseObjCMessageExpression()
3051 SkipUntil(tok::r_square, StopAtSemi); in ParseObjCMessageExpression()
3104 if (Tok.is(tok::code_completion)) { in ParseObjCMessageExpressionBody()
3126 if (Tok.is(tok::colon)) { in ParseObjCMessageExpressionBody()
3132 if (ExpectAndConsume(tok::colon)) { in ParseObjCMessageExpressionBody()
3136 SkipUntil(tok::r_square, StopAtSemi); in ParseObjCMessageExpressionBody()
3142 if (Tok.is(tok::code_completion)) { in ParseObjCMessageExpressionBody()
3161 if (getLangOpts().CPlusPlus11 && Tok.is(tok::l_brace)) { in ParseObjCMessageExpressionBody()
3172 SkipUntil(tok::r_square, StopAtSemi); in ParseObjCMessageExpressionBody()
3180 if (Tok.is(tok::code_completion)) { in ParseObjCMessageExpressionBody()
3199 if (!selIdent && Tok.isNot(tok::colon)) in ParseObjCMessageExpressionBody()
3204 while (Tok.is(tok::comma)) { in ParseObjCMessageExpressionBody()
3208 if (Tok.is(tok::colon)) in ParseObjCMessageExpressionBody()
3211 if (Tok.is(tok::colon)) { in ParseObjCMessageExpressionBody()
3218 SkipUntil(tok::r_square, StopAtSemi); in ParseObjCMessageExpressionBody()
3226 Diag(Tok, diag::err_expected) << tok::identifier; // missing selector name. in ParseObjCMessageExpressionBody()
3231 SkipUntil(tok::r_square, StopAtSemi); in ParseObjCMessageExpressionBody()
3235 if (Tok.isNot(tok::r_square)) { in ParseObjCMessageExpressionBody()
3237 << (Tok.is(tok::identifier) ? tok::colon : tok::r_square); in ParseObjCMessageExpressionBody()
3241 SkipUntil(tok::r_square, StopAtSemi); in ParseObjCMessageExpressionBody()
3276 while (Tok.is(tok::at)) { in ParseObjCStringLiteral()
3336 if (Tok.isNot(tok::l_paren)) in ParseObjCBoxedExpr()
3339 BalancedDelimiterTracker T(*this, tok::l_paren); in ParseObjCBoxedExpr()
3360 while (Tok.isNot(tok::r_square)) { in ParseObjCArrayLiteral()
3367 SkipUntil(tok::r_square, StopAtSemi); in ParseObjCArrayLiteral()
3372 if (Tok.is(tok::ellipsis)) in ParseObjCArrayLiteral()
3379 if (Tok.is(tok::comma)) in ParseObjCArrayLiteral()
3381 else if (Tok.isNot(tok::r_square)) in ParseObjCArrayLiteral()
3382 return ExprError(Diag(Tok, diag::err_expected_either) << tok::r_square in ParseObjCArrayLiteral()
3383 << tok::comma); in ParseObjCArrayLiteral()
3393 while (Tok.isNot(tok::r_brace)) { in ParseObjCDictionaryLiteral()
3403 SkipUntil(tok::r_brace, StopAtSemi); in ParseObjCDictionaryLiteral()
3408 if (ExpectAndConsume(tok::colon)) { in ParseObjCDictionaryLiteral()
3409 SkipUntil(tok::r_brace, StopAtSemi); in ParseObjCDictionaryLiteral()
3418 SkipUntil(tok::r_brace, StopAtSemi); in ParseObjCDictionaryLiteral()
3425 TryConsumeToken(tok::ellipsis, EllipsisLoc); in ParseObjCDictionaryLiteral()
3434 if (!TryConsumeToken(tok::comma) && Tok.isNot(tok::r_brace)) in ParseObjCDictionaryLiteral()
3435 return ExprError(Diag(Tok, diag::err_expected_either) << tok::r_brace in ParseObjCDictionaryLiteral()
3436 << tok::comma); in ParseObjCDictionaryLiteral()
3449 assert(Tok.isObjCAtKeyword(tok::objc_encode) && "Not an @encode expression!"); in ParseObjCEncodeExpression()
3453 if (Tok.isNot(tok::l_paren)) in ParseObjCEncodeExpression()
3456 BalancedDelimiterTracker T(*this, tok::l_paren); in ParseObjCEncodeExpression()
3476 if (Tok.isNot(tok::l_paren)) in ParseObjCProtocolExpression()
3479 BalancedDelimiterTracker T(*this, tok::l_paren); in ParseObjCProtocolExpression()
3482 if (Tok.isNot(tok::identifier)) in ParseObjCProtocolExpression()
3483 return ExprError(Diag(Tok, diag::err_expected) << tok::identifier); in ParseObjCProtocolExpression()
3500 if (Tok.isNot(tok::l_paren)) in ParseObjCSelectorExpression()
3506 BalancedDelimiterTracker T(*this, tok::l_paren); in ParseObjCSelectorExpression()
3508 bool HasOptionalParen = Tok.is(tok::l_paren); in ParseObjCSelectorExpression()
3512 if (Tok.is(tok::code_completion)) { in ParseObjCSelectorExpression()
3520 Tok.isNot(tok::colon) && Tok.isNot(tok::coloncolon)) in ParseObjCSelectorExpression()
3521 return ExprError(Diag(Tok, diag::err_expected) << tok::identifier); in ParseObjCSelectorExpression()
3526 if (Tok.isNot(tok::r_paren)) { in ParseObjCSelectorExpression()
3528 if (TryConsumeToken(tok::coloncolon)) { // Handle :: in C++. in ParseObjCSelectorExpression()
3531 } else if (ExpectAndConsume(tok::colon)) // Otherwise expect ':'. in ParseObjCSelectorExpression()
3535 if (Tok.is(tok::r_paren)) in ParseObjCSelectorExpression()
3538 if (Tok.is(tok::code_completion)) { in ParseObjCSelectorExpression()
3548 if (!SelIdent && Tok.isNot(tok::colon) && Tok.isNot(tok::coloncolon)) in ParseObjCSelectorExpression()
3552 if (HasOptionalParen && Tok.is(tok::r_paren)) in ParseObjCSelectorExpression()
3583 assert(Tok.isOneOf(tok::l_brace, tok::kw_try, tok::colon) && in ParseLexedObjCMethodDefs()
3597 if (Tok.is(tok::kw_try)) in ParseLexedObjCMethodDefs()
3600 if (Tok.is(tok::colon)) in ParseLexedObjCMethodDefs()
3613 while (Tok.getLocation() != OrigLoc && Tok.isNot(tok::eof)) in ParseLexedObjCMethodDefs()