Lines Matching full:token
10 /// This file defines the \c FormatTokenSource interface, which provides a token
11 /// stream as well as the ability to manipulate the token stream.
20 #define DEBUG_TYPE "format-token-source"
25 // Navigate a token stream.
27 // Enables traversal of a token stream, resetting the position in a token
33 // Returns the next token in the token stream.
36 // Returns the token preceding the token returned by the last call to
37 // getNextToken() in the token stream, or nullptr if no such token exists.
43 // Returns the token that would be returned by the next call to
48 // This can be different from whether getNextToken() returned an eof token
49 // when the FormatTokenSource is a view on a part of the token stream.
52 // Gets the current position in the token stream, to be used by setPosition().
55 // should not be used to get relative token positions.
58 // Resets the token stream to the state it was in when getPosition() returned
59 // Position, and return the token at that position in the stream.
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,
66 // the next token will be the last token returned by getNextToken();
68 // For example, given the token sequence 'a1 a2':
157 llvm::dbgs() << "At inserted token "; in insertTokens()
179 << "] Token: " << Tok->Tok.getName() << " / " << Tok->TokenText
186 // Maps from position a to position b, so that when we reach a, the token
197 Token(nullptr), PreviousToken(nullptr) { in ScopedMacroState()
208 ResetToken = Token; in ~ScopedMacroState()
216 // \c getNextToken() after it has encountered the first eof token. in getNextToken()
218 PreviousToken = Token; in getNextToken()
219 Token = PreviousTokenSource->getNextToken(); in getNextToken()
222 return Token; in getNextToken()
241 Token = PreviousTokenSource->setPosition(Position); in setPosition()
242 return Token; in setPosition()
252 return Token && Token->HasUnescapedNewline && in eof()
253 !continuesLineComment(*Token, PreviousToken, in eof()
264 FormatToken *Token; variable