Skip to content

Commit

Permalink
Merge branch 'master' of github.com:doxygen/doxygen
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimitri van Heesch committed Sep 16, 2017
2 parents c120ac4 + ddae919 commit 62ccfaa
Show file tree
Hide file tree
Showing 37 changed files with 1,460 additions and 613 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Expand Up @@ -5,7 +5,6 @@ compiler:

before_install:
- sudo apt-add-repository ppa:smspillaz/cmake-2.8.12 -y
- sudo add-apt-repository ppa:texlive-backports/ppa -y
- sudo apt-get update -qq

install:
Expand Down
2 changes: 1 addition & 1 deletion INSTALL
@@ -1,6 +1,6 @@
DOXYGEN

Please read the installation section of the manual
Please read the installation section of the manual
(http://www.doxygen.org/install.html) for instructions.

--------
Expand Down
11 changes: 11 additions & 0 deletions 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
Expand All @@ -21,6 +31,7 @@ ${ICONV_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${SQLITE3_LIBRARIES}
${EXTRA_LIBS}
${CLANG_LIBS}
)

install(TARGETS doxyparse DESTINATION bin)
Expand Down
5 changes: 5 additions & 0 deletions addon/doxyparse/README
Expand Up @@ -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
=======

Expand Down
59 changes: 31 additions & 28 deletions addon/doxyparse/doxyparse.cpp
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -188,15 +191,15 @@ 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);
if (md->getClassDef()) {
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);
Expand All @@ -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);
Expand Down Expand Up @@ -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);
}

Expand All @@ -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];
Expand All @@ -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();

Expand All @@ -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();

Expand Down
10 changes: 5 additions & 5 deletions cmake/lang_cfg.cmake
@@ -1,10 +1,10 @@
if(${CMAKE_ARGC} GREATER 1)
if ("${CMAKE_ARGV3}" STREQUAL "ENONLY")
message("#define ENGLISH_ONLY")
if(${CMAKE_ARGC} GREATER 2)
if ("${CMAKE_ARGV4}" STREQUAL "ENONLY")
file(APPEND ${CMAKE_ARGV3} " #define ENGLISH_ONLY")
else()
math(EXPR UPTO ${CMAKE_ARGC}-1)
foreach(i RANGE 3 ${UPTO})
message("#define LANG_${CMAKE_ARGV${i}}")
foreach(i RANGE 4 ${UPTO})
file(APPEND ${CMAKE_ARGV3} " #define LANG_${CMAKE_ARGV${i}}")
endforeach()
endif()
endif()
Expand Down
2 changes: 1 addition & 1 deletion doc/preprocessing.doc
Expand Up @@ -62,7 +62,7 @@ to \c YES. Then the result after preprocessing becomes:
#define VERSION
#define CONST_STRING

static const char * version = "1.xx";
static const char * version = "2.xx";
\endverbatim

