![]() |
Qt 6.x
The Qt SDK
|
#include <parser.h>
Classes | |
struct | IncludePath |
Public Attributes | |
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 |
|
inline |
Definition at line 45 of file parser.h.
References QList< T >::append(), list, and m_includeDirs.
Referenced by main().
void Parser::addIncludesRecursive | ( | const QString & | filename, |
QStringList & | includes | ||
) |
Definition at line 491 of file parser.cpp.
References QFileInfo::absoluteFilePath(), QFileInfo::absolutePath(), addIncludesRecursive(), Qt::CaseInsensitive, DEBUGPRINTF, QFileInfo::exists(), QFileInfo::fileName(), QRegularExpression::globalMatch(), i, includes, info, QString::isEmpty(), line, match(), qPrintable, QStringLiteral, QIODeviceBase::ReadOnly, resolveInclude(), QString::startsWith(), QIODeviceBase::Text, and QString::trimmed().
Referenced by addIncludesRecursive(), and parse().
Definition at line 50 of file parser.cpp.
References QByteArray::data(), Symbol::lexem(), Symbol::lineNum, and printMsg().
Referenced by error(), and error().
Definition at line 64 of file parser.cpp.
References defaultErrorMsg(), error_msg, printMsg(), and symbol().
Definition at line 58 of file parser.cpp.
References defaultErrorMsg().
Referenced by Generator::generateCode(), and Preprocessor::macroExpandIdentifier().
QStringList Parser::findEnumValues | ( | const QString & | name, |
const QStringList & | includes | ||
) |
Definition at line 237 of file parser.cpp.
References begin(), DEBUGPRINTF, e, QRegularExpression::globalMatch(), i, includes, QByteArrayView::isEmpty(), line, match(), QString::mid(), pos, qPrintable, QStringLiteral, QIODeviceBase::ReadOnly, ret, simplifyData(), QString::split(), split(), QByteArrayView::startsWith(), QIODeviceBase::Text, and QString::trimmed().
Referenced by parseMetadata().
|
inline |
Definition at line 34 of file parser.h.
References QList< T >::size(), and symbols.
Referenced by Moc::parse(), Preprocessor::parseDefineArguments(), Moc::parseFunctionArguments(), Moc::parseSignals(), Moc::parseSlots(), and Preprocessor::substituteUntilNewline().
|
inline |
Definition at line 62 of file parser.h.
References QList< T >::isEmpty(), m_functions, and m_points.
Referenced by main().
|
inline |
Definition at line 44 of file parser.h.
References QList< T >::at(), QCss::Symbol::lexem(), and symbols.
Referenced by Moc::createPropertyDef(), Preprocessor::macroExpandIdentifier(), Moc::parse(), Moc::parseClassHead(), Moc::parseDeclareInterface(), Preprocessor::parseDefineArguments(), Moc::parseEnum(), Moc::parseEnumOrFlag(), Moc::parseFlag(), Moc::parseFunctionArguments(), Moc::parseInterfaces(), Moc::parsePluginData(), Moc::parsePropertyAccessor(), Moc::parsePropertyAttributes(), Moc::parseSlotInPrivate(), Moc::parseType(), Preprocessor::preprocessed(), PP_Expression::primary_expression(), and Preprocessor::tokenize().
int Parser::lineNumber | ( | qsizetype | offset | ) | const |
Definition at line 131 of file parser.cpp.
References QString::begin(), DEBUGPRINTF, QString::end(), line, m_offsets, and QList< T >::size().
Referenced by parse(), and parseParamReplace().
|
inline |
Definition at line 68 of file parser.h.
References QList< T >::at(), QList< T >::size(), symbols, and QCss::Symbol::token.
Referenced by Moc::parse(), Moc::parseClassHead(), Moc::parseEnum(), Moc::parseFunction(), Moc::parseMaybeFunction(), Moc::parseType(), PP_Expression::primary_expression_lookup(), and PP_Expression::unary_expression_lookup().
|
inline |
Definition at line 35 of file parser.h.
References QList< T >::at(), QList< T >::size(), symbols, and QCss::Symbol::token.
Referenced by PP_Expression::additive_expression(), Moc::createPropertyDef(), PP_Expression::equality_expression(), Moc::lexemUntil(), Preprocessor::macroExpandIdentifier(), PP_Expression::multiplicative_expression(), Moc::parse(), Moc::parseClassInfo(), Moc::parseDeclareInterface(), Moc::parseDeclareMetatype(), Preprocessor::parseDefineArguments(), Moc::parseEnum(), Moc::parseEnumOrFlag(), Moc::parseFlag(), Moc::parseFunction(), Moc::parseInterfaces(), Moc::parseMocInclude(), Moc::parsePluginData(), Moc::parsePrivateProperty(), Moc::parseProperty(), Moc::parsePropertyAccessor(), Moc::parsePropertyAttributes(), Moc::parseRevision(), Moc::parseSignals(), Moc::parseSlotInPrivate(), Moc::parseSlots(), Moc::parseType(), PP_Expression::primary_expression(), PP_Expression::relational_expression(), PP_Expression::shift_expression(), Preprocessor::substituteUntilNewline(), Preprocessor::tokenize(), and PP_Expression::unary_expression().
Definition at line 86 of file parser.cpp.
References displayNotes, printMsg(), and symbol().
Definition at line 536 of file parser.cpp.
References addIncludesRecursive(), Qt::CaseInsensitive, QRegularExpression::globalMatch(), i, includes, QString::isEmpty(), QString::length(), line, lineNumber(), m_functions, m_offsets, m_replaces, match(), parseInstrument(), parseMetadata(), parseParamReplace(), parsePoint(), parsePrefix(), prev(), QList< T >::push_back(), QStringLiteral, resolveInclude(), simplifyData(), QString::startsWith(), and QString::trimmed().
Referenced by main(), and QQmlJSTypeDescriptionReader::operator()().
Definition at line 159 of file parser.cpp.
References begin(), DEBUGPRINTF, QString::indexOf(), m_functions, m_provider, QString::mid(), QList< T >::push_back(), qPrintable, QStringLiteral, and QString::simplified().
Referenced by parse().
void Parser::parseMetadata | ( | const QString & | data, |
qsizetype | offset, | ||
const QStringList & | includes | ||
) |
Definition at line 367 of file parser.cpp.
References QList< T >::append(), QRegularExpressionMatch::captured(), QListSpecialMethodsBase< T >::contains(), DEBUGPRINTF, DEBUGPRINTF2, enumsToValues(), findEnumValues(), QRegularExpression::globalMatch(), i, includes, QString::indexOf(), iter, QString::length(), m_metadata, m_provider, match(), QString::mid(), panic(), preprocessMetadata(), prev(), qPrintable, QStringLiteral, and QString::simplified().
Referenced by parse().
Definition at line 142 of file parser.cpp.
References QString::append(), DEBUGPRINTF, QString::endsWith(), Replace::in, QString::indexOf(), QString::left(), lineNumber(), m_replaces, QString::mid(), Replace::out, panic(), QList< T >::push_back(), qPrintable, QString::right(), and QString::simplified().
Referenced by parse().
Definition at line 192 of file parser.cpp.
References DEBUGPRINTF, QString::indexOf(), m_points, m_provider, QString::mid(), Point::name, Point::parameters, QList< T >::push_back(), qPrintable, and QString::simplified().
Referenced by parse().
Definition at line 219 of file parser.cpp.
References QListSpecialMethodsBase< T >::contains(), DEBUGPRINTF, QString::indexOf(), m_prefixes, m_provider, QString::mid(), preprocessMetadata(), QList< T >::push_back(), qPrintable, and QString::simplified().
Referenced by parse().
|
inline |
Definition at line 36 of file parser.h.
References QList< T >::at(), QList< T >::size(), symbols, and QCss::Symbol::token.
Referenced by Moc::parsePropertyAccessor().
|
inline |
Definition at line 40 of file parser.h.
References index.
Referenced by PP_Expression::additive_expression(), PP_Expression::equality_expression(), Moc::lexemUntil(), PP_Expression::multiplicative_expression(), parse(), Moc::parseFunction(), parseMetadata(), Moc::parsePropertyAttributes(), Moc::parseSignals(), Moc::parseSlots(), Moc::parseType(), PP_Expression::relational_expression(), PP_Expression::shift_expression(), and PP_Expression::unary_expression().
void Parser::printMsg | ( | QByteArrayView | formatStringSuffix, |
QByteArrayView | msg, | ||
const Symbol & | sym | ||
) |
Base implementation for printing diagnostic messages.
For example: "/path/to/file:line:column: error: %s\n" 's' is replaced by msg. (Currently "column" is always 1).
If sym.lineNum is -1, the line and column parts aren't printed: "/path/to/file: error: %s\n"
formatStringSuffix specifies the type of the message e.g.: "error: %s\n" "warning: %s\n" "note: %s\n" "Parse error at %s\n" (from defaultErrorMsg())
Definition at line 33 of file parser.cpp.
References currentFilenames, QByteArrayView::data(), and Symbol::lineNum.
Referenced by defaultErrorMsg(), error(), note(), and warning().
Definition at line 478 of file parser.cpp.
References QFileInfo::absoluteFilePath(), QFileInfo::exists(), info, m_includeDirs, and sp.
Referenced by addIncludesRecursive(), and parse().
|
inline |
Definition at line 46 of file parser.h.
References QList< T >::at(), and symbols.
Referenced by error(), note(), Moc::parse(), Moc::parseClassInfo(), Preprocessor::parseDefineArguments(), Moc::parseEnum(), Moc::parsePropertyAttributes(), Preprocessor::substituteUntilNewline(), and warning().
|
inline |
Definition at line 42 of file parser.h.
References QList< T >::at(), and symbols.
Definition at line 47 of file parser.h.
References QList< T >::at(), and symbols.
Referenced by Moc::checkProperties().
|
inline |
Definition at line 59 of file parser.h.
References QList< T >::at(), index, QList< T >::size(), symbols, QCss::Symbol::token, and token().
Referenced by PP_Expression::AND_expression(), PP_Expression::conditional_expression(), PP_Expression::exclusive_OR_expression(), PP_Expression::inclusive_OR_expression(), PP_Expression::logical_AND_expression(), PP_Expression::logical_OR_expression(), next(), next(), Moc::parse(), Moc::parseClassHead(), Moc::parseClassInfo(), Moc::parseDeclareInterface(), Preprocessor::parseDefineArguments(), Moc::parseEnum(), Moc::parseEnumOrFlag(), Moc::parseFlag(), Moc::parseFunction(), Moc::parseFunctionArguments(), Moc::parseInterfaces(), Moc::parseMaybeFunction(), Moc::parsePluginData(), Moc::parsePropertyAttributes(), Moc::parseSignals(), Moc::parseSlotInPrivate(), Moc::parseSlots(), Moc::parseType(), PP_Expression::primary_expression(), Moc::skipCxxAttributes(), Preprocessor::substituteUntilNewline(), Moc::testForFunctionModifiers(), and Moc::testFunctionRevision().
|
inline |
Definition at line 43 of file parser.h.
References QList< T >::at(), symbols, and QCss::Symbol::token.
Referenced by next(), next(), Moc::parseClassHead(), Preprocessor::preprocessed(), Preprocessor::substituteUntilNewline(), test(), and Preprocessor::tokenize().
|
inline |
Definition at line 45 of file parser.h.
References QList< T >::at(), and symbols.
Referenced by Moc::parse(), and Moc::parsePluginData().
Definition at line 82 of file parser.cpp.
References symbol(), and warning().
Referenced by Moc::checkProperties(), Moc::checkSuperClasses(), Moc::parseFunction(), Moc::parseMaybeFunction(), Moc::parsePluginData(), Moc::parsePropertyAttributes(), Moc::parseSignals(), and warning().
void Parser::warning | ( | const Symbol & | sym, |
QByteArrayView | msg | ||
) |
Definition at line 76 of file parser.cpp.
References displayWarnings, and printMsg().
Definition at line 592 of file parser.cpp.
References m_functions, m_metadata, m_points, m_prefixes, out, QStringLiteral, and QList< T >::size().
Referenced by main().
std::stack<QByteArray, QByteArrayList> Parser::currentFilenames |
Definition at line 32 of file parser.h.
Referenced by Preprocessor::evaluateCondition(), Moc::parse(), Moc::parseEnum(), Moc::parsePluginData(), and printMsg().
QList<IncludePath> Parser::includes |
Definition at line 30 of file parser.h.
Referenced by addIncludesRecursive(), findEnumValues(), parse(), parseMetadata(), Moc::parsePluginData(), Preprocessor::resolveInclude(), and runMoc().
qsizetype Parser::index |
Definition at line 19 of file parser.h.
Referenced by Moc::createPropertyDef(), Moc::lexemUntil(), Preprocessor::macroExpand(), Moc::parse(), Moc::parseClassHead(), prev(), Preprocessor::skipBranch(), Moc::skipCxxAttributes(), Preprocessor::skipUntilEndif(), test(), Moc::testFunctionAttribute(), and Moc::until().
Definition at line 73 of file parser.h.
Referenced by addIncludeDirs(), and resolveInclude().
Definition at line 71 of file parser.h.
Referenced by parseMetadata(), and write().
QList<LineNumber> Parser::m_offsets |
Definition at line 72 of file parser.h.
Referenced by lineNumber(), and parse().
Definition at line 68 of file parser.h.
Referenced by isEmpty(), parsePoint(), and write().
Definition at line 70 of file parser.h.
Referenced by parsePrefix(), and write().
QString Parser::m_provider |
Definition at line 74 of file parser.h.
Referenced by parseInstrument(), parseMetadata(), parsePoint(), and parsePrefix().
Definition at line 69 of file parser.h.
Referenced by parse(), and parseParamReplace().
Symbols Parser::symbols |
Definition at line 18 of file parser.h.
Referenced by Preprocessor::evaluateCondition(), hasNext(), lexem(), Moc::lexemUntil(), lookup(), Preprocessor::macroExpand(), Preprocessor::macroExpandIdentifier(), next(), peek(), Preprocessor::preprocessed(), Preprocessor::skipBranch(), Preprocessor::skipUntilEndif(), Preprocessor::substituteUntilNewline(), symbol(), symbol_lookup(), symbolAt(), test(), Moc::testFunctionAttribute(), token(), Preprocessor::tokenize(), unquotedLexem(), and Moc::until().