14 #ifndef LLVM_CLANG_LEX_TOKENLEXER_H
15 #define LLVM_CLANG_LEX_TOKENLEXER_H
72 unsigned MacroStartSLocOffset;
77 unsigned MacroDefLength;
81 bool AtStartOfLine : 1;
82 bool HasLeadingSpace : 1;
90 bool NextTokGetsSpace : 1;
100 bool DisableMacroExpansion : 1;
111 : Macro(nullptr), ActualArgs(nullptr), PP(pp), OwnsTokens(
false) {
112 Init(Tok, ILEnd, MI, ActualArgs);
127 : Macro(nullptr), ActualArgs(nullptr), PP(pp), OwnsTokens(
false) {
128 Init(TokArray, NumToks, DisableExpansion, ownsTokens);
136 void Init(
const Token *TokArray,
unsigned NumToks,
137 bool DisableMacroExpansion,
bool OwnsTokens);
158 bool isAtEnd()
const {
159 return CurToken == NumTokens;
167 bool PasteTokens(
Token &Tok);
171 void ExpandFunctionArguments();
178 void HandleMicrosoftCommentPaste(
Token &Tok);
183 SourceLocation getExpansionLocForMacroDefLoc(SourceLocation loc)
const;
190 void updateLocForMacroArgTokens(SourceLocation ArgIdSpellLoc,
195 bool MaybeRemoveCommaBeforeVaArgs(SmallVectorImpl<Token> &ResultToks,
196 bool HasPasteOperator,
197 MacroInfo *Macro,
unsigned MacroArgNo,
200 void PropagateLineStartLeadingSpaceInfo(
Token &
Result);
void Init(Token &Tok, SourceLocation ILEnd, MacroInfo *MI, MacroArgs *ActualArgs)
unsigned isNextTokenLParen() const
bool isParsingPreprocessorDirective() const
friend class Preprocessor
bool Lex(Token &Tok)
Lex - Lex and return a token from this macro stream.
TokenLexer(const Token *TokArray, unsigned NumToks, bool DisableExpansion, bool ownsTokens, Preprocessor &pp)
TokenLexer(Token &Tok, SourceLocation ILEnd, MacroInfo *MI, MacroArgs *ActualArgs, Preprocessor &pp)
The result type of a method or function.
Encodes a location in the source. The SourceManager can decode this to get at the full include stack...
Encapsulates the data about a macro definition (e.g. its tokens).
Defines the clang::SourceLocation class and associated facilities.
Engages in a tight little dance with the lexer to efficiently preprocess tokens.