Lines Matching full:tokens
28 // stream, as well as inserting new tokens.
62 // Insert the given tokens before the current position.
63 // Returns the first token in \c Tokens.
64 // The next returned token will be the second token in \c Tokens.
65 // Requires the last token in Tokens to be EOF; once the EOF token is reached,
74 virtual FormatToken *insertTokens(ArrayRef<FormatToken *> Tokens) = 0;
88 IndexedTokenSource(ArrayRef<FormatToken *> Tokens) in IndexedTokenSource() argument
89 : Tokens(Tokens), Position(-1) {} in IndexedTokenSource()
97 return Tokens[Position]; in getNextToken()
104 return Tokens[Position]; in getNextToken()
108 assert(Position <= 0 || Tokens[Position - 1]->isNot(tok::eof)); in getPreviousToken()
109 return Position > 0 ? Tokens[Position - 1] : nullptr; in getPreviousToken()
114 return Tokens[Position];
117 while (Tokens[Next]->is(tok::comment))
123 return Tokens[Next];
127 return Position == -1 ? false : Tokens[Position]->is(tok::eof); in isEOF()
139 return Tokens[Position]; in setPosition()
145 int Next = Tokens.size(); in insertTokens()
146 Tokens.append(New.begin(), New.end()); in insertTokens()
149 for (int I = Next, E = Tokens.size(); I != E; ++I) in insertTokens()
151 llvm::dbgs() << " Jump from: " << (Tokens.size() - 1) << " -> " in insertTokens()
154 Jumps[Tokens.size() - 1] = Position; in insertTokens()
160 return Tokens[Position]; in insertTokens()
177 FormatToken *Tok = Tokens[Position];
183 SmallVector<FormatToken *> Tokens; variable
245 FormatToken *insertTokens(ArrayRef<FormatToken *> Tokens) override { in insertTokens() argument
246 llvm_unreachable("Cannot insert tokens while parsing a macro."); in insertTokens()