diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2016-02-19 15:20:39 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2016-02-19 15:26:41 +0000 |
commit | 863a6621d14caf67adcf3f30cb955a268765f0f1 (patch) | |
tree | 259e076b43ea65aec0284e0b2edad95b88f3f764 /src/qdoc/cppcodeparser.h | |
parent | 1735c0c7e68e754aee16aa24fbcd002b174f547e (diff) |
Revert "qdoc: Remove creation of redundant function & variable nodes"
This reverts commit 18fe6a9a5eb4a1c2ce62cd64b42b6db5e581e152.
Because we are changing the C++ parser to clang, we won't need this
anymore.
Task-number: QTBUG-48191
Change-Id: Iacf134ab91517a0eb3e28ea6bce41f74e3c957a0
Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
Diffstat (limited to 'src/qdoc/cppcodeparser.h')
-rw-r--r-- | src/qdoc/cppcodeparser.h | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/src/qdoc/cppcodeparser.h b/src/qdoc/cppcodeparser.h index cc0b0f2fe..ec0448232 100644 --- a/src/qdoc/cppcodeparser.h +++ b/src/qdoc/cppcodeparser.h @@ -51,6 +51,16 @@ class CppCodeParser : public CodeParser { Q_DECLARE_TR_FUNCTIONS(QDoc::CppCodeParser) + struct ExtraFuncData { + Aggregate* root; // Used as the parent. + Node::NodeType type; // The node type: Function, etc. + bool isAttached; // If true, the method is attached. + bool isMacro; // If true, we are parsing a macro signature. + ExtraFuncData() : root(0), type(Node::Function), isAttached(false), isMacro(false) { } + ExtraFuncData(Aggregate* r, Node::NodeType t, bool a) + : root(r), type(t), isAttached(a), isMacro(false) { } + }; + public: CppCodeParser(); ~CppCodeParser(); @@ -109,7 +119,11 @@ protected: bool matchTemplateHeader(); bool matchDataType(CodeChunk *type, QString *var = 0); bool matchParameter(QVector<Parameter>& pvect, bool& isQPrivateSignal); - bool matchDeclaration(Declaration& declData); + bool matchFunctionDecl(Aggregate *parent, + QStringList *parentPathPtr, + FunctionNode **funcPtr, + const QString &templateStuff, + ExtraFuncData& extra); bool matchBaseSpecifier(ClassNode *classe, bool isClass); bool matchBaseList(ClassNode *classe, bool isClass); bool matchClassDecl(Aggregate *parent, @@ -122,22 +136,28 @@ protected: bool matchProperty(Aggregate *parent); bool matchDeclList(Aggregate *parent); bool matchDocsAndStuff(); - bool parseDeclaration(const QString &synopsis, Declaration& declData); + bool makeFunctionNode(const QString &synopsis, + QStringList *parentPathPtr, + FunctionNode **funcPtr, + ExtraFuncData& params); + FunctionNode* makeFunctionNode(const Doc& doc, + const QString& sig, + Aggregate* parent, + Node::NodeType type, + bool attached, + QString qdoctag); void parseQiteratorDotH(const Location &location, const QString &filePath); void instantiateIteratorMacro(const QString &container, const QString &includeFile, const QString ¯oDef); void createExampleFileNodes(DocumentNode *dn); - FunctionNode* createFunctionNode(Declaration& declData); - VariableNode* createVariableNode(Declaration& declData); int matchFunctionModifier(); - void matchVariableDecl(Declaration& declData); protected: QMap<QString, Node::NodeType> nodeTypeMap; Tokenizer *tokenizer; int tok; - Node::Access access_; + Node::Access access; FunctionNode::Metaness metaness_; QString physicalModuleName; QStringList lastPath_; |