Now works end to end :) DoxygenTranslator restructured and placed into SWIG, Changes to java.cxx and

lang.cxx to accomodate this



git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-cherylfoil@10761 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Cheryl Foil 2008-08-15 23:36:18 +00:00
commit 4f2a579d6d
39 changed files with 5101 additions and 58 deletions

View file

@ -0,0 +1,89 @@
#include "DoxygenEntity.h"
#include <string>
/* Little data class for Doxygen Commands */
/* Basic node for commands that have
* nothing after them
* example: \n
*/
string commandArray2[] = {"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",
"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", "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",
"$", "@", string(1, 92), "&", "~", "<", ">", "#", "%"};
string findCommand(int commandNum){
int arraySize = sizeof(commandArray2)/sizeof(*commandArray2);
if (commandNum - 101 >= 0 && commandNum - 101 < arraySize){
return commandArray2[commandNum - 101];
}
return "" ;
}
DoxygenEntity::DoxygenEntity(string typeEnt){
typeOfEntity = typeEnt;
data = "";
isLeaf = 1;
}
/* Basic node for commands that have
* only 1 thing after them
* example: \b word
* OR holding a string
*/
DoxygenEntity::DoxygenEntity(string typeEnt, string param1){
typeOfEntity = typeEnt;
data = param1;
isLeaf = 1;
}
/* Nonterminal node
* contains
*/
DoxygenEntity::DoxygenEntity(string typeEnt, list <DoxygenEntity> &entList ){
typeOfEntity = typeEnt;
data = "";
isLeaf = 0;
entityList = entList;
}
void DoxygenEntity::printEntity(int level){
int thisLevel = level;
if (isLeaf) {
for (int i = 0; i < thisLevel; i++) {cout << "\t";}
cout << "Node Command: " << typeOfEntity << " ";
if (data.compare("") != 0) cout << "Node Data: " << data;
cout << endl;
}
else{
for (int i = 0; i < thisLevel; i++) {cout << "\t";}
cout << "Node Command : " << typeOfEntity << endl;
list<DoxygenEntity>::iterator p = entityList.begin();
thisLevel++;
while (p != entityList.end()){
(*p).printEntity(thisLevel);
p++;
}
}
}
DoxygenEntity::~DoxygenEntity()
{
}