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.
This commit is contained in:
Vadim Zeitlin 2014-08-26 17:45:59 +02:00
commit dc3102a535
4 changed files with 16 additions and 15 deletions

View file

@ -954,12 +954,16 @@ DoxygenEntityList DoxygenParser::parse(TokenListCIt endParsingIndex,
return aNewList; return aNewList;
} }
DoxygenEntityList DoxygenParser::createTree(const std::string &doxygenBlob, DoxygenEntityList DoxygenParser::createTree(Node* node, String* documentation)
const std::string &fileName,
int lineNumber)
{ {
m_node = node;
tokenizeDoxygenComment(
Char(documentation),
Char(Getfile(documentation)),
Getline(documentation)
);
tokenizeDoxygenComment(doxygenBlob, fileName, lineNumber);
if (noisy) { if (noisy) {
cout << "---TOKEN LIST---" << endl; cout << "---TOKEN LIST---" << endl;
printList(); printList();

View file

@ -16,6 +16,9 @@
#include <map> #include <map>
#include <vector> #include <vector>
#include <set> #include <set>
#include "swig.h"
#include "DoxygenEntity.h" #include "DoxygenEntity.h"
class DoxygenParser { class DoxygenParser {
@ -91,6 +94,7 @@ private:
bool m_isVerbatimText; // used to handle \htmlonly and \verbatim commands bool m_isVerbatimText; // used to handle \htmlonly and \verbatim commands
bool m_isInQuotedString; bool m_isInQuotedString;
Node* m_node;
std::string m_fileName; std::string m_fileName;
int m_fileLineNo; int m_fileLineNo;
@ -375,9 +379,7 @@ private:
public: public:
DoxygenParser(bool noisy = false); DoxygenParser(bool noisy = false);
virtual ~DoxygenParser(); virtual ~DoxygenParser();
DoxygenEntityList createTree(const std::string &doxygen, DoxygenEntityList createTree(Node* node, String* documentation);
const std::string &fileName,
int lineNumber);
}; };
#endif #endif

View file

@ -928,8 +928,7 @@ String *JavaDocConverter::makeDocumentation(Node *node)
return comment; return comment;
} }
DoxygenEntityList entityList = parser.createTree(Char (documentation), DoxygenEntityList entityList = parser.createTree(node, documentation);
Char (Getfile(documentation)), Getline(documentation));
// entityList.sort(CompareDoxygenEntities()); sorting currently not used, // entityList.sort(CompareDoxygenEntities()); sorting currently not used,

View file

@ -852,9 +852,7 @@ String *PyDocConverter::makeDocumentation(Node *n)
oneDoc = Char (comment); oneDoc = Char (comment);
Delete(comment); Delete(comment);
} else { } else {
std::list<DoxygenEntity> entityList = parser.createTree( std::list<DoxygenEntity> entityList = parser.createTree(n, documentation);
Char (documentation), Char (Getfile(documentation)),
Getline(documentation));
DoxygenEntity root("root", entityList); DoxygenEntity root("root", entityList);
oneDoc = translateSubtree(root); oneDoc = translateSubtree(root);
@ -908,9 +906,7 @@ String *PyDocConverter::makeDocumentation(Node *n)
pyDocString = Char (comment); pyDocString = Char (comment);
Delete(comment); Delete(comment);
} else { } else {
std::list<DoxygenEntity> entityList = parser.createTree( std::list<DoxygenEntity> entityList = parser.createTree(n, documentation);
Char (documentation), Char (Getfile(documentation)),
Getline(documentation));
DoxygenEntity root("root", entityList); DoxygenEntity root("root", entityList);
pyDocString = translateSubtree(root); pyDocString = translateSubtree(root);
} }