Various small code fixes. Some unwanted code removed.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2012-doxygen@13551 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
51e184f134
commit
cecc793782
7 changed files with 36 additions and 177 deletions
|
|
@ -2,25 +2,6 @@
|
||||||
#ifndef DOXYGENCOMMANDS_H
|
#ifndef DOXYGENCOMMANDS_H
|
||||||
#define DOXYGENCOMMANDS_H
|
#define DOXYGENCOMMANDS_H
|
||||||
|
|
||||||
const char *commandArray[] = {
|
|
||||||
"a", "addindex", "addtogroup", "anchor", "arg", "attention",
|
|
||||||
"author", "authors", "b", "brief", "bug", "c", "callgraph", "callergraph", "category", "cite",
|
|
||||||
"class", "code", "cond", "copybrief", "copydetails", "copydoc", "copyright", "date", "def",
|
|
||||||
"defgroup", "deprecated", "details", "dir", "dontinclude", "dot", "dotfile", "e",
|
|
||||||
"else", "elseif", "em", "endcode", "endcond", "enddot", "endhtmlonly", "endif",
|
|
||||||
"endlatexonly", "endlink", "endmanonly", "endmsc", "endverbatim", "endxmlonly",
|
|
||||||
"enum", "example", "exception", "f$", "f[", "f]", "f{", "f}", "file", "fn", "headerfile",
|
|
||||||
"hideinitializer", "htmlinclude", "htmlonly", "if", "ifnot", "image", "include",
|
|
||||||
"includelineno", "ingroup", "internal", "invariant", "interface", "latexonly", "li",
|
|
||||||
"line", "link", "mainpage", "manonly", "msc", "mscfile", "n", "name", "namespace", "nosubgrouping",
|
|
||||||
"note", "overload", "p", "package", "page", "par", "paragraph", "param", "post", "pre",
|
|
||||||
"private", "privatesection", "property", "protected", "protectedsection", "protocol",
|
|
||||||
"public", "publicsection", "ref", "relates", "relatesalso", "remarks", "remark", "result", "return", "returns", "retval",
|
|
||||||
"sa", "section", "see", "showinitializer", "since", "skip", "skipline", "struct", "subpage",
|
|
||||||
"subsection", "subsubsection", "test", "throw", "throws", "todo", "tparam", "typedef", "union", "until",
|
|
||||||
"var", "verbatim", "verbinclude", "version", "warning", "weakgroup", "xmlonly", "xrefitem", "$", "@", "\\", "&", "~", "<", ">", "#", "%"};
|
|
||||||
|
|
||||||
|
|
||||||
const char *sectionIndicators[] = {
|
const char *sectionIndicators[] = {
|
||||||
"attention", "author", "authors", "brief", "bug", "cond", "date", "deprecated", "details",
|
"attention", "author", "authors", "brief", "bug", "cond", "date", "deprecated", "details",
|
||||||
"else", "elseif", "endcond", "endif", "exception", "if", "ifnot", "invariant", "note", "par", "param",
|
"else", "elseif", "endcond", "endif", "exception", "if", "ifnot", "invariant", "note", "par", "param",
|
||||||
|
|
@ -35,38 +16,22 @@ const char *simpleCommands[] = {
|
||||||
"protected", "protectedsection", "tableofcontents"};
|
"protected", "protectedsection", "tableofcontents"};
|
||||||
const int simpleCommandsSize = sizeof(simpleCommands) / sizeof(*simpleCommands);
|
const int simpleCommandsSize = sizeof(simpleCommands) / sizeof(*simpleCommands);
|
||||||
|
|
||||||
const char *ignoredSimpleCommands[] = {
|
|
||||||
"nothing at the moment"};
|
|
||||||
const int ignoredSimpleCommandsSize = sizeof(ignoredSimpleCommands) / sizeof(*ignoredSimpleCommands);
|
|
||||||
|
|
||||||
const char *commandWords[] = {
|
const char *commandWords[] = {
|
||||||
"a", "b", "c", "e", "em", "p", "def", "enum", "package", "relates", "namespace", "relatesalso", "anchor", "dontinclude", "include",
|
"a", "b", "c", "e", "em", "p", "def", "enum", "package", "relates", "namespace", "relatesalso", "anchor", "dontinclude", "include",
|
||||||
"includelineno", "copydoc", "copybrief", "copydetails", "verbinclude", "htmlinclude", "extends", "implements", "memberof", "related",
|
"includelineno", "copydoc", "copybrief", "copydetails", "verbinclude", "htmlinclude", "extends", "implements", "memberof", "related",
|
||||||
"relatedalso", "cite"};
|
"relatedalso", "cite"};
|
||||||
const int commandWordsSize = sizeof(commandWords) / sizeof(*commandWords);
|
const int commandWordsSize = sizeof(commandWords) / sizeof(*commandWords);
|
||||||
|
|
||||||
const char *ignoredCommandWords[] = {
|
|
||||||
"nothing at the moment"};
|
|
||||||
const int ignoredCommandWordsSize = sizeof(ignoredCommandWords) / sizeof(*ignoredCommandWords);
|
|
||||||
|
|
||||||
const char *commandLines[] = {
|
const char *commandLines[] = {
|
||||||
"addindex", "fn", "name", "line", "var", "skipline", "typedef", "skip", "until", "property"};
|
"addindex", "fn", "name", "line", "var", "skipline", "typedef", "skip", "until", "property"};
|
||||||
const int commandLinesSize = sizeof(commandLines) / sizeof(*commandLines);
|
const int commandLinesSize = sizeof(commandLines) / sizeof(*commandLines);
|
||||||
|
|
||||||
const char *ignoreCommandLines[] = {
|
|
||||||
"nothing at the moment"};
|
|
||||||
const int ignoreCommandLinesSize = sizeof(ignoreCommandLines) / sizeof(*ignoreCommandLines);
|
|
||||||
|
|
||||||
const char *commandParagraph[] = {
|
const char *commandParagraph[] = {
|
||||||
"partofdescription", "result", "return", "returns", "remarks", "remark", "since", "test", "sa", "see", "pre", "post", "details", "invariant",
|
"partofdescription", "result", "return", "returns", "remarks", "remark", "since", "test", "sa", "see", "pre", "post", "details", "invariant",
|
||||||
"deprecated", "date", "note", "warning", "version", "todo", "bug", "attention", "brief", "author", "authors",
|
"deprecated", "date", "note", "warning", "version", "todo", "bug", "attention", "brief", "author", "authors",
|
||||||
"copyright", "short"};
|
"copyright", "short"};
|
||||||
const int commandParagraphSize = sizeof(commandParagraph) / sizeof(*commandParagraph);
|
const int commandParagraphSize = sizeof(commandParagraph) / sizeof(*commandParagraph);
|
||||||
|
|
||||||
const char *ignoreCommandParagraphs[] = {
|
|
||||||
"nothing at the moment"};
|
|
||||||
const int ignoreCommandParagraphsSize = sizeof(ignoreCommandParagraphs) / sizeof(*ignoreCommandParagraphs);
|
|
||||||
|
|
||||||
const char *commandEndCommands[] = {
|
const char *commandEndCommands[] = {
|
||||||
"htmlonly", "latexonly", "manonly", "xmlonly", "link", "rtfonly"};
|
"htmlonly", "latexonly", "manonly", "xmlonly", "link", "rtfonly"};
|
||||||
const int commandEndCommandsSize = sizeof(commandEndCommands) / sizeof(*commandEndCommands);
|
const int commandEndCommandsSize = sizeof(commandEndCommands) / sizeof(*commandEndCommands);
|
||||||
|
|
|
||||||
|
|
@ -20,13 +20,9 @@
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
SIMPLECOMMAND,
|
SIMPLECOMMAND,
|
||||||
IGNOREDSIMPLECOMMAND,
|
|
||||||
COMMANDWORD,
|
COMMANDWORD,
|
||||||
IGNOREDCOMMANDWORD,
|
|
||||||
COMMANDLINE,
|
COMMANDLINE,
|
||||||
IGNOREDCOMMANDLINE,
|
|
||||||
COMMANDPARAGRAPH,
|
COMMANDPARAGRAPH,
|
||||||
IGNORECOMMANDPARAGRAPH,
|
|
||||||
COMMANDENDCOMMAND,
|
COMMANDENDCOMMAND,
|
||||||
COMMANDWORDPARAGRAPH,
|
COMMANDWORDPARAGRAPH,
|
||||||
COMMANDWORDLINE,
|
COMMANDWORDLINE,
|
||||||
|
|
|
||||||
|
|
@ -32,24 +32,12 @@ void DoxygenParser::fillTables() {
|
||||||
// fill in tables with data from DxygenCommands.h
|
// fill in tables with data from DxygenCommands.h
|
||||||
for (int i = 0; i < simpleCommandsSize; i++)
|
for (int i = 0; i < simpleCommandsSize; i++)
|
||||||
doxygenCommands[simpleCommands[i]] = SIMPLECOMMAND;
|
doxygenCommands[simpleCommands[i]] = SIMPLECOMMAND;
|
||||||
for (int i = 0; i < ignoredSimpleCommandsSize; i++)
|
|
||||||
doxygenCommands[ignoredSimpleCommands[i]] = IGNOREDSIMPLECOMMAND;
|
|
||||||
|
|
||||||
for (int i = 0; i < commandWordsSize; i++)
|
for (int i = 0; i < commandWordsSize; i++)
|
||||||
doxygenCommands[commandWords[i]] = COMMANDWORD;
|
doxygenCommands[commandWords[i]] = COMMANDWORD;
|
||||||
for (int i = 0; i < ignoredCommandWordsSize; i++)
|
|
||||||
doxygenCommands[ignoredCommandWords[i]] = IGNOREDCOMMANDWORD;
|
|
||||||
|
|
||||||
for (int i = 0; i < commandLinesSize; i++)
|
for (int i = 0; i < commandLinesSize; i++)
|
||||||
doxygenCommands[commandLines[i]] = COMMANDLINE;
|
doxygenCommands[commandLines[i]] = COMMANDLINE;
|
||||||
for (int i = 0; i < ignoreCommandLinesSize; i++)
|
|
||||||
doxygenCommands[ignoreCommandLines[i]] = IGNOREDCOMMANDLINE;
|
|
||||||
|
|
||||||
for (int i = 0; i < commandParagraphSize; i++)
|
for (int i = 0; i < commandParagraphSize; i++)
|
||||||
doxygenCommands[commandParagraph[i]] = COMMANDPARAGRAPH;
|
doxygenCommands[commandParagraph[i]] = COMMANDPARAGRAPH;
|
||||||
for (int i = 0; i < ignoreCommandParagraphsSize; i++)
|
|
||||||
doxygenCommands[ignoreCommandParagraphs[i]] = IGNORECOMMANDPARAGRAPH;
|
|
||||||
|
|
||||||
for (int i = 0; i < commandEndCommandsSize; i++)
|
for (int i = 0; i < commandEndCommandsSize; i++)
|
||||||
doxygenCommands[commandEndCommands[i]] = COMMANDENDCOMMAND;
|
doxygenCommands[commandEndCommands[i]] = COMMANDENDCOMMAND;
|
||||||
for (int i = 0; i < commandWordParagraphsSize; i++)
|
for (int i = 0; i < commandWordParagraphsSize; i++)
|
||||||
|
|
@ -70,7 +58,7 @@ void DoxygenParser::fillTables() {
|
||||||
doxygenSectionIndicators.insert(sectionIndicators[i]);
|
doxygenSectionIndicators.insert(sectionIndicators[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string DoxygenParser::StringToLower(std::string stringToConvert) {
|
std::string DoxygenParser::stringToLower(std::string &stringToConvert) {
|
||||||
for (unsigned int i = 0; i < stringToConvert.length(); i++) {
|
for (unsigned int i = 0; i < stringToConvert.length(); i++) {
|
||||||
stringToConvert[i] = tolower(stringToConvert[i]);
|
stringToConvert[i] = tolower(stringToConvert[i]);
|
||||||
}
|
}
|
||||||
|
|
@ -79,7 +67,7 @@ std::string DoxygenParser::StringToLower(std::string stringToConvert) {
|
||||||
|
|
||||||
int DoxygenParser::findCommand(std::string smallString) {
|
int DoxygenParser::findCommand(std::string smallString) {
|
||||||
std::map<std::string, DoxyCommandEnum>::iterator it;
|
std::map<std::string, DoxyCommandEnum>::iterator it;
|
||||||
smallString = StringToLower(smallString);
|
smallString = stringToLower(smallString);
|
||||||
// I'm not sure if we can really do so, because there are different commands
|
// I'm not sure if we can really do so, because there are different commands
|
||||||
// in doxygenCommands and original commandArray
|
// in doxygenCommands and original commandArray
|
||||||
it = doxygenCommands.find(smallString);
|
it = doxygenCommands.find(smallString);
|
||||||
|
|
@ -89,7 +77,7 @@ int DoxygenParser::findCommand(std::string smallString) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int DoxygenParser::isSectionIndicator(std::string smallString) {
|
int DoxygenParser::isSectionIndicator(std::string smallString) {
|
||||||
smallString = StringToLower(smallString);
|
smallString = stringToLower(smallString);
|
||||||
std::set<std::string>::iterator it;
|
std::set<std::string>::iterator it;
|
||||||
it = doxygenSectionIndicators.find(smallString);
|
it = doxygenSectionIndicators.find(smallString);
|
||||||
if (it != doxygenSectionIndicators.end())
|
if (it != doxygenSectionIndicators.end())
|
||||||
|
|
@ -106,7 +94,7 @@ void DoxygenParser::printTree(std::list < DoxygenEntity > &rootList) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int DoxygenParser::commandBelongs(std::string theCommand) {
|
int DoxygenParser::commandBelongs(std::string theCommand) {
|
||||||
std::string smallString = StringToLower(theCommand);
|
std::string smallString = stringToLower(theCommand);
|
||||||
//cout << " Looking for command " << theCommand << endl;
|
//cout << " Looking for command " << theCommand << endl;
|
||||||
std::map<std::string, DoxyCommandEnum>::iterator it;
|
std::map<std::string, DoxyCommandEnum>::iterator it;
|
||||||
it = doxygenCommands.find(smallString);
|
it = doxygenCommands.find(smallString);
|
||||||
|
|
@ -238,8 +226,7 @@ std::list < Token >::iterator DoxygenParser::getEndCommand(std::string theComman
|
||||||
return tokList.end();
|
return tokList.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::list < Token >::iterator DoxygenParser::getTilAnyCommand(std::string theCommand, TokenList & tokList) {
|
std::list < Token >::iterator DoxygenParser::getTilAnyCommand(std::string, TokenList &) {
|
||||||
#pragma unused(theCommand,tokList)
|
|
||||||
std::list < Token >::iterator anIterator;
|
std::list < Token >::iterator anIterator;
|
||||||
return anIterator;
|
return anIterator;
|
||||||
}
|
}
|
||||||
|
|
@ -251,13 +238,6 @@ int DoxygenParser::addSimpleCommand(std::string theCommand, std::list < DoxygenE
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DoxygenParser::ignoreSimpleCommand(std::string theCommand, std::list < DoxygenEntity > &doxyList) {
|
|
||||||
#pragma unused(doxyList)
|
|
||||||
if (noisy)
|
|
||||||
cout << "Not Adding " << theCommand << endl;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int DoxygenParser::addCommandWord(std::string theCommand, TokenList & tokList, std::list < DoxygenEntity > &doxyList) {
|
int DoxygenParser::addCommandWord(std::string theCommand, TokenList & tokList, std::list < DoxygenEntity > &doxyList) {
|
||||||
if (noisy)
|
if (noisy)
|
||||||
cout << "Parsing " << theCommand << endl;
|
cout << "Parsing " << theCommand << endl;
|
||||||
|
|
@ -272,18 +252,6 @@ int DoxygenParser::addCommandWord(std::string theCommand, TokenList & tokList, s
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DoxygenParser::ignoreCommandWord(std::string theCommand, TokenList & tokList, std::list < DoxygenEntity > &doxyList) {
|
|
||||||
#pragma unused(doxyList)
|
|
||||||
if (noisy)
|
|
||||||
cout << "Not Adding " << theCommand << endl;
|
|
||||||
std::string name = getNextWord(tokList);
|
|
||||||
if (!name.empty())
|
|
||||||
return 1;
|
|
||||||
else
|
|
||||||
tokList.printListError("No word followed " + theCommand + " command.");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int DoxygenParser::addCommandLine(std::string theCommand, TokenList & tokList, std::list < DoxygenEntity > &doxyList) {
|
int DoxygenParser::addCommandLine(std::string theCommand, TokenList & tokList, std::list < DoxygenEntity > &doxyList) {
|
||||||
if (noisy)
|
if (noisy)
|
||||||
cout << "Parsing " << theCommand << endl;
|
cout << "Parsing " << theCommand << endl;
|
||||||
|
|
@ -293,15 +261,6 @@ int DoxygenParser::addCommandLine(std::string theCommand, TokenList & tokList, s
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DoxygenParser::ignoreCommandLine(std::string theCommand, TokenList & tokList, std::list < DoxygenEntity > &doxyList) {
|
|
||||||
#pragma unused(doxyList)
|
|
||||||
if (noisy)
|
|
||||||
cout << "Not Adding " << theCommand << endl;
|
|
||||||
std::list < Token >::iterator endOfLine = getOneLine(tokList);
|
|
||||||
tokList.setIterator(endOfLine);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int DoxygenParser::addCommandParagraph(std::string theCommand, TokenList & tokList, std::list < DoxygenEntity > &doxyList) {
|
int DoxygenParser::addCommandParagraph(std::string theCommand, TokenList & tokList, std::list < DoxygenEntity > &doxyList) {
|
||||||
if (noisy)
|
if (noisy)
|
||||||
cout << "Parsing " << theCommand << endl;
|
cout << "Parsing " << theCommand << endl;
|
||||||
|
|
@ -312,15 +271,6 @@ int DoxygenParser::addCommandParagraph(std::string theCommand, TokenList & tokLi
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DoxygenParser::ignoreCommandParagraph(std::string theCommand, TokenList & tokList, std::list < DoxygenEntity > &doxyList) {
|
|
||||||
#pragma unused(doxyList)
|
|
||||||
if (noisy)
|
|
||||||
cout << "Not Adding " << theCommand << endl;
|
|
||||||
std::list < Token >::iterator endOfParagraph = getEndOfParagraph(tokList);
|
|
||||||
tokList.setIterator(endOfParagraph);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int DoxygenParser::addCommandEndCommand(std::string theCommand, TokenList & tokList, std::list < DoxygenEntity > &doxyList) {
|
int DoxygenParser::addCommandEndCommand(std::string theCommand, TokenList & tokList, std::list < DoxygenEntity > &doxyList) {
|
||||||
if (noisy)
|
if (noisy)
|
||||||
cout << "Parsing " << theCommand << endl;
|
cout << "Parsing " << theCommand << endl;
|
||||||
|
|
@ -399,8 +349,7 @@ int DoxygenParser::addCommandOWord(std::string theCommand, TokenList & tokList,
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DoxygenParser::addCommandErrorThrow(std::string theCommand, TokenList & tokList, std::list < DoxygenEntity > &doxyList) {
|
int DoxygenParser::addCommandErrorThrow(std::string theCommand, TokenList & tokList, std::list < DoxygenEntity > &) {
|
||||||
#pragma unused(doxyList)
|
|
||||||
tokList.printListError("Encountered: " + theCommand +
|
tokList.printListError("Encountered: " + theCommand +
|
||||||
"\nThis command should not have been encountered. Behaviour past this may be unpredictable");
|
"\nThis command should not have been encountered. Behaviour past this may be unpredictable");
|
||||||
std::list < Token >::iterator endOfLine = getOneLine(tokList);
|
std::list < Token >::iterator endOfLine = getOneLine(tokList);
|
||||||
|
|
@ -684,7 +633,7 @@ int DoxygenParser::addCommandUnique(std::string theCommand, TokenList & tokList,
|
||||||
}
|
}
|
||||||
|
|
||||||
int DoxygenParser::addCommand(std::string commandString, TokenList & tokList, std::list < DoxygenEntity > &doxyList) {
|
int DoxygenParser::addCommand(std::string commandString, TokenList & tokList, std::list < DoxygenEntity > &doxyList) {
|
||||||
std::string theCommand = StringToLower(commandString);
|
std::string theCommand = stringToLower(commandString);
|
||||||
if (theCommand == "plainstd::string") {
|
if (theCommand == "plainstd::string") {
|
||||||
std::string nextPhrase = getStringTilCommand(tokList);
|
std::string nextPhrase = getStringTilCommand(tokList);
|
||||||
if (noisy)
|
if (noisy)
|
||||||
|
|
@ -692,53 +641,30 @@ int DoxygenParser::addCommand(std::string commandString, TokenList & tokList, st
|
||||||
doxyList.push_back(DoxygenEntity("plainstd::string", nextPhrase));
|
doxyList.push_back(DoxygenEntity("plainstd::string", nextPhrase));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
int commandNumber = commandBelongs(theCommand);
|
switch (commandBelongs(theCommand)) {
|
||||||
if (commandNumber == SIMPLECOMMAND) {
|
case SIMPLECOMMAND:
|
||||||
return addSimpleCommand(theCommand, doxyList);
|
return addSimpleCommand(theCommand, doxyList);
|
||||||
}
|
case COMMANDWORD:
|
||||||
if (commandNumber == IGNOREDSIMPLECOMMAND) {
|
|
||||||
return ignoreSimpleCommand(theCommand, doxyList);
|
|
||||||
}
|
|
||||||
if (commandNumber == COMMANDWORD) {
|
|
||||||
return addCommandWord(theCommand, tokList, doxyList);
|
return addCommandWord(theCommand, tokList, doxyList);
|
||||||
}
|
case COMMANDLINE:
|
||||||
if (commandNumber == IGNOREDCOMMANDWORD) {
|
|
||||||
return ignoreCommandWord(theCommand, tokList, doxyList);
|
|
||||||
}
|
|
||||||
if (commandNumber == COMMANDLINE) {
|
|
||||||
return addCommandLine(theCommand, tokList, doxyList);
|
return addCommandLine(theCommand, tokList, doxyList);
|
||||||
}
|
case COMMANDPARAGRAPH:
|
||||||
if (commandNumber == IGNOREDCOMMANDLINE) {
|
|
||||||
return ignoreCommandLine(theCommand, tokList, doxyList);
|
|
||||||
}
|
|
||||||
if (commandNumber == COMMANDPARAGRAPH) {
|
|
||||||
return addCommandParagraph(theCommand, tokList, doxyList);
|
return addCommandParagraph(theCommand, tokList, doxyList);
|
||||||
}
|
case COMMANDENDCOMMAND:
|
||||||
if (commandNumber == IGNORECOMMANDPARAGRAPH) {
|
|
||||||
return ignoreCommandParagraph(theCommand, tokList, doxyList);
|
|
||||||
}
|
|
||||||
if (commandNumber == COMMANDENDCOMMAND) {
|
|
||||||
return addCommandEndCommand(theCommand, tokList, doxyList);
|
return addCommandEndCommand(theCommand, tokList, doxyList);
|
||||||
}
|
case COMMANDWORDPARAGRAPH:
|
||||||
if (commandNumber == COMMANDWORDPARAGRAPH) {
|
|
||||||
return addCommandWordParagraph(theCommand, tokList, doxyList);
|
return addCommandWordParagraph(theCommand, tokList, doxyList);
|
||||||
}
|
case COMMANDWORDLINE:
|
||||||
if (commandNumber == COMMANDWORDLINE) {
|
|
||||||
return addCommandWordLine(theCommand, tokList, doxyList);
|
return addCommandWordLine(theCommand, tokList, doxyList);
|
||||||
}
|
case COMMANDWORDOWORDWORD:
|
||||||
if (commandNumber == COMMANDWORDOWORDWORD) {
|
|
||||||
return addCommandWordOWordOWord(theCommand, tokList, doxyList);
|
return addCommandWordOWordOWord(theCommand, tokList, doxyList);
|
||||||
}
|
case COMMANDOWORD:
|
||||||
if (commandNumber == COMMANDOWORD) {
|
|
||||||
return addCommandOWord(theCommand, tokList, doxyList);
|
return addCommandOWord(theCommand, tokList, doxyList);
|
||||||
}
|
case COMMANDERRORTHROW:
|
||||||
if (commandNumber == COMMANDERRORTHROW) {
|
|
||||||
return addCommandErrorThrow(theCommand, tokList, doxyList);
|
return addCommandErrorThrow(theCommand, tokList, doxyList);
|
||||||
}
|
case COMMANDUNIQUE:
|
||||||
if (commandNumber == COMMANDUNIQUE) {
|
|
||||||
return addCommandUnique(theCommand, tokList, doxyList);
|
return addCommandUnique(theCommand, tokList, doxyList);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ private:
|
||||||
/*
|
/*
|
||||||
*Changes a std::string to all lower case
|
*Changes a std::string to all lower case
|
||||||
*/
|
*/
|
||||||
std::string StringToLower(std::string stringToConvert);
|
std::string stringToLower(std::string &stringToConvert);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Finds out if a command exists (is a possible command)
|
* Finds out if a command exists (is a possible command)
|
||||||
|
|
@ -112,12 +112,6 @@ private:
|
||||||
* \n \\ \@ \& \$ \# \< \> \%
|
* \n \\ \@ \& \$ \# \< \> \%
|
||||||
*/
|
*/
|
||||||
int addSimpleCommand(std::string theCommand, std::list < DoxygenEntity > &doxyList);
|
int addSimpleCommand(std::string theCommand, std::list < DoxygenEntity > &doxyList);
|
||||||
/*
|
|
||||||
* NOT INCLUDED Simple Commands
|
|
||||||
* Format: @command
|
|
||||||
* Plain commands, such as newline etc, they contain no other data
|
|
||||||
*/
|
|
||||||
int ignoreSimpleCommand(std::string theCommand, std::list < DoxygenEntity > &doxyList);
|
|
||||||
/*
|
/*
|
||||||
* CommandWord
|
* CommandWord
|
||||||
* Format: @command <word>
|
* Format: @command <word>
|
||||||
|
|
@ -126,13 +120,6 @@ private:
|
||||||
* "relates", "namespace", "relatesalso","anchor", "dontinclude", "include", "includelineno"
|
* "relates", "namespace", "relatesalso","anchor", "dontinclude", "include", "includelineno"
|
||||||
*/
|
*/
|
||||||
int addCommandWord(std::string theCommand, TokenList & tokList, std::list < DoxygenEntity > &doxyList);
|
int addCommandWord(std::string theCommand, TokenList & tokList, std::list < DoxygenEntity > &doxyList);
|
||||||
/*
|
|
||||||
* NOT INCLUDED CommandWord
|
|
||||||
* Format: @command <word>
|
|
||||||
* Commands with a single WORD after then such as @b
|
|
||||||
* "copydoc", "copybrief", "copydetails", "verbinclude", "htmlinclude"
|
|
||||||
*/
|
|
||||||
int ignoreCommandWord(std::string theCommand, TokenList & tokList, std::list < DoxygenEntity > &doxyList);
|
|
||||||
/*
|
/*
|
||||||
* CommandLine
|
* CommandLine
|
||||||
* Format: @command (line)
|
* Format: @command (line)
|
||||||
|
|
@ -140,12 +127,6 @@ private:
|
||||||
* "addindex", "fn", "name", "line", "var", "skipline", "typedef", "skip", "until", "property"
|
* "addindex", "fn", "name", "line", "var", "skipline", "typedef", "skip", "until", "property"
|
||||||
*/
|
*/
|
||||||
int addCommandLine(std::string theCommand, TokenList & tokList, std::list < DoxygenEntity > &doxyList);
|
int addCommandLine(std::string theCommand, TokenList & tokList, std::list < DoxygenEntity > &doxyList);
|
||||||
/*
|
|
||||||
* NOT INCLUDED CommandLine
|
|
||||||
* Format: @command (line)
|
|
||||||
* Commands with a single LINE after then such as @var
|
|
||||||
*/
|
|
||||||
int ignoreCommandLine(std::string theCommand, TokenList & tokList, std::list < DoxygenEntity > &doxyList);
|
|
||||||
/*
|
/*
|
||||||
* CommandParagraph
|
* CommandParagraph
|
||||||
* Format: @command {paragraph}
|
* Format: @command {paragraph}
|
||||||
|
|
@ -154,12 +135,6 @@ private:
|
||||||
* "deprecated", "date", "note", "warning", "version", "todo", "bug", "attention", "brief", "arg", "author"
|
* "deprecated", "date", "note", "warning", "version", "todo", "bug", "attention", "brief", "arg", "author"
|
||||||
*/
|
*/
|
||||||
int addCommandParagraph(std::string theCommand, TokenList & tokList, std::list < DoxygenEntity > &doxyList);
|
int addCommandParagraph(std::string theCommand, TokenList & tokList, std::list < DoxygenEntity > &doxyList);
|
||||||
/*
|
|
||||||
* CommandParagraph
|
|
||||||
* Format: @command {paragraph}
|
|
||||||
* Commands with a single LINE after then such as @var
|
|
||||||
*/
|
|
||||||
int ignoreCommandParagraph(std::string theCommand, TokenList & tokList, std::list < DoxygenEntity > &doxyList);
|
|
||||||
/*
|
/*
|
||||||
* Command EndCommand
|
* Command EndCommand
|
||||||
* Format: @command and ends at @endcommand
|
* Format: @command and ends at @endcommand
|
||||||
|
|
@ -207,9 +182,7 @@ private:
|
||||||
*/
|
*/
|
||||||
int addCommandUnique(std::string theCommand, TokenList & tokList, std::list < DoxygenEntity > &doxyList);
|
int addCommandUnique(std::string theCommand, TokenList & tokList, std::list < DoxygenEntity > &doxyList);
|
||||||
/*
|
/*
|
||||||
* The actual "meat" of the doxygen parser. This is not yet fully implemented
|
* The actual "meat" of the doxygen parser. Calls the correct addCommand* function
|
||||||
* with my current design- however the skeletal outline is contained in
|
|
||||||
* the file Skeleton
|
|
||||||
*/
|
*/
|
||||||
int addCommand(std::string commandString, TokenList & tokList, std::list < DoxygenEntity > &doxyList);
|
int addCommand(std::string commandString, TokenList & tokList, std::list < DoxygenEntity > &doxyList);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ String *DoxygenTranslator::getDoxygenComment(Node *node) {
|
||||||
String *DoxygenTranslator::getDocumentation(Node *node) {
|
String *DoxygenTranslator::getDocumentation(Node *node) {
|
||||||
|
|
||||||
if (!hasDocumentation(node))
|
if (!hasDocumentation(node))
|
||||||
return 0;
|
return NewString("");
|
||||||
|
|
||||||
return makeDocumentation(node);
|
return makeDocumentation(node);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ public:
|
||||||
* Return the documentation for a given node formated for the correct
|
* Return the documentation for a given node formated for the correct
|
||||||
* documentation system.
|
* documentation system.
|
||||||
* @param node The node to extract and translate documentation for.
|
* @param node The node to extract and translate documentation for.
|
||||||
* @return The resulted documentation string.
|
* @return The resulted documentation string, or empty string in case of any errors.
|
||||||
*/
|
*/
|
||||||
String *getDocumentation(Node *node);
|
String *getDocumentation(Node *node);
|
||||||
/*
|
/*
|
||||||
|
|
@ -57,8 +57,7 @@ protected:
|
||||||
* Overridden in subclasses to return the documentation formatted for a given
|
* Overridden in subclasses to return the documentation formatted for a given
|
||||||
* documentation system.
|
* documentation system.
|
||||||
* @param node The node to extract and translate documentation for.
|
* @param node The node to extract and translate documentation for.
|
||||||
* @param documentation The returned documentation string.
|
* @return The resulted documentation string
|
||||||
* @return A bool to indicate if there was documentation to return for the node.
|
|
||||||
*/
|
*/
|
||||||
virtual String *makeDocumentation(Node *node) = 0;
|
virtual String *makeDocumentation(Node *node) = 0;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ TokenList TokenList::tokenizeDoxygenComment(const std::string &doxygenComment, c
|
||||||
// check if it's one of the '!!!', '***', '///' of any length
|
// check if it's one of the '!!!', '***', '///' of any length
|
||||||
char c = currentWord[0];
|
char c = currentWord[0];
|
||||||
isPlainString = false;
|
isPlainString = false;
|
||||||
for (int i=0; i<currentWord.size(); i++)
|
for (size_t i=0; i<currentWord.size(); i++)
|
||||||
if (currentWord[i] != c) {
|
if (currentWord[i] != c) {
|
||||||
isPlainString = true;
|
isPlainString = true;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue