Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
CppCodeParser Class Reference

#include <cppcodeparser.h>

+ Collaboration diagram for CppCodeParser:

Public Member Functions

 CppCodeParser (FnCommandParser &&parser)
 
FunctionNodeparseMacroArg (const Location &location, const QString &macroArg)
 Parse the macro arguments in macroArg ad hoc, without using any actual parser.
 
FunctionNodeparseOtherFuncArg (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< QStringtopic_commands
 
static const QSet< QStringmeta_commands
 

Protected Member Functions

virtual NodeprocessTopicCommand (const Doc &doc, const QString &command, const ArgPair &arg)
 Process the topic command found in the doc with argument arg.
 
std::vector< TiedDocumentationprocessQmlProperties (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...
 

Detailed Description

Definition at line 19 of file cppcodeparser.h.

Constructor & Destructor Documentation

◆ CppCodeParser()

CppCodeParser::CppCodeParser ( FnCommandParser && parser)
explicit

Definition at line 53 of file cppcodeparser.cpp.

References CppCodeParser().

Referenced by CppCodeParser(), and processQdocconfFile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Function Documentation

◆ isQMLMethodTopic()

bool CppCodeParser::isQMLMethodTopic ( const QString & t)
static

returns true if t is {qmlsignal}, {qmlmethod}, {qmlattachedsignal}, or {qmlattachedmethod}.

Definition at line 841 of file cppcodeparser.cpp.

◆ isQMLPropertyTopic()

bool CppCodeParser::isQMLPropertyTopic ( const QString & t)
static

Returns true if t is {qmlproperty}, {qmlpropertygroup}, or {qmlattachedproperty}.

Definition at line 851 of file cppcodeparser.cpp.

◆ parseMacroArg()

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().

+ Here is the call graph for this function:

◆ parseOtherFuncArg()

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.

+ Here is the call graph for this function:

◆ processMetaCommand()

void CppCodeParser::processMetaCommand ( const Doc & doc,
const QString & command,
const ArgPair & argPair,
Node * node )

◆ processMetaCommands() [1/2]

void CppCodeParser::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.

node is the node where doc resides.

Definition at line 620 of file cppcodeparser.cpp.

References Node< _Tp >::isSharedCommentNode().

Referenced by parseSourceFiles().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ processMetaCommands() [2/2]

void CppCodeParser::processMetaCommands ( const std::vector< TiedDocumentation > & tied)

Definition at line 969 of file cppcodeparser.cpp.

◆ processQmlProperties()

std::vector< TiedDocumentation > CppCodeParser::processQmlProperties ( const UntiedDocumentation & untied)
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().

+ Here is the call graph for this function:

◆ processTopicArgs()

std::pair< std::vector< TiedDocumentation >, std::vector< FnMatchError > > CppCodeParser::processTopicArgs ( const UntiedDocumentation & untied)

Definition at line 857 of file cppcodeparser.cpp.

◆ processTopicCommand()

Node * CppCodeParser::processTopicCommand ( const Doc & doc,
const QString & command,
const ArgPair & arg )
protectedvirtual

◆ splitQmlPropertyArg()

bool CppCodeParser::splitQmlPropertyArg ( const QString & arg,
QString & type,
QString & module,
QString & qmlTypeName,
QString & name,
const Location & location )
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.

Note
The two QML types {Component} and {QtObject} never have a module qualifier.

Definition at line 215 of file cppcodeparser.cpp.

Referenced by processQmlProperties().

+ Here is the caller graph for this function:

Member Data Documentation

◆ meta_commands

const QSet<QString> CppCodeParser::meta_commands
inlinestatic
Initial value:
static const QSet< QString > common_meta_commands
Definition codeparser.h:108
Definition qset.h:19
#define COMMAND_NEXTPAGE
Definition codeparser.h:39
#define COMMAND_RELATES
Definition codeparser.h:72
#define COMMAND_QMLNATIVETYPE
Definition codeparser.h:60
#define COMMAND_OVERLOAD
Definition codeparser.h:43
#define COMMAND_COMPARESWITH
Definition codeparser.h:19
#define COMMAND_REIMP
Definition codeparser.h:71
#define COMMAND_INHEADERFILE
Definition codeparser.h:30
#define COMMAND_PREVIOUSPAGE
Definition codeparser.h:46
#define COMMAND_COMPARES
Definition codeparser.h:18
#define COMMAND_QMLINSTANTIATES
Definition codeparser.h:57

Definition at line 33 of file cppcodeparser.h.

◆ topic_commands

const QSet<QString> CppCodeParser::topic_commands
inlinestatic
Initial value:
{
}
#define COMMAND_ENUM
Definition codeparser.h:23
#define COMMAND_HEADERFILE
Definition codeparser.h:28
#define COMMAND_EXTERNALPAGE
Definition codeparser.h:25
#define COMMAND_MODULE
Definition codeparser.h:36
#define COMMAND_QMLSIGNAL
Definition codeparser.h:65
#define COMMAND_STRUCT
Definition codeparser.h:74
#define COMMAND_QMLPROPERTYGROUP
Definition codeparser.h:62
#define COMMAND_PROPERTY
Definition codeparser.h:47
#define COMMAND_CLASS
Definition codeparser.h:14
#define COMMAND_NAMESPACE
Definition codeparser.h:38
#define COMMAND_QMLMODULE
Definition codeparser.h:59
#define COMMAND_QMLPROPERTY
Definition codeparser.h:61
#define COMMAND_FN
Definition codeparser.h:26
#define COMMAND_QMLATTACHEDPROPERTY
Definition codeparser.h:50
#define COMMAND_UNION
Definition codeparser.h:83
#define COMMAND_MACRO
Definition codeparser.h:35
#define COMMAND_GROUP
Definition codeparser.h:27
#define COMMAND_VARIABLE
Definition codeparser.h:81
#define COMMAND_QMLBASICTYPE
Definition codeparser.h:88
#define COMMAND_PAGE
Definition codeparser.h:44
#define COMMAND_EXAMPLE
Definition codeparser.h:24
#define COMMAND_TYPEDEF
Definition codeparser.h:80
#define COMMAND_QMLMETHOD
Definition codeparser.h:58
#define COMMAND_DONTDOCUMENT
Definition codeparser.h:22
#define COMMAND_QMLVALUETYPE
Definition codeparser.h:52
#define COMMAND_TYPEALIAS
Definition codeparser.h:79
#define COMMAND_QMLTYPE
Definition codeparser.h:66
#define COMMAND_QMLATTACHEDMETHOD
Definition codeparser.h:49
#define COMMAND_QMLATTACHEDSIGNAL
Definition codeparser.h:51

Definition at line 22 of file cppcodeparser.h.


The documentation for this class was generated from the following files: