Home | History | Annotate | Download | only in Lex

Lines Matching refs:Tok

79                                    Token &Tok) {
82 PP.LexUnexpandedToken(Tok);
86 = FindHandler(Tok.getIdentifierInfo() ? Tok.getIdentifierInfo()->getName()
90 PP.Diag(Tok, diag::warn_pragma_ignored);
95 Handler->HandlePragma(PP, Introducer, Tok);
115 Token Tok;
116 PragmaHandlers->HandlePragma(*this, Introducer, Tok);
135 Token &Tok)
137 Failed(false), OutTok(Tok) {
163 /// been read into 'Tok'.
164 void Preprocessor::Handle_Pragma(Token &Tok) {
177 LexingFor_PragmaRAII _PragmaLexing(*this, InMacroArgPreExpansion, Tok);
180 SourceLocation PragmaLoc = Tok.getLocation();
183 Lex(Tok);
184 if (Tok.isNot(tok::l_paren)) {
190 Lex(Tok);
191 if (!tok::isStringLiteral(Tok.getKind())) {
194 if (Tok.isNot(tok::r_paren))
195 Lex(Tok);
196 if (Tok.is(tok::r_paren))
197 Lex(Tok);
201 if (Tok.hasUDSuffix()) {
202 Diag(Tok, diag::err_invalid_string_udl);
204 Lex(Tok);
205 if (Tok.is(tok::r_paren))
206 Lex(Tok);
211 Token StrTok = Tok;
214 Lex(Tok);
215 if (Tok.isNot(tok::r_paren)) {
223 SourceLocation RParenLoc = Tok.getLocation();
297 return Lex(Tok);
302 void Preprocessor::HandleMicrosoft__pragma(Token &Tok) {
304 SourceLocation PragmaLoc = Tok.getLocation();
307 Lex(Tok);
308 if (Tok.isNot(tok::l_paren)) {
316 Lex(Tok);
317 while (Tok.isNot(tok::eof)) {
318 PragmaToks.push_back(Tok);
319 if (Tok.is(tok::l_paren))
321 else if (Tok.is(tok::r_paren) && NumParens-- == 0)
323 Lex(Tok);
326 if (Tok.is(tok::eof)) {
334 PragmaToks.back().setKind(tok::eod);
346 return Lex(Tok);
374 Token Tok;
383 LexUnexpandedToken(Tok);
387 if (Tok.is(tok::eod)) return;
390 if (Tok.isNot(tok::raw_identifier)) {
391 Diag(Tok, diag::err_pp_invalid_poison);
397 IdentifierInfo *II = LookUpIdentifierInfo(Tok);
404 Diag(Tok, diag::pp_poisoning_existing_macro);
454 if (FilenameTok.is(tok::eod))
488 while (DependencyTok.isNot(tok::eod)) {
502 IdentifierInfo *Preprocessor::ParsePragmaPushOrPopMacro(Token &Tok) {
504 Token PragmaTok = Tok;
507 Lex(Tok);
508 if (Tok.isNot(tok::l_paren)) {
515 Lex(Tok);
516 if (Tok.isNot(tok::string_literal)) {
522 if (Tok.hasUDSuffix()) {
523 Diag(Tok, diag::err_invalid_string_udl);
528 std::string StrVal = getSpelling(Tok);
531 Lex(Tok);
532 if (Tok.isNot(tok::r_paren)) {
544 MacroTok.setKind(tok::raw_identifier);
618 void Preprocessor::HandlePragmaIncludeAlias(Token &Tok) {
625 Lex(Tok);
626 if (Tok.isNot(tok::l_paren)) {
627 Diag(Tok, diag::warn_pragma_include_alias_expected) << "(";
634 if (SourceFilenameTok.is(tok::eod)) {
641 if (SourceFilenameTok.is(tok::string_literal) ||
642 SourceFilenameTok.is(tok::angle_string_literal)) {
644 } else if (SourceFilenameTok.is(tok::less)) {
652 Diag(Tok, diag::warn_pragma_include_alias_expected_filename);
658 Lex(Tok);
659 if (Tok.isNot(tok::comma)) {
660 Diag(Tok, diag::warn_pragma_include_alias_expected) << ",";
666 if (ReplaceFilenameTok.is(tok::eod)) {
672 if (ReplaceFilenameTok.is(tok::string_literal) ||
673 ReplaceFilenameTok.is(tok::angle_string_literal)) {
675 } else if (ReplaceFilenameTok.is(tok::less)) {
683 Diag(Tok, diag::warn_pragma_include_alias_expected_filename);
688 Lex(Tok);
689 if (Tok.isNot(tok::r_paren)) {
690 Diag(Tok, diag::warn_pragma_include_alias_expected) << ")";
780 bool Preprocessor::LexOnOffSwitch(tok::OnOffSwitch &Result) {
781 Token Tok;
782 LexUnexpandedToken(Tok);
784 if (Tok.isNot(tok::identifier)) {
785 Diag(Tok, diag::ext_on_off_switch_syntax);
788 IdentifierInfo *II = Tok.getIdentifierInfo();
790 Result = tok::OOS_ON;
792 Result = tok::OOS_OFF;
794 Result = tok::OOS_DEFAULT;
796 Diag(Tok, diag::ext_on_off_switch_syntax);
801 LexUnexpandedToken(Tok);
802 if (Tok.isNot(tok::eod))
803 Diag(Tok, diag::ext_pragma_syntax_eod);
859 Token Tok;
860 PP.LexUnexpandedToken(Tok);
861 if (Tok.isNot(tok::identifier)) {
862 PP.Diag(Tok, diag::warn_pragma_diagnostic_invalid);
865 IdentifierInfo *II = Tok.getIdentifierInfo();
873 Crasher.setKind(tok::annot_pragma_parser_crash);
888 PP.Diag(Tok, diag::warn_pragma_debug_unexpected_command)
894 Callbacks->PragmaDebug(Tok.getLocation(), II->getName());
902 Token Tok;
903 PP.LexUnexpandedToken(Tok);
905 if (Tok.isNot(tok::eod)) {
906 PP.Diag(Tok, diag::ext_pp_extra_tokens_at_eol)
911 SourceLocation NameLoc = Tok.getLocation();
914 Toks->setKind(tok::annot_pragma_captured);
944 Token Tok;
945 PP.LexUnexpandedToken(Tok);
946 if (Tok.isNot(tok::identifier)) {
947 PP.Diag(Tok, diag::warn_pragma_diagnostic_invalid);
950 IdentifierInfo *II = Tok.getIdentifierInfo();
964 PP.Diag(Tok, diag::warn_pragma_diagnostic_cannot_pop);
974 PP.Diag(Tok, diag::warn_pragma_diagnostic_invalid);
978 PP.LexUnexpandedToken(Tok);
979 SourceLocation StringLoc = Tok.getLocation();
982 if (!PP.FinishLexStringLiteral(Tok, WarningName, "pragma diagnostic",
986 if (Tok.isNot(tok::eod)) {
987 PP.Diag(Tok.getLocation(), diag::warn_pragma_diagnostic_invalid_token);
1052 Token &Tok) {
1053 SourceLocation MessageLoc = Tok.getLocation();
1054 PP.Lex(Tok);
1056 switch (Tok.getKind()) {
1057 case tok::l_paren:
1061 PP.Lex(Tok);
1063 case tok::string_literal:
1072 if (!PP.FinishLexStringLiteral(Tok, MessageString, PragmaKind(Kind),
1077 if (Tok.isNot(tok::r_paren)) {
1078 PP.Diag(Tok.getLocation(), diag::err_pragma_message_malformed) << Kind;
1081 PP.Lex(Tok); // eat the r_paren.
1084 if (Tok.isNot(tok::eod)) {
1085 PP.Diag(Tok.getLocation(), diag::err_pragma_message_malformed) << Kind;
1127 Token &Tok) {
1128 tok::OnOffSwitch OOS;
1131 if (OOS == tok::OOS_ON)
1132 PP.Diag(Tok, diag::warn_stdc_fenv_access_not_supported);
1141 Token &Tok) {
1142 tok::OnOffSwitch OOS;
1166 Token Tok;
1169 PP.LexUnexpandedToken(Tok);
1170 const IdentifierInfo *BeginEnd = Tok.getIdentifierInfo();
1176 PP.Diag(Tok.getLocation(), diag::err_pp_arc_cf_code_audited_syntax);
1181 PP.LexUnexpandedToken(Tok);
1182 if (Tok.isNot(tok::eod))
1183 PP.Diag(Tok, diag::ext_pp_extra_tokens_at_eol) << "pragma";