Searched defs:Tok (Results 1 - 25 of 64) sorted by relevance

123

/external/clang/include/clang/AST/
H A DCommentBriefParser.h36 Token Tok; member in class:clang::comments::BriefParser
39 SourceLocation Loc = Tok.getLocation();
40 L.lex(Tok);
H A DCommentParser.h56 Token Tok; member in class:clang::comments::Parser
63 L.lex(Tok);
65 Tok = MoreLATokens.pop_back_val();
69 MoreLATokens.push_back(Tok);
70 Tok = OldTok;
77 MoreLATokens.push_back(Tok);
84 Tok = Toks[0];
88 return (Tok.is(tok::backslash_command) || Tok.is(tok::at_command)) &&
89 Traits.getCommandInfo(Tok
[all...]
/external/clang/lib/Lex/
H A DPPCaching.cpp97 void Preprocessor::AnnotatePreviousCachedTokens(const Token &Tok) { argument
98 assert(Tok.isAnnotation() && "Expected annotation token");
100 assert(CachedTokens[CachedLexPos-1].getLastLoc() == Tok.getAnnotationEndLoc()
107 if (AnnotBegin->getLocation() == Tok.getLocation()) {
113 *AnnotBegin = Tok;
H A DTokenConcatenation.cpp48 bool TokenConcatenation::IsIdentifierStringPrefix(const Token &Tok) const {
51 if (!Tok.needsCleaning()) {
52 if (Tok.getLength() < 1 || Tok.getLength() > 3)
55 const char *Ptr = SM.getCharacterData(SM.getSpellingLoc(Tok.getLocation()));
56 return IsStringPrefix(StringRef(Ptr, Tok.getLength()),
60 if (Tok.getLength() < 256) {
63 unsigned length = PP.getSpelling(Tok, TokPtr);
67 return IsStringPrefix(StringRef(PP.getSpelling(Tok)), LangOpts.CPlusPlus11);
119 /// GetFirstChar - Get the first character of the token \arg Tok,
121 GetFirstChar(Preprocessor &PP, const Token &Tok) argument
[all...]
H A DMacroArgs.cpp174 Token &Tok = Result.back(); local
175 PP.Lex(Tok);
199 Token Tok; local
200 Tok.startToken();
201 Tok.setKind(Charify ? tok::char_constant : tok::string_literal);
211 const Token &Tok = *ArgToks; local
212 if (!isFirst && (Tok.hasLeadingSpace() || Tok.isAtStartOfLine()))
218 if (tok::isStringLiteral(Tok.getKind()) || // "foo", u8R"x(foo)x"_bar, etc.
219 Tok
[all...]
H A DPPExpressions.cpp750 Token Tok; local
751 LexNonComment(Tok);
758 if (EvaluateValue(ResVal, Tok, DT, true, *this)) {
760 if (Tok.isNot(tok::eod))
771 if (Tok.is(tok::eod)) {
785 Tok, true, *this)) {
787 if (Tok.isNot(tok::eod))
797 if (Tok.isNot(tok::eod)) {
798 Diag(Tok, diag::err_pp_expected_eol);
H A DPPLexerChange.cpp161 void Preprocessor::EnterMacro(Token &Tok, SourceLocation ILEnd, argument
165 TokLexer = new TokenLexer(Tok, ILEnd, Macro, Args, *this);
168 TokLexer->Init(Tok, ILEnd, Macro, Args);
555 void Preprocessor::HandleMicrosoftCommentPaste(Token &Tok) { argument
584 if (!HandleEndOfTokenLexer(Tok)) Lex(Tok);
592 while (Tok.isNot(tok::eod) && Tok.isNot(tok::eof))
593 Lex(Tok);
596 if (Tok
[all...]
/external/clang/lib/Rewrite/Core/
H A DTokenRewriter.cpp37 if (Tok.is(tok::raw_identifier)) {
40 PP.LookUpIdentifierInfo(Tok);
87 Token Tok; local
88 Tok.startToken();
90 Tok.setLocation(ScratchBuf->getToken(Val, Len, Spelling));
91 Tok.setLength(Len);
95 Tok.setKind(tok::unknown);
97 return AddToken(Tok, RemapIterator(I));
H A DHTMLRewrite.cpp371 Token Tok; local
372 L.LexFromRawLexer(Tok);
374 while (Tok.isNot(tok::eof)) {
377 unsigned TokOffs = SM.getFileOffset(Tok.getLocation());
378 unsigned TokLen = Tok.getLength();
379 switch (Tok.getKind()) {
386 PP.LookUpIdentifierInfo(Tok);
389 if (Tok.isNot(tok::identifier))
417 if (!Tok.isAtStartOfLine())
423 L.LexFromRawLexer(Tok);
457 Token Tok; local
510 Token Tok; local
[all...]
/external/clang/include/clang/Lex/
H A DTokenLexer.h109 TokenLexer(Token &Tok, SourceLocation ILEnd, MacroInfo *MI, argument
112 Init(Tok, ILEnd, MI, ActualArgs);
119 void Init(Token &Tok, SourceLocation ILEnd, MacroInfo *MI,
147 bool Lex(Token &Tok);
162 /// PasteTokens - Tok is the LHS of a ## operator, and CurToken is the ##
165 /// Tok. If this returns true, the caller should immediately return the
167 bool PasteTokens(Token &Tok);
178 void HandleMicrosoftCommentPaste(Token &Tok);
H A DLexer.h241 /// Tok.getLength() bytes long. The length of the actual result is returned.
248 static unsigned getSpelling(const Token &Tok, const char *&Buffer,
253 /// getSpelling() - Return the 'spelling' of the Tok token. The spelling of a
258 static std::string getSpelling(const Token &Tok,
506 inline char getAndAdvanceChar(const char *&Ptr, Token &Tok) { argument
512 char C = getCharAndSizeSlow(Ptr, Size, &Tok);
521 const char *ConsumeChar(const char *Ptr, unsigned Size, Token &Tok) { argument
529 getCharAndSizeSlow(Ptr, Size, &Tok);
552 Token *Tok = nullptr);
614 /// \param Tok Th
[all...]
/external/clang/lib/Parse/
H A DParseAST.cpp45 const Token &Tok = P.getCurToken(); local
46 if (Tok.is(tok::eof)) {
51 if (Tok.getLocation().isInvalid()) {
57 Tok.getLocation().print(OS, PP.getSourceManager());
58 if (Tok.isAnnotation()) {
61 // Do the equivalent of PP.getSpelling(Tok) except for the parts that would
65 unsigned Length = Tok.getLength();
66 const char *Spelling = SM.getCharacterData(Tok.getLocation(), &Invalid);
H A DParseOpenMP.cpp29 auto Tok = P.getCurToken(); local
31 Tok.isAnnotation()
33 : getOpenMPDirectiveKind(P.getPreprocessor().getSpelling(Tok));
35 Tok = P.getPreprocessor().LookAhead(0);
37 Tok.isAnnotation()
39 : getOpenMPDirectiveKind(P.getPreprocessor().getSpelling(Tok));
57 assert(Tok.is(tok::annot_pragma_openmp) && "Not an OpenMP directive!");
70 if (Tok.isNot(tok::annot_pragma_openmp_end)) {
71 Diag(Tok, diag::warn_omp_extra_tokens_at_eol)
81 Diag(Tok, dia
[all...]
H A DParseStmtAsm.cpp156 const Token &Tok = AsmToks[TokIndex]; local
157 Loc = Tok.getLocation();
186 LineToks.push_back(Tok);
213 if (Tok.is(EndOfStream)) {
216 while (LineToks[LineIndex].getLocation() != Tok.getLocation()) {
224 if (Invalid || Tok.is(EndOfStream)) {
236 assert(Tok.is(EndOfStream));
260 const Token &Tok = AsmToks[i];
263 if (!isNewStatement && (Tok.is(tok::kw_asm) || Tok
[all...]
/external/clang/unittests/AST/
H A DCommentLexer.cpp48 StringRef getCommandName(const Token &Tok) { argument
49 return Traits.getCommandInfo(Tok.getCommandID())->Name;
52 StringRef getVerbatimBlockName(const Token &Tok) { argument
53 return Traits.getCommandInfo(Tok.getVerbatimBlockID())->Name;
56 StringRef getVerbatimLineName(const Token &Tok) { argument
57 return Traits.getCommandInfo(Tok.getVerbatimLineID())->Name;
70 Token Tok; local
71 L.lex(Tok);
72 if (Tok.is(tok::eof))
74 Toks.push_back(Tok);
[all...]
/external/clang/lib/Format/
H A DBreakableToken.h75 BreakableToken(const FormatToken &Tok, unsigned IndentLevel, argument
78 : Tok(Tok), IndentLevel(IndentLevel), InPPDirective(InPPDirective),
81 const FormatToken &Tok; member in class:clang::format::BreakableToken
98 BreakableSingleLineToken(const FormatToken &Tok, unsigned IndentLevel,
120 BreakableStringLiteral(const FormatToken &Tok, unsigned IndentLevel,
H A DUnwrappedLineParser.h110 void pushToken(FormatToken *Tok);
204 UnwrappedLineNode() : Tok(nullptr) {}
205 UnwrappedLineNode(FormatToken *Tok) : Tok(Tok) {} argument
207 FormatToken *Tok; member in struct:clang::format::UnwrappedLineNode
H A DWhitespaceManager.cpp46 void WhitespaceManager::replaceWhitespace(FormatToken &Tok, unsigned Newlines, argument
50 if (Tok.Finalized)
52 Tok.Decision = (Newlines > 0) ? FD_Break : FD_Continue;
53 Changes.push_back(Change(true, Tok.WhitespaceRange, IndentLevel, Spaces,
55 Tok.Tok.getKind(), InPPDirective && !Tok.IsFirst));
58 void WhitespaceManager::addUntouchableToken(const FormatToken &Tok, argument
60 if (Tok.Finalized)
62 Changes.push_back(Change(false, Tok
68 replaceWhitespaceInToken( const FormatToken &Tok, unsigned Offset, unsigned ReplaceChars, StringRef PreviousPostfix, StringRef CurrentPrefix, bool InPPDirective, unsigned Newlines, unsigned IndentLevel, int Spaces) argument
[all...]
H A DBreakableToken.cpp145 const FormatToken &Tok, unsigned IndentLevel, unsigned StartColumn,
148 : BreakableToken(Tok, IndentLevel, InPPDirective, Encoding, Style),
150 assert(Tok.TokenText.endswith(Postfix));
151 Line = Tok.TokenText.substr(
152 Prefix.size(), Tok.TokenText.size() - Prefix.size() - Postfix.size());
156 const FormatToken &Tok, unsigned IndentLevel, unsigned StartColumn,
159 : BreakableSingleLineToken(Tok, IndentLevel, StartColumn, Prefix, Postfix,
181 Tok, Prefix.size() + TailOffset + Split.first, Split.second, Postfix,
227 Tok, OriginalPrefix.size() + TailOffset + Split.first, Split.second,
235 Tok, OriginalPrefi
144 BreakableSingleLineToken( const FormatToken &Tok, unsigned IndentLevel, unsigned StartColumn, StringRef Prefix, StringRef Postfix, bool InPPDirective, encoding::Encoding Encoding, const FormatStyle &Style) argument
155 BreakableStringLiteral( const FormatToken &Tok, unsigned IndentLevel, unsigned StartColumn, StringRef Prefix, StringRef Postfix, bool InPPDirective, encoding::Encoding Encoding, const FormatStyle &Style) argument
[all...]
H A DContinuationIndenter.cpp30 // the ), ], } or > matching \c Tok.
31 static unsigned getLengthToMatchingParen(const FormatToken &Tok) { argument
32 if (!Tok.MatchingParen)
34 FormatToken *End = Tok.MatchingParen;
38 return End->TotalLength - Tok.TotalLength + 1;
41 // Returns \c true if \c Tok is the "." or "->" of a call and starts the next
43 static bool startsSegmentOfBuilderTypeCall(const FormatToken &Tok) { argument
44 return Tok.isMemberAccess() && Tok.Previous && Tok
266 const FormatToken *Tok = &Previous; local
748 consumeRParens(LineState& State, const FormatToken &Tok) argument
779 const FormatToken &Tok = *State.NextToken; local
[all...]
/external/llvm/lib/TableGen/
H A DTGLexer.cpp293 tgtok::TokKind Tok = LexToken(); local
294 if (Tok == tgtok::Error) return true;
295 if (Tok != tgtok::StrVal) {
/external/clang/lib/Frontend/
H A DFrontendActions.cpp568 Token Tok; local
571 PP.Lex(Tok);
572 PP.DumpToken(Tok, true);
574 } while (Tok.isNot(tok::eof));
598 Token Tok; local
602 PP.Lex(Tok);
603 } while (Tok.isNot(tok::eof));
/external/clang/unittests/Lex/
H A DPPCallbacksTest.cpp185 Token Tok; local
186 PP.Lex(Tok);
187 if (Tok.is(tok::eof))
229 Token Tok; local
230 PP.Lex(Tok);
231 if (Tok.is(tok::eof))
/external/llvm/lib/IR/
H A DDataLayout.cpp230 StringRef &Tok = Split.first; // Current token. local
233 char Specifier = Tok.front();
234 Tok = Tok.substr(1);
249 unsigned AddrSpace = Tok.empty() ? 0 : getInt(Tok);
255 unsigned PointerMemSize = inBytes(getInt(Tok));
259 unsigned PointerABIAlign = inBytes(getInt(Tok));
265 PointerPrefAlign = inBytes(getInt(Tok));
286 unsigned Size = Tok
[all...]
/external/llvm/tools/llvm-mc/
H A Dllvm-mc.cpp249 AsmToken Tok = Lexer.getTok(); local
251 switch (Tok.getKind()) {
313 Out->os().write_escaped(Tok.getString());

Completed in 423 milliseconds

123