TokenLexer - This implements a lexer that returns tokens from a macro body or token stream instead of lexing from a character buffer. More...
#include "clang/Lex/TokenLexer.h"
TokenLexer - This implements a lexer that returns tokens from a macro body or token stream instead of lexing from a character buffer.
This is used for macro expansion and _Pragma handling, for example.
Definition at line 30 of file TokenLexer.h.
◆ TokenLexer() [1/3]Create a TokenLexer for the specified macro with the specified actual arguments.
Note that this ctor takes ownership of the ActualArgs pointer. ILEnd specifies the location of the ')' for a function-like macro or the identifier for an object-like macro.
Definition at line 108 of file TokenLexer.h.
References clang::Init.
◆ TokenLexer() [2/3]Create a TokenLexer for the specified token stream.
If 'OwnsTokens' is specified, this takes ownership of the tokens and delete[]'s them when the token lexer is empty.
Definition at line 117 of file TokenLexer.h.
References clang::Init.
◆ TokenLexer() [3/3] clang::TokenLexer::TokenLexer ( const TokenLexer & ) delete ◆ ~TokenLexer() clang::TokenLexer::~TokenLexer ( ) inlineDefinition at line 125 of file TokenLexer.h.
◆ Init() [1/2] void TokenLexer::Init ( const Token * TokArray, unsigned NumToks, bool disableMacroExpansion, bool ownsTokens, bool isReinject ) ◆ Init() [2/2]Initialize this TokenLexer to expand from the specified macro with the specified argument information.
Create a TokenLexer for the specified macro with the specified actual arguments.
Note that this ctor takes ownership of the ActualArgs pointer. ILEnd specifies the location of the ')' for a function-like macro or the identifier for an object-like macro.
Note that this ctor takes ownership of the ActualArgs pointer.
Definition at line 39 of file TokenLexer.cpp.
References clang::MacroInfo::DisableMacro(), clang::MacroInfo::getDefinitionLength(), clang::Token::getLocation(), clang::MacroInfo::getNumParams(), clang::Preprocessor::getSourceManager(), clang::Token::hasLeadingSpace(), clang::Token::isAtStartOfLine(), clang::MacroInfo::isFunctionLike(), clang::SourceLocation::isValid(), SM, clang::MacroInfo::tokens_begin(), and clang::MacroInfo::tokens_end().
◆ isNextTokenLParen() unsigned TokenLexer::isNextTokenLParen ( ) constIf the next token lexed will pop this macro off the expansion stack, return 2.
isNextTokenLParen - If the next token lexed will pop this macro off the expansion stack, return 2.
If the next unexpanded token is a '(', return 1, otherwise return 0.
Definition at line 926 of file TokenLexer.cpp.
References clang::Token::is().
◆ isParsingPreprocessorDirective() bool TokenLexer::isParsingPreprocessorDirective ( ) constisParsingPreprocessorDirective - Return true if we are in the middle of a preprocessor directive.
Definition at line 935 of file TokenLexer.cpp.
References clang::Token::is().
◆ Lex()Lex and return a token from this macro stream.
Lex - Lex and return a token from this macro stream.
Definition at line 621 of file TokenLexer.cpp.
References clang::Token::getIdentifierInfo(), clang::Preprocessor::getLangOpts(), clang::Token::getLength(), clang::Token::getLocation(), clang::Preprocessor::getSourceManager(), clang::IdentifierInfo::getTokenID(), clang::Preprocessor::HandleEndOfTokenLexer(), clang::Preprocessor::HandleIdentifier(), clang::Preprocessor::HandlePoisonedIdentifier(), clang::Token::is(), clang::Token::isAnnotation(), clang::IdentifierInfo::isHandleIdentifierCase(), clang::IdentifierInfo::isPoisoned(), clang::Token::IsReinjected, clang::SourceLocation::isValid(), isWideStringLiteralFromMacro(), clang::Token::LeadingEmptyMacro, clang::Token::LeadingSpace, clang::Token::setFlag(), clang::Token::setFlagValue(), clang::Token::setKind(), clang::Token::setLocation(), SM, clang::Token::StartOfLine, and clang::Token::startToken().
◆ operator=() ◆ PreprocessorThe documentation for this class was generated from the following files:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4