/external/bcc/src/cc/frontends/b/ |
D | lexer.ll | 36 return Tok::TSTRING; 44 \n { if (next_line()) { return save(Tok::TSEMI, true); } } 45 "//".*\n { if (next_line()) { return save(Tok::TSEMI, true); } } 46 ^"#" return save(Tok::TPRAGMA); 47 "=" return save(Tok::TEQUAL); 48 "==" return save(Tok::TCEQ); 49 "!=" return save(Tok::TCNE); 50 "<" return save(Tok::TCLT); 51 "<=" return save(Tok::TCLE); 52 ">" return save(Tok::TCGT); [all …]
|
/external/llvm-project/clang/lib/Parse/ |
D | ParsePragma.cpp | 105 Token &Tok) override { in HandlePragma() 106 Token PragmaName = Tok; in HandlePragma() 108 PP.Diag(Tok.getLocation(), diag::warn_pragma_fp_ignored) in HandlePragma() 120 Toks[0].setLocation(Tok.getLocation()); in HandlePragma() 121 Toks[0].setAnnotationEndLoc(Tok.getLocation()); in HandlePragma() 134 Token &Tok) override { in HandlePragma() 145 Token &Tok) override; 550 assert(Tok.is(tok::annot_pragma_unused)); in HandlePragmaUnused() 552 Actions.ActOnPragmaUnused(Tok, getCurScope(), UnusedLoc); in HandlePragmaUnused() 557 assert(Tok.is(tok::annot_pragma_vis)); in HandlePragmaVisibility() [all …]
|
D | Parser.cpp | 57 Tok.startToken(); in Parser() 58 Tok.setKind(tok::eof); in Parser() 77 DiagnosticBuilder Parser::Diag(const Token &Tok, unsigned DiagID) { in Diag() argument 78 return Diag(Tok.getLocation(), DiagID); in Diag() 102 static bool IsCommonTypo(tok::TokenKind ExpectedTok, const Token &Tok) { in IsCommonTypo() argument 105 return Tok.is(tok::colon) || Tok.is(tok::comma); // : or , for ; in IsCommonTypo() 112 if (Tok.is(ExpectedTok) || Tok.is(tok::code_completion)) { in ExpectAndConsume() 118 if (IsCommonTypo(ExpectedTok, Tok)) { in ExpectAndConsume() 119 SourceLocation Loc = Tok.getLocation(); in ExpectAndConsume() 145 : Diag(Tok, DiagID); in ExpectAndConsume() [all …]
|
D | ParseCXXInlineMethods.cpp | 29 assert(Tok.isOneOf(tok::l_brace, tok::colon, tok::kw_try, tok::equal) && in ParseCXXInlineMethodDef() 65 SourceLocation KWEndLoc = Tok.getEndLoc().getLocWithOffset(-1); in ParseCXXInlineMethodDef() 89 if (Tok.is(tok::comma)) { in ParseCXXInlineMethodDef() 138 tok::TokenKind kind = Tok.getKind(); in ParseCXXInlineMethodDef() 158 while (Tok.is(tok::kw_catch)) { in ParseCXXInlineMethodDef() 185 assert(Tok.isOneOf(tok::l_brace, tok::equal) && in ParseCXXNonStaticMemberInitializer() 193 tok::TokenKind kind = Tok.getKind(); in ParseCXXNonStaticMemberInitializer() 195 Toks.push_back(Tok); in ParseCXXNonStaticMemberInitializer() 201 Toks.push_back(Tok); in ParseCXXNonStaticMemberInitializer() 216 Eof.setLocation(Tok.getLocation()); in ParseCXXNonStaticMemberInitializer() [all …]
|
D | ParseObjc.cpp | 30 if (Tok.is(tok::kw___attribute)) { in MaybeSkipAttributes() 32 Diag(Tok, diag::err_objc_postfix_attribute_hint) in MaybeSkipAttributes() 35 Diag(Tok, diag::err_objc_postfix_attribute); in MaybeSkipAttributes() 52 if (Tok.is(tok::code_completion)) { in ParseObjCAtDirectives() 59 switch (Tok.getObjCKeywordID()) { in ParseObjCAtDirectives() 143 ClassNames.push_back(Tok.getIdentifierInfo()); in ParseObjCAtClassDeclaration() 144 ClassLocs.push_back(Tok.getLocation()); in ParseObjCAtClassDeclaration() 149 if (Tok.is(tok::less)) in ParseObjCAtClassDeclaration() 215 assert(Tok.isObjCAtKeyword(tok::objc_interface) && in ParseObjCAtInterfaceDeclaration() 221 if (Tok.is(tok::code_completion)) { in ParseObjCAtInterfaceDeclaration() [all …]
|
D | ParseTentative.cpp | 50 switch (Tok.getKind()) { in isCXXDeclarationStatement() 155 switch (Tok.getKind()) { in TryConsumeDeclarationSpecifier() 166 if (Tok.isNot(tok::l_paren)) in TryConsumeDeclarationSpecifier() 194 if (Tok.is(tok::annot_cxxscope)) in TryConsumeDeclarationSpecifier() 196 if (Tok.is(tok::identifier)) in TryConsumeDeclarationSpecifier() 198 else if (Tok.is(tok::annot_template_id)) in TryConsumeDeclarationSpecifier() 210 if (getLangOpts().ObjC && Tok.is(tok::less)) in TryConsumeDeclarationSpecifier() 233 if (Tok.isNot(tok::l_paren)) { in TryParseSimpleDeclaration() 246 if (Tok.isNot(tok::semi) && (!AllowForRangeDecl || Tok.isNot(tok::colon))) in TryParseSimpleDeclaration() 287 if (Tok.isOneOf(tok::kw_asm, tok::kw___attribute)) in TryParseInitDeclaratorList() [all …]
|
D | ParseOpenMP.cpp | 172 Token Tok = P.getCurToken(); in parseOpenMPDirectiveKind() local 174 Tok.isAnnotation() in parseOpenMPDirectiveKind() 176 : getOpenMPDirectiveKindEx(P.getPreprocessor().getSpelling(Tok)); in parseOpenMPDirectiveKind() 184 Tok = P.getPreprocessor().LookAhead(0); in parseOpenMPDirectiveKind() 186 Tok.isAnnotation() in parseOpenMPDirectiveKind() 188 : getOpenMPDirectiveKindEx(P.getPreprocessor().getSpelling(Tok)); in parseOpenMPDirectiveKind() 203 Token Tok = P.getCurToken(); in parseOpenMPReductionId() local 208 if (Tok.is(tok::kw_operator)) { in parseOpenMPReductionId() 210 Tok = P.getCurToken(); in parseOpenMPReductionId() 213 switch (Tok.getKind()) { in parseOpenMPReductionId() [all …]
|
D | ParseTemplate.cpp | 42 if (Tok.is(tok::kw_template) && NextToken().isNot(tok::less)) { in ParseDeclarationStartingWithTemplate() 77 assert(Tok.isOneOf(tok::kw_export, tok::kw_template) && in ParseTemplateDeclarationOrSpecialization() 121 Diag(Tok.getLocation(), diag::err_expected_template); in ParseTemplateDeclarationOrSpecialization() 160 } while (Tok.isOneOf(tok::kw_export, tok::kw_template)); in ParseTemplateDeclarationOrSpecialization() 163 if (Tok.is(tok::kw_concept)) in ParseTemplateDeclarationOrSpecialization() 192 if (Tok.is(tok::kw_static_assert)) { in ParseSingleDeclarationAfterTemplate() 194 Diag(Tok.getLocation(), diag::err_templated_invalid_declaration) in ParseSingleDeclarationAfterTemplate() 210 if (Tok.is(tok::kw_using)) { in ParseSingleDeclarationAfterTemplate() 225 if (Tok.is(tok::semi)) { in ParseSingleDeclarationAfterTemplate() 256 if (Tok.is(tok::semi)) in ParseSingleDeclarationAfterTemplate() [all …]
|
D | ParseInit.cpp | 29 switch (Tok.getKind()) { in MayBeDesignationStart() 103 return Tok.is(tok::equal); in MayBeDesignationStart() 168 if (Tok.is(tok::identifier)) { in ParseInitializerWithPotentialDesignator() 169 const IdentifierInfo *FieldName = Tok.getIdentifierInfo(); in ParseInitializerWithPotentialDesignator() 177 assert(Tok.is(tok::colon) && "MayBeDesignationStart not working properly!"); in ParseInitializerWithPotentialDesignator() 196 while (Tok.is(tok::period) || Tok.is(tok::l_square)) { in ParseInitializerWithPotentialDesignator() 197 if (Tok.is(tok::period)) { in ParseInitializerWithPotentialDesignator() 201 if (Tok.is(tok::code_completion)) { in ParseInitializerWithPotentialDesignator() 206 if (Tok.isNot(tok::identifier)) { in ParseInitializerWithPotentialDesignator() 207 Diag(Tok.getLocation(), diag::err_expected_field_designator); in ParseInitializerWithPotentialDesignator() [all …]
|
/external/clang/lib/Parse/ |
D | ParsePragma.cpp | 324 assert(Tok.is(tok::annot_pragma_unused)); in HandlePragmaUnused() 326 Actions.ActOnPragmaUnused(Tok, getCurScope(), UnusedLoc); in HandlePragmaUnused() 331 assert(Tok.is(tok::annot_pragma_vis)); in HandlePragmaVisibility() 333 static_cast<IdentifierInfo *>(Tok.getAnnotationValue()); in HandlePragmaVisibility() 347 assert(Tok.is(tok::annot_pragma_pack)); in HandlePragmaPack() 349 static_cast<PragmaPackInfo *>(Tok.getAnnotationValue()); in HandlePragmaPack() 362 assert(Tok.is(tok::annot_pragma_msstruct)); in HandlePragmaMSStruct() 364 reinterpret_cast<uintptr_t>(Tok.getAnnotationValue())); in HandlePragmaMSStruct() 370 assert(Tok.is(tok::annot_pragma_align)); in HandlePragmaAlign() 373 reinterpret_cast<uintptr_t>(Tok.getAnnotationValue())); in HandlePragmaAlign() [all …]
|
D | ParseOpenMP.cpp | 114 auto Tok = P.getCurToken(); in ParseOpenMPDirectiveKind() local 116 Tok.isAnnotation() in ParseOpenMPDirectiveKind() 118 : getOpenMPDirectiveKindEx(P.getPreprocessor().getSpelling(Tok)); in ParseOpenMPDirectiveKind() 126 Tok = P.getPreprocessor().LookAhead(0); in ParseOpenMPDirectiveKind() 128 Tok.isAnnotation() in ParseOpenMPDirectiveKind() 130 : getOpenMPDirectiveKindEx(P.getPreprocessor().getSpelling(Tok)); in ParseOpenMPDirectiveKind() 144 Token Tok = P.getCurToken(); in parseOpenMPReductionId() local 149 if (Tok.is(tok::kw_operator)) { in parseOpenMPReductionId() 151 Tok = P.getCurToken(); in parseOpenMPReductionId() 154 switch (Tok.getKind()) { in parseOpenMPReductionId() [all …]
|
D | Parser.cpp | 77 Tok.startToken(); in Parser() 78 Tok.setKind(tok::eof); in Parser() 98 DiagnosticBuilder Parser::Diag(const Token &Tok, unsigned DiagID) { in Diag() argument 99 return Diag(Tok.getLocation(), DiagID); in Diag() 123 static bool IsCommonTypo(tok::TokenKind ExpectedTok, const Token &Tok) { in IsCommonTypo() argument 126 return Tok.is(tok::colon) || Tok.is(tok::comma); // : or , for ; in IsCommonTypo() 133 if (Tok.is(ExpectedTok) || Tok.is(tok::code_completion)) { in ExpectAndConsume() 139 if (IsCommonTypo(ExpectedTok, Tok)) { in ExpectAndConsume() 140 SourceLocation Loc = Tok.getLocation(); in ExpectAndConsume() 166 : Diag(Tok, DiagID); in ExpectAndConsume() [all …]
|
D | ParseCXXInlineMethods.cpp | 32 assert(Tok.isOneOf(tok::l_brace, tok::colon, tok::kw_try, tok::equal) && in ParseCXXInlineMethodDef() 68 SourceLocation KWEndLoc = Tok.getEndLoc().getLocWithOffset(-1); in ParseCXXInlineMethodDef() 92 if (Tok.is(tok::comma)) { in ParseCXXInlineMethodDef() 142 tok::TokenKind kind = Tok.getKind(); in ParseCXXInlineMethodDef() 162 while (Tok.is(tok::kw_catch)) { in ParseCXXInlineMethodDef() 198 assert(Tok.isOneOf(tok::l_brace, tok::equal) && in ParseCXXNonStaticMemberInitializer() 206 tok::TokenKind kind = Tok.getKind(); in ParseCXXNonStaticMemberInitializer() 208 Toks.push_back(Tok); in ParseCXXNonStaticMemberInitializer() 214 Toks.push_back(Tok); in ParseCXXNonStaticMemberInitializer() 229 Eof.setLocation(Tok.getLocation()); in ParseCXXNonStaticMemberInitializer() [all …]
|
D | ParseObjc.cpp | 30 if (Tok.is(tok::kw___attribute)) { in MaybeSkipAttributes() 32 Diag(Tok, diag::err_objc_postfix_attribute_hint) in MaybeSkipAttributes() 35 Diag(Tok, diag::err_objc_postfix_attribute); in MaybeSkipAttributes() 51 if (Tok.is(tok::code_completion)) { in ParseObjCAtDirectives() 58 switch (Tok.getObjCKeywordID()) { in ParseObjCAtDirectives() 140 if (Tok.isNot(tok::identifier)) { in ParseObjCAtClassDeclaration() 141 Diag(Tok, diag::err_expected) << tok::identifier; in ParseObjCAtClassDeclaration() 145 ClassNames.push_back(Tok.getIdentifierInfo()); in ParseObjCAtClassDeclaration() 146 ClassLocs.push_back(Tok.getLocation()); in ParseObjCAtClassDeclaration() 151 if (Tok.is(tok::less)) in ParseObjCAtClassDeclaration() [all …]
|
D | ParseTemplate.cpp | 34 if (Tok.is(tok::kw_template) && NextToken().isNot(tok::less)) { in ParseDeclarationStartingWithTemplate() 65 assert(Tok.isOneOf(tok::kw_export, tok::kw_template) && in ParseTemplateDeclarationOrSpecialization() 110 Diag(Tok.getLocation(), diag::err_expected_template); in ParseTemplateDeclarationOrSpecialization() 147 } while (Tok.isOneOf(tok::kw_export, tok::kw_template)); in ParseTemplateDeclarationOrSpecialization() 182 if (Tok.is(tok::kw_static_assert)) { in ParseSingleDeclarationAfterTemplate() 184 Diag(Tok.getLocation(), diag::err_templated_invalid_declaration) in ParseSingleDeclarationAfterTemplate() 200 if (Tok.is(tok::kw_using)) in ParseSingleDeclarationAfterTemplate() 211 if (Tok.is(tok::semi)) { in ParseSingleDeclarationAfterTemplate() 240 if (Tok.is(tok::semi)) in ParseSingleDeclarationAfterTemplate() 256 Diag(Tok, diag::err_function_definition_not_allowed); in ParseSingleDeclarationAfterTemplate() [all …]
|
D | ParseInit.cpp | 28 switch (Tok.getKind()) { in MayBeDesignationStart() 87 tok::TokenKind Kind = Tok.getKind(); in MayBeDesignationStart() 137 if (Tok.is(tok::identifier)) { in ParseInitializerWithPotentialDesignator() 138 const IdentifierInfo *FieldName = Tok.getIdentifierInfo(); in ParseInitializerWithPotentialDesignator() 146 assert(Tok.is(tok::colon) && "MayBeDesignationStart not working properly!"); in ParseInitializerWithPotentialDesignator() 165 while (Tok.is(tok::period) || Tok.is(tok::l_square)) { in ParseInitializerWithPotentialDesignator() 166 if (Tok.is(tok::period)) { in ParseInitializerWithPotentialDesignator() 170 if (Tok.isNot(tok::identifier)) { in ParseInitializerWithPotentialDesignator() 171 Diag(Tok.getLocation(), diag::err_expected_field_designator); in ParseInitializerWithPotentialDesignator() 175 Desig.AddDesignator(Designator::getField(Tok.getIdentifierInfo(), DotLoc, in ParseInitializerWithPotentialDesignator() [all …]
|
/external/llvm-project/clang/lib/Lex/ |
D | Pragma.cpp | 107 PragmaIntroducer Introducer, Token &Tok) { in HandlePragma() argument 110 PP.LexUnexpandedToken(Tok); in HandlePragma() 114 = FindHandler(Tok.getIdentifierInfo() ? Tok.getIdentifierInfo()->getName() in HandlePragma() 118 PP.Diag(Tok, diag::warn_pragma_ignored); in HandlePragma() 123 Handler->HandlePragma(PP, Introducer, Tok); in HandlePragma() 138 Token &Tok; member 142 Tokens.push_back(Tok); in lex() 143 Self.Lex(Tok); in lex() 153 Toks[Tokens.size() - 1] = Tok; in revert() 159 Tok = *Tokens.begin(); in revert() [all …]
|
D | PPMacroExpansion.cpp | 539 Callbacks->MacroExpands(Info.Tok, Info.MD, Info.Range, in HandleMacroExpandedIdentifier() 767 Token Tok; in ReadMacroCallArgumentList() local 771 LexUnexpandedToken(Tok); in ReadMacroCallArgumentList() 772 assert(Tok.is(tok::l_paren) && "Error computing l-paren-ness?"); in ReadMacroCallArgumentList() 784 while (Tok.isNot(tok::r_paren)) { in ReadMacroCallArgumentList() 785 if (ContainsCodeCompletionTok && Tok.isOneOf(tok::eof, tok::eod)) in ReadMacroCallArgumentList() 788 assert(Tok.isOneOf(tok::l_paren, tok::comma) && in ReadMacroCallArgumentList() 792 SourceLocation ArgStartLoc = Tok.getLocation(); in ReadMacroCallArgumentList() 801 LexUnexpandedToken(Tok); in ReadMacroCallArgumentList() 803 if (Tok.isOneOf(tok::eof, tok::eod)) { // "#if f(<eof>" & "#if f(\n" in ReadMacroCallArgumentList() [all …]
|
/external/clang/lib/Lex/ |
D | Pragma.cpp | 80 Token &Tok) { in HandlePragma() argument 83 PP.LexUnexpandedToken(Tok); in HandlePragma() 87 = FindHandler(Tok.getIdentifierInfo() ? Tok.getIdentifierInfo()->getName() in HandlePragma() 91 PP.Diag(Tok, diag::warn_pragma_ignored); in HandlePragma() 96 Handler->HandlePragma(PP, Introducer, Tok); in HandlePragma() 116 Token Tok; in HandlePragmaDirective() local 117 PragmaHandlers->HandlePragma(*this, Introducer, Tok); in HandlePragmaDirective() 136 Token &Tok) in LexingFor_PragmaRAII() argument 138 Failed(false), OutTok(Tok) { in LexingFor_PragmaRAII() 165 void Preprocessor::Handle_Pragma(Token &Tok) { in Handle_Pragma() argument [all …]
|
D | PPMacroExpansion.cpp | 486 Callbacks->MacroExpands(Info.Tok, Info.MD, Info.Range, in HandleMacroExpandedIdentifier() 714 Token Tok; in ReadFunctionLikeMacroArgs() local 718 LexUnexpandedToken(Tok); in ReadFunctionLikeMacroArgs() 719 assert(Tok.is(tok::l_paren) && "Error computing l-paren-ness?"); in ReadFunctionLikeMacroArgs() 731 while (Tok.isNot(tok::r_paren)) { in ReadFunctionLikeMacroArgs() 732 if (ContainsCodeCompletionTok && Tok.isOneOf(tok::eof, tok::eod)) in ReadFunctionLikeMacroArgs() 735 assert(Tok.isOneOf(tok::l_paren, tok::comma) && in ReadFunctionLikeMacroArgs() 739 SourceLocation ArgStartLoc = Tok.getLocation(); in ReadFunctionLikeMacroArgs() 748 LexUnexpandedToken(Tok); in ReadFunctionLikeMacroArgs() 750 if (Tok.isOneOf(tok::eof, tok::eod)) { // "#if f(<eof>" & "#if f(\n" in ReadFunctionLikeMacroArgs() [all …]
|
/external/llvm-project/clang/lib/AST/ |
D | CommentParser.cpp | 59 const Token &Tok = Toks[Pos.CurToken]; in setupBuffer() local 61 Pos.BufferStart = Tok.getText().begin(); in setupBuffer() 62 Pos.BufferEnd = Tok.getText().end(); in setupBuffer() 64 Pos.BufferStartLoc = Tok.getLocation(); in setupBuffer() 99 if (P.Tok.is(tok::newline)) { in addToken() 101 Token Newline = P.Tok; in addToken() 103 if (P.Tok.isNot(tok::text)) { in addToken() 109 if (P.Tok.isNot(tok::text)) { in addToken() 114 Toks.push_back(P.Tok); in addToken() 153 bool lexWord(Token &Tok) { in lexWord() argument [all …]
|
/external/clang/lib/AST/ |
D | CommentParser.cpp | 60 const Token &Tok = Toks[Pos.CurToken]; in setupBuffer() local 62 Pos.BufferStart = Tok.getText().begin(); in setupBuffer() 63 Pos.BufferEnd = Tok.getText().end(); in setupBuffer() 65 Pos.BufferStartLoc = Tok.getLocation(); in setupBuffer() 100 if (P.Tok.is(tok::newline)) { in addToken() 102 Token Newline = P.Tok; in addToken() 104 if (P.Tok.isNot(tok::text)) { in addToken() 110 if (P.Tok.isNot(tok::text)) { in addToken() 115 Toks.push_back(P.Tok); in addToken() 154 bool lexWord(Token &Tok) { in lexWord() argument [all …]
|
/external/swiftshader/third_party/llvm-10.0/llvm/lib/Object/ |
D | COFFModuleDefinition.cpp | 155 } while (Tok.K != Eof); in parse() 162 Tok = Lex.lex(); in read() 165 Tok = Stack.back(); in read() 171 if (Tok.K != Identifier || Tok.Value.getAsInteger(10, *I)) in readAsInt() 178 if (Tok.K != Expected) in expect() 183 void unget() { Stack.push_back(Tok); } in unget() 187 switch (Tok.K) { in parseOne() 193 if (Tok.K != Identifier) { in parseOne() 206 bool IsDll = Tok.K == KwLibrary; // Check before parseName. in parseOne() 226 return createError("unknown directive: " + Tok.Value); in parseOne() [all …]
|
/external/llvm-project/llvm/lib/Object/ |
D | COFFModuleDefinition.cpp | 155 } while (Tok.K != Eof); in parse() 162 Tok = Lex.lex(); in read() 165 Tok = Stack.back(); in read() 171 if (Tok.K != Identifier || Tok.Value.getAsInteger(10, *I)) in readAsInt() 178 if (Tok.K != Expected) in expect() 183 void unget() { Stack.push_back(Tok); } in unget() 187 switch (Tok.K) { in parseOne() 193 if (Tok.K != Identifier) { in parseOne() 206 bool IsDll = Tok.K == KwLibrary; // Check before parseName. in parseOne() 226 return createError("unknown directive: " + Tok.Value); in parseOne() [all …]
|
/external/clang/lib/Rewrite/ |
D | HTMLRewrite.cpp | 371 Token Tok; in SyntaxHighlight() local 372 L.LexFromRawLexer(Tok); in SyntaxHighlight() 374 while (Tok.isNot(tok::eof)) { in SyntaxHighlight() 377 unsigned TokOffs = SM.getFileOffset(Tok.getLocation()); in SyntaxHighlight() 378 unsigned TokLen = Tok.getLength(); in SyntaxHighlight() 379 switch (Tok.getKind()) { in SyntaxHighlight() 386 PP.LookUpIdentifierInfo(Tok); in SyntaxHighlight() 389 if (Tok.isNot(tok::identifier)) in SyntaxHighlight() 417 if (!Tok.isAtStartOfLine()) in SyntaxHighlight() 423 L.LexFromRawLexer(Tok); in SyntaxHighlight() [all …]
|