13 #ifndef LLVM_CLANG_LEX_TOKENLEXER_H 14 #define LLVM_CLANG_LEX_TOKENLEXER_H 17 #include "llvm/ADT/ArrayRef.h" 25 class VAOptExpansionContext;
68 unsigned MacroStartSLocOffset;
74 unsigned MacroDefLength;
78 bool AtStartOfLine : 1;
79 bool HasLeadingSpace : 1;
87 bool NextTokGetsSpace : 1;
97 bool DisableMacroExpansion : 1;
110 : PP(pp), OwnsTokens(
false) {
111 Init(Tok, ILEnd, MI, ActualArgs);
119 : PP(pp), OwnsTokens(
false) {
120 Init(TokArray, NumToks, DisableExpansion, ownsTokens, isReinject);
139 void Init(
const Token *TokArray,
unsigned NumToks,
bool DisableMacroExpansion,
140 bool OwnsTokens,
bool IsReinject);
159 bool isAtEnd()
const {
160 return CurTokenIdx == NumTokens;
185 unsigned int &CurIdx);
189 bool pasteTokens(
Token &Tok);
211 void ExpandFunctionArguments();
236 bool HasPasteOperator,
240 void PropagateLineStartLeadingSpaceInfo(
Token &
Result);
245 #endif // LLVM_CLANG_LEX_TOKENLEXER_H A class for tracking whether we're inside a VA_OPT during a traversal of the tokens of a macro during...
TokenLexer & operator=(const TokenLexer &)=delete
Token - This structure provides full information about a lexed token.
bool Lex(Token &Tok)
Lex and return a token from this macro stream.
TokenLexer - This implements a lexer that returns tokens from a macro body or token stream instead of...
void Init(Token &Tok, SourceLocation ELEnd, MacroInfo *MI, MacroArgs *Actuals)
Initialize this TokenLexer to expand from the specified macro with the specified argument information...
MacroArgs - An instance of this class captures information about the formal arguments specified to a ...
TokenLexer(Token &Tok, SourceLocation ILEnd, MacroInfo *MI, MacroArgs *ActualArgs, Preprocessor &pp)
Create a TokenLexer for the specified macro with the specified actual arguments.
The result type of a method or function.
Encodes a location in the source.
Dataflow Directional Tag Classes.
Encapsulates the data about a macro definition (e.g.
unsigned isNextTokenLParen() const
If the next token lexed will pop this macro off the expansion stack, return 2.
TokenLexer(const Token *TokArray, unsigned NumToks, bool DisableExpansion, bool ownsTokens, bool isReinject, Preprocessor &pp)
Create a TokenLexer for the specified token stream.
Defines the clang::SourceLocation class and associated facilities.
bool isParsingPreprocessorDirective() const
isParsingPreprocessorDirective - Return true if we are in the middle of a preprocessor directive...
Engages in a tight little dance with the lexer to efficiently preprocess tokens.