Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include <cppcodeparser.h>
Public Member Functions | |
CppCodeParser (FnCommandParser &&parser) | |
FunctionNode * | parseMacroArg (const Location &location, const QString ¯oArg) |
Parse the macro arguments in macroArg ad hoc, without using any actual parser. | |
FunctionNode * | parseOtherFuncArg (const QString &topic, const Location &location, const QString &funcArg) |
Parse QML signal/method topic commands. | |
std::pair< std::vector< TiedDocumentation >, std::vector< FnMatchError > > | processTopicArgs (const UntiedDocumentation &untied) |
void | processMetaCommand (const Doc &doc, const QString &command, const ArgPair &argLocPair, Node *node) |
Process the metacommand command in the context of the node associated with the topic command and the doc. | |
void | processMetaCommands (const Doc &doc, Node *node) |
The topic command has been processed, and now doc and node are passed to this function to get the metacommands from doc and process them one at a time. | |
void | processMetaCommands (const std::vector< TiedDocumentation > &tied) |
Static Public Member Functions | |
static bool | isQMLMethodTopic (const QString &t) |
returns true if t is {qmlsignal}, {qmlmethod}, {qmlattachedsignal}, or {qmlattachedmethod}. | |
static bool | isQMLPropertyTopic (const QString &t) |
Returns true if t is {qmlproperty}, {qmlpropertygroup}, or {qmlattachedproperty}. | |
Static Public Attributes | |
static const QSet< QString > | topic_commands |
static const QSet< QString > | meta_commands |
Protected Member Functions | |
virtual Node * | processTopicCommand (const Doc &doc, const QString &command, const ArgPair &arg) |
Process the topic command found in the doc with argument arg. | |
std::vector< TiedDocumentation > | processQmlProperties (const UntiedDocumentation &untied) |
bool | splitQmlPropertyArg (const QString &arg, QString &type, QString &module, QString &element, QString &name, const Location &location) |
A QML property argument has the form... | |
Definition at line 19 of file cppcodeparser.h.
|
explicit |
Definition at line 53 of file cppcodeparser.cpp.
References CppCodeParser().
Referenced by CppCodeParser(), and processQdocconfFile().
|
static |
returns true if t is {qmlsignal}, {qmlmethod}, {qmlattachedsignal}, or {qmlattachedmethod}.
Definition at line 841 of file cppcodeparser.cpp.
|
static |
Returns true if t is {qmlproperty}, {qmlpropertygroup}, or {qmlattachedproperty}.
Definition at line 851 of file cppcodeparser.cpp.
FunctionNode * CppCodeParser::parseMacroArg | ( | const Location & | location, |
const QString & | macroArg ) |
Parse the macro arguments in macroArg ad hoc, without using any actual parser.
If successful, return a pointer to the new FunctionNode for the macro. Otherwise return null. location is used for reporting errors.
Definition at line 726 of file cppcodeparser.cpp.
References Node< _Tp >::doc(), FunctionNode::MacroWithoutParams, FunctionNode::MacroWithParams, Node< _Tp >::parent(), QDocDatabase::primaryTreeRoot(), and QDocDatabase::qdocDB().
FunctionNode * CppCodeParser::parseOtherFuncArg | ( | const QString & | topic, |
const Location & | location, | ||
const QString & | funcArg ) |
Parse QML signal/method topic commands.
Definition at line 656 of file cppcodeparser.cpp.
References QDocDatabase::primaryTreeRoot(), QDocDatabase::qdocDB(), and Node< _Tp >::QmlType.
void CppCodeParser::processMetaCommand | ( | const Doc & | doc, |
const QString & | command, | ||
const ArgPair & | argPair, | ||
Node * | node ) |
Process the metacommand command in the context of the node associated with the topic command and the doc.
arg is the argument to the metacommand.
node is guaranteed to be non-null.
Definition at line 345 of file cppcodeparser.cpp.
References QDocDatabase::addExampleNode(), Node< _Tp >::Deprecated, Node< _Tp >::isAggregate(), Node< _Tp >::isCollectionNode(), Node< _Tp >::isExample(), Node< _Tp >::isFunction(), Node< _Tp >::isInternal(), Node< _Tp >::isModule(), Node< _Tp >::isQmlModule(), Node< _Tp >::isQmlProperty(), Node< _Tp >::isQmlType(), Node< _Tp >::isSharedCommentNode(), Node< _Tp >::isTextPageNode(), CodeParser::isWorthWarningAbout(), Doc::location(), PageNode::markAttribution(), Node< _Tp >::markDefault(), Node< _Tp >::markInternal(), Node< _Tp >::markReadOnly(), Node< _Tp >::NonReentrant, FunctionNode::overridesThis(), Node< _Tp >::parent(), Node< _Tp >::Preliminary, QDocDatabase::qdocDB(), Node< _Tp >::Reentrant, Node< _Tp >::setAbstract(), PageNode::setNoAutoList(), FunctionNode::setOverloadFlag(), SharedCommentNode::setOverloadFlags(), FunctionNode::setReimpFlag(), QmlPropertyNode::setRequired(), Node< _Tp >::setStatus(), Node< _Tp >::setThreadSafeness(), Node< _Tp >::setWrapper(), and Node< _Tp >::ThreadSafe.
The topic command has been processed, and now doc and node are passed to this function to get the metacommands from doc and process them one at a time.
node is the node where doc resides.
Definition at line 620 of file cppcodeparser.cpp.
References Node< _Tp >::isSharedCommentNode().
Referenced by parseSourceFiles().
void CppCodeParser::processMetaCommands | ( | const std::vector< TiedDocumentation > & | tied | ) |
Definition at line 969 of file cppcodeparser.cpp.
|
protected |
Definition at line 243 of file cppcodeparser.cpp.
References UntiedDocumentation::documentation, Doc::location(), QDocDatabase::primaryTreeRoot(), QDocDatabase::qdocDB(), Node< _Tp >::QmlType, Node< _Tp >::setLocation(), splitQmlPropertyArg(), Doc::startLocation(), and Doc::topicsUsed().
std::pair< std::vector< TiedDocumentation >, std::vector< FnMatchError > > CppCodeParser::processTopicArgs | ( | const UntiedDocumentation & | untied | ) |
Definition at line 857 of file cppcodeparser.cpp.
|
protectedvirtual |
Process the topic command found in the doc with argument arg.
Definition at line 81 of file cppcodeparser.cpp.
References Node< _Tp >::access(), Tree::camelCaseModuleName(), Node< _Tp >::Class, Config::generateExamples, Node< _Tp >::isAggregate(), Node< _Tp >::isTypeAlias(), CodeParser::isWorthWarningAbout(), Doc::location(), Node< _Tp >::location(), CollectionNode::markSeen(), NamespaceNode::markSeen(), Node< _Tp >::Namespace, Node< _Tp >::parent(), QDocDatabase::primaryTreeRoot(), QDocDatabase::qdocDB(), Node< _Tp >::QmlType, Node< _Tp >::QmlValueType, Node< _Tp >::setAccess(), Node< _Tp >::setLocation(), Node< _Tp >::setTemplateDecl(), Doc::startLocation(), NamespaceNode::tree(), and Node< _Tp >::Variable.
|
protected |
A QML property argument has the form...
<type> <QML-type>::<name> <type> <QML-module>::<QML-type>::<name>
This function splits the argument into one of those two forms. The three part form is the old form, which was used before the creation of Qt Quick 2 and Qt Components. A <QML-module> is the QML equivalent of a C++ namespace. So this function splits arg on "::" and stores the parts in type, module, qmlTypeName, and name, and returns true
. If any part other than module is not found, a qdoc warning is emitted and false is returned.
Definition at line 215 of file cppcodeparser.cpp.
Referenced by processQmlProperties().
Definition at line 33 of file cppcodeparser.h.
Definition at line 22 of file cppcodeparser.h.