![]() |
Qt 6.x
The Qt SDK
|
#include <preprocessor.h>
Public Types | |
enum | TokenizeMode { TokenizeCpp , TokenizePreprocessor , PreparePreprocessorStatement , TokenizePreprocessorStatement , TokenizeInclude , PrepareDefine , TokenizeDefine } |
Static Public Member Functions | |
static Symbols | macroExpandIdentifier (Preprocessor *that, SymbolStack &symbols, int lineNum, QByteArray *macroName) |
static void | macroExpand (Symbols *into, Preprocessor *that, const Symbols &toExpand, qsizetype &index, int lineNum, bool one, const QSet< QByteArray > &excludeSymbols=QSet< QByteArray >()) |
static Symbols | tokenize (const QByteArray &input, int lineNum=1, TokenizeMode mode=TokenizeCpp) |
Public Attributes | |
QList< QByteArray > | frameworks |
QSet< QByteArray > | preprocessedIncludes |
QHash< QByteArray, QByteArray > | nonlocalIncludePathResolutionCache |
Macros | macros |
![]() | |
Symbols | symbols |
qsizetype | index |
bool | displayWarnings |
bool | displayNotes |
QList< IncludePath > | includes |
std::stack< QByteArray, QByteArrayList > | currentFilenames |
QList< Function > | m_functions |
QList< Point > | m_points |
QList< Replace > | m_replaces |
QList< QString > | m_prefixes |
QList< QString > | m_metadata |
QList< LineNumber > | m_offsets |
QList< QString > | m_includeDirs |
QString | m_provider |
Static Public Attributes | |
static bool | preprocessOnly = false |
Definition at line 32 of file preprocessor.h.
Enumerator | |
---|---|
TokenizeCpp | |
TokenizePreprocessor | |
PreparePreprocessorStatement | |
TokenizePreprocessorStatement | |
TokenizeInclude | |
PrepareDefine | |
TokenizeDefine |
Definition at line 57 of file preprocessor.h.
|
inline |
Definition at line 35 of file preprocessor.h.
int Preprocessor::evaluateCondition | ( | ) |
Definition at line 951 of file preprocessor.cpp.
References Parser::currentFilenames, substituteUntilNewline(), Parser::symbols, and PP_Expression::value().
|
static |
Definition at line 515 of file preprocessor.cpp.
References SafeSymbols::excludedSymbols, SafeSymbols::expandedMacro, Parser::index, SafeSymbols::index, QByteArray::isEmpty(), QList< T >::isEmpty(), macroExpandIdentifier(), QList< T >::size(), Parser::symbols, and SafeSymbols::symbols.
Referenced by macroExpandIdentifier(), and substituteUntilNewline().
|
static |
Definition at line 556 of file preprocessor.cpp.
References QByteArray::append(), QList< T >::append(), arg, argument, arguments, Macro::arguments, QList< T >::at(), QList< T >::cbegin(), QList< T >::cend(), QList< T >::constLast(), QHash< Key, T >::contains(), Parser::error(), QListSpecialMethodsBase< T >::indexOf(), QList< T >::isEmpty(), Macro::isFunction, Macro::isVariadic, it, QList< T >::last(), Parser::lexem(), Symbol::lexem(), Symbol::lineNum, macroExpand(), macros, Parser::next(), Normal, QList< T >::pop_back(), PP_COMMA, PP_IDENTIFIER, PP_LPAREN, PP_RPAREN, PP_WHITESPACE, QByteArray::prepend(), QByteArray::replace(), QList< T >::size(), Parser::symbols, Macro::symbols, QList< T >::takeLast(), Symbol::token, and QHash< Key, T >::value().
Referenced by macroExpand().
Definition at line 1277 of file preprocessor.cpp.
References arg, arguments, QByteArray::constData(), QListSpecialMethodsBase< T >::contains(), error, Parser::hasNext(), is_identifier(), Parser::lexem(), Parser::next(), PP_COMMA, PP_IDENTIFIER, PP_RPAREN, PP_WHITESPACE, QByteArray::size(), Parser::symbol(), and Parser::test().
Symbols Preprocessor::preprocessed | ( | const QByteArray & | filename, |
QFile * | device | ||
) |
Definition at line 1235 of file preprocessor.cpp.
References cleaned(), file, j, Parser::lexem(), mergeStringLiterals(), readOrMapFile(), QList< T >::size(), QFile::size(), Parser::symbols, Parser::token(), and tokenize().
Referenced by main(), and runMoc().
QByteArray Preprocessor::resolveInclude | ( | const QByteArray & | filename, |
const QByteArray & | relativeTo | ||
) |
Definition at line 1051 of file preprocessor.cpp.
References QFileInfo::canonicalFilePath(), dir, QHash< Key, T >::end(), QFileInfo::exists(), fi, QHash< Key, T >::find(), QString::fromLocal8Bit(), Parser::includes, QHash< Key, T >::insert(), QFileInfo::isDir(), QByteArray::isEmpty(), it, nonlocalIncludePathResolutionCache, searchIncludePaths(), QFileInfo::setFile(), and QString::toLocal8Bit().
Referenced by runMoc().
void Preprocessor::setDebugIncludes | ( | bool | value | ) |
Definition at line 1331 of file preprocessor.cpp.
Referenced by runMoc().
bool Preprocessor::skipBranch | ( | ) |
Definition at line 106 of file preprocessor.cpp.
References QList< T >::at(), Parser::index, QList< T >::size(), skipUntilEndif(), Parser::symbols, and QCss::Symbol::token.
void Preprocessor::skipUntilEndif | ( | ) |
Definition at line 89 of file preprocessor.cpp.
References QList< T >::at(), Parser::index, QList< T >::size(), skipUntilEndif(), Parser::symbols, and QCss::Symbol::token.
Referenced by skipBranch(), and skipUntilEndif().
Definition at line 707 of file preprocessor.cpp.
References QHash< Key, T >::contains(), Parser::hasNext(), macroExpand(), macros, Parser::next(), PP_IDENTIFIER, PP_LPAREN, PP_NEWLINE, PP_RPAREN, Parser::symbol(), Parser::symbols, Parser::test(), Parser::token(), and Symbol::token.
Referenced by evaluateCondition().
|
static |
Definition at line 129 of file preprocessor.cpp.
References begin(), QList< T >::constLast(), defchar, ident, is_ident_char(), QtMiscUtils::isAsciiDigit(), QList< T >::isEmpty(), QtMiscUtils::isHexDigit(), keyword_trans, keywords, QList< T >::last(), Parser::lexem(), Symbol::lineNum, QByteArray::mid(), Parser::next(), PP_BACKSLASH, PP_C_COMMENT, PP_CHARACTER, PP_CHARACTER_LITERAL, PP_CPP_COMMENT, PP_DIGIT, PP_FLOATING_LITERAL, PP_IDENTIFIER, PP_INTEGER_LITERAL, pp_keyword_trans, pp_keywords, PP_LANGLE, PP_NEWLINE, PP_NOT, PP_QUOTE, PP_SINGLEQUOTE, PP_STRING_LITERAL, PP_WHITESPACE, PrepareDefine, PreparePreprocessorStatement, preprocessOnly, Q_FALLTHROUGH, QList< T >::reserve(), skipQuote(), state, Parser::symbols, Parser::token(), Symbol::token, TokenizeCpp, TokenizeDefine, TokenizeInclude, TokenizePreprocessor, TokenizePreprocessorStatement, and Symbol::unquotedLexem().
Referenced by preprocessed(), and runMoc().
QList<QByteArray> Preprocessor::frameworks |
Definition at line 37 of file preprocessor.h.
Macros Preprocessor::macros |
Definition at line 40 of file preprocessor.h.
Referenced by macroExpandIdentifier(), main(), runMoc(), and substituteUntilNewline().
QHash<QByteArray, QByteArray> Preprocessor::nonlocalIncludePathResolutionCache |
Definition at line 39 of file preprocessor.h.
Referenced by resolveInclude().
QSet<QByteArray> Preprocessor::preprocessedIncludes |
Definition at line 38 of file preprocessor.h.
Referenced by runMoc().
|
static |
Definition at line 36 of file preprocessor.h.
Referenced by runMoc(), and tokenize().