clang API Documentation
#include <PTHLexer.h>
Public Member Functions | |
~PTHLexer () | |
bool | Lex (Token &Tok) |
Lex - Return the next token. | |
void | getEOF (Token &Tok) |
void | DiscardToEndOfLine () |
unsigned | isNextPPTokenLParen () |
void | IndirectLex (Token &Result) override |
SourceLocation | getSourceLocation () override |
bool | SkipBlock () |
SkipBlock - Used by Preprocessor to skip the current conditional block. | |
Protected Member Functions | |
PTHLexer (Preprocessor &pp, FileID FID, const unsigned char *D, const unsigned char *ppcond, PTHManager &PM) | |
Create a PTHLexer for the specified token stream. | |
Friends | |
class | PTHManager |
Definition at line 24 of file PTHLexer.h.
PTHLexer::PTHLexer | ( | Preprocessor & | pp, |
FileID | FID, | ||
const unsigned char * | D, | ||
const unsigned char * | ppcond, | ||
PTHManager & | PM | ||
) | [protected] |
Create a PTHLexer for the specified token stream.
Definition at line 37 of file PTHLexer.cpp.
References clang::SourceManager::getLocForStartOfFile(), and clang::Preprocessor::getSourceManager().
clang::PTHLexer::~PTHLexer | ( | ) | [inline] |
Definition at line 68 of file PTHLexer.h.
void PTHLexer::DiscardToEndOfLine | ( | ) |
DiscardToEndOfLine - Read the rest of the current preprocessor line as an uninterpreted string. This switches the lexer out of directive mode.
Definition at line 159 of file PTHLexer.cpp.
References clang::comments::tok::eof, clang::PreprocessorLexer::ParsingFilename, clang::PreprocessorLexer::ParsingPreprocessorDirective, clang::Token::StartOfLine, and StoredTokenSize.
void PTHLexer::getEOF | ( | Token & | Tok | ) |
Definition at line 154 of file PTHLexer.cpp.
References clang::comments::tok::eof, and clang::Token::is().
SourceLocation PTHLexer::getSourceLocation | ( | ) | [override, virtual] |
getSourceLocation - Return a source location for the token in the current file.
Implements clang::PreprocessorLexer.
Definition at line 286 of file PTHLexer.cpp.
References clang::SourceLocation::getLocWithOffset(), and StoredTokenSize.
void clang::PTHLexer::IndirectLex | ( | Token & | Result | ) | [inline, override, virtual] |
IndirectLex - An indirect call to 'Lex' that can be invoked via the PreprocessorLexer interface.
Implements clang::PreprocessorLexer.
Definition at line 93 of file PTHLexer.h.
References Lex().
unsigned clang::PTHLexer::isNextPPTokenLParen | ( | ) | [inline] |
isNextPPTokenLParen - Return 1 if the next unexpanded token will return a tok::l_paren token, 0 if it is something else and 2 if there are no more tokens controlled by this lexer.
Definition at line 82 of file PTHLexer.h.
References clang::comments::tok::eof.
bool PTHLexer::Lex | ( | Token & | Tok | ) |
Lex - Return the next token.
Definition at line 45 of file PTHLexer.cpp.
References clang::comments::tok::eof, clang::IdentifierInfo::getTokenID(), clang::Preprocessor::HandleDirective(), clang::Preprocessor::HandleIdentifier(), clang::Token::isAtStartOfLine(), clang::IdentifierInfo::isHandleIdentifierCase(), clang::Token::isLiteral(), clang::PreprocessorLexer::LexingRawMode, clang::PreprocessorLexer::MIOpt, clang::PreprocessorLexer::ParsingPreprocessorDirective, clang::PreprocessorLexer::PP, clang::MultipleIncludeOpt::ReadToken(), clang::Token::setFlag(), clang::Token::setIdentifierInfo(), clang::Token::setKind(), clang::Token::setLength(), clang::Token::setLiteralData(), clang::Token::setLocation(), clang::Token::startToken(), and StoredTokenSize.
Referenced by IndirectLex().
SkipBlock - Used by Preprocessor to skip the current conditional block.
Definition at line 188 of file PTHLexer.cpp.
References StoredTokenSize.
friend class PTHManager [friend] |
Definition at line 61 of file PTHLexer.h.