Lines Matching defs:Tokens
4856 // Lex tokens until we hit the end of the range.
4905 CXToken **Tokens, unsigned *NumTokens) {
4910 if (Tokens)
4911 *Tokens = 0;
4916 if (!CXXUnit || !Tokens || !NumTokens)
4931 *Tokens = (CXToken *)malloc(sizeof(CXToken) * CXTokens.size());
4932 memmove(*Tokens, CXTokens.data(), sizeof(CXToken) * CXTokens.size());
4937 CXToken *Tokens, unsigned NumTokens) {
4938 free(Tokens);
4955 CXToken *Tokens;
4976 return SourceLocation::getFromRawEncoding(Tokens[tokI].int_data[1]);
4979 return Tokens[tokI].int_data[3] != 0;
4982 return SourceLocation::getFromRawEncoding(Tokens[tokI].int_data[3]);
4990 AnnotateTokensWorker(CXToken *tokens, CXCursor *cursors, unsigned numTokens,
4992 : Tokens(tokens), Cursors(cursors),
5022 // Walk the AST within the region of interest, annotating tokens
5034 /// \brief It annotates and advances tokens with a cursor until the comparison
5038 /// Pass RangeBefore to annotate tokens with a cursor until a range is reached.
5039 /// Pass RangeOverlap to annotate tokens inside a range.
5059 /// \brief Special annotation handling for macro argument tokens.
5060 /// \returns true if it advanced beyond all macro tokens, false otherwise.
5067 "Should be called only for macro arg tokens");
5072 // We only advance once past all of the macro arg tokens if all of them
5074 // at the start of the macro arg tokens so that the failing token will be
5094 TokIdx = I; // All of the tokens were handled, advance beyond all of them.
5155 // Skip tokens up until we catch up to the beginning of the preprocessing
5171 // Look at all of the tokens within this range.
5213 // Attributes are annotated out-of-order, skip tokens until we reach it.
5264 // Scan the tokens that are at the end of the cursor, but are not captured
5268 // Scan the tokens that are at the beginning of the cursor, but are not
5301 /// and mark tokens that are macro arguments. This info is used by the
5305 CXToken *Tokens;
5311 CXToken *tokens, unsigned numTokens)
5312 : SM(SM), Tokens(tokens), NumTokens(numTokens), CurIdx(0) { }
5347 return SourceLocation::getFromRawEncoding(Tokens[tokI].int_data[1]);
5352 // to mark macro arg expanded tokens with their expanded locations.
5353 Tokens[tokI].int_data[3] = loc.getRawEncoding();
5370 CXToken *Tokens;
5394 CXToken *Tokens,
5421 // Lex tokens in raw mode until we hit the end of the range, to avoid
5429 SourceLocation::getFromRawEncoding(Tokens[TokIdx].int_data[1]));
5433 // We have found a preprocessing directive. Annotate the tokens
5480 SourceLocation::getFromRawEncoding(Tokens[LastIdx].int_data[1]);
5498 CXToken *Tokens = ((clang_annotateTokens_Data*)UserData)->Tokens;
5506 // Determine the region of interest, which contains all of the tokens.
5509 cxloc::translateSourceLocation(clang_getTokenLocation(TU, Tokens[0])));
5512 Tokens[NumTokens-1])));
5514 // Relex the tokens within the source range to look for preprocessing
5516 annotatePreprocessorTokens(TU, RegionOfInterest, Cursors, Tokens, NumTokens);
5529 // Search and mark tokens that are macro argument expansions.
5531 Tokens, NumTokens);
5542 AnnotateTokensWorker W(Tokens, Cursors, NumTokens, TU, RegionOfInterest);
5552 // take another pass through the tokens to mark them as such.
5555 if (clang_getTokenKind(Tokens[I]) != CXToken_Identifier)
5559 IdentifierInfo *II = static_cast<IdentifierInfo *>(Tokens[I].ptr_data);
5577 Tokens[I].int_data[0] = CXToken_Keyword;
5584 IdentifierInfo *II = static_cast<IdentifierInfo *>(Tokens[I].ptr_data);
5593 Tokens[I].int_data[0] = CXToken_Keyword;
5599 Tokens[I].int_data[0] = CXToken_Keyword;
5609 CXToken *Tokens, unsigned NumTokens,
5611 if (NumTokens == 0 || !Tokens || !Cursors) {
5618 CXSourceLocation bloc = clang_getTokenLocation(TU, Tokens[0]);
5619 CXSourceLocation eloc = clang_getTokenLocation(TU, Tokens[NumTokens-1]);
5634 clang_annotateTokens_Data data = { TU, CXXUnit, Tokens, NumTokens, Cursors };
5638 fprintf(stderr, "libclang: crash detected while annotating tokens\n");