Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
|
#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 |
Public Attributes inherited from Parser | |
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 28 of file preprocessor.h.
Enumerator | |
---|---|
TokenizeCpp | |
TokenizePreprocessor | |
PreparePreprocessorStatement | |
TokenizePreprocessorStatement | |
TokenizeInclude | |
PrepareDefine | |
TokenizeDefine |
Definition at line 53 of file preprocessor.h.
|
inline |
Definition at line 31 of file preprocessor.h.
int Preprocessor::evaluateCondition | ( | ) |
Definition at line 949 of file preprocessor.cpp.
References Parser::currentFilenames, substituteUntilNewline(), Parser::symbols, and PP_Expression::value().
|
static |
Definition at line 509 of file preprocessor.cpp.
References Parser::index, macroExpandIdentifier(), QList< T >::size(), Parser::symbols, and SafeSymbols::symbols.
Referenced by macroExpandIdentifier(), and substituteUntilNewline().
|
static |
Definition at line 550 of file preprocessor.cpp.
References QByteArray::append(), arg, argument, arguments, QList< T >::at(), QSet< T >::cbegin(), QList< T >::cend(), it, Parser::lexem(), Symbol::lexem(), macroExpand(), Parser::next(), Normal, PP_COMMA, PP_IDENTIFIER, PP_LPAREN, PP_RPAREN, PP_WHITESPACE, QByteArray::prepend(), QByteArray(), QByteArray::replace(), QList< T >::size(), Parser::symbols, and Symbol::token.
Referenced by macroExpand().
Definition at line 1275 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 1233 of file preprocessor.cpp.
References cleaned(), file, j, Parser::lexem(), mergeStringLiterals(), readOrMapFile(), QList< T >::size(), QFile::size(), Parser::symbols, Parser::token(), and tokenize().
QByteArray Preprocessor::resolveInclude | ( | const QByteArray & | filename, |
const QByteArray & | relativeTo ) |
Definition at line 1049 of file preprocessor.cpp.
References dir, QHash< Key, T >::end(), QHash< Key, T >::find(), QString::fromLocal8Bit(), Parser::includes, QHash< Key, T >::insert(), it, nonlocalIncludePathResolutionCache, searchIncludePaths(), and QFileInfo::setFile().
void Preprocessor::setDebugIncludes | ( | bool | value | ) |
Definition at line 1329 of file preprocessor.cpp.
bool Preprocessor::skipBranch | ( | ) |
Definition at line 106 of file preprocessor.cpp.
References QList< T >::at(), Parser::index, QList< T >::size(), skipUntilEndif(), Parser::symbols, and 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 Symbol::token.
Referenced by skipBranch(), and skipUntilEndif().
Definition at line 701 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(), and Parser::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 33 of file preprocessor.h.
Macros Preprocessor::macros |
Definition at line 36 of file preprocessor.h.
Referenced by substituteUntilNewline().
QHash<QByteArray, QByteArray> Preprocessor::nonlocalIncludePathResolutionCache |
Definition at line 35 of file preprocessor.h.
Referenced by resolveInclude().
QSet<QByteArray> Preprocessor::preprocessedIncludes |
Definition at line 34 of file preprocessor.h.
|
static |
Definition at line 32 of file preprocessor.h.
Referenced by tokenize().