summaryrefslogtreecommitdiffstats
path: root/addon
diff options
context:
space:
mode:
authorJoenio Costa <joenio@joenio.me>2017-06-28 02:10:08 (GMT)
committerJoenio Costa <joenio@joenio.me>2017-06-28 02:10:08 (GMT)
commit20af63f43e583a31dfe93f78807aa868f9b9ff14 (patch)
treeeac1804f1be010fb8598647f8e608cd1f9e3d0dd /addon
parente7e62101a1a659740223c32cdd525b1e66b1cf09 (diff)
downloadDoxygen-20af63f43e583a31dfe93f78807aa868f9b9ff14.zip
Doxygen-20af63f43e583a31dfe93f78807aa868f9b9ff14.tar.gz
Doxygen-20af63f43e583a31dfe93f78807aa868f9b9ff14.tar.bz2
add the number of conditionals path and bugfix
* Rebased with upstream master * Added build instructions to README * Bug 398942 - fixes the problem with instance variables and arguments with the same name Signed-off-by: Antonio Terceiro <terceiro@softwarelivre.org> Signed-off-by: João M. Miranda <joaomm88@gmail.com> Signed-off-by: Paulo Meirelles <paulo@softwarelivre.org> Signed-off-by: Vinicius Daros <vkdaros@mercurio.eclipse.ime.usp.br> Signed-off-by: Jonathan Moraes <arkyebr@gmail.com>
Diffstat (limited to 'addon')
-rw-r--r--addon/doxyparse/CMakeLists.txt11
-rw-r--r--addon/doxyparse/README5
-rw-r--r--addon/doxyparse/doxyparse.cpp59
3 files changed, 47 insertions, 28 deletions
diff --git a/addon/doxyparse/CMakeLists.txt b/addon/doxyparse/CMakeLists.txt
index 24f98cb..e4f9021 100644
--- a/addon/doxyparse/CMakeLists.txt
+++ b/addon/doxyparse/CMakeLists.txt
@@ -1,11 +1,21 @@
if (build_parse)
+# configvalues.h
+add_custom_command(
+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/configgen.py -maph ${CMAKE_SOURCE_DIR}/src/config.xml > ${GENERATED_SRC}/configvalues.h
+ DEPENDS ${CMAKE_SOURCE_DIR}/src/config.xml ${CMAKE_SOURCE_DIR}/src/configgen.py
+ OUTPUT ${GENERATED_SRC}/configvalues.h
+)
+set_source_files_properties(${GENERATED_SRC}/configvalues.h PROPERTIES GENERATED 1)
+
find_package(Iconv)
include_directories(
${CMAKE_SOURCE_DIR}/src
+ ${GENERATED_SRC}
${CMAKE_SOURCE_DIR}/qtools
${ICONV_INCLUDE_DIR}
+ ${CLANG_INCLUDEDIR}
)
add_executable(doxyparse
@@ -21,6 +31,7 @@ ${ICONV_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${SQLITE3_LIBRARIES}
${EXTRA_LIBS}
+${CLANG_LIBS}
)
install(TARGETS doxyparse DESTINATION bin)
diff --git a/addon/doxyparse/README b/addon/doxyparse/README
index 7cbc8ff..9f7429c 100644
--- a/addon/doxyparse/README
+++ b/addon/doxyparse/README
@@ -5,6 +5,11 @@ This directory contains an "source parsing engine" based on doxyapp code.
More info and source code repository: https://github.com/analizo/doxygen
+## build
+
+ cmake -G "Unix Makefiles" -Dbuild_parse=ON
+ make
+
AUTHORS
=======
diff --git a/addon/doxyparse/doxyparse.cpp b/addon/doxyparse/doxyparse.cpp
index ec1bdae..ee34e3b 100644
--- a/addon/doxyparse/doxyparse.cpp
+++ b/addon/doxyparse/doxyparse.cpp
@@ -103,7 +103,7 @@ static void findXRefSymbols(FileDef *fd)
static bool ignoreStaticExternalCall(MemberDef *context, MemberDef *md) {
if (md->isStatic()) {
if(md->getFileDef()) {
- if(md->getFileDef()->getFileBase() == context->getFileDef()->getFileBase())
+ if(md->getFileDef()->getOutputFileBase() == context->getFileDef()->getOutputFileBase())
// TODO ignore prefix of file
return false;
else
@@ -159,6 +159,9 @@ static void printReferenceTo(std::string type, std::string signature, std::strin
printf(" type: %s\n", type.c_str());
printf(" defined_in: %s\n", defined_in.c_str());
}
+static void printNumberOfConditionalPaths(MemberDef* md) {
+ printf(" conditional_paths: %d\n", md->numberOfFlowKeyWords());
+}
static int isPartOfCStruct(MemberDef * md) {
return is_c_code && md->getClassDef() != NULL;
@@ -188,7 +191,7 @@ static void referenceTo(MemberDef* md) {
std::string signature = "";
if (isPartOfCStruct(md)) {
signature = md->getClassDef()->name().data() + std::string("::") + functionSignature(md);
- defined_in = md->getClassDef()->getFileDef()->getFileBase().data();
+ defined_in = md->getClassDef()->getFileDef()->getOutputFileBase().data();
}
else {
signature = functionSignature(md);
@@ -196,7 +199,7 @@ static void referenceTo(MemberDef* md) {
defined_in = md->getClassDef()->name().data();
}
else if (md->getFileDef()) {
- defined_in = md->getFileDef()->getFileBase().data();
+ defined_in = md->getFileDef()->getOutputFileBase().data();
}
}
printReferenceTo(type, signature, defined_in);
@@ -221,6 +224,7 @@ void functionInformation(MemberDef* md) {
printNumberOfLines(size);
ArgumentList *argList = md->argumentList();
printNumberOfArguments(argList->count());
+ printNumberOfConditionalPaths(md);
MemberSDict *defDict = md->getReferencesMembers();
if (defDict) {
MemberSDict::Iterator msdi(*defDict);
@@ -329,7 +333,7 @@ static void listSymbols() {
printFile(fd->absFilePath().data());
MemberList *ml = fd->getMemberList(MemberListType_allMembersList);
if (ml && ml->count() > 0) {
- printModule(fd->getFileBase().data());
+ printModule(fd->getOutputFileBase().data());
listMembers(ml);
}
@@ -355,37 +359,40 @@ int main(int argc,char **argv) {
// initialize data structures
initDoxygen();
+ // check and finalize the configuration
+ checkConfiguration();
+ adjustConfiguration();
+
// setup the non-default configuration options
// we need a place to put intermediate files
std::ostringstream tmpdir;
tmpdir << "/tmp/doxyparse-" << getpid();
- Config_getString("OUTPUT_DIRECTORY")= tmpdir.str().c_str();
-
+ Config_getString(OUTPUT_DIRECTORY)= tmpdir.str().c_str();
// enable HTML (fake) output to omit warning about missing output format
- Config_getBool("GENERATE_HTML")=TRUE;
+ Config_getBool(GENERATE_HTML)=TRUE;
// disable latex output
- Config_getBool("GENERATE_LATEX")=FALSE;
+ Config_getBool(GENERATE_LATEX)=FALSE;
// be quiet
- Config_getBool("QUIET")=TRUE;
+ Config_getBool(QUIET)=TRUE;
// turn off warnings
- Config_getBool("WARNINGS")=FALSE;
- Config_getBool("WARN_IF_UNDOCUMENTED")=FALSE;
- Config_getBool("WARN_IF_DOC_ERROR")=FALSE;
+ Config_getBool(WARNINGS)=FALSE;
+ Config_getBool(WARN_IF_UNDOCUMENTED)=FALSE;
+ Config_getBool(WARN_IF_DOC_ERROR)=FALSE;
// Extract as much as possible
- Config_getBool("EXTRACT_ALL")=TRUE;
- Config_getBool("EXTRACT_STATIC")=TRUE;
- Config_getBool("EXTRACT_PRIVATE")=TRUE;
- Config_getBool("EXTRACT_LOCAL_METHODS")=TRUE;
+ Config_getBool(EXTRACT_ALL)=TRUE;
+ Config_getBool(EXTRACT_STATIC)=TRUE;
+ Config_getBool(EXTRACT_PRIVATE)=TRUE;
+ Config_getBool(EXTRACT_LOCAL_METHODS)=TRUE;
// Extract source browse information, needed
// to make doxygen gather the cross reference info
- Config_getBool("SOURCE_BROWSER")=TRUE;
+ Config_getBool(SOURCE_BROWSER)=TRUE;
// find functions call between modules
- Config_getBool("CALL_GRAPH")=TRUE;
+ Config_getBool(CALL_GRAPH)=TRUE;
// loop recursive over input files
- Config_getBool("RECURSIVE")=TRUE;
+ Config_getBool(RECURSIVE)=TRUE;
// set the input
- Config_getList("INPUT").clear();
+ Config_getList(INPUT).clear();
for (int i = 1; i < argc; i++) {
if (strcmp(argv[i], "-") == 0) {
char filename[1024];
@@ -394,20 +401,16 @@ int main(int argc,char **argv) {
if (feof(stdin)) {
break;
}
- Config_getList("INPUT").append(filename);
+ Config_getList(INPUT).append(filename);
}
} else {
- Config_getList("INPUT").append(argv[i]);
+ Config_getList(INPUT).append(argv[i]);
}
}
- if (Config_getList("INPUT").isEmpty()) {
+ if (Config_getList(INPUT).isEmpty()) {
exit(0);
}
- // check and finalize the configuration
- checkConfiguration();
- adjustConfiguration();
-
// parse the files
parseInput();
@@ -429,7 +432,7 @@ int main(int argc,char **argv) {
if (!Doxygen::objDBFileName.isEmpty()) unlink(Doxygen::objDBFileName);
if (!Doxygen::entryDBFileName.isEmpty()) unlink(Doxygen::entryDBFileName);
// clean up after us
- rmdir(Config_getString("OUTPUT_DIRECTORY"));
+ rmdir(Config_getString(OUTPUT_DIRECTORY));
listSymbols();