From dc3102a535b404f074a3b21be7cb0b1315d69bec Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 26 Aug 2014 17:45:59 +0200 Subject: [PATCH] Pass the node the Doxygen comment is attached to to DoxygenParser. This will be needed to take into account various Doxygen-specific features that can be attached to this node. --- Source/DoxygenTranslator/src/DoxygenParser.cpp | 12 ++++++++---- Source/DoxygenTranslator/src/DoxygenParser.h | 8 +++++--- Source/DoxygenTranslator/src/JavaDocConverter.cpp | 3 +-- Source/DoxygenTranslator/src/PyDocConverter.cpp | 8 ++------ 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/Source/DoxygenTranslator/src/DoxygenParser.cpp b/Source/DoxygenTranslator/src/DoxygenParser.cpp index 13c40dee1..0f6e18943 100644 --- a/Source/DoxygenTranslator/src/DoxygenParser.cpp +++ b/Source/DoxygenTranslator/src/DoxygenParser.cpp @@ -954,12 +954,16 @@ DoxygenEntityList DoxygenParser::parse(TokenListCIt endParsingIndex, return aNewList; } -DoxygenEntityList DoxygenParser::createTree(const std::string &doxygenBlob, - const std::string &fileName, - int lineNumber) +DoxygenEntityList DoxygenParser::createTree(Node* node, String* documentation) { + m_node = node; + + tokenizeDoxygenComment( + Char(documentation), + Char(Getfile(documentation)), + Getline(documentation) + ); - tokenizeDoxygenComment(doxygenBlob, fileName, lineNumber); if (noisy) { cout << "---TOKEN LIST---" << endl; printList(); diff --git a/Source/DoxygenTranslator/src/DoxygenParser.h b/Source/DoxygenTranslator/src/DoxygenParser.h index 4df978fc7..f86f94f44 100644 --- a/Source/DoxygenTranslator/src/DoxygenParser.h +++ b/Source/DoxygenTranslator/src/DoxygenParser.h @@ -16,6 +16,9 @@ #include #include #include + +#include "swig.h" + #include "DoxygenEntity.h" class DoxygenParser { @@ -91,6 +94,7 @@ private: bool m_isVerbatimText; // used to handle \htmlonly and \verbatim commands bool m_isInQuotedString; + Node* m_node; std::string m_fileName; int m_fileLineNo; @@ -375,9 +379,7 @@ private: public: DoxygenParser(bool noisy = false); virtual ~DoxygenParser(); - DoxygenEntityList createTree(const std::string &doxygen, - const std::string &fileName, - int lineNumber); + DoxygenEntityList createTree(Node* node, String* documentation); }; #endif diff --git a/Source/DoxygenTranslator/src/JavaDocConverter.cpp b/Source/DoxygenTranslator/src/JavaDocConverter.cpp index c7c601b9b..c2b47a796 100644 --- a/Source/DoxygenTranslator/src/JavaDocConverter.cpp +++ b/Source/DoxygenTranslator/src/JavaDocConverter.cpp @@ -928,8 +928,7 @@ String *JavaDocConverter::makeDocumentation(Node *node) return comment; } - DoxygenEntityList entityList = parser.createTree(Char (documentation), - Char (Getfile(documentation)), Getline(documentation)); + DoxygenEntityList entityList = parser.createTree(node, documentation); // entityList.sort(CompareDoxygenEntities()); sorting currently not used, diff --git a/Source/DoxygenTranslator/src/PyDocConverter.cpp b/Source/DoxygenTranslator/src/PyDocConverter.cpp index 9203904c5..d7dbabe35 100644 --- a/Source/DoxygenTranslator/src/PyDocConverter.cpp +++ b/Source/DoxygenTranslator/src/PyDocConverter.cpp @@ -852,9 +852,7 @@ String *PyDocConverter::makeDocumentation(Node *n) oneDoc = Char (comment); Delete(comment); } else { - std::list entityList = parser.createTree( - Char (documentation), Char (Getfile(documentation)), - Getline(documentation)); + std::list entityList = parser.createTree(n, documentation); DoxygenEntity root("root", entityList); oneDoc = translateSubtree(root); @@ -908,9 +906,7 @@ String *PyDocConverter::makeDocumentation(Node *n) pyDocString = Char (comment); Delete(comment); } else { - std::list entityList = parser.createTree( - Char (documentation), Char (Getfile(documentation)), - Getline(documentation)); + std::list entityList = parser.createTree(n, documentation); DoxygenEntity root("root", entityList); pyDocString = translateSubtree(root); }