diff options
Diffstat (limited to 'addon/doxyparse')
-rw-r--r-- | addon/doxyparse/README | 10 | ||||
-rw-r--r-- | addon/doxyparse/doxyparse.cpp | 35 |
2 files changed, 37 insertions, 8 deletions
diff --git a/addon/doxyparse/README b/addon/doxyparse/README index 9f7429c..288b31e 100644 --- a/addon/doxyparse/README +++ b/addon/doxyparse/README @@ -5,16 +5,24 @@ This directory contains an "source parsing engine" based on doxyapp code. More info and source code repository: https://github.com/analizo/doxygen +## build dependencies + + apt-get install flex bison cmake build-essential python + ## build cmake -G "Unix Makefiles" -Dbuild_parse=ON make +## install + + sudo make install + AUTHORS ======= Antonio Terceiro <terceiro@softwarelivre.org> João M. Miranda <joaomm88@gmail.com> -Joenio Costa <joenio@colivre.coop.br> +Joenio Costa <joenio@joenio.me> Paulo Meirelles <paulo@softwarelivre.org> Vinicius Daros <vkdaros@mercurio.eclipse.ime.usp.br> diff --git a/addon/doxyparse/doxyparse.cpp b/addon/doxyparse/doxyparse.cpp index 6a1886c..584e8b0 100644 --- a/addon/doxyparse/doxyparse.cpp +++ b/addon/doxyparse/doxyparse.cpp @@ -138,7 +138,7 @@ static void printDefines() { modules[current_module] = true; } static void printDefinition(std::string type, std::string signature, int line) { - printf(" - %s:\n", signature.c_str()); + printf(" - \"%s\":\n", signature.c_str()); printf(" type: %s\n", type.c_str()); printf(" line: %d\n", line); } @@ -155,7 +155,7 @@ static void printUses() { printf(" uses:\n"); } static void printReferenceTo(std::string type, std::string signature, std::string defined_in) { - printf(" - %s:\n", signature.c_str()); + printf(" - \"%s\":\n", signature.c_str()); printf(" type: %s\n", type.c_str()); printf(" defined_in: %s\n", defined_in.c_str()); } @@ -167,6 +167,24 @@ static int isPartOfCStruct(MemberDef * md) { return is_c_code && md->getClassDef() != NULL; } +std::string removeDoubleQuotes(std::string data) { + // remove surrounding double quotes + if (data.front() == '"' && data.back() == '"') { + data.erase(0, 1); // first double quote + data.erase(data.size() - 1); // last double quote + } + return data; +} + +std::string argumentData(Argument *argument) { + std::string data = ""; + if (argument->type != NULL) + data = removeDoubleQuotes(argument->type.data()); + else if (argument->name != NULL) + data = removeDoubleQuotes(argument->name.data()); + return data; +} + std::string functionSignature(MemberDef* md) { std::string signature = md->name().data(); if(md->isFunction()){ @@ -175,9 +193,9 @@ std::string functionSignature(MemberDef* md) { signature += "("; Argument * argument = iterator.toFirst(); if(argument != NULL) { - signature += argument->type.data(); - for(++iterator; (argument = iterator.current()) ;++iterator){ - signature += std::string(",") + argument->type.data(); + signature += argumentData(argument); + for(++iterator; (argument = iterator.current()); ++iterator){ + signature += std::string(",") + argumentData(argument); } } signature += ")"; @@ -245,7 +263,7 @@ static void lookupSymbol(Definition *d) { std::string signature = functionSignature(md); printDefinition(type, signature, md->getDefLine()); if (md->protection() == Public) { - printProtection("protection public"); + printProtection("public"); } if (md->isFunction()) { functionInformation(md); @@ -311,7 +329,10 @@ static void detectProgrammingLanguage(FileNameListIterator& fnli) { checkLanguage(filename, ".cc") || checkLanguage(filename, ".cxx") || checkLanguage(filename, ".cpp") || - checkLanguage(filename, ".java") + checkLanguage(filename, ".java") || + checkLanguage(filename, ".py") || + checkLanguage(filename, ".pyw") || + checkLanguage(filename, ".cs") ) { is_c_code = false; } |