class PreprocessorLexer

Declaration

class PreprocessorLexer { /* full declaration omitted */ };

Declared at: clang/include/clang/Lex/PreprocessorLexer.h:30

Member Variables

protected clang::Preprocessor* PP = nullptr
protected const clang::FileID FID
The SourceManager FileID corresponding to the file being lexed.
protected unsigned int InitialNumSLocEntries = 0
Number of SLocEntries before lexing the file.
protected bool ParsingPreprocessorDirective = false
True when parsing # XXX; turns ' \ n' into a tok::eod token.
protected bool ParsingFilename = false
True after # include; turns < xx> or "xxx" into a tok::header_name token.
protected bool LexingRawMode = false
Note that in raw mode that the PP pointer may be null.
protected clang::MultipleIncludeOpt MIOpt
A state machine that detects the # ifndef-wrapping a file idiom for the multiple-include optimization.
protected SmallVector<clang::PPConditionalInfo, 4> ConditionalStack
Information about the set of # if/ # ifdef/ # ifndef blocks we are currently in.

Method Overview

Methods

virtual void IndirectLex(clang::Token& Result)

Declared at: clang/include/clang/Lex/PreprocessorLexer.h:82

Parameters

clang::Token& Result

void LexIncludeFilename(clang::Token& FilenameTok)

Description

Lex a token, producing a header-name token if possible.

Declared at: clang/include/clang/Lex/PreprocessorLexer.h:133

Parameters

clang::Token& FilenameTok

PreprocessorLexer()

Declared at: clang/include/clang/Lex/PreprocessorLexer.h:78

PreprocessorLexer(const clang::PreprocessorLexer&)

Declared at: clang/include/clang/Lex/PreprocessorLexer.h:126

Parameters

const clang::PreprocessorLexer&

PreprocessorLexer(clang::Preprocessor* pp,
                  clang::FileID fid)

Declared at: clang/include/clang/Lex/PreprocessorLexer.h:79

Parameters

clang::Preprocessor* pp
clang::FileID fid

virtual void anchor()

Declared at: clang/include/clang/Lex/PreprocessorLexer.h:31

clang::PreprocessorLexer::conditional_iterator
conditional_begin() const

Declared at: clang/include/clang/Lex/PreprocessorLexer.h:167

clang::PreprocessorLexer::conditional_iterator
conditional_end() const

Declared at: clang/include/clang/Lex/PreprocessorLexer.h:171

unsigned int getConditionalStackDepth() const

Declared at: clang/include/clang/Lex/PreprocessorLexer.h:123

clang::OptionalFileEntryRefDegradesToFileEntryPtr
getFileEntry() const

Description

getFileEntry - Return the FileEntry corresponding to this FileID. Like getFileID(), this only works for lexers with attached preprocessors.

Declared at: clang/include/clang/Lex/PreprocessorLexer.h:160

clang::FileID getFileID() const

Declared at: clang/include/clang/Lex/PreprocessorLexer.h:147

unsigned int getInitialNumSLocEntries() const

Description

Number of SLocEntries before lexing the file.

Declared at: clang/include/clang/Lex/PreprocessorLexer.h:154

clang::Preprocessor* getPP() const

Description

Return the preprocessor object for this lexer.

Declared at: clang/include/clang/Lex/PreprocessorLexer.h:145

virtual clang::SourceLocation getSourceLocation()

Description

Return the source location for the next observable location.

Declared at: clang/include/clang/Lex/PreprocessorLexer.h:85

bool isLexingRawMode() const

Description

Return true if this lexer is in raw mode or not.

Declared at: clang/include/clang/Lex/PreprocessorLexer.h:142

clang::PPConditionalInfo& peekConditionalLevel()

Description

Return the top of the conditional stack.

Declared at: clang/include/clang/Lex/PreprocessorLexer.h:118

bool popConditionalLevel(
    clang::PPConditionalInfo& CI)

Description

popConditionalLevel - Remove an entry off the top of the conditional stack, returning information about it. If the conditional stack is empty, this returns true and does not fill in the arguments.

Declared at: clang/include/clang/Lex/PreprocessorLexer.h:109

Parameters

clang::PPConditionalInfo& CI

void pushConditionalLevel(
    clang::SourceLocation DirectiveStart,
    bool WasSkipping,
    bool FoundNonSkip,
    bool FoundElse)

Description

pushConditionalLevel - When we enter a # if directive, this keeps track of what we are currently in for diagnostic emission (e.g. # if with missing # endif).

Declared at: clang/include/clang/Lex/PreprocessorLexer.h:93

Parameters

clang::SourceLocation DirectiveStart
bool WasSkipping
bool FoundNonSkip
bool FoundElse

void pushConditionalLevel(
    const clang::PPConditionalInfo& CI)

Declared at: clang/include/clang/Lex/PreprocessorLexer.h:102

Parameters

const clang::PPConditionalInfo& CI

void setConditionalLevels(
    ArrayRef<clang::PPConditionalInfo> CL)

Declared at: clang/include/clang/Lex/PreprocessorLexer.h:175

Parameters

ArrayRef<clang::PPConditionalInfo> CL

void setParsingPreprocessorDirective(bool f)

Description

Inform the lexer whether or not we are currently lexing a preprocessor directive.

Declared at: clang/include/clang/Lex/PreprocessorLexer.h:137

Parameters

bool f

virtual ~PreprocessorLexer()

Declared at: clang/include/clang/Lex/PreprocessorLexer.h:80