Note that doxygen will now expand \e all macro definitions
Expand Down
2 changes: 1 addition & 1 deletion jquery/README
@@ -1,6 +1,6 @@
Doxygen's jquery.js script is composed of minified versions of the following
packages:
- jquery 1.7.1: http://jquery.com/download/
- jquery 1.7.1: http://jquery.com/download/
- jquery.ui 1.8.18: https://code.google.com/p/jquery-ui/downloads/list
modules required:
- jquery.ui.core
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Expand Up @@ -73,7 +73,7 @@ set_source_files_properties(${GENERATED_SRC}/ce_parse.h PROPERTIES GENERATED 1)
# lang_cfg.h
add_custom_command(
COMMENT "Generating ${GENERATED_SRC}/lang_cfg.h"
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_SOURCE_DIR}/cmake/lang_cfg.cmake ${LANG_CODES} 2> ${GENERATED_SRC}/lang_cfg.h
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_SOURCE_DIR}/cmake/lang_cfg.cmake ${GENERATED_SRC}/lang_cfg.h ${LANG_CODES}
DEPENDS ${LANGUAGE_FILES}
OUTPUT ${GENERATED_SRC}/lang_cfg.h
)
Expand Down
14 changes: 14 additions & 0 deletions src/classdef.cpp
Expand Up @@ -1935,7 +1935,21 @@ void ClassDef::writeDeclarationLink(OutputList &ol,bool &found,const char *heade
if (rootNode && !rootNode->isEmpty())
{
ol.startMemberDescription(anchor());

ol.pushGeneratorState();
ol.disableAll();
ol.enable(OutputGenerator::RTF);
ol.writeString("{");
ol.popGeneratorState();

ol.writeDoc(rootNode,this,0);

ol.pushGeneratorState();
ol.disableAll();
ol.enable(OutputGenerator::RTF);
ol.writeString("\\par}");
ol.popGeneratorState();

if (isLinkableInProject())
{
writeMoreLink(ol,anchor());
Expand Down
54 changes: 52 additions & 2 deletions src/code.l
Expand Up @@ -126,6 +126,7 @@ static bool g_lexInit = FALSE;

static QStack<int> g_classScopeLengthStack;

static int g_prefixed_with_this_keyword = FALSE;
static Definition *g_searchCtx;
static bool g_collectXRefs;

Expand Down Expand Up @@ -963,7 +964,7 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,const char *clName
bool isLocal=FALSE;

//printf("generateClassOrGlobalLink(className=%s)\n",className.data());
if ((lcd=g_theVarContext.findVariable(className))==0) // not a local variable
if (!g_prefixed_with_this_keyword || (lcd=g_theVarContext.findVariable(className))==0) // not a local variable
{
Definition *d = g_currentDefinition;
//printf("d=%s g_sourceFileDef=%s\n",d?d->name().data():"<none>",g_sourceFileDef?g_sourceFileDef->name().data():"<none>");
Expand Down Expand Up @@ -1019,6 +1020,8 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,const char *clName
isLocal=TRUE;
DBG_CTX((stderr,"is a local variable cd=%p!\n",cd));
}
g_prefixed_with_this_keyword = FALSE; // discard the "this" prefix for the next calls

if (cd && cd->isLinkable()) // is it a linkable class
{
DBG_CTX((stderr,"is linkable class %s\n",clName));
Expand Down Expand Up @@ -1821,7 +1824,8 @@ SCOPETNAME (((({ID}{TEMPLIST}?){BN}*)?{SEP}{BN}*)*)((~{BN}*)?{ID})
SCOPEPREFIX ({ID}{TEMPLIST}?{BN}*{SEP}{BN}*)+
KEYWORD_OBJC ("@public"|"@private"|"@protected"|"@class"|"@implementation"|"@interface"|"@end"|"@selector"|"@protocol"|"@optional"|"@required"|"@throw"|"@synthesize"|"@property")
KEYWORD ("asm"|"__assume"|"auto"|"class"|"const"|"delete"|"enum"|"explicit"|"extern"|"false"|"friend"|"gcnew"|"gcroot"|"set"|"get"|"inline"|"internal"|"mutable"|"namespace"|"new"|"nullptr"|"override"|"operator"|"pin_ptr"|"private"|"protected"|"public"|"raise"|"register"|"remove"|"self"|"sizeof"|"static"|"struct"|"__super"|"function"|"template"|"generic"|"this"|"true"|"typedef"|"typeid"|"typename"|"union"|"using"|"virtual"|"volatile"|"abstract"|"final"|"import"|"synchronized"|"transient"|"alignas"|"alignof"|{KEYWORD_OBJC})
FLOWKW ("break"|"case"|"catch"|"continue"|"default"|"do"|"else"|"finally"|"for"|"foreach"|"for each"|"goto"|"if"|"return"|"switch"|"throw"|"throws"|"try"|"while"|"@try"|"@catch"|"@finally")
FLOWKW ("break"|"catch"|"continue"|"default"|"do"|"else"|"finally"|"return"|"switch"|"throw"|"throws"|"@catch"|"@finally")
FLOWCONDITION ("case"|"for"|"foreach"|"for each"|"goto"|"if"|"try"|"while"|"@try")
TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"object"|"short"|"signed"|"unsigned"|"void"|"wchar_t"|"size_t"|"boolean"|"id"|"SEL"|"string"|"nullptr")
CASTKW ("const_cast"|"dynamic_cast"|"reinterpret_cast"|"static_cast")
CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^' \\\n]{1,4}"'"))
Expand Down Expand Up @@ -2408,6 +2412,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\"
<UsingName>\n { codifyLines(yytext); BEGIN(Body); }
<UsingName>. { codifyLines(yytext); BEGIN(Body); }
<Body,FuncCall>"$"?"this"("->"|".") { g_code->codify(yytext); // this-> for C++, this. for C#
g_prefixed_with_this_keyword = TRUE;
}
<Body>{KEYWORD}/([^a-z_A-Z0-9]) {
startFontClass("keyword");
Expand Down Expand Up @@ -2449,6 +2454,18 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\"
g_inForEachExpression = (qstrcmp(yytext,"for each")==0 || qstrcmp(yytext, "foreach")==0);
BEGIN(FuncCall);
}
<Body>{FLOWCONDITION}/{BN}*"(" {
if (g_currentMemberDef && g_currentMemberDef->isFunction())
{
g_currentMemberDef->addFlowKeyWord();
}
startFontClass("keywordflow");
codifyLines(yytext);
endFontClass();
g_name.resize(0);g_type.resize(0);
g_inForEachExpression = (strcmp(yytext,"for each")==0 || strcmp(yytext, "foreach")==0);
BEGIN(FuncCall);
}
<Body>{FLOWKW}/([^a-z_A-Z0-9]) {
startFontClass("keywordflow");
codifyLines(yytext);
Expand All @@ -2458,11 +2475,33 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\"
g_inFunctionTryBlock=FALSE;
}
}
<Body>{FLOWCONDITION}/([^a-z_A-Z0-9]) {
if (g_currentMemberDef && g_currentMemberDef->isFunction())
{
g_currentMemberDef->addFlowKeyWord();
}
startFontClass("keywordflow");
codifyLines(yytext);
endFontClass();
if (g_inFunctionTryBlock && (strcmp(yytext,"catch")==0 || strcmp(yytext,"finally")==0))
{
g_inFunctionTryBlock=FALSE;
}
}
<Body>{FLOWKW}/{B}* {
startFontClass("keywordflow");
codifyLines(yytext);
endFontClass();
}
<Body>{FLOWCONDITION}/{B}* {
if (g_currentMemberDef && g_currentMemberDef->isFunction())
{
g_currentMemberDef->addFlowKeyWord();
}
startFontClass("keywordflow");
codifyLines(yytext);
endFontClass();
}
<Body>"*"{B}*")" { // end of cast?
g_code->codify(yytext);
g_theCallContext.popScope();
Expand Down Expand Up @@ -2963,6 +3002,17 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\"
g_code->codify(yytext);
endFontClass();
}
<MemberCall2,FuncCall>{FLOWCONDITION}/([^a-z_A-Z0-9]) {
if (g_currentMemberDef && g_currentMemberDef->isFunction())
{
g_currentMemberDef->addFlowKeyWord();
}
addParmType();
g_parmName=yytext;
startFontClass("keywordflow");
g_code->codify(yytext);
endFontClass();
}
<MemberCall2,FuncCall>{ID}(({B}*"<"[^\n\[\](){}<>]*">")?({B}*"::"{B}*{ID})?)* {
addParmType();
g_parmName=yytext;
Expand Down

0 comments on commit 62ccfaa

Please sign in to comment.