Whitespace corrects.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-cherylfoil@10840 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Jamie Kirkpatrick 2008-09-12 11:19:07 +00:00
commit eb38ea3a43
3 changed files with 659 additions and 638 deletions

View file

@ -10,27 +10,6 @@
#include "DoxygenEntity.h" #include "DoxygenEntity.h"
#include <iostream> #include <iostream>
/*
* Basic node for commands that have nothing after them (eg: \n)
*/
std::string DoxygenEntity::commandArray[] = {"a", "addindex", "addtogroup", "anchor", "arg", "attention",
"author", "b", "brief", "bug", "c", "callgraph", "callergraph", "category",
"class", "code", "cond", "copybrief", "copydetails", "copydoc", "date", "def",
"defgroup", "deprecated", "details", "dir", "dontinclude", "dot", "dotfile", "e",
"else", "elseif", "em", "endcode", "endcond", "enddot", "endhtmlonly", "endif",
"std::endlatexonly", "std::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", "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", "return", "retval",
"sa", "section", "see", "showinitializer", "since", "skip", "skipline", "struct", "subpage",
"subsection", "subsubsection", "test", "throw", "todo", "tparam", "typedef", "union", "until",
"var", "verbatim", "verbinclude", "version", "warning", "weakgroup", "xmlonly", "xrefitem",
"$", "@", std::string(1, 92), "&", "~", "<", ">", "#", "%"};
DoxygenEntity::DoxygenEntity(std::string typeEnt){ DoxygenEntity::DoxygenEntity(std::string typeEnt){
typeOfEntity = typeEnt; typeOfEntity = typeEnt;
data = ""; data = "";

View file

@ -25,7 +25,6 @@ struct DoxygenEntity{
std::list <DoxygenEntity> entityList; std::list <DoxygenEntity> entityList;
std::string data; std::string data;
int isLeaf; int isLeaf;
static std::string commandArray[];
}; };
/* /*

View file

@ -100,7 +100,7 @@ std::string StringToLower(std::string stringToConvert){
int findCommand(std::string smallString){ int findCommand(std::string smallString){
smallString = StringToLower(smallString); smallString = StringToLower(smallString);
int a; int a;
for (int i = 0; i < sizeof(commandArray)/sizeof(*commandArray); i++){ for (unsigned i = 0; i < sizeof(commandArray)/sizeof(*commandArray); i++){
if( (a = smallString.compare(commandArray[i])) == 0){ if( (a = smallString.compare(commandArray[i])) == 0){
return 101 + i; return 101 + i;
} }
@ -114,7 +114,7 @@ int findCommand(std::string smallString){
*/ */
int isSectionIndicator(std::string smallString){ int isSectionIndicator(std::string smallString){
smallString = StringToLower(smallString); smallString = StringToLower(smallString);
for (int i = 0; i < sizeof( sectionIndicators)/sizeof(* sectionIndicators); i++){ for (unsigned i = 0; i < sizeof( sectionIndicators)/sizeof(* sectionIndicators); i++){
if( smallString.compare( sectionIndicators[i]) == 0){ if( smallString.compare( sectionIndicators[i]) == 0){
return 1; return 1;
} }
@ -137,51 +137,66 @@ void printTree( std::list <DoxygenEntity> &rootList){
int commandBelongs(std::string theCommand){ int 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;
int i = 0; unsigned i = 0;
for (i = 0; i < sizeof(simpleCommands)/sizeof(*simpleCommands); i++){ for (i = 0; i < sizeof(simpleCommands)/sizeof(*simpleCommands); i++){
if(smallString.compare(simpleCommands[i]) == 0){return SIMPLECOMMAND;} if(smallString.compare(simpleCommands[i]) == 0)
return SIMPLECOMMAND;
} }
for (i = 0; i < sizeof(ignoredSimpleCommands)/sizeof(*ignoredSimpleCommands); i++){ for (i = 0; i < sizeof(ignoredSimpleCommands)/sizeof(*ignoredSimpleCommands); i++){
if(smallString.compare(ignoredSimpleCommands[i]) == 0){return IGNOREDSIMPLECOMMAND;} if(smallString.compare(ignoredSimpleCommands[i]) == 0)
return IGNOREDSIMPLECOMMAND;
} }
for (i = 0; i < sizeof(commandWords)/sizeof(*commandWords); i++){ for (i = 0; i < sizeof(commandWords)/sizeof(*commandWords); i++){
if(smallString.compare( commandWords[i]) == 0){return COMMANDWORD;} if(smallString.compare( commandWords[i]) == 0)
return COMMANDWORD;
} }
for (i = 0; i < sizeof(ignoredCommandWords)/sizeof(*ignoredCommandWords); i++){ for (i = 0; i < sizeof(ignoredCommandWords)/sizeof(*ignoredCommandWords); i++){
if(smallString.compare( ignoredCommandWords[i]) == 0){return IGNOREDCOMMANDWORD;} if(smallString.compare( ignoredCommandWords[i]) == 0)
return IGNOREDCOMMANDWORD;
} }
for (i = 0; i < sizeof(commandLines)/sizeof(*commandLines); i++){ for (i = 0; i < sizeof(commandLines)/sizeof(*commandLines); i++){
if(smallString.compare( commandLines[i]) == 0){return COMMANDLINE;} if(smallString.compare( commandLines[i]) == 0)
return COMMANDLINE;
} }
for (i = 0; i < sizeof(ignoreCommandLines)/sizeof(*ignoreCommandLines); i++){ for (i = 0; i < sizeof(ignoreCommandLines)/sizeof(*ignoreCommandLines); i++){
if(smallString.compare( ignoreCommandLines[i]) == 0){return IGNOREDCOMMANDLINE;} if(smallString.compare( ignoreCommandLines[i]) == 0)
return IGNOREDCOMMANDLINE;
} }
for (i = 0; i < sizeof(commandParagraph)/sizeof(*commandParagraph); i++){ for (i = 0; i < sizeof(commandParagraph)/sizeof(*commandParagraph); i++){
if(smallString.compare( commandParagraph[i]) == 0){return COMMANDPARAGRAPH;} if(smallString.compare( commandParagraph[i]) == 0)
return COMMANDPARAGRAPH;
} }
for (i = 0; i < sizeof(ignoreCommandParagraphs)/sizeof(*ignoreCommandParagraphs); i++){ for (i = 0; i < sizeof(ignoreCommandParagraphs)/sizeof(*ignoreCommandParagraphs); i++){
if(smallString.compare( ignoreCommandParagraphs[i]) == 0){return IGNORECOMMANDPARAGRAPH;} if(smallString.compare( ignoreCommandParagraphs[i]) == 0)
return IGNORECOMMANDPARAGRAPH;
} }
for (i = 0; i < sizeof(commandEndCommands)/sizeof(*commandEndCommands); i++){ for (i = 0; i < sizeof(commandEndCommands)/sizeof(*commandEndCommands); i++){
if(smallString.compare( commandEndCommands[i]) == 0){return COMMANDENDCOMMAND ;} if(smallString.compare( commandEndCommands[i]) == 0)
return COMMANDENDCOMMAND;
} }
for (i = 0; i < sizeof(commandWordParagraphs)/sizeof(*commandWordParagraphs); i++){ for (i = 0; i < sizeof(commandWordParagraphs)/sizeof(*commandWordParagraphs); i++){
if(smallString.compare( commandWordParagraphs[i]) == 0){return COMMANDWORDPARAGRAPH;} if(smallString.compare( commandWordParagraphs[i]) == 0)
return COMMANDWORDPARAGRAPH;
} }
for (i = 0; i < sizeof(commandWordLines)/sizeof(*commandWordLines); i++){ for (i = 0; i < sizeof(commandWordLines)/sizeof(*commandWordLines); i++){
if(smallString.compare( commandWordLines[i]) == 0){return COMMANDWORDLINE ;} if(smallString.compare( commandWordLines[i]) == 0)
return COMMANDWORDLINE;
} }
for (i = 0; i < sizeof(commandWordOWordOWords)/sizeof(*commandWordOWordOWords); i++){ for (i = 0; i < sizeof(commandWordOWordOWords)/sizeof(*commandWordOWordOWords); i++){
if(smallString.compare( commandWordOWordOWords[i]) == 0){return COMMANDWORDOWORDWORD;} if(smallString.compare( commandWordOWordOWords[i]) == 0)
return COMMANDWORDOWORDWORD;
} }
for (i = 0; i < sizeof(commandOWords)/sizeof(*commandOWords); i++){ for (i = 0; i < sizeof(commandOWords)/sizeof(*commandOWords); i++){
if(smallString.compare( commandOWords[i]) == 0){return COMMANDOWORD;} if(smallString.compare( commandOWords[i]) == 0)
return COMMANDOWORD;
} }
for (i = 0; i < sizeof(commandErrorThrowings)/sizeof(*commandErrorThrowings); i++){ for (i = 0; i < sizeof(commandErrorThrowings)/sizeof(*commandErrorThrowings); i++){
if(smallString.compare( commandErrorThrowings[i]) == 0){return COMMANDERRORTHROW;} if(smallString.compare( commandErrorThrowings[i]) == 0)
return COMMANDERRORTHROW;
} }
for (i = 0; i < sizeof(commandUniques)/sizeof(*commandUniques); i++){ for (i = 0; i < sizeof(commandUniques)/sizeof(*commandUniques); i++){
if(smallString.compare( commandUniques[i]) == 0){return COMMANDUNIQUE;} if(smallString.compare( commandUniques[i]) == 0)
return COMMANDUNIQUE;
} }
return 0; return 0;
} }
@ -323,6 +338,7 @@ std::list<Token>::iterator getEndCommand(std::string theCommand, TokenList &tokL
*/ */
//TODO getTilAnyCommand //TODO getTilAnyCommand
std::list<Token>::iterator getTilAnyCommand(std::string theCommand, TokenList &tokList){ std::list<Token>::iterator getTilAnyCommand(std::string theCommand, TokenList &tokList){
#pragma unused(theCommand,tokList)
std::list<Token>::iterator anIterator; std::list<Token>::iterator anIterator;
return anIterator; return anIterator;
} }
@ -346,6 +362,7 @@ std::list<Token>::iterator getTilAnyCommand(std::string theCommand, TokenList &t
* Plain commands, such as newline etc, they contain no other data * Plain commands, such as newline etc, they contain no other data
*/ */
int ignoreSimpleCommand(std::string theCommand, std::list <DoxygenEntity> &doxyList){ int ignoreSimpleCommand(std::string theCommand, std::list <DoxygenEntity> &doxyList){
#pragma unused(doxyList)
if (noisy) cout << "Not Adding " << theCommand << endl; if (noisy) cout << "Not Adding " << theCommand << endl;
return 1; return 1;
} }
@ -363,7 +380,8 @@ std::list<Token>::iterator getTilAnyCommand(std::string theCommand, TokenList &t
doxyList.push_back(DoxygenEntity(theCommand, name)); doxyList.push_back(DoxygenEntity(theCommand, name));
return 1; return 1;
} }
else cout << "No word followed " << theCommand << " command. Not added" << endl; else
cout << "No word followed " << theCommand << " command. Not added" << endl;
return 0; return 0;
} }
@ -373,12 +391,14 @@ std::list<Token>::iterator getTilAnyCommand(std::string theCommand, TokenList &t
* "copydoc", "copybrief", "copydetails", "verbinclude", "htmlinclude" * "copydoc", "copybrief", "copydetails", "verbinclude", "htmlinclude"
*/ */
int ignoreCommandWord(std::string theCommand, TokenList &tokList, std::list <DoxygenEntity> &doxyList){ int ignoreCommandWord(std::string theCommand, TokenList &tokList, std::list <DoxygenEntity> &doxyList){
if (noisy) cout << "Not Adding " << theCommand << endl; #pragma unused(doxyList)
if (noisy)
cout << "Not Adding " << theCommand << endl;
std::string name = getNextWord(tokList); std::string name = getNextWord(tokList);
if (!name.empty()){ if (!name.empty())
return 1; return 1;
} else
else cout << "WARNING: No word followed " << theCommand << " command." << endl; cout << "WARNING: No word followed " << theCommand << " command." << endl;
return 0; return 0;
} }
@ -388,10 +408,10 @@ std::list<Token>::iterator getTilAnyCommand(std::string theCommand, TokenList &t
* "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){
if (noisy) cout << "Parsing " << theCommand << endl; if (noisy)
cout << "Parsing " << theCommand << endl;
std::list<Token>::iterator endOfLine = getOneLine(tokList); std::list<Token>::iterator endOfLine = getOneLine(tokList);
std::list <DoxygenEntity> aNewList; std::list <DoxygenEntity> aNewList = parse(endOfLine, tokList);
aNewList = parse(endOfLine, tokList);
doxyList.push_back( DoxygenEntity(theCommand, aNewList)); doxyList.push_back( DoxygenEntity(theCommand, aNewList));
return 1; return 1;
} }
@ -402,7 +422,9 @@ std::list<Token>::iterator getTilAnyCommand(std::string theCommand, TokenList &t
* *
*/ */
int ignoreCommandLine(std::string theCommand, TokenList &tokList, std::list <DoxygenEntity> &doxyList){ int ignoreCommandLine(std::string theCommand, TokenList &tokList, std::list <DoxygenEntity> &doxyList){
if (noisy) cout << "Not Adding " << theCommand << endl; #pragma unused(doxyList)
if (noisy)
cout << "Not Adding " << theCommand << endl;
std::list<Token>::iterator endOfLine = getOneLine(tokList); std::list<Token>::iterator endOfLine = getOneLine(tokList);
tokList.setIterator(endOfLine); tokList.setIterator(endOfLine);
return 1; return 1;
@ -415,7 +437,8 @@ std::list<Token>::iterator getTilAnyCommand(std::string theCommand, TokenList &t
* "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){
if (noisy) cout << "Parsing " << theCommand << endl; if (noisy)
cout << "Parsing " << theCommand << endl;
std::list<Token>::iterator endOfParagraph = getEndOfParagraph(tokList); std::list<Token>::iterator endOfParagraph = getEndOfParagraph(tokList);
std::list <DoxygenEntity> aNewList; std::list <DoxygenEntity> aNewList;
aNewList = parse(endOfParagraph, tokList); aNewList = parse(endOfParagraph, tokList);
@ -429,7 +452,9 @@ std::list<Token>::iterator getTilAnyCommand(std::string theCommand, TokenList &t
* *
*/ */
int ignoreCommandParagraph(std::string theCommand, TokenList &tokList, std::list <DoxygenEntity> &doxyList){ int ignoreCommandParagraph(std::string theCommand, TokenList &tokList, std::list <DoxygenEntity> &doxyList){
if (noisy) cout << "Not Adding " << theCommand << endl; #pragma unused(doxyList)
if (noisy)
cout << "Not Adding " << theCommand << endl;
std::list<Token>::iterator endOfParagraph = getEndOfParagraph(tokList); std::list<Token>::iterator endOfParagraph = getEndOfParagraph(tokList);
tokList.setIterator(endOfParagraph); tokList.setIterator(endOfParagraph);
return 1; return 1;
@ -443,7 +468,8 @@ std::list<Token>::iterator getTilAnyCommand(std::string theCommand, TokenList &t
* Returns 1 if success, 0 if the endcommand is never encountered. * Returns 1 if success, 0 if the endcommand is never encountered.
*/ */
int addCommandEndCommand(std::string theCommand, TokenList &tokList, std::list <DoxygenEntity> &doxyList){ int addCommandEndCommand(std::string theCommand, TokenList &tokList, std::list <DoxygenEntity> &doxyList){
if (noisy) cout << "Not Adding " << theCommand << endl; if (noisy)
cout << "Not Adding " << theCommand << endl;
std::string description = getStringTilEndCommand( "end" + theCommand, tokList); std::string description = getStringTilEndCommand( "end" + theCommand, tokList);
doxyList.push_back(DoxygenEntity(theCommand, description)); doxyList.push_back(DoxygenEntity(theCommand, description));
return 1; return 1;
@ -455,7 +481,8 @@ std::list<Token>::iterator getTilAnyCommand(std::string theCommand, TokenList &t
* "param", "tparam", "throw", "retval", "exception" * "param", "tparam", "throw", "retval", "exception"
*/ */
int addCommandWordParagraph(std::string theCommand, TokenList &tokList, std::list <DoxygenEntity> &doxyList){ int addCommandWordParagraph(std::string theCommand, TokenList &tokList, std::list <DoxygenEntity> &doxyList){
if (noisy) cout << "Parsing " << theCommand << endl; if (noisy)
cout << "Parsing " << theCommand << endl;
std::string name = getNextWord(tokList); std::string name = getNextWord(tokList);
if (name.empty()){ if (name.empty()){
cout << "No word followed " << theCommand << " command. Not added" << endl; cout << "No word followed " << theCommand << " command. Not added" << endl;
@ -487,7 +514,6 @@ std::list<Token>::iterator getTilAnyCommand(std::string theCommand, TokenList &t
aNewList.push_front(DoxygenEntity("plainstd::string", name)); aNewList.push_front(DoxygenEntity("plainstd::string", name));
doxyList.push_back(DoxygenEntity(theCommand, aNewList)); doxyList.push_back(DoxygenEntity(theCommand, aNewList));
return 1; return 1;
//else cout << "No line followed " << theCommand << " command. Not added" << endl; //else cout << "No line followed " << theCommand << " command. Not added" << endl;
} }
@ -497,7 +523,8 @@ std::list<Token>::iterator getTilAnyCommand(std::string theCommand, TokenList &t
* "category", "class", "protocol", "interface", "struct", "union" * "category", "class", "protocol", "interface", "struct", "union"
*/ */
int addCommandWordOWordOWord(std::string theCommand, TokenList &tokList, std::list <DoxygenEntity> &doxyList){ int addCommandWordOWordOWord(std::string theCommand, TokenList &tokList, std::list <DoxygenEntity> &doxyList){
if (noisy) cout << "Parsing " << theCommand << endl; if (noisy)
cout << "Parsing " << theCommand << endl;
std::string name = getNextWord(tokList); std::string name = getNextWord(tokList);
if (name.empty()){ if (name.empty()){
cout << "No word followed " << theCommand << " command. Not added" << endl; cout << "No word followed " << theCommand << " command. Not added" << endl;
@ -507,8 +534,10 @@ std::list<Token>::iterator getTilAnyCommand(std::string theCommand, TokenList &t
std::string headername = getNextWord(tokList); std::string headername = getNextWord(tokList);
std::list <DoxygenEntity> aNewList; std::list <DoxygenEntity> aNewList;
aNewList.push_back(DoxygenEntity("plainstd::string", name)); aNewList.push_back(DoxygenEntity("plainstd::string", name));
if (!headerfile.empty()) aNewList.push_back(DoxygenEntity("plainstd::string", headerfile)); if (!headerfile.empty())
if (!headername.empty()) aNewList.push_back(DoxygenEntity("plainstd::string", headername)); aNewList.push_back(DoxygenEntity("plainstd::string", headerfile));
if (!headername.empty())
aNewList.push_back(DoxygenEntity("plainstd::string", headername));
doxyList.push_back(DoxygenEntity(theCommand, aNewList)); doxyList.push_back(DoxygenEntity(theCommand, aNewList));
return 1; return 1;
} }
@ -519,7 +548,8 @@ std::list<Token>::iterator getTilAnyCommand(std::string theCommand, TokenList &t
* "dir", "file", "cond" * "dir", "file", "cond"
*/ */
int addCommandOWord(std::string theCommand, TokenList &tokList, std::list <DoxygenEntity> &doxyList){ int addCommandOWord(std::string theCommand, TokenList &tokList, std::list <DoxygenEntity> &doxyList){
if (noisy) cout << "Parsing " << theCommand << endl; if (noisy)
cout << "Parsing " << theCommand << endl;
std::string name = getNextWord(tokList); std::string name = getNextWord(tokList);
doxyList.push_back(DoxygenEntity(theCommand, name)); doxyList.push_back(DoxygenEntity(theCommand, name));
return 1; return 1;
@ -529,6 +559,7 @@ std::list<Token>::iterator getTilAnyCommand(std::string theCommand, TokenList &t
* goes til the end of line then returns * goes til the end of line then returns
*/ */
int addCommandErrorThrow(std::string theCommand, TokenList &tokList, std::list <DoxygenEntity> &doxyList){ int addCommandErrorThrow(std::string theCommand, TokenList &tokList, std::list <DoxygenEntity> &doxyList){
#pragma unused(doxyList)
cout << "Encountered :" << theCommand << endl; cout << "Encountered :" << theCommand << endl;
cout << "This command should not have been encountered. Behaviour past this may be unpredictable " << endl; cout << "This command should not have been encountered. Behaviour past this may be unpredictable " << endl;
std::list<Token>::iterator endOfLine = getOneLine(tokList); std::list<Token>::iterator endOfLine = getOneLine(tokList);
@ -548,7 +579,8 @@ std::list<Token>::iterator getTilAnyCommand(std::string theCommand, TokenList &t
// \xrefitem <key> "(heading)" "(std::list title)" {text} // \xrefitem <key> "(heading)" "(std::list title)" {text}
else if (theCommand.compare("xrefitem") == 0){ else if (theCommand.compare("xrefitem") == 0){
//TODO Implement xrefitem //TODO Implement xrefitem
if (noisy) cout << "Not Adding " << theCommand << endl; if (noisy)
cout << "Not Adding " << theCommand << endl;
std::list<Token>::iterator endOfParagraph = getEndOfParagraph(tokList); std::list<Token>::iterator endOfParagraph = getEndOfParagraph(tokList);
tokList.setIterator(endOfParagraph); tokList.setIterator(endOfParagraph);
return 1; return 1;
@ -558,9 +590,11 @@ std::list<Token>::iterator getTilAnyCommand(std::string theCommand, TokenList &t
std::string name = getNextWord(tokList); std::string name = getNextWord(tokList);
aNewList.push_back(DoxygenEntity("plainstd::string", name)); aNewList.push_back(DoxygenEntity("plainstd::string", name));
name = getNextWord(tokList); name = getNextWord(tokList);
if(!name.empty()) aNewList.push_back(DoxygenEntity("plainstd::string", name)); if(!name.empty())
aNewList.push_back(DoxygenEntity("plainstd::string", name));
name = getNextWord(tokList); name = getNextWord(tokList);
if(!name.empty()) aNewList.push_back(DoxygenEntity("plainstd::string", name)); if(!name.empty())
aNewList.push_back(DoxygenEntity("plainstd::string", name));
doxyList.push_back(DoxygenEntity(theCommand, aNewList)); doxyList.push_back(DoxygenEntity(theCommand, aNewList));
return 1; return 1;
} }
@ -580,7 +614,8 @@ std::list<Token>::iterator getTilAnyCommand(std::string theCommand, TokenList &t
std::string name = getNextWord(tokList); std::string name = getNextWord(tokList);
aNewList.push_back(DoxygenEntity("plainstd::string", name)); aNewList.push_back(DoxygenEntity("plainstd::string", name));
name = getNextWord(tokList); name = getNextWord(tokList);
if(!name.empty()) aNewList.push_back(DoxygenEntity("plainstd::string", name)); if(!name.empty())
aNewList.push_back(DoxygenEntity("plainstd::string", name));
doxyList.push_back(DoxygenEntity(theCommand, aNewList)); doxyList.push_back(DoxygenEntity(theCommand, aNewList));
return 1; return 1;
} }
@ -592,7 +627,8 @@ std::list<Token>::iterator getTilAnyCommand(std::string theCommand, TokenList &t
aNewList = parse(endOfLine, tokList); aNewList = parse(endOfLine, tokList);
doxyList.push_back(DoxygenEntity(theCommand, aNewList)); doxyList.push_back(DoxygenEntity(theCommand, aNewList));
} }
else doxyList.push_back(DoxygenEntity(theCommand)); else
doxyList.push_back(DoxygenEntity(theCommand));
return 1; return 1;
} }
// \weakgroup <name> [(title)] // \weakgroup <name> [(title)]
@ -614,21 +650,24 @@ std::list<Token>::iterator getTilAnyCommand(std::string theCommand, TokenList &t
// \ref <name> ["(text)"] // \ref <name> ["(text)"]
else if (theCommand.compare("ref") == 0){ else if (theCommand.compare("ref") == 0){
//TODO Implement ref //TODO Implement ref
if (noisy) cout << "Not Adding " << theCommand << endl; if (noisy)
cout << "Not Adding " << theCommand << endl;
std::list<Token>::iterator endOfParagraph = getEndOfParagraph(tokList); std::list<Token>::iterator endOfParagraph = getEndOfParagraph(tokList);
tokList.setIterator(endOfParagraph); tokList.setIterator(endOfParagraph);
} }
// \subpage <name> ["(text)"] // \subpage <name> ["(text)"]
else if (theCommand.compare("subpage") == 0){ else if (theCommand.compare("subpage") == 0){
//TODO implement subpage //TODO implement subpage
if (noisy) cout << "Not Adding " << theCommand << endl; if (noisy)
cout << "Not Adding " << theCommand << endl;
std::list<Token>::iterator endOfParagraph = getEndOfParagraph(tokList); std::list<Token>::iterator endOfParagraph = getEndOfParagraph(tokList);
tokList.setIterator(endOfParagraph); tokList.setIterator(endOfParagraph);
} }
// \dotfile <file> ["caption"] // \dotfile <file> ["caption"]
else if (theCommand.compare("dotfile") == 0){ else if (theCommand.compare("dotfile") == 0){
//TODO implement dotfile //TODO implement dotfile
if (noisy) cout << "Not Adding " << theCommand << endl; if (noisy)
cout << "Not Adding " << theCommand << endl;
std::list<Token>::iterator endOfParagraph = getEndOfParagraph(tokList); std::list<Token>::iterator endOfParagraph = getEndOfParagraph(tokList);
tokList.setIterator(endOfParagraph); tokList.setIterator(endOfParagraph);
} }
@ -638,7 +677,8 @@ std::list<Token>::iterator getTilAnyCommand(std::string theCommand, TokenList &t
} }
// \addtogroup <name> [(title)] // \addtogroup <name> [(title)]
else if (theCommand.compare("addtogroup") == 0){ else if (theCommand.compare("addtogroup") == 0){
if (noisy) cout << "Parsing " << theCommand << endl; if (noisy)
cout << "Parsing " << theCommand << endl;
std::string name = getNextWord(tokList); std::string name = getNextWord(tokList);
if (name.empty()){ if (name.empty()){
cout << "No word followed " << theCommand << " command. Not added" << endl; cout << "No word followed " << theCommand << " command. Not added" << endl;
@ -724,17 +764,19 @@ std::list<DoxygenEntity> parse(std::list<Token>::iterator endParsingIndex, Token
int currCommand; int currCommand;
while (tokList.current() != endParsingIndex){ while (tokList.current() != endParsingIndex){
Token currToken = tokList.peek(); Token currToken = tokList.peek();
if(noisy) cout << "Parsing for phrase starting in:" << currToken.toString() << endl; if(noisy)
cout << "Parsing for phrase starting in:" << currToken.toString() << endl;
if(currToken.tokenType == END_LINE ){ if(currToken.tokenType == END_LINE ){
tokList.next(); tokList.next();
} }
else if(currToken.tokenType == COMMAND){ else if(currToken.tokenType == COMMAND){
currCommand = findCommand(currToken.tokenString); currCommand = findCommand(currToken.tokenString);
if (currCommand < 0 ){ if (currCommand < 0 ){
if(noisy) cout << "Unidentified Command " << currToken.tokenString << endl; if(noisy)
cout << "Unidentified Command " << currToken.tokenString << endl;
tokList.next(); tokList.next();
addCommand(std::string("plainstd::string"), tokList, aNewList);} addCommand(std::string("plainstd::string"), tokList, aNewList);
//cout << "Command: " << currWord << " " << currCommand << endl; }
else { tokList.next(); else { tokList.next();
addCommand(currToken.tokenString, tokList, aNewList); addCommand(currToken.tokenString, tokList, aNewList);
} }
@ -742,7 +784,7 @@ std::list<DoxygenEntity> parse(std::list<Token>::iterator endParsingIndex, Token
else if (currToken.tokenType == PLAINSTRING){ else if (currToken.tokenType == PLAINSTRING){
addCommand(std::string("plainstd::string"), tokList, aNewList); addCommand(std::string("plainstd::string"), tokList, aNewList);
} }
else break; break;
} }
return aNewList; return aNewList;
} }
@ -759,7 +801,8 @@ std::list<DoxygenEntity> parseRoot(std::list<Token>::iterator endParsingIndex, T
else if(currToken.tokenType == COMMAND){ else if(currToken.tokenType == COMMAND){
currCommand = findCommand(currToken.tokenString); currCommand = findCommand(currToken.tokenString);
if (currCommand < 0 ){ if (currCommand < 0 ){
if(noisy) cout << "Unidentified Command " << currToken.tokenString << endl; if(noisy)
cout << "Unidentified Command " << currToken.tokenString << endl;
tokList.next(); tokList.next();
addCommand(std::string("partofdescription"), tokList, aNewList);} addCommand(std::string("partofdescription"), tokList, aNewList);}
//cout << "Command: " << currWord << " " << currCommand << endl; //cout << "Command: " << currWord << " " << currCommand << endl;