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
- protected virtual void IndirectLex(clang::Token & Result)
- public void LexIncludeFilename(clang::Token & FilenameTok)
- protected PreprocessorLexer()
- public PreprocessorLexer(const clang::PreprocessorLexer &)
- protected PreprocessorLexer(clang::Preprocessor * pp, clang::FileID fid)
- private virtual void anchor()
- public clang::PreprocessorLexer::conditional_iterator conditional_begin() const
- public clang::PreprocessorLexer::conditional_iterator conditional_end() const
- protected unsigned int getConditionalStackDepth() const
- public clang::OptionalFileEntryRefDegradesToFileEntryPtr getFileEntry() const
- public clang::FileID getFileID() const
- public unsigned int getInitialNumSLocEntries() const
- public clang::Preprocessor * getPP() const
- protected virtual clang::SourceLocation getSourceLocation()
- public bool isLexingRawMode() const
- protected clang::PPConditionalInfo & peekConditionalLevel()
- protected bool popConditionalLevel(clang::PPConditionalInfo & CI)
- protected void pushConditionalLevel(clang::SourceLocation DirectiveStart, bool WasSkipping, bool FoundNonSkip, bool FoundElse)
- protected void pushConditionalLevel(const clang::PPConditionalInfo & CI)
- public void setConditionalLevels(ArrayRef<clang::PPConditionalInfo> CL)
- public void setParsingPreprocessorDirective(bool f)
- protected virtual ~PreprocessorLexer()
Methods
¶virtual void IndirectLex(clang::Token& Result)
virtual void IndirectLex(clang::Token& Result)
Declared at: clang/include/clang/Lex/PreprocessorLexer.h:82
Parameters
- clang::Token& Result
¶void LexIncludeFilename(clang::Token& FilenameTok)
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()
PreprocessorLexer()
Declared at: clang/include/clang/Lex/PreprocessorLexer.h:78
¶PreprocessorLexer(const clang::PreprocessorLexer&)
PreprocessorLexer(const clang::PreprocessorLexer&)
Declared at: clang/include/clang/Lex/PreprocessorLexer.h:126
Parameters
- const clang::PreprocessorLexer&
¶PreprocessorLexer(clang::Preprocessor* pp,
clang::FileID fid)
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()
virtual void anchor()
Declared at: clang/include/clang/Lex/PreprocessorLexer.h:31
¶clang::PreprocessorLexer::conditional_iterator
conditional_begin() const
clang::PreprocessorLexer::conditional_iterator
conditional_begin() const
Declared at: clang/include/clang/Lex/PreprocessorLexer.h:167
¶clang::PreprocessorLexer::conditional_iterator
conditional_end() const
clang::PreprocessorLexer::conditional_iterator
conditional_end() const
Declared at: clang/include/clang/Lex/PreprocessorLexer.h:171
¶unsigned int getConditionalStackDepth() const
unsigned int getConditionalStackDepth() const
Declared at: clang/include/clang/Lex/PreprocessorLexer.h:123
¶clang::OptionalFileEntryRefDegradesToFileEntryPtr
getFileEntry() const
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
clang::FileID getFileID() const
Declared at: clang/include/clang/Lex/PreprocessorLexer.h:147
¶unsigned int getInitialNumSLocEntries() const
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
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()
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
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()
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)
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
¶void pushConditionalLevel(
clang::SourceLocation DirectiveStart,
bool WasSkipping,
bool FoundNonSkip,
bool FoundElse)
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)
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)
void setConditionalLevels(
ArrayRef<clang::PPConditionalInfo> CL)
Declared at: clang/include/clang/Lex/PreprocessorLexer.h:175
Parameters
- ArrayRef<clang::PPConditionalInfo> CL
¶void setParsingPreprocessorDirective(bool f)
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()
virtual ~PreprocessorLexer()
Declared at: clang/include/clang/Lex/PreprocessorLexer.h:80