From a93deafa9c460aceb9ca87add52405e1f41cf14a Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 15 May 2020 13:47:20 +0200 Subject: Change of git version input file was not taken into account Changes in the git version input file file were not taken into account. Explicitly checking whether or not the input file is newer or not than the output file. --- cmake/git_watcher.cmake | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cmake/git_watcher.cmake b/cmake/git_watcher.cmake index 72b7852..ac34c1d 100644 --- a/cmake/git_watcher.cmake +++ b/cmake/git_watcher.cmake @@ -150,6 +150,19 @@ function(CheckGit _working_dir _state_changed _state) # (Passing by reference in CMake is awkward...) set(${_state} ${state} PARENT_SCOPE) + if(EXISTS "${POST_CONFIGURE_GIT_VERSION_FILE}") + if("${PRE_CONFIGURE_GIT_VERSION_FILE}" IS_NEWER_THAN "${POST_CONFIGURE_GIT_VERSION_FILE}") + file(REMOVE "${POST_CONFIGURE_GIT_VERSION_FILE}") + file(REMOVE "${GIT_STATE_FILE}") + set(${_state_changed} "true" PARENT_SCOPE) + return() + endif() + else() + file(REMOVE "${GIT_STATE_FILE}") + set(${_state_changed} "true" PARENT_SCOPE) + return() + endif() + # Check if the state has changed compared to the backup on disk. if(EXISTS "${GIT_STATE_FILE}") file(READ "${GIT_STATE_FILE}" OLD_HEAD_CONTENTS) -- cgit v0.12 From 57fe2e8128f33e6b6d09ab340874abbb52cf89d7 Mon Sep 17 00:00:00 2001 From: Wataru Ashihara Date: Sat, 23 May 2020 17:33:32 +0900 Subject: Replace ${CMAKE_SOURCE_DIR}/path/to/current/cmake-lists-txt/dir with ${CMAKE_CURRENT_LIST_DIR} --- src/CMakeLists.txt | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e880722..255db79 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -14,7 +14,7 @@ include_directories( file(MAKE_DIRECTORY ${GENERATED_SRC}) -file(GLOB LANGUAGE_FILES "${CMAKE_SOURCE_DIR}/src/translator_??.h") +file(GLOB LANGUAGE_FILES "${CMAKE_CURRENT_LIST_DIR}/translator_??.h") # instead of increasebuffer.py add_definitions(-DYY_BUF_SIZE=${enlarge_lex_buffers} -DYY_READ_BUF_SIZE=${enlarge_lex_buffers}) @@ -35,8 +35,8 @@ set_source_files_properties(${GENERATED_SRC}/settings.h PROPERTIES GENERATED 1) # 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 + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/configgen.py -maph ${CMAKE_CURRENT_LIST_DIR}/config.xml > ${GENERATED_SRC}/configvalues.h + DEPENDS ${CMAKE_CURRENT_LIST_DIR}/config.xml ${CMAKE_CURRENT_LIST_DIR}/configgen.py OUTPUT ${GENERATED_SRC}/configvalues.h ) set_source_files_properties(${GENERATED_SRC}/configvalues.h PROPERTIES GENERATED 1) @@ -47,16 +47,16 @@ add_custom_target( # configvalues.cpp add_custom_command( - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/configgen.py -maps ${CMAKE_SOURCE_DIR}/src/config.xml > ${GENERATED_SRC}/configvalues.cpp - DEPENDS ${CMAKE_SOURCE_DIR}/src/config.xml ${CMAKE_SOURCE_DIR}/src/configgen.py + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/configgen.py -maps ${CMAKE_CURRENT_LIST_DIR}/config.xml > ${GENERATED_SRC}/configvalues.cpp + DEPENDS ${CMAKE_CURRENT_LIST_DIR}/config.xml ${CMAKE_CURRENT_LIST_DIR}/configgen.py OUTPUT ${GENERATED_SRC}/configvalues.cpp ) set_source_files_properties(${GENERATED_SRC}/configvalues.cpp PROPERTIES GENERATED 1) # configoptions.cpp add_custom_command( - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/configgen.py -cpp ${CMAKE_SOURCE_DIR}/src/config.xml > ${GENERATED_SRC}/configoptions.cpp - DEPENDS ${CMAKE_SOURCE_DIR}/src/config.xml ${CMAKE_SOURCE_DIR}/src/configgen.py + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/configgen.py -cpp ${CMAKE_CURRENT_LIST_DIR}/config.xml > ${GENERATED_SRC}/configoptions.cpp + DEPENDS ${CMAKE_CURRENT_LIST_DIR}/config.xml ${CMAKE_CURRENT_LIST_DIR}/configgen.py OUTPUT ${GENERATED_SRC}/configoptions.cpp ) set_source_files_properties(${GENERATED_SRC}/configoptions.cpp PROPERTIES GENERATED 1) @@ -64,8 +64,8 @@ set_source_files_properties(${GENERATED_SRC}/configoptions.cpp PROPERTIES GENERA # ce_parse.h add_custom_command( - COMMAND ${BISON_EXECUTABLE} -l -d -p ce_parsexpYY ${CMAKE_SOURCE_DIR}/src/constexp.y -o ce_parse.c - DEPENDS ${CMAKE_SOURCE_DIR}/src/constexp.y + COMMAND ${BISON_EXECUTABLE} -l -d -p ce_parsexpYY ${CMAKE_CURRENT_LIST_DIR}/constexp.y -o ce_parse.c + DEPENDS ${CMAKE_CURRENT_LIST_DIR}/constexp.y OUTPUT ${GENERATED_SRC}/ce_parse.h WORKING_DIRECTORY ${GENERATED_SRC} ) @@ -86,7 +86,7 @@ file(GLOB RESOURCES ${CMAKE_SOURCE_DIR}/templates/*/*) # resources.cpp add_custom_command( COMMENT "Generating ${GENERATED_SRC}/resources.cpp" - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/res2cc_cmd.py ${CMAKE_SOURCE_DIR}/templates ${GENERATED_SRC}/resources.cpp + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/res2cc_cmd.py ${CMAKE_SOURCE_DIR}/templates ${GENERATED_SRC}/resources.cpp DEPENDS ${RESOURCES} OUTPUT ${GENERATED_SRC}/resources.cpp ) @@ -94,8 +94,8 @@ set_source_files_properties(${GENERATED_SRC}/resources.cpp PROPERTIES GENERATED # layout_default.xml add_custom_command( - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/to_c_cmd.py < ${CMAKE_SOURCE_DIR}/src/layout_default.xml > ${GENERATED_SRC}/layout_default.xml.h - DEPENDS ${CMAKE_SOURCE_DIR}/src/layout_default.xml + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/to_c_cmd.py < ${CMAKE_CURRENT_LIST_DIR}/layout_default.xml > ${GENERATED_SRC}/layout_default.xml.h + DEPENDS ${CMAKE_CURRENT_LIST_DIR}/layout_default.xml OUTPUT ${GENERATED_SRC}/layout_default.xml.h ) set_source_files_properties(${GENERATED_SRC}/layout_default.xml.h PROPERTIES GENERATED 1) @@ -123,8 +123,8 @@ foreach(lex_file ${LEX_FILES}) set(LEX_FILES_H ${LEX_FILES_H} " " ${GENERATED_SRC}/${lex_file}.l.h CACHE INTERNAL "Stores generated files") set(LEX_FILES_CPP ${LEX_FILES_CPP} " " ${GENERATED_SRC}/${lex_file}.cpp CACHE INTERNAL "Stores generated files") add_custom_command( - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/scan_states.py ${CMAKE_SOURCE_DIR}/src/${lex_file}.l > ${GENERATED_SRC}/${lex_file}.l.h - DEPENDS ${CMAKE_SOURCE_DIR}/src/scan_states.py ${CMAKE_SOURCE_DIR}/src/${lex_file}.l + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/scan_states.py ${CMAKE_CURRENT_LIST_DIR}/${lex_file}.l > ${GENERATED_SRC}/${lex_file}.l.h + DEPENDS ${CMAKE_CURRENT_LIST_DIR}/scan_states.py ${CMAKE_CURRENT_LIST_DIR}/${lex_file}.l OUTPUT ${GENERATED_SRC}/${lex_file}.l.h ) set_source_files_properties(${GENERATED_SRC}/${lex_file}.l.h PROPERTIES GENERATED 1) -- cgit v0.12 From 57730818727420a23e63917e3d035df3926b958f Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Fri, 22 May 2020 16:08:39 +0200 Subject: Refactoring: Removed creation of MemberDef's for macro definitions from pre.l --- CMakeLists.txt | 2 + addon/CMakeLists.txt | 4 +- addon/doxmlparser/examples/metrics/CMakeLists.txt | 2 + addon/doxmlparser/test/CMakeLists.txt | 1 + addon/doxyapp/CMakeLists.txt | 1 + addon/doxyparse/CMakeLists.txt | 1 + addon/doxysearch/CMakeLists.txt | 1 + cmake/CompilerWarnings.cmake | 4 +- cmake/Coverage.cmake | 39 ++++++++++++++ cmake/SearchReplace.cmake | 4 ++ src/CMakeLists.txt | 34 ++++++++++-- src/define.cpp | 54 ------------------- src/define.h | 32 ++++------- src/doxygen.cpp | 35 ++++++++++++ src/doxygen.h | 3 +- src/pre.l | 66 ++++++++++------------- 16 files changed, 161 insertions(+), 122 deletions(-) create mode 100644 cmake/Coverage.cmake create mode 100644 cmake/SearchReplace.cmake delete mode 100644 src/define.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 20c87dc..16c0454 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,6 +26,7 @@ option(use_libclang "Add support for libclang parsing." OFF) option(win_static "Link with /MT in stead of /MD on windows" OFF) option(english_only "Only compile in support for the English language" OFF) option(force_qt4 "Forces doxywizard to build using Qt4 even if Qt5 is installed" OFF) +option(enable_coverage "Enable coverage reporting for gcc/clang [development]" OFF) SET(enlarge_lex_buffers "262144" CACHE INTERNAL "Sets the lex input and read buffers to the specified size") @@ -159,6 +160,7 @@ if (win_static) endif() include(cmake/CompilerWarnings.cmake) +include(cmake/Coverage.cmake) add_subdirectory(libmd5) add_subdirectory(liblodepng) diff --git a/addon/CMakeLists.txt b/addon/CMakeLists.txt index fd8c73f..ec4706b 100644 --- a/addon/CMakeLists.txt +++ b/addon/CMakeLists.txt @@ -1,4 +1,6 @@ -add_subdirectory(doxmlparser) +if (build_xmlparser) + add_subdirectory(doxmlparser) +endif () if (build_app) add_subdirectory(doxyapp) diff --git a/addon/doxmlparser/examples/metrics/CMakeLists.txt b/addon/doxmlparser/examples/metrics/CMakeLists.txt index 8e03246..255ae0e 100644 --- a/addon/doxmlparser/examples/metrics/CMakeLists.txt +++ b/addon/doxmlparser/examples/metrics/CMakeLists.txt @@ -11,4 +11,6 @@ main.cpp target_link_libraries(doxmlparser_metrics doxmlparser qtools + ${COVERAGE_LINKER_FLAGS} ) + diff --git a/addon/doxmlparser/test/CMakeLists.txt b/addon/doxmlparser/test/CMakeLists.txt index c38c8a5..2d92b72 100644 --- a/addon/doxmlparser/test/CMakeLists.txt +++ b/addon/doxmlparser/test/CMakeLists.txt @@ -12,4 +12,5 @@ main.cpp target_link_libraries(doxmlparser_test doxmlparser qtools + ${COVERAGE_LINKER_FLAGS} ) diff --git a/addon/doxyapp/CMakeLists.txt b/addon/doxyapp/CMakeLists.txt index af4590d..9d74fbc 100644 --- a/addon/doxyapp/CMakeLists.txt +++ b/addon/doxyapp/CMakeLists.txt @@ -31,6 +31,7 @@ ${CMAKE_THREAD_LIBS_INIT} ${SQLITE3_LIBRARIES} ${EXTRA_LIBS} ${CLANG_LIBS} +${COVERAGE_LINKER_FLAGS} ) install(TARGETS doxyapp DESTINATION bin) diff --git a/addon/doxyparse/CMakeLists.txt b/addon/doxyparse/CMakeLists.txt index d2a8f63..8e0ad49 100644 --- a/addon/doxyparse/CMakeLists.txt +++ b/addon/doxyparse/CMakeLists.txt @@ -31,6 +31,7 @@ ${CMAKE_THREAD_LIBS_INIT} ${SQLITE3_LIBRARIES} ${EXTRA_LIBS} ${CLANG_LIBS} +${COVERAGE_LINKER_FLAGS} ) install(TARGETS doxyparse DESTINATION bin) diff --git a/addon/doxysearch/CMakeLists.txt b/addon/doxysearch/CMakeLists.txt index 54794a6..7a1e1c1 100644 --- a/addon/doxysearch/CMakeLists.txt +++ b/addon/doxysearch/CMakeLists.txt @@ -17,6 +17,7 @@ target_link_libraries(doxyindexer ${XAPIAN_LIBRARIES} ${ZLIB_LIBRARIES} ${WIN_EXTRA_LIBS} + ${COVERAGE_LINKER_FLAGS} qtools ) diff --git a/cmake/CompilerWarnings.cmake b/cmake/CompilerWarnings.cmake index e6c1539..8137f6f 100644 --- a/cmake/CompilerWarnings.cmake +++ b/cmake/CompilerWarnings.cmake @@ -100,9 +100,9 @@ function(set_project_warnings project_name) if(MSVC) set(PROJECT_WARNINGS ${MSVC_WARNINGS}) - elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + elseif(CMAKE_CXX_COMPILER_ID MATCHES ".*Clang") # e.g. Clang or AppleClang set(PROJECT_WARNINGS ${CLANG_WARNINGS}) - else() + elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "7.0.0") set(GCC_EXTRA_WARNINGS -Wno-implicit-fallthrough diff --git a/cmake/Coverage.cmake b/cmake/Coverage.cmake new file mode 100644 index 0000000..31f8341 --- /dev/null +++ b/cmake/Coverage.cmake @@ -0,0 +1,39 @@ +if(enable_coverage) + FIND_PROGRAM( LCOV_PATH lcov ) + FIND_PROGRAM( GENHTML_PATH genhtml ) + set(COVERAGE_COMPILER_FLAGS -g --coverage -O0 + CACHE INTERNAL "") + set(COVERAGE_LINKER_FLAGS --coverage + CACHE INTERNAL "") + add_custom_target(coverage-clean + COMMAND ${LCOV_PATH} --rc lcov_branch_coverage=1 --directory . --zerocounters + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + ) + add_custom_target(coverage + COMMAND ${LCOV_PATH} --rc lcov_branch_coverage=1 --directory . --capture --output-file cov.info + COMMAND ${LCOV_PATH} --rc lcov_branch_coverage=1 --remove cov.info '*/c++/*' '*/_ctype.h' '*/generated_src/*' --output-file cov.info.cleaned + COMMAND ${CMAKE_COMMAND} -Dsearch=${CMAKE_BINARY_DIR} + -Dreplace=${CMAKE_SOURCE_DIR} + -Dsrc=cov.info.cleaned + -Ddst=cov.info.final + -P ${CMAKE_SOURCE_DIR}/cmake/SearchReplace.cmake + COMMAND ${GENHTML_PATH} --rc genhtml_branch_coverage=1 + --function-coverage --branch-coverage + --title "Doxygen Coverage Report" --num-spaces 2 + --legend --prefix ${CMAKE_SOURCE_DIR} --demangle-cpp + --output-directory cov_output cov.info.final + COMMAND ${CMAKE_COMMAND} -E remove cov.info cov.info.cleaned cov.info.final + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + ) + add_custom_command(TARGET coverage POST_BUILD + COMMAND ; + COMMENT "Open ./cov_output/index.html in your browser to view the coverage report" + ) +endif() + +function(set_project_coverage project_name) + if(enable_coverage) + target_compile_options(${project_name} PRIVATE ${COVERAGE_COMPILER_FLAGS}) + endif() +endfunction() + diff --git a/cmake/SearchReplace.cmake b/cmake/SearchReplace.cmake new file mode 100644 index 0000000..116cd71 --- /dev/null +++ b/cmake/SearchReplace.cmake @@ -0,0 +1,4 @@ +message("Replacing ${search} by ${replace} in file ${src} and writing to ${dst}...") +file(READ ${src} file_contents) +string(REPLACE "${search}" "${replace}" file_contents ${file_contents}) +file(WRITE ${dst} ${file_contents}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fec251e..a002ff8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -128,12 +128,30 @@ foreach(lex_file ${LEX_FILES}) OUTPUT ${GENERATED_SRC}/${lex_file}.l.h ) set_source_files_properties(${GENERATED_SRC}/${lex_file}.l.h PROPERTIES GENERATED 1) + # for code coverage we need the flex sources in the build src directory + add_custom_command( + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/src/${lex_file}.l ${CMAKE_BINARY_DIR}/src/${lex_file}.l + DEPENDS ${CMAKE_SOURCE_DIR}/src/${lex_file}.l + OUTPUT ${CMAKE_BINARY_DIR}/src/${lex_file}.l + ) - FLEX_TARGET(${lex_file} ${lex_file}.l ${GENERATED_SRC}/${lex_file}.cpp COMPILE_FLAGS "${LEX_FLAGS}") + FLEX_TARGET(${lex_file} + ${lex_file}.l + ${GENERATED_SRC}/${lex_file}.cpp + COMPILE_FLAGS "${LEX_FLAGS}") endforeach() -BISON_TARGET(constexp constexp.y ${GENERATED_SRC}/ce_parse.cpp COMPILE_FLAGS "${YACC_FLAGS}") +BISON_TARGET(constexp + constexp.y + ${GENERATED_SRC}/ce_parse.cpp + COMPILE_FLAGS "${YACC_FLAGS}") + +add_custom_command( + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/src/constexp.y ${CMAKE_BINARY_DIR}/src + DEPENDS ${CMAKE_SOURCE_DIR}/src/constexp.y + OUTPUT ${CMAKE_BINARY_DIR}/src/constexp.y +) add_library(doxycfg STATIC ${GENERATED_SRC}/lang_cfg.h @@ -204,7 +222,6 @@ add_library(doxymain STATIC context.cpp cppvalue.cpp defgen.cpp - define.cpp definition.cpp dia.cpp diagram.cpp @@ -291,8 +308,9 @@ endif() ##add_library(doxymain STATIC ${GENERATED_SRC}/${lex_file}.l.h) ##endforeach() -add_executable(doxygen main.cpp) - +add_executable(doxygen + main.cpp +) if (use_libclang) find_package(LLVM REQUIRED CONFIG) @@ -328,6 +346,7 @@ target_link_libraries(doxygen ${CMAKE_THREAD_LIBS_INIT} ${EXTRA_LIBS} ${CLANG_LIBS} + ${COVERAGE_LINKER_FLAGS} ${DOXYGEN_EXTRA_LINK_OPTIONS} ) @@ -335,5 +354,10 @@ set_project_warnings(doxycfg) set_project_warnings(doxymain) set_project_warnings(doxygen) +set_project_coverage(qtools) +set_project_coverage(doxycfg) +set_project_coverage(doxymain) +set_project_coverage(doxygen) + install(TARGETS doxygen DESTINATION bin) diff --git a/src/define.cpp b/src/define.cpp deleted file mode 100644 index b5d9170..0000000 --- a/src/define.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/****************************************************************************** - * - * - * - * Copyright (C) 1997-2015 by Dimitri van Heesch. - * - * Permission to use, copy, modify, and distribute this software and its - * documentation under the terms of the GNU General Public License is hereby - * granted. No representations are made about the suitability of this software - * for any purpose. It is provided "as is" without express or implied warranty. - * See the GNU General Public License for more details. - * - * Documents produced by Doxygen are derivative works derived from the - * input used in their production; they are not affected by this license. - * - */ - -#include "define.h" -#include "config.h" - -Define::Define() -{ - fileDef=0; - lineNr=1; - columnNr=1; - nargs=-1; - undef=FALSE; - varArgs=FALSE; - isPredefined=FALSE; - nonRecursive=FALSE; -} - -Define::Define(const Define &d) - : name(d.name),definition(d.definition),fileName(d.fileName) -{ - //name=d.name; definition=d.definition; fileName=d.fileName; - lineNr=d.lineNr; - columnNr=d.columnNr; - nargs=d.nargs; - undef=d.undef; - varArgs=d.varArgs; - isPredefined=d.isPredefined; - nonRecursive=d.nonRecursive; - fileDef=0; -} - -Define::~Define() -{ -} - -bool Define::hasDocumentation() -{ - return definition && (doc || Config_getBool(EXTRACT_ALL)); -} diff --git a/src/define.h b/src/define.h index 3627140..0a3d62c 100644 --- a/src/define.h +++ b/src/define.h @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright (C) 1997-2015 by Dimitri van Heesch. + * Copyright (C) 1997-2020 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -28,31 +28,21 @@ class FileDef; class Define { public: - Define(); - Define(const Define &d); - ~Define(); - bool hasDocumentation(); QCString name; QCString definition; QCString fileName; - QCString doc; - QCString brief; QCString args; - QCString anchor; - FileDef *fileDef; - int lineNr; - int columnNr; - int nargs; - bool undef; - bool varArgs; - bool isPredefined; - bool nonRecursive; + FileDef *fileDef = 0; + int lineNr = 1; + int columnNr = 1; + int nargs = -1; + bool undef = FALSE; + bool varArgs = FALSE; + bool isPredefined = FALSE; + bool nonRecursive = FALSE; }; -/** A dictionary of references to Define objects. */ -typedef std::map< std::string,Define* > DefineMapRef; - -/** A dictionary of managed Define objects. */ -typedef std::map< std::string,std::unique_ptr > DefineMapOwning; +/** List of all macro definitions */ +using DefineList = std::vector< std::unique_ptr >; #endif diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 5f324fd..c7c9b45 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -160,6 +160,7 @@ bool Doxygen::generatingXmlOutput = FALSE; bool Doxygen::markdownSupport = TRUE; GenericsSDict *Doxygen::genericsDict; Preprocessor *Doxygen::preprocessor = 0; +DefineList Doxygen::macroDefinitions; // locally accessible globals static std::unordered_map< std::string, const Entry* > g_classEntries; @@ -7698,6 +7699,36 @@ static void addSourceReferences() //---------------------------------------------------------------------------- +// add the macro definitions found during preprocessing as file members +static void buildDefineList() +{ + for (const auto &def : Doxygen::macroDefinitions) + { + std::unique_ptr md { createMemberDef( + def->fileName,def->lineNr,def->columnNr, + "#define",def->name,def->args,0, + Public,Normal,FALSE,Member,MemberType_Define, + ArgumentList(),ArgumentList(),"") }; + + if (!def->args.isEmpty()) + { + md->moveArgumentList(stringToArgumentList(SrcLangExt_Cpp, def->args)); + } + md->setInitializer(def->definition); + md->setFileDef(def->fileDef); + md->setDefinition("#define "+def->name); + + MemberName *mn=Doxygen::functionNameLinkedMap->add(def->name); + if (def->fileDef) + { + def->fileDef->insertMember(md.get()); + } + mn->push_back(std::move(md)); + } +} + +//---------------------------------------------------------------------------- + static void sortMemberLists() { // sort class member lists @@ -10876,6 +10907,10 @@ void parseInput() * Gather information * **************************************************************************/ + g_s.begin("Building macro definition list...\n"); + buildDefineList(); + g_s.end(); + g_s.begin("Building group list...\n"); buildGroupList(root.get()); organizeSubGroups(root.get()); diff --git a/src/doxygen.h b/src/doxygen.h index d8cd1fc..b824b54 100644 --- a/src/doxygen.h +++ b/src/doxygen.h @@ -28,6 +28,7 @@ #include "membergroup.h" #include "dirdef.h" #include "memberlist.h" +#include "define.h" class RefList; class PageSList; @@ -107,7 +108,6 @@ class Doxygen static FileNameLinkedMap *diaFileNameLinkedMap; static MemberNameLinkedMap *memberNameLinkedMap; static MemberNameLinkedMap *functionNameLinkedMap; - static QStrList tagfileList; static StringUnorderedMap namespaceAliasMap; static GroupSDict *groupSDict; static NamespaceSDict *namespaceSDict; @@ -139,6 +139,7 @@ class Doxygen static bool markdownSupport; static GenericsSDict *genericsDict; static Preprocessor *preprocessor; + static DefineList macroDefinitions; }; void initDoxygen(); diff --git a/src/pre.l b/src/pre.l index da67db5..ef97f0a 100644 --- a/src/pre.l +++ b/src/pre.l @@ -57,8 +57,6 @@ #include "condparser.h" #include "config.h" #include "filedef.h" -#include "memberdef.h" -#include "membername.h" #define YY_NO_UNISTD_H 1 @@ -93,6 +91,12 @@ struct FileState QCString fileName; }; +/** A dictionary of references to Define objects. */ +typedef std::map< std::string,Define* > DefineMapRef; + +/** A dictionary of managed Define objects. */ +typedef std::map< std::string,std::unique_ptr > DefineMapOwning; + /** @brief Singleton that manages the defines available while * preprocessing files. */ @@ -415,7 +419,7 @@ static bool otherCaseDone(yyscan_t yyscanner); static bool computeExpression(yyscan_t yyscanner,const QCString &expr); static void startCondSection(yyscan_t yyscanner,const char *sectId); static void endCondSection(yyscan_t yyscanner); -static void addDefine(yyscan_t yyscanner); +static void addMacroDefinition(yyscan_t yyscanner); static std::unique_ptr newDefine(yyscan_t yyscanner); static void setFileName(yyscan_t yyscanner,const char *name); static yy_size_t yyread(yyscan_t yyscanner,char *buf,yy_size_t max_size); @@ -1540,7 +1544,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) //printf("Define name='%s' text='%s' litTexti='%s'\n",yyextra->defName.data(),yyextra->defText.data(),yyextra->defLitText.data()); if (yyextra->includeStack.empty() || yyextra->curlyCount>0) { - addDefine(yyscanner); + addMacroDefinition(yyscanner); } def=g_defineManager.isDefined(yyextra->defName); if (def==0) // new define @@ -2787,60 +2791,46 @@ static std::unique_ptr newDefine(yyscan_t yyscanner) return def; } -static void addDefine(yyscan_t yyscanner) +static void addMacroDefinition(yyscan_t yyscanner) { YY_EXTRA_TYPE state = preYYget_extra(yyscanner); if (state->skip) return; // do not add this define as it is inside a // conditional section (cond command) that is disabled. - //printf("addDefine '%s' '%s'\n",state->defName.data(),state->defArgsStr.data()); - //ArgumentList *al = new ArgumentList; - //stringToArgumentList(state->defArgsStr,al); - std::unique_ptr md { createMemberDef( - state->yyFileName,state->yyLineNr-state->yyMLines,state->yyColNr, - "#define",state->defName,state->defArgsStr,0, - Public,Normal,FALSE,Member,MemberType_Define,ArgumentList(),ArgumentList(),"") }; - if (!state->defArgsStr.isEmpty()) - { - //printf("addDefine() state->defName='%s' state->defArgsStr='%s'\n",state->defName.data(),state->defArgsStr.data()); - md->moveArgumentList(stringToArgumentList(SrcLangExt_Cpp, state->defArgsStr)); - } - //printf("Setting initializer for '%s' to '%s'\n",state->defName.data(),state->defText.data()); - int l=state->defLitText.find('\n'); - if (l>0 && state->defLitText.left(l).stripWhiteSpace()=="\\") + auto define = std::make_unique(); + define->fileName = state->yyFileName; + define->lineNr = state->yyLineNr - state->yyMLines; + define->columnNr = state->yyColNr; + define->name = state->defName; + define->args = state->defArgsStr; + define->fileDef = state->inputFileDef; + + QCString litText = state->defLitText; + int l=litText.find('\n'); + if (l>0 && litText.left(l).stripWhiteSpace()=="\\") { // strip first line if it only contains a slash - state->defLitText = state->defLitText.right(state->defLitText.length()-l-1); + litText = litText.right(litText.length()-l-1); } else if (l>0) { // align the items on the first line with the items on the second line int k=l+1; - const char *p=state->defLitText.data()+k; + const char *p=litText.data()+k; char c; while ((c=*p++) && (c==' ' || c=='\t')) k++; - state->defLitText=state->defLitText.mid(l+1,k-l-1)+state->defLitText.stripWhiteSpace(); + litText=litText.mid(l+1,k-l-1)+litText.stripWhiteSpace(); } - QCString defLitTextStripped = state->defLitText.stripWhiteSpace(); - if (defLitTextStripped.contains('\n')>=1) + QCString litTextStripped = state->defLitText.stripWhiteSpace(); + if (litTextStripped.contains('\n')>=1) { - md->setInitializer(state->defLitText); + define->definition = litText; } else { - md->setInitializer(defLitTextStripped); - } - - //printf("pre.l: md->setFileDef(%p)\n",state->inputFileDef); - md->setFileDef(state->inputFileDef); - md->setDefinition("#define "+state->defName); - - MemberName *mn=Doxygen::functionNameLinkedMap->add(state->defName); - if (state->yyFileDef) - { - state->yyFileDef->insertMember(md.get()); + define->definition = litTextStripped; } - mn->push_back(std::move(md)); + Doxygen::macroDefinitions.push_back(std::move(define)); } static inline void outputChar(yyscan_t yyscanner,char c) -- cgit v0.12 From 96de4597eb27064ad2a90cd2f70d5dcf9bf66071 Mon Sep 17 00:00:00 2001 From: albert-github Date: Sun, 24 May 2020 13:39:00 +0200 Subject: Compilation error on debug compilation of constexp.l MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I case we use `LEX_FLAGS=-d` to compile `constexp.l` we get the error: ``` constexp.l: In member function ‘bool ConstExpressionParser::parse(const char*, int, const QCString&)’: constexp.l:140:17: error: ‘yyscanner’ was not declared in this scope; did you mean ‘yyscan_t’? 140 | yyset_debug(1,yyscanner); | ^~~~~~~~~ | yyscan_t make[2]: *** [src/CMakeFiles/doxymain.dir/build.make:455: src/CMakeFiles/doxymain.dir/__/generated_src/constexp.cpp.o] Error 1 ``` --- src/constexp.l | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/constexp.l b/src/constexp.l index a14f8d3..0f053bd 100644 --- a/src/constexp.l +++ b/src/constexp.l @@ -137,7 +137,7 @@ bool ConstExpressionParser::parse(const char *fileName,int lineNr,const QCString struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner; #ifdef FLEX_DEBUG - yyset_debug(1,yyscanner); + constexpYYset_debug(1,p->yyscanner); #endif yyextra->constExpFileName = fileName; -- cgit v0.12 From 3bc881556ef5aac73294a9306580b27f3f198cd3 Mon Sep 17 00:00:00 2001 From: albert-github Date: Sun, 24 May 2020 16:35:26 +0200 Subject: Better warning for non documented struct In case if a 'struct' we get the message about a 'class', by using the 'compoundTypeString' this can be corrected. (message was originally found in #7304) --- src/memberdef.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/memberdef.cpp b/src/memberdef.cpp index ac7605d..d857fa6 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -4008,16 +4008,13 @@ void MemberDefImpl::warnIfUndocumented() const const FileDef *fd = getFileDef(); const GroupDef *gd = getGroupDef(); const Definition *d=0; - const char *t=0; + QCString t; if (cd) - t="class", d=cd; + t=cd->compoundTypeString(), d=cd; else if (nd) { d=nd; - if (d->getLanguage() == SrcLangExt_Fortran) - t="module"; - else - t="namespace"; + t=nd->compoundTypeString(); } else if (gd) t="group", d=gd; @@ -4036,7 +4033,7 @@ void MemberDefImpl::warnIfUndocumented() const ) { warn_undoc(getDefFileName(),getDefLine(),"Member %s%s (%s) of %s %s is not documented.", - qPrint(name()),qPrint(argsString()),qPrint(memberTypeName()),t,qPrint(d->name())); + qPrint(name()),qPrint(argsString()),qPrint(memberTypeName()),qPrint(t),qPrint(d->name())); } else if (!isDetailedSectionLinkable()) { -- cgit v0.12 From 4310f3cecb062413728533dba042853872f35790 Mon Sep 17 00:00:00 2001 From: albert-github Date: Wed, 27 May 2020 15:32:00 +0200 Subject: Issue #7804 String double quotes in C get misinterpreted by pdflatex MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `"` quote is in some LaTeX language packages redefined to be used to create a umlaut / umlaut / tréma and in normal running text they have to replaced / escaped, --- src/htmlentity.cpp | 4 ++-- src/util.cpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/htmlentity.cpp b/src/htmlentity.cpp index 543f86b..ae2d8f1 100644 --- a/src/htmlentity.cpp +++ b/src/htmlentity.cpp @@ -263,7 +263,7 @@ static struct htmlEntityInfo { SYM(clubs), "\xe2\x99\xa3", "♣", "", "♣", "{$\\clubsuit$}", NULL, "\\u9827?", { NULL, DocSymbol::Perl_unknown }}, { SYM(hearts), "\xe2\x99\xa5", "♥", "", "♥", "{$\\heartsuit$}", NULL, "\\u9829?", { NULL, DocSymbol::Perl_unknown }}, { SYM(diams), "\xe2\x99\xa6", "♦", "", "♦", "{$\\diamondsuit$}", NULL, "\\u9830?", { NULL, DocSymbol::Perl_unknown }}, - { SYM(quot), "\"", """, "\"", """, "\"", "\"", "\"", { "\"", DocSymbol::Perl_char }}, + { SYM(quot), "\"", """, "\"", """, "\"{}", "\"", "\"", { "\"", DocSymbol::Perl_char }}, { SYM(amp), "&", "&", "&", "&", "\\&", "&", "&", { "&", DocSymbol::Perl_char }}, { SYM(lt), "<", "<", "<", "<", "<", "<", "<", { "<", DocSymbol::Perl_char }}, { SYM(gt), ">", ">", ">", ">", ">", ">", ">", { ">", DocSymbol::Perl_char }}, @@ -311,7 +311,7 @@ static struct htmlEntityInfo { SYM(DoubleColon), "::", "::", "::", "::", "::", "::", "::", { "::", DocSymbol::Perl_string }}, { SYM(Percent), "%", "%", "%", "%", "\\%", "%", "%", { "%", DocSymbol::Perl_char }}, { SYM(Pipe), "|", "|", "|", "|", "$|$", "|", "|", { "|", DocSymbol::Perl_char }}, - { SYM(Quot), "\"", "\"", "\"", """, "\"", "\"", "\"", { "\"", DocSymbol::Perl_char }}, + { SYM(Quot), "\"", "\"", "\"", """, "\"{}", "\"", "\"", { "\"", DocSymbol::Perl_char }}, { SYM(Minus), "-", "-", "-", "-", "-\\/", "-", "-", { "-", DocSymbol::Perl_char }}, { SYM(Plus), "+", "+", "+", "+", "+", "+", "+", { "+", DocSymbol::Perl_char }}, { SYM(Dot), ".", ".", ".", ".", ".", ".", ".", { ".", DocSymbol::Perl_char }}, diff --git a/src/util.cpp b/src/util.cpp index 5b799c8..d198a5d 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -6199,6 +6199,7 @@ void filterLatexString(FTextStream &t,const char *str, case '%': t << "\\%"; break; case '#': t << "\\#"; break; case '$': t << "\\$"; break; + case '"': t << "\"{}"; break; case '-': t << "-\\/"; break; case '^': (usedTableLevels()>0) ? t << "\\string^" : t << (char)c; break; case '~': t << "\\string~"; break; -- cgit v0.12 From 5870db1f2848ff551007a0feff0b25e1029f7eb6 Mon Sep 17 00:00:00 2001 From: albert-github Date: Wed, 27 May 2020 17:47:44 +0200 Subject: Warning in case of multiple python documentation sections. In special cases when having multiple documentation section for 1 item in python it is possible that they are concatenated in a wrong way and result in a warning. Each documentation section should be seen as a separate section and be separated from other sections. the example: ``` ##################################################################### # # Modify Install Stage ############################################ ##################################################################### class install(_install): """Specialised python package installer. It does some required chown calls in addition to the usual stuff. """ ``` gives a warning like: ``` warning: unexpected command endverbatim ``` --- src/pyscanner.l | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pyscanner.l b/src/pyscanner.l index f2a315c..ed76c75 100644 --- a/src/pyscanner.l +++ b/src/pyscanner.l @@ -1618,6 +1618,10 @@ static void handleCommentBlock(yyscan_t yyscanner,const QCString &doc,bool brief // TODO: Fix me yyextra->docBlockInBody=FALSE; + if (!yyextra->current->doc.isEmpty()) + { + yyextra->current->doc=yyextra->current->doc.stripWhiteSpace()+"\n\n"; + } if (yyextra->docBlockInBody && yyextra->previous && !yyextra->previous->doc.isEmpty()) { yyextra->previous->doc=yyextra->previous->doc.stripWhiteSpace()+"\n\n"; -- cgit v0.12 From 1bdc70103de256aa23a8afc54c9ea022ce790141 Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 29 May 2020 17:54:19 +0200 Subject: Empty enum setting in configuration file In case we have an empty setting in the doxygen configuration file, where an enum value is expected like: ``` OUTPUT_LANGUAGE = ``` we get the warning: ``` warning: argument '(null)' for option OUTPUT_LANGUAGE is not a valid enum value Using the default: English! ``` The default value should immediately have been used. --- src/configimpl.l | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/configimpl.l b/src/configimpl.l index d07e25c..da94484 100644 --- a/src/configimpl.l +++ b/src/configimpl.l @@ -234,6 +234,11 @@ void ConfigBool::convertStrToVal() void ConfigEnum::convertStrToVal() { + if (m_value.isEmpty()) + { + m_value = m_defValue; + return; + } QCString val = m_value.stripWhiteSpace().lower(); const char *s=m_valueRange.first(); while (s) -- cgit v0.12 From b265433382b93625b75cbc1f10b0509489b0b6b7 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Sun, 31 May 2020 19:58:24 +0200 Subject: Added experimental multi-thread input processing support. This is disabled by default. It can be enabled by setting MULTITHREADED_INPUT to 1 in doxygen.h. Still has many data races, so don't use for anything other than development! --- qtools/qmap.h | 3 +- qtools/qregexp.cpp | 9 +++-- src/doxygen.cpp | 114 ++++++++++++++++++++++++++++++++++------------------ src/doxygen.h | 13 +++++- src/entry.cpp | 2 +- src/entry.h | 2 +- src/markdown.cpp | 18 ++++----- src/message.cpp | 42 ++++++++++++++----- src/parserintf.h | 65 ++++++++++++++++-------------- src/pre.l | 26 +++++++++++- src/threadpool.h | 116 +++++++++++++++++++++++++++++++++++++++++++++++++++++ src/util.cpp | 18 +++++++-- src/vhdldocgen.cpp | 8 ++-- 13 files changed, 329 insertions(+), 107 deletions(-) create mode 100644 src/threadpool.h diff --git a/qtools/qmap.h b/qtools/qmap.h index f384a3d..0031e0d 100644 --- a/qtools/qmap.h +++ b/qtools/qmap.h @@ -1,5 +1,5 @@ /**************************************************************************** -** +** ** ** Definition of QMap class ** @@ -102,6 +102,7 @@ class Q_EXPORT QMapIterator QMapIterator() : node( 0 ) {} QMapIterator( QMapNode* p ) : node( p ) {} QMapIterator( const QMapIterator& it ) : node( it.node ) {} + QMapIterator &operator=(const QMapIterator &it) = default; bool operator==( const QMapIterator& it ) const { return node == it.node; } bool operator!=( const QMapIterator& it ) const { return node != it.node; } diff --git a/qtools/qregexp.cpp b/qtools/qregexp.cpp index d958f0a..8709858 100644 --- a/qtools/qregexp.cpp +++ b/qtools/qregexp.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -** +** ** ** Implementation of QRegExp class ** @@ -901,8 +901,6 @@ static uint *dump( uint *p ) #endif // DEBUG -static const int maxlen = 1024; // max length of regexp array -static uint rxarray[ maxlen ]; // tmp regexp array /*! \internal @@ -913,6 +911,9 @@ static uint rxarray[ maxlen ]; // tmp regexp array void QRegExp::compile() { + const int maxlen = 1024; // max length of regexp array + uint rxarray[ maxlen ]; // tmp regexp array + if ( rxdata ) { // delete old data delete [] rxdata; rxdata = 0; @@ -1006,7 +1007,7 @@ void QRegExp::compile() numFields++; } if ( d >= rxarray + maxlen ) { // pattern too long - error = PatOverflow; + error = PatOverflow; return; } if ( !pl ) { // At least ']' should be left diff --git a/src/doxygen.cpp b/src/doxygen.cpp index c7c9b45..1824ceb 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -103,6 +103,7 @@ #include "emoji.h" #include "plantuml.h" #include "stlsupport.h" +#include "threadpool.h" // provided by the generated file resources.cpp extern void initResources(); @@ -159,7 +160,6 @@ QCString Doxygen::spaces; bool Doxygen::generatingXmlOutput = FALSE; bool Doxygen::markdownSupport = TRUE; GenericsSDict *Doxygen::genericsDict; -Preprocessor *Doxygen::preprocessor = 0; DefineList Doxygen::macroDefinitions; // locally accessible globals @@ -9034,7 +9034,7 @@ static void generateDiskNames() //---------------------------------------------------------------------------- -static OutlineParserInterface &getParserForFile(const char *fn) +static std::unique_ptr getParserForFile(const char *fn) { QCString fileName=fn; QCString extension; @@ -9052,8 +9052,8 @@ static OutlineParserInterface &getParserForFile(const char *fn) return Doxygen::parserManager->getOutlineParser(extension); } -static void parseFile(OutlineParserInterface &parser, - const std::shared_ptr &root,FileDef *fd,const char *fn, +static std::shared_ptr parseFile(OutlineParserInterface &parser, + FileDef *fd,const char *fn, bool sameTu,QStrList &filesInSameTu) { #if USE_LIBCLANG @@ -9079,10 +9079,18 @@ static void parseFile(OutlineParserInterface &parser, if (Config_getBool(ENABLE_PREPROCESSING) && parser.needsPreprocessing(extension)) { + Preprocessor preprocessor; + QStrList &includePath = Config_getList(INCLUDE_PATH); + char *s=includePath.first(); + while (s) + { + preprocessor.addSearchDir(QFileInfo(s).absFilePath().utf8()); + s=includePath.next(); + } BufStr inBuf(fi.size()+4096); msg("Preprocessing %s...\n",fn); readInputFile(fileName,inBuf); - Doxygen::preprocessor->processFile(fileName,inBuf,preBuf); + preprocessor.processFile(fileName,inBuf,preBuf); } else // no preprocessing { @@ -9110,7 +9118,7 @@ static void parseFile(OutlineParserInterface &parser, // use language parse to parse the file parser.parseInput(fileName,convBuf.data(),fileRoot,sameTu,filesInSameTu); fileRoot->setFileDef(fd); - root->moveToSubEntryAndKeep(fileRoot); + return fileRoot; } //! parse the list of input files @@ -9138,9 +9146,10 @@ static void parseFiles(const std::shared_ptr &root) if (fd->isSource() && !fd->isReference()) // this is a source file { QStrList filesInSameTu; - OutlineParserInterface &parser = getParserForFile(s.c_str()); - parser.startTranslationUnit(s.c_str()); - parseFile(parser,root,fd,s.c_str(),FALSE,filesInSameTu); + std::unique_ptr parser { getParserForFile(s.c_str()) }; + parser->startTranslationUnit(s.c_str()); + std::shared_ptr fileRoot = parseFile(*parser.get(),fd,s.c_str(),FALSE,filesInSameTu); + root->moveToSubEntryAndKeep(fileRoot); //printf(" got %d extra files in tu\n",filesInSameTu.count()); // Now process any include files in the same translation unit @@ -9155,13 +9164,14 @@ static void parseFiles(const std::shared_ptr &root) { QStrList moreFiles; //printf(" Processing %s in same translation unit as %s\n",incFile,s->c_str()); - parseFile(parser,root,ifd,incFile,TRUE,moreFiles); + fileRoot = parseFile(*parser.get(),ifd,incFile,TRUE,moreFiles); + root->moveToSubEntryAndKeep(fileRoot); g_processedFiles.insert(incFile,(void*)0x8); } } incFile = filesInSameTu.next(); } - parser.finishTranslationUnit(); + parser->finishTranslationUnit(); g_processedFiles.insert(s.c_str(),(void*)0x8); } } @@ -9174,10 +9184,11 @@ static void parseFiles(const std::shared_ptr &root) QStrList filesInSameTu; FileDef *fd=findFileDef(Doxygen::inputNameLinkedMap,s.c_str(),ambig); ASSERT(fd!=0); - OutlineParserInterface &parser = getParserForFile(s.c_str()); - parser.startTranslationUnit(s.c_str()); - parseFile(parser,root,fd,s.c_str(),FALSE,filesInSameTu); - parser.finishTranslationUnit(); + std::unique_ptr parser { getParserForFile(s.c_str()) }; + parser->startTranslationUnit(s.c_str()); + std::shared_ptr fileRoot = parseFile(*parser.get(),fd,s.c_str(),FALSE,filesInSameTu); + root->moveToSubEntryAndKeep(fileRoot); + parser->finishTranslationUnit(); g_processedFiles.insert(s.c_str(),(void*)0x8); } } @@ -9185,16 +9196,46 @@ static void parseFiles(const std::shared_ptr &root) else // normal processing #endif { +#if !MULTITHREADED_INPUT for (const auto &s : g_inputFiles) { bool ambig; QStrList filesInSameTu; FileDef *fd=findFileDef(Doxygen::inputNameLinkedMap,s.c_str(),ambig); ASSERT(fd!=0); - OutlineParserInterface &parser = getParserForFile(s.c_str()); - parser.startTranslationUnit(s.c_str()); - parseFile(parser,root,fd,s.c_str(),FALSE,filesInSameTu); + std::unique_ptr parser { getParserForFile(s.c_str()) }; + parser->startTranslationUnit(s.c_str()); + std::shared_ptr fileRoot = parseFile(*parser.get(),fd,s.c_str(),FALSE,filesInSameTu); + root->moveToSubEntryAndKeep(fileRoot); + } +#else + std::size_t numThreads = std::thread::hardware_concurrency(); + msg("Processing input using %lu threads.\n",numThreads); + ThreadPool threadPool(numThreads); + std::vector< std::future< std::shared_ptr > > results; + for (const auto &s : g_inputFiles) + { + // lambda representing the work to executed by a thread + auto processFile = [s]() { + bool ambig; + QStrList filesInSameTu; + FileDef *fd=findFileDef(Doxygen::inputNameLinkedMap,s.c_str(),ambig); + ASSERT(fd!=0); + std::unique_ptr parser { getParserForFile(s.c_str()) }; + parser->startTranslationUnit(s.c_str()); + std::shared_ptr fileRoot = parseFile(*parser.get(),fd,s.c_str(),FALSE,filesInSameTu); + return fileRoot; + }; + // dispatch the work and collect the future results + results.emplace_back(threadPool.queue(processFile)); } + // synchronise with the Entry results produced and add them to the root + for (auto &f : results) + { + root->moveToSubEntryAndKeep(f.get()); + } +#warning "Multi-threaded input enabled. This is a highly experimental feature. Only use for doxygen development." +#endif } } @@ -9676,6 +9717,10 @@ class NullOutlineParser : public OutlineParserInterface }; +template std::function< std::unique_ptr() > make_output_parser_factory() +{ + return []() { return std::make_unique(); }; +} void initDoxygen() { @@ -9689,27 +9734,25 @@ void initDoxygen() Portable::correct_path(); Debug::startTimer(); - Doxygen::preprocessor = new Preprocessor(); - - Doxygen::parserManager = new ParserManager( std::make_unique(), + Doxygen::parserManager = new ParserManager( make_output_parser_factory(), std::make_unique()); - Doxygen::parserManager->registerParser("c", std::make_unique(), + Doxygen::parserManager->registerParser("c", make_output_parser_factory(), std::make_unique()); - Doxygen::parserManager->registerParser("python", std::make_unique(), + Doxygen::parserManager->registerParser("python", make_output_parser_factory(), std::make_unique()); - Doxygen::parserManager->registerParser("fortran", std::make_unique(), + Doxygen::parserManager->registerParser("fortran", make_output_parser_factory(), std::make_unique()); - Doxygen::parserManager->registerParser("fortranfree", std::make_unique(), + Doxygen::parserManager->registerParser("fortranfree", make_output_parser_factory(), std::make_unique()); - Doxygen::parserManager->registerParser("fortranfixed", std::make_unique(), + Doxygen::parserManager->registerParser("fortranfixed", make_output_parser_factory(), std::make_unique()); - Doxygen::parserManager->registerParser("vhdl", std::make_unique(), + Doxygen::parserManager->registerParser("vhdl", make_output_parser_factory(), std::make_unique()); - Doxygen::parserManager->registerParser("xml", std::make_unique(), + Doxygen::parserManager->registerParser("xml", make_output_parser_factory(), std::make_unique()); - Doxygen::parserManager->registerParser("sql", std::make_unique(), + Doxygen::parserManager->registerParser("sql", make_output_parser_factory(), std::make_unique()); - Doxygen::parserManager->registerParser("md", std::make_unique(), + Doxygen::parserManager->registerParser("md", make_output_parser_factory(), std::make_unique()); // register any additional parsers here... @@ -9788,7 +9831,6 @@ void cleanUpDoxygen() delete Doxygen::exampleSDict; delete Doxygen::globalScope; delete Doxygen::parserManager; - delete Doxygen::preprocessor; delete theTranslator; delete g_outputList; Mappers::freeMappers(); @@ -10250,14 +10292,6 @@ void adjustConfiguration() warn_uncond("Output language %s not supported! Using English instead.\n", outputLanguage.data()); } - QStrList &includePath = Config_getList(INCLUDE_PATH); - char *s=includePath.first(); - while (s) - { - QFileInfo fi(s); - Doxygen::preprocessor->addSearchDir(fi.absFilePath().utf8()); - s=includePath.next(); - } /* Set the global html file extension. */ Doxygen::htmlFileExtension = Config_getString(HTML_FILE_EXTENSION); @@ -10312,7 +10346,7 @@ void adjustConfiguration() // add predefined macro name to a dictionary QStrList &expandAsDefinedList =Config_getList(EXPAND_AS_DEFINED); - s=expandAsDefinedList.first(); + char *s=expandAsDefinedList.first(); while (s) { Doxygen::expandAsDefinedSet.insert(s); diff --git a/src/doxygen.h b/src/doxygen.h index b824b54..99b5d6f 100644 --- a/src/doxygen.h +++ b/src/doxygen.h @@ -30,6 +30,18 @@ #include "memberlist.h" #include "define.h" +#define MULTITHREADED_INPUT 0 + +#if MULTITHREADED_INPUT +#define THREAD_LOCAL thread_local +#define AtomicInt std::atomic_int +#define AtomicBool std::atomic_bool +#else +#define THREAD_LOCAL +#define AtomicInt int +#define AtomicBool bool +#endif + class RefList; class PageSList; class PageSDict; @@ -138,7 +150,6 @@ class Doxygen static bool generatingXmlOutput; static bool markdownSupport; static GenericsSDict *genericsDict; - static Preprocessor *preprocessor; static DefineList macroDefinitions; }; diff --git a/src/entry.cpp b/src/entry.cpp index 0c7da99..e5f6d90 100644 --- a/src/entry.cpp +++ b/src/entry.cpp @@ -150,7 +150,7 @@ void Entry::moveToSubEntryAndKeep(Entry *current) m_sublist.emplace_back(current); } -void Entry::moveToSubEntryAndKeep(std::shared_ptr ¤t) +void Entry::moveToSubEntryAndKeep(std::shared_ptr current) { current->m_parent=this; m_sublist.push_back(current); diff --git a/src/entry.h b/src/entry.h index bdc8ab8..c3d1558 100644 --- a/src/entry.h +++ b/src/entry.h @@ -207,7 +207,7 @@ class Entry * @{ */ void moveToSubEntryAndKeep(Entry* e); - void moveToSubEntryAndKeep(std::shared_ptr &e); + void moveToSubEntryAndKeep(std::shared_ptr e); /*! @} */ /*! @name add entry as a child, pass ownership and reinitialize entry */ diff --git a/src/markdown.cpp b/src/markdown.cpp index b04ab2a..c4dd9fb 100644 --- a/src/markdown.cpp +++ b/src/markdown.cpp @@ -39,6 +39,8 @@ #include //#define USE_ORIGINAL_TABLES +#include + #include "markdown.h" #include "growbuf.h" #include "debug.h" @@ -1312,7 +1314,7 @@ static QCString extractTitleId(QCString &title, int level) } if ((level > 0) && (level <= Config_getInt(TOC_INCLUDE_HEADINGS))) { - static int autoId = 0; + static AtomicInt autoId { 0 }; QCString id; id.sprintf("autotoc_md%d",autoId++); //printf("auto-generated id='%s' title='%s'\n",id.data(),title.data()); @@ -2469,7 +2471,7 @@ static QCString extractPageTitle(QCString &docs,QCString &id) static QCString detab(const QCString &s,int &refIndent) { - static int tabSize = Config_getInt(TAB_SIZE); + int tabSize = Config_getInt(TAB_SIZE); int size = s.length(); GrowBuf out(size); const char *data = s.data(); @@ -2539,7 +2541,7 @@ static QCString detab(const QCString &s,int &refIndent) QCString processMarkdown(const QCString &fileName,const int lineNr,Entry *e,const QCString &input) { - static bool init=FALSE; + static AtomicBool init { FALSE }; if (!init) { // setup callback table for special characters @@ -2562,7 +2564,7 @@ QCString processMarkdown(const QCString &fileName,const int lineNr,Entry *e,cons g_current = e; g_fileName = fileName; g_lineNr = lineNr; - static GrowBuf out; + GrowBuf out; if (input.isEmpty()) return input; out.clear(); int refIndent; @@ -2657,7 +2659,7 @@ void MarkdownOutlineParser::parseInput(const char *fileName, g_indentLevel=title.isEmpty() ? 0 : -1; QCString titleFn = QFileInfo(fileName).baseName().utf8(); QCString fn = QFileInfo(fileName).fileName().utf8(); - static QCString mdfileAsMainPage = Config_getString(USE_MDFILE_AS_MAINPAGE); + QCString mdfileAsMainPage = Config_getString(USE_MDFILE_AS_MAINPAGE); bool wasEmpty = id.isEmpty(); if (wasEmpty) id = markdownFileNameToId(fileName); if (!isExplicitPage(docs)) @@ -2729,11 +2731,7 @@ void MarkdownOutlineParser::parseInput(const char *fileName, void MarkdownOutlineParser::parsePrototype(const char *text) { - OutlineParserInterface &intf = Doxygen::parserManager->getOutlineParser("*.cpp"); - if (&intf!=this) - { - intf.parsePrototype(text); - } + Doxygen::parserManager->getOutlineParser("*.cpp")->parsePrototype(text); } //------------------------------------------------------------------------ diff --git a/src/message.cpp b/src/message.cpp index a787357..bbf578b 100644 --- a/src/message.cpp +++ b/src/message.cpp @@ -18,6 +18,9 @@ #include "debug.h" #include "portable.h" #include "message.h" +#include "doxygen.h" + +#include static QCString outputFormat; static const char *warning_str = "warning: "; @@ -31,6 +34,11 @@ static const char *error_str = "error: "; static FILE *warnFile = stderr; + +#if MULTITHREADED_INPUT +static std::mutex g_mutex; +#endif + void initWarningFormat() { // int filePos = Config_getString(WARN_FORMAT).find("$file"); @@ -104,6 +112,9 @@ void msg(const char *fmt, ...) { if (!Config_getBool(QUIET)) { +#if MULTITHREADED_INPUT + std::unique_lock lock(g_mutex); +#endif if (Debug::isFlagSet(Debug::Time)) { printf("%.3f sec: ",((double)Debug::elapsedTime())/1000.0); @@ -143,8 +154,13 @@ static void format_warn(const char *file,int line,const char *text) } msgText += '\n'; - // print resulting message - fwrite(msgText.data(),1,msgText.length(),warnFile); + { +#if MULTITHREADED_INPUT + std::unique_lock lock(g_mutex); +#endif + // print resulting message + fwrite(msgText.data(),1,msgText.length(),warnFile); + } if (warnAsError) { exit(1); @@ -240,14 +256,19 @@ extern void err_full(const char *file,int line,const char *fmt, ...) void term(const char *fmt, ...) { - va_list args; - va_start(args, fmt); - vfprintf(warnFile, (QCString(error_str) + fmt).data(), args); - va_end(args); - if (warnFile != stderr) { - for (int i = 0; i < (int)strlen(error_str); i++) fprintf(warnFile, " "); - fprintf(warnFile, "%s\n", "Exiting..."); +#if MULTITHREADED_INPUT + std::unique_lock lock(g_mutex); +#endif + va_list args; + va_start(args, fmt); + vfprintf(warnFile, (QCString(error_str) + fmt).data(), args); + va_end(args); + if (warnFile != stderr) + { + for (int i = 0; i < (int)strlen(error_str); i++) fprintf(warnFile, " "); + fprintf(warnFile, "%s\n", "Exiting..."); + } } exit(1); } @@ -263,6 +284,9 @@ void printlex(int dbg, bool enter, const char *lexName, const char *fileName) enter_txt_uc = "Finished"; } +#if MULTITHREADED_INPUT + std::unique_lock lock(g_mutex); +#endif if (dbg) { if (fileName) diff --git a/src/parserintf.h b/src/parserintf.h index 6dc9569..f11352e 100644 --- a/src/parserintf.h +++ b/src/parserintf.h @@ -1,12 +1,12 @@ /****************************************************************************** * - * + * * * Copyright (C) 1997-2015 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its - * documentation under the terms of the GNU General Public License is hereby - * granted. No representations are made about the suitability of this software + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software * for any purpose. It is provided "as is" without express or implied warranty. * See the GNU General Public License for more details. * @@ -20,6 +20,7 @@ #include +#include #include #include #include @@ -35,7 +36,7 @@ class Definition; /** \brief Abstract interface for outline parsers. * * By implementing the methods of this interface one can add - * a new language parser to doxygen. The parser implementation can make use of the + * a new language parser to doxygen. The parser implementation can make use of the * comment block parser to parse the contents of special comment blocks. */ class OutlineParserInterface @@ -46,21 +47,21 @@ class OutlineParserInterface /** Starts processing a translation unit (source files + headers). * After this call parseInput() is called with sameTranslationUnit * set to FALSE. If parseInput() returns additional include files, - * these are also processed using parseInput() with + * these are also processed using parseInput() with * sameTranslationUnit set to TRUE. After that * finishTranslationUnit() is called. */ virtual void startTranslationUnit(const char *fileName) = 0; - /** Called after all files in a translation unit have been + /** Called after all files in a translation unit have been * processed. */ virtual void finishTranslationUnit() = 0; - /** Parses a single input file with the goal to build an Entry tree. + /** Parses a single input file with the goal to build an Entry tree. * @param[in] fileName The full name of the file. * @param[in] fileBuf The contents of the file (zero terminated). - * @param[in,out] root The root of the tree of Entry *nodes + * @param[in,out] root The root of the tree of Entry *nodes * representing the information extracted from the file. * @param[in] sameTranslationUnit TRUE if this file was found in the same * translation unit (in the filesInSameTranslationUnit list @@ -80,7 +81,7 @@ class OutlineParserInterface * @see parseInput() */ virtual bool needsPreprocessing(const QCString &extension) const = 0; - + /** Callback function called by the comment block scanner. * It provides a string \a text containing the prototype of a function * or variable. The parser should parse this and store the information @@ -110,14 +111,14 @@ class CodeParserInterface * @param[in] input Actual code in the form of a string * @param[in] isExampleBlock TRUE iff the code is part of an example. * @param[in] exampleName Name of the example. - * @param[in] fileDef File definition to which the code + * @param[in] fileDef File definition to which the code * is associated. - * @param[in] startLine Starting line in case of a code fragment. + * @param[in] startLine Starting line in case of a code fragment. * @param[in] endLine Ending line of the code fragment. - * @param[in] inlineFragment Code fragment that is to be shown inline + * @param[in] inlineFragment Code fragment that is to be shown inline * as part of the documentation. * @param[in] memberDef Member definition to which the code - * is associated (non null in case of an inline fragment + * is associated (non null in case of an inline fragment * for a member). * @param[in] showLineNumbers if set to TRUE and also fileDef is not 0, * line numbers will be added to the source fragment @@ -151,29 +152,31 @@ class CodeParserInterface //----------------------------------------------------------------------------- +using OutlineParserFactory = std::function()>; + /** \brief Manages programming language parsers. * - * This class manages the language parsers in the system. One can + * This class manages the language parsers in the system. One can * register parsers, and obtain a parser given a file extension. */ class ParserManager { public: + struct ParserPair { - ParserPair(std::unique_ptr oli, - std::unique_ptr cpi) - : outlineParser(std::move(oli)), codeParser(std::move(cpi)) + ParserPair(OutlineParserFactory opf, std::unique_ptr cpi) + : outlineParserFactory(opf), codeParserInterface(std::move(cpi)) { } - std::unique_ptr outlineParser; - std::unique_ptr codeParser; + OutlineParserFactory outlineParserFactory; + std::unique_ptr codeParserInterface; }; - ParserManager(std::unique_ptr outlineParser, - std::unique_ptr codeParser) - : m_defaultParsers(std::move(outlineParser),std::move(codeParser)) + ParserManager(OutlineParserFactory outlineParserFactory, + std::unique_ptr codeParserInterface) + : m_defaultParsers(outlineParserFactory,std::move(codeParserInterface)) { } @@ -185,14 +188,14 @@ class ParserManager * @param[in] codeParser The code parser that is to be used for the * given name. */ - void registerParser(const char *name,std::unique_ptr outlineParser, - std::unique_ptr codeParser) + void registerParser(const char *name,OutlineParserFactory outlineParserFactory, + std::unique_ptr codeParserInterface) { m_parsers.emplace(std::string(name), - ParserPair(std::move(outlineParser),std::move(codeParser))); + ParserPair(outlineParserFactory,std::move(codeParserInterface))); } - /** Registers a file \a extension with a parser with name \a parserName. + /** Registers a file \a extension with a parser with name \a parserName. * Returns TRUE if the extension was successfully registered. */ bool registerExtension(const char *extension, const char *parserName) @@ -212,21 +215,21 @@ class ParserManager } /** Gets the interface to the parser associated with given \a extension. - * If there is no parser explicitly registered for the supplied extension, + * If there is no parser explicitly registered for the supplied extension, * the interface to the default parser will be returned. */ - OutlineParserInterface &getOutlineParser(const char *extension) + std::unique_ptr getOutlineParser(const char *extension) { - return *getParsers(extension).outlineParser; + return getParsers(extension).outlineParserFactory(); } /** Gets the interface to the parser associated with given \a extension. - * If there is no parser explicitly registered for the supplied extension, + * If there is no parser explicitly registered for the supplied extension, * the interface to the default parser will be returned. */ CodeParserInterface &getCodeParser(const char *extension) { - return *getParsers(extension).codeParser; + return *getParsers(extension).codeParserInterface; } private: diff --git a/src/pre.l b/src/pre.l index ef97f0a..5981147 100644 --- a/src/pre.l +++ b/src/pre.l @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -161,6 +162,9 @@ class DefineManager */ void startContext(const char *fileName) { +#if MULTITHREADED_INPUT + std::unique_lock lock(m_mutex); +#endif //printf("DefineManager::startContext()\n"); m_contextDefines.clear(); if (fileName==0) return; @@ -177,6 +181,9 @@ class DefineManager */ void endContext() { +#if MULTITHREADED_INPUT + std::unique_lock lock(m_mutex); +#endif //printf("DefineManager::endContext()\n"); m_contextDefines.clear(); } @@ -188,6 +195,10 @@ class DefineManager void addFileToContext(const char *fileName) { if (fileName==0) return; +#if MULTITHREADED_INPUT + std::unique_lock lock(m_mutex); +#endif + //printf("DefineManager::addFileToContext(%s)\n",fileName); auto it = m_fileMap.find(fileName); if (it==m_fileMap.end()) @@ -210,6 +221,10 @@ class DefineManager void addDefine(const char *fileName,std::unique_ptr &&def) { if (fileName==0) return; + +#if MULTITHREADED_INPUT + std::unique_lock lock(m_mutex); +#endif //printf("DefineManager::addDefine(%s,%s)\n",fileName,def->name.data()); m_contextDefines[def->name.data()] = def.get(); @@ -233,6 +248,9 @@ class DefineManager */ void addInclude(const char *fromFileName,const char *toFileName) { +#if MULTITHREADED_INPUT + std::unique_lock lock(m_mutex); +#endif //printf("DefineManager::addInclude(%s,%s)\n",fromFileName,toFileName); if (fromFileName==0 || toFileName==0) return; auto it = m_fileMap.find(fromFileName); @@ -252,6 +270,9 @@ class DefineManager */ Define *isDefined(const char *name) { +#if MULTITHREADED_INPUT + std::unique_lock lock(m_mutex); +#endif Define *d=0; auto it = m_contextDefines.find(name); if (it!=m_contextDefines.end()) @@ -295,6 +316,9 @@ class DefineManager std::map< std::string,std::unique_ptr > m_fileMap; DefineMapRef m_contextDefines; +#if MULTITHREADED_INPUT + std::mutex m_mutex; +#endif }; @@ -2848,7 +2872,7 @@ static inline void outputArray(yyscan_t yyscanner,const char *a,int len) static void readIncludeFile(yyscan_t yyscanner,const QCString &inc) { YY_EXTRA_TYPE state = preYYget_extra(yyscanner); - static bool searchIncludes = Config_getBool(SEARCH_INCLUDES); + bool searchIncludes = Config_getBool(SEARCH_INCLUDES); uint i=0; // find the start of the include file name diff --git a/src/threadpool.h b/src/threadpool.h new file mode 100644 index 0000000..3acba4e --- /dev/null +++ b/src/threadpool.h @@ -0,0 +1,116 @@ +#ifndef THREADPOOL_H +#define THREADPOOL_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/// Class managing a pool of worker threads. +/// Work can be queued by passing a function to queue(). When the +/// work is done the result of the function will be passed back via a future. +class ThreadPool +{ + public: + /// start N threads in the thread pool. + ThreadPool(std::size_t N=1) + { + for (std::size_t i = 0; i < N; ++i) + { + // each thread is a std::async running thread_task(): + m_finished.push_back( + std::async( + std::launch::async, + [this]{ threadTask(); } + ) + ); + } + } + /// deletes the thread pool by finishing all threads + ~ThreadPool() + { + finish(); + } + + /// Queue the lambda 'task' for the threads to execute. + /// A future of the return type of the lambda is returned to capture the result. + template > + std::future queue(F&& f) + { + // wrap the function object into a packaged task, splitting + // execution from the return value: + std::packaged_task p(std::forward(f)); + + auto r=p.get_future(); // get the return value before we hand off the task + { + std::unique_lock l(m_mutex); + m_work.emplace_back(std::move(p)); // store the task as a task + m_cond.notify_one(); // wake a thread to work on the task + } + + return r; // return the future result of the task + } + + /// finish enques a "stop the thread" message for every thread, + /// then waits for them to finish + void finish() + { + { + std::unique_lock l(m_mutex); + for(auto&& u : m_finished) + { + unused_variable(u); + m_work.push_back({}); + } + } + m_cond.notify_all(); + m_finished.clear(); + } + private: + + // helper to silence the compiler warning about unused variables + template + void unused_variable(Args&& ...args) { (void)(sizeof...(args)); } + + // the work that a worker thread does: + void threadTask() + { + while(true) + { + // pop a task off the queue: + std::packaged_task f; + { + // usual thread-safe queue code: + std::unique_lock l(m_mutex); + if (m_work.empty()) + { + m_cond.wait(l,[&]{return !m_work.empty();}); + } + f = std::move(m_work.front()); + m_work.pop_front(); + } + // if the task is invalid, it means we are asked to abort + if (!f.valid()) return; + // otherwise, run the task + f(); + } + } + + // the mutex, condition variable and deque form a single + // thread-safe triggered queue of tasks: + std::mutex m_mutex; + std::condition_variable m_cond; + // note that a packaged_task can store a packaged_task: + std::deque< std::packaged_task > m_work; + + // this holds futures representing the worker threads being done: + std::vector< std::future > m_finished; +}; + +#endif + diff --git a/src/util.cpp b/src/util.cpp index d198a5d..86435fa 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -22,6 +22,7 @@ #include #include +#include #include "md5.h" @@ -1664,15 +1665,16 @@ static CharAroundSpace g_charAroundSpace; // Note: this function is not reentrant due to the use of static buffer! QCString removeRedundantWhiteSpace(const QCString &s) { - static bool cliSupport = Config_getBool(CPP_CLI_SUPPORT); - static bool vhdl = Config_getBool(OPTIMIZE_OUTPUT_VHDL); + bool cliSupport = Config_getBool(CPP_CLI_SUPPORT); + bool vhdl = Config_getBool(OPTIMIZE_OUTPUT_VHDL); if (s.isEmpty() || vhdl) return s; // We use a static character array to // improve the performance of this function - static char *growBuf = 0; - static int growBufLen = 0; + // and thread_local is needed to make it multi-thread safe + static THREAD_LOCAL char *growBuf = 0; + static THREAD_LOCAL int growBufLen = 0; if ((int)s.length()*3>growBufLen) // For input character we produce at most 3 output characters, { growBufLen = s.length()*3; @@ -4480,11 +4482,19 @@ struct FindFileCacheElem static QCache g_findFileDefCache(5000); +#if MULTITHREADED_INPUT +static std::mutex g_findFileDefMutex; +#endif + FileDef *findFileDef(const FileNameLinkedMap *fnMap,const char *n,bool &ambig) { ambig=FALSE; if (n==0) return 0; +#if MULTITHREADED_INPUT + std::unique_lock lock(g_findFileDefMutex); +#endif + const int maxAddrSize = 20; char addr[maxAddrSize]; qsnprintf(addr,maxAddrSize,"%p:",(void*)fnMap); diff --git a/src/vhdldocgen.cpp b/src/vhdldocgen.cpp index 380c77b..9a48e14 100644 --- a/src/vhdldocgen.cpp +++ b/src/vhdldocgen.cpp @@ -2936,13 +2936,13 @@ void VhdlDocGen::createFlowChart(const MemberDef *mdef) bool b=readCodeFragment( fd->absFilePath().data(), actualStart,actualEnd,codeFragment); if (!b) return; - VHDLOutlineParser &intf =dynamic_cast(Doxygen::parserManager->getOutlineParser(".vhd")); + auto parser { Doxygen::parserManager->getOutlineParser(".vhd") }; VhdlDocGen::setFlowMember(mdef); std::shared_ptr root = std::make_shared(); QStrList filesInSameTu; - intf.startTranslationUnit(""); - intf.parseInput("",codeFragment.data(),root,FALSE,filesInSameTu); - intf.finishTranslationUnit(); + parser->startTranslationUnit(""); + parser->parseInput("",codeFragment.data(),root,FALSE,filesInSameTu); + parser->finishTranslationUnit(); } void VhdlDocGen::resetCodeVhdlParserState() -- cgit v0.12 From c21e21640a049bcda5bef690a272a8cb1483bcc9 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Sun, 31 May 2020 20:02:52 +0200 Subject: Added copyright header to threadpool.h --- src/threadpool.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/threadpool.h b/src/threadpool.h index 3acba4e..5b3f823 100644 --- a/src/threadpool.h +++ b/src/threadpool.h @@ -1,3 +1,18 @@ +/****************************************************************************** + * + * Copyright (C) 1997-2020 by Dimitri van Heesch. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software + * for any purpose. It is provided "as is" without express or implied warranty. + * See the GNU General Public License for more details. + * + * Documents produced by Doxygen are derivative works derived from the + * input used in their production; they are not affected by this license. + * + */ + #ifndef THREADPOOL_H #define THREADPOOL_H @@ -105,6 +120,7 @@ class ThreadPool // thread-safe triggered queue of tasks: std::mutex m_mutex; std::condition_variable m_cond; + // note that a packaged_task can store a packaged_task: std::deque< std::packaged_task > m_work; -- cgit v0.12 From fd1111503cd3e403db3784d03530e6ec3ac37032 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Mon, 1 Jun 2020 11:00:47 +0200 Subject: Update installation documentation for Linux binary distribution --- doc/install.doc | 88 +++++++++++++++++++++++++-------------------------------- 1 file changed, 39 insertions(+), 49 deletions(-) diff --git a/doc/install.doc b/doc/install.doc index 5f15d8a..9820f3c 100644 --- a/doc/install.doc +++ b/doc/install.doc @@ -1,12 +1,12 @@ /****************************************************************************** * - * + * * * Copyright (C) 1997-2015 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its - * documentation under the terms of the GNU General Public License is hereby - * granted. No representations are made about the suitability of this software + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software * for any purpose. It is provided "as is" without express or implied warranty. * See the GNU General Public License for more details. * @@ -19,16 +19,16 @@ \addindex installation \tableofcontents{html,latex} -First go to the +First go to the download page to get the latest distribution, if you have not downloaded doxygen already. \section install_src_unix Compiling from source on UNIX -If you downloaded the source distribution, you need at least the +If you downloaded the source distribution, you need at least the following to build the executable:
    -
  • The GNU tools +
  • The GNU tools \c flex, \c bison, \c libiconv and GNU make, and \c strip \addindex flex \addindex bison @@ -37,7 +37,7 @@ following to build the executable: \addindex strip \addindex python
  • You need \c python (version 2.6 or higher, see https://www.python.org). -
  • In order to generate a \c Makefile for your platform, you need +
  • In order to generate a \c Makefile for your platform, you need cmake version 3.1.3 or later. \addindex cmake
@@ -46,24 +46,24 @@ To take full advantage of doxygen's features the following additional tools should be installed.
    -
  • Qt Software's GUI toolkit +
  • Qt Software's GUI toolkit Qt \addindex Qt version 4.3 or higher (including Qt 5). - This is needed to build the GUI front-end doxywizard. + This is needed to build the GUI front-end doxywizard.
  • A \LaTeX distribution: for instance TeX Live This is needed for generating \LaTeX, Postscript, and PDF output.
  • the Graph visualization toolkit version 1.8.10 or higher - Needed for the include dependency graphs, + Needed for the include dependency graphs, the graphical inheritance graphs, and the collaboration graphs. If you compile graphviz yourself, make sure you do include - freetype support (which requires the freetype library and header files), + freetype support (which requires the freetype library and header files), otherwise the graphs will not render proper text labels.
  • For formulas in the HTML output (when MathJax is not used) or in case you do not wish to use `pdflatex`, - the ghostscript interpreter is needed. You can find it at + the ghostscript interpreter is needed. You can find it at www.ghostscript.com.
@@ -71,7 +71,7 @@ Compilation is now done by performing the following steps:
  1. Unpack the archive, unless you already have done that: - + gunzip doxygen-$VERSION.src.tar.gz # uncompress the archive tar xf doxygen-$VERSION.src.tar # unpack it @@ -106,16 +106,16 @@ Compilation is now done by performing the following steps: should be available in the bin directory within the build directory.
  2. Optional: Generate the user manual. - + cmake -Dbuild_doc=YES .. make docs To let doxygen generate the HTML and PDF documentation. - + The HTML directory within the build directory will now contain the html documentation (just point a HTML browser to the file index.html in the html directory). - +
  3. Optional: static linking If you want to build a statically linked version of doxygen that embeds libclang @@ -142,32 +142,22 @@ Compilation is now done by performing the following steps: \section install_bin_unix Installing the binaries on UNIX After the compilation of the source code do a make install -to install doxygen. If you downloaded the binary distribution for UNIX, +to install doxygen. If you downloaded the binary distribution for Linux, type: - ./configure make install -Binaries are installed into the directory \/bin. -Use make install_docs to install the -documentation and examples into \/doxygen. - -\ defaults to /usr/local but can be changed with -the `--prefix` option of the configure script. -The default \ directory is -\/share/doc/packages and can be changed with -the `--docdir` option of the configure script. - -Alternatively, you can also copy the binaries from the bin -directory manually to some bin directory in your search path. -This is sufficient to use doxygen. +Binaries are installed into the directory /usr/local/bin, +man pages in /usr/local/man/man1 and documentation in +/usr/local/doc/doxygen +To change this just edit the Makefile. \note You need the GNU install tool for this to work (it is part of -the coreutils package). Other install tools may put the binaries in +the coreutils package). Other install tools may put the binaries in the wrong directory! -If you have a RPM or DEP package, then please follow the -standard installation procedure that is required for these packages. +If you have a RPM or DEP package, then please follow the +standard installation procedure that is required for these packages. \section install_src_windows Compiling from source on Windows @@ -178,8 +168,8 @@ cmake can be downloaded from https://cmake.org/download/ At the moment only the express version of Visual Studio 2013 is tested, but other version might also work. -Alternatively, you can compile doxygen -\ref install_src_unix "the UNIX way" using +Alternatively, you can compile doxygen +\ref install_src_unix "the UNIX way" using Cygwin or MinGW. @@ -224,30 +214,30 @@ Doxygen comes as a self-installing archive, so installation is extremely simple. Just follow the dialogs. After installation it is recommended to also download and install GraphViz -(version 2.20 or better is highly recommended). Doxygen can use the \c dot tool -of the GraphViz package to render nicer diagrams, see the +(version 2.20 or better is highly recommended). Doxygen can use the \c dot tool +of the GraphViz package to render nicer diagrams, see the \ref cfg_have_dot "HAVE_DOT" option in the configuration file. -If you want to produce compressed HTML files (see \ref -cfg_generate_htmlhelp "GENERATE_HTMLHELP") in the configuration file, then -you need the Microsoft HTML help workshop. -You can download it from +If you want to produce compressed HTML files (see \ref +cfg_generate_htmlhelp "GENERATE_HTMLHELP") in the configuration file, then +you need the Microsoft HTML help workshop. +You can download it from Microsoft. -If you want to produce Qt Compressed Help files (see \ref -cfg_qhg_location "QHG_LOCATION") in the configuration file, then -you need qhelpgenerator which is part of Qt. +If you want to produce Qt Compressed Help files (see \ref +cfg_qhg_location "QHG_LOCATION") in the configuration file, then +you need qhelpgenerator which is part of Qt. You can download Qt from Qt Software Downloads. In order to generate PDF output or use scientific formulas you will also need to -install LaTeX and -Ghostscript. +install LaTeX and +Ghostscript. For \LaTeX a number of distributions exists. Popular ones that should work with -doxygen are MikTex +doxygen are MikTex and proTeXt. -Ghostscript can be downloaded +Ghostscript can be downloaded from Sourceforge. After installing \LaTeX and Ghostscript you'll need to make sure the tools -- cgit v0.12 From 406e1499c35570e6d4333962ccd420a1ab217f7c Mon Sep 17 00:00:00 2001 From: hake Date: Wed, 3 Jun 2020 19:32:11 +0200 Subject: missing instance-rework --- src/vhdljjparser.cpp | 173 ++++++++++++++++++++++++++++++++++++----------- src/vhdljjparser.h | 1 + vhdlparser/vhdlparser.jj | 2 +- 3 files changed, 136 insertions(+), 40 deletions(-) diff --git a/src/vhdljjparser.cpp b/src/vhdljjparser.cpp index ea60dd6..38aa641 100644 --- a/src/vhdljjparser.cpp +++ b/src/vhdljjparser.cpp @@ -81,6 +81,7 @@ struct VHDLOutlineParser::Private VHDLDocInfo str_doc; VhdlParser::SharedState shared; QCString forL; + int code = 0; }; @@ -264,34 +265,128 @@ void VHDLOutlineParser::handleFlowComment(const char* doc) } } +int VHDLOutlineParser::checkInlineCode(QCString &doc) +{ + QRegExp cs("[\\\\@]code"); + QRegExp cend("[\\s ]*[\\\\@]endcode"); + QRegExp cbrief("[\\\\@]brief"); + int index = doc.find(cs); + + if (doc.contains(cend) > 0) + return 1; + + if (index < 0) + return index; + + VhdlParser::SharedState *s = &p->shared; + p->strComment += doc; + p->code = p->inputString.find(cs, p->code + 1); + int com = p->inputString.find(p->strComment.data()); + int ref = p->inputString.find(cend, p->code + 1); + int len = p->strComment.size(); + + int ll = com + len; + int diff = ref - ll - 3; + QCString code = p->inputString.mid(ll, diff); + int iLine = 0; + code = stripLeadingAndTrailingEmptyLines(code, iLine); + int val = code.contains('\n'); + VhdlDocGen::prepareComment(p->strComment); + QCStringList ql = QCStringList::split('\n', p->strComment); + + QCString co; + QCString na; + for (QCString qcs : ql) + { + qcs = qcs.simplifyWhiteSpace(); + if (qcs.contains(cs)) + { + int i = qcs.find('{'); + int j = qcs.find('}'); + if (i > 0 && j > 0 && j > i) + { + na = qcs.mid(i + 1, (j - i - 1)); + } + continue; + } + qcs = qcs.replace(cbrief, ""); + co += qcs; + co += '\n'; + } + + VhdlDocGen::prepareComment(co); + + Entry gBlock; + if (!na.isEmpty()) + gBlock.name = na; + else + gBlock.name = "misc" + VhdlDocGen::getRecordNumber(); + gBlock.startLine = p->yyLineNr+iLine-1; + gBlock.bodyLine = p->yyLineNr+iLine-1 ; + gBlock.doc = code; + gBlock.inbodyDocs = code; + gBlock.brief = co; + gBlock.section = Entry::VARIABLE_SEC; + gBlock.spec = VhdlDocGen::MISCELLANEOUS; + gBlock.fileName = p->yyFileName; + gBlock.endBodyLine = p->yyLineNr + val +iLine; + gBlock.lang = SrcLangExt_VHDL; + std::shared_ptr compound; + + if (s->lastEntity) + compound = s->lastEntity; + else if (s->lastCompound) + compound = s->lastCompound; + else + compound = 0; + + if (compound) + { + compound->copyToSubEntry(&gBlock); + } + else + { + gBlock.type = "misc"; // global code like library ieee... + s->current_root->copyToSubEntry(&gBlock); + } + p->strComment.resize(0); + return 1; +} -void VHDLOutlineParser::handleCommentBlock(const char* doc1,bool brief) +void VHDLOutlineParser::handleCommentBlock(const char *doc1, bool brief) { + int position = 0; + bool needsEntry = FALSE; VhdlParser::SharedState *s = &p->shared; QCString doc = doc1; - if (doc.isEmpty()) return; - if (checkMultiComment(doc,p->yyLineNr)) + if (doc.isEmpty()) + return; + + if (checkMultiComment(doc, p->yyLineNr)) { p->strComment.resize(0); return; } - VhdlDocGen::prepareComment(doc); + if (checkInlineCode(doc) > 0) + { + return; + } - Protection protection=Public; + Protection protection = Public; + VhdlDocGen::prepareComment(doc); - if (p->oldEntry==s->current.get()) + if (p->oldEntry == s->current.get()) { - //printf("\n find pending message < %s > at line: %d \n ",doc.data(),iDocLine); - p->str_doc.doc=doc; - p->str_doc.iDocLine=p->iDocLine; - p->str_doc.brief=brief; - p->str_doc.pending=TRUE; + p->str_doc.doc = doc; + p->str_doc.iDocLine = p->iDocLine; + p->str_doc.brief = brief; + p->str_doc.pending = TRUE; return; } - p->oldEntry=s->current.get(); + p->oldEntry = s->current.get(); if (brief) { @@ -302,45 +397,45 @@ void VHDLOutlineParser::handleCommentBlock(const char* doc1,bool brief) s->current->docLine = p->yyLineNr; } - int j=doc.find("[plant]"); - if (j>=0) + int j = doc.find("[plant]"); + if (j >= 0) { - doc=doc.remove(j,7); - s->current->stat=true; + doc = doc.remove(j, 7); + s->current->stat = true; } - int position=0; - bool needsEntry=FALSE; - QCString processedDoc = processMarkdownForCommentBlock(doc,p->yyFileName,p->iDocLine); + //int position=0; + + QCString processedDoc = processMarkdownForCommentBlock(doc, p->yyFileName, p->iDocLine); + while (p->commentScanner.parseCommentBlock( - p->thisParser, - s->current.get(), - processedDoc, // text - p->yyFileName, // file - p->iDocLine, // line of block start - brief, - 0, - FALSE, - protection, - position, - needsEntry - ) - ) - { - if (needsEntry) newEntry(); + p->thisParser, + s->current.get(), + processedDoc, // text + p->yyFileName, // file + p->iDocLine, // line of block start + brief, + 0, + FALSE, + protection, + position, + needsEntry)) + { + if (needsEntry) + newEntry(); } if (needsEntry) { if (p->varr) { - p->varr=FALSE; - s->current->name=p->varName; - s->current->section=Entry::VARIABLEDOC_SEC; - p->varName=""; + p->varr = FALSE; + s->current->name = p->varName; + s->current->section = Entry::VARIABLEDOC_SEC; + p->varName = ""; } newEntry(); } - p->iDocLine=-1; + p->iDocLine = -1; p->strComment.resize(0); } diff --git a/src/vhdljjparser.h b/src/vhdljjparser.h index c4a55de..940631d 100755 --- a/src/vhdljjparser.h +++ b/src/vhdljjparser.h @@ -72,6 +72,7 @@ class VHDLOutlineParser : public OutlineParserInterface bool checkMultiComment(QCString& qcs,int line); void insertEntryAtLine(std::shared_ptr ce,int line); QString getNameID(); + int checkInlineCode(QCString & doc); private: struct Private; std::unique_ptr p; diff --git a/vhdlparser/vhdlparser.jj b/vhdlparser/vhdlparser.jj index 4287871..007bd5b 100755 --- a/vhdlparser/vhdlparser.jj +++ b/vhdlparser/vhdlparser.jj @@ -783,7 +783,7 @@ block_statement() LOOKAHEAD([identifier() ":"] [] ) process_statement() | -LOOKAHEAD(generate_statement()) +LOOKAHEAD(3) generate_statement() | case_scheme() -- cgit v0.12 From 73d699a94cf96915a6b5897b7747d0964df647ca Mon Sep 17 00:00:00 2001 From: albert-github Date: Thu, 4 Jun 2020 18:45:54 +0200 Subject: Incorrect htmlhelp language code for Indonesian The language code for Indonesian is `0x421` and not `0x412`, the later is for Korean. --- src/htmlhelp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/htmlhelp.cpp b/src/htmlhelp.cpp index 066e6f7..44dea05 100644 --- a/src/htmlhelp.cpp +++ b/src/htmlhelp.cpp @@ -420,7 +420,7 @@ void HtmlHelp::initialize() s_languageDict.insert("chinese-traditional", new QCString("0x404 Chinese (Taiwan)")); // new LCIDs - s_languageDict.insert("indonesian", new QCString("0x412 Indonesian")); + s_languageDict.insert("indonesian", new QCString("0x421 Indonesian")); s_languageDict.insert("croatian", new QCString("0x41A Croatian")); s_languageDict.insert("romanian", new QCString("0x418 Romanian")); s_languageDict.insert("slovene", new QCString("0x424 Slovenian")); -- cgit v0.12 From 0df1623c9363d52a2b04457233dcf2c64319b03c Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Tue, 2 Jun 2020 11:13:43 +0200 Subject: Refactor: modernize configuration values --- addon/doxyapp/doxyapp.cpp | 31 +-- addon/doxyparse/doxyparse.cpp | 52 ++-- src/cite.cpp | 40 ++- src/clangparser.cpp | 20 +- src/classdef.cpp | 10 +- src/condparser.cpp | 16 +- src/config.h | 32 ++- src/configgen.py | 117 +++++---- src/configimpl.h | 91 +++---- src/configimpl.l | 562 ++++++++++++++++++++---------------------- src/context.cpp | 18 +- src/definition.cpp | 18 +- src/dirdef.cpp | 12 +- src/docparser.cpp | 10 +- src/doxygen.cpp | 243 +++++++++--------- src/doxygen.h | 4 +- src/ftvhelp.cpp | 2 +- src/htags.cpp | 32 +-- src/htmlgen.cpp | 29 +-- src/index.cpp | 12 +- src/latexgen.cpp | 10 +- src/layout.cpp | 496 ++++++++++++++++++------------------- src/mangen.cpp | 158 ++++++------ src/plantuml.cpp | 28 ++- src/pre.l | 20 +- src/rtfgen.cpp | 4 +- src/util.cpp | 52 ++-- src/util.h | 3 +- src/vhdldocgen.cpp | 7 +- 29 files changed, 1041 insertions(+), 1088 deletions(-) diff --git a/addon/doxyapp/doxyapp.cpp b/addon/doxyapp/doxyapp.cpp index 1153ce3..97f3755 100644 --- a/addon/doxyapp/doxyapp.cpp +++ b/addon/doxyapp/doxyapp.cpp @@ -264,31 +264,32 @@ int main(int argc,char **argv) checkConfiguration(); adjustConfiguration(); // we need a place to put intermediate files - Config_getString(OUTPUT_DIRECTORY)="/tmp/doxygen"; + Config_updateString(OUTPUT_DIRECTORY,"/tmp/doxygen"); // disable html output - Config_getBool(GENERATE_HTML)=FALSE; + Config_updateBool(GENERATE_HTML,FALSE); // disable latex output - Config_getBool(GENERATE_LATEX)=FALSE; + Config_updateBool(GENERATE_LATEX,FALSE); // be quiet - Config_getBool(QUIET)=TRUE; + Config_updateBool(QUIET,TRUE); // turn off warnings - Config_getBool(WARNINGS)=FALSE; - Config_getBool(WARN_IF_UNDOCUMENTED)=FALSE; - Config_getBool(WARN_IF_DOC_ERROR)=FALSE; + Config_updateBool(WARNINGS,FALSE); + Config_updateBool(WARN_IF_UNDOCUMENTED,FALSE); + Config_updateBool(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_updateBool(EXTRACT_ALL,TRUE); + Config_updateBool(EXTRACT_STATIC,TRUE); + Config_updateBool(EXTRACT_PRIVATE,TRUE); + Config_updateBool(EXTRACT_LOCAL_METHODS,TRUE); // Extract source browse information, needed // to make doxygen gather the cross reference info - Config_getBool(SOURCE_BROWSER)=TRUE; + Config_updateBool(SOURCE_BROWSER,TRUE); // In case of a directory take all files on directory and its subdirectories - Config_getBool(RECURSIVE)=TRUE; + Config_updateBool(RECURSIVE,TRUE); // set the input - Config_getList(INPUT).clear(); - Config_getList(INPUT).append(argv[1]); + StringVector inputList; + inputList.push_back(argv[1]); + Config_updateList(INPUT,inputList); // parse the files parseInput(); diff --git a/addon/doxyparse/doxyparse.cpp b/addon/doxyparse/doxyparse.cpp index 2fcf9ac..c06eb1c 100644 --- a/addon/doxyparse/doxyparse.cpp +++ b/addon/doxyparse/doxyparse.cpp @@ -462,44 +462,35 @@ int main(int argc,char **argv) { else tmpdir << "doxyparse-" << pid; - Config_getString(OUTPUT_DIRECTORY)= tmpdir.str().c_str(); + Config_updateString(OUTPUT_DIRECTORY,tmpdir.str().c_str()); // enable HTML (fake) output to omit warning about missing output format - Config_getBool(GENERATE_HTML)=TRUE; + Config_updateBool(GENERATE_HTML,TRUE); // disable latex output - Config_getBool(GENERATE_LATEX)=FALSE; + Config_updateBool(GENERATE_LATEX,FALSE); // be quiet - Config_getBool(QUIET)=TRUE; + Config_updateBool(QUIET,TRUE); // turn off warnings - Config_getBool(WARNINGS)=FALSE; - Config_getBool(WARN_IF_UNDOCUMENTED)=FALSE; - Config_getBool(WARN_IF_DOC_ERROR)=FALSE; + Config_updateBool(WARNINGS,FALSE); + Config_updateBool(WARN_IF_UNDOCUMENTED,FALSE); + Config_updateBool(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_PACKAGE)=TRUE; + Config_updateBool(EXTRACT_ALL,TRUE); + Config_updateBool(EXTRACT_STATIC,TRUE); + Config_updateBool(EXTRACT_PRIVATE,TRUE); + Config_updateBool(EXTRACT_LOCAL_METHODS,TRUE); + Config_updateBool(EXTRACT_PACKAGE,TRUE); // Extract source browse information, needed // to make doxygen gather the cross reference info - Config_getBool(SOURCE_BROWSER)=TRUE; + Config_updateBool(SOURCE_BROWSER,TRUE); // find functions call between modules - Config_getBool(CALL_GRAPH)=TRUE; + Config_updateBool(CALL_GRAPH,TRUE); // loop recursive over input files - Config_getBool(RECURSIVE)=TRUE; + Config_updateBool(RECURSIVE,TRUE); // add file extensions - Config_getList(FILE_PATTERNS).append("*.cc"); - Config_getList(FILE_PATTERNS).append("*.cxx"); - Config_getList(FILE_PATTERNS).append("*.cpp"); - Config_getList(FILE_PATTERNS).append("*.java"); - Config_getList(FILE_PATTERNS).append("*.py"); - Config_getList(FILE_PATTERNS).append("*.pyw"); - Config_getList(FILE_PATTERNS).append("*.cs"); - Config_getList(FILE_PATTERNS).append("*.c"); - Config_getList(FILE_PATTERNS).append("*.h"); - Config_getList(FILE_PATTERNS).append("*.hh"); - Config_getList(FILE_PATTERNS).append("*.hpp"); + Config_updateList(FILE_PATTERNS, { "*.cc", "*.cxx", "*.cpp", "*.java", + "*.py", "*.pyw", "*.cs", "*.c", "*.h", "*.hh", "*.hpp"}); // set the input - Config_getList(INPUT).clear(); + StringVector inputList; for (int i = 1; i < argc; i++) { if (strcmp(argv[i], "-") == 0) { char filename[1024]; @@ -508,13 +499,14 @@ int main(int argc,char **argv) { if (feof(stdin)) { break; } - Config_getList(INPUT).append(filename); + inputList.push_back(filename); } } else { - Config_getList(INPUT).append(argv[i]); + inputList.push_back(argv[i]); } } - if (Config_getList(INPUT).isEmpty()) { + Config_updateList(INPUT,inputList); + if (inputList.empty()) { exit(0); } diff --git a/src/cite.cpp b/src/cite.cpp index dac2bcd..7b6452e 100644 --- a/src/cite.cpp +++ b/src/cite.cpp @@ -4,8 +4,8 @@ * Based on a patch by David Munger * * Permission to use, copy, modify, and distribute this software and its - * documentation under the terms of the GNU General Public License is hereby - * granted. No representations are made about the suitability of this software + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software * for any purpose. It is provided "as is" without express or implied warranty. * See the GNU General Public License for more details. * @@ -94,7 +94,7 @@ void CitationManager::clear() bool CitationManager::isEmpty() const { - uint numFiles = Config_getList(CITE_BIB_FILES).count(); + size_t numFiles = Config_getList(CITE_BIB_FILES).size(); return (numFiles==0 || p->entries.empty()); } @@ -117,12 +117,10 @@ void CitationManager::generatePage() // 0. add cross references from the bib files to the cite dictionary QFile f; - const QStrList &citeDataList = Config_getList(CITE_BIB_FILES); - QStrListIterator li(citeDataList); - const char *bibdata = 0; - for (li.toFirst() ; (bibdata = li.current()) ; ++li) + const StringVector &citeDataList = Config_getList(CITE_BIB_FILES); + for (const auto &bibdata : citeDataList) { - QCString bibFile = bibdata; + QCString bibFile = bibdata.c_str(); if (!bibFile.isEmpty() && bibFile.right(4)!=".bib") bibFile+=".bib"; QFileInfo fi(bibFile); if (fi.exists()) @@ -130,7 +128,7 @@ void CitationManager::generatePage() if (!bibFile.isEmpty()) { f.setName(bibFile); - if (!f.open(IO_ReadOnly)) + if (!f.open(IO_ReadOnly)) { err("could not open file %s for reading\n",bibFile.data()); } @@ -173,7 +171,7 @@ void CitationManager::generatePage() QCString outputDir = Config_getString(OUTPUT_DIRECTORY); QCString citeListFile = outputDir+"/citelist.doc"; f.setName(citeListFile); - if (!f.open(IO_WriteOnly)) + if (!f.open(IO_WriteOnly)) { err("could not open file %s for writing\n",citeListFile.data()); } @@ -207,9 +205,9 @@ void CitationManager::generatePage() QDir thisDir; thisDir.mkdir(bibOutputDir); int i = 0; - for (li.toFirst() ; (bibdata = li.current()) ; ++li) + for (const auto &bibdata : citeDataList) { - QCString bibFile = bibdata; + QCString bibFile = bibdata.c_str(); if (!bibFile.isEmpty() && bibFile.right(4)!=".bib") bibFile+=".bib"; QFileInfo fi(bibFile); if (fi.exists()) @@ -242,7 +240,7 @@ void CitationManager::generatePage() // 6. read back the file f.setName(citeListFile); - if (!f.open(IO_ReadOnly)) + if (!f.open(IO_ReadOnly)) { err("could not open file %s for reading\n",citeListFile.data()); } @@ -294,16 +292,16 @@ void CitationManager::generatePage() // 7. add it as a page addRelatedPage(fileName(),theTranslator->trCiteReferences(),doc,fileName(),1); - // 8. for latex we just copy the bib files to the output and let + // 8. for latex we just copy the bib files to the output and let // latex do this work. if (Config_getBool(GENERATE_LATEX)) { // copy bib files to the latex output dir QCString latexOutputDir = Config_getString(LATEX_OUTPUT)+"/"; i = 0; - for (li.toFirst() ; (bibdata = li.current()) ; ++li) + for (const auto &bibdata : citeDataList) { - QCString bibFile = bibdata; + QCString bibFile = bibdata.c_str(); // Note: file can now have multiple dots if (!bibFile.isEmpty() && bibFile.right(4)!=".bib") bibFile+=".bib"; fi.setFile(bibFile); @@ -333,7 +331,7 @@ void CitationManager::generatePage() // we might try to remove too many files as empty files didn't get a corresponding new file // but the remove function does not emit an error for it and we don't catch the error return // so no problem. - for (unsigned int j = 1; j <= citeDataList.count(); j++) + for (size_t j = 1; j <= citeDataList.size(); j++) { thisDir.remove(bibOutputDir + bibTmpFile + QCString().setNum(j) + ".bib"); } @@ -370,13 +368,11 @@ void CitationManager::writeLatexBibliography(FTextStream &t) const } t << "\\bibliographystyle{" << style << "}\n" "\\bibliography{"; - QStrList &citeDataList = Config_getList(CITE_BIB_FILES); + const StringVector &citeDataList = Config_getList(CITE_BIB_FILES); int i = 0; - QStrListIterator li(citeDataList); - const char *bibdata = 0; - for (li.toFirst() ; (bibdata = li.current()) ; ++li) + for (const auto &bibdata : citeDataList) { - QCString bibFile = bibdata; + QCString bibFile = bibdata.c_str(); // Note: file can now have multiple dots if (!bibFile.isEmpty() && bibFile.right(4)!=".bib") bibFile+=".bib"; QFileInfo fi(bibFile); diff --git a/src/clangparser.cpp b/src/clangparser.cpp index 0754888..e0a1640 100644 --- a/src/clangparser.cpp +++ b/src/clangparser.cpp @@ -159,10 +159,10 @@ void ClangParser::determineInputFilesInSameTu(QStrList &files) void ClangParser::start(const char *fileName,QStrList &filesInTranslationUnit) { - static bool clangAssistedParsing = Config_getBool(CLANG_ASSISTED_PARSING); - static QStrList &includePath = Config_getList(INCLUDE_PATH); - static QStrList clangOptions = Config_getList(CLANG_OPTIONS); - static QCString clangCompileDatabase = Config_getString(CLANG_DATABASE_PATH); + bool clangAssistedParsing = Config_getBool(CLANG_ASSISTED_PARSING); + const StringVector &includePath = Config_getList(INCLUDE_PATH); + const StringVector &clangOptions = Config_getList(CLANG_OPTIONS); + QCString clangCompileDatabase = Config_getString(CLANG_DATABASE_PATH); if (!clangAssistedParsing) return; //printf("ClangParser::start(%s)\n",fileName); p->fileName = fileName; @@ -198,8 +198,8 @@ void ClangParser::start(const char *fileName,QStrList &filesInTranslationUnit) } char **argv = (char**)malloc(sizeof(char*)* (4+Doxygen::inputPaths.size()+ - includePath.count()+ - clangOptions.count()+ + includePath.size()+ + clangOptions.size()+ clang_option_len)); if (!command.empty() ) { @@ -222,15 +222,15 @@ void ClangParser::start(const char *fileName,QStrList &filesInTranslationUnit) //printf("argv[%d]=%s\n",argc,argv[argc]); } // add external include paths - for (uint i=0;iincInfo) { QCString nm; - QStrList paths = Config_getList(STRIP_FROM_PATH); - if (!paths.isEmpty() && m_impl->incInfo->fileDef) + const StringVector &paths = Config_getList(STRIP_FROM_PATH); + if (!paths.empty() && m_impl->incInfo->fileDef) { QCString abs = m_impl->incInfo->fileDef->absFilePath(); - const char *s = paths.first(); QCString potential; unsigned int length = 0; - while (s) + for (const auto &s : paths) { - QFileInfo info(s); + QFileInfo info(s.c_str()); if (info.exists()) { QCString prefix = info.absFilePath().utf8(); @@ -1872,7 +1871,6 @@ void ClassDefImpl::writeIncludeFilesForSlice(OutputList &ol) const length = prefix.length(); potential = abs.right(abs.length() - prefix.length()); } - s = paths.next(); } } diff --git a/src/condparser.cpp b/src/condparser.cpp index e76b164..ac6ff61 100644 --- a/src/condparser.cpp +++ b/src/condparser.cpp @@ -2,8 +2,8 @@ * Copyright (C) 1997-2015 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its - * documentation under the terms of the GNU General Public License is hereby - * granted. No representations are made about the suitability of this software + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software * for any purpose. It is provided "as is" without express or implied warranty. * See the GNU General Public License for more details. * @@ -19,6 +19,8 @@ * ! NOT operator */ +#include + #include "condparser.h" #include "config.h" #include "message.h" @@ -27,7 +29,7 @@ /** * parses and evaluates the given expression. - * @returns + * @returns * - On error, an error message is returned. * - On success, the result of the expression is either "1" or "0". */ @@ -123,13 +125,13 @@ int CondParser::getOperatorId(const QCString &opName) /** * Get next token in the current string expr. - * Uses the data in m_expr pointed to by m_e to + * Uses the data in m_expr pointed to by m_e to * produce m_tokenType and m_token, set m_err in case of an error */ void CondParser::getToken() { m_tokenType = NOTHING; - m_token.resize(0); + m_token.resize(0); //printf("\tgetToken e:{%c}, ascii=%i, col=%i\n", *e, *e, e-expr); @@ -303,7 +305,7 @@ bool CondParser::evalOperator(int opId, bool lhs, bool rhs) */ bool CondParser::evalVariable(const char *varName) { - if (Config_getList(ENABLED_SECTIONS).find(varName)==-1) return FALSE; - return TRUE; + const StringVector &list = Config_getList(ENABLED_SECTIONS); + return std::find(list.begin(),list.end(),varName)!=list.end(); } diff --git a/src/config.h b/src/config.h index 1b79b1e..845a369 100644 --- a/src/config.h +++ b/src/config.h @@ -24,19 +24,25 @@ class FTextStream; //! @{ //! some convenience macros for accessing the config options //! mainly done like this for backward compatibility -#if DYNAMIC_LOOKUP // for debug purposes -#define Config_getString(val) (ConfigValues::instance().*((ConfigValues::InfoString*)ConfigValues::instance().get(#val))->item) -#define Config_getBool(val) (ConfigValues::instance().*((ConfigValues::InfoBool*)ConfigValues::instance().get(#val))->item) -#define Config_getInt(val) (ConfigValues::instance().*((ConfigValues::InfoInt*)ConfigValues::instance().get(#val))->item) -#define Config_getEnum(val) (ConfigValues::instance().*((ConfigValues::InfoString*)ConfigValues::instance().get(#val))->item) -#define Config_getList(val) (ConfigValues::instance().*((ConfigValues::InfoList*)ConfigValues::instance().get(#val))->item) -#else // direct access -#define Config_getString(val) (ConfigValues::instance().val) -#define Config_getBool(val) (ConfigValues::instance().val) -#define Config_getInt(val) (ConfigValues::instance().val) -#define Config_getEnum(val) (ConfigValues::instance().val) -#define Config_getList(val) (ConfigValues::instance().val) -#endif +//#if DYNAMIC_LOOKUP // for debug purposes +//#define Config_getString(val) (ConfigValues::instance().*((ConfigValues::InfoString*)ConfigValues::instance().get(#val))->item) +//#define Config_getBool(val) (ConfigValues::instance().*((ConfigValues::InfoBool*)ConfigValues::instance().get(#val))->item) +//#define Config_getInt(val) (ConfigValues::instance().*((ConfigValues::InfoInt*)ConfigValues::instance().get(#val))->item) +//#define Config_getEnum(val) (ConfigValues::instance().*((ConfigValues::InfoString*)ConfigValues::instance().get(#val))->item) +//#define Config_getList(val) (ConfigValues::instance().*((ConfigValues::InfoList*)ConfigValues::instance().get(#val))->item) +//#else // direct access +#define Config_getString(name) (ConfigValues::instance().name()) +#define Config_getBool(name) (ConfigValues::instance().name()) +#define Config_getInt(name) (ConfigValues::instance().name()) +#define Config_getEnum(name) (ConfigValues::instance().name()) +#define Config_getList(name) (ConfigValues::instance().name()) +#define Config_updateString(name,value) (ConfigValues::instance().update_##name(value)); +#define Config_updateBool(name,value) (ConfigValues::instance().update_##name(value)); +#define Config_updateInt(name,value) (ConfigValues::instance().update_##name(value)); +#define Config_updateEnum(name,value) (ConfigValues::instance().update_##name(value)); +#define Config_updateList(name,...) (ConfigValues::instance().update_##name(__VA_ARGS__)); +#define Config_setterFunc(name) (std::bind(&ConfigValues::update_##name,ConfigValues::instance(),std::placeholders::_1)) +//#endif //! @} /** \brief Public function to deal with the configuration file. */ diff --git a/src/configgen.py b/src/configgen.py index 6720116..89eff6d 100755 --- a/src/configgen.py +++ b/src/configgen.py @@ -355,8 +355,23 @@ def parseGroups(node): if n.nodeType == Node.ELEMENT_NODE: parseOption(n) -def parseGroupMap(node): - map = { 'bool':'bool', 'string':'QCString', 'enum':'QCString', 'int':'int', 'list':'QStrList' } + +def parseGroupMapGetter(node): + map = { 'bool':'bool', 'string':'const QCString &', 'enum':'const QCString &', 'int':'int', 'list':'const StringVector &' } + for n in node.childNodes: + if n.nodeType == Node.ELEMENT_NODE: + setting = n.getAttribute('setting') + if len(setting) > 0: + print("#if %s" % (setting)) + type = n.getAttribute('type') + name = n.getAttribute('id') + if type in map: + print(" %-20s %-30s const { return m_%s; }" % (map[type],name+'()',name)) + if len(setting) > 0: + print("#endif") + +def parseGroupMapSetter(node): + map = { 'bool':'bool', 'string':'const QCString &', 'enum':'const QCString &', 'int':'int', 'list':'const StringVector &' } for n in node.childNodes: if n.nodeType == Node.ELEMENT_NODE: setting = n.getAttribute('setting') @@ -365,7 +380,21 @@ def parseGroupMap(node): type = n.getAttribute('type') name = n.getAttribute('id') if type in map: - print(" %-8s %s;" % (map[type],name)) + print(" %-20s update_%-46s { m_%s = v; return m_%s; }" % (map[type],name+'('+map[type]+' v)',name,name)) + if len(setting) > 0: + print("#endif") + +def parseGroupMapVar(node): + map = { 'bool':'bool', 'string':'QCString', 'enum':'QCString', 'int':'int', 'list':'StringVector' } + for n in node.childNodes: + if n.nodeType == Node.ELEMENT_NODE: + setting = n.getAttribute('setting') + if len(setting) > 0: + print("#if %s" % (setting)) + type = n.getAttribute('type') + name = n.getAttribute('id') + if type in map: + print(" %-12s m_%s;" % (map[type],name)) if len(setting) > 0: print("#endif") @@ -379,7 +408,7 @@ def parseGroupInit(node): type = n.getAttribute('type') name = n.getAttribute('id') if type in map: - print(" %-25s = ConfigImpl::instance()->get%s(__FILE__,__LINE__,\"%s\");" % (name,map[type],name)) + print(" %-25s = ConfigImpl::instance()->get%s(__FILE__,__LINE__,\"%s\");" % ('m_'+name,map[type],name)) if len(setting) > 0: print("#endif") @@ -393,7 +422,7 @@ def parseGroupMapInit(node): type = n.getAttribute('type') name = n.getAttribute('id') if type in map: - print(" m_map.insert(\"%s\",new Info%s(&ConfigValues::%s));" % (name,map[type],name)) + print(" { %-25s Info{ %-13s &ConfigValues::m_%s }}," % ('\"'+name+'\",','Info::'+map[type]+',',name)) if len(setting) > 0: print("#endif") @@ -652,6 +681,7 @@ def main(): print("#include ") print("#include ") print("#include ") + print("#include \"containers.h\"") print("#include \"settings.h\"") print("") print("class ConfigValues") @@ -661,42 +691,38 @@ def main(): for n in elem.childNodes: if n.nodeType == Node.ELEMENT_NODE: if (n.nodeName == "group"): - parseGroupMap(n) + parseGroupMapGetter(n) + for n in elem.childNodes: + if n.nodeType == Node.ELEMENT_NODE: + if (n.nodeName == "group"): + parseGroupMapSetter(n) print(" void init();") - print(" struct Info") - print(" {") - print(" enum Type { Bool, Int, String, List, Unknown };") - print(" Info(Type t) : type(t) {}") - print(" virtual ~Info() {}") - print(" Type type;") - print(" };") - print(" struct InfoBool : public Info") - print(" {") - print(" InfoBool(bool ConfigValues::*ptm) : Info(Info::Bool), item(ptm) {}") - print(" bool ConfigValues::*item;") - print(" };") - print(" struct InfoInt : public Info") - print(" {") - print(" InfoInt(int ConfigValues::*ptm) : Info(Info::Int), item(ptm) {}") - print(" int ConfigValues::*item;") - print(" };") - print(" struct InfoString : public Info") - print(" {") - print(" InfoString(QCString ConfigValues::*ptm) : Info(Info::String), item(ptm) {}") - print(" QCString ConfigValues::*item;") - print(" };") - print(" struct InfoList : public Info") - print(" {") - print(" InfoList(QStrList ConfigValues::*ptm) : Info(Info::List), item(ptm) {}") - print(" QStrList ConfigValues::*item;") - print(" };") - print(" const Info *get(const char *tag) const") - print(" {") - print(" return m_map.find(tag);") - print(" }") + print(" struct Info"); + print(" {"); + print(" enum Type { Bool, Int, String, List, Unknown };"); + print(" Info(Type t,bool ConfigValues::*b) : type(t), value(b) {}"); + print(" Info(Type t,int ConfigValues::*i) : type(t), value(i) {}"); + print(" Info(Type t,QCString ConfigValues::*s) : type(t), value(s) {}"); + print(" Info(Type t,StringVector ConfigValues::*l) : type(t), value(l) {}"); + print(" Type type;"); + print(" union Item"); + print(" {"); + print(" Item(bool ConfigValues::*v) : b(v) {}"); + print(" Item(int ConfigValues::*v) : i(v) {}"); + print(" Item(QCString ConfigValues::*v) : s(v) {}"); + print(" Item(StringVector ConfigValues::*v) : l(v) {}"); + print(" bool ConfigValues::*b;"); + print(" int ConfigValues::*i;"); + print(" QCString ConfigValues::*s;"); + print(" StringVector ConfigValues::*l;"); + print(" } value;"); + print(" };"); + print(" const Info *get(const char *tag) const;"); print(" private:") - print(" ConfigValues();") - print(" QDict m_map;") + for n in elem.childNodes: + if n.nodeType == Node.ELEMENT_NODE: + if (n.nodeName == "group"): + parseGroupMapVar(n) print("};") print("") print("#endif") @@ -707,15 +733,20 @@ def main(): print(" */") print("#include \"configvalues.h\"") print("#include \"configimpl.h\"") + print("#include ") print("") - print("ConfigValues::ConfigValues() : m_map(257)") - print("{") - print(" m_map.setAutoDelete(TRUE);") + print("const ConfigValues::Info *ConfigValues::get(const char *tag) const"); + print("{"); + print(" static const std::unordered_map< std::string, Info > configMap ="); + print(" {"); for n in elem.childNodes: if n.nodeType == Node.ELEMENT_NODE: if (n.nodeName == "group"): parseGroupMapInit(n) - print("}") + print(" };"); + print(" auto it = configMap.find(tag);"); + print(" return it!=configMap.end() ? &it->second : nullptr;"); + print("}"); print("") print("void ConfigValues::init()") print("{") diff --git a/src/configimpl.h b/src/configimpl.h index 6134088..a267cc6 100644 --- a/src/configimpl.h +++ b/src/configimpl.h @@ -1,13 +1,13 @@ /****************************************************************************** * - * + * * * * Copyright (C) 1997-2015 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its - * documentation under the terms of the GNU General Public License is hereby - * granted. No representations are made about the suitability of this software + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software * for any purpose. It is provided "as is" without express or implied warranty. * See the GNU General Public License for more details. * @@ -24,6 +24,7 @@ #include #include #include "ftextstream.h" +#include "containers.h" /** Abstract base class for any configuration option. @@ -35,8 +36,8 @@ class ConfigOption public: /*! The type of option */ - enum OptionType - { + enum OptionType + { O_Info, //!< A section header O_List, //!< A list of items O_Enum, //!< A fixed set of items @@ -46,14 +47,14 @@ class ConfigOption O_Obsolete, //!< An obsolete option O_Disabled //!< Disabled compile time option }; - enum - { - /*! Maximum length of an option in the config file. Used for + enum + { + /*! Maximum length of an option in the config file. Used for * alignment purposes. */ - MAX_OPTION_LENGTH = 23 + MAX_OPTION_LENGTH = 23 }; - ConfigOption(OptionType t) : m_kind(t) + ConfigOption(OptionType t) : m_kind(t) { m_spaces.fill(' ',40); } @@ -81,8 +82,8 @@ class ConfigOption void writeBoolValue(FTextStream &t,bool v); void writeIntValue(FTextStream &t,int i); - void writeStringValue(FTextStream &t,QCString &s); - void writeStringList(FTextStream &t,QStrList &l); + void writeStringValue(FTextStream &t,const QCString &s); + void writeStringList(FTextStream &t,const StringVector &l); QCString m_spaces; QCString m_name; @@ -98,7 +99,7 @@ class ConfigOption class ConfigInfo : public ConfigOption { public: - ConfigInfo(const char *name,const char *doc) + ConfigInfo(const char *name,const char *doc) : ConfigOption(O_Info) { m_name = name; @@ -115,25 +116,25 @@ class ConfigList : public ConfigOption { public: enum WidgetType { String, File, Dir, FileAndDir }; - ConfigList(const char *name,const char *doc) + ConfigList(const char *name,const char *doc) : ConfigOption(O_List) { m_name = name; m_doc = doc; m_widgetType = String; } - void addValue(const char *v) { m_defaultValue.append(v); } + void addValue(const char *v) { m_defaultValue.push_back(v); } void setWidgetType(WidgetType w) { m_widgetType = w; } WidgetType widgetType() const { return m_widgetType; } - QStrList *valueRef() { return &m_value; } - QStrList getDefault() { return m_defaultValue; } + StringVector *valueRef() { return &m_value; } + StringVector getDefault() { return m_defaultValue; } void writeTemplate(FTextStream &t,bool sl,bool); void compareDoxyfile(FTextStream &t); void substEnvVars(); void init() { m_value = m_defaultValue; } private: - QStrList m_value; - QStrList m_defaultValue; + StringVector m_value; + StringVector m_defaultValue; WidgetType m_widgetType; }; @@ -142,7 +143,7 @@ class ConfigList : public ConfigOption class ConfigEnum : public ConfigOption { public: - ConfigEnum(const char *name,const char *doc,const char *defVal) + ConfigEnum(const char *name,const char *doc,const char *defVal) : ConfigOption(O_Enum) { m_name = name; @@ -151,7 +152,7 @@ class ConfigEnum : public ConfigOption m_defValue = defVal; } void addValue(const char *v) { m_valueRange.append(v); } - QStrListIterator iterator() + QStrListIterator iterator() { return QStrListIterator(m_valueRange); } @@ -174,7 +175,7 @@ class ConfigString : public ConfigOption { public: enum WidgetType { String, File, Dir, Image }; - ConfigString(const char *name,const char *doc) + ConfigString(const char *name,const char *doc) : ConfigOption(O_String) { m_name = name; @@ -193,7 +194,7 @@ class ConfigString : public ConfigOption void substEnvVars(); void init() { m_value = m_defValue.copy(); } void emptyValueToDefault() { if(m_value.isEmpty()) m_value=m_defValue; }; - + private: QCString m_value; QCString m_defValue; @@ -205,7 +206,7 @@ class ConfigString : public ConfigOption class ConfigInt : public ConfigOption { public: - ConfigInt(const char *name,const char *doc,int minVal,int maxVal,int defVal) + ConfigInt(const char *name,const char *doc,int minVal,int maxVal,int defVal) : ConfigOption(O_Int) { m_name = name; @@ -237,7 +238,7 @@ class ConfigInt : public ConfigOption class ConfigBool : public ConfigOption { public: - ConfigBool(const char *name,const char *doc,bool defVal) + ConfigBool(const char *name,const char *doc,bool defVal) : ConfigOption(O_Bool) { m_name = name; @@ -264,7 +265,7 @@ class ConfigBool : public ConfigOption class ConfigObsolete : public ConfigOption { public: - ConfigObsolete(const char *name) : ConfigOption(O_Obsolete) + ConfigObsolete(const char *name) : ConfigOption(O_Obsolete) { m_name = name; } void writeTemplate(FTextStream &,bool,bool); void compareDoxyfile(FTextStream &) {} @@ -276,7 +277,7 @@ class ConfigObsolete : public ConfigOption class ConfigDisabled : public ConfigOption { public: - ConfigDisabled(const char *name) : ConfigOption(O_Disabled) + ConfigDisabled(const char *name) : ConfigOption(O_Disabled) { m_name = name; } void writeTemplate(FTextStream &,bool,bool); void compareDoxyfile(FTextStream &) {} @@ -297,7 +298,7 @@ class ConfigDisabled : public ConfigOption * read from a user-supplied configuration file. * The static member instance() can be used to get * a pointer to the one and only instance. - * + * * Set all variables to their default values by * calling Config::instance()->init() * @@ -321,8 +322,8 @@ class ConfigImpl delete m_instance; m_instance=0; } - - /*! Returns an iterator that can by used to iterate over the + + /*! Returns an iterator that can by used to iterate over the * configuration options. */ QListIterator iterator() @@ -330,36 +331,36 @@ class ConfigImpl return QListIterator(*m_options); } - /*! + /*! * @name Getting configuration values. * @{ */ - /*! Returns the value of the string option with name \a fileName. + /*! Returns the value of the string option with name \a fileName. * The arguments \a num and \a name are for debugging purposes only. * There is a convenience function Config_getString() for this. */ QCString &getString(const char *fileName,int num,const char *name) const; - /*! Returns the value of the list option with name \a fileName. + /*! Returns the value of the list option with name \a fileName. * The arguments \a num and \a name are for debugging purposes only. * There is a convenience function Config_getList() for this. */ - QStrList &getList(const char *fileName,int num,const char *name) const; + StringVector &getList(const char *fileName,int num,const char *name) const; - /*! Returns the value of the enum option with name \a fileName. + /*! Returns the value of the enum option with name \a fileName. * The arguments \a num and \a name are for debugging purposes only. * There is a convenience function Config_getEnum() for this. */ QCString &getEnum(const char *fileName,int num,const char *name) const; - /*! Returns the value of the integer option with name \a fileName. + /*! Returns the value of the integer option with name \a fileName. * The arguments \a num and \a name are for debugging purposes only. * There is a convenience function Config_getInt() for this. */ int &getInt(const char *fileName,int num,const char *name) const; - /*! Returns the value of the boolean option with name \a fileName. + /*! Returns the value of the boolean option with name \a fileName. * The arguments \a num and \a name are for debugging purposes only. * There is a convenience function Config_getBool() for this. */ @@ -370,12 +371,12 @@ class ConfigImpl */ ConfigOption *get(const char *name) const { - return m_dict->find(name); + return m_dict->find(name); } /* @} */ - /*! - * @name Adding configuration options. + /*! + * @name Adding configuration options. * @{ */ @@ -402,7 +403,7 @@ class ConfigImpl } /*! Adds a new enumeration option with \a name and documentation \a doc - * and initial value \a defVal. + * and initial value \a defVal. * \returns An object representing the option. */ ConfigEnum *addEnum(const char *name, @@ -510,18 +511,18 @@ class ConfigImpl /*! Parse a configuration data in string \a str. * \returns TRUE if successful, or FALSE if the string could not be * parsed. - */ + */ //bool parseString(const char *fn,const char *str); bool parseString(const char *fn,const char *str,bool upd = FALSE); /*! Parse a configuration file with name \a fn. - * \returns TRUE if successful, FALSE if the file could not be + * \returns TRUE if successful, FALSE if the file could not be * opened or read. - */ + */ bool parse(const char *fn,bool upd = FALSE); /*! Called from the constructor, will add doxygen's default options - * to the configuration object + * to the configuration object */ void create(); diff --git a/src/configimpl.l b/src/configimpl.l index da94484..9cea61b 100644 --- a/src/configimpl.l +++ b/src/configimpl.l @@ -1,10 +1,10 @@ /****************************************************************************** * - * Copyright (C) 1997-2015 by Dimitri van Heesch. + * Copyright (C) 1997-2020 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its - * documentation under the terms of the GNU General Public License is hereby - * granted. No representations are made about the suitability of this software + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software * for any purpose. It is provided "as is" without express or implied warranty. * See the GNU General Public License for more details. * @@ -29,11 +29,12 @@ #include #include -#include #include #include #include + #include +#include #include "configimpl.h" #include "version.h" @@ -61,7 +62,7 @@ void config_err(const char *fmt, ...) va_list args; va_start(args, fmt); vfprintf(stderr, (QCString(error_str) + fmt).data(), args); - va_end(args); + va_end(args); } void config_term(const char *fmt, ...) { @@ -141,7 +142,7 @@ void ConfigOption::writeIntValue(FTextStream &t,int i) t << " " << i; } -void ConfigOption::writeStringValue(FTextStream &t,QCString &s) +void ConfigOption::writeStringValue(FTextStream &t,const QCString &s) { char c; bool needsEscaping=FALSE; @@ -151,10 +152,10 @@ void ConfigOption::writeStringValue(FTextStream &t,QCString &s) if (p) { t << " "; - while ((c=*p++)!=0 && !needsEscaping) + while ((c=*p++)!=0 && !needsEscaping) needsEscaping = (c==' ' || c=='\n' || c=='\t' || c=='"' || c=='#'); if (needsEscaping) - { + { t << "\""; p=se.data(); while (*p) @@ -172,19 +173,17 @@ void ConfigOption::writeStringValue(FTextStream &t,QCString &s) } } -void ConfigOption::writeStringList(FTextStream &t,QStrList &l) +void ConfigOption::writeStringList(FTextStream &t,const StringVector &l) { - const char *p = l.first(); bool first=TRUE; - while (p) + for (const auto &p : l) { - QCString s=p; + if (!first) t << " \\" << endl; + QCString s=p.c_str(); if (!first) t << " "; - first=FALSE; writeStringValue(t,s); - p = l.next(); - if (p) t << " \\" << endl; + first=FALSE; } } @@ -193,7 +192,7 @@ void ConfigOption::writeStringList(FTextStream &t,QStrList &l) ConfigImpl *ConfigImpl::m_instance = 0; -void ConfigInt::convertStrToVal() +void ConfigInt::convertStrToVal() { if (!m_valueString.isEmpty()) { @@ -216,7 +215,7 @@ void ConfigBool::convertStrToVal() QCString val = m_valueString.stripWhiteSpace().lower(); if (!val.isEmpty()) { - if (val=="yes" || val=="true" || val=="1" || val=="all") + if (val=="yes" || val=="true" || val=="1" || val=="all") { m_value=TRUE; } @@ -259,7 +258,7 @@ void ConfigEnum::convertStrToVal() QCString &ConfigImpl::getString(const char *fileName,int num,const char *name) const { ConfigOption *opt = m_dict->find(name); - if (opt==0) + if (opt==0) { config_term("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name); } @@ -270,10 +269,10 @@ QCString &ConfigImpl::getString(const char *fileName,int num,const char *name) c return *((ConfigString *)opt)->valueRef(); } -QStrList &ConfigImpl::getList(const char *fileName,int num,const char *name) const +StringVector &ConfigImpl::getList(const char *fileName,int num,const char *name) const { ConfigOption *opt = m_dict->find(name); - if (opt==0) + if (opt==0) { config_term("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name); } @@ -287,7 +286,7 @@ QStrList &ConfigImpl::getList(const char *fileName,int num,const char *name) con QCString &ConfigImpl::getEnum(const char *fileName,int num,const char *name) const { ConfigOption *opt = m_dict->find(name); - if (opt==0) + if (opt==0) { config_term("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name); } @@ -301,7 +300,7 @@ QCString &ConfigImpl::getEnum(const char *fileName,int num,const char *name) con int &ConfigImpl::getInt(const char *fileName,int num,const char *name) const { ConfigOption *opt = m_dict->find(name); - if (opt==0) + if (opt==0) { config_term("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name); } @@ -315,7 +314,7 @@ int &ConfigImpl::getInt(const char *fileName,int num,const char *name) const bool &ConfigImpl::getBool(const char *fileName,int num,const char *name) const { ConfigOption *opt = m_dict->find(name); - if (opt==0) + if (opt==0) { config_term("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name); } @@ -358,71 +357,33 @@ void ConfigList::writeTemplate(FTextStream &t,bool sl,bool) void ConfigList::compareDoxyfile(FTextStream &t) { - const char *p = m_value.first(); - const char *q = m_defaultValue.first(); - int defCnt = 0; - int valCnt = 0; - - // count non empty elements - while (p) - { - QCString s=p; - if (!s.stripWhiteSpace().isEmpty()) valCnt += 1; - p = m_value.next(); - } - - while (q) - { - QCString s=q; - if (!s.stripWhiteSpace().isEmpty()) defCnt += 1; - q = m_defaultValue.next(); - } + auto get_stripped = [](std::string s) { return QCString(s.c_str()).stripWhiteSpace(); }; + auto is_not_empty = [get_stripped](std::string s) { return !get_stripped(s).isEmpty(); }; + int defCnt = std::count_if( m_value.begin(), m_value.end(),is_not_empty); + int valCnt = std::count_if(m_defaultValue.begin(),m_defaultValue.end(),is_not_empty); if ( valCnt != defCnt) { writeTemplate(t,TRUE,TRUE); return; } - - // get first non empry element - q = m_defaultValue.first(); - p = m_value.first(); - QCString sp = p; - while (p && sp.stripWhiteSpace().isEmpty()) + auto it1 = m_value.begin(); + auto it2 = m_defaultValue.begin(); + while (it1!=m_value.end() && it2!=m_defaultValue.end()) { - p = m_value.next(); - sp = p; - } - QCString sq = q; - while (q && sq.stripWhiteSpace().isEmpty()) - { - q = m_value.next(); - sq = q; - } - while (p) - { - // skip empty elements - sp = p; - while (p && sp.stripWhiteSpace().isEmpty()) + // skip over empty values + while (it1!=m_value.end() && !is_not_empty(*it1)) { - p = m_value.next(); - sp = p; + ++it1; } - sq = q; - while (q && sq.stripWhiteSpace().isEmpty()) + if (it1!=m_value.end()) // non-empty value { - q = m_value.next(); - sq = q; - } - // be sure we have still an element (p and q have same number of 'filled' elements) - if (p) - { - if (sp.stripWhiteSpace() != sq.stripWhiteSpace()) + if (get_stripped(*it1) != get_stripped(*it2)) // not the default, write as difference { writeTemplate(t,TRUE,TRUE); return; } - p = m_value.next(); - q = m_defaultValue.next(); + ++it1; + ++it2; } } } @@ -544,7 +505,7 @@ struct ConfigFileState YY_BUFFER_STATE oldState; YY_BUFFER_STATE newState; QCString fileName; -}; +}; static const char *g_inputString; static int g_inputPosition; @@ -553,11 +514,11 @@ static QCString g_yyFileName; static QCString g_tmpString; static QCString *g_string=0; static bool *g_bool=0; -static QStrList *g_list=0; +static StringVector *g_list=0; static int g_lastState; static QCString g_elemStr; -static QStrList g_includePathList; -static QStack g_includeStack; +static StringVector g_includePathList; +static QStack g_includeStack; static int g_includeDepth; static bool g_configUpdate = FALSE; static QCString g_encoding; @@ -571,7 +532,7 @@ static ConfigImpl *g_config; static yy_size_t yyread(char *buf,yy_size_t max_size) { // no file included - if (g_includeStack.isEmpty()) + if (g_includeStack.isEmpty()) { yy_size_t c=0; if (g_inputString==0) return c; @@ -602,7 +563,7 @@ static QCString configStringRecode( int outputSize=inputSize*4+1; QCString output(outputSize); void *cd = portable_iconv_open(outputEncoding,inputEncoding); - if (cd==(void *)(-1)) + if (cd==(void *)(-1)) { config_term("Error: unsupported character conversion: '%s'->'%s'\n", inputEncoding.data(),outputEncoding.data()); @@ -646,7 +607,7 @@ static FILE *tryPath(const char *path,const char *fileName) return 0; } -static void substEnvVarsInStrList(QStrList &sl); +static void substEnvVarsInStrList(StringVector &sl); static void substEnvVarsInString(QCString &s); static FILE *findFile(const char *fileName) @@ -660,13 +621,11 @@ static FILE *findFile(const char *fileName) return tryPath(NULL, fileName); } substEnvVarsInStrList(g_includePathList); - char *s=g_includePathList.first(); - while (s) // try each of the include paths + for (const auto &s : g_includePathList) { - FILE *f = tryPath(s,fileName); + FILE *f = tryPath(s.c_str(),fileName); if (f) return f; - s=g_includePathList.next(); - } + } // try cwd if g_includePathList fails return tryPath(".",fileName); } @@ -676,7 +635,7 @@ static void readIncludeFile(const char *incName) if (g_includeDepth==MAX_INCLUDE_DEPTH) { config_term("maximum include depth (%d) reached, %s is not included. Aborting...\n", MAX_INCLUDE_DEPTH,incName); - } + } QCString inc = incName; substEnvVarsInString(inc); @@ -697,7 +656,7 @@ static void readIncludeFile(const char *incName) msg("@INCLUDE = %s: parsing...\n",inc.data()); #endif - // store the state of the old file + // store the state of the old file ConfigFileState *fs=new ConfigFileState; fs->oldState=YY_CURRENT_BUFFER; fs->lineNr=g_yyLineNr; @@ -710,7 +669,7 @@ static void readIncludeFile(const char *incName) fs->newState=YY_CURRENT_BUFFER; g_yyFileName=inc; g_includeDepth++; - } + } else { config_term("@INCLUDE = %s: not found!\n",inc.data()); @@ -745,12 +704,12 @@ static void readIncludeFile(const char *incName) "##".*"\n" { g_config->appendUserComment(yytext);g_yyLineNr++;} "#" { BEGIN(SkipComment); } [a-z_A-Z][a-z_A-Z0-9]*[ \t]*"=" { QCString cmd=yytext; - cmd=cmd.left(cmd.length()-1).stripWhiteSpace(); + cmd=cmd.left(cmd.length()-1).stripWhiteSpace(); ConfigOption *option = g_config->get(cmd); if (option==0) // oops not known { config_warn("ignoring unsupported tag '%s' at line %d, file %s\n", - cmd.data(),g_yyLineNr,g_yyFileName.data()); + cmd.data(),g_yyLineNr,g_yyFileName.data()); BEGIN(SkipInvalid); } else // known tag @@ -806,7 +765,7 @@ static void readIncludeFile(const char *incName) { config_warn("Tag '%s' at line %d of file '%s' has become obsolete.\n" " To avoid this warning please remove this line from your configuration " - "file or upgrade it using \"doxygen -u\"\n", cmd.data(),g_yyLineNr,g_yyFileName.data()); + "file or upgrade it using \"doxygen -u\"\n", cmd.data(),g_yyLineNr,g_yyFileName.data()); } BEGIN(SkipInvalid); break; @@ -820,7 +779,7 @@ static void readIncludeFile(const char *incName) { config_warn("Tag '%s' at line %d of file '%s' belongs to an option that was not enabled at compile time.\n" " To avoid this warning please remove this line from your configuration " - "file or upgrade it using \"doxygen -u\", or recompile doxygen with this feature enabled.\n", cmd.data(),g_yyLineNr,g_yyFileName.data()); + "file or upgrade it using \"doxygen -u\", or recompile doxygen with this feature enabled.\n", cmd.data(),g_yyLineNr,g_yyFileName.data()); } BEGIN(SkipInvalid); break; @@ -828,12 +787,12 @@ static void readIncludeFile(const char *incName) } } [a-z_A-Z][a-z_A-Z0-9]*[ \t]*"+=" { QCString cmd=yytext; - cmd=cmd.left(cmd.length()-2).stripWhiteSpace(); + cmd=cmd.left(cmd.length()-2).stripWhiteSpace(); ConfigOption *option = g_config->get(cmd); if (option==0) // oops not known { config_warn("ignoring unsupported tag '%s' at line %d, file %s\n", - cmd.data(),g_yyLineNr,g_yyFileName.data()); + cmd.data(),g_yyLineNr,g_yyFileName.data()); BEGIN(SkipInvalid); } else // known tag @@ -862,19 +821,19 @@ static void readIncludeFile(const char *incName) case ConfigOption::O_Int: case ConfigOption::O_Bool: config_warn("operator += not supported for '%s'. Ignoring line at line %d, file %s\n", - yytext,g_yyLineNr,g_yyFileName.data()); + yytext,g_yyLineNr,g_yyFileName.data()); BEGIN(SkipInvalid); break; case ConfigOption::O_Obsolete: config_warn("Tag '%s' at line %d of file %s has become obsolete.\n" "To avoid this warning please update your configuration " - "file using \"doxygen -u\"\n", cmd.data(),g_yyLineNr,g_yyFileName.data()); + "file using \"doxygen -u\"\n", cmd.data(),g_yyLineNr,g_yyFileName.data()); BEGIN(SkipInvalid); break; case ConfigOption::O_Disabled: config_warn("Tag '%s' at line %d of file %s belongs to an option that was not enabled at compile time.\n" "To avoid this warning please remove this line from your configuration " - "file, upgrade it using \"doxygen -u\", or recompile doxygen with this feature enabled.\n", cmd.data(),g_yyLineNr,g_yyFileName.data()); + "file, upgrade it using \"doxygen -u\", or recompile doxygen with this feature enabled.\n", cmd.data(),g_yyLineNr,g_yyFileName.data()); BEGIN(SkipInvalid); break; } @@ -883,8 +842,8 @@ static void readIncludeFile(const char *incName) "@INCLUDE_PATH"[ \t]*"=" { BEGIN(GetStrList); g_list=&g_includePathList; g_list->clear(); g_elemStr=""; } /* include a g_config file */ "@INCLUDE"[ \t]*"=" { BEGIN(Include);} -([^ \"\t\r\n]+)|("\""[^\n\"]+"\"") { - readIncludeFile(configStringRecode(yytext,g_encoding,"UTF-8")); +([^ \"\t\r\n]+)|("\""[^\n\"]+"\"") { + readIncludeFile(configStringRecode(yytext,g_encoding,"UTF-8")); BEGIN(Start); } <> { @@ -912,19 +871,19 @@ static void readIncludeFile(const char *incName) [a-z_A-Z0-9]+ { config_warn("ignoring unknown tag '%s' at line %d, file %s\n",yytext,g_yyLineNr,g_yyFileName.data()); } \n { g_yyLineNr++; BEGIN(Start); } \n { - g_yyLineNr++; + g_yyLineNr++; if (!g_elemStr.isEmpty()) { //printf("elemStr1='%s'\n",g_elemStr.data()); - g_list->append(g_elemStr); + g_list->push_back(g_elemStr.data()); } - BEGIN(Start); + BEGIN(Start); } [ \t]+ { if (!g_elemStr.isEmpty()) { //printf("elemStr2='%s'\n",g_elemStr.data()); - g_list->append(g_elemStr); + g_list->push_back(g_elemStr.data()); } g_elemStr.resize(0); } @@ -932,18 +891,18 @@ static void readIncludeFile(const char *incName) if (!g_elemStr.isEmpty()) { //printf("elemStr2='%s'\n",g_elemStr.data()); - g_list->append(g_elemStr); + g_list->push_back(g_elemStr.data()); } g_elemStr.resize(0); } -[^ \"\t\r\n]+ { (*g_string)+=configStringRecode(yytext,g_encoding,"UTF-8"); +[^ \"\t\r\n]+ { (*g_string)+=configStringRecode(yytext,g_encoding,"UTF-8"); checkEncoding(); } "\"" { g_lastState=YY_START; - BEGIN(GetQuotedString); - g_tmpString.resize(0); + BEGIN(GetQuotedString); + g_tmpString.resize(0); } -"\""|"\n" { +"\""|"\n" { // we add a bogus space to signal that the string was quoted. This space will be stripped later on. g_tmpString+=" "; //printf("Quoted String = '%s'\n",g_tmpString.data()); @@ -967,16 +926,16 @@ static void readIncludeFile(const char *incName) g_tmpString+='"'; } . { g_tmpString+=*yytext; } -[a-zA-Z]+ { - QCString bs=yytext; +[a-zA-Z]+ { + QCString bs=yytext; bs=bs.upper(); if (bs=="YES" || bs=="1") *g_bool=TRUE; else if (bs=="NO" || bs=="0") *g_bool=FALSE; - else + else { - *g_bool=FALSE; + *g_bool=FALSE; config_warn("Invalid value '%s' for " "boolean tag in line %d, file %s; use YES or NO\n", bs.data(),g_yyLineNr,g_yyFileName.data()); @@ -991,7 +950,7 @@ static void readIncludeFile(const char *incName) \n { g_yyLineNr++; BEGIN(Start); } \\[ \r\t]*\n { g_yyLineNr++; BEGIN(Start); } <*>\\[ \r\t]*\n { g_yyLineNr++; } -<*>. +<*>. <*>\n { g_yyLineNr++ ; } %% @@ -1004,7 +963,7 @@ void ConfigImpl::writeTemplate(FTextStream &t,bool sl,bool upd) /* print first lines of user comment that were at the beginning of the file, might have special meaning for editors */ if (m_startComment) { - t << takeStartComment() << endl; + t << takeStartComment() << endl; } t << "# Doxyfile " << getDoxygenVersion() << endl << endl; if (!sl) @@ -1078,12 +1037,12 @@ static void substEnvVarsInString(QCString &s) //printf("substEnvVarInString(%s) end\n",s.data()); } -static void substEnvVarsInStrList(QStrList &sl) +static void substEnvVarsInStrList(StringVector &sl) { - char *s = sl.first(); - while (s) + StringVector results; + for (const auto &s : sl) { - QCString result(s); + QCString result = s.c_str(); // an argument with quotes will have an extra space at the end, so wasQuoted will be TRUE. bool wasQuoted = (result.find(' ')!=-1) || (result.find('\t')!=-1); // here we strip the quote again @@ -1093,8 +1052,8 @@ static void substEnvVarsInStrList(QStrList &sl) if (!wasQuoted) /* as a result of the expansion, a single string may have expanded into a list, which we'll - add to sl. If the original string already - contained multiple elements no further + add to sl. If the original string already + contained multiple elements no further splitting is done to allow quoted items with spaces! */ { int l=result.length(); @@ -1105,7 +1064,7 @@ static void substEnvVarsInStrList(QStrList &sl) { char c=0; // skip until start of new word - while (iinit(); } -static void checkList(QStrList &list,const char *name, bool equalRequired,bool valueRequired) +static void checkList(const StringVector &list,const char *name, bool equalRequired,bool valueRequired) { - const char *s=list.first(); - while (s) + for (const auto &s: list) { - QCString item=s; + QCString item=s.c_str(); item=item.stripWhiteSpace(); int i=item.find('='); if (i==-1 && equalRequired) @@ -1403,7 +1331,6 @@ static void checkList(QStrList &list,const char *name, bool equalRequired,bool v } } } - s=list.next(); } } @@ -1411,17 +1338,18 @@ void Config::checkAndCorrect() { ConfigValues::instance().init(); - QCString &warnFormat = Config_getString(WARN_FORMAT); + //------------------------ + // check WARN_FORMAT + QCString warnFormat = Config_getString(WARN_FORMAT); if (warnFormat.stripWhiteSpace().isEmpty()) { - warnFormat="$file:$line $text"; + Config_updateString(WARN_FORMAT,"$file:$line $text"); } else { if (warnFormat.find("$file")==-1) { warn_uncond("warning format does not contain a $file tag!\n"); - } if (warnFormat.find("$line")==-1) { @@ -1433,15 +1361,17 @@ void Config::checkAndCorrect() } } - QCString &manExtension = Config_getString(MAN_EXTENSION); - + //------------------------ // set default man page extension if non is given by the user + QCString manExtension = Config_getString(MAN_EXTENSION); if (manExtension.isEmpty()) { - manExtension=".3"; + Config_updateString(MAN_EXTENSION,".3"); } - QCString &paperType = Config_getEnum(PAPER_TYPE); + //------------------------ + // check and correct PAPER_TYPE + QCString paperType = Config_getEnum(PAPER_TYPE); paperType=paperType.lower().stripWhiteSpace(); if (paperType.isEmpty() || paperType=="a4wide") { @@ -1453,42 +1383,53 @@ void Config::checkAndCorrect() err("Unknown page type specified\n"); paperType="a4"; } + Config_updateEnum(PAPER_TYPE,paperType); - QCString &outputLanguage=Config_getEnum(OUTPUT_LANGUAGE); + //------------------------ + // check & correct OUTPUT_LANGUAGE + QCString outputLanguage=Config_getEnum(OUTPUT_LANGUAGE); outputLanguage=outputLanguage.stripWhiteSpace(); if (outputLanguage.isEmpty()) { outputLanguage = "English"; } + Config_updateEnum(OUTPUT_LANGUAGE,outputLanguage); - QCString &htmlFileExtension=Config_getString(HTML_FILE_EXTENSION); + //------------------------ + // check & correct HTML_FILE_EXTENSION + QCString htmlFileExtension=Config_getString(HTML_FILE_EXTENSION); htmlFileExtension=htmlFileExtension.stripWhiteSpace(); if (htmlFileExtension.isEmpty()) { htmlFileExtension = ".html"; } + Config_updateString(HTML_FILE_EXTENSION,htmlFileExtension); - // expand the relative stripFromPath values - QStrList &stripFromPath = Config_getList(STRIP_FROM_PATH); - char *sfp = stripFromPath.first(); - if (sfp==0) // by default use the current path + //------------------------ + // check & correct STRIP_FROM_PATH + StringVector stripFromPath = Config_getList(STRIP_FROM_PATH); + if (stripFromPath.empty()) // by default use the current path { QString p = QDir::currentDirPath(); if (p.at(p.length()-1)!='/') p.append('/'); - stripFromPath.append(p.utf8()); + stripFromPath.push_back(p.utf8().data()); } else { cleanUpPaths(stripFromPath); } + Config_updateList(STRIP_FROM_PATH,stripFromPath); - // expand the relative stripFromPath values - QStrList &stripFromIncPath = Config_getList(STRIP_FROM_INC_PATH); + //------------------------ + // check & correct STRIP_FROM_INC_PATH + StringVector stripFromIncPath = Config_getList(STRIP_FROM_INC_PATH); cleanUpPaths(stripFromIncPath); + Config_updateList(STRIP_FROM_INC_PATH,stripFromIncPath); + //------------------------ // Test to see if HTML header is valid - QCString &headerFile = Config_getString(HTML_HEADER); + QCString headerFile = Config_getString(HTML_HEADER); if (!headerFile.isEmpty()) { QFileInfo fi(headerFile); @@ -1498,8 +1439,10 @@ void Config::checkAndCorrect() "does not exist\n",headerFile.data()); } } + + //------------------------ // Test to see if HTML footer is valid - QCString &footerFile = Config_getString(HTML_FOOTER); + QCString footerFile = Config_getString(HTML_FOOTER); if (!footerFile.isEmpty()) { QFileInfo fi(footerFile); @@ -1510,29 +1453,31 @@ void Config::checkAndCorrect() } } + //------------------------ // Test to see if MathJax code file is valid if (Config_getBool(USE_MATHJAX)) { - QCString &MathJaxCodefile = Config_getString(MATHJAX_CODEFILE); - if (!MathJaxCodefile.isEmpty()) + QCString mathJaxCodefile = Config_getString(MATHJAX_CODEFILE); + if (!mathJaxCodefile.isEmpty()) { - QFileInfo fi(MathJaxCodefile); + QFileInfo fi(mathJaxCodefile); if (!fi.exists()) { config_term("tag MATHJAX_CODEFILE file '%s' " - "does not exist\n",MathJaxCodefile.data()); + "does not exist\n",mathJaxCodefile.data()); } } - QCString &path = Config_getString(MATHJAX_RELPATH); + QCString path = Config_getString(MATHJAX_RELPATH); if (!path.isEmpty() && path.at(path.length()-1)!='/') { path+="/"; } - + Config_updateString(MATHJAX_RELPATH,path); } + //------------------------ // Test to see if LaTeX header is valid - QCString &latexHeaderFile = Config_getString(LATEX_HEADER); + QCString latexHeaderFile = Config_getString(LATEX_HEADER); if (!latexHeaderFile.isEmpty()) { QFileInfo fi(latexHeaderFile); @@ -1542,8 +1487,10 @@ void Config::checkAndCorrect() "does not exist\n",latexHeaderFile.data()); } } + + //------------------------ // Test to see if LaTeX footer is valid - QCString &latexFooterFile = Config_getString(LATEX_FOOTER); + QCString latexFooterFile = Config_getString(LATEX_FOOTER); if (!latexFooterFile.isEmpty()) { QFileInfo fi(latexFooterFile); @@ -1554,25 +1501,24 @@ void Config::checkAndCorrect() } } + //------------------------ // check include path - QStrList &includePath = Config_getList(INCLUDE_PATH); - char *s=includePath.first(); - while (s) + const StringVector &includePath = Config_getList(INCLUDE_PATH); + for (const auto &s : includePath) { - QFileInfo fi(s); + QFileInfo fi(s.c_str()); if (!fi.exists()) warn_uncond("tag INCLUDE_PATH: include path '%s' " - "does not exist\n",s); - s=includePath.next(); + "does not exist\n",s.c_str()); } + //------------------------ // check PREDEFINED if (Config_getBool(ENABLE_PREPROCESSING)) { - QStrList &predefList = Config_getList(PREDEFINED); - s=predefList.first(); - while (s) + const StringVector &predefList = Config_getList(PREDEFINED); + for (const auto &s : predefList) { - QCString predef=s; + QCString predef=s.c_str(); predef=predef.stripWhiteSpace(); int i_equals=predef.find('='); int i_obrace=predef.find('('); @@ -1580,79 +1526,85 @@ void Config::checkAndCorrect() { err("Illegal PREDEFINED format '%s', no define name specified\n",predef.data()); } - s=predefList.next(); } } + //------------------------ // check ALIASES - QStrList &aliasList = Config_getList(ALIASES); - s=aliasList.first(); - while (s) + const StringVector &aliasList = Config_getList(ALIASES); + for (const auto &s : aliasList) { QRegExp re1("[a-z_A-Z][a-z_A-Z0-9]*[ \t]*="); // alias without argument QRegExp re2("[a-z_A-Z][a-z_A-Z0-9]*{[0-9]+}[ \t]*="); // alias with argument - QCString alias=s; + QCString alias=s.c_str(); alias=alias.stripWhiteSpace(); if (alias.find(re1)!=0 && alias.find(re2)!=0) { err("Illegal ALIASES format '%s'. Use \"name=value\" or \"name{n}=value\", where n is the number of arguments\n", alias.data()); } - s=aliasList.next(); } + //------------------------ // check EXTENSION_MAPPING checkList(Config_getList(EXTENSION_MAPPING),"EXTENSION_MAPPING",TRUE,TRUE); + //------------------------ // check FILTER_PATTERNS checkList(Config_getList(FILTER_PATTERNS),"FILTER_PATTERNS",TRUE,TRUE); + //------------------------ // check FILTER_SOURCE_PATTERNS checkList(Config_getList(FILTER_SOURCE_PATTERNS),"FILTER_SOURCE_PATTERNS",FALSE,FALSE); + //------------------------ // check TAGFILES checkList(Config_getList(TAGFILES),"TAGFILES",FALSE,TRUE); + //------------------------ // check EXTRA_SEARCH_MAPPINGS if (Config_getBool(SEARCHENGINE) && Config_getBool(GENERATE_HTML)) { checkList(Config_getList(EXTRA_SEARCH_MAPPINGS),"EXTRA_SEARCH_MAPPING",TRUE,TRUE); } + //------------------------ // check if GENERATE_TREEVIEW and GENERATE_HTMLHELP are both enabled if (Config_getBool(GENERATE_TREEVIEW) && Config_getBool(GENERATE_HTMLHELP)) { err("When enabling GENERATE_HTMLHELP the tree view (GENERATE_TREEVIEW) should be disabled. I'll do it for you.\n"); - Config_getBool(GENERATE_TREEVIEW)=FALSE; + Config_updateBool(GENERATE_TREEVIEW,FALSE); } + + //------------------------ + // check if SEARCHENGINE and GENERATE_HTMLHELP are both enabled if (Config_getBool(SEARCHENGINE) && Config_getBool(GENERATE_HTMLHELP)) { err("When enabling GENERATE_HTMLHELP the search engine (SEARCHENGINE) should be disabled. I'll do it for you.\n"); - Config_getBool(SEARCHENGINE)=FALSE; + Config_updateBool(SEARCHENGINE,FALSE); } + //------------------------ // check if SEPARATE_MEMBER_PAGES and INLINE_GROUPED_CLASSES are both enabled if (Config_getBool(SEPARATE_MEMBER_PAGES) && Config_getBool(INLINE_GROUPED_CLASSES)) { err("When enabling INLINE_GROUPED_CLASSES the SEPARATE_MEMBER_PAGES option should be disabled. I'll do it for you.\n"); - Config_getBool(SEPARATE_MEMBER_PAGES)=FALSE; + Config_updateBool(SEPARATE_MEMBER_PAGES,FALSE); } - // check dot image format - QCString &dotImageFormat=Config_getEnum(DOT_IMAGE_FORMAT); + //------------------------ + // check and correct DOT_IMAGE_FORMAT + QCString dotImageFormat=Config_getEnum(DOT_IMAGE_FORMAT); dotImageFormat=dotImageFormat.stripWhiteSpace(); if (dotImageFormat.isEmpty()) { dotImageFormat = "png"; } - //else if (dotImageFormat!="gif" && dotImageFormat!="png" && dotImageFormat!="jpg") - //{ - // err("Invalid value for DOT_IMAGE_FORMAT: '%s'. Using the default.\n",dotImageFormat.data()); - // dotImageFormat = "png"; - //} + Config_updateEnum(DOT_IMAGE_FORMAT,dotImageFormat); + //------------------------ // correct DOT_FONTNAME if needed - QCString &dotFontName=Config_getString(DOT_FONTNAME); + QCString dotFontName=Config_getString(DOT_FONTNAME); if (dotFontName=="FreeSans" || dotFontName=="FreeSans.ttf") { warn_uncond("doxygen no longer ships with the FreeSans font.\n" @@ -1663,9 +1615,11 @@ void Config::checkAndCorrect() { dotFontName = "Helvetica"; } + Config_updateString(DOT_FONTNAME,dotFontName); + //------------------------ // clip dotFontSize against the maximum bounds - int &dotFontSize = Config_getInt(DOT_FONTSIZE); + int dotFontSize = Config_getInt(DOT_FONTSIZE); if (dotFontSize<4) { dotFontSize=4; @@ -1674,9 +1628,11 @@ void Config::checkAndCorrect() { dotFontSize=24; } + Config_updateInt(DOT_FONTSIZE,dotFontSize); + //------------------------ // clip number of threads - int &dotNumThreads = Config_getInt(DOT_NUM_THREADS); + int dotNumThreads = Config_getInt(DOT_NUM_THREADS); if (dotNumThreads>32) { dotNumThreads=32; @@ -1685,9 +1641,11 @@ void Config::checkAndCorrect() { dotNumThreads=QMAX(2,std::thread::hardware_concurrency()+1); } + Config_updateInt(DOT_NUM_THREADS,dotNumThreads); + //------------------------ // check dot path - QCString &dotPath = Config_getString(DOT_PATH); + QCString dotPath = Config_getString(DOT_PATH); if (!dotPath.isEmpty()) { QFileInfo fi(dotPath); @@ -1717,9 +1675,11 @@ void Config::checkAndCorrect() { dotPath=""; } + Config_updateString(DOT_PATH,dotPath); + //------------------------ // check plantuml path - QCString &plantumlJarPath = Config_getString(PLANTUML_JAR_PATH); + QCString plantumlJarPath = Config_getString(PLANTUML_JAR_PATH); if (!plantumlJarPath.isEmpty()) { QFileInfo pu(plantumlJarPath); @@ -1748,9 +1708,11 @@ void Config::checkAndCorrect() plantumlJarPath=""; } } + Config_updateString(PLANTUML_JAR_PATH,plantumlJarPath); + //------------------------ // check dia path - QCString &diaPath = Config_getString(DIA_PATH); + QCString diaPath = Config_getString(DIA_PATH); if (!diaPath.isEmpty()) { QFileInfo dp(diaPath+"/dia"+Portable::commandExtension()); @@ -1772,52 +1734,52 @@ void Config::checkAndCorrect() { diaPath=""; } + Config_updateString(DIA_PATH,diaPath); - // check input - QStrList &inputSources=Config_getList(INPUT); - if (inputSources.count()==0) + //------------------------ + // check INPUT + StringVector inputSources=Config_getList(INPUT); + if (inputSources.empty()) { // use current dir as the default - inputSources.append(QDir::currentDirPath().utf8()); + inputSources.push_back(QDir::currentDirPath().utf8().data()); } else { - s=inputSources.first(); - while (s) + for (const auto &s : inputSources) { - QFileInfo fi(s); + QFileInfo fi(s.c_str()); if (!fi.exists()) { - warn_uncond("tag INPUT: input source '%s' does not exist\n",s); + warn_uncond("tag INPUT: input source '%s' does not exist\n",s.c_str()); } - s=inputSources.next(); } } + Config_updateList(INPUT,inputSources); + //------------------------ // add default file patterns if needed - QStrList &filePatternList = Config_getList(FILE_PATTERNS); - if (filePatternList.isEmpty()) + StringVector filePatternList = Config_getList(FILE_PATTERNS); + if (filePatternList.empty()) { ConfigOption * opt = ConfigImpl::instance()->get("FILE_PATTERNS"); if (opt->kind()==ConfigOption::O_List) { - QStrList l = ((ConfigList*)opt)->getDefault(); - const char *p = l.first(); - while (p) - { - filePatternList.append(p); - p = l.next(); - } + filePatternList = ((ConfigList*)opt)->getDefault(); } } + Config_updateList(FILE_PATTERNS,filePatternList); + //------------------------ // add default pattern if needed - QStrList &examplePatternList = Config_getList(EXAMPLE_PATTERNS); - if (examplePatternList.isEmpty()) + StringVector examplePatternList = Config_getList(EXAMPLE_PATTERNS); + if (examplePatternList.empty()) { - examplePatternList.append("*"); + examplePatternList.push_back("*"); + Config_updateList(EXAMPLE_PATTERNS,examplePatternList); } + //------------------------ // if no output format is enabled, warn the user if (!Config_getBool(GENERATE_HTML) && !Config_getBool(GENERATE_LATEX) && @@ -1834,6 +1796,7 @@ void Config::checkAndCorrect() warn_uncond("No output formats selected! Set at least one of the main GENERATE_* options to YES.\n"); } + //------------------------ // check HTMLHELP creation requirements if (!Config_getBool(GENERATE_HTML) && Config_getBool(GENERATE_HTMLHELP)) @@ -1841,36 +1804,40 @@ void Config::checkAndCorrect() warn_uncond("GENERATE_HTMLHELP=YES requires GENERATE_HTML=YES.\n"); } + //------------------------ // check QHP creation requirements if (Config_getBool(GENERATE_QHP)) { if (Config_getString(QHP_NAMESPACE).isEmpty()) { err("GENERATE_QHP=YES requires QHP_NAMESPACE to be set. Using 'org.doxygen.doc' as default!.\n"); - Config_getString(QHP_NAMESPACE)="org.doxygen.doc"; + Config_updateString(QHP_NAMESPACE,"org.doxygen.doc"); } if (Config_getString(QHP_VIRTUAL_FOLDER).isEmpty()) { err("GENERATE_QHP=YES requires QHP_VIRTUAL_FOLDER to be set. Using 'doc' as default!\n"); - Config_getString(QHP_VIRTUAL_FOLDER)="doc"; + Config_updateString(QHP_VIRTUAL_FOLDER,"doc"); } } + //------------------------ if (Config_getBool(OPTIMIZE_OUTPUT_JAVA) && Config_getBool(INLINE_INFO)) { // don't show inline info for Java output, since Java has no inline // concept. - Config_getBool(INLINE_INFO)=FALSE; + Config_updateBool(INLINE_INFO,FALSE); } - int &depth = Config_getInt(MAX_DOT_GRAPH_DEPTH); + //------------------------ + int depth = Config_getInt(MAX_DOT_GRAPH_DEPTH); if (depth==0) { - depth=1000; + Config_updateInt(MAX_DOT_GRAPH_DEPTH,1000); } - int &hue = Config_getInt(HTML_COLORSTYLE_HUE); + //------------------------ + int hue = Config_getInt(HTML_COLORSTYLE_HUE); if (hue<0) { hue=0; @@ -1879,8 +1846,10 @@ void Config::checkAndCorrect() { hue=hue%360; } + Config_updateInt(HTML_COLORSTYLE_HUE,hue); - int &sat = Config_getInt(HTML_COLORSTYLE_SAT); + //------------------------ + int sat = Config_getInt(HTML_COLORSTYLE_SAT); if (sat<0) { sat=0; @@ -1889,7 +1858,11 @@ void Config::checkAndCorrect() { sat=255; } - int &gamma = Config_getInt(HTML_COLORSTYLE_GAMMA); + Config_updateInt(HTML_COLORSTYLE_SAT,sat); + + + //------------------------ + int gamma = Config_getInt(HTML_COLORSTYLE_GAMMA); if (gamma<40) { gamma=40; @@ -1898,32 +1871,30 @@ void Config::checkAndCorrect() { gamma=240; } + Config_updateInt(HTML_COLORSTYLE_GAMMA,gamma); + //------------------------ QCString mathJaxFormat = Config_getEnum(MATHJAX_FORMAT); if (!mathJaxFormat.isEmpty() && mathJaxFormat!="HTML-CSS" && mathJaxFormat!="NativeMML" && mathJaxFormat!="SVG") { err("Unsupported value for MATHJAX_FORMAT: Should be one of HTML-CSS, NativeMML, or SVG\n"); - Config_getEnum(MATHJAX_FORMAT)="HTML-CSS"; + Config_updateEnum(MATHJAX_FORMAT,"HTML-CSS"); } + //------------------------ // add default words if needed - QStrList &annotationFromBrief = Config_getList(ABBREVIATE_BRIEF); - if (annotationFromBrief.isEmpty()) - { - annotationFromBrief.append("The $name class"); - annotationFromBrief.append("The $name widget"); - annotationFromBrief.append("The $name file"); - annotationFromBrief.append("is"); - annotationFromBrief.append("provides"); - annotationFromBrief.append("specifies"); - annotationFromBrief.append("contains"); - annotationFromBrief.append("represents"); - annotationFromBrief.append("a"); - annotationFromBrief.append("an"); - annotationFromBrief.append("the"); + const StringVector &annotationFromBrief = Config_getList(ABBREVIATE_BRIEF); + if (annotationFromBrief.empty()) + { + Config_updateList(ABBREVIATE_BRIEF, + { "The $name class", "The $name widget", + "The $name file", "is", "provides", "specifies", + "contains", "represents", "a", "an", "the" + }); } + //------------------------ // some default settings for vhdl if (Config_getBool(OPTIMIZE_OUTPUT_VHDL) && (Config_getBool(INLINE_INHERITED_MEMB) || @@ -1953,15 +1924,18 @@ void Config::checkAndCorrect() "%s%s%s%s%s%s",s1,s2,s3,s4,s5,s6 ); - Config_getBool(INLINE_INHERITED_MEMB) = FALSE; - Config_getBool(INHERIT_DOCS) = FALSE; - Config_getBool(HIDE_SCOPE_NAMES) = TRUE; - Config_getBool(EXTRACT_PRIVATE) = TRUE; - Config_getBool(ENABLE_PREPROCESSING) = FALSE; - Config_getBool(EXTRACT_PACKAGE) = TRUE; + Config_updateBool(INLINE_INHERITED_MEMB, FALSE); + Config_updateBool(INHERIT_DOCS, FALSE); + Config_updateBool(HIDE_SCOPE_NAMES, TRUE); + Config_updateBool(EXTRACT_PRIVATE, TRUE); + Config_updateBool(ENABLE_PREPROCESSING, FALSE); + Config_updateBool(EXTRACT_PACKAGE, TRUE); } - checkFileName(Config_getString(GENERATE_TAGFILE),"GENERATE_TAGFILE"); + if (!checkFileName(Config_getString(GENERATE_TAGFILE),"GENERATE_TAGFILE")) + { + Config_updateString(GENERATE_TAGFILE,""); + } #if 0 // TODO: this breaks test 25; SOURCEBROWSER = NO and SOURCE_TOOLTIPS = YES. // So this and other regressions should be analysed and fixed before this can be enabled @@ -2016,10 +1990,10 @@ void Config::postProcess(bool clearHeaderAndFooter, bool compare) // refers to the files that we are supposed to parse. if (clearHeaderAndFooter) { - Config_getString(HTML_HEADER)=""; - Config_getString(HTML_FOOTER)=""; - Config_getString(LATEX_HEADER)=""; - Config_getString(LATEX_FOOTER)=""; + Config_updateString(HTML_HEADER ,""); + Config_updateString(HTML_FOOTER ,""); + Config_updateString(LATEX_HEADER,""); + Config_updateString(LATEX_FOOTER,""); } } diff --git a/src/context.cpp b/src/context.cpp index 9684870..d21b1d0 100644 --- a/src/context.cpp +++ b/src/context.cpp @@ -298,18 +298,16 @@ class ConfigContext::Private public: Private() { m_cachedLists.setAutoDelete(TRUE); } virtual ~Private() { } - TemplateVariant fetchList(const QCString &name,const QStrList *list) + TemplateVariant fetchList(const QCString &name,const StringVector &list) { TemplateVariant *v = m_cachedLists.find(name); if (v==0) { TemplateList *tlist = TemplateList::alloc(); m_cachedLists.insert(name,new TemplateVariant(tlist)); - QStrListIterator li(*list); - char *s; - for (li.toFirst();(s=li.current());++li) + for (const auto &s : list) { - tlist->append(s); + tlist->append(s.c_str()); } return tlist; } @@ -345,23 +343,23 @@ TemplateVariant ConfigContext::get(const char *name) const { case ConfigValues::Info::Bool: { - bool b = ConfigValues::instance().*((ConfigValues::InfoBool*)option)->item; + bool b = ConfigValues::instance().*(option->value.b); return TemplateVariant(b); } case ConfigValues::Info::Int: { - int i = ConfigValues::instance().*((ConfigValues::InfoInt*)option)->item; + int i = ConfigValues::instance().*(option->value.i); return TemplateVariant(i); } case ConfigValues::Info::String: { - QCString s = ConfigValues::instance().*((ConfigValues::InfoString*)option)->item; + QCString s = ConfigValues::instance().*(option->value.s); return TemplateVariant(s); } case ConfigValues::Info::List: { - const QStrList &l = ConfigValues::instance().*((ConfigValues::InfoList*)option)->item; - return p->fetchList(name,&l); + const StringVector &l = ConfigValues::instance().*(option->value.l); + return p->fetchList(name,l); } default: break; diff --git a/src/definition.cpp b/src/definition.cpp index 09b4f56..c398b61 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -159,13 +159,12 @@ void DefinitionImpl::setDefFile(const QCString &df,int defLine,int defCol) static bool matchExcludedSymbols(const char *name) { - static QStrList &exclSyms = Config_getList(EXCLUDE_SYMBOLS); - if (exclSyms.count()==0) return FALSE; // nothing specified - const char *pat = exclSyms.first(); + const StringVector &exclSyms = Config_getList(EXCLUDE_SYMBOLS); + if (exclSyms.empty()) return FALSE; // nothing specified QCString symName = name; - while (pat) + for (const auto &pat : exclSyms) { - QCString pattern = pat; + QCString pattern = pat.c_str(); bool forceStart=FALSE; bool forceEnd=FALSE; if (pattern.at(0)=='^') @@ -210,7 +209,6 @@ static bool matchExcludedSymbols(const char *name) } } } - pat = exclSyms.next(); } //printf("--> name=%s: no match\n",name); return FALSE; @@ -1930,15 +1928,13 @@ QCString abbreviate(const char *s,const char *name) result=result.left(result.length()-1); // strip any predefined prefix - QStrList &briefDescAbbrev = Config_getList(ABBREVIATE_BRIEF); - const char *p = briefDescAbbrev.first(); - while (p) + const StringVector &briefDescAbbrev = Config_getList(ABBREVIATE_BRIEF); + for (const auto &p : briefDescAbbrev) { - QCString str = p; + QCString str = p.c_str(); str.replace(QRegExp("\\$name"), scopelessName); // replace $name with entity name str += " "; stripWord(result,str); - p = briefDescAbbrev.next(); } // capitalize first word diff --git a/src/dirdef.cpp b/src/dirdef.cpp index 0f8f04b..7f0b524 100644 --- a/src/dirdef.cpp +++ b/src/dirdef.cpp @@ -69,7 +69,7 @@ class DirDefImpl : public DefinitionImpl, public DirDef void endMemberDeclarations(OutputList &ol); static DirDef *createNewDir(const char *path); - static bool matchPath(const QCString &path,QStrList &l); + static bool matchPath(const QCString &path,const StringVector &l); DirList m_subdirs; QCString m_dispName; @@ -792,17 +792,15 @@ DirDef *DirDefImpl::createNewDir(const char *path) return dir; } -bool DirDefImpl::matchPath(const QCString &path,QStrList &l) +bool DirDefImpl::matchPath(const QCString &path,const StringVector &l) { - const char *s=l.first(); - while (s) + for (const auto &s : l) { - QCString prefix = s; - if (qstricmp(prefix.left(path.length()),path)==0) // case insensitive compare + std::string prefix = s.substr(0,path.length()); + if (qstricmp(prefix.c_str(),path)==0) // case insensitive compare { return TRUE; } - s = l.next(); } return FALSE; } diff --git a/src/docparser.cpp b/src/docparser.cpp index 00f287c..0ed7f50 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -1846,18 +1846,16 @@ static void readTextFileByName(const QCString &file,QCString &text) return; } } - QStrList &examplePathList = Config_getList(EXAMPLE_PATH); - char *s=examplePathList.first(); - while (s) + const StringVector &examplePathList = Config_getList(EXAMPLE_PATH); + for (const auto &s : examplePathList) { - QCString absFileName = QCString(s)+Portable::pathSeparator()+file; + QCString absFileName = QCString(s.c_str())+Portable::pathSeparator()+file; QFileInfo fi(absFileName); if (fi.exists()) { text = fileToString(absFileName,Config_getBool(FILTER_SOURCE_FILES)); return; } - s=examplePathList.next(); } // as a fallback we also look in the exampleNameDict @@ -2569,7 +2567,7 @@ void DocRef::parse() DocCite::DocCite(DocNode *parent,const QCString &target,const QCString &) //context) { - static uint numBibFiles = Config_getList(CITE_BIB_FILES).count(); + size_t numBibFiles = Config_getList(CITE_BIB_FILES).size(); m_parent = parent; //printf("DocCite::DocCite(target=%s)\n",target.data()); ASSERT(!target.isEmpty()); diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 1824ceb..ddaa3f1 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -628,7 +628,7 @@ static void addIncludeFile(ClassDef *cd,FileDef *ifd,const Entry *root) iName=fd->name(); } } - else if (!Config_getList(STRIP_FROM_INC_PATH).isEmpty()) + else if (!Config_getList(STRIP_FROM_INC_PATH).empty()) { iName=stripFromIncludePath(fd->absFilePath()); } @@ -8856,10 +8856,10 @@ static void readTagFile(const std::shared_ptr &root,const char *tl) //---------------------------------------------------------------------------- static void copyLatexStyleSheet() { - QStrList latexExtraStyleSheet = Config_getList(LATEX_EXTRA_STYLESHEET); - for (uint i=0; i parseFile(OutlineParserInterface &parser, parser.needsPreprocessing(extension)) { Preprocessor preprocessor; - QStrList &includePath = Config_getList(INCLUDE_PATH); - char *s=includePath.first(); - while (s) + const StringVector &includePath = Config_getList(INCLUDE_PATH); + for (const auto &s : includePath) { - preprocessor.addSearchDir(QFileInfo(s).absFilePath().utf8()); - s=includePath.next(); + preprocessor.addSearchDir(QFileInfo(s.c_str()).absFilePath().utf8()); } BufStr inBuf(fi.size()+4096); msg("Preprocessing %s...\n",fn); @@ -9318,8 +9314,8 @@ static QDict g_pathsVisited(1009); static int readDir(QFileInfo *fi, FileNameLinkedMap *fnMap, StringUnorderedSet *exclSet, - QStrList *patList, - QStrList *exclPatList, + const StringVector *patList, + const StringVector *exclPatList, StringVector *resultList, StringUnorderedSet *resultSet, bool errorIfNotExist, @@ -9366,8 +9362,8 @@ static int readDir(QFileInfo *fi, } else if (cfi->isFile() && (!Config_getBool(EXCLUDE_SYMLINKS) || !cfi->isSymLink()) && - (patList==0 || patternMatch(*cfi,patList)) && - !patternMatch(*cfi,exclPatList) && + (patList==0 || patternMatch(*cfi,*patList)) && + (exclPatList==0 || !patternMatch(*cfi,*exclPatList)) && (killSet==0 || killSet->find(cfi->absFilePath().utf8().data())==killSet->end()) ) { @@ -9391,7 +9387,7 @@ static int readDir(QFileInfo *fi, else if (recursive && (!Config_getBool(EXCLUDE_SYMLINKS) || !cfi->isSymLink()) && cfi->isDir() && - !patternMatch(*cfi,exclPatList) && + (exclPatList==0 || !patternMatch(*cfi,*exclPatList)) && cfi->fileName().at(0)!='.') // skip "." ".." and ".dir" { cfi->setFile(cfi->absFilePath()); @@ -9414,8 +9410,8 @@ static int readDir(QFileInfo *fi, int readFileOrDirectory(const char *s, FileNameLinkedMap *fnMap, StringUnorderedSet *exclSet, - QStrList *patList, - QStrList *exclPatList, + const StringVector *patList, + const StringVector *exclPatList, StringVector *resultList, StringUnorderedSet *resultSet, bool recursive, @@ -9554,13 +9550,12 @@ void readAliases() { // add aliases to a dictionary Doxygen::aliasDict.setAutoDelete(TRUE); - QStrList &aliasList = Config_getList(ALIASES); - const char *s=aliasList.first(); - while (s) + const StringVector &aliasList = Config_getList(ALIASES); + for (const auto &s : aliasList) { - if (Doxygen::aliasDict[s]==0) + QCString alias=s.c_str(); + if (Doxygen::aliasDict[alias]==0) { - QCString alias=s; int i=alias.find('='); if (i>0) { @@ -9581,7 +9576,6 @@ void readAliases() } } } - s=aliasList.next(); } expandAliases(); escapeAliases(); @@ -10308,15 +10302,13 @@ void adjustConfiguration() * Add custom extension mappings **************************************************************************/ - QStrList &extMaps = Config_getList(EXTENSION_MAPPING); - char *mapping = extMaps.first(); - while (mapping) + const StringVector &extMaps = Config_getList(EXTENSION_MAPPING); + for (const auto &mapping : extMaps) { - QCString mapStr = mapping; + QCString mapStr = mapping.c_str(); int i=mapStr.find('='); if (i==-1) { - mapping = extMaps.next(); continue; } else @@ -10325,7 +10317,6 @@ void adjustConfiguration() QCString language = mapStr.mid(i+1).stripWhiteSpace().lower(); if (ext.isEmpty() || language.isEmpty()) { - mapping = extMaps.next(); continue; } @@ -10341,23 +10332,20 @@ void adjustConfiguration() ext.data(),language.data()); } } - mapping = extMaps.next(); } // add predefined macro name to a dictionary - QStrList &expandAsDefinedList =Config_getList(EXPAND_AS_DEFINED); - char *s=expandAsDefinedList.first(); - while (s) + const StringVector &expandAsDefinedList =Config_getList(EXPAND_AS_DEFINED); + for (const auto &s : expandAsDefinedList) { - Doxygen::expandAsDefinedSet.insert(s); - s=expandAsDefinedList.next(); + Doxygen::expandAsDefinedSet.insert(s.c_str()); } // read aliases and store them in a dictionary readAliases(); // store number of spaces in a tab into Doxygen::spaces - int &tabSize = Config_getInt(TAB_SIZE); + int tabSize = Config_getInt(TAB_SIZE); Doxygen::spaces.resize(tabSize+1); int sp;for (sp=0;sp updateConfig) { + QCString result = formatDirName; // Note the & on the next line, we modify the formatDirOption! - if (formatDirName.isEmpty()) + if (result.isEmpty()) { - formatDirName = baseDirName + defaultDirName; + result = baseDirName + defaultDirName; + updateConfig(result); } else if (formatDirName[0]!='/' && (formatDirName.length()==1 || formatDirName[1]!=':')) { - formatDirName.prepend(baseDirName+'/'); + result.prepend(baseDirName+'/'); + updateConfig(result); } - QDir formatDir(formatDirName); - if (!formatDir.exists() && !formatDir.mkdir(formatDirName)) + QDir formatDir(result); + if (!formatDir.exists() && !formatDir.mkdir(result)) { - err("Could not create output directory %s\n", formatDirName.data()); + err("Could not create output directory %s\n", result.data()); cleanUpDoxygen(); exit(1); } - return formatDirName; + return result; } static QCString getQchFileName() @@ -10533,23 +10525,20 @@ void searchInputFiles() { StringUnorderedSet killSet; - QStrList &exclPatterns = Config_getList(EXCLUDE_PATTERNS); + const StringVector &exclPatterns = Config_getList(EXCLUDE_PATTERNS); bool alwaysRecursive = Config_getBool(RECURSIVE); StringUnorderedSet excludeNameSet; // gather names of all files in the include path g_s.begin("Searching for include files...\n"); killSet.clear(); - QStrList &includePathList = Config_getList(INCLUDE_PATH); - char *s=includePathList.first(); - while (s) + const StringVector &includePathList = Config_getList(INCLUDE_PATH); + for (const auto &s : includePathList) { - QStrList &pl = Config_getList(INCLUDE_FILE_PATTERNS); - if (pl.count()==0) - { - pl = Config_getList(FILE_PATTERNS); - } - readFileOrDirectory(s, // s + size_t plSize = Config_getList(INCLUDE_FILE_PATTERNS).size(); + const StringVector &pl = plSize==0 ? Config_getList(FILE_PATTERNS) : + Config_getList(INCLUDE_FILE_PATTERNS); + readFileOrDirectory(s.c_str(), // s Doxygen::includeNameLinkedMap, // fnDict 0, // exclSet &pl, // patList @@ -10559,17 +10548,15 @@ void searchInputFiles() alwaysRecursive, // recursive TRUE, // errorIfNotExist &killSet); // killSet - s=includePathList.next(); } g_s.end(); g_s.begin("Searching for example files...\n"); killSet.clear(); - QStrList &examplePathList = Config_getList(EXAMPLE_PATH); - s=examplePathList.first(); - while (s) + const StringVector &examplePathList = Config_getList(EXAMPLE_PATH); + for (const auto &s : examplePathList) { - readFileOrDirectory(s, // s + readFileOrDirectory(s.c_str(), // s Doxygen::exampleNameLinkedMap, // fnDict 0, // exclSet &Config_getList(EXAMPLE_PATTERNS), // patList @@ -10579,17 +10566,15 @@ void searchInputFiles() (alwaysRecursive || Config_getBool(EXAMPLE_RECURSIVE)), // recursive TRUE, // errorIfNotExist &killSet); // killSet - s=examplePathList.next(); } g_s.end(); g_s.begin("Searching for images...\n"); killSet.clear(); - QStrList &imagePathList=Config_getList(IMAGE_PATH); - s=imagePathList.first(); - while (s) + const StringVector &imagePathList=Config_getList(IMAGE_PATH); + for (const auto &s : imagePathList) { - readFileOrDirectory(s, // s + readFileOrDirectory(s.c_str(), // s Doxygen::imageNameLinkedMap, // fnDict 0, // exclSet 0, // patList @@ -10599,17 +10584,15 @@ void searchInputFiles() alwaysRecursive, // recursive TRUE, // errorIfNotExist &killSet); // killSet - s=imagePathList.next(); } g_s.end(); g_s.begin("Searching for dot files...\n"); killSet.clear(); - QStrList &dotFileList=Config_getList(DOTFILE_DIRS); - s=dotFileList.first(); - while (s) + const StringVector &dotFileList=Config_getList(DOTFILE_DIRS); + for (const auto &s : dotFileList) { - readFileOrDirectory(s, // s + readFileOrDirectory(s.c_str(), // s Doxygen::dotFileNameLinkedMap, // fnDict 0, // exclSet 0, // patList @@ -10619,17 +10602,15 @@ void searchInputFiles() alwaysRecursive, // recursive TRUE, // errorIfNotExist &killSet); // killSet - s=dotFileList.next(); } g_s.end(); g_s.begin("Searching for msc files...\n"); killSet.clear(); - QStrList &mscFileList=Config_getList(MSCFILE_DIRS); - s=mscFileList.first(); - while (s) + const StringVector &mscFileList=Config_getList(MSCFILE_DIRS); + for (const auto &s : mscFileList) { - readFileOrDirectory(s, // s + readFileOrDirectory(s.c_str(), // s Doxygen::mscFileNameLinkedMap, // fnDict 0, // exclSet 0, // patList @@ -10639,17 +10620,15 @@ void searchInputFiles() alwaysRecursive, // recursive TRUE, // errorIfNotExist &killSet); // killSet - s=mscFileList.next(); } g_s.end(); g_s.begin("Searching for dia files...\n"); killSet.clear(); - QStrList &diaFileList=Config_getList(DIAFILE_DIRS); - s=diaFileList.first(); - while (s) + const StringVector &diaFileList=Config_getList(DIAFILE_DIRS); + for (const auto &s : diaFileList) { - readFileOrDirectory(s, // s + readFileOrDirectory(s.c_str(), // s Doxygen::diaFileNameLinkedMap, // fnDict 0, // exclSet 0, // patList @@ -10659,16 +10638,14 @@ void searchInputFiles() alwaysRecursive, // recursive TRUE, // errorIfNotExist &killSet); // killSet - s=diaFileList.next(); } g_s.end(); g_s.begin("Searching for files to exclude\n"); - QStrList &excludeList = Config_getList(EXCLUDE); - s=excludeList.first(); - while (s) + const StringVector &excludeList = Config_getList(EXCLUDE); + for (const auto &s : excludeList) { - readFileOrDirectory(s, // s + readFileOrDirectory(s.c_str(), // s 0, // fnDict 0, // exclSet &Config_getList(FILE_PATTERNS), // patList @@ -10677,7 +10654,6 @@ void searchInputFiles() &excludeNameSet, // resultSet alwaysRecursive, // recursive FALSE); // errorIfNotExist - s=excludeList.next(); // killSet } g_s.end(); @@ -10688,11 +10664,10 @@ void searchInputFiles() g_s.begin("Searching INPUT for files to process...\n"); killSet.clear(); Doxygen::inputPaths.clear(); - QStrList &inputList=Config_getList(INPUT); - s=inputList.first(); - while (s) + const StringVector &inputList=Config_getList(INPUT); + for (const auto &s : inputList) { - QCString path=s; + QCString path=s.c_str(); uint l = path.length(); if (l>0) { @@ -10712,7 +10687,6 @@ void searchInputFiles() &killSet, // killSet &Doxygen::inputPaths); // paths } - s=inputList.next(); } std::sort(Doxygen::inputNameLinkedMap->begin(), Doxygen::inputNameLinkedMap->end(), @@ -10738,10 +10712,10 @@ void parseInput() /************************************************************************** * Make sure the output directory exists **************************************************************************/ - QCString &outputDirectory = Config_getString(OUTPUT_DIRECTORY); + QCString outputDirectory = Config_getString(OUTPUT_DIRECTORY); if (outputDirectory.isEmpty()) { - outputDirectory=QDir::currentDirPath().utf8(); + outputDirectory = Config_updateString(OUTPUT_DIRECTORY,QDir::currentDirPath().utf8()); } else { @@ -10763,7 +10737,7 @@ void parseInput() } dir.cd(outputDirectory); } - outputDirectory=dir.absPath().utf8(); + outputDirectory = Config_updateString(OUTPUT_DIRECTORY,dir.absPath().utf8()); } /************************************************************************** @@ -10795,34 +10769,40 @@ void parseInput() **************************************************************************/ QCString htmlOutput; - bool &generateHtml = Config_getBool(GENERATE_HTML); + bool generateHtml = Config_getBool(GENERATE_HTML); if (generateHtml || g_useOutputTemplate /* TODO: temp hack */) - htmlOutput = createOutputDirectory(outputDirectory,Config_getString(HTML_OUTPUT),"/html"); + htmlOutput = createOutputDirectory(outputDirectory,Config_getString(HTML_OUTPUT), + "/html",Config_setterFunc(HTML_OUTPUT)); QCString docbookOutput; - bool &generateDocbook = Config_getBool(GENERATE_DOCBOOK); + bool generateDocbook = Config_getBool(GENERATE_DOCBOOK); if (generateDocbook) - docbookOutput = createOutputDirectory(outputDirectory,Config_getString(DOCBOOK_OUTPUT),"/docbook"); + docbookOutput = createOutputDirectory(outputDirectory,Config_getString(DOCBOOK_OUTPUT), + "/docbook",Config_setterFunc(DOCBOOK_OUTPUT)); QCString xmlOutput; - bool &generateXml = Config_getBool(GENERATE_XML); + bool generateXml = Config_getBool(GENERATE_XML); if (generateXml) - xmlOutput = createOutputDirectory(outputDirectory,Config_getString(XML_OUTPUT),"/xml"); + xmlOutput = createOutputDirectory(outputDirectory,Config_getString(XML_OUTPUT), + "/xml",Config_setterFunc(XML_OUTPUT)); QCString latexOutput; - bool &generateLatex = Config_getBool(GENERATE_LATEX); + bool generateLatex = Config_getBool(GENERATE_LATEX); if (generateLatex) - latexOutput = createOutputDirectory(outputDirectory,Config_getString(LATEX_OUTPUT),"/latex"); + latexOutput = createOutputDirectory(outputDirectory,Config_getString(LATEX_OUTPUT), + "/latex",Config_setterFunc(LATEX_OUTPUT)); QCString rtfOutput; - bool &generateRtf = Config_getBool(GENERATE_RTF); + bool generateRtf = Config_getBool(GENERATE_RTF); if (generateRtf) - rtfOutput = createOutputDirectory(outputDirectory,Config_getString(RTF_OUTPUT),"/rtf"); + rtfOutput = createOutputDirectory(outputDirectory,Config_getString(RTF_OUTPUT), + "/rtf",Config_setterFunc(RTF_OUTPUT)); QCString manOutput; - bool &generateMan = Config_getBool(GENERATE_MAN); + bool generateMan = Config_getBool(GENERATE_MAN); if (generateMan) - manOutput = createOutputDirectory(outputDirectory,Config_getString(MAN_OUTPUT),"/man"); + manOutput = createOutputDirectory(outputDirectory,Config_getString(MAN_OUTPUT), + "/man",Config_setterFunc(MAN_OUTPUT)); //QCString sqlOutput; //bool &generateSql = Config_getBool(GENERATE_SQLITE3); @@ -10856,11 +10836,11 @@ void parseInput() **************************************************************************/ LayoutDocManager::instance().init(); - QCString &layoutFileName = Config_getString(LAYOUT_FILE); + QCString layoutFileName = Config_getString(LAYOUT_FILE); bool defaultLayoutUsed = FALSE; if (layoutFileName.isEmpty()) { - layoutFileName = "DoxygenLayout.xml"; + layoutFileName = Config_updateString(LAYOUT_FILE,"DoxygenLayout.xml"); defaultLayoutUsed = TRUE; } @@ -10880,13 +10860,14 @@ void parseInput() **************************************************************************/ // prevent search in the output directories - QStrList &exclPatterns = Config_getList(EXCLUDE_PATTERNS); - if (generateHtml) exclPatterns.append(htmlOutput); - if (generateDocbook) exclPatterns.append(docbookOutput); - if (generateXml) exclPatterns.append(xmlOutput); - if (generateLatex) exclPatterns.append(latexOutput); - if (generateRtf) exclPatterns.append(rtfOutput); - if (generateMan) exclPatterns.append(manOutput); + StringVector exclPatterns = Config_getList(EXCLUDE_PATTERNS); + if (generateHtml) exclPatterns.push_back(htmlOutput.data()); + if (generateDocbook) exclPatterns.push_back(docbookOutput.data()); + if (generateXml) exclPatterns.push_back(xmlOutput.data()); + if (generateLatex) exclPatterns.push_back(latexOutput.data()); + if (generateRtf) exclPatterns.push_back(rtfOutput.data()); + if (generateMan) exclPatterns.push_back(manOutput.data()); + Config_updateList(EXCLUDE_PATTERNS,exclPatterns); searchInputFiles(); @@ -10919,12 +10900,10 @@ void parseInput() std::shared_ptr root = std::make_shared(); msg("Reading and parsing tag files\n"); - QStrList &tagFileList = Config_getList(TAGFILES); - char *s=tagFileList.first(); - while (s) + const StringVector &tagFileList = Config_getList(TAGFILES); + for (const auto &s : tagFileList) { - readTagFile(root,s); - s=tagFileList.next(); + readTagFile(root,s.c_str()); } /************************************************************************** diff --git a/src/doxygen.h b/src/doxygen.h index 99b5d6f..557c871 100644 --- a/src/doxygen.h +++ b/src/doxygen.h @@ -165,8 +165,8 @@ void cleanUpDoxygen(); int readFileOrDirectory(const char *s, FileNameLinkedMap *fnDict, StringUnorderedSet *exclSet, - QStrList *patList, - QStrList *exclPatList, + const StringVector *patList, + const StringVector *exclPatList, StringVector *resultList, StringUnorderedSet *resultSet, bool recursive, diff --git a/src/ftvhelp.cpp b/src/ftvhelp.cpp index cb50af1..d5a5703 100644 --- a/src/ftvhelp.cpp +++ b/src/ftvhelp.cpp @@ -669,7 +669,7 @@ static void generateJSNavTree(const QList &nodeList) t << "var NAVTREE =" << endl; t << "[" << endl; t << " [ "; - QCString &projName = Config_getString(PROJECT_NAME); + QCString projName = Config_getString(PROJECT_NAME); if (projName.isEmpty()) { if (mainPageHasTitle()) // Use title of main page as root diff --git a/src/htags.cpp b/src/htags.cpp index 1a240b1..0c3a9af 100644 --- a/src/htags.cpp +++ b/src/htags.cpp @@ -3,8 +3,8 @@ * Copyright (C) 1997-2015 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its - * documentation under the terms of the GNU General Public License is hereby - * granted. No representations are made about the suitability of this software + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software * for any purpose. It is provided "as is" without express or implied warranty. * See the GNU General Public License for more details. * @@ -36,25 +36,25 @@ static QDict g_symbolDict(10007); */ bool Htags::execute(const QCString &htmldir) { - static QStrList &inputSource = Config_getList(INPUT); - static bool quiet = Config_getBool(QUIET); - static bool warnings = Config_getBool(WARNINGS); - static QCString htagsOptions = ""; //Config_getString(HTAGS_OPTIONS); - static QCString projectName = Config_getString(PROJECT_NAME); - static QCString projectNumber = Config_getString(PROJECT_NUMBER); + const StringVector &inputSource = Config_getList(INPUT); + bool quiet = Config_getBool(QUIET); + bool warnings = Config_getBool(WARNINGS); + QCString htagsOptions = ""; //Config_getString(HTAGS_OPTIONS); + QCString projectName = Config_getString(PROJECT_NAME); + QCString projectNumber = Config_getString(PROJECT_NUMBER); QCString cwd = QDir::currentDirPath().utf8(); - if (inputSource.isEmpty()) + if (inputSource.empty()) { g_inputDir.setPath(cwd); } - else if (inputSource.count()==1) + else if (inputSource.size()==1) { - g_inputDir.setPath(inputSource.first()); + g_inputDir.setPath(inputSource.back().c_str()); if (!g_inputDir.exists()) err("Cannot find directory %s. " "Check the value of the INPUT tag in the configuration file.\n", - inputSource.first() + inputSource.back().c_str() ); } else @@ -69,16 +69,16 @@ bool Htags::execute(const QCString &htmldir) QCString commandLine = " -g -s -a -n "; if (!quiet) commandLine += "-v "; if (warnings) commandLine += "-w "; - if (!htagsOptions.isEmpty()) + if (!htagsOptions.isEmpty()) { commandLine += ' '; commandLine += htagsOptions; } - if (!projectName.isEmpty()) + if (!projectName.isEmpty()) { commandLine += "-t \""; commandLine += projectName; - if (!projectNumber.isEmpty()) + if (!projectNumber.isEmpty()) { commandLine += '-'; commandLine += projectNumber; @@ -150,7 +150,7 @@ bool Htags::loadFilemap(const QCString &htmlDir) } else { - err("file %s cannot be opened\n",fileMapName.data()); + err("file %s cannot be opened\n",fileMapName.data()); } } return FALSE; diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index 7458b23..900ea48 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -415,7 +415,6 @@ static QCString substituteHtmlKeywords(const QCString &str, { // Build CSS/JavaScript tags depending on treeview, search engine settings QCString cssFile; - QStrList extraCssFile; QCString generatedBy; QCString treeViewCssJs; QCString searchCssJs; @@ -456,10 +455,10 @@ static QCString substituteHtmlKeywords(const QCString &str, } extraCssText = ""; - extraCssFile = Config_getList(HTML_EXTRA_STYLESHEET); - for (uint i=0; i\n" " MathJax.Hub.Config({\n" " extensions: [\"tex2jax.js\""; - QStrList &mathJaxExtensions = Config_getList(MATHJAX_EXTENSIONS); - const char *s = mathJaxExtensions.first(); - while (s) + const StringVector &mathJaxExtensions = Config_getList(MATHJAX_EXTENSIONS); + for (const auto &s : mathJaxExtensions) { - mathJaxJs+= ", \""+QCString(s)+".js\""; - s = mathJaxExtensions.next(); + mathJaxJs+= ", \""+QCString(s.c_str())+".js\""; } if (mathJaxFormat.isEmpty()) { @@ -1261,10 +1258,10 @@ void HtmlGenerator::writeStyleInfo(int part) } Doxygen::indexList->addStyleSheetFile(cssfi.fileName().utf8()); } - static QStrList extraCssFile = Config_getList(HTML_EXTRA_STYLESHEET); - for (uint i=0; itrLegendTitle().data()); startTitle(ol,0); @@ -3936,8 +3936,8 @@ void writeGraphInfo(OutputList &ol) delete fd; // restore config settings - stripCommentsStateRef = oldStripCommentsState; - createSubdirs = oldCreateSubdirs; + Config_updateBool(STRIP_CODE_COMMENTS,oldStripCommentsState); + Config_updateBool(CREATE_SUBDIRS,oldCreateSubdirs); endFile(ol); ol.popGeneratorState(); diff --git a/src/latexgen.cpp b/src/latexgen.cpp index 52a8acf..f3cce3e 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -511,10 +511,10 @@ static void writeDefaultHeaderPart1(FTextStream &t) "\\usepackage{fixltx2e}\n" // for \textsubscript "\\usepackage{calc}\n" "\\usepackage{doxygen}\n"; - QStrList extraLatexStyle = Config_getList(LATEX_EXTRA_STYLESHEET); - for (uint i=0; itype==ConfigValues::Info::Bool) { - return ConfigValues::instance().*((ConfigValues::InfoBool*)opt)->item; + return ConfigValues::instance().*(opt->value.b); } else if (!opt) { @@ -84,7 +84,7 @@ LayoutNavEntry *LayoutNavEntry::find(LayoutNavEntry::Kind kind, LayoutNavEntry *entry; for (li.toFirst();(entry=li.current());++li) { - // depth first search, needed to find the entry furthest from the + // depth first search, needed to find the entry furthest from the // root in case an entry is in the tree twice result = entry->find(kind,file); if (result) return result; @@ -99,7 +99,7 @@ LayoutNavEntry *LayoutNavEntry::find(LayoutNavEntry::Kind kind, QCString LayoutNavEntry::url() const { QCString url = baseFile().stripWhiteSpace(); - if ((kind()!=LayoutNavEntry::User && kind()!=LayoutNavEntry::UserGroup) || + if ((kind()!=LayoutNavEntry::User && kind()!=LayoutNavEntry::UserGroup) || (kind()==LayoutNavEntry::UserGroup && url.left(9)=="usergroup")) { url+=Doxygen::htmlFileExtension; @@ -111,7 +111,7 @@ QCString LayoutNavEntry::url() const bool found=FALSE; if (resolveLink(0,url.mid(5).stripWhiteSpace(),TRUE,&d,anchor)) { - if (d && d->isLinkable()) + if (d && d->isLinkable()) { url=d->getOutputFileBase()+Doxygen::htmlFileExtension; if (!anchor.isEmpty()) @@ -137,14 +137,14 @@ class LayoutParser : public QXmlDefaultHandler private: class StartElementHandler { - typedef void (LayoutParser::*Handler)(const QXmlAttributes &attrib); + typedef void (LayoutParser::*Handler)(const QXmlAttributes &attrib); public: - StartElementHandler(LayoutParser *parent, Handler h) + StartElementHandler(LayoutParser *parent, Handler h) : m_parent(parent), m_handler(h) {} virtual ~StartElementHandler() {} - virtual void operator()(const QXmlAttributes &attrib) - { - (m_parent->*m_handler)(attrib); + virtual void operator()(const QXmlAttributes &attrib) + { + (m_parent->*m_handler)(attrib); } protected: StartElementHandler() : m_parent(0), m_handler(0) {} @@ -156,13 +156,13 @@ class LayoutParser : public QXmlDefaultHandler class StartElementHandlerKind : public StartElementHandler { typedef void (LayoutParser::*Handler)(LayoutDocEntry::Kind kind, - const QXmlAttributes &attrib); + const QXmlAttributes &attrib); public: - StartElementHandlerKind(LayoutParser *parent, LayoutDocEntry::Kind k,Handler h) + StartElementHandlerKind(LayoutParser *parent, LayoutDocEntry::Kind k,Handler h) : m_parent(parent), m_kind(k), m_handler(h) {} - void operator()(const QXmlAttributes &attrib) - { - (m_parent->*m_handler)(m_kind,attrib); + void operator()(const QXmlAttributes &attrib) + { + (m_parent->*m_handler)(m_kind,attrib); } private: LayoutParser *m_parent; @@ -174,14 +174,14 @@ class LayoutParser : public QXmlDefaultHandler { typedef void (LayoutParser::*Handler)(LayoutDocEntry::Kind kind, const QXmlAttributes &attrib, - const QCString &title); + const QCString &title); public: StartElementHandlerSection(LayoutParser *parent, LayoutDocEntry::Kind k,Handler h, - const QCString &title) + const QCString &title) : m_parent(parent), m_kind(k), m_handler(h), m_title(title) {} - void operator()(const QXmlAttributes &attrib) - { - (m_parent->*m_handler)(m_kind,attrib,m_title); + void operator()(const QXmlAttributes &attrib) + { + (m_parent->*m_handler)(m_kind,attrib,m_title); } private: LayoutParser *m_parent; @@ -195,19 +195,19 @@ class LayoutParser : public QXmlDefaultHandler typedef void (LayoutParser::*Handler)(const QXmlAttributes &attrib, MemberListType type, const QCString &title, - const QCString &subtitle); + const QCString &subtitle); public: - StartElementHandlerMember(LayoutParser *parent, + StartElementHandlerMember(LayoutParser *parent, Handler h, MemberListType type, const QCString &tl, const QCString &ss = QCString() - ) + ) : m_parent(parent), m_handler(h), m_type(type), m_title(tl), m_subscript(ss) {} - void operator()(const QXmlAttributes &attrib) - { - (m_parent->*m_handler)(attrib,m_type,m_title,m_subscript); + void operator()(const QXmlAttributes &attrib) + { + (m_parent->*m_handler)(attrib,m_type,m_title,m_subscript); } private: LayoutParser *m_parent; @@ -221,17 +221,17 @@ class LayoutParser : public QXmlDefaultHandler { typedef void (LayoutParser::*Handler)(LayoutNavEntry::Kind kind, const QXmlAttributes &attrib, - const QCString &title); + const QCString &title); public: StartElementHandlerNavEntry(LayoutParser *parent, - LayoutNavEntry::Kind kind, + LayoutNavEntry::Kind kind, Handler h, const QCString &tl - ) + ) : m_parent(parent), m_kind(kind), m_handler(h), m_title(tl) {} - void operator()(const QXmlAttributes &attrib) - { - (m_parent->*m_handler)(m_kind,attrib,m_title); + void operator()(const QXmlAttributes &attrib) + { + (m_parent->*m_handler)(m_kind,attrib,m_title); } private: LayoutParser *m_parent; @@ -242,7 +242,7 @@ class LayoutParser : public QXmlDefaultHandler class EndElementHandler { - typedef void (LayoutParser::*Handler)(); + typedef void (LayoutParser::*Handler)(); public: EndElementHandler(LayoutParser *parent, Handler h) : m_parent(parent), m_handler(h) {} void operator()() { (m_parent->*m_handler)(); } @@ -266,51 +266,51 @@ class LayoutParser : public QXmlDefaultHandler m_rootNav = 0; //bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN); - //bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL); + //bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL); //bool javaOpt = Config_getBool(OPTIMIZE_OUTPUT_JAVA); bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE); // start & end handlers - m_sHandler.insert("doxygenlayout", + m_sHandler.insert("doxygenlayout", new StartElementHandler(this,&LayoutParser::startLayout)); - m_eHandler.insert("doxygenlayout", + m_eHandler.insert("doxygenlayout", new EndElementHandler(this,&LayoutParser::endLayout)); // class layout handlers - m_sHandler.insert("navindex", + m_sHandler.insert("navindex", new StartElementHandler(this,&LayoutParser::startNavIndex)); - m_sHandler.insert("navindex/tab", + m_sHandler.insert("navindex/tab", new StartElementHandler(this,&LayoutParser::startNavEntry)); - m_eHandler.insert("navindex/tab", + m_eHandler.insert("navindex/tab", new EndElementHandler(this,&LayoutParser::endNavEntry)); - m_eHandler.insert("navindex", + m_eHandler.insert("navindex", new EndElementHandler(this,&LayoutParser::endNavIndex)); // class layout handlers - m_sHandler.insert("class", + m_sHandler.insert("class", new StartElementHandler(this,&LayoutParser::startClass)); - m_sHandler.insert("class/briefdescription", + m_sHandler.insert("class/briefdescription", new StartElementHandlerKind(this,LayoutDocEntry::BriefDesc,&LayoutParser::startSimpleEntry)); - m_sHandler.insert("class/detaileddescription", + m_sHandler.insert("class/detaileddescription", new StartElementHandlerSection(this,LayoutDocEntry::DetailedDesc,&LayoutParser::startSectionEntry, theTranslator->trDetailedDescription())); - m_sHandler.insert("class/authorsection", + m_sHandler.insert("class/authorsection", new StartElementHandlerKind(this,LayoutDocEntry::AuthorSection,&LayoutParser::startSimpleEntry)); - m_sHandler.insert("class/includes", + m_sHandler.insert("class/includes", new StartElementHandlerKind(this,LayoutDocEntry::ClassIncludes,&LayoutParser::startSimpleEntry)); - m_sHandler.insert("class/inheritancegraph", + m_sHandler.insert("class/inheritancegraph", new StartElementHandlerKind(this,LayoutDocEntry::ClassInheritanceGraph,&LayoutParser::startSimpleEntry)); - m_sHandler.insert("class/collaborationgraph", + m_sHandler.insert("class/collaborationgraph", new StartElementHandlerKind(this,LayoutDocEntry::ClassCollaborationGraph,&LayoutParser::startSimpleEntry)); - m_sHandler.insert("class/allmemberslink", + m_sHandler.insert("class/allmemberslink", new StartElementHandlerKind(this,LayoutDocEntry::ClassAllMembersLink,&LayoutParser::startSimpleEntry)); - m_sHandler.insert("class/usedfiles", + m_sHandler.insert("class/usedfiles", new StartElementHandlerKind(this,LayoutDocEntry::ClassUsedFiles,&LayoutParser::startSimpleEntry)); - m_sHandler.insert("class/memberdecl", + m_sHandler.insert("class/memberdecl", new StartElementHandler(this,&LayoutParser::startMemberDecl)); - m_sHandler.insert("class/memberdecl/membergroups", + m_sHandler.insert("class/memberdecl/membergroups", new StartElementHandlerKind(this,LayoutDocEntry::MemberGroups,&LayoutParser::startSimpleEntry)); - m_sHandler.insert("class/memberdecl/nestedclasses", + m_sHandler.insert("class/memberdecl/nestedclasses", new StartElementHandlerSection(this,LayoutDocEntry::ClassNestedClasses,&LayoutParser::startSectionEntry, COMPILE_FOR_2_OPTIONS( theTranslator->trCompounds(), @@ -323,118 +323,118 @@ class LayoutParser : public QXmlDefaultHandler m_sHandler.insert("class/memberdecl/interfaces", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, MemberListType_interfaces,theTranslator->trInterfaces())); - m_sHandler.insert("class/memberdecl/publictypes", + m_sHandler.insert("class/memberdecl/publictypes", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, MemberListType_pubTypes,theTranslator->trPublicTypes())); - m_sHandler.insert("class/memberdecl/publicslots", + m_sHandler.insert("class/memberdecl/publicslots", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, - MemberListType_pubSlots,theTranslator->trPublicSlots())); - m_sHandler.insert("class/memberdecl/signals", + MemberListType_pubSlots,theTranslator->trPublicSlots())); + m_sHandler.insert("class/memberdecl/signals", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, - MemberListType_signals,theTranslator->trSignals())); - m_sHandler.insert("class/memberdecl/publicmethods", + MemberListType_signals,theTranslator->trSignals())); + m_sHandler.insert("class/memberdecl/publicmethods", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, MemberListType_pubMethods, COMPILE_FOR_2_OPTIONS( theTranslator->trPublicMembers(), SrcLangExt_ObjC,theTranslator->trInstanceMethods(), SrcLangExt_Slice,theTranslator->trOperations() - ))); - m_sHandler.insert("class/memberdecl/publicstaticmethods", + ))); + m_sHandler.insert("class/memberdecl/publicstaticmethods", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, MemberListType_pubStaticMethods, COMPILE_FOR_1_OPTION( theTranslator->trStaticPublicMembers(), SrcLangExt_ObjC,theTranslator->trClassMethods() - ))); - m_sHandler.insert("class/memberdecl/publicattributes", + ))); + m_sHandler.insert("class/memberdecl/publicattributes", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, MemberListType_pubAttribs, COMPILE_FOR_1_OPTION( theTranslator->trPublicAttribs(), SrcLangExt_Slice,theTranslator->trDataMembers() - ))); - m_sHandler.insert("class/memberdecl/publicstaticattributes", + ))); + m_sHandler.insert("class/memberdecl/publicstaticattributes", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, - MemberListType_pubStaticAttribs,theTranslator->trStaticPublicAttribs())); - m_sHandler.insert("class/memberdecl/protectedtypes", + MemberListType_pubStaticAttribs,theTranslator->trStaticPublicAttribs())); + m_sHandler.insert("class/memberdecl/protectedtypes", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, - MemberListType_proTypes,theTranslator->trProtectedTypes())); - m_sHandler.insert("class/memberdecl/protectedslots", + MemberListType_proTypes,theTranslator->trProtectedTypes())); + m_sHandler.insert("class/memberdecl/protectedslots", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, - MemberListType_proSlots,theTranslator->trProtectedSlots())); - m_sHandler.insert("class/memberdecl/protectedmethods", + MemberListType_proSlots,theTranslator->trProtectedSlots())); + m_sHandler.insert("class/memberdecl/protectedmethods", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, - MemberListType_proMethods,theTranslator->trProtectedMembers())); - m_sHandler.insert("class/memberdecl/protectedstaticmethods", + MemberListType_proMethods,theTranslator->trProtectedMembers())); + m_sHandler.insert("class/memberdecl/protectedstaticmethods", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, MemberListType_proStaticMethods,theTranslator->trStaticProtectedMembers())); - m_sHandler.insert("class/memberdecl/protectedattributes", + m_sHandler.insert("class/memberdecl/protectedattributes", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, - MemberListType_proAttribs,theTranslator->trProtectedAttribs())); - m_sHandler.insert("class/memberdecl/protectedstaticattributes", + MemberListType_proAttribs,theTranslator->trProtectedAttribs())); + m_sHandler.insert("class/memberdecl/protectedstaticattributes", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, - MemberListType_proStaticAttribs,theTranslator->trStaticProtectedAttribs())); - m_sHandler.insert("class/memberdecl/packagetypes", + MemberListType_proStaticAttribs,theTranslator->trStaticProtectedAttribs())); + m_sHandler.insert("class/memberdecl/packagetypes", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, - MemberListType_pacTypes,theTranslator->trPackageTypes())); - m_sHandler.insert("class/memberdecl/packagemethods", + MemberListType_pacTypes,theTranslator->trPackageTypes())); + m_sHandler.insert("class/memberdecl/packagemethods", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, - MemberListType_pacMethods,theTranslator->trPackageMembers())); - m_sHandler.insert("class/memberdecl/packagestaticmethods", + MemberListType_pacMethods,theTranslator->trPackageMembers())); + m_sHandler.insert("class/memberdecl/packagestaticmethods", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, - MemberListType_pacStaticMethods,theTranslator->trStaticPackageMembers())); - m_sHandler.insert("class/memberdecl/packageattributes", + MemberListType_pacStaticMethods,theTranslator->trStaticPackageMembers())); + m_sHandler.insert("class/memberdecl/packageattributes", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, - MemberListType_pacAttribs,theTranslator->trPackageAttribs())); - m_sHandler.insert("class/memberdecl/packagestaticattributes", + MemberListType_pacAttribs,theTranslator->trPackageAttribs())); + m_sHandler.insert("class/memberdecl/packagestaticattributes", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, - MemberListType_pacStaticAttribs,theTranslator->trStaticPackageAttribs())); - m_sHandler.insert("class/memberdecl/properties", + MemberListType_pacStaticAttribs,theTranslator->trStaticPackageAttribs())); + m_sHandler.insert("class/memberdecl/properties", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, - MemberListType_properties,theTranslator->trProperties())); - m_sHandler.insert("class/memberdecl/events", + MemberListType_properties,theTranslator->trProperties())); + m_sHandler.insert("class/memberdecl/events", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, - MemberListType_events,theTranslator->trEvents())); - m_sHandler.insert("class/memberdecl/privatetypes", + MemberListType_events,theTranslator->trEvents())); + m_sHandler.insert("class/memberdecl/privatetypes", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, - MemberListType_priTypes,theTranslator->trPrivateTypes())); - m_sHandler.insert("class/memberdecl/privateslots", + MemberListType_priTypes,theTranslator->trPrivateTypes())); + m_sHandler.insert("class/memberdecl/privateslots", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, - MemberListType_priSlots,theTranslator->trPrivateSlots())); - m_sHandler.insert("class/memberdecl/privatemethods", + MemberListType_priSlots,theTranslator->trPrivateSlots())); + m_sHandler.insert("class/memberdecl/privatemethods", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, - MemberListType_priMethods,theTranslator->trPrivateMembers())); - m_sHandler.insert("class/memberdecl/privatestaticmethods", + MemberListType_priMethods,theTranslator->trPrivateMembers())); + m_sHandler.insert("class/memberdecl/privatestaticmethods", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, - MemberListType_priStaticMethods,theTranslator->trStaticPrivateMembers())); - m_sHandler.insert("class/memberdecl/privateattributes", + MemberListType_priStaticMethods,theTranslator->trStaticPrivateMembers())); + m_sHandler.insert("class/memberdecl/privateattributes", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, - MemberListType_priAttribs,theTranslator->trPrivateAttribs())); - m_sHandler.insert("class/memberdecl/privatestaticattributes", + MemberListType_priAttribs,theTranslator->trPrivateAttribs())); + m_sHandler.insert("class/memberdecl/privatestaticattributes", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, - MemberListType_priStaticAttribs,theTranslator->trStaticPrivateAttribs())); - m_sHandler.insert("class/memberdecl/friends", + MemberListType_priStaticAttribs,theTranslator->trStaticPrivateAttribs())); + m_sHandler.insert("class/memberdecl/friends", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, MemberListType_friends,theTranslator->trFriends())); - m_sHandler.insert("class/memberdecl/related", + m_sHandler.insert("class/memberdecl/related", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, MemberListType_related,theTranslator->trRelatedFunctions(), - theTranslator->trRelatedSubscript())); - m_eHandler.insert("class/memberdecl", + theTranslator->trRelatedSubscript())); + m_eHandler.insert("class/memberdecl", new EndElementHandler(this,&LayoutParser::endMemberDecl)); - m_sHandler.insert("class/memberdef", + m_sHandler.insert("class/memberdef", new StartElementHandler(this,&LayoutParser::startMemberDef)); - m_sHandler.insert("class/memberdef/inlineclasses", + m_sHandler.insert("class/memberdef/inlineclasses", new StartElementHandlerSection(this,LayoutDocEntry::ClassInlineClasses,&LayoutParser::startSectionEntry, COMPILE_FOR_1_OPTION( theTranslator->trClassDocumentation(), SrcLangExt_Fortran,theTranslator->trTypeDocumentation() ))); - m_sHandler.insert("class/memberdef/typedefs", + m_sHandler.insert("class/memberdef/typedefs", new StartElementHandlerMember(this,&LayoutParser::startMemberDefEntry, MemberListType_typedefMembers,theTranslator->trMemberTypedefDocumentation())); - m_sHandler.insert("class/memberdef/enums", + m_sHandler.insert("class/memberdef/enums", new StartElementHandlerMember(this,&LayoutParser::startMemberDefEntry, MemberListType_enumMembers,theTranslator->trMemberEnumerationDocumentation())); m_sHandler.insert("class/memberdef/services", @@ -443,10 +443,10 @@ class LayoutParser : public QXmlDefaultHandler m_sHandler.insert("class/memberdef/interfaces", new StartElementHandlerMember(this,&LayoutParser::startMemberDefEntry, MemberListType_interfaceMembers,theTranslator->trInterfaces())); - m_sHandler.insert("class/memberdef/constructors", + m_sHandler.insert("class/memberdef/constructors", new StartElementHandlerMember(this,&LayoutParser::startMemberDefEntry, MemberListType_constructors,theTranslator->trConstructorDocumentation())); - m_sHandler.insert("class/memberdef/functions", + m_sHandler.insert("class/memberdef/functions", new StartElementHandlerMember(this,&LayoutParser::startMemberDefEntry, MemberListType_functionMembers, COMPILE_FOR_3_OPTIONS( @@ -455,41 +455,41 @@ class LayoutParser : public QXmlDefaultHandler SrcLangExt_Fortran,theTranslator->trMemberFunctionDocumentationFortran(), SrcLangExt_Slice,theTranslator->trOperationDocumentation() ))); - m_sHandler.insert("class/memberdef/related", + m_sHandler.insert("class/memberdef/related", new StartElementHandlerMember(this,&LayoutParser::startMemberDefEntry, MemberListType_relatedMembers,theTranslator->trRelatedFunctionDocumentation())); - m_sHandler.insert("class/memberdef/variables", + m_sHandler.insert("class/memberdef/variables", new StartElementHandlerMember(this,&LayoutParser::startMemberDefEntry, MemberListType_variableMembers, COMPILE_FOR_1_OPTION( theTranslator->trMemberDataDocumentation(), SrcLangExt_Slice,theTranslator->trDataMemberDocumentation() - ))); - m_sHandler.insert("class/memberdef/properties", + ))); + m_sHandler.insert("class/memberdef/properties", new StartElementHandlerMember(this,&LayoutParser::startMemberDefEntry, MemberListType_propertyMembers,theTranslator->trPropertyDocumentation())); - m_sHandler.insert("class/memberdef/events", + m_sHandler.insert("class/memberdef/events", new StartElementHandlerMember(this,&LayoutParser::startMemberDefEntry, MemberListType_eventMembers,theTranslator->trEventDocumentation())); - m_eHandler.insert("class/memberdef", + m_eHandler.insert("class/memberdef", new EndElementHandler(this,&LayoutParser::endMemberDef)); - m_eHandler.insert("class", + m_eHandler.insert("class", new EndElementHandler(this,&LayoutParser::endClass)); // namespace layout handlers - m_sHandler.insert("namespace", + m_sHandler.insert("namespace", new StartElementHandler(this,&LayoutParser::startNamespace)); - m_sHandler.insert("namespace/briefdescription", + m_sHandler.insert("namespace/briefdescription", new StartElementHandlerKind(this,LayoutDocEntry::BriefDesc,&LayoutParser::startSimpleEntry)); - m_sHandler.insert("namespace/detaileddescription", + m_sHandler.insert("namespace/detaileddescription", new StartElementHandlerSection(this,LayoutDocEntry::DetailedDesc,&LayoutParser::startSectionEntry, theTranslator->trDetailedDescription())); - m_sHandler.insert("namespace/authorsection", + m_sHandler.insert("namespace/authorsection", new StartElementHandlerKind(this,LayoutDocEntry::AuthorSection,&LayoutParser::startSimpleEntry)); - m_sHandler.insert("namespace/memberdecl", + m_sHandler.insert("namespace/memberdecl", new StartElementHandler(this,&LayoutParser::startMemberDecl)); - m_sHandler.insert("namespace/memberdecl/nestednamespaces", + m_sHandler.insert("namespace/memberdecl/nestednamespaces", new StartElementHandlerSection(this,LayoutDocEntry::NamespaceNestedNamespaces,&LayoutParser::startSectionEntry, COMPILE_FOR_5_OPTIONS( theTranslator->trNamespaces(), @@ -503,37 +503,37 @@ class LayoutParser : public QXmlDefaultHandler m_sHandler.insert("namespace/memberdecl/constantgroups", new StartElementHandlerSection(this,LayoutDocEntry::NamespaceNestedConstantGroups,&LayoutParser::startSectionEntry, theTranslator->trConstantGroups())); - m_sHandler.insert("namespace/memberdecl/interfaces", + m_sHandler.insert("namespace/memberdecl/interfaces", new StartElementHandlerSection(this,LayoutDocEntry::NamespaceInterfaces,&LayoutParser::startSectionEntry, theTranslator->trSliceInterfaces())); - m_sHandler.insert("namespace/memberdecl/classes", + m_sHandler.insert("namespace/memberdecl/classes", new StartElementHandlerSection(this,LayoutDocEntry::NamespaceClasses,&LayoutParser::startSectionEntry, COMPILE_FOR_2_OPTIONS( theTranslator->trCompounds(), SrcLangExt_VHDL,theTranslator->trVhdlType(VhdlDocGen::ENTITY,FALSE), SrcLangExt_Fortran,theTranslator->trDataTypes() ))); - m_sHandler.insert("namespace/memberdecl/structs", + m_sHandler.insert("namespace/memberdecl/structs", new StartElementHandlerSection(this,LayoutDocEntry::NamespaceStructs,&LayoutParser::startSectionEntry, theTranslator->trStructs())); - m_sHandler.insert("namespace/memberdecl/exceptions", + m_sHandler.insert("namespace/memberdecl/exceptions", new StartElementHandlerSection(this,LayoutDocEntry::NamespaceExceptions,&LayoutParser::startSectionEntry, theTranslator->trExceptions())); - m_sHandler.insert("namespace/memberdecl/membergroups", + m_sHandler.insert("namespace/memberdecl/membergroups", new StartElementHandlerKind(this,LayoutDocEntry::MemberGroups,&LayoutParser::startSimpleEntry)); - m_sHandler.insert("namespace/memberdecl/typedefs", + m_sHandler.insert("namespace/memberdecl/typedefs", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, MemberListType_decTypedefMembers,theTranslator->trTypedefs())); - m_sHandler.insert("namespace/memberdecl/sequences", + m_sHandler.insert("namespace/memberdecl/sequences", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, MemberListType_decSequenceMembers,theTranslator->trSequences())); - m_sHandler.insert("namespace/memberdecl/dictionaries", + m_sHandler.insert("namespace/memberdecl/dictionaries", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, MemberListType_decDictionaryMembers,theTranslator->trDictionaries())); - m_sHandler.insert("namespace/memberdecl/enums", + m_sHandler.insert("namespace/memberdecl/enums", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, MemberListType_decEnumMembers,theTranslator->trEnumerations())); - m_sHandler.insert("namespace/memberdecl/functions", + m_sHandler.insert("namespace/memberdecl/functions", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, MemberListType_decFuncMembers, COMPILE_FOR_2_OPTIONS( @@ -541,89 +541,89 @@ class LayoutParser : public QXmlDefaultHandler SrcLangExt_Fortran,theTranslator->trSubprograms(), SrcLangExt_VHDL,theTranslator->trFunctionAndProc() ))); - m_sHandler.insert("namespace/memberdecl/variables", + m_sHandler.insert("namespace/memberdecl/variables", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, MemberListType_decVarMembers, sliceOpt ? theTranslator->trConstants() : theTranslator->trVariables())); - m_eHandler.insert("namespace/memberdecl", + m_eHandler.insert("namespace/memberdecl", new EndElementHandler(this,&LayoutParser::endMemberDecl)); - m_sHandler.insert("namespace/memberdef", + m_sHandler.insert("namespace/memberdef", new StartElementHandler(this,&LayoutParser::startMemberDef)); - m_sHandler.insert("namespace/memberdef/inlineclasses", + m_sHandler.insert("namespace/memberdef/inlineclasses", new StartElementHandlerSection(this,LayoutDocEntry::NamespaceInlineClasses,&LayoutParser::startSectionEntry, COMPILE_FOR_1_OPTION( theTranslator->trClassDocumentation(), SrcLangExt_Fortran,theTranslator->trTypeDocumentation() ))); - m_sHandler.insert("namespace/memberdef/typedefs", + m_sHandler.insert("namespace/memberdef/typedefs", new StartElementHandlerMember(this,&LayoutParser::startMemberDefEntry, MemberListType_docTypedefMembers,theTranslator->trTypedefDocumentation())); - m_sHandler.insert("namespace/memberdef/sequences", + m_sHandler.insert("namespace/memberdef/sequences", new StartElementHandlerMember(this,&LayoutParser::startMemberDefEntry, MemberListType_docSequenceMembers,theTranslator->trSequenceDocumentation())); - m_sHandler.insert("namespace/memberdef/dictionaries", + m_sHandler.insert("namespace/memberdef/dictionaries", new StartElementHandlerMember(this,&LayoutParser::startMemberDefEntry, MemberListType_docDictionaryMembers, theTranslator->trDictionaryDocumentation())); - m_sHandler.insert("namespace/memberdef/enums", + m_sHandler.insert("namespace/memberdef/enums", new StartElementHandlerMember(this,&LayoutParser::startMemberDefEntry, MemberListType_docEnumMembers,theTranslator->trEnumerationTypeDocumentation())); - m_sHandler.insert("namespace/memberdef/functions", + m_sHandler.insert("namespace/memberdef/functions", new StartElementHandlerMember(this,&LayoutParser::startMemberDefEntry, MemberListType_docFuncMembers, COMPILE_FOR_1_OPTION( theTranslator->trFunctionDocumentation(), SrcLangExt_Fortran,theTranslator->trSubprogramDocumentation() ))); - m_sHandler.insert("namespace/memberdef/variables", + m_sHandler.insert("namespace/memberdef/variables", new StartElementHandlerMember(this,&LayoutParser::startMemberDefEntry, MemberListType_docVarMembers, sliceOpt ? theTranslator->trConstantDocumentation() : theTranslator->trVariableDocumentation())); - m_eHandler.insert("namespace/memberdef", + m_eHandler.insert("namespace/memberdef", new EndElementHandler(this,&LayoutParser::endMemberDef)); - m_eHandler.insert("namespace", + m_eHandler.insert("namespace", new EndElementHandler(this,&LayoutParser::endNamespace)); // file layout handlers - m_sHandler.insert("file", + m_sHandler.insert("file", new StartElementHandler(this,&LayoutParser::startFile)); - m_sHandler.insert("file/briefdescription", + m_sHandler.insert("file/briefdescription", new StartElementHandlerKind(this,LayoutDocEntry::BriefDesc,&LayoutParser::startSimpleEntry)); - m_sHandler.insert("file/detaileddescription", + m_sHandler.insert("file/detaileddescription", new StartElementHandlerSection(this,LayoutDocEntry::DetailedDesc,&LayoutParser::startSectionEntry, theTranslator->trDetailedDescription())); - m_sHandler.insert("file/authorsection", + m_sHandler.insert("file/authorsection", new StartElementHandlerKind(this,LayoutDocEntry::AuthorSection,&LayoutParser::startSimpleEntry)); - m_sHandler.insert("file/includes", + m_sHandler.insert("file/includes", new StartElementHandlerKind(this,LayoutDocEntry::FileIncludes,&LayoutParser::startSimpleEntry)); - m_sHandler.insert("file/includegraph", + m_sHandler.insert("file/includegraph", new StartElementHandlerKind(this,LayoutDocEntry::FileIncludeGraph,&LayoutParser::startSimpleEntry)); - m_sHandler.insert("file/includedbygraph", + m_sHandler.insert("file/includedbygraph", new StartElementHandlerKind(this,LayoutDocEntry::FileIncludedByGraph,&LayoutParser::startSimpleEntry)); - m_sHandler.insert("file/sourcelink", + m_sHandler.insert("file/sourcelink", new StartElementHandlerKind(this,LayoutDocEntry::FileSourceLink,&LayoutParser::startSimpleEntry)); - m_sHandler.insert("file/memberdecl/membergroups", + m_sHandler.insert("file/memberdecl/membergroups", new StartElementHandlerKind(this,LayoutDocEntry::MemberGroups,&LayoutParser::startSimpleEntry)); - m_sHandler.insert("file/memberdecl", + m_sHandler.insert("file/memberdecl", new StartElementHandler(this,&LayoutParser::startMemberDecl)); - m_sHandler.insert("file/memberdecl/interfaces", + m_sHandler.insert("file/memberdecl/interfaces", new StartElementHandlerSection(this,LayoutDocEntry::FileInterfaces,&LayoutParser::startSectionEntry, theTranslator->trSliceInterfaces())); - m_sHandler.insert("file/memberdecl/classes", + m_sHandler.insert("file/memberdecl/classes", new StartElementHandlerSection(this,LayoutDocEntry::FileClasses,&LayoutParser::startSectionEntry, COMPILE_FOR_2_OPTIONS( theTranslator->trCompounds(), SrcLangExt_VHDL,theTranslator->trVhdlType(VhdlDocGen::ENTITY,FALSE), SrcLangExt_Fortran,theTranslator->trDataTypes() ))); - m_sHandler.insert("file/memberdecl/structs", + m_sHandler.insert("file/memberdecl/structs", new StartElementHandlerSection(this,LayoutDocEntry::FileStructs,&LayoutParser::startSectionEntry, theTranslator->trStructs())); - m_sHandler.insert("file/memberdecl/exceptions", + m_sHandler.insert("file/memberdecl/exceptions", new StartElementHandlerSection(this,LayoutDocEntry::FileExceptions,&LayoutParser::startSectionEntry, theTranslator->trExceptions())); - m_sHandler.insert("file/memberdecl/namespaces", + m_sHandler.insert("file/memberdecl/namespaces", new StartElementHandlerSection(this,LayoutDocEntry::FileNamespaces,&LayoutParser::startSectionEntry, COMPILE_FOR_4_OPTIONS( theTranslator->trNamespaces(), @@ -635,22 +635,22 @@ class LayoutParser : public QXmlDefaultHandler m_sHandler.insert("file/memberdecl/constantgroups", new StartElementHandlerSection(this,LayoutDocEntry::FileConstantGroups,&LayoutParser::startSectionEntry, theTranslator->trConstantGroups())); - m_sHandler.insert("file/memberdecl/defines", + m_sHandler.insert("file/memberdecl/defines", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, MemberListType_decDefineMembers,theTranslator->trDefines())); - m_sHandler.insert("file/memberdecl/typedefs", + m_sHandler.insert("file/memberdecl/typedefs", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, MemberListType_decTypedefMembers,theTranslator->trTypedefs())); - m_sHandler.insert("file/memberdecl/sequences", + m_sHandler.insert("file/memberdecl/sequences", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, MemberListType_decSequenceMembers,theTranslator->trSequences())); - m_sHandler.insert("file/memberdecl/dictionaries", + m_sHandler.insert("file/memberdecl/dictionaries", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, MemberListType_decDictionaryMembers,theTranslator->trDictionaries())); - m_sHandler.insert("file/memberdecl/enums", + m_sHandler.insert("file/memberdecl/enums", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, MemberListType_decEnumMembers,theTranslator->trEnumerations())); - m_sHandler.insert("file/memberdecl/functions", + m_sHandler.insert("file/memberdecl/functions", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, MemberListType_decFuncMembers, COMPILE_FOR_2_OPTIONS( @@ -658,115 +658,115 @@ class LayoutParser : public QXmlDefaultHandler SrcLangExt_Fortran,theTranslator->trSubprograms(), SrcLangExt_VHDL,theTranslator->trFunctionAndProc() ))); - m_sHandler.insert("file/memberdecl/variables", + m_sHandler.insert("file/memberdecl/variables", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, MemberListType_decVarMembers, sliceOpt ? theTranslator->trConstants() : theTranslator->trVariables())); - m_eHandler.insert("file/memberdecl", + m_eHandler.insert("file/memberdecl", new EndElementHandler(this,&LayoutParser::endMemberDecl)); - m_sHandler.insert("file/memberdef", + m_sHandler.insert("file/memberdef", new StartElementHandler(this,&LayoutParser::startMemberDef)); - m_sHandler.insert("file/memberdef/inlineclasses", + m_sHandler.insert("file/memberdef/inlineclasses", new StartElementHandlerSection(this,LayoutDocEntry::FileInlineClasses,&LayoutParser::startSectionEntry, COMPILE_FOR_1_OPTION( theTranslator->trClassDocumentation(), SrcLangExt_Fortran,theTranslator->trTypeDocumentation() ))); - m_sHandler.insert("file/memberdef/defines", + m_sHandler.insert("file/memberdef/defines", new StartElementHandlerMember(this,&LayoutParser::startMemberDefEntry, MemberListType_docDefineMembers,theTranslator->trDefineDocumentation())); - m_sHandler.insert("file/memberdef/typedefs", + m_sHandler.insert("file/memberdef/typedefs", new StartElementHandlerMember(this,&LayoutParser::startMemberDefEntry, MemberListType_docTypedefMembers,theTranslator->trTypedefDocumentation())); - m_sHandler.insert("file/memberdef/sequences", + m_sHandler.insert("file/memberdef/sequences", new StartElementHandlerMember(this,&LayoutParser::startMemberDefEntry, MemberListType_docSequenceMembers,theTranslator->trSequenceDocumentation())); - m_sHandler.insert("file/memberdef/dictionaries", + m_sHandler.insert("file/memberdef/dictionaries", new StartElementHandlerMember(this,&LayoutParser::startMemberDefEntry, MemberListType_docDictionaryMembers, theTranslator->trDictionaryDocumentation())); - m_sHandler.insert("file/memberdef/enums", + m_sHandler.insert("file/memberdef/enums", new StartElementHandlerMember(this,&LayoutParser::startMemberDefEntry, MemberListType_docEnumMembers, theTranslator->trEnumerationTypeDocumentation())); - m_sHandler.insert("file/memberdef/functions", + m_sHandler.insert("file/memberdef/functions", new StartElementHandlerMember(this,&LayoutParser::startMemberDefEntry, MemberListType_docFuncMembers, COMPILE_FOR_1_OPTION( theTranslator->trFunctionDocumentation(), SrcLangExt_Fortran,theTranslator->trSubprogramDocumentation() ))); - m_sHandler.insert("file/memberdef/variables", + m_sHandler.insert("file/memberdef/variables", new StartElementHandlerMember(this,&LayoutParser::startMemberDefEntry, MemberListType_docVarMembers,theTranslator->trVariableDocumentation())); - m_eHandler.insert("file/memberdef", + m_eHandler.insert("file/memberdef", new EndElementHandler(this,&LayoutParser::endMemberDef)); - m_eHandler.insert("file", + m_eHandler.insert("file", new EndElementHandler(this,&LayoutParser::endFile)); // group layout handlers - m_sHandler.insert("group", + m_sHandler.insert("group", new StartElementHandler(this,&LayoutParser::startGroup)); - m_sHandler.insert("group/briefdescription", + m_sHandler.insert("group/briefdescription", new StartElementHandlerKind(this,LayoutDocEntry::BriefDesc,&LayoutParser::startSimpleEntry)); - m_sHandler.insert("group/detaileddescription", + m_sHandler.insert("group/detaileddescription", new StartElementHandlerSection(this,LayoutDocEntry::DetailedDesc,&LayoutParser::startSectionEntry, theTranslator->trDetailedDescription())); - m_sHandler.insert("group/authorsection", + m_sHandler.insert("group/authorsection", new StartElementHandlerKind(this,LayoutDocEntry::AuthorSection,&LayoutParser::startSimpleEntry)); - m_sHandler.insert("group/groupgraph", + m_sHandler.insert("group/groupgraph", new StartElementHandlerKind(this,LayoutDocEntry::GroupGraph,&LayoutParser::startSimpleEntry)); - m_sHandler.insert("group/memberdecl/membergroups", + m_sHandler.insert("group/memberdecl/membergroups", new StartElementHandlerKind(this,LayoutDocEntry::MemberGroups,&LayoutParser::startSimpleEntry)); - m_sHandler.insert("group/memberdecl", + m_sHandler.insert("group/memberdecl", new StartElementHandler(this,&LayoutParser::startMemberDecl)); - m_sHandler.insert("group/memberdecl/classes", + m_sHandler.insert("group/memberdecl/classes", new StartElementHandlerSection(this,LayoutDocEntry::GroupClasses,&LayoutParser::startSectionEntry, COMPILE_FOR_2_OPTIONS( theTranslator->trCompounds(), SrcLangExt_VHDL,theTranslator->trVhdlType(VhdlDocGen::ENTITY,FALSE), SrcLangExt_Fortran,theTranslator->trDataTypes() ))); - m_sHandler.insert("group/memberdecl/namespaces", + m_sHandler.insert("group/memberdecl/namespaces", new StartElementHandlerSection(this,LayoutDocEntry::GroupNamespaces,&LayoutParser::startSectionEntry, COMPILE_FOR_2_OPTIONS( theTranslator->trNamespaces(), SrcLangExt_Java,theTranslator->trPackages(), SrcLangExt_Fortran,theTranslator->trModules() ))); - m_sHandler.insert("group/memberdecl/dirs", + m_sHandler.insert("group/memberdecl/dirs", new StartElementHandlerSection(this,LayoutDocEntry::GroupDirs,&LayoutParser::startSectionEntry, theTranslator->trDirectories() )); - m_sHandler.insert("group/memberdecl/nestedgroups", + m_sHandler.insert("group/memberdecl/nestedgroups", new StartElementHandlerSection(this,LayoutDocEntry::GroupNestedGroups,&LayoutParser::startSectionEntry, theTranslator->trModules() )); - m_sHandler.insert("group/memberdecl/files", + m_sHandler.insert("group/memberdecl/files", new StartElementHandlerSection(this,LayoutDocEntry::GroupFiles,&LayoutParser::startSectionEntry, theTranslator->trFile(TRUE,FALSE) )); - m_sHandler.insert("group/memberdecl/defines", + m_sHandler.insert("group/memberdecl/defines", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, MemberListType_decDefineMembers,theTranslator->trDefines())); - m_sHandler.insert("group/memberdecl/typedefs", + m_sHandler.insert("group/memberdecl/typedefs", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, MemberListType_decTypedefMembers,theTranslator->trTypedefs())); - m_sHandler.insert("group/memberdecl/sequences", + m_sHandler.insert("group/memberdecl/sequences", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, MemberListType_decSequenceMembers,theTranslator->trSequences())); - m_sHandler.insert("group/memberdecl/dictionaries", + m_sHandler.insert("group/memberdecl/dictionaries", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, MemberListType_decDictionaryMembers,theTranslator->trDictionaries())); - m_sHandler.insert("group/memberdecl/enums", + m_sHandler.insert("group/memberdecl/enums", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, MemberListType_decEnumMembers,theTranslator->trEnumerations())); - m_sHandler.insert("group/memberdecl/enumvalues", + m_sHandler.insert("group/memberdecl/enumvalues", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, MemberListType_decEnumValMembers,theTranslator->trEnumerationValues())); - m_sHandler.insert("group/memberdecl/functions", + m_sHandler.insert("group/memberdecl/functions", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, MemberListType_decFuncMembers, COMPILE_FOR_2_OPTIONS( @@ -774,116 +774,116 @@ class LayoutParser : public QXmlDefaultHandler SrcLangExt_Fortran,theTranslator->trSubprograms(), SrcLangExt_VHDL,theTranslator->trFunctionAndProc() ))); - m_sHandler.insert("group/memberdecl/variables", + m_sHandler.insert("group/memberdecl/variables", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, MemberListType_decVarMembers,theTranslator->trVariables())); - m_sHandler.insert("group/memberdecl/signals", + m_sHandler.insert("group/memberdecl/signals", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, MemberListType_decSignalMembers,theTranslator->trSignals())); - m_sHandler.insert("group/memberdecl/publicslots", + m_sHandler.insert("group/memberdecl/publicslots", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, MemberListType_decPubSlotMembers,theTranslator->trPublicSlots())); - m_sHandler.insert("group/memberdecl/protectedslots", + m_sHandler.insert("group/memberdecl/protectedslots", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, MemberListType_decProSlotMembers,theTranslator->trProtectedSlots())); - m_sHandler.insert("group/memberdecl/privateslots", + m_sHandler.insert("group/memberdecl/privateslots", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, MemberListType_decPriSlotMembers,theTranslator->trPrivateSlots())); - m_sHandler.insert("group/memberdecl/events", + m_sHandler.insert("group/memberdecl/events", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, MemberListType_decEventMembers,theTranslator->trEvents())); - m_sHandler.insert("group/memberdecl/properties", + m_sHandler.insert("group/memberdecl/properties", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, MemberListType_decPropMembers,theTranslator->trProperties())); - m_sHandler.insert("group/memberdecl/friends", + m_sHandler.insert("group/memberdecl/friends", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, MemberListType_decFriendMembers,theTranslator->trFriends())); - m_eHandler.insert("group/memberdecl", + m_eHandler.insert("group/memberdecl", new EndElementHandler(this,&LayoutParser::endMemberDecl)); - m_sHandler.insert("group/memberdef", + m_sHandler.insert("group/memberdef", new StartElementHandler(this,&LayoutParser::startMemberDef)); - m_sHandler.insert("group/memberdef/pagedocs", + m_sHandler.insert("group/memberdef/pagedocs", new StartElementHandlerKind(this,LayoutDocEntry::GroupPageDocs,&LayoutParser::startSimpleEntry)); - m_sHandler.insert("group/memberdef/inlineclasses", + m_sHandler.insert("group/memberdef/inlineclasses", new StartElementHandlerSection(this,LayoutDocEntry::GroupInlineClasses,&LayoutParser::startSectionEntry, COMPILE_FOR_1_OPTION( theTranslator->trClassDocumentation(), SrcLangExt_Fortran,theTranslator->trTypeDocumentation() ))); - m_sHandler.insert("group/memberdef/defines", + m_sHandler.insert("group/memberdef/defines", new StartElementHandlerMember(this,&LayoutParser::startMemberDefEntry, MemberListType_docDefineMembers,theTranslator->trDefineDocumentation())); - m_sHandler.insert("group/memberdef/typedefs", + m_sHandler.insert("group/memberdef/typedefs", new StartElementHandlerMember(this,&LayoutParser::startMemberDefEntry, MemberListType_docTypedefMembers,theTranslator->trTypedefDocumentation())); - m_sHandler.insert("group/memberdef/sequences", + m_sHandler.insert("group/memberdef/sequences", new StartElementHandlerMember(this,&LayoutParser::startMemberDefEntry, MemberListType_docSequenceMembers,theTranslator->trSequenceDocumentation())); - m_sHandler.insert("group/memberdef/dictionaries", + m_sHandler.insert("group/memberdef/dictionaries", new StartElementHandlerMember(this,&LayoutParser::startMemberDefEntry, MemberListType_docDictionaryMembers, theTranslator->trDictionaryDocumentation())); - m_sHandler.insert("group/memberdef/enums", + m_sHandler.insert("group/memberdef/enums", new StartElementHandlerMember(this,&LayoutParser::startMemberDefEntry, MemberListType_docEnumMembers,theTranslator->trEnumerationTypeDocumentation())); - m_sHandler.insert("group/memberdef/enumvalues", + m_sHandler.insert("group/memberdef/enumvalues", new StartElementHandlerMember(this,&LayoutParser::startMemberDefEntry, MemberListType_docEnumValMembers,theTranslator->trEnumerationValueDocumentation())); - m_sHandler.insert("group/memberdef/functions", + m_sHandler.insert("group/memberdef/functions", new StartElementHandlerMember(this,&LayoutParser::startMemberDefEntry, MemberListType_docFuncMembers, COMPILE_FOR_1_OPTION( theTranslator->trFunctionDocumentation(), SrcLangExt_Fortran,theTranslator->trSubprogramDocumentation() ))); - m_sHandler.insert("group/memberdef/variables", + m_sHandler.insert("group/memberdef/variables", new StartElementHandlerMember(this,&LayoutParser::startMemberDefEntry, MemberListType_docVarMembers,theTranslator->trVariableDocumentation())); - m_sHandler.insert("group/memberdef/signals", + m_sHandler.insert("group/memberdef/signals", new StartElementHandlerMember(this,&LayoutParser::startMemberDefEntry, - MemberListType_docSignalMembers,theTranslator->trSignals())); - m_sHandler.insert("group/memberdef/publicslots", + MemberListType_docSignalMembers,theTranslator->trSignals())); + m_sHandler.insert("group/memberdef/publicslots", new StartElementHandlerMember(this,&LayoutParser::startMemberDefEntry, MemberListType_docPubSlotMembers,theTranslator->trPublicSlots())); - m_sHandler.insert("group/memberdef/protectedslots", + m_sHandler.insert("group/memberdef/protectedslots", new StartElementHandlerMember(this,&LayoutParser::startMemberDefEntry, MemberListType_docProSlotMembers,theTranslator->trProtectedSlots())); - m_sHandler.insert("group/memberdef/privateslots", + m_sHandler.insert("group/memberdef/privateslots", new StartElementHandlerMember(this,&LayoutParser::startMemberDefEntry, MemberListType_docPriSlotMembers,theTranslator->trPrivateSlots())); - m_sHandler.insert("group/memberdef/events", + m_sHandler.insert("group/memberdef/events", new StartElementHandlerMember(this,&LayoutParser::startMemberDefEntry, MemberListType_docEventMembers,theTranslator->trEvents())); - m_sHandler.insert("group/memberdef/properties", + m_sHandler.insert("group/memberdef/properties", new StartElementHandlerMember(this,&LayoutParser::startMemberDefEntry, MemberListType_docPropMembers,theTranslator->trProperties())); - m_sHandler.insert("group/memberdef/friends", + m_sHandler.insert("group/memberdef/friends", new StartElementHandlerMember(this,&LayoutParser::startMemberDefEntry, MemberListType_docFriendMembers,theTranslator->trFriends())); - m_eHandler.insert("group/memberdef", + m_eHandler.insert("group/memberdef", new EndElementHandler(this,&LayoutParser::endMemberDef)); - m_eHandler.insert("group", + m_eHandler.insert("group", new EndElementHandler(this,&LayoutParser::endGroup)); // directory layout handlers - m_sHandler.insert("directory", + m_sHandler.insert("directory", new StartElementHandler(this,&LayoutParser::startDirectory)); - m_sHandler.insert("directory/briefdescription", + m_sHandler.insert("directory/briefdescription", new StartElementHandlerKind(this,LayoutDocEntry::BriefDesc,&LayoutParser::startSimpleEntry)); - m_sHandler.insert("directory/detaileddescription", + m_sHandler.insert("directory/detaileddescription", new StartElementHandlerSection(this,LayoutDocEntry::DetailedDesc,&LayoutParser::startSectionEntry, theTranslator->trDetailedDescription())); - m_sHandler.insert("directory/directorygraph", + m_sHandler.insert("directory/directorygraph", new StartElementHandlerKind(this,LayoutDocEntry::DirGraph,&LayoutParser::startSimpleEntry)); - m_sHandler.insert("directory/memberdecl", + m_sHandler.insert("directory/memberdecl", new StartElementHandler(this,&LayoutParser::startMemberDecl)); - m_sHandler.insert("directory/memberdecl/dirs", + m_sHandler.insert("directory/memberdecl/dirs", new StartElementHandlerKind(this,LayoutDocEntry::DirSubDirs,&LayoutParser::startSimpleEntry)); - m_sHandler.insert("directory/memberdecl/files", + m_sHandler.insert("directory/memberdecl/files", new StartElementHandlerKind(this,LayoutDocEntry::DirFiles,&LayoutParser::startSimpleEntry)); - m_eHandler.insert("directory/memberdecl", + m_eHandler.insert("directory/memberdecl", new EndElementHandler(this,&LayoutParser::endMemberDecl)); - m_eHandler.insert("directory", + m_eHandler.insert("directory", new EndElementHandler(this,&LayoutParser::endDirectory)); } @@ -964,7 +964,7 @@ class LayoutParser : public QXmlDefaultHandler if (m_rootNav && !m_rootNav->find(LayoutNavEntry::MainPage)) { // no MainPage node... add one as the first item of the root node... - new LayoutNavEntry(m_rootNav,LayoutNavEntry::MainPage, TRUE, + new LayoutNavEntry(m_rootNav,LayoutNavEntry::MainPage, TRUE, /*Config_getBool(GENERATE_TREEVIEW) ? "main" :*/ "index", theTranslator->trMainPage(),"",TRUE); } @@ -974,8 +974,8 @@ class LayoutParser : public QXmlDefaultHandler { static bool javaOpt = Config_getBool(OPTIMIZE_OUTPUT_JAVA); static bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN); - static bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL); - static bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE); + static bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL); + static bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE); static bool hasGraphicalHierarchy = Config_getBool(HAVE_DOT) && Config_getBool(GRAPHICAL_HIERARCHY); static bool extractAll = Config_getBool(EXTRACT_ALL); @@ -1213,7 +1213,7 @@ class LayoutParser : public QXmlDefaultHandler } i++; } - if (mapping[i].typeStr==0) + if (mapping[i].typeStr==0) { if (type.isEmpty()) { @@ -1230,7 +1230,7 @@ class LayoutParser : public QXmlDefaultHandler QCString title = attrib.value("title").utf8(); bool isVisible = elemIsVisible(attrib); if (title.isEmpty()) // use default title - { + { title = mapping[i].mainName; // use title for main row if (m_rootNav!=LayoutDocManager::instance().rootNavEntry() && !mapping[i].subName.isEmpty()) { @@ -1384,7 +1384,7 @@ class LayoutParser : public QXmlDefaultHandler } // reimplemented from QXmlDefaultHandler - bool startElement( const QString&, const QString&, + bool startElement( const QString&, const QString&, const QString& name, const QXmlAttributes& attrib ) { //printf("startElement [%s]::[%s]\n",m_scope.data(),name.data()); @@ -1568,7 +1568,7 @@ void writeDefaultLayoutFile(const char *fileName) //---------------------------------------------------------------------------------- // Convert input to a title. -// The format of input can be a simple title "A title" or in case there are different +// The format of input can be a simple title "A title" or in case there are different // titles for some programming languages they can take the following form: // "A title|16=Another title|8=Yet Another title" // where the number is a value of SrcLangExt in decimal notation (i.e. 16=Java, 8=IDL). diff --git a/src/mangen.cpp b/src/mangen.cpp index 6709748..1faa296 100644 --- a/src/mangen.cpp +++ b/src/mangen.cpp @@ -1,12 +1,12 @@ /****************************************************************************** * - * + * * * Copyright (C) 1997-2015 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its - * documentation under the terms of the GNU General Public License is hereby - * granted. No representations are made about the suitability of this software + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software * for any purpose. It is provided "as is" without express or implied warranty. * See the GNU General Public License for more details. * @@ -41,7 +41,7 @@ static QCString getExtension() QCString ext = Config_getString(MAN_EXTENSION); if (ext.isEmpty()) { - ext = "3"; + ext = "3"; } else { @@ -49,7 +49,7 @@ static QCString getExtension() { if (ext.length()==1) { - ext = "3"; + ext = "3"; } else // strip . { @@ -91,8 +91,8 @@ ManGenerator::~ManGenerator() void ManGenerator::init() { - QCString &manOutput = Config_getString(MAN_OUTPUT); - + QCString manOutput = Config_getString(MAN_OUTPUT); + QDir d(manOutput); if (!d.exists() && !d.mkdir(manOutput)) { @@ -139,7 +139,7 @@ static QCString buildFileName(const char *name) } QCString manExtension = "." + getExtension(); - if (fileName.right(manExtension.length())!=manExtension) + if (fileName.right(manExtension.length())!=manExtension) { fileName+=manExtension; } @@ -161,11 +161,11 @@ void ManGenerator::endFile() void ManGenerator::endTitleHead(const char *,const char *name) { - t << ".TH \"" << name << "\" " << getExtension() << " \"" + t << ".TH \"" << name << "\" " << getExtension() << " \"" << dateToString(FALSE) << "\" \""; if (!Config_getString(PROJECT_NUMBER).isEmpty()) t << "Version " << Config_getString(PROJECT_NUMBER) << "\" \""; - if (Config_getString(PROJECT_NAME).isEmpty()) + if (Config_getString(PROJECT_NAME).isEmpty()) t << "Doxygen"; else t << Config_getString(PROJECT_NAME); @@ -284,7 +284,7 @@ void ManGenerator::docify(const char *str) { const char *p=str; char c=0; - while ((c=*p++)) + while ((c=*p++)) { switch(c) { @@ -318,8 +318,8 @@ void ManGenerator::codify(const char *str) case '.': t << "\\&."; break; // see bug652277 case '\t': spacesToNextTabStop = Config_getInt(TAB_SIZE) - (m_col%Config_getInt(TAB_SIZE)); - t << Doxygen::spaces.left(spacesToNextTabStop); - m_col+=spacesToNextTabStop; + t << Doxygen::spaces.left(spacesToNextTabStop); + m_col+=spacesToNextTabStop; break; case '\n': t << "\n"; m_firstCol=TRUE; m_col=0; break; case '\\': t << "\\"; m_col++; break; @@ -346,21 +346,21 @@ void ManGenerator::writeChar(char c) m_paragraph=FALSE; } -void ManGenerator::startDescList(SectionTypes) +void ManGenerator::startDescList(SectionTypes) { - if (!m_firstCol) - { t << endl << ".PP" << endl; - m_firstCol=TRUE; m_paragraph=TRUE; + if (!m_firstCol) + { t << endl << ".PP" << endl; + m_firstCol=TRUE; m_paragraph=TRUE; m_col=0; } m_paragraph=FALSE; startBold(); } -void ManGenerator::startTitle() -{ - if (!m_firstCol) t << endl; - t << ".SH \""; +void ManGenerator::startTitle() +{ + if (!m_firstCol) t << endl; + t << ".SH \""; m_firstCol=FALSE; m_paragraph=FALSE; } @@ -370,40 +370,40 @@ void ManGenerator::endTitle() t << "\""; } -void ManGenerator::startItemListItem() -{ - if (!m_firstCol) t << endl; - t << ".TP" << endl; +void ManGenerator::startItemListItem() +{ + if (!m_firstCol) t << endl; + t << ".TP" << endl; m_firstCol=TRUE; m_paragraph=FALSE; m_col=0; -} +} void ManGenerator::endItemListItem() { } -void ManGenerator::startCodeFragment() -{ +void ManGenerator::startCodeFragment() +{ newParagraph(); - t << ".nf" << endl; + t << ".nf" << endl; m_firstCol=TRUE; m_paragraph=FALSE; } -void ManGenerator::endCodeFragment() -{ +void ManGenerator::endCodeFragment() +{ if (!m_firstCol) t << endl; - t << ".fi" << endl; + t << ".fi" << endl; m_firstCol=TRUE; m_paragraph=FALSE; m_col=0; } -void ManGenerator::startMemberDoc(const char *,const char *,const char *,const char *,int,int,bool) -{ +void ManGenerator::startMemberDoc(const char *,const char *,const char *,const char *,int,int,bool) +{ if (!m_firstCol) t << endl; - t << ".SS \""; + t << ".SS \""; m_firstCol=FALSE; m_paragraph=FALSE; } @@ -413,7 +413,7 @@ void ManGenerator::startDoxyAnchor(const char *,const char *manName, const char *) { // something to be done? - if( !Config_getBool(MAN_LINKS) ) + if( !Config_getBool(MAN_LINKS) ) { return; // no } @@ -426,14 +426,14 @@ void ManGenerator::startDoxyAnchor(const char *,const char *manName, //printf("Converting man link '%s'->'%s'->'%s'\n", // name,baseName.data(),buildFileName(baseName).data()); - + // - remove dangerous characters and append suffix, then add dir prefix QCString fileName=m_dir+"/"+buildFileName( baseName ); QFile linkfile( fileName ); // - only create file if it doesn't exist already - if ( !linkfile.open( IO_ReadOnly ) ) + if ( !linkfile.open( IO_ReadOnly ) ) { - if ( linkfile.open( IO_WriteOnly ) ) + if ( linkfile.open( IO_WriteOnly ) ) { FTextStream linkstream; linkstream.setDevice(&linkfile); @@ -449,10 +449,10 @@ void ManGenerator::endMemberDoc(bool) t << "\"\n"; } -void ManGenerator::startSubsection() -{ +void ManGenerator::startSubsection() +{ if (!m_firstCol) t << endl; - t << ".SS \""; + t << ".SS \""; m_firstCol=FALSE; m_paragraph=FALSE; } @@ -463,10 +463,10 @@ void ManGenerator::endSubsection() } -void ManGenerator::startSubsubsection() -{ +void ManGenerator::startSubsubsection() +{ if (!m_firstCol) t << endl; - t << "\n.SS \""; + t << "\n.SS \""; m_firstCol=FALSE; m_paragraph=FALSE; } @@ -476,10 +476,10 @@ void ManGenerator::endSubsubsection() t << "\""; } -void ManGenerator::writeSynopsis() -{ +void ManGenerator::writeSynopsis() +{ if (!m_firstCol) t << endl; - t << ".SH SYNOPSIS\n.br\n.PP\n"; + t << ".SH SYNOPSIS\n.br\n.PP\n"; m_firstCol=TRUE; m_paragraph=FALSE; } @@ -534,31 +534,31 @@ void ManGenerator::endAnonTypeScope(int indentLevel) } -void ManGenerator::startMemberItem(const char *,int,const char *) -{ +void ManGenerator::startMemberItem(const char *,int,const char *) +{ if (m_firstCol && !m_insideTabbing) t << ".in +1c\n"; - t << "\n.ti -1c\n.RI \""; + t << "\n.ti -1c\n.RI \""; m_firstCol=FALSE; } -void ManGenerator::endMemberItem() -{ - t << "\"\n.br"; +void ManGenerator::endMemberItem() +{ + t << "\"\n.br"; } -void ManGenerator::startMemberList() -{ +void ManGenerator::startMemberList() +{ if (!m_insideTabbing) { - t << "\n.in +1c"; m_firstCol=FALSE; + t << "\n.in +1c"; m_firstCol=FALSE; } } -void ManGenerator::endMemberList() -{ +void ManGenerator::endMemberList() +{ if (!m_insideTabbing) { - t << "\n.in -1c"; m_firstCol=FALSE; + t << "\n.in -1c"; m_firstCol=FALSE; } } @@ -595,7 +595,7 @@ void ManGenerator::endMemberGroup(bool) void ManGenerator::startSection(const char *,const char *,SectionType type) { - if( !m_inHeader ) + if( !m_inHeader ) { switch(type) { @@ -634,9 +634,9 @@ void ManGenerator::endSection(const char *,SectionType type) void ManGenerator::startExamples() { - if (!m_firstCol) - { t << endl << ".PP" << endl; - m_firstCol=TRUE; m_paragraph=TRUE; + if (!m_firstCol) + { t << endl << ".PP" << endl; + m_firstCol=TRUE; m_paragraph=TRUE; m_col=0; } m_paragraph=FALSE; @@ -652,9 +652,9 @@ void ManGenerator::endExamples() void ManGenerator::startDescTable(const char *title) { - if (!m_firstCol) - { t << endl << ".PP" << endl; - m_firstCol=TRUE; m_paragraph=TRUE; + if (!m_firstCol) + { t << endl << ".PP" << endl; + m_firstCol=TRUE; m_paragraph=TRUE; m_col=0; } m_paragraph=FALSE; @@ -672,9 +672,9 @@ void ManGenerator::endDescTable() void ManGenerator::startParamList(ParamListTypes,const char *title) { - if (!m_firstCol) - { t << endl << ".PP" << endl; - m_firstCol=TRUE; m_paragraph=TRUE; + if (!m_firstCol) + { t << endl << ".PP" << endl; + m_firstCol=TRUE; m_paragraph=TRUE; m_col=0; } m_paragraph=FALSE; @@ -692,16 +692,16 @@ void ManGenerator::writeDoc(DocNode *n,const Definition *ctx,const MemberDef *) { ManDocVisitor *visitor = new ManDocVisitor(t,*this,ctx?ctx->getDefFileExtension():QCString("")); n->accept(visitor); - delete visitor; + delete visitor; m_firstCol=FALSE; m_paragraph = FALSE; } void ManGenerator::startConstraintList(const char *header) { - if (!m_firstCol) - { t << endl << ".PP" << endl; - m_firstCol=TRUE; m_paragraph=TRUE; + if (!m_firstCol) + { t << endl << ".PP" << endl; + m_firstCol=TRUE; m_paragraph=TRUE; m_col=0; } m_paragraph=FALSE; @@ -748,16 +748,16 @@ void ManGenerator::endConstraintList() } -void ManGenerator::startInlineHeader() +void ManGenerator::startInlineHeader() { - if (!m_firstCol) + if (!m_firstCol) { t << endl << ".PP" << endl << ".in -1c" << endl; } - t << ".RI \"\\fB"; + t << ".RI \"\\fB"; } -void ManGenerator::endInlineHeader() +void ManGenerator::endInlineHeader() { t << "\\fP\"" << endl << ".in +1c" << endl; m_firstCol = FALSE; @@ -765,7 +765,7 @@ void ManGenerator::endInlineHeader() void ManGenerator::startMemberDocSimple(bool isEnum) { - if (!m_firstCol) + if (!m_firstCol) { t << endl << ".PP" << endl; } diff --git a/src/plantuml.cpp b/src/plantuml.cpp index 2e172ac..d020da0 100644 --- a/src/plantuml.cpp +++ b/src/plantuml.cpp @@ -208,21 +208,23 @@ static void runPlantumlContent(const QDict< QList > &plantumlFiles, QCString pumlType = ""; QCString pumlOutDir = ""; - QStrList &pumlIncludePathList = Config_getList(PLANTUML_INCLUDE_PATH); - char *s=pumlIncludePathList.first(); - if (s) + const StringVector &pumlIncludePathList = Config_getList(PLANTUML_INCLUDE_PATH); { - pumlArgs += "-Dplantuml.include.path=\""; - pumlArgs += s; - s = pumlIncludePathList.next(); - } - while (s) - { - pumlArgs += Portable::pathListSeparator(); - pumlArgs += s; - s = pumlIncludePathList.next(); + auto it = pumlIncludePathList.begin(); + if (it!=pumlIncludePathList.end()) + { + pumlArgs += "-Dplantuml.include.path=\""; + pumlArgs += it->c_str(); + ++it; + } + while (it!=pumlIncludePathList.end()) + { + pumlArgs += Portable::pathListSeparator(); + pumlArgs += it->c_str(); + ++it; + } } - if (pumlIncludePathList.first()) pumlArgs += "\" "; + if (!pumlIncludePathList.empty()) pumlArgs += "\" "; pumlArgs += "-Djava.awt.headless=true -jar \""+plantumlJarPath+"plantuml.jar\" "; if (!plantumlConfigFile.isEmpty()) { diff --git a/src/pre.l b/src/pre.l index 5981147..b78908f 100644 --- a/src/pre.l +++ b/src/pre.l @@ -1796,8 +1796,8 @@ static FileState *checkAndOpenFile(yyscan_t yyscanner,const QCString &fileName,b QFileInfo fi(fileName); if (fi.exists() && fi.isFile()) { - const QStrList &exclPatterns = Config_getList(EXCLUDE_PATTERNS); - if (patternMatch(fi,&exclPatterns)) return 0; + const StringVector &exclPatterns = Config_getList(EXCLUDE_PATTERNS); + if (patternMatch(fi,exclPatterns)) return 0; QCString absName = fi.absFilePath().utf8(); @@ -2918,11 +2918,10 @@ static void readIncludeFile(yyscan_t yyscanner,const QCString &inc) } else if (searchIncludes) // search in INCLUDE_PATH as well { - QStrList &includePath = Config_getList(INCLUDE_PATH); - char *incPath=includePath.first(); - while (incPath) + const StringVector &includePath = Config_getList(INCLUDE_PATH); + for (const auto &incPath : includePath) { - QFileInfo fi3(incPath); + QFileInfo fi3(incPath.c_str()); if (fi3.exists() && fi3.isDir()) { absName = QCString(fi3.absFilePath().utf8())+"/"+incFileName; @@ -2935,7 +2934,6 @@ static void readIncludeFile(yyscan_t yyscanner,const QCString &inc) } //printf( "absIncFileName = %s\n", absIncFileName.data() ); } - incPath=includePath.next(); } } //printf( "absIncFileName = %s\n", absIncFileName.data() ); @@ -3191,12 +3189,10 @@ static void initPredefined(yyscan_t yyscanner,const char *fileName) YY_EXTRA_TYPE state = preYYget_extra(yyscanner); // add predefined macros - char *defStr; - QStrList &predefList = Config_getList(PREDEFINED); - QStrListIterator sli(predefList); - for (sli.toFirst();(defStr=sli.current());++sli) + const StringVector &predefList = Config_getList(PREDEFINED); + for (const auto &defStr : predefList) { - QCString ds = defStr; + QCString ds = defStr.c_str(); int i_equals=ds.find('='); int i_obrace=ds.find('('); int i_cbrace=ds.find(')'); diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp index ecf2d32..9d0a957 100644 --- a/src/rtfgen.cpp +++ b/src/rtfgen.cpp @@ -186,14 +186,14 @@ void RTFGenerator::init() } // overwrite some (or all) definitions from file - QCString &rtfStyleSheetFile = Config_getString(RTF_STYLESHEET_FILE); + QCString rtfStyleSheetFile = Config_getString(RTF_STYLESHEET_FILE); if (!rtfStyleSheetFile.isEmpty()) { loadStylesheet(rtfStyleSheetFile, rtf_Style); } // If user has defined an extension file, load its contents. - QCString &rtfExtensionsFile = Config_getString(RTF_EXTENSIONS_FILE); + QCString rtfExtensionsFile = Config_getString(RTF_EXTENSIONS_FILE); if (!rtfExtensionsFile.isEmpty()) { loadExtensions(rtfExtensionsFile); diff --git a/src/util.cpp b/src/util.cpp index 86435fa..7006f26 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -277,22 +277,20 @@ QCString generateMarker(int id) return result; } -static QCString stripFromPath(const QCString &path,QStrList &l) +static QCString stripFromPath(const QCString &path,const StringVector &l) { // look at all the strings in the list and strip the longest match - const char *s=l.first(); QCString potential; unsigned int length = 0; - while (s) + for (const auto &s : l) { - QCString prefix = s; + QCString prefix = s.c_str(); if (prefix.length() > length && qstricmp(path.left(prefix.length()),prefix)==0) // case insensitive compare { length = prefix.length(); potential = path.right(path.length()-prefix.length()); } - s = l.next(); } if (length) return potential; return path; @@ -2377,15 +2375,13 @@ int filterCRLF(char *buf,int len) return dest; // length of the valid part of the buf } -static QCString getFilterFromList(const char *name,const QStrList &filterList,bool &found) +static QCString getFilterFromList(const char *name,const StringVector &filterList,bool &found) { found=FALSE; // compare the file name to the filter pattern list - QStrListIterator sli(filterList); - char* filterStr; - for (sli.toFirst(); (filterStr = sli.current()); ++sli) + for (const auto &filterStr : filterList) { - QCString fs = filterStr; + QCString fs = filterStr.c_str(); int i_equals=fs.find('='); if (i_equals!=-1) { @@ -2419,12 +2415,12 @@ QCString getFileFilter(const char* name,bool isSourceCode) // sanity check if (name==0) return ""; - QStrList& filterSrcList = Config_getList(FILTER_SOURCE_PATTERNS); - QStrList& filterList = Config_getList(FILTER_PATTERNS); + const StringVector& filterSrcList = Config_getList(FILTER_SOURCE_PATTERNS); + const StringVector& filterList = Config_getList(FILTER_PATTERNS); QCString filterName; bool found=FALSE; - if (isSourceCode && !filterSrcList.isEmpty()) + if (isSourceCode && !filterSrcList.empty()) { // first look for source filter pattern list filterName = getFilterFromList(name,filterSrcList,found); } @@ -4633,11 +4629,10 @@ QCString substituteKeywords(const QCString &s,const char *title, int getPrefixIndex(const QCString &name) { if (name.isEmpty()) return 0; - static QStrList &sl = Config_getList(IGNORE_PREFIX); - char *s = sl.first(); - while (s) + const StringVector &sl = Config_getList(IGNORE_PREFIX); + for (const auto &s : sl) { - const char *ps=s; + const char *ps=s.c_str(); const char *pd=name.data(); int i=0; while (*ps!=0 && *pd!=0 && *ps==*pd) ps++,pd++,i++; @@ -4645,7 +4640,6 @@ int getPrefixIndex(const QCString &name) { return i; } - s = sl.next(); } return 0; } @@ -7506,7 +7500,7 @@ QCString filterTitle(const QCString &title) // returns TRUE if the name of the file represented by 'fi' matches // one of the file patterns in the 'patList' list. -bool patternMatch(const QFileInfo &fi,const QStrList *patList) +bool patternMatch(const QFileInfo &fi,const StringVector &patList) { static bool caseSenseNames = Config_getBool(CASE_SENSE_NAMES); bool found = FALSE; @@ -7517,17 +7511,15 @@ bool patternMatch(const QFileInfo &fi,const QStrList *patList) caseSenseNames = FALSE; } - if (patList) + if (!patList.empty()) { - QStrListIterator it(*patList); - QCString pattern; - QCString fn = fi.fileName().data(); QCString fp = fi.filePath().data(); QCString afp= fi.absFilePath().data(); - for (it.toFirst();(pattern=it.current());++it) + for (const auto &pat: patList) { + QCString pattern = pat.c_str(); if (!pattern.isEmpty()) { int i=pattern.find('='); @@ -8368,18 +8360,16 @@ bool openOutputFile(const char *outFile,QFile &f) void writeExtraLatexPackages(FTextStream &t) { // User-specified packages - QStrList &extraPackages = Config_getList(EXTRA_PACKAGES); - if (!extraPackages.isEmpty()) + const StringVector &extraPackages = Config_getList(EXTRA_PACKAGES); + if (!extraPackages.empty()) { t << "% Packages requested by user\n"; - const char *pkgName=extraPackages.first(); - while (pkgName) + for (const auto &pkgName : extraPackages) { if ((pkgName[0] == '[') || (pkgName[0] == '{')) - t << "\\usepackage" << pkgName << "\n"; + t << "\\usepackage" << pkgName.c_str() << "\n"; else - t << "\\usepackage{" << pkgName << "}\n"; - pkgName=extraPackages.next(); + t << "\\usepackage{" << pkgName.c_str() << "}\n"; } t << "\n"; } diff --git a/src/util.h b/src/util.h index e49a807..a93220c 100644 --- a/src/util.h +++ b/src/util.h @@ -31,6 +31,7 @@ #include "docparser.h" #include "classdef.h" #include "arguments.h" +#include "containers.h" //-------------------------------------------------------------------- @@ -436,7 +437,7 @@ bool readInputFile(const char *fileName,BufStr &inBuf, bool filter=TRUE,bool isSourceCode=FALSE); QCString filterTitle(const QCString &title); -bool patternMatch(const QFileInfo &fi,const QStrList *patList); +bool patternMatch(const QFileInfo &fi,const StringVector &patList); QCString externalLinkTarget(const bool parent = false); QCString externalRef(const QCString &relPath,const QCString &ref,bool href); diff --git a/src/vhdldocgen.cpp b/src/vhdldocgen.cpp index 9a48e14..3f63cf0 100644 --- a/src/vhdldocgen.cpp +++ b/src/vhdldocgen.cpp @@ -3524,12 +3524,11 @@ void FlowChart::printUmlTree() } qcs+="\n"; - QCString & htmlOutDir = Config_getString(HTML_OUTPUT); + QCString htmlOutDir = Config_getString(HTML_OUTPUT); QCString n=convertNameToFileName(); - QCString tmp=htmlOutDir; - n=PlantumlManager::instance()->writePlantUMLSource(tmp,n,qcs,PlantumlManager::PUML_SVG); - PlantumlManager::instance()->generatePlantUMLOutput(n.data(),tmp.data(),PlantumlManager::PUML_SVG); + n=PlantumlManager::instance()->writePlantUMLSource(htmlOutDir,n,qcs,PlantumlManager::PUML_SVG); + PlantumlManager::instance()->generatePlantUMLOutput(n,htmlOutDir,PlantumlManager::PUML_SVG); } QCString FlowChart::convertNameToFileName() -- cgit v0.12 From f49f1c8cdd9babbbe0350c9ad3d3a3e92244085e Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Fri, 5 Jun 2020 21:24:10 +0200 Subject: Issue #7831: Error building docs after 0df1623c9363d52a2b04457233dcf2c64319b03c --- src/config.h | 1 - src/doxygen.cpp | 47 +++++++++++++++++++++++++++++------------------ 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/src/config.h b/src/config.h index 845a369..31be3a1 100644 --- a/src/config.h +++ b/src/config.h @@ -41,7 +41,6 @@ class FTextStream; #define Config_updateInt(name,value) (ConfigValues::instance().update_##name(value)); #define Config_updateEnum(name,value) (ConfigValues::instance().update_##name(value)); #define Config_updateList(name,...) (ConfigValues::instance().update_##name(__VA_ARGS__)); -#define Config_setterFunc(name) (std::bind(&ConfigValues::update_##name,ConfigValues::instance(),std::placeholders::_1)) //#endif //! @} diff --git a/src/doxygen.cpp b/src/doxygen.cpp index ddaa3f1..344ec7b 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -10479,20 +10479,16 @@ static void exitDoxygen() static QCString createOutputDirectory(const QCString &baseDirName, const QCString &formatDirName, - const char *defaultDirName, - std::function updateConfig) + const char *defaultDirName) { QCString result = formatDirName; - // Note the & on the next line, we modify the formatDirOption! if (result.isEmpty()) { result = baseDirName + defaultDirName; - updateConfig(result); } else if (formatDirName[0]!='/' && (formatDirName.length()==1 || formatDirName[1]!=':')) { result.prepend(baseDirName+'/'); - updateConfig(result); } QDir formatDir(result); if (!formatDir.exists() && !formatDir.mkdir(result)) @@ -10771,43 +10767,58 @@ void parseInput() QCString htmlOutput; bool generateHtml = Config_getBool(GENERATE_HTML); if (generateHtml || g_useOutputTemplate /* TODO: temp hack */) - htmlOutput = createOutputDirectory(outputDirectory,Config_getString(HTML_OUTPUT), - "/html",Config_setterFunc(HTML_OUTPUT)); + { + htmlOutput = createOutputDirectory(outputDirectory,Config_getString(HTML_OUTPUT),"/html"); + Config_updateString(HTML_OUTPUT,htmlOutput); + } QCString docbookOutput; bool generateDocbook = Config_getBool(GENERATE_DOCBOOK); if (generateDocbook) - docbookOutput = createOutputDirectory(outputDirectory,Config_getString(DOCBOOK_OUTPUT), - "/docbook",Config_setterFunc(DOCBOOK_OUTPUT)); + { + docbookOutput = createOutputDirectory(outputDirectory,Config_getString(DOCBOOK_OUTPUT),"/docbook"); + Config_updateString(DOCBOOK_OUTPUT,docbookOutput); + } QCString xmlOutput; bool generateXml = Config_getBool(GENERATE_XML); if (generateXml) - xmlOutput = createOutputDirectory(outputDirectory,Config_getString(XML_OUTPUT), - "/xml",Config_setterFunc(XML_OUTPUT)); + { + xmlOutput = createOutputDirectory(outputDirectory,Config_getString(XML_OUTPUT),"/xml"); + Config_updateString(XML_OUTPUT,xmlOutput); + } QCString latexOutput; bool generateLatex = Config_getBool(GENERATE_LATEX); if (generateLatex) - latexOutput = createOutputDirectory(outputDirectory,Config_getString(LATEX_OUTPUT), - "/latex",Config_setterFunc(LATEX_OUTPUT)); + { + latexOutput = createOutputDirectory(outputDirectory,Config_getString(LATEX_OUTPUT), "/latex"); + Config_updateString(LATEX_OUTPUT,latexOutput); + } QCString rtfOutput; bool generateRtf = Config_getBool(GENERATE_RTF); if (generateRtf) - rtfOutput = createOutputDirectory(outputDirectory,Config_getString(RTF_OUTPUT), - "/rtf",Config_setterFunc(RTF_OUTPUT)); + { + rtfOutput = createOutputDirectory(outputDirectory,Config_getString(RTF_OUTPUT),"/rtf"); + Config_updateString(RTF_OUTPUT,rtfOutput); + } QCString manOutput; bool generateMan = Config_getBool(GENERATE_MAN); if (generateMan) - manOutput = createOutputDirectory(outputDirectory,Config_getString(MAN_OUTPUT), - "/man",Config_setterFunc(MAN_OUTPUT)); + { + manOutput = createOutputDirectory(outputDirectory,Config_getString(MAN_OUTPUT),"/man"); + Config_updateString(MAN_OUTPUT,manOutput); + } //QCString sqlOutput; //bool &generateSql = Config_getBool(GENERATE_SQLITE3); //if (generateSql) - // sqlOutput = createOutputDirectory(outputDirectory,"SQLITE3_OUTPUT","/sqlite3"); + //{ + // sqlOutput = createOutputDirectory(outputDirectory,Config_getString(SQLITE3_OUTPUT),"/sqlite3"); + // Config_update(SQLITE3_OUTPUT,sqlOutput); + //} if (Config_getBool(HAVE_DOT)) { -- cgit v0.12 From c0dcee7cdcc5d7841d050682a35ccf59dc668fcb Mon Sep 17 00:00:00 2001 From: albert-github Date: Sat, 6 Jun 2020 13:22:04 +0200 Subject: issue #7833 Empty string in PREDEFINED throws Ignore empty strings --- src/configimpl.l | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/configimpl.l b/src/configimpl.l index 9cea61b..57e7c78 100644 --- a/src/configimpl.l +++ b/src/configimpl.l @@ -1102,7 +1102,7 @@ static void substEnvVarsInStrList(StringVector &sl) } else // just goto the next element in the list { - results.push_back(result.data()); + if (!result.isEmpty()) results.push_back(result.data()); } } sl = results; -- cgit v0.12 From b42789d09fd8a81a40c0f13ba2c024b7eec71d92 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Sat, 6 Jun 2020 13:38:02 +0200 Subject: Fixed compilation issue on Windows for setNum with size_t argument --- src/cite.cpp | 2 +- src/index.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cite.cpp b/src/cite.cpp index 7b6452e..4adf6f2 100644 --- a/src/cite.cpp +++ b/src/cite.cpp @@ -333,7 +333,7 @@ void CitationManager::generatePage() // so no problem. for (size_t j = 1; j <= citeDataList.size(); j++) { - thisDir.remove(bibOutputDir + bibTmpFile + QCString().setNum(j) + ".bib"); + thisDir.remove(bibOutputDir + bibTmpFile + QCString().setNum(static_cast(j)) + ".bib"); } thisDir.rmdir(bibOutputDir); } diff --git a/src/index.cpp b/src/index.cpp index 54fa90b..04d6ce4 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -3988,7 +3988,7 @@ static void writeGroupTreeNode(OutputList &ol, GroupDef *gd, int level, FTVHelp* numSubItems += gd->getNamespaces()->count(); numSubItems += gd->getClasses()->count(); numSubItems += gd->getFiles()->count(); - numSubItems += gd->getDirs().size(); + numSubItems += static_cast(gd->getDirs().size()); numSubItems += gd->getPages()->count(); } -- cgit v0.12 From 2a0e9798c552e7ce526ed9e6678ea938033faa65 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Sat, 6 Jun 2020 13:43:15 +0200 Subject: Prevent potential empty string --- src/configimpl.l | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/configimpl.l b/src/configimpl.l index 57e7c78..9eda61d 100644 --- a/src/configimpl.l +++ b/src/configimpl.l @@ -1090,7 +1090,7 @@ static void substEnvVarsInStrList(StringVector &sl) } else if (c==' ' || c=='\t') // separator { - results.push_back(result.mid(p,i-p).data()); + if (i>p) results.push_back(result.mid(p,i-p).data()); p=i+1; } } -- cgit v0.12 From 73c460247af61dd37fb092a9dd4e647edcd8cbfa Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Sat, 6 Jun 2020 14:57:58 +0200 Subject: Minor documentation updates --- doc/CMakeLists.txt | 2 +- doc/arch.doc | 110 ++++----- doc/archoverview.gif | Bin 7822 -> 0 bytes doc/archoverview.svg | 625 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/install.doc | 24 +- 5 files changed, 697 insertions(+), 64 deletions(-) delete mode 100644 doc/archoverview.gif create mode 100644 doc/archoverview.svg diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 032c16a..537089b 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -32,7 +32,7 @@ set(DOC_INSTALL_DIR "share/doc/packages/doxygen" CACHE STRING "Relative path whe set(DOC_FILES arch.doc archoverview.eps - archoverview.gif + archoverview.svg autolink.doc changelog.doc commands.doc diff --git a/doc/arch.doc b/doc/arch.doc index bd51a1b..104b3e3 100644 --- a/doc/arch.doc +++ b/doc/arch.doc @@ -1,12 +1,12 @@ /****************************************************************************** * - * + * * * Copyright (C) 1997-2015 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its - * documentation under the terms of the GNU General Public License is hereby - * granted. No representations are made about the suitability of this software + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software * for any purpose. It is provided "as is" without express or implied warranty. * See the GNU General Public License for more details. * @@ -22,7 +22,7 @@ The following picture shows how source files are processed by doxygen. -\image html archoverview.gif "Data flow overview" +\image html archoverview.svg "Data flow overview" \image latex archoverview.eps "Data flow overview" width=14cm The following sections explain the steps above in more detail. @@ -30,20 +30,20 @@ The following sections explain the steps above in more detail.

    Config parser

    The configuration file that controls the settings of a project is parsed -and the settings are stored in the singleton class \c Config -in src/config.h. The parser itself is written using \c flex -and can be found in src/config.l. This parser is also used +and the settings are stored in the singleton class \c Config +in src/config.h. The parser itself is written using \c flex +and can be found in src/config.l. This parser is also used directly by \c doxywizard, so it is put in a separate library. -Each configuration option has one of 5 possible types: \c String, +Each configuration option has one of 5 possible types: \c String, \c List, \c Enum, \c Int, or \c Bool. The values of these options are available through the global functions \c Config_getXXX(), where \c XXX is the type of the option. The argument of these function is a string naming -the option as it appears in the configuration file. For instance: +the option as it appears in the configuration file. For instance: \c Config_getBool("GENERATE_TESTLIST") returns a reference to a boolean -value that is \c TRUE if the test list was enabled in the configuration file. +value that is \c TRUE if the test list was enabled in the configuration file. -The function \c readConfiguration() in \c src/doxygen.cpp +The function \c readConfiguration() in \c src/doxygen.cpp reads the command line options and then calls the configuration parser.

    C Preprocessor

    @@ -54,29 +54,29 @@ C Preprocessor (after being piped through a user defined filter if available). The way the preprocessor works differs somewhat from a standard C Preprocessor. By default it does not do macro expansion, although it can be configured to expand all macros. Typical usage is to only expand a user specified set -of macros. This is to allow macro names to appear in the type of +of macros. This is to allow macro names to appear in the type of function parameters for instance. -Another difference is that the preprocessor parses, but not actually includes +Another difference is that the preprocessor parses, but not actually includes code when it encounters a \c \#include (with the exception of \c \#include -found inside { ... } blocks). The reasons behind this deviation from -the standard is to prevent feeding multiple definitions of the -same functions/classes to doxygen's parser. If all source files would -include a common header file for instance, the class and type -definitions (and their documentation) would be present in each -translation unit. +found inside { ... } blocks). The reasons behind this deviation from +the standard is to prevent feeding multiple definitions of the +same functions/classes to doxygen's parser. If all source files would +include a common header file for instance, the class and type +definitions (and their documentation) would be present in each +translation unit. The preprocessor is written using \c flex and can be found in -\c src/pre.l. For condition blocks (\c \#if) evaluation of constant expressions -is needed. For this a \c yacc based parser is used, which can be found +\c src/pre.l. For condition blocks (\c \#if) evaluation of constant expressions +is needed. For this a \c yacc based parser is used, which can be found in \c src/constexp.y and \c src/constexp.l. -The preprocessor is invoked for each file using the \c preprocessFile() -function declared in \c src/pre.h, and will append the preprocessed result +The preprocessor is invoked for each file using the \c preprocessFile() +function declared in \c src/pre.h, and will append the preprocessed result to a character buffer. The format of the character buffer is \verbatim -0x06 file name 1 +0x06 file name 1 0x06 preprocessed contents of file 1 ... 0x06 file name n @@ -85,17 +85,17 @@ to a character buffer. The format of the character buffer is

    Language parser

    -The preprocessed input buffer is fed to the language parser, which is -implemented as a big state machine using \c flex. It can be found -in the file \c src/scanner.l. There is one parser for all -languages (C/C++/Java/IDL). The state variables \c insideIDL -and \c insideJava are uses at some places for language specific choices. +The preprocessed input buffer is fed to the language parser, which is +implemented as a big state machine using \c flex. It can be found +in the file \c src/scanner.l. There is one parser for all +languages (C/C++/Java/IDL). The state variables \c insideIDL +and \c insideJava are uses at some places for language specific choices. -The task of the parser is to convert the input buffer into a tree of entries -(basically an abstract syntax tree). An entry is defined in \c src/entry.h -and is a blob of loosely structured information. The most important field +The task of the parser is to convert the input buffer into a tree of entries +(basically an abstract syntax tree). An entry is defined in \c src/entry.h +and is a blob of loosely structured information. The most important field is \c section which specifies the kind of information contained in the entry. - + Possible improvements for future versions: - Use one scanner/parser per language instead of one big scanner. - Move the first pass parsing of documentation blocks to a separate module. @@ -104,8 +104,8 @@ Possible improvements for future versions:

    Data organizer

    -This step consists of many smaller steps, that build -dictionaries of the extracted classes, files, namespaces, +This step consists of many smaller steps, that build +dictionaries of the extracted classes, files, namespaces, variables, functions, packages, pages, and groups. Besides building dictionaries, during this step relations (such as inheritance relations), between the extracted entities are computed. @@ -117,15 +117,15 @@ on the tree of entries, built during language parsing. Look at the The result of this step is a number of dictionaries, which can be found in the doxygen "namespace" defined in \c src/doxygen.h. Most elements of these dictionaries are derived from the class \c Definition; -The class \c MemberDef, for instance, holds all information for a member. -An instance of such a class can be part of a file ( class \c FileDef ), -a class ( class \c ClassDef ), a namespace ( class \c NamespaceDef ), +The class \c MemberDef, for instance, holds all information for a member. +An instance of such a class can be part of a file ( class \c FileDef ), +a class ( class \c ClassDef ), a namespace ( class \c NamespaceDef ), a group ( class \c GroupDef ), or a Java package ( class \c PackageDef ).

    Tag file parser

    If tag files are specified in the configuration file, these are parsed -by a SAX based XML parser, which can be found in \c src/tagreader.cpp. +by a SAX based XML parser, which can be found in \c src/tagreader.cpp. The result of parsing a tag file is the insertion of \c Entry objects in the entry tree. The field \c Entry::tagInfo is used to mark the entry as external, and holds information about the tag file. @@ -136,7 +136,7 @@ Special comment blocks are stored as strings in the entities that they document. There is a string for the brief description and a string for the detailed description. The documentation parser reads these strings and executes the commands it finds in it (this is the second pass -in parsing the documentation). It writes the result directly to the output +in parsing the documentation). It writes the result directly to the output generators. The parser is written in C++ and can be found in \c src/docparser.cpp. The @@ -144,7 +144,7 @@ tokens that are eaten by the parser come from \c src/doctokenizer.l. Code fragments found in the comment blocks are passed on to the source parser. The main entry point for the documentation parser is \c validatingParseDoc() -declared in \c src/docparser.h. For simple texts with special +declared in \c src/docparser.h. For simple texts with special commands \c validatingParseText() is used.

    Source parser

    @@ -156,13 +156,13 @@ The code parser tries to cross-reference to source code it parses with documented entities. It also does syntax highlighting of the sources. The output is directly written to the output generators. -The main entry point for the code parser is \c parseCode() +The main entry point for the code parser is \c parseCode() declared in \c src/code.h.

    Output generators

    -After data is gathered and cross-referenced, doxygen generates -output in various formats. For this it uses the methods provided by +After data is gathered and cross-referenced, doxygen generates +output in various formats. For this it uses the methods provided by the abstract class \c OutputGenerator. In order to generate output for multiple formats at once, the methods of \c OutputList are called instead. This class maintains a list of concrete output generators, @@ -171,15 +171,15 @@ where each method called is delegated to all generators in the list. To allow small deviations in what is written to the output for each concrete output generator, it is possible to temporarily disable certain generators. The OutputList class contains various \c disable() and \c enable() -methods for this. The methods \c OutputList::pushGeneratorState() and +methods for this. The methods \c OutputList::pushGeneratorState() and \c OutputList::popGeneratorState() are used to temporarily save the -set of enabled/disabled output generators on a stack. +set of enabled/disabled output generators on a stack. The XML is generated directly from the gathered data structures. In the future XML will be used as an intermediate language (IL). The output generators will then use this IL as a starting point to generate the specific output formats. The advantage of having an IL is that various -independently developed tools written in various languages, +independently developed tools written in various languages, could extract information from the XML output. Possible tools could be: - an interactive source browser - a class diagram generator @@ -188,18 +188,18 @@ could extract information from the XML output. Possible tools could be:

    Debugging

    Since doxygen uses a lot of \c flex code it is important to understand -how \c flex works (for this one should read the \c man page) -and to understand what it is doing when \c flex is parsing some input. +how \c flex works (for this one should read the \c man page) +and to understand what it is doing when \c flex is parsing some input. Fortunately, when \c flex is used with the `-d` option it outputs what rules -matched. This makes it quite easy to follow what is going on for a -particular input fragment. +matched. This makes it quite easy to follow what is going on for a +particular input fragment. To make it easier to toggle debug information for a given \c flex file I wrote the following \c perl script, which automatically adds or removes `-d` from the correct line in the \c Makefile: \verbatim -#!/usr/bin/perl +#!/usr/bin/perl $file = shift @ARGV; print "Toggle debugging mode for $file\n"; @@ -232,7 +232,7 @@ if (open(F,"Testing @@ -258,7 +258,7 @@ Studio projects), e.g. `setenv TEST_FLAGS "--id 5 --id 7"` and `make tests`.

    Doxyfile differences

    -In case one has to communicate through e.g. a forum the configuration settings that +In case one has to communicate through e.g. a forum the configuration settings that are different from the standard doxygen configuration file settings one can run the doxygen command: with the `-x` option and the name of the configuration file (default is `Doxyfile`). The output will be a list of the not default settings (in `Doxyfile` diff --git a/doc/archoverview.gif b/doc/archoverview.gif deleted file mode 100644 index f404076..0000000 Binary files a/doc/archoverview.gif and /dev/null differ diff --git a/doc/archoverview.svg b/doc/archoverview.svg new file mode 100644 index 0000000..11a4340 --- /dev/null +++ b/doc/archoverview.svg @@ -0,0 +1,625 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/install.doc b/doc/install.doc index 9820f3c..97a0d7a 100644 --- a/doc/install.doc +++ b/doc/install.doc @@ -29,16 +29,15 @@ If you downloaded the source distribution, you need at least the following to build the executable:
    • The GNU tools - \c flex, \c bison, \c libiconv and GNU make, and \c strip + \c flex, \c bison, \c libiconv and GNU make \addindex flex \addindex bison \addindex libiconv \addindex make - \addindex strip \addindex python -
    • You need \c python (version 2.6 or higher, see https://www.python.org). +
    • You need \c python (version 2.7 or higher, see https://www.python.org).
    • In order to generate a \c Makefile for your platform, you need - cmake version 3.1.3 or later. + cmake version 3.3 or later. \addindex cmake
    @@ -55,7 +54,7 @@ tools should be installed. TeX Live This is needed for generating \LaTeX, Postscript, and PDF output.
  4. - the Graph visualization toolkit version 1.8.10 or higher + the Graph visualization toolkit version 2.38 or higher Needed for the include dependency graphs, the graphical inheritance graphs, and the collaboration graphs. If you compile graphviz yourself, make sure you do include @@ -165,7 +164,7 @@ From version 1.8.10 onwards, build files need to be generated by cmake. cmake can be downloaded from https://cmake.org/download/ \addindex cmake -At the moment only the express version of Visual Studio 2013 is tested, +At the moment only the express version of Visual Studio 2015 and 2017 are tested, but other version might also work. Alternatively, you can compile doxygen @@ -199,7 +198,16 @@ cd into the \c doxygen-x.y.z directory, create and cd to a build directory \verbatim mkdir build cd build -cmake -G "Visual Studio 12 2013" .. +cmake -G "Visual Studio 14 2015" .. +\endverbatim +This will create a project file then can be opened in Visual Studio. + +If you prefer compiling from the command prompt you can use the following instead: +\verbatim +mkdir build +cd build +cmake -G "NMake Makefiles" .. +nmake \endverbatim Note that compiling Doxywizard requires Qt 4.3 or newer @@ -214,7 +222,7 @@ Doxygen comes as a self-installing archive, so installation is extremely simple. Just follow the dialogs. After installation it is recommended to also download and install GraphViz -(version 2.20 or better is highly recommended). Doxygen can use the \c dot tool +(version 2.38 or better is highly recommended). Doxygen can use the \c dot tool of the GraphViz package to render nicer diagrams, see the \ref cfg_have_dot "HAVE_DOT" option in the configuration file. -- cgit v0.12 From 95f9c89d6aa0008321c2ee8a0f3b1a4602789395 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Sun, 7 Jun 2020 21:11:50 +0200 Subject: Revert pull request #7703: make declArgumentList be from declaration, and argumentList from definition --- src/doxygen.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 344ec7b..f20756e 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -3443,7 +3443,7 @@ static void buildFunctionList(const Entry *root) { // merge argument lists ArgumentList mergedArgList = root->argList; - mergeArguments(mdAl,mergedArgList,!root->proto); + mergeArguments(mdAl,mergedArgList,!root->doc.isEmpty()); // merge documentation if (md->documentation().isEmpty() && !root->doc.isEmpty()) { @@ -4952,7 +4952,7 @@ static void addMemberDocs(const Entry *root, { ArgumentList mergedAl = *al; //printf("merging arguments (1) docs=%d\n",root->doc.isEmpty()); - mergeArguments(mdAl,mergedAl,!root->proto); + mergeArguments(mdAl,mergedAl,!root->doc.isEmpty()); } else { @@ -4965,7 +4965,7 @@ static void addMemberDocs(const Entry *root, { //printf("merging arguments (2)\n"); ArgumentList mergedArgList = root->argList; - mergeArguments(mdAl,mergedArgList,!root->proto); + mergeArguments(mdAl,mergedArgList,!root->doc.isEmpty()); } } if (over_load) // the \overload keyword was used -- cgit v0.12 From 2f19e7322f6c082b09252c285753056f359a1eb6 Mon Sep 17 00:00:00 2001 From: albert-github Date: Mon, 8 Jun 2020 18:26:52 +0200 Subject: LaTeX test were hanging for a.o. Hungarian on Windows On Windows a number of tests were hanging when using a language like Hungarian, Russian. The handling of the output of the output is now done differently for Windows and other OS A small (but obvious) error has been corrected (failed_html -> failed_latex), has no effect on the output / results though. --- testing/runtests.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/testing/runtests.py b/testing/runtests.py index 10fe502..7896cdd 100755 --- a/testing/runtests.py +++ b/testing/runtests.py @@ -366,10 +366,13 @@ class Tester: if (self.args.pdf): failed_latex=False latex_output='%s/latex' % self.test_out + # with languages like Hungarian we had problems with some tests on windows when stderr was used. if (sys.platform == 'win32'): + outType=False redirl='>nul: 2>temp' mk='make.bat' else: + outType=True redirl='>/dev/null 2>temp' mk='make' cur_directory = os.getcwd() @@ -377,18 +380,22 @@ class Tester: exe_string = mk exe_string1 = exe_string exe_string += ' %s' % (redirl) - exe_string += ' %s more temp' % (separ) - latex_out = xpopen(exe_string,exe_string1,getStderr=True) + if outType: + exe_string += ' %s more temp' % (separ) + latex_out = xpopen(exe_string,exe_string1,getStderr=outType) os.chdir(cur_directory); - if latex_out.find("Error")!=-1: + if (outType and latex_out.find("Error")!=-1): msg += ("PDF generation failed\n For a description of the problem see 'refman.log' in the latex directory of this test",) - failed_html=True + failed_latex=True + elif (not outType and xopen(latex_output + "/temp",'r').read().find("Error")!= -1): + msg += ("PDF generation failed\n For a description of the problem see 'refman.log' in the latex directory of this test",) + failed_latex=True elif xopen(latex_output + "/refman.log",'r').read().find("Error")!= -1: msg += ("PDF generation failed\n For a description of the problem see 'refman.log' in the latex directory of this test",) - failed_html=True + failed_latex=True elif xopen(latex_output + "/refman.log",'r').read().find("Emergency stop")!= -1: msg += ("PDF generation failed\n For a description of the problem see 'refman.log' in the latex directory of this test",) - failed_html=True + failed_latex=True elif not self.args.keep: shutil.rmtree(latex_output,ignore_errors=True) -- cgit v0.12 From 1fa64cc88d0400eccb85fe4a687a269870fc3017 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Sun, 7 Jun 2020 11:36:24 +0200 Subject: Refactor: make QCString a wrapper around std::string --- qtools/qcstring.cpp | 273 +---------------- qtools/qcstring.h | 806 ++++++++++++++++----------------------------------- src/definition.cpp | 2 +- src/definition.h | 2 +- src/definitionimpl.h | 4 +- src/dot.cpp | 3 +- src/dotrunner.cpp | 3 +- src/filedef.cpp | 5 +- src/filedef.h | 24 +- src/ftextstream.h | 3 +- 10 files changed, 279 insertions(+), 846 deletions(-) diff --git a/qtools/qcstring.cpp b/qtools/qcstring.cpp index 8d442d7..8169979 100644 --- a/qtools/qcstring.cpp +++ b/qtools/qcstring.cpp @@ -218,135 +218,6 @@ int QCString::contains( const QRegExp &rx ) const return count; } -bool QCString::startsWith( const char *s ) const -{ - const char *p = data(); - if (p==0 || s==0) return s==0; - while (*p!=0 && *p==*s) p++,s++; - return *s==0; -} - -bool QCString::stripPrefix(const char *prefix) -{ - if (prefix==0 || length()==0) return FALSE; - int len = qstrlen(prefix); - if (qstrncmp(prefix,data(),len)==0) - { - m_rep=mid(len,length()-len).m_rep; // need to make a deep copy - return TRUE; - } - return FALSE; -} - -QCString QCString::left( uint len ) const -{ - if (isEmpty()) - { - return QCString(); - } - else if (len>=length()) - { - return QCString(data()); - } - else - { - QCString s( len+1 ); - memcpy( s.rawData(), data(), len); - return s; - } -} - -QCString QCString::right( uint len ) const -{ - if (isEmpty()) - { - return QCString(); - } - else - { - int l = length(); - if ((int)len>l) len=l; - const char *pos = data() + (l-len); - return QCString(pos); - } -} - -QCString QCString::mid( uint index, uint len) const -{ - uint slen = (uint)length(); - if (len==0xffffffff) len = slen-index; - if (isEmpty() || index>=slen || len==0) - { - return QCString(); - } - else - { - const char *p = data()+index; - QCString s(len+1); - qstrncpy( s.rawData(), p, len+1 ); - return s; - } -} - -QCString QCString::lower() const -{ - if (length()==0) return QCString(); - QCString s(data()); - char *pos = s.rawData(); - if (pos) - { - while (*pos) - { - *pos = tolower((unsigned char)*pos); - pos++; - } - } - return s; -} - -QCString QCString::upper() const -{ - if (length()==0) return QCString(); - QCString s(data()); - char *pos = s.rawData(); - if (pos) - { - while (*pos) - { - *pos = toupper((unsigned char)*pos); - pos++; - } - } - return s; -} - -QCString QCString::stripWhiteSpace() const -{ - if ( isEmpty() ) // nothing to do - return *this; - - const char *cs = data(); - int reslen = length(); - if ( !isspace((uchar)cs[0]) && !isspace((uchar)cs[reslen-1]) ) - return *this; // returns a copy - - QCString result(cs); - char *s = result.rawData(); - int start = 0; - int end = reslen - 1; - while ( isspace((uchar) s[start]) ) // skip white space from start - start++; - if ( s[start] == '\0' ) - { // only white space - return QCString(); - } - while ( end && isspace((uchar) s[end]) ) // skip white space from end - end--; - end -= start - 1; - qmemmove( s, &s[start], end ); - result.resize( end + 1 ); - return result; -} QCString QCString::simplifyWhiteSpace() const { @@ -375,67 +246,6 @@ QCString QCString::simplifyWhiteSpace() const return result; } -QCString &QCString::assign( const char *str ) -{ - return operator=(str); -} - -QCString &QCString::insert( uint index, const char *s ) -{ - int len = s ? qstrlen(s) : 0; - if ( len == 0 ) return *this; - int olen = length(); - int nlen = olen + len; - if ((int)index>=olen) - { - resize(nlen+index-olen+1); - memset(rawData()+olen, ' ', index-olen); - memcpy(rawData()+index,s, len+1); - } - else - { - resize(nlen+1); - qmemmove(rawData()+index+len,data()+index,olen-index+1); - memcpy(rawData()+index,s,len); - } - return *this; -} - -QCString &QCString::insert( uint index, char c) -{ - char buf[2]; - buf[0] = c; - buf[1] = '\0'; - return insert( index, buf ); -} -QCString &QCString::append( const char *s ) -{ - return operator+=(s); -} -QCString &QCString::prepend( const char *s ) -{ - return insert(0,s); -} -QCString &QCString::remove( uint index, uint len ) -{ - uint olen = length(); - if ( index + len >= olen ) // range problems - { - if ( index < olen ) // index ok - { - resize( index+1 ); - } - } - else if ( len != 0 ) - { - QCString tmp(olen-index-len+1); - qmemmove( tmp.rawData(), data()+index+len, olen-index-len+1 ); - resize( olen-len+1 ); - memcpy( rawData()+index,tmp.data(),tmp.length() ); - } - return *this; -} - QCString &QCString::replace( uint index, uint len, const char *s) { remove( index, len ); @@ -645,65 +455,6 @@ bye: return is_ok ? val : 0; } -QCString &QCString::setNum(short n) -{ - return setNum((long)n); -} - -QCString &QCString::setNum(ushort n) -{ - return setNum((ulong)n); -} - -QCString &QCString::setNum(int n) -{ - return setNum((long)n); -} - -QCString &QCString::setNum(uint n) -{ - return setNum((ulong)n); -} - -QCString &QCString::setNum(long n) -{ - char buf[20]; - char *p = &buf[19]; - bool neg; - if ( n < 0 ) - { - neg = TRUE; - n = -n; - } - else - { - neg = FALSE; - } - *p = '\0'; - do - { - *--p = ((int)(n%10)) + '0'; - n /= 10; - } while ( n ); - if ( neg ) *--p = '-'; - operator=( p ); - return *this; -} - -QCString &QCString::setNum( ulong n) -{ - char buf[20]; - char *p = &buf[19]; - *p = '\0'; - do - { - *--p = ((int)(n%10)) + '0'; - n /= 10; - } while ( n ); - operator=( p ); - return *this; -} - //------------------------------------------------- void *qmemmove( void *dst, const void *src, uint len ) @@ -828,16 +579,12 @@ QDataStream &operator>>( QDataStream &s, QCString &str ) inline QCString operator+( const QCString &s1, const QGString &s2 ) { - QCString tmp(s1); - tmp += s2.data(); - return tmp; + return s1.str()+s2.data(); } inline QCString operator+( const QGString &s1, const QCString &s2 ) { - QCString tmp(s1.data()); - tmp += s2; - return tmp; + return s1.data()+s2.str(); } /// substitute all occurrences of \a src in \a s by \a dst @@ -934,19 +681,3 @@ QCString substitute(const QCString &s,const QCString &src,const QCString &dst,in return result; } -/// substitute all occurrences of \a srcChar in \a s by \a dstChar -QCString substitute(const QCString &s,char srcChar,char dstChar) -{ - int l=s.length(); - QCString result(l+1); - char *q=result.rawData(); - if (l>0) - { - const char *p=s.data(); - char c; - while ((c=*p++)) *q++ = (c==srcChar) ? dstChar : c; - } - *q='\0'; - return result; -} - diff --git a/qtools/qcstring.h b/qtools/qcstring.h index b126194..9c10bec 100644 --- a/qtools/qcstring.h +++ b/qtools/qcstring.h @@ -22,52 +22,21 @@ #endif // QT_H #include +#include -#include -#include -#include - -#if !defined(_OS_WIN32_) || defined(__MINGW32__) -#include -#endif - -#if defined(_OS_SUN_) && defined(_CC_GNU_) -#include -#endif - -#include +#include +#include +#include +#include +#include class QGString; /***************************************************************************** - Fixes and workarounds for some platforms - *****************************************************************************/ - -#if defined(_OS_HPUX_) -// HP-UX has badly defined strstr() etc. -// ### fix in 3.0: change hack_* to qt_hack_* -// by the way HP-UX is probably right, the standard has evolved and -// we'll have to adapt to it -inline char *hack_strstr( const char *s1, const char *s2 ) -{ return (char *)strstr(s1, s2); } -inline char *hack_strchr( const char *s, int c ) -{ return (char *)strchr(s, c); } -inline char *hack_strrchr( const char *s, int c ) -{ return (char *)strrchr(s, c); } -#define strstr(s1,s2) hack_strstr((s1),(s2)) -#define strchr(s,c) hack_strchr((s),(c)) -#define strrchr(s,c) hack_strrchr((s),(c)) -#endif - -/***************************************************************************** Safe and portable C string functions; extensions to standard string.h *****************************************************************************/ -Q_EXPORT void *qmemmove( void *dst, const void *src, uint len ); - -#if defined(_OS_SUN_) || defined(_CC_OC_) -#define memmove(s1,s2,n) qmemmove((s1),(s2),(n)) -#endif +void *qmemmove( void *dst, const void *src, uint len ); #if defined(_OS_WIN32_) #define qsnprintf _snprintf @@ -75,45 +44,45 @@ Q_EXPORT void *qmemmove( void *dst, const void *src, uint len ); #define qsnprintf snprintf #endif -Q_EXPORT char *qstrdup( const char * ); +char *qstrdup( const char * ); -Q_EXPORT inline uint cstrlen( const char *str ) +inline uint cstrlen( const char *str ) { return (uint)strlen(str); } -Q_EXPORT inline uint qstrlen( const char *str ) +inline uint qstrlen( const char *str ) { return str ? (uint)strlen(str) : 0; } -Q_EXPORT inline char *cstrcpy( char *dst, const char *src ) +inline char *cstrcpy( char *dst, const char *src ) { return strcpy(dst,src); } -Q_EXPORT inline char *qstrcpy( char *dst, const char *src ) +inline char *qstrcpy( char *dst, const char *src ) { return src ? strcpy(dst, src) : 0; } -Q_EXPORT char * qstrncpy(char *src,const char *dst, uint len); +char * qstrncpy(char *src,const char *dst, uint len); -Q_EXPORT inline int cstrcmp( const char *str1, const char *str2 ) +inline int cstrcmp( const char *str1, const char *str2 ) { return strcmp(str1,str2); } -Q_EXPORT inline int qstrcmp( const char *str1, const char *str2 ) +inline int qstrcmp( const char *str1, const char *str2 ) { return (str1 && str2) ? strcmp(str1,str2) : (int)((intptr_t)str2 - (intptr_t)str1); } -Q_EXPORT inline int cstrncmp( const char *str1, const char *str2, uint len ) +inline int cstrncmp( const char *str1, const char *str2, uint len ) { return strncmp(str1,str2,len); } -Q_EXPORT inline int qstrncmp( const char *str1, const char *str2, uint len ) +inline int qstrncmp( const char *str1, const char *str2, uint len ) { return (str1 && str2) ? strncmp(str1,str2,len) : (int)((intptr_t)str2 - (intptr_t)str1); } -Q_EXPORT int qstricmp( const char *str1, const char *str2 ); +int qstricmp( const char *str1, const char *str2 ); -Q_EXPORT int qstrnicmp( const char *str1, const char *str2, uint len ); +int qstrnicmp( const char *str1, const char *str2, uint len ); /***************************************************************************** QByteArray class *****************************************************************************/ #if defined(Q_TEMPLATEDLL) -template class Q_EXPORT QArray; +template class QArray; #endif typedef QArray QByteArray; @@ -121,120 +90,75 @@ typedef QArray QByteArray; QByteArray stream functions *****************************************************************************/ #ifndef QT_NO_DATASTREAM -Q_EXPORT QDataStream &operator<<( QDataStream &, const QByteArray & ); -Q_EXPORT QDataStream &operator>>( QDataStream &, QByteArray & ); +QDataStream &operator<<( QDataStream &, const QByteArray & ); +QDataStream &operator>>( QDataStream &, QByteArray & ); #endif class QRegExp; /** This is an alternative implementation of QCString. It provides basically - * the same functions but uses reference counting and copy on write. + * the same functions but uses std::string as the underlying string type */ class QCString { -public: - /** creates an empty string */ - QCString() : m_rep() - { - } - - /** destroys the string */ - ~QCString() - { - } + public: + QCString() = default; + ~QCString() = default; + QCString( const QCString &s ) = default; + QCString &operator=( const QCString &s ) = default; + QCString( QCString &&s ) = default; + QCString &operator=( QCString &&s ) = default; - /** makes a copy of a string. */ - QCString( const QCString &s ) : m_rep(s.m_rep) - { - } + QCString( const std::string &s ) : m_rep(s) {} /** creates a string with room for size characters - * @param[in] size the number of character to allocate (including the 0-terminator) + * @param[in] size the number of character to allocate (also counting the 0-terminator!) */ - explicit QCString( uint size ) : m_rep(size) - { - } + explicit QCString( uint size ) { m_rep.resize(size>0 ? size-1 : 0); } /** creates a string from a plain C string. * @param[in] str A zero terminated C string. When 0 an empty string is created. */ - QCString( const char *str ) : m_rep(str) - { - } + QCString( const char *str ) : m_rep(str?str:"") {} /** creates a string from \a str and copies over the first \a maxlen characters. */ - QCString( const char *str, uint maxlen ) : m_rep(str,maxlen) - { - } + QCString( const char *str, uint maxlen ) : m_rep(str?str:"") { m_rep.resize(maxlen); } /** replaces the contents by that of string \a s. */ - QCString &operator=( const QCString &s ) - { - m_rep = s.m_rep; - return *this; - } /** replaces the contents by that of C string \a str. */ - QCString &operator=( const char *str) - { - m_rep = str; - return *this; - } + QCString &operator=( const char *str) { m_rep = str?str:""; return *this; } /** Returns TRUE iff the string is empty. Equivalent to isEmpty(). */ - bool isNull() const - { - return m_rep.isEmpty(); - } + bool isNull() const { return m_rep.empty(); } /** Returns TRUE iff the string is empty */ - bool isEmpty() const - { - return m_rep.isEmpty(); - } + bool isEmpty() const { return m_rep.empty(); } - /** Returns the length of the string, excluding the 0-terminator. Equivalent to size(). */ - uint length() const - { - return m_rep.length(); - } + /** Returns the length of the string, not counting the 0-terminator. Equivalent to size(). */ + uint length() const { return (uint)m_rep.size(); } - /** Returns the length of the string, excluding the 0-terminator. */ - uint size() const - { - return m_rep.length(); - } + /** Returns the length of the string, not counting the 0-terminator. */ + uint size() const { return (uint)m_rep.size(); } /** Returns a pointer to the contents of the string in the form of a 0-terminated C string */ - const char *data() const - { - return m_rep.data(); - } + const char *data() const { return m_rep.empty() ? 0 : m_rep.c_str(); } /** Returns a writable pointer to the data. * @warning if the string is shared it will modifying the string directly and * this will overwrite all copies as well! */ - char *rawData() const - { - return m_rep.rawData(); - } + char *rawData() const { return m_rep.empty() ? 0 : const_cast(&m_rep[0]); } /** Resizes the string to hold \a newlen characters - * (this value should include the 0-terminator). If the string is enlarged the contents will + * (this value should also count the 0-terminator). + * If the string is enlarged the contents will * be left unmodified. */ - bool resize( uint newlen ) - { - m_rep.resize(newlen); - return TRUE; - } + bool resize( uint newlen ) { m_rep.resize( newlen>0 ? newlen-1 : 0 ); return TRUE; } /** Truncates the string at position \a pos. */ - bool truncate( uint pos ) - { - return resize(pos+1); - } + bool truncate( uint pos ) { return resize( pos + 1 ); } /** Fills a string with a predefined character * @param[in] c the character used to fill the string with. @@ -244,523 +168,286 @@ public: */ bool fill( char c, int len = -1 ) { - m_rep.fill(c,len); + int l = len==-1 ? m_rep.size() : len; + m_rep = std::string(l,c); return TRUE; } /** Returns a deep copy of the string. */ - QCString copy() const - { - if (length()==0) return QCString(); - QCString cs(length()+1); - memcpy(cs.rawData(),data(),length()); - return cs; - } + QCString copy() const { return *this; } QCString &sprintf( const char *format, ... ); + int find( char c, int index=0, bool cs=TRUE ) const; int find( const char *str, int index=0, bool cs=TRUE ) const; int find( const QCString &str, int index=0, bool cs=TRUE ) const; int find( const QRegExp &rx, int index=0 ) const; + int findRev( char c, int index=-1, bool cs=TRUE) const; int findRev( const char *str, int index=-1, bool cs=TRUE) const; int findRev( const QRegExp &rx, int index=-1 ) const; + int contains( char c, bool cs=TRUE ) const; int contains( const char *str, bool cs=TRUE ) const; int contains( const QRegExp &rx ) const; - bool stripPrefix(const char *prefix); - QCString left( uint len ) const; - QCString right( uint len ) const; - QCString mid( uint index, uint len=(uint)-1) const; - QCString lower() const; - QCString upper() const; - QCString stripWhiteSpace() const; + + bool stripPrefix(const char *prefix) + { + if (prefix==0 || m_rep.empty()) return FALSE; + if (m_rep.rfind(prefix,0)==0) // string starts with prefix + { + m_rep.erase(0,qstrlen(prefix)); + return TRUE; + } + return FALSE; + } + + QCString left( uint len ) const + { + return m_rep.empty() ? QCString() : QCString(m_rep.substr(0,len)); + } + + QCString right( uint len ) const + { + return m_rep.empty() ? QCString() : + lenslen || len==0 ? QCString() : + QCString(m_rep.substr(index,len)); + } + + QCString lower() const + { + std::string s = m_rep; + std::transform(s.begin(),s.end(),s.begin(), + [](unsigned char c){ return std::tolower(c); }); + return s; + } + + QCString upper() const + { + std::string s = m_rep; + std::transform(s.begin(),s.end(),s.begin(), + [](unsigned char c){ return std::toupper(c); }); + return s; + } + + QCString stripWhiteSpace() const + { + int sl = (uint)m_rep.size(); + if (sl==0 || (!std::isspace(m_rep[0]) && !std::isspace(m_rep[sl-1]))) return *this; + int start=0,end=sl-1; + while (startstart && std::isspace(m_rep[end])) end--; + return QCString(m_rep.substr(start,1+end-start)); + } + QCString simplifyWhiteSpace() const; - QCString &assign( const char *str ); - QCString &insert( uint index, const char *s ); - QCString &insert( uint index, char c); - QCString &append( const char *s ); - QCString &prepend( const char *s ); - QCString &remove( uint index, uint len ); + + QCString &insert( uint index, const char *s ) + { + uint len = s ? qstrlen(s) : 0; + if (len>0) + { + uint ol = m_rep.size(); + if (index>ol) // insert beyond end of string and fill gap with spaces + { + m_rep.resize(index+len); + std::memset(&m_rep[ol],' ',index-ol); + std::memcpy(&m_rep[index],s,len+1); + } + else // insert inside the string + { + m_rep.insert(index,s); + } + } + return *this; + } + + QCString &insert( uint index, char c) + { + char s[2] = { c, '\0' }; + return insert(index,s); + } + + QCString &append( const char *s ) + { + return operator+=(s); + } + + QCString &prepend( const char *s ) + { + return insert(0,s); + } + + QCString &remove( uint index, uint len ) + { + uint ol = (uint)m_rep.size(); + if (index
      0) m_rep.erase(index,index+len>=ol ? std::string::npos : len); + return *this; + } + QCString &replace( uint index, uint len, const char *s); QCString &replace( const QRegExp &rx, const char *str ); - short toShort( bool *ok=0, int base=10 ) const; + + short toShort( bool *ok=0, int base=10 ) const; ushort toUShort( bool *ok=0, int base=10 ) const; - int toInt( bool *ok=0, int base=10 ) const; - uint toUInt( bool *ok=0, int base=10 ) const; - long toLong( bool *ok=0, int base=10 ) const; - ulong toULong( bool *ok=0, int base=10 ) const; + int toInt( bool *ok=0, int base=10 ) const; + uint toUInt( bool *ok=0, int base=10 ) const; + long toLong( bool *ok=0, int base=10 ) const; + ulong toULong( bool *ok=0, int base=10 ) const; uint64 toUInt64( bool *ok=0, int base=10 ) const; - QCString &setNum(short n); - QCString &setNum(ushort n); - QCString &setNum(int n); - QCString &setNum(uint n); - QCString &setNum(long n); - QCString &setNum(ulong n); - bool startsWith( const char *s ) const; - /** Converts the string to a plain C string */ - operator const char *() const + QCString &setNum(short n) { - return (const char *)data(); + m_rep = std::to_string(n); + return *this; } - /** Appends string \a str to this string and returns a reference to the result. */ - QCString &operator+=( const char *str ) + QCString &setNum(ushort n) { - if (!str) return *this; - uint len1 = length(); - uint len2 = (uint)strlen(str); - resize(len1+len2+1); - memcpy(rawData()+len1,str,len2); + m_rep = std::to_string(n); return *this; } - /** Appends character \a c to this string and returns a reference to the result. */ - QCString &operator+=( char c ) + QCString &setNum(int n) { - uint len = length(); - resize(len+2); - rawData()[len]=c; + m_rep = std::to_string(n); return *this; } - /** Returns a reference to the character at index \a i. */ - char &at( uint i) const + QCString &setNum(uint n) { - return m_rep.at(i); + m_rep = std::to_string(n); + return *this; } - /** Indexing operator. Equivalent to at(). */ - char &operator[]( int i ) const + QCString &setNum(long n) { - return m_rep.at((uint)i); + m_rep = std::to_string(n); + return *this; } - private: - - struct LSData; - - // long string representation - struct LongStringRep + QCString &setNum(ulong n) { - uchar isShort; // : 1; // should be shared with ShortStringRep - //uchar : 7; - LSData *d; - }; + m_rep = std::to_string(n); + return *this; + } -#define SHORT_STR_CAPACITY ((int)sizeof(LongStringRep)-2) -#define SHORT_STR_MAX_LEN (SHORT_STR_CAPACITY-1) + bool startsWith( const char *s ) const + { + if (m_rep.empty() || s==0) return s==0; + return m_rep.rfind(s,0)==0; // looking "backward" starting and ending at index 0 + } - // short string representation - struct ShortStringRep + /** Converts the string to a plain C string */ + operator const char *() const { - uchar isShort; // : 1; // should be shared with LongStringRep - uchar len; // : 7; - char str[SHORT_STR_CAPACITY]; // size including 0-terminator - }; + return const_cast(data()); + } - // ref counting string header - struct LSHeader + std::string str() const { - uint len; // length of string without 0 terminator - int refCount; // -1=leaked, 0=one ref & non-cost, n>0, n+1 refs, const - }; - // ref counting string data and methods - struct LSData : public LSHeader + return m_rep; + } + + /** Appends string \a str to this string and returns a reference to the result. */ + QCString &operator+=( const char *str ) { - char *toStr() - { - return (char*)(this+1); // string data starts after the header - } + if (str) m_rep+=str; + return *this; + } - // creates a LSData item with room for size bytes (which includes the 0 terminator!) - // if size is zero, an empty string will be created. - static LSData *create(uint size) - { - LSData *data; - data = (LSData*)malloc(sizeof(LSHeader)+size); - data->len = size-1; - data->refCount = 0; - data->toStr()[size-1] = 0; - return data; - } - // remove out reference to the data. Frees memory if no more users - void dispose() - { - if (--refCount<0) free(this); - } + /** Appends character \a c to this string and returns a reference to the result. */ + QCString &operator+=( char c ) + { + m_rep+=c; + return *this; + } - // resizes LSData so it can hold size bytes (which includes the 0 terminator!) - // Since this is for long strings only, size should be > SHORT_STR_CAPACITY - static LSData *resize(LSData *d,uint size) - { - if (d->len>0 && d->refCount==0) // non-const, non-empty - { - d = (LSData*)realloc(d,sizeof(LSHeader)+size); - d->len = size-1; - d->toStr()[size-1] = 0; - return d; - } - else // need to make a copy - { - LSData *newData = LSData::create(size); - uint len = d->len; - if (len>=size) len=size-1; - memcpy(newData->toStr(),d->toStr(),len); - newData->toStr()[len]=0; - d->dispose(); - return newData; - } - } - }; + /** Returns a reference to the character at index \a i. */ + char &at( uint i) const + { + return const_cast(m_rep[i]); + } - class StringRep + /** Indexing operator. Equivalent to at(). */ + char &operator[]( int i ) const { - public: - StringRep() - { - initEmpty(); - } - void initEmpty() - { - u.s.isShort=TRUE; - u.s.len=0; - //memset(u.s.str,0,SHORT_STR_CAPACITY); - } - ~StringRep() - { - if (!u.s.isShort) - { - u.l.d->dispose(); - } - } - StringRep(const StringRep &s) - { - if (&s!=this) - { - u.s.isShort = s.u.s.isShort; - if (s.u.s.isShort) - { - u.s.len = s.u.s.len; - memcpy(u.s.str,s.u.s.str,s.u.s.len+1); - } - else - { - u.l.d = s.u.l.d; - u.l.d->refCount++; - } - } - else // self-assignment - { - u = s.u; // avoid uninitialized warning from gcc - } - } - StringRep(uint size) - { - u.s.isShort = size<=SHORT_STR_CAPACITY; - if (size<=SHORT_STR_CAPACITY) // init short string - { - if (size>0) - { - u.s.len = (uchar)(size-1); - u.s.str[size-1]='\0'; - } - else - { - u.s.len = 0; - } - } - else // int long string - { - u.l.d = LSData::create(size); - } - } - StringRep(const char *str) - { - if (str) - { - uint len = (uint)strlen(str); - u.s.isShort = lentoStr(),str,u.l.d->len); - } - } - else // create empty string - { - initEmpty(); - } - } - StringRep( const char *str, uint maxlen ) - { - if (str && maxlen>0) - { - uint len=(uint)strlen(str); - if (len>maxlen) len=maxlen; - u.s.isShort = len<=SHORT_STR_MAX_LEN; - if (u.s.isShort) - { - u.s.len = (uchar)len; - memcpy(u.s.str,str,len); - u.s.str[len]='\0'; - } - else - { - u.l.d = LSData::create(len+1); - memcpy(u.l.d->toStr(),str,len); - } - } - else // create empty string - { - initEmpty(); - } - } - StringRep &operator=(const StringRep &s) - { - if (&s!=this) - { - if (!u.s.isShort) - { - u.l.d->dispose(); - } - u.s.isShort = s.u.s.isShort; - if (u.s.isShort) // copy by value - { - u.s.len = s.u.s.len; - memcpy(u.s.str,s.u.s.str,s.u.s.len+1); - } - else // copy by reference - { - u.l.d = s.u.l.d; - u.l.d->refCount++; - } - } - else // self-assignment - { - u = s.u; // avoid uninitialized warning from gcc - } - return *this; - } - StringRep &operator=(const char *str) - { - if (!u.s.isShort) - { - u.l.d->dispose(); - } - if (str) - { - uint len = (uint)strlen(str); - u.s.isShort = lentoStr(),str,len); - } - } - else - { - initEmpty(); - } - return *this; - } - bool isEmpty() const - { - return u.s.isShort && u.s.len==0; - } - uint length() const - { - uint l = u.s.isShort ? u.s.len : u.l.d->len; - return l; - } - const char *data() const - { - if (u.s.isShort) - { - return u.s.len==0 ? 0 : u.s.str; - } - else - { - return u.l.d->len==0 ? 0 : u.l.d->toStr(); - } - } - char *rawData() const - { - if (u.s.isShort) - { - return u.s.len==0 ? 0 : (char*)u.s.str; - } - else - { - //assert(u.l.d->refCount==0); // string may not be shared when accessed raw - return u.l.d->len==0 ? 0 : u.l.d->toStr(); - } - } - char &at(uint i) const - { - if (u.s.isShort) - { - return (char&)u.s.str[i]; - } - else - { - return u.l.d->toStr()[i]; - } - } - bool resize( uint newlen ) - { - if (u.s.isShort && newlen<=SHORT_STR_CAPACITY) // resize short string - { - if (newlen>0) - { - u.s.len = (uchar)(newlen-1); - u.s.str[newlen-1]='\0'; - } - else // string becomes empty - { - initEmpty(); - } - } - else if (u.s.isShort) // turn short string into long string - { - StringRep tmp = *this; - u.s.isShort=FALSE; - u.l.d = LSData::create(newlen); - if (tmp.u.s.len>0) - { - memcpy(u.l.d->toStr(),tmp.u.s.str,tmp.u.s.len+1); - } - else - { - u.l.d->toStr()[0]='\0'; - } - } - else if (!u.s.isShort && newlen<=SHORT_STR_CAPACITY) // turn long string into short string - { - if (newlen>0) - { - StringRep tmp(newlen); // copy short part into tmp buffer - memcpy(tmp.u.s.str,u.l.d->toStr(),newlen-1); - tmp.u.s.str[newlen-1]='\0'; - u.l.d->dispose(); - u.s = tmp.u.s; - } - else - { - u.l.d->dispose(); - initEmpty(); - } - } - else // resize long string - { - u.l.d = u.l.d->resize(u.l.d,newlen); - } - return TRUE; - } - bool fill( char c, int len ) - { - uint ulen = len<0 ? length() : (uint)len; - if (!u.s.isShort) // detach from shared string - { - resize(ulen+1); - } - else if (ulen!=length()) - { - if (ulen>0) - { - resize(ulen+1); - } - } - if (ulen>0) - { - memset(rawData(),c,ulen); - } - return TRUE; - } - private: - union ShortOrLongStringSelector - { - ShortStringRep s; - LongStringRep l; - } u; - }; - StringRep m_rep; + return const_cast(m_rep[i]); + } + private: + std::string m_rep; }; /***************************************************************************** QCString stream functions *****************************************************************************/ #ifndef QT_NO_DATASTREAM -Q_EXPORT QDataStream &operator<<( QDataStream &, const QCString & ); -Q_EXPORT QDataStream &operator>>( QDataStream &, QCString & ); +QDataStream &operator<<( QDataStream &, const QCString & ); +QDataStream &operator>>( QDataStream &, QCString & ); #endif /***************************************************************************** QCString non-member operators *****************************************************************************/ -Q_EXPORT inline bool operator==( const QCString &s1, const QCString &s2 ) +inline bool operator==( const QCString &s1, const QCString &s2 ) { return qstrcmp(s1.data(),s2.data()) == 0; } -Q_EXPORT inline bool operator==( const QCString &s1, const char *s2 ) +inline bool operator==( const QCString &s1, const char *s2 ) { return qstrcmp(s1.data(),s2) == 0; } -Q_EXPORT inline bool operator==( const char *s1, const QCString &s2 ) +inline bool operator==( const char *s1, const QCString &s2 ) { return qstrcmp(s1,s2.data()) == 0; } -Q_EXPORT inline bool operator!=( const QCString &s1, const QCString &s2 ) +inline bool operator!=( const QCString &s1, const QCString &s2 ) { return qstrcmp(s1.data(),s2.data()) != 0; } -Q_EXPORT inline bool operator!=( const QCString &s1, const char *s2 ) +inline bool operator!=( const QCString &s1, const char *s2 ) { return qstrcmp(s1.data(),s2) != 0; } -Q_EXPORT inline bool operator!=( const char *s1, const QCString &s2 ) +inline bool operator!=( const char *s1, const QCString &s2 ) { return qstrcmp(s1,s2.data()) != 0; } -Q_EXPORT inline bool operator<( const QCString &s1, const QCString& s2 ) +inline bool operator<( const QCString &s1, const QCString& s2 ) { return qstrcmp(s1.data(),s2.data()) < 0; } -Q_EXPORT inline bool operator<( const QCString &s1, const char *s2 ) +inline bool operator<( const QCString &s1, const char *s2 ) { return qstrcmp(s1.data(),s2) < 0; } -Q_EXPORT inline bool operator<( const char *s1, const QCString &s2 ) +inline bool operator<( const char *s1, const QCString &s2 ) { return qstrcmp(s1,s2.data()) < 0; } -Q_EXPORT inline bool operator<=( const QCString &s1, const char *s2 ) +inline bool operator<=( const QCString &s1, const char *s2 ) { return qstrcmp(s1.data(),s2) <= 0; } -Q_EXPORT inline bool operator<=( const char *s1, const QCString &s2 ) +inline bool operator<=( const char *s1, const QCString &s2 ) { return qstrcmp(s1,s2.data()) <= 0; } -Q_EXPORT inline bool operator>( const QCString &s1, const char *s2 ) +inline bool operator>( const QCString &s1, const char *s2 ) { return qstrcmp(s1.data(),s2) > 0; } -Q_EXPORT inline bool operator>( const char *s1, const QCString &s2 ) +inline bool operator>( const char *s1, const QCString &s2 ) { return qstrcmp(s1,s2.data()) > 0; } -Q_EXPORT inline bool operator>=( const QCString &s1, const char *s2 ) +inline bool operator>=( const QCString &s1, const char *s2 ) { return qstrcmp(s1.data(),s2) >= 0; } -Q_EXPORT inline bool operator>=( const char *s1, const QCString &s2 ) +inline bool operator>=( const char *s1, const QCString &s2 ) { return qstrcmp(s1,s2.data()) >= 0; } -Q_EXPORT inline QCString operator+( const QCString &s1, const QCString &s2 ) +inline QCString operator+( const QCString &s1, const QCString &s2 ) { - QCString tmp(s1); - tmp += s2; - return tmp; + return QCString(s1.str()+s2.str()); } @@ -768,28 +455,28 @@ inline QCString operator+( const QCString &s1, const QGString &s2 ); inline QCString operator+( const QGString &s1, const QCString &s2 ); -Q_EXPORT inline QCString operator+( const QCString &s1, const char *s2 ) +inline QCString operator+( const QCString &s1, const char *s2 ) { QCString tmp(s1); tmp += s2; return tmp; } -Q_EXPORT inline QCString operator+( const char *s1, const QCString &s2 ) +inline QCString operator+( const char *s1, const QCString &s2 ) { QCString tmp(s1); tmp += s2; return tmp; } -Q_EXPORT inline QCString operator+( const QCString &s1, char c2 ) +inline QCString operator+( const QCString &s1, char c2 ) { QCString tmp( s1.data() ); tmp += c2; return tmp; } -Q_EXPORT inline QCString operator+( char c1, const QCString &s2 ) +inline QCString operator+( char c1, const QCString &s2 ) { QCString tmp; tmp += c1; @@ -807,14 +494,25 @@ inline const char *qPrint(const QCString &s) if (!s.isEmpty()) return s.data(); else return ""; } +inline const char *qPrint(const std::string &s) +{ + return s.c_str(); +} + inline std::string toStdString(const QCString &s) { - if (!s.isEmpty()) return std::string(s.data()); else return std::string(); + return s.str(); } // helper functions -QCString substitute(const QCString &s,const QCString &src,const QCString &dst); +QCString substitute(const QCString &str,const QCString &find,const QCString &replace); QCString substitute(const QCString &s,const QCString &src,const QCString &dst,int skip_seq); -QCString substitute(const QCString &s,char srcChar,char dstChar); + +inline QCString substitute(const QCString &s,char srcChar,char dstChar) +{ + std::string ss = s.str(); + ss.replace(ss.begin(),ss.end(),srcChar,dstChar); + return ss; +} #endif // QCSTRING_H diff --git a/src/definition.cpp b/src/definition.cpp index c398b61..3ed331c 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -2177,7 +2177,7 @@ QCString DefinitionImpl::externalReference(const QCString &relPath) const return relPath; } -QCString DefinitionImpl::name() const +const QCString &DefinitionImpl::name() const { return m_impl->name; } diff --git a/src/definition.h b/src/definition.h index 2d167dc..8ad15b2 100644 --- a/src/definition.h +++ b/src/definition.h @@ -111,7 +111,7 @@ class Definition : public DefinitionIntf virtual bool isAlias() const = 0; /*! Returns the name of the definition */ - virtual QCString name() const = 0; + virtual const QCString &name() const = 0; /*! Returns TRUE iff this definition has an artificially generated name * (typically starting with a @) that is used for nameless definitions diff --git a/src/definitionimpl.h b/src/definitionimpl.h index c35a89e..e91d989 100644 --- a/src/definitionimpl.h +++ b/src/definitionimpl.h @@ -31,7 +31,7 @@ class DefinitionImpl : virtual public Definition virtual ~DefinitionImpl(); virtual bool isAlias() const { return FALSE; } - virtual QCString name() const; + virtual const QCString &name() const; virtual bool isAnonymous() const; virtual QCString localName() const; virtual QCString qualifiedName() const; @@ -142,7 +142,7 @@ class DefinitionAliasImpl : virtual public Definition virtual ~DefinitionAliasImpl(); virtual bool isAlias() const { return TRUE; } - virtual QCString name() const + virtual const QCString &name() const { return m_def->name(); } virtual bool isAnonymous() const { return m_def->isAnonymous(); } diff --git a/src/dot.cpp b/src/dot.cpp index 675ead6..ddabbc7 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -13,7 +13,8 @@ * */ -#include +#include +#include #include diff --git a/src/dotrunner.cpp b/src/dotrunner.cpp index 8cf09fa..a1bbc52 100644 --- a/src/dotrunner.cpp +++ b/src/dotrunner.cpp @@ -13,6 +13,8 @@ * */ +#include + #include "dotrunner.h" #include "qstring.h" @@ -151,7 +153,6 @@ DotRunner::DotRunner(const std::string& absDotName, const std::string& md5Hash) , m_md5Hash(md5Hash.data()) , m_dotExe(Config_getString(DOT_PATH)+"dot") , m_cleanUp(Config_getBool(DOT_CLEANUP)) - , m_jobs() { } diff --git a/src/filedef.cpp b/src/filedef.cpp index 7e8afdc..919ce2b 100644 --- a/src/filedef.cpp +++ b/src/filedef.cpp @@ -55,7 +55,8 @@ class FileDefImpl : public DefinitionImpl, public FileDef virtual ~FileDefImpl(); virtual DefType definitionType() const { return TypeFile; } - virtual QCString name() const; + virtual const QCString &name() const; + virtual QCString displayName(bool=TRUE) const { return name(); } virtual QCString fileName() const { return m_fileName; } virtual QCString getOutputFileBase() const; @@ -1464,7 +1465,7 @@ void FileDefImpl::insertNamespace(NamespaceDef *nd) } } -QCString FileDefImpl::name() const +const QCString &FileDefImpl::name() const { if (Config_getBool(FULL_PATH_NAMES)) return m_fileName; diff --git a/src/filedef.h b/src/filedef.h index 2ca33db..2510d85 100644 --- a/src/filedef.h +++ b/src/filedef.h @@ -1,12 +1,12 @@ /****************************************************************************** * - * + * * * Copyright (C) 1997-2015 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its - * documentation under the terms of the GNU General Public License is hereby - * granted. No representations are made about the suitability of this software + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software * for any purpose. It is provided "as is" without express or implied warranty. * See the GNU General Public License for more details. * @@ -53,11 +53,11 @@ struct IncludeInfo bool indirect; }; -/** A model of a file symbol. - * +/** A model of a file symbol. + * * An object of this class contains all file information that is gathered. * This includes the members and compounds defined in the file. - * + * * The member writeDocumentation() can be used to generate the page of * documentation to HTML and LaTeX. */ @@ -71,7 +71,7 @@ class FileDef : virtual public Definition virtual DefType definitionType() const = 0; /*! Returns the unique file name (this may include part of the path). */ - virtual QCString name() const = 0; + virtual const QCString &name() const = 0; virtual QCString displayName(bool=TRUE) const = 0; virtual QCString fileName() const = 0; @@ -228,11 +228,11 @@ class DirEntry { public: enum EntryKind { Dir, File }; - DirEntry(DirEntry *parent,FileDef *fd) - : m_parent(parent), m_name(fd->name()), m_kind(File), m_fd(fd), + DirEntry(DirEntry *parent,FileDef *fd) + : m_parent(parent), m_name(fd->name()), m_kind(File), m_fd(fd), m_isLast(FALSE) { } - DirEntry(DirEntry *parent,QCString name) - : m_parent(parent), m_name(name), m_kind(Dir), + DirEntry(DirEntry *parent,QCString name) + : m_parent(parent), m_name(name), m_kind(Dir), m_fd(0), m_isLast(FALSE) { } virtual ~DirEntry() { } EntryKind kind() const { return m_kind; } @@ -257,7 +257,7 @@ class DirEntry class Directory : public DirEntry { public: - Directory(Directory *parent,const QCString &name) + Directory(Directory *parent,const QCString &name) : DirEntry(parent,name) { m_children.setAutoDelete(TRUE); } virtual ~Directory() {} diff --git a/src/ftextstream.h b/src/ftextstream.h index bfc5bd5..5b6a9ca 100644 --- a/src/ftextstream.h +++ b/src/ftextstream.h @@ -60,7 +60,8 @@ inline FTextStream &FTextStream::operator<<( const char* s) inline FTextStream &FTextStream::operator<<( const QCString &s) { - return operator<<(s.data()); + if (m_dev) m_dev->writeBlock( s, s.length() ); + return *this; } typedef FTextStream & (*FTSFUNC)(FTextStream &);// manipulator function -- cgit v0.12 From b4323811d0d68bc8de00d9487469c4ec60601dd6 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Wed, 10 Jun 2020 21:15:45 +0200 Subject: Fix win64 compiler warnings --- qtools/qcstring.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/qtools/qcstring.h b/qtools/qcstring.h index 9c10bec..a998fef 100644 --- a/qtools/qcstring.h +++ b/qtools/qcstring.h @@ -168,7 +168,7 @@ class QCString */ bool fill( char c, int len = -1 ) { - int l = len==-1 ? m_rep.size() : len; + int l = len==-1 ? (int)m_rep.size() : len; m_rep = std::string(l,c); return TRUE; } @@ -226,7 +226,7 @@ class QCString { std::string s = m_rep; std::transform(s.begin(),s.end(),s.begin(), - [](unsigned char c){ return std::tolower(c); }); + [](unsigned char c){ return (unsigned char)std::tolower(c); }); return s; } @@ -234,7 +234,7 @@ class QCString { std::string s = m_rep; std::transform(s.begin(),s.end(),s.begin(), - [](unsigned char c){ return std::toupper(c); }); + [](unsigned char c){ return (unsigned char)std::toupper(c); }); return s; } @@ -256,7 +256,7 @@ class QCString uint len = s ? qstrlen(s) : 0; if (len>0) { - uint ol = m_rep.size(); + uint ol = (uint)m_rep.size(); if (index>ol) // insert beyond end of string and fill gap with spaces { m_rep.resize(index+len); -- cgit v0.12 From cb5a9c3f31b0233a5dc72d13f9f4cfa7db5fe00c Mon Sep 17 00:00:00 2001 From: albert-github Date: Wed, 10 Jun 2020 21:44:36 +0200 Subject: issue #7778 Build fails with javacc 5.0 (#7779) * issue #7778 Build fails with javacc 5.0 At the moment doxygen works with javaCC version 7.0.5 but no test is done for the version. The minimum requirement has been set to 7.0.5 javacc does not have an option to retrieve the version though when giving `--version` a bit more information is given, this information is filtered. (an issue has been submitted to javacc to obtain the version information: https://github.com/javacc/javacc/issues/172). * issue #7778 Build fails with javacc 5.0 Version detection did not work for `5.0` (only x.y.z was handled, not x.y) * issue #7778 Build fails with javacc 5.0 Based on a review - `--version` is not a valid option, but present already for future use but - removed double ` if(JAVACC_EXECUTABLE)` - Needed `"${JAVACC_TEMP_VERSION}"` as otherwise when `javacc` is found but cannot be executed a message like: ``` CMake Error at cmake/FindJavacc.cmake:11 (string): string sub-command REGEX, mode MATCH needs at least 5 arguments total to command. Call Stack (most recent call first): vhdlparser/CMakeLists.txt:1 (find_package) ``` would appear - reformulated some status strings * issue #7778 Build fails with javacc 5.0 the `.` was not correctly escaped. * issue #7778 Build fails with javacc 5.0 Another one 7.0........ match, going for the suggested match in the cmake CheckCXXCompilerFlag * issue #7778 Build fails with javacc 5.0 Accidently left debug statement. * issue #7778 Build fails with javacc 5.0 Problem has been fixed upstream for version 7.0.7 and up, not using `--version` but `-version` as all command line arguments are starting with a single '-'. Also it is just the bare version, so small extra test so it will work with all versions. --- cmake/FindJavacc.cmake | 17 ++++++++++++++++- vhdlparser/CMakeLists.txt | 6 ++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/cmake/FindJavacc.cmake b/cmake/FindJavacc.cmake index c7de776..a134020 100755 --- a/cmake/FindJavacc.cmake +++ b/cmake/FindJavacc.cmake @@ -1,9 +1,24 @@ - find_program(JAVACC_EXECUTABLE NAMES javacc javaCC Javacc JavaCC javacc.bat DOC "path to the javacc executable") mark_as_advanced(JAVACC_EXECUTABLE) if(JAVACC_EXECUTABLE) set(JAVACC_FOUND 1) message(STATUS "The javacc executable: ${JAVACC_EXECUTABLE}") + execute_process( + COMMAND "${JAVACC_EXECUTABLE}" -version + OUTPUT_VARIABLE JAVACC_TEMP_VERSION + ) + string(REGEX MATCH ".* ([0-9]+(\\.[0-9]+)+) .*" JAVACC_TEMP_VERSION2_UNUSED "${JAVACC_TEMP_VERSION}") + if(CMAKE_MATCH_1) + set(JAVACC_VERSION ${CMAKE_MATCH_1}) + else() + string(REGEX MATCH "([0-9]+(\\.[0-9]+)+)" JAVACC_TEMP_VERSION3_UNUSED "${JAVACC_TEMP_VERSION}") + if(CMAKE_MATCH_1) + set(JAVACC_VERSION ${CMAKE_MATCH_1}) + else() + message(STATUS "Unable to determine JavaCC version, using existing files") + set(JAVACC_FOUND 0) + endif() + endif() else() set(JAVACC_FOUND 0) message(STATUS "The javacc executable not found, using existing files") diff --git a/vhdlparser/CMakeLists.txt b/vhdlparser/CMakeLists.txt index 3e52817..343f126 100644 --- a/vhdlparser/CMakeLists.txt +++ b/vhdlparser/CMakeLists.txt @@ -1,11 +1,17 @@ find_package(Javacc) if (JAVACC_FOUND) + if (JAVACC_VERSION VERSION_LESS 7.0.5) + message(STATUS " Doxygen requires at least JavaCC version 7.0.5 (installed: ${JAVACC_VERSION})") + message(STATUS " Fall back to JavaCC not installed, using existing files.") + else() + add_custom_command( COMMAND ${JAVACC_EXECUTABLE} ${JAVACC_FLAGS} -OUTPUT_DIRECTORY=${CMAKE_SOURCE_DIR}/vhdlparser ${CMAKE_SOURCE_DIR}/vhdlparser/vhdlparser.jj DEPENDS ${CMAKE_SOURCE_DIR}/vhdlparser/vhdlparser.jj OUTPUT ${CMAKE_SOURCE_DIR}/vhdlparser/CharStream.cc ${CMAKE_SOURCE_DIR}/vhdlparser/CharStream.h ${CMAKE_SOURCE_DIR}/vhdlparser/ErrorHandler.h ${CMAKE_SOURCE_DIR}/vhdlparser/ParseException.cc ${CMAKE_SOURCE_DIR}/vhdlparser/ParseException.h ${CMAKE_SOURCE_DIR}/vhdlparser/Token.cc ${CMAKE_SOURCE_DIR}/vhdlparser/Token.h ${CMAKE_SOURCE_DIR}/vhdlparser/TokenManager.h ${CMAKE_SOURCE_DIR}/vhdlparser/TokenMgrError.cc ${CMAKE_SOURCE_DIR}/vhdlparser/TokenMgrError.h ${CMAKE_SOURCE_DIR}/vhdlparser/VhdlParser.cc ${CMAKE_SOURCE_DIR}/vhdlparser/VhdlParser.h ${CMAKE_SOURCE_DIR}/vhdlparser/VhdlParserConstants.h ${CMAKE_SOURCE_DIR}/vhdlparser/VhdlParserTokenManager.cc ${CMAKE_SOURCE_DIR}/vhdlparser/VhdlParserTokenManager.h ) + endif() endif() include_directories(${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/qtools ${GENERATED_SRC}) -- cgit v0.12 From 6b807dd23a21a45ead11a9af48c45d8adf211663 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Wed, 10 Jun 2020 22:15:50 +0200 Subject: Regression: fix issue with substitute characters --- qtools/qcstring.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qtools/qcstring.h b/qtools/qcstring.h index a998fef..acb9c13 100644 --- a/qtools/qcstring.h +++ b/qtools/qcstring.h @@ -511,7 +511,7 @@ QCString substitute(const QCString &s,const QCString &src,const QCString &dst,in inline QCString substitute(const QCString &s,char srcChar,char dstChar) { std::string ss = s.str(); - ss.replace(ss.begin(),ss.end(),srcChar,dstChar); + std::replace(ss.begin(),ss.end(),srcChar,dstChar); return ss; } -- cgit v0.12 From fa4e3f5f955e602f02545e049361510f3334cfff Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Wed, 10 Jun 2020 22:48:21 +0200 Subject: Regression: further fixes to make the documentation build again --- qtools/qcstring.h | 2 +- src/latexdocvisitor.cpp | 165 +-- vhdlparser/VhdlParser.cc | 2 +- vhdlparser/VhdlParser.h | 2797 ++++++++++++++++++++-------------------------- 4 files changed, 1301 insertions(+), 1665 deletions(-) diff --git a/qtools/qcstring.h b/qtools/qcstring.h index acb9c13..0f3f932 100644 --- a/qtools/qcstring.h +++ b/qtools/qcstring.h @@ -350,7 +350,7 @@ class QCString /** Converts the string to a plain C string */ operator const char *() const { - return const_cast(data()); + return data(); } std::string str() const diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp index b899935..19f01b0 100644 --- a/src/latexdocvisitor.cpp +++ b/src/latexdocvisitor.cpp @@ -1,13 +1,13 @@ /****************************************************************************** * - * + * * * * Copyright (C) 1997-2015 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its - * documentation under the terms of the GNU General Public License is hereby - * granted. No representations are made about the suitability of this software + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software * for any purpose. It is provided "as is" without express or implied warranty. * See the GNU General Public License for more details. * @@ -16,7 +16,7 @@ * */ #include "htmlattrib.h" -#include +#include #include "latexdocvisitor.h" #include "latexgen.h" #include "docparser.h" @@ -37,7 +37,7 @@ #include "plantuml.h" const int maxLevels=5; -static const char *secLabels[maxLevels] = +static const char *secLabels[maxLevels] = { "doxysection","doxysubsection","doxysubsubsection","doxyparagraph","doxysubparagraph" }; static const char *getSectionName(int level) @@ -176,8 +176,8 @@ QCString LatexDocVisitor::escapeMakeIndexChars(const char *s) LatexDocVisitor::LatexDocVisitor(FTextStream &t,CodeOutputInterface &ci, - const char *langExt,bool insideTabbing) - : DocVisitor(DocVisitor_Latex), m_t(t), m_ci(ci), m_insidePre(FALSE), + const char *langExt,bool insideTabbing) + : DocVisitor(DocVisitor_Latex), m_t(t), m_ci(ci), m_insidePre(FALSE), m_insideItem(FALSE), m_hide(FALSE), m_hideCaption(FALSE), m_insideTabbing(insideTabbing), m_langExt(langExt) { @@ -322,7 +322,7 @@ void LatexDocVisitor::visit(DocStyleChange *s) if (s->enable()) m_t << "\n\\footnotesize "; else m_t << "\n\\normalsize "; break; case DocStyleChange::Preformatted: - if (s->enable()) + if (s->enable()) { m_t << "\n\\begin{DoxyPre}"; m_insidePre=TRUE; @@ -349,7 +349,7 @@ void LatexDocVisitor::visit(DocVerbatim *s) SrcLangExt langExt = getLanguageFromFileName(lang); switch(s->type()) { - case DocVerbatim::Code: + case DocVerbatim::Code: { m_t << "\n\\begin{DoxyCode}{" << usedTableLevels() << "}\n"; LatexCodeGenerator::setDoxyCodeOpen(TRUE); @@ -360,28 +360,28 @@ void LatexDocVisitor::visit(DocVerbatim *s) m_t << "\\end{DoxyCode}\n"; } break; - case DocVerbatim::Verbatim: + case DocVerbatim::Verbatim: m_t << "\\begin{DoxyVerb}"; m_t << s->text(); m_t << "\\end{DoxyVerb}\n"; break; - case DocVerbatim::HtmlOnly: - case DocVerbatim::XmlOnly: - case DocVerbatim::ManOnly: + case DocVerbatim::HtmlOnly: + case DocVerbatim::XmlOnly: + case DocVerbatim::ManOnly: case DocVerbatim::RtfOnly: case DocVerbatim::DocbookOnly: - /* nothing */ + /* nothing */ break; - case DocVerbatim::LatexOnly: - m_t << s->text(); + case DocVerbatim::LatexOnly: + m_t << s->text(); break; - case DocVerbatim::Dot: + case DocVerbatim::Dot: { static int dotindex = 1; QCString fileName(4096); - fileName.sprintf("%s%d%s", - (Config_getString(LATEX_OUTPUT)+"/inline_dotgraph_").data(), + fileName.sprintf("%s%d%s", + (Config_getString(LATEX_OUTPUT)+"/inline_dotgraph_").data(), dotindex++, ".dot" ); @@ -403,13 +403,13 @@ void LatexDocVisitor::visit(DocVerbatim *s) } } break; - case DocVerbatim::Msc: + case DocVerbatim::Msc: { static int mscindex = 1; QCString baseName(4096); - baseName.sprintf("%s%d", - (Config_getString(LATEX_OUTPUT)+"/inline_mscgraph_").data(), + baseName.sprintf("%s%d", + (Config_getString(LATEX_OUTPUT)+"/inline_mscgraph_").data(), mscindex++ ); QFile file(baseName+".msc"); @@ -431,7 +431,7 @@ void LatexDocVisitor::visit(DocVerbatim *s) } } break; - case DocVerbatim::PlantUML: + case DocVerbatim::PlantUML: { QCString latexOutput = Config_getString(LATEX_OUTPUT); QCString baseName = PlantumlManager::instance()->writePlantUMLSource(latexOutput,s->exampleFile(),s->text(),PlantumlManager::PUML_EPS); @@ -446,11 +446,11 @@ void LatexDocVisitor::visit(DocAnchor *anc) { if (m_hide) return; m_t << "\\label{" << stripPath(anc->file()) << "_" << anc->anchor() << "}%" << endl; - if (!anc->file().isEmpty() && Config_getBool(PDF_HYPERLINKS)) + if (!anc->file().isEmpty() && Config_getBool(PDF_HYPERLINKS)) { - m_t << "\\Hypertarget{" << stripPath(anc->file()) << "_" << anc->anchor() + m_t << "\\Hypertarget{" << stripPath(anc->file()) << "_" << anc->anchor() << "}%" << endl; - } + } } void LatexDocVisitor::visit(DocInclude *inc) @@ -460,7 +460,7 @@ void LatexDocVisitor::visit(DocInclude *inc) switch(inc->type()) { case DocInclude::IncWithLines: - { + { m_t << "\n\\begin{DoxyCodeInclude}{" << usedTableLevels() << "}\n"; LatexCodeGenerator::setDoxyCodeOpen(TRUE); QFileInfo cfi( inc->file() ); @@ -482,8 +482,8 @@ void LatexDocVisitor::visit(DocInclude *inc) LatexCodeGenerator::setDoxyCodeOpen(FALSE); m_t << "\\end{DoxyCodeInclude}" << endl; } - break; - case DocInclude::Include: + break; + case DocInclude::Include: m_t << "\n\\begin{DoxyCodeInclude}{" << usedTableLevels() << "}\n"; LatexCodeGenerator::setDoxyCodeOpen(TRUE); Doxygen::parserManager->getCodeParser(inc->extension()) @@ -511,7 +511,7 @@ void LatexDocVisitor::visit(DocInclude *inc) case DocInclude::LatexInclude: m_t << inc->text(); break; - case DocInclude::VerbInclude: + case DocInclude::VerbInclude: m_t << "\n\\begin{DoxyVerbInclude}\n"; m_t << inc->text(); m_t << "\\end{DoxyVerbInclude}\n"; @@ -544,7 +544,7 @@ void LatexDocVisitor::visit(DocInclude *inc) extractBlock(inc->text(),inc->blockId()), langExt, inc->isExample(), - inc->exampleFile(), + inc->exampleFile(), fd, lineBlock(inc->text(),inc->blockId()), -1, // endLine @@ -557,8 +557,8 @@ void LatexDocVisitor::visit(DocInclude *inc) m_t << "\\end{DoxyCodeInclude}" << endl; } break; - case DocInclude::SnippetDoc: - case DocInclude::IncludeDoc: + case DocInclude::SnippetDoc: + case DocInclude::IncludeDoc: err("Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s" "Please create a bug report\n",__FILE__); break; @@ -569,7 +569,7 @@ void LatexDocVisitor::visit(DocIncOperator *op) { //printf("DocIncOperator: type=%d first=%d, last=%d text='%s'\n", // op->type(),op->isFirst(),op->isLast(),op->text().data()); - if (op->isFirst()) + if (op->isFirst()) { if (!m_hide) m_t << "\n\\begin{DoxyCodeInclude}{" << usedTableLevels() << "}\n"; LatexCodeGenerator::setDoxyCodeOpen(TRUE); @@ -579,10 +579,10 @@ void LatexDocVisitor::visit(DocIncOperator *op) QCString locLangExt = getFileNameExtension(op->includeFileName()); if (locLangExt.isEmpty()) locLangExt = m_langExt; SrcLangExt langExt = getLanguageFromFileName(locLangExt); - if (op->type()!=DocIncOperator::Skip) + if (op->type()!=DocIncOperator::Skip) { popEnabled(); - if (!m_hide) + if (!m_hide) { FileDef *fd = 0; if (!op->includeFileName().isEmpty()) @@ -606,7 +606,7 @@ void LatexDocVisitor::visit(DocIncOperator *op) pushEnabled(); m_hide=TRUE; } - if (op->isLast()) + if (op->isLast()) { popEnabled(); LatexCodeGenerator::setDoxyCodeOpen(FALSE); @@ -621,7 +621,8 @@ void LatexDocVisitor::visit(DocIncOperator *op) void LatexDocVisitor::visit(DocFormula *f) { if (m_hide) return; - const char *p=f->text(); + QCString s = f->text(); + const char *p = s.data(); char c; if (p) { @@ -653,7 +654,7 @@ void LatexDocVisitor::visit(DocSimpleSectSep *) void LatexDocVisitor::visit(DocCite *cite) { if (m_hide) return; - if (!cite->file().isEmpty()) + if (!cite->file().isEmpty()) { //startLink(cite->ref(),cite->file(),cite->anchor()); QCString anchor = cite->anchor(); @@ -705,11 +706,11 @@ void LatexDocVisitor::visitPre(DocAutoListItem *) m_t << "\n\\item "; } -void LatexDocVisitor::visitPost(DocAutoListItem *) +void LatexDocVisitor::visitPost(DocAutoListItem *) { } -void LatexDocVisitor::visitPre(DocPara *) +void LatexDocVisitor::visitPre(DocPara *) { } @@ -799,7 +800,7 @@ void LatexDocVisitor::visitPre(DocSimpleSect *s) case DocSimpleSect::User: m_t << "\\begin{DoxyParagraph}{"; break; - case DocSimpleSect::Rcs: + case DocSimpleSect::Rcs: m_t << "\\begin{DoxyParagraph}{"; break; case DocSimpleSect::Unknown: break; @@ -869,7 +870,7 @@ void LatexDocVisitor::visitPost(DocSimpleSect *s) case DocSimpleSect::User: m_t << "\n\\end{DoxyParagraph}\n"; break; - case DocSimpleSect::Rcs: + case DocSimpleSect::Rcs: m_t << "\n\\end{DoxyParagraph}\n"; break; default: @@ -906,7 +907,7 @@ void LatexDocVisitor::visitPre(DocSimpleListItem *) m_t << "\\item "; } -void LatexDocVisitor::visitPost(DocSimpleListItem *) +void LatexDocVisitor::visitPost(DocSimpleListItem *) { } @@ -922,25 +923,25 @@ void LatexDocVisitor::visitPre(DocSection *s) m_t << "}\\label{" << stripPath(s->file()) << "_" << s->anchor() << "}" << endl; } -void LatexDocVisitor::visitPost(DocSection *) +void LatexDocVisitor::visitPost(DocSection *) { } void LatexDocVisitor::visitPre(DocHtmlList *s) { if (m_hide) return; - if (s->type()==DocHtmlList::Ordered) + if (s->type()==DocHtmlList::Ordered) m_t << "\n\\begin{DoxyEnumerate}"; - else + else m_t << "\n\\begin{DoxyItemize}"; } -void LatexDocVisitor::visitPost(DocHtmlList *s) +void LatexDocVisitor::visitPost(DocHtmlList *s) { if (m_hide) return; - if (s->type()==DocHtmlList::Ordered) + if (s->type()==DocHtmlList::Ordered) m_t << "\n\\end{DoxyEnumerate}"; - else + else m_t << "\n\\end{DoxyItemize}"; } @@ -950,7 +951,7 @@ void LatexDocVisitor::visitPre(DocHtmlListItem *) m_t << "\n\\item "; } -void LatexDocVisitor::visitPost(DocHtmlListItem *) +void LatexDocVisitor::visitPost(DocHtmlListItem *) { } @@ -960,7 +961,7 @@ void LatexDocVisitor::visitPost(DocHtmlListItem *) // m_insidePre=TRUE; //} -//void LatexDocVisitor::visitPost(DocHtmlPre *) +//void LatexDocVisitor::visitPost(DocHtmlPre *) //{ // m_insidePre=FALSE; // m_t << "\\end{alltt}\\normalsize " << endl; @@ -980,7 +981,7 @@ void LatexDocVisitor::visitPre(DocHtmlDescList *dl) } } -void LatexDocVisitor::visitPost(DocHtmlDescList *dl) +void LatexDocVisitor::visitPost(DocHtmlDescList *dl) { if (m_hide) return; QCString val = dl->attribs().find("class"); @@ -1001,7 +1002,7 @@ void LatexDocVisitor::visitPre(DocHtmlDescTitle *) m_insideItem=TRUE; } -void LatexDocVisitor::visitPost(DocHtmlDescTitle *) +void LatexDocVisitor::visitPost(DocHtmlDescTitle *) { if (m_hide) return; m_insideItem=FALSE; @@ -1012,7 +1013,7 @@ void LatexDocVisitor::visitPre(DocHtmlDescData *) { } -void LatexDocVisitor::visitPost(DocHtmlDescData *) +void LatexDocVisitor::visitPost(DocHtmlDescData *) { } @@ -1120,7 +1121,7 @@ void LatexDocVisitor::visitPre(DocHtmlRow *r) setCurrentColumn(0); } -void LatexDocVisitor::visitPost(DocHtmlRow *row) +void LatexDocVisitor::visitPost(DocHtmlRow *row) { if (m_hide) return; @@ -1155,7 +1156,7 @@ void LatexDocVisitor::visitPost(DocHtmlRow *row) } m_t << "\\\\"; - + int col = 1; uint i; for (i=0;iisHeading()) @@ -1317,7 +1318,7 @@ void LatexDocVisitor::visitPre(DocInternal *) //m_t << "}\n"; } -void LatexDocVisitor::visitPost(DocInternal *) +void LatexDocVisitor::visitPost(DocInternal *) { if (m_hide) return; //m_t << "\\end{DoxyInternal}" << endl; @@ -1335,7 +1336,7 @@ void LatexDocVisitor::visitPre(DocHRef *href) m_t << "{\\texttt{ "; } -void LatexDocVisitor::visitPost(DocHRef *) +void LatexDocVisitor::visitPost(DocHRef *) { if (m_hide) return; m_t << "}}"; @@ -1347,7 +1348,7 @@ void LatexDocVisitor::visitPre(DocHtmlHeader *header) m_t << "\\" << getSectionName(header->level()) << "*{"; } -void LatexDocVisitor::visitPost(DocHtmlHeader *) +void LatexDocVisitor::visitPost(DocHtmlHeader *) { if (m_hide) return; m_t << "}"; @@ -1372,7 +1373,7 @@ void LatexDocVisitor::visitPre(DocImage *img) } } -void LatexDocVisitor::visitPost(DocImage *img) +void LatexDocVisitor::visitPost(DocImage *img) { if (img->type()==DocImage::Latex) { @@ -1391,7 +1392,7 @@ void LatexDocVisitor::visitPre(DocDotFile *df) startDotFile(df->file(),df->width(),df->height(),df->hasCaption()); } -void LatexDocVisitor::visitPost(DocDotFile *df) +void LatexDocVisitor::visitPost(DocDotFile *df) { if (m_hide) return; endDotFile(df->hasCaption()); @@ -1402,7 +1403,7 @@ void LatexDocVisitor::visitPre(DocMscFile *df) startMscFile(df->file(),df->width(),df->height(),df->hasCaption()); } -void LatexDocVisitor::visitPost(DocMscFile *df) +void LatexDocVisitor::visitPost(DocMscFile *df) { if (m_hide) return; endMscFile(df->hasCaption()); @@ -1425,7 +1426,7 @@ void LatexDocVisitor::visitPre(DocLink *lnk) startLink(lnk->ref(),lnk->file(),lnk->anchor()); } -void LatexDocVisitor::visitPost(DocLink *lnk) +void LatexDocVisitor::visitPost(DocLink *lnk) { if (m_hide) return; endLink(lnk->ref(),lnk->file(),lnk->anchor()); @@ -1447,7 +1448,7 @@ void LatexDocVisitor::visitPre(DocRef *ref) if (!ref->hasLinkText()) filter(ref->targetTitle()); } -void LatexDocVisitor::visitPost(DocRef *ref) +void LatexDocVisitor::visitPost(DocRef *ref) { if (m_hide) return; if (ref->isSubPage()) @@ -1471,7 +1472,7 @@ void LatexDocVisitor::visitPre(DocSecRefItem *ref) } } -void LatexDocVisitor::visitPost(DocSecRefItem *ref) +void LatexDocVisitor::visitPost(DocSecRefItem *ref) { if (m_hide) return; static bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS); @@ -1490,7 +1491,7 @@ void LatexDocVisitor::visitPre(DocSecRefList *) m_t << "\\begin{DoxyCompactList}" << endl; } -void LatexDocVisitor::visitPost(DocSecRefList *) +void LatexDocVisitor::visitPost(DocSecRefList *) { if (m_hide) return; m_t << "\\end{DoxyCompactList}" << endl; @@ -1517,11 +1518,11 @@ void LatexDocVisitor::visitPre(DocParamSect *s) m_t << "\n\\begin{DoxyRetVals}{"; filter(theTranslator->trReturnValues()); break; - case DocParamSect::Exception: + case DocParamSect::Exception: m_t << "\n\\begin{DoxyExceptions}{"; filter(theTranslator->trExceptions()); break; - case DocParamSect::TemplateParam: + case DocParamSect::TemplateParam: m_t << "\n\\begin{DoxyTemplParams}{"; filter(theTranslator->trTemplateParameters()); break; @@ -1543,10 +1544,10 @@ void LatexDocVisitor::visitPost(DocParamSect *s) case DocParamSect::RetVal: m_t << "\\end{DoxyRetVals}\n"; break; - case DocParamSect::Exception: + case DocParamSect::Exception: m_t << "\\end{DoxyExceptions}\n"; break; - case DocParamSect::TemplateParam: + case DocParamSect::TemplateParam: m_t << "\\end{DoxyTemplParams}\n"; break; default: @@ -1601,11 +1602,11 @@ void LatexDocVisitor::visitPre(DocParamList *pl) { if (type->kind()==DocNode::Kind_Word) { - visit((DocWord*)type); + visit((DocWord*)type); } else if (type->kind()==DocNode::Kind_LinkedWord) { - visit((DocLinkedWord*)type); + visit((DocLinkedWord*)type); } else if (type->kind()==DocNode::Kind_Sep) { @@ -1626,11 +1627,11 @@ void LatexDocVisitor::visitPre(DocParamList *pl) m_insideItem=TRUE; if (param->kind()==DocNode::Kind_Word) { - visit((DocWord*)param); + visit((DocWord*)param); } else if (param->kind()==DocNode::Kind_LinkedWord) { - visit((DocLinkedWord*)param); + visit((DocLinkedWord*)param); } m_insideItem=FALSE; } @@ -1705,7 +1706,7 @@ void LatexDocVisitor::visitPre(DocInternalRef *ref) startLink(0,ref->file(),ref->anchor()); } -void LatexDocVisitor::visitPost(DocInternalRef *ref) +void LatexDocVisitor::visitPost(DocInternalRef *ref) { if (m_hide) return; endLink(0,ref->file(),ref->anchor()); @@ -1752,7 +1753,7 @@ void LatexDocVisitor::visitPost(DocParBlock *) } void LatexDocVisitor::filter(const char *str) -{ +{ filterLatexString(m_t,str,m_insideTabbing,m_insidePre,m_insideItem); } @@ -1833,7 +1834,7 @@ void LatexDocVisitor::startDotFile(const QCString &fileName, if ((i=baseName.findRev('/'))!=-1) { baseName=baseName.right(baseName.length()-i-1); - } + } if ((i=baseName.find('.'))!=-1) { baseName=baseName.left(i); @@ -1862,7 +1863,7 @@ void LatexDocVisitor::startMscFile(const QCString &fileName, if ((i=baseName.findRev('/'))!=-1) { baseName=baseName.right(baseName.length()-i-1); - } + } if ((i=baseName.find('.'))!=-1) { baseName=baseName.left(i); @@ -1870,7 +1871,7 @@ void LatexDocVisitor::startMscFile(const QCString &fileName, baseName.prepend("msc_"); QCString outDir = Config_getString(LATEX_OUTPUT); - writeMscGraphFromFile(fileName,outDir,baseName,MSC_EPS); + writeMscGraphFromFile(fileName,outDir,baseName,MSC_EPS); visitPreStart(m_t,hasCaption, baseName, width, height); } @@ -1888,7 +1889,7 @@ void LatexDocVisitor::writeMscFile(const QCString &baseName, DocVerbatim *s) if ((i=shortName.findRev('/'))!=-1) { shortName=shortName.right(shortName.length()-i-1); - } + } QCString outDir = Config_getString(LATEX_OUTPUT); writeMscGraphFromFile(baseName+".msc",outDir,shortName,MSC_EPS); visitPreStart(m_t, s->hasCaption(), shortName, s->width(),s->height()); diff --git a/vhdlparser/VhdlParser.cc b/vhdlparser/VhdlParser.cc index dd96740..3c0fe35 100644 --- a/vhdlparser/VhdlParser.cc +++ b/vhdlparser/VhdlParser.cc @@ -1907,7 +1907,7 @@ void VhdlParser::concurrent_statement() { if (!hasError) { process_statement(); } - } else if (jj_2_20(2147483647)) { + } else if (jj_2_20(3)) { if (!hasError) { generate_statement(); } diff --git a/vhdlparser/VhdlParser.h b/vhdlparser/VhdlParser.h index 088be16..891b085 100644 --- a/vhdlparser/VhdlParser.h +++ b/vhdlparser/VhdlParser.h @@ -1303,7 +1303,7 @@ void parseInline(); { jj_save(124, xla); } } - inline bool jj_3R_209() + inline bool jj_3R_207() { if (jj_done) return true; if (jj_scan_token(VARASSIGN_T)) return true; @@ -1311,33 +1311,33 @@ void parseInline(); return false; } - inline bool jj_3R_471() + inline bool jj_3R_461() { if (jj_done) return true; if (jj_scan_token(FOR_T)) return true; - if (jj_3R_428()) return true; + if (jj_3R_543()) return true; return false; } - inline bool jj_3R_208() + inline bool jj_3R_206() { if (jj_done) return true; - if (jj_3R_368()) return true; + if (jj_3R_363()) return true; return false; } - inline bool jj_3R_388() + inline bool jj_3R_383() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_470()) return false; + if (!jj_3R_460()) return false; jj_scanpos = xsp; - if (jj_3R_471()) return true; + if (jj_3R_461()) return true; return false; } - inline bool jj_3R_470() + inline bool jj_3R_460() { if (jj_done) return true; if (jj_scan_token(WHILE_T)) return true; @@ -1345,15 +1345,15 @@ void parseInline(); return false; } - inline bool jj_3R_420() + inline bool jj_3R_415() { if (jj_done) return true; if (jj_scan_token(SEMI_T)) return true; - if (jj_3R_419()) return true; + if (jj_3R_414()) return true; return false; } - inline bool jj_3R_434() + inline bool jj_3R_424() { if (jj_done) return true; if (jj_scan_token(LPAREN_T)) return true; @@ -1362,7 +1362,7 @@ void parseInline(); return false; } - inline bool jj_3R_206() + inline bool jj_3R_204() { if (jj_done) return true; Token * xsp; @@ -1382,27 +1382,27 @@ void parseInline(); if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_206()) jj_scanpos = xsp; - if (jj_3R_207()) return true; + if (jj_3R_204()) jj_scanpos = xsp; + if (jj_3R_205()) return true; if (jj_scan_token(COLON_T)) return true; xsp = jj_scanpos; - if (jj_3R_208()) jj_scanpos = xsp; + if (jj_3R_206()) jj_scanpos = xsp; if (jj_3R_89()) return true; xsp = jj_scanpos; if (jj_scan_token(27)) jj_scanpos = xsp; xsp = jj_scanpos; - if (jj_3R_209()) jj_scanpos = xsp; + if (jj_3R_207()) jj_scanpos = xsp; return false; } - inline bool jj_3R_329() + inline bool jj_3R_327() { if (jj_done) return true; - if (jj_3R_419()) return true; + if (jj_3R_414()) return true; Token * xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_420()) { jj_scanpos = xsp; break; } + if (jj_3R_415()) { jj_scanpos = xsp; break; } } return false; } @@ -1411,23 +1411,23 @@ void parseInline(); { if (jj_done) return true; if (jj_scan_token(FILE_T)) return true; - if (jj_3R_207()) return true; + if (jj_3R_205()) return true; if (jj_scan_token(COLON_T)) return true; if (jj_3R_89()) return true; return false; } - inline bool jj_3R_728() + inline bool jj_3R_693() { if (jj_done) return true; if (jj_3R_74()) return true; return false; } - inline bool jj_3R_419() + inline bool jj_3R_414() { if (jj_done) return true; - if (jj_3R_523()) return true; + if (jj_3R_513()) return true; return false; } @@ -1438,27 +1438,27 @@ void parseInline(); return false; } - inline bool jj_3R_454() + inline bool jj_3R_444() { if (jj_done) return true; if (jj_scan_token(IS_T)) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_728()) return false; + if (!jj_3R_693()) return false; jj_scanpos = xsp; if (jj_scan_token(145)) return true; return false; } - inline bool jj_3R_584() + inline bool jj_3R_572() { if (jj_done) return true; - if (jj_3R_645()) return true; + if (jj_3R_625()) return true; if (jj_3R_74()) return true; return false; } - inline bool jj_3R_583() + inline bool jj_3R_571() { if (jj_done) return true; if (jj_3R_98()) return true; @@ -1486,7 +1486,7 @@ void parseInline(); return false; } - inline bool jj_3R_523() + inline bool jj_3R_513() { if (jj_done) return true; Token * xsp; @@ -1499,9 +1499,9 @@ void parseInline(); jj_scanpos = xsp; if (!jj_3_45()) return false; jj_scanpos = xsp; - if (!jj_3R_583()) return false; + if (!jj_3R_571()) return false; jj_scanpos = xsp; - if (jj_3R_584()) return true; + if (jj_3R_572()) return true; return false; } @@ -1528,48 +1528,48 @@ void parseInline(); return false; } - inline bool jj_3R_437() + inline bool jj_3R_427() { if (jj_done) return true; if (jj_scan_token(ALL_T)) return true; return false; } - inline bool jj_3R_436() + inline bool jj_3R_426() { if (jj_done) return true; if (jj_scan_token(OTHER_T)) return true; return false; } - inline bool jj_3R_653() + inline bool jj_3R_631() { if (jj_done) return true; if (jj_3R_74()) return true; return false; } - inline bool jj_3R_348() + inline bool jj_3R_343() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_435()) return false; + if (!jj_3R_425()) return false; jj_scanpos = xsp; - if (!jj_3R_436()) return false; + if (!jj_3R_426()) return false; jj_scanpos = xsp; - if (jj_3R_437()) return true; + if (jj_3R_427()) return true; return false; } - inline bool jj_3R_435() + inline bool jj_3R_425() { if (jj_done) return true; - if (jj_3R_207()) return true; + if (jj_3R_205()) return true; return false; } - inline bool jj_3R_345() + inline bool jj_3R_340() { if (jj_done) return true; if (jj_scan_token(CONFIGURATION_T)) return true; @@ -1577,7 +1577,7 @@ void parseInline(); return false; } - inline bool jj_3R_344() + inline bool jj_3R_339() { if (jj_done) return true; if (jj_scan_token(ENTITY_T)) return true; @@ -1586,20 +1586,20 @@ void parseInline(); if (jj_3_41()) jj_scanpos = xsp; if (jj_3R_63()) return true; xsp = jj_scanpos; - if (jj_3R_434()) jj_scanpos = xsp; + if (jj_3R_424()) jj_scanpos = xsp; return false; } - inline bool jj_3R_179() + inline bool jj_3R_177() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_343()) return false; + if (!jj_3R_338()) return false; jj_scanpos = xsp; - if (!jj_3R_344()) return false; + if (!jj_3R_339()) return false; jj_scanpos = xsp; - if (jj_3R_345()) return true; + if (jj_3R_340()) return true; return false; } @@ -1610,7 +1610,7 @@ void parseInline(); return false; } - inline bool jj_3R_343() + inline bool jj_3R_338() { if (jj_done) return true; Token * xsp; @@ -1620,7 +1620,7 @@ void parseInline(); return false; } - inline bool jj_3R_757() + inline bool jj_3R_722() { if (jj_done) return true; if (jj_3R_161()) return true; @@ -1629,36 +1629,36 @@ void parseInline(); return false; } - inline bool jj_3R_650() + inline bool jj_3R_628() { if (jj_done) return true; if (jj_3R_61()) return true; return false; } - inline bool jj_3R_649() + inline bool jj_3R_627() { if (jj_done) return true; if (jj_3R_72()) return true; return false; } - inline bool jj_3R_597() + inline bool jj_3R_577() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_649()) return false; + if (!jj_3R_627()) return false; jj_scanpos = xsp; - if (jj_3R_650()) return true; + if (jj_3R_628()) return true; return false; } - inline bool jj_3R_548() + inline bool jj_3R_535() { if (jj_done) return true; if (jj_scan_token(LPAREN_T)) return true; - if (jj_3R_329()) return true; + if (jj_3R_327()) return true; if (jj_scan_token(RPAREN_T)) return true; return false; } @@ -1671,14 +1671,14 @@ void parseInline(); return false; } - inline bool jj_3R_452() + inline bool jj_3R_442() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; if (jj_scan_token(77)) jj_scanpos = xsp; xsp = jj_scanpos; - if (jj_3R_548()) jj_scanpos = xsp; + if (jj_3R_535()) jj_scanpos = xsp; return false; } @@ -1696,7 +1696,7 @@ void parseInline(); return false; } - inline bool jj_3R_559() + inline bool jj_3R_547() { if (jj_done) return true; if (jj_scan_token(TYPE_T)) return true; @@ -1705,7 +1705,7 @@ void parseInline(); return false; } - inline bool jj_3R_406() + inline bool jj_3R_401() { if (jj_done) return true; if (jj_3R_61()) return true; @@ -1719,30 +1719,30 @@ void parseInline(); return false; } - inline bool jj_3R_558() + inline bool jj_3R_546() { if (jj_done) return true; if (jj_scan_token(COMMA_T)) return true; - if (jj_3R_476()) return true; + if (jj_3R_466()) return true; return false; } - inline bool jj_3R_652() + inline bool jj_3R_630() { if (jj_done) return true; if (jj_scan_token(ELSE_T)) return true; - if (jj_3R_270()) return true; + if (jj_3R_268()) return true; return false; } - inline bool jj_3R_318() + inline bool jj_3R_316() { if (jj_done) return true; - if (jj_3R_404()) return true; + if (jj_3R_399()) return true; return false; } - inline bool jj_3R_573() + inline bool jj_3R_561() { if (jj_done) return true; if (jj_scan_token(WHEN_T)) return true; @@ -1750,7 +1750,7 @@ void parseInline(); return false; } - inline bool jj_3R_453() + inline bool jj_3R_443() { if (jj_done) return true; Token * xsp; @@ -1761,33 +1761,33 @@ void parseInline(); return false; } - inline bool jj_3R_651() + inline bool jj_3R_629() { if (jj_done) return true; if (jj_scan_token(ELSIF_T)) return true; if (jj_3R_83()) return true; if (jj_scan_token(THEN_T)) return true; - if (jj_3R_270()) return true; + if (jj_3R_268()) return true; return false; } - inline bool jj_3R_366() + inline bool jj_3R_361() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_453()) jj_scanpos = xsp; + if (jj_3R_443()) jj_scanpos = xsp; if (jj_scan_token(FUNCTION_T)) return true; if (jj_3R_63()) return true; - if (jj_3R_452()) return true; + if (jj_3R_442()) return true; if (jj_scan_token(RETURN_T)) return true; if (jj_3R_63()) return true; xsp = jj_scanpos; - if (jj_3R_454()) jj_scanpos = xsp; + if (jj_3R_444()) jj_scanpos = xsp; return false; } - inline bool jj_3R_367() + inline bool jj_3R_362() { if (jj_done) return true; if (jj_scan_token(COMMA_T)) return true; @@ -1795,16 +1795,16 @@ void parseInline(); return false; } - inline bool jj_3R_365() + inline bool jj_3R_360() { if (jj_done) return true; if (jj_scan_token(PROCEDURE_T)) return true; if (jj_3R_74()) return true; - if (jj_3R_452()) return true; + if (jj_3R_442()) return true; return false; } - inline bool jj_3R_266() + inline bool jj_3R_264() { if (jj_done) return true; if (jj_3R_74()) return true; @@ -1817,36 +1817,36 @@ void parseInline(); if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_266()) jj_scanpos = xsp; + if (jj_3R_264()) jj_scanpos = xsp; if (jj_scan_token(IF_T)) return true; if (jj_3R_83()) return true; if (jj_scan_token(THEN_T)) return true; - if (jj_3R_270()) return true; + if (jj_3R_268()) return true; while (true) { xsp = jj_scanpos; - if (jj_3R_651()) { jj_scanpos = xsp; break; } + if (jj_3R_629()) { jj_scanpos = xsp; break; } } xsp = jj_scanpos; - if (jj_3R_652()) jj_scanpos = xsp; + if (jj_3R_630()) jj_scanpos = xsp; if (jj_scan_token(END_T)) return true; if (jj_scan_token(IF_T)) return true; xsp = jj_scanpos; - if (jj_3R_653()) jj_scanpos = xsp; + if (jj_3R_631()) jj_scanpos = xsp; if (jj_scan_token(SEMI_T)) return true; return false; } - inline bool jj_3R_205() + inline bool jj_3R_203() { if (jj_done) return true; - if (jj_3R_366()) return true; + if (jj_3R_361()) return true; return false; } - inline bool jj_3R_204() + inline bool jj_3R_202() { if (jj_done) return true; - if (jj_3R_365()) return true; + if (jj_3R_360()) return true; return false; } @@ -1855,32 +1855,32 @@ void parseInline(); if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_204()) return false; + if (!jj_3R_202()) return false; jj_scanpos = xsp; - if (jj_3R_205()) return true; + if (jj_3R_203()) return true; return false; } - inline bool jj_3R_207() + inline bool jj_3R_205() { if (jj_done) return true; if (jj_3R_63()) return true; Token * xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_367()) { jj_scanpos = xsp; break; } + if (jj_3R_362()) { jj_scanpos = xsp; break; } } return false; } - inline bool jj_3R_503() + inline bool jj_3R_493() { if (jj_done) return true; if (jj_scan_token(ELSE_T)) return true; if (jj_3R_61()) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_573()) jj_scanpos = xsp; + if (jj_3R_561()) jj_scanpos = xsp; return false; } @@ -1891,14 +1891,14 @@ void parseInline(); return false; } - inline bool jj_3R_405() + inline bool jj_3R_400() { if (jj_done) return true; Token * xsp; - if (jj_3R_503()) return true; + if (jj_3R_493()) return true; while (true) { xsp = jj_scanpos; - if (jj_3R_503()) { jj_scanpos = xsp; break; } + if (jj_3R_493()) { jj_scanpos = xsp; break; } } return false; } @@ -1921,15 +1921,15 @@ void parseInline(); return false; } - inline bool jj_3R_572() + inline bool jj_3R_560() { if (jj_done) return true; if (jj_scan_token(COMMA_T)) return true; - if (jj_3R_571()) return true; + if (jj_3R_559()) return true; return false; } - inline bool jj_3R_404() + inline bool jj_3R_399() { if (jj_done) return true; Token * xsp; @@ -1940,25 +1940,25 @@ void parseInline(); return false; } - inline bool jj_3R_476() + inline bool jj_3R_466() { if (jj_done) return true; - if (jj_3R_473()) return true; + if (jj_3R_463()) return true; if (jj_scan_token(WHEN_T)) return true; if (jj_3R_90()) return true; Token * xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_558()) { jj_scanpos = xsp; break; } + if (jj_3R_546()) { jj_scanpos = xsp; break; } } if (jj_scan_token(SEMI_T)) return true; return false; } - inline bool jj_3R_475() + inline bool jj_3R_465() { if (jj_done) return true; - if (jj_3R_425()) return true; + if (jj_3R_420()) return true; return false; } @@ -1969,13 +1969,13 @@ void parseInline(); if (jj_3R_74()) return true; if (jj_scan_token(IS_T)) return true; if (jj_scan_token(LPAREN_T)) return true; - if (jj_3R_501()) return true; + if (jj_3R_491()) return true; if (jj_scan_token(RPAREN_T)) return true; if (jj_scan_token(SEMI_T)) return true; return false; } - inline bool jj_3R_319() + inline bool jj_3R_317() { if (jj_done) return true; if (jj_3R_61()) return true; @@ -1988,12 +1988,12 @@ void parseInline(); if (jj_scan_token(137)) return true; while (true) { xsp = jj_scanpos; - if (jj_3R_406()) { jj_scanpos = xsp; break; } + if (jj_3R_401()) { jj_scanpos = xsp; break; } } return false; } - inline bool jj_3R_403() + inline bool jj_3R_398() { if (jj_done) return true; if (jj_scan_token(GROUP_T)) return true; @@ -2001,7 +2001,7 @@ void parseInline(); if (jj_scan_token(COLON_T)) return true; if (jj_3R_74()) return true; if (jj_scan_token(LPAREN_T)) return true; - if (jj_3R_502()) return true; + if (jj_3R_492()) return true; if (jj_scan_token(RPAREN_T)) return true; if (jj_scan_token(SEMI_T)) return true; return false; @@ -2020,19 +2020,19 @@ void parseInline(); if (jj_scan_token(LESSTHAN_T)) return true; if (jj_scan_token(FORCE_T)) return true; xsp = jj_scanpos; - if (jj_3R_318()) jj_scanpos = xsp; - if (jj_3R_319()) return true; + if (jj_3R_316()) jj_scanpos = xsp; + if (jj_3R_317()) return true; return false; } - inline bool jj_3R_502() + inline bool jj_3R_492() { if (jj_done) return true; - if (jj_3R_571()) return true; + if (jj_3R_559()) return true; Token * xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_572()) { jj_scanpos = xsp; break; } + if (jj_3R_560()) { jj_scanpos = xsp; break; } } return false; } @@ -2044,7 +2044,7 @@ void parseInline(); return false; } - inline bool jj_3R_390() + inline bool jj_3R_385() { if (jj_done) return true; if (jj_scan_token(WITH_T)) return true; @@ -2056,37 +2056,37 @@ void parseInline(); if (jj_3R_119()) return true; if (jj_scan_token(LESSTHAN_T)) return true; xsp = jj_scanpos; - if (jj_3R_475()) jj_scanpos = xsp; - if (jj_3R_476()) return true; + if (jj_3R_465()) jj_scanpos = xsp; + if (jj_3R_466()) return true; return false; } - inline bool jj_3R_640() + inline bool jj_3R_620() { if (jj_done) return true; - if (jj_3R_374()) return true; + if (jj_3R_369()) return true; return false; } - inline bool jj_3R_639() + inline bool jj_3R_619() { if (jj_done) return true; if (jj_3R_63()) return true; return false; } - inline bool jj_3R_571() + inline bool jj_3R_559() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_639()) return false; + if (!jj_3R_619()) return false; jj_scanpos = xsp; - if (jj_3R_640()) return true; + if (jj_3R_620()) return true; return false; } - inline bool jj_3R_722() + inline bool jj_3R_687() { if (jj_done) return true; if (jj_3R_63()) return true; @@ -2104,21 +2104,21 @@ void parseInline(); return false; } - inline bool jj_3R_721() + inline bool jj_3R_686() { if (jj_done) return true; if (jj_3R_114()) return true; return false; } - inline bool jj_3R_696() + inline bool jj_3R_663() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_721()) return false; + if (!jj_3R_686()) return false; jj_scanpos = xsp; - if (jj_3R_722()) return true; + if (jj_3R_687()) return true; return false; } @@ -2130,14 +2130,7 @@ void parseInline(); return false; } - inline bool jj_3R_176() - { - if (jj_done) return true; - if (jj_3R_74()) return true; - return false; - } - - inline bool jj_3R_607() + inline bool jj_3R_587() { if (jj_done) return true; if (jj_scan_token(WHEN_T)) return true; @@ -2152,7 +2145,7 @@ void parseInline(); return false; } - inline bool jj_3R_555() + inline bool jj_3R_542() { if (jj_done) return true; if (jj_scan_token(WITH_T)) return true; @@ -2161,16 +2154,16 @@ void parseInline(); Token * xsp; xsp = jj_scanpos; if (jj_scan_token(155)) jj_scanpos = xsp; - if (jj_3R_696()) return true; + if (jj_3R_663()) return true; if (jj_scan_token(VARASSIGN_T)) return true; - if (jj_3R_319()) return true; + if (jj_3R_317()) return true; return false; } inline bool jj_3R_162() { if (jj_done) return true; - if (jj_3R_329()) return true; + if (jj_3R_327()) return true; return false; } @@ -2182,14 +2175,14 @@ void parseInline(); return false; } - inline bool jj_3R_316() + inline bool jj_3R_314() { if (jj_done) return true; - if (jj_3R_404()) return true; + if (jj_3R_399()) return true; return false; } - inline bool jj_3R_314() + inline bool jj_3R_312() { if (jj_done) return true; if (jj_3R_148()) return true; @@ -2197,18 +2190,18 @@ void parseInline(); return false; } - inline bool jj_3R_317() + inline bool jj_3R_315() { if (jj_done) return true; if (jj_3R_61()) return true; - if (jj_3R_405()) return true; + if (jj_3R_400()) return true; return false; } - inline bool jj_3R_474() + inline bool jj_3R_464() { if (jj_done) return true; - if (jj_3R_557()) return true; + if (jj_3R_545()) return true; return false; } @@ -2223,10 +2216,10 @@ void parseInline(); return false; } - inline bool jj_3R_282() + inline bool jj_3R_280() { if (jj_done) return true; - if (jj_3R_390()) return true; + if (jj_3R_385()) return true; return false; } @@ -2235,27 +2228,23 @@ void parseInline(); if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_281()) return false; + if (!jj_3R_279()) return false; jj_scanpos = xsp; - if (jj_3R_282()) return true; + if (jj_3R_280()) return true; return false; } - inline bool jj_3R_281() + inline bool jj_3R_279() { if (jj_done) return true; if (jj_3R_150()) return true; return false; } - inline bool jj_3R_338() + inline bool jj_3R_336() { if (jj_done) return true; if (jj_scan_token(IF_T)) return true; - Token * xsp; - xsp = jj_scanpos; - if (jj_3_39()) jj_scanpos = xsp; - if (jj_3R_83()) return true; return false; } @@ -2264,24 +2253,23 @@ void parseInline(); if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_337()) return false; + if (!jj_3R_335()) return false; jj_scanpos = xsp; - if (jj_3R_338()) return true; + if (jj_3R_336()) return true; return false; } - inline bool jj_3R_337() + inline bool jj_3R_335() { if (jj_done) return true; if (jj_scan_token(FOR_T)) return true; - if (jj_3R_428()) return true; return false; } - inline bool jj_3R_472() + inline bool jj_3R_462() { if (jj_done) return true; - if (jj_3R_425()) return true; + if (jj_3R_420()) return true; return false; } @@ -2293,23 +2281,23 @@ void parseInline(); if (jj_scan_token(FORCE_T)) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_316()) jj_scanpos = xsp; + if (jj_3R_314()) jj_scanpos = xsp; if (jj_3R_61()) return true; if (jj_scan_token(WHEN_T)) return true; xsp = jj_scanpos; - if (jj_3R_317()) jj_scanpos = xsp; + if (jj_3R_315()) jj_scanpos = xsp; if (jj_scan_token(SEMI_T)) return true; return false; } - inline bool jj_3R_557() + inline bool jj_3R_545() { if (jj_done) return true; if (jj_scan_token(ELSE_T)) return true; if (jj_3R_61()) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_607()) jj_scanpos = xsp; + if (jj_3R_587()) jj_scanpos = xsp; return false; } @@ -2319,14 +2307,6 @@ void parseInline(); if (jj_3R_74()) return true; if (jj_scan_token(COLON_T)) return true; if (jj_3R_174()) return true; - if (jj_scan_token(GENERATE_T)) return true; - if (jj_3R_175()) return true; - if (jj_scan_token(END_T)) return true; - if (jj_scan_token(GENERATE_T)) return true; - Token * xsp; - xsp = jj_scanpos; - if (jj_3R_176()) jj_scanpos = xsp; - if (jj_scan_token(SEMI_T)) return true; return false; } @@ -2342,32 +2322,32 @@ void parseInline(); if (jj_done) return true; if (jj_3R_63()) return true; if (jj_scan_token(LPAREN_T)) return true; - if (jj_3R_238()) return true; + if (jj_3R_236()) return true; if (jj_scan_token(RPAREN_T)) return true; return false; } - inline bool jj_3R_389() + inline bool jj_3R_384() { if (jj_done) return true; if (jj_3R_119()) return true; if (jj_scan_token(LESSTHAN_T)) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_472()) jj_scanpos = xsp; - if (jj_3R_473()) return true; + if (jj_3R_462()) jj_scanpos = xsp; + if (jj_3R_463()) return true; if (jj_scan_token(WHEN_T)) return true; if (jj_3R_61()) return true; xsp = jj_scanpos; - if (jj_3R_474()) jj_scanpos = xsp; + if (jj_3R_464()) jj_scanpos = xsp; if (jj_scan_token(SEMI_T)) return true; return false; } - inline bool jj_3R_280() + inline bool jj_3R_278() { if (jj_done) return true; - if (jj_3R_389()) return true; + if (jj_3R_384()) return true; return false; } @@ -2376,20 +2356,20 @@ void parseInline(); if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_279()) return false; + if (!jj_3R_277()) return false; jj_scanpos = xsp; - if (jj_3R_280()) return true; + if (jj_3R_278()) return true; return false; } - inline bool jj_3R_279() + inline bool jj_3R_277() { if (jj_done) return true; if (jj_3R_149()) return true; return false; } - inline bool jj_3R_582() + inline bool jj_3R_570() { if (jj_done) return true; if (jj_scan_token(AT_T)) return true; @@ -2397,14 +2377,14 @@ void parseInline(); return false; } - inline bool jj_3R_491() + inline bool jj_3R_481() { if (jj_done) return true; - if (jj_3R_561()) return true; + if (jj_3R_549()) return true; return false; } - inline bool jj_3R_315() + inline bool jj_3R_313() { if (jj_done) return true; if (jj_scan_token(LPAREN_T)) return true; @@ -2420,13 +2400,6 @@ void parseInline(); return false; } - inline bool jj_3R_430() - { - if (jj_done) return true; - if (jj_3R_531()) return true; - return false; - } - inline bool jj_3R_147() { if (jj_done) return true; @@ -2435,22 +2408,22 @@ void parseInline(); Token * xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_314()) { jj_scanpos = xsp; break; } + if (jj_3R_312()) { jj_scanpos = xsp; break; } } return false; } - inline bool jj_3R_644() + inline bool jj_3R_624() { if (jj_done) return true; if (jj_3R_147()) return true; return false; } - inline bool jj_3R_612() + inline bool jj_3R_592() { if (jj_done) return true; - if (jj_3R_404()) return true; + if (jj_3R_399()) return true; return false; } @@ -2458,7 +2431,7 @@ void parseInline(); { if (jj_done) return true; if (jj_scan_token(LPAREN_T)) return true; - if (jj_3R_328()) return true; + if (jj_3R_326()) return true; if (jj_scan_token(RPAREN_T)) return true; return false; } @@ -2469,7 +2442,7 @@ void parseInline(); if (jj_3R_74()) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_315()) jj_scanpos = xsp; + if (jj_3R_313()) jj_scanpos = xsp; return false; } @@ -2479,12 +2452,12 @@ void parseInline(); if (jj_scan_token(TYPE_T)) return true; if (jj_3R_74()) return true; if (jj_scan_token(IS_T)) return true; - if (jj_3R_608()) return true; + if (jj_3R_588()) return true; if (jj_scan_token(SEMI_T)) return true; return false; } - inline bool jj_3R_669() + inline bool jj_3R_647() { if (jj_done) return true; if (jj_scan_token(NEG_T)) return true; @@ -2492,14 +2465,14 @@ void parseInline(); return false; } - inline bool jj_3R_643() + inline bool jj_3R_623() { if (jj_done) return true; Token * xsp; - if (jj_3R_669()) return true; + if (jj_3R_647()) return true; while (true) { xsp = jj_scanpos; - if (jj_3R_669()) { jj_scanpos = xsp; break; } + if (jj_3R_647()) { jj_scanpos = xsp; break; } } return false; } @@ -2522,39 +2495,32 @@ void parseInline(); return false; } - inline bool jj_3R_581() + inline bool jj_3R_569() { if (jj_done) return true; - if (jj_3R_643()) return true; + if (jj_3R_623()) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_644()) jj_scanpos = xsp; + if (jj_3R_624()) jj_scanpos = xsp; if (jj_3R_74()) return true; return false; } - inline bool jj_3R_602() + inline bool jj_3R_582() { if (jj_done) return true; - if (jj_3R_329()) return true; - return false; - } - - inline bool jj_3R_341() - { - if (jj_done) return true; - if (jj_3R_432()) return true; + if (jj_3R_327()) return true; return false; } - inline bool jj_3R_418() + inline bool jj_3R_413() { if (jj_done) return true; if (jj_scan_token(INTEGER)) return true; return false; } - inline bool jj_3R_642() + inline bool jj_3R_622() { if (jj_done) return true; if (jj_scan_token(DOT_T)) return true; @@ -2562,25 +2528,25 @@ void parseInline(); return false; } - inline bool jj_3R_328() + inline bool jj_3R_326() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_417()) return false; + if (!jj_3R_412()) return false; jj_scanpos = xsp; - if (jj_3R_418()) return true; + if (jj_3R_413()) return true; return false; } - inline bool jj_3R_417() + inline bool jj_3R_412() { if (jj_done) return true; if (jj_3R_63()) return true; return false; } - inline bool jj_3R_641() + inline bool jj_3R_621() { if (jj_done) return true; if (jj_scan_token(DOT_T)) return true; @@ -2589,66 +2555,66 @@ void parseInline(); return false; } - inline bool jj_3R_580() + inline bool jj_3R_568() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_641()) return false; + if (!jj_3R_621()) return false; jj_scanpos = xsp; - if (jj_3R_642()) return true; + if (jj_3R_622()) return true; return false; } - inline bool jj_3R_522() - { - if (jj_done) return true; - if (jj_3R_582()) return true; - return false; - } - - inline bool jj_3R_521() + inline bool jj_3R_512() { if (jj_done) return true; - if (jj_3R_581()) return true; + if (jj_3R_570()) return true; return false; } - inline bool jj_3R_520() + inline bool jj_3R_511() { if (jj_done) return true; - if (jj_3R_580()) return true; + if (jj_3R_569()) return true; return false; } - inline bool jj_3R_416() + inline bool jj_3R_411() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_520()) return false; + if (!jj_3R_510()) return false; jj_scanpos = xsp; - if (!jj_3R_521()) return false; + if (!jj_3R_511()) return false; jj_scanpos = xsp; - if (jj_3R_522()) return true; + if (jj_3R_512()) return true; return false; } - inline bool jj_3R_519() + inline bool jj_3R_510() { if (jj_done) return true; - if (jj_scan_token(VARIABLE_T)) return true; + if (jj_3R_568()) return true; return false; } - inline bool jj_3R_191() + inline bool jj_3R_189() { if (jj_done) return true; if (jj_3R_74()) return true; return false; } - inline bool jj_3R_687() + inline bool jj_3R_509() + { + if (jj_done) return true; + if (jj_scan_token(VARIABLE_T)) return true; + return false; + } + + inline bool jj_3R_659() { if (jj_done) return true; if (jj_scan_token(FILE_T)) return true; @@ -2657,14 +2623,14 @@ void parseInline(); return false; } - inline bool jj_3R_518() + inline bool jj_3R_508() { if (jj_done) return true; if (jj_scan_token(SIGNAL_T)) return true; return false; } - inline bool jj_3R_611() + inline bool jj_3R_591() { if (jj_done) return true; if (jj_scan_token(OPEN_T)) return true; @@ -2672,40 +2638,40 @@ void parseInline(); return false; } - inline bool jj_3R_517() + inline bool jj_3R_410() { if (jj_done) return true; - if (jj_scan_token(CONSTANT_T)) return true; + Token * xsp; + xsp = jj_scanpos; + if (!jj_3R_507()) return false; + jj_scanpos = xsp; + if (!jj_3R_508()) return false; + jj_scanpos = xsp; + if (jj_3R_509()) return true; return false; } - inline bool jj_3R_415() + inline bool jj_3R_507() { if (jj_done) return true; - Token * xsp; - xsp = jj_scanpos; - if (!jj_3R_517()) return false; - jj_scanpos = xsp; - if (!jj_3R_518()) return false; - jj_scanpos = xsp; - if (jj_3R_519()) return true; + if (jj_scan_token(CONSTANT_T)) return true; return false; } - inline bool jj_3R_561() + inline bool jj_3R_549() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_611()) jj_scanpos = xsp; + if (jj_3R_591()) jj_scanpos = xsp; if (jj_scan_token(IS_T)) return true; xsp = jj_scanpos; - if (jj_3R_612()) jj_scanpos = xsp; - if (jj_3R_613()) return true; + if (jj_3R_592()) jj_scanpos = xsp; + if (jj_3R_593()) return true; return false; } - inline bool jj_3R_613() + inline bool jj_3R_593() { if (jj_done) return true; if (jj_3R_61()) return true; @@ -2727,12 +2693,12 @@ void parseInline(); return false; } - inline bool jj_3R_325() + inline bool jj_3R_323() { if (jj_done) return true; if (jj_scan_token(SLSL_T)) return true; - if (jj_3R_415()) return true; - if (jj_3R_416()) return true; + if (jj_3R_410()) return true; + if (jj_3R_411()) return true; if (jj_scan_token(COLON_T)) return true; if (jj_3R_89()) return true; if (jj_scan_token(RSRS_T)) return true; @@ -2747,49 +2713,36 @@ void parseInline(); return false; } - inline bool jj_3R_477() + inline bool jj_3R_467() { if (jj_done) return true; if (jj_scan_token(DOUBLEMULT_T)) return true; - if (jj_3R_391()) return true; + if (jj_3R_386()) return true; return false; } - inline bool jj_3R_397() + inline bool jj_3R_392() { if (jj_done) return true; if (jj_scan_token(FILE_T)) return true; - if (jj_3R_207()) return true; + if (jj_3R_205()) return true; if (jj_scan_token(COLON_T)) return true; if (jj_3R_89()) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_491()) jj_scanpos = xsp; + if (jj_3R_481()) jj_scanpos = xsp; if (jj_scan_token(SEMI_T)) return true; return false; } - inline bool jj_3R_286() + inline bool jj_3R_284() { if (jj_done) return true; if (jj_3R_137()) return true; return false; } - inline bool jj_3R_532() - { - if (jj_done) return true; - if (jj_scan_token(ELSIF_T)) return true; - Token * xsp; - xsp = jj_scanpos; - if (jj_3_118()) jj_scanpos = xsp; - if (jj_3R_61()) return true; - if (jj_scan_token(GENERATE_T)) return true; - if (jj_3R_339()) return true; - return false; - } - - inline bool jj_3R_275() + inline bool jj_3R_273() { if (jj_done) return true; if (jj_3R_74()) return true; @@ -2803,54 +2756,35 @@ void parseInline(); return false; } - inline bool jj_3R_297() + inline bool jj_3R_295() { if (jj_done) return true; - if (jj_3R_322()) return true; - if (jj_3R_391()) return true; + if (jj_3R_320()) return true; + if (jj_3R_386()) return true; return false; } - inline bool jj_3R_296() + inline bool jj_3R_294() { if (jj_done) return true; if (jj_scan_token(QQ_T)) return true; - if (jj_3R_391()) return true; + if (jj_3R_386()) return true; return false; } - inline bool jj_3R_295() + inline bool jj_3R_293() { if (jj_done) return true; if (jj_scan_token(NOT_T)) return true; - if (jj_3R_391()) return true; - return false; - } - - inline bool jj_3R_432() - { - if (jj_done) return true; - if (jj_scan_token(ELSE_T)) return true; - Token * xsp; - xsp = jj_scanpos; - if (jj_3_117()) jj_scanpos = xsp; - if (jj_scan_token(GENERATE_T)) return true; - if (jj_3R_339()) return true; + if (jj_3R_386()) return true; return false; } - inline bool jj_3R_294() + inline bool jj_3R_292() { if (jj_done) return true; if (jj_scan_token(ABS_T)) return true; - if (jj_3R_391()) return true; - return false; - } - - inline bool jj_3R_431() - { - if (jj_done) return true; - if (jj_3R_532()) return true; + if (jj_3R_386()) return true; return false; } @@ -2859,58 +2793,29 @@ void parseInline(); if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_293()) return false; + if (!jj_3R_291()) return false; jj_scanpos = xsp; - if (!jj_3R_294()) return false; + if (!jj_3R_292()) return false; jj_scanpos = xsp; - if (!jj_3R_295()) return false; + if (!jj_3R_293()) return false; jj_scanpos = xsp; - if (!jj_3R_296()) return false; + if (!jj_3R_294()) return false; jj_scanpos = xsp; - if (jj_3R_297()) return true; + if (jj_3R_295()) return true; return false; } - inline bool jj_3R_293() - { - if (jj_done) return true; - if (jj_3R_391()) return true; - Token * xsp; - xsp = jj_scanpos; - if (jj_3R_477()) jj_scanpos = xsp; - return false; - } - - inline bool jj_3R_340() - { - if (jj_done) return true; - Token * xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_431()) { jj_scanpos = xsp; break; } - } - return false; - } - - inline bool jj_3R_530() - { - if (jj_done) return true; - if (jj_3R_146()) return true; - return false; - } - - inline bool jj_3R_175() + inline bool jj_3R_291() { if (jj_done) return true; - if (jj_3R_339()) return true; - if (jj_3R_340()) return true; + if (jj_3R_386()) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_341()) jj_scanpos = xsp; + if (jj_3R_467()) jj_scanpos = xsp; return false; } - inline bool jj_3R_253() + inline bool jj_3R_251() { if (jj_done) return true; if (jj_scan_token(COMMA_T)) return true; @@ -2918,75 +2823,50 @@ void parseInline(); return false; } - inline bool jj_3R_429() - { - if (jj_done) return true; - Token * xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_530()) { jj_scanpos = xsp; break; } - } - if (jj_scan_token(BEGIN_T)) return true; - return false; - } - - inline bool jj_3R_339() - { - if (jj_done) return true; - Token * xsp; - xsp = jj_scanpos; - if (jj_3R_429()) jj_scanpos = xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_430()) { jj_scanpos = xsp; break; } - } - return false; - } - inline bool jj_3R_152() { if (jj_done) return true; - if (jj_3R_322()) return true; + if (jj_3R_320()) return true; if (jj_3R_151()) return true; return false; } - inline bool jj_3R_298() + inline bool jj_3R_296() { if (jj_done) return true; if (jj_3R_74()) return true; return false; } - inline bool jj_3R_414() + inline bool jj_3R_409() { if (jj_done) return true; if (jj_scan_token(OR_T)) return true; return false; } - inline bool jj_3R_413() + inline bool jj_3R_408() { if (jj_done) return true; if (jj_scan_token(XOR_T)) return true; return false; } - inline bool jj_3R_412() + inline bool jj_3R_407() { if (jj_done) return true; if (jj_scan_token(XNOR_T)) return true; return false; } - inline bool jj_3R_248() + inline bool jj_3R_246() { if (jj_done) return true; if (jj_3R_137()) return true; return false; } - inline bool jj_3R_411() + inline bool jj_3R_406() { if (jj_done) return true; if (jj_scan_token(NOR_T)) return true; @@ -3001,33 +2881,33 @@ void parseInline(); return false; } - inline bool jj_3R_410() + inline bool jj_3R_405() { if (jj_done) return true; if (jj_scan_token(NAND_T)) return true; return false; } - inline bool jj_3R_322() + inline bool jj_3R_320() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_409()) return false; + if (!jj_3R_404()) return false; jj_scanpos = xsp; - if (!jj_3R_410()) return false; + if (!jj_3R_405()) return false; jj_scanpos = xsp; - if (!jj_3R_411()) return false; + if (!jj_3R_406()) return false; jj_scanpos = xsp; - if (!jj_3R_412()) return false; + if (!jj_3R_407()) return false; jj_scanpos = xsp; - if (!jj_3R_413()) return false; + if (!jj_3R_408()) return false; jj_scanpos = xsp; - if (jj_3R_414()) return true; + if (jj_3R_409()) return true; return false; } - inline bool jj_3R_409() + inline bool jj_3R_404() { if (jj_done) return true; if (jj_scan_token(AND_T)) return true; @@ -3040,35 +2920,22 @@ void parseInline(); if (jj_scan_token(END_T)) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_298()) jj_scanpos = xsp; + if (jj_3R_296()) jj_scanpos = xsp; if (jj_scan_token(SEMI_T)) return true; return false; } - inline bool jj_3R_670() + inline bool jj_3R_648() { if (jj_done) return true; if (jj_3R_137()) return true; return false; } - inline bool jj_3R_190() - { - if (jj_done) return true; - if (jj_3R_354()) return true; - return false; - } - - inline bool jj_3R_695() + inline bool jj_3R_188() { if (jj_done) return true; - if (jj_scan_token(WHEN_T)) return true; - Token * xsp; - xsp = jj_scanpos; - if (jj_3_115()) jj_scanpos = xsp; - if (jj_3R_90()) return true; - if (jj_scan_token(ARROW_T)) return true; - if (jj_3R_339()) return true; + if (jj_3R_349()) return true; return false; } @@ -3084,36 +2951,7 @@ void parseInline(); return false; } - inline bool jj_3R_682() - { - if (jj_done) return true; - Token * xsp; - if (jj_3R_695()) return true; - while (true) { - xsp = jj_scanpos; - if (jj_3R_695()) { jj_scanpos = xsp; break; } - } - return false; - } - - inline bool jj_3R_647() - { - if (jj_done) return true; - if (jj_scan_token(CASE_T)) return true; - if (jj_3R_61()) return true; - if (jj_scan_token(GENERATE_T)) return true; - if (jj_3R_682()) return true; - Token * xsp; - xsp = jj_scanpos; - if (jj_3_114()) jj_scanpos = xsp; - if (jj_scan_token(END_T)) return true; - if (jj_scan_token(GENERATE_T)) return true; - if (jj_3R_339()) return true; - if (jj_scan_token(SEMI_T)) return true; - return false; - } - - inline bool jj_3R_276() + inline bool jj_3R_274() { if (jj_done) return true; if (jj_scan_token(WHEN_T)) return true; @@ -3121,7 +2959,7 @@ void parseInline(); return false; } - inline bool jj_3R_274() + inline bool jj_3R_272() { if (jj_done) return true; if (jj_3R_74()) return true; @@ -3134,12 +2972,12 @@ void parseInline(); if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_274()) jj_scanpos = xsp; + if (jj_3R_272()) jj_scanpos = xsp; if (jj_scan_token(EXIT_T)) return true; xsp = jj_scanpos; - if (jj_3R_275()) jj_scanpos = xsp; + if (jj_3R_273()) jj_scanpos = xsp; xsp = jj_scanpos; - if (jj_3R_276()) jj_scanpos = xsp; + if (jj_3R_274()) jj_scanpos = xsp; if (jj_scan_token(SEMI_T)) return true; return false; } @@ -3152,7 +2990,7 @@ void parseInline(); Token * xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_253()) { jj_scanpos = xsp; break; } + if (jj_3R_251()) { jj_scanpos = xsp; break; } } if (jj_scan_token(RPAREN_T)) return true; return false; @@ -3163,19 +3001,19 @@ void parseInline(); if (jj_done) return true; if (jj_scan_token(GENERIC_T)) return true; if (jj_scan_token(LPAREN_T)) return true; - if (jj_3R_329()) return true; + if (jj_3R_327()) return true; if (jj_scan_token(RPAREN_T)) return true; return false; } - inline bool jj_3R_220() + inline bool jj_3R_218() { if (jj_done) return true; - if (jj_3R_374()) return true; + if (jj_3R_369()) return true; return false; } - inline bool jj_3R_219() + inline bool jj_3R_217() { if (jj_done) return true; if (jj_3R_74()) return true; @@ -3187,9 +3025,9 @@ void parseInline(); if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_219()) return false; + if (!jj_3R_217()) return false; jj_scanpos = xsp; - if (jj_3R_220()) return true; + if (jj_3R_218()) return true; return false; } @@ -3204,36 +3042,36 @@ void parseInline(); return false; } - inline bool jj_3R_718() + inline bool jj_3R_685() { if (jj_done) return true; - if (jj_3R_374()) return true; + if (jj_3R_369()) return true; return false; } - inline bool jj_3R_717() + inline bool jj_3R_684() { if (jj_done) return true; if (jj_3R_63()) return true; return false; } - inline bool jj_3R_689() + inline bool jj_3R_661() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_717()) return false; + if (!jj_3R_684()) return false; jj_scanpos = xsp; - if (jj_3R_718()) return true; + if (jj_3R_685()) return true; return false; } - inline bool jj_3R_667() + inline bool jj_3R_645() { if (jj_done) return true; if (jj_scan_token(COMMA_T)) return true; - if (jj_3R_666()) return true; + if (jj_3R_644()) return true; return false; } @@ -3259,10 +3097,10 @@ void parseInline(); if (jj_scan_token(IS_T)) return true; if (jj_scan_token(NEW_T)) return true; if (jj_3R_63()) return true; - if (jj_3R_247()) return true; + if (jj_3R_245()) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_286()) jj_scanpos = xsp; + if (jj_3R_284()) jj_scanpos = xsp; if (jj_scan_token(SEMI_T)) return true; return false; } @@ -3277,11 +3115,11 @@ void parseInline(); if (jj_3R_63()) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_670()) jj_scanpos = xsp; + if (jj_3R_648()) jj_scanpos = xsp; return false; } - inline bool jj_3R_445() + inline bool jj_3R_435() { if (jj_done) return true; if (jj_scan_token(DOT_T)) return true; @@ -3289,19 +3127,19 @@ void parseInline(); return false; } - inline bool jj_3R_498() + inline bool jj_3R_488() { if (jj_done) return true; - if (jj_3R_566()) return true; + if (jj_3R_554()) return true; if (jj_scan_token(COLON_T)) return true; - if (jj_3R_567()) return true; + if (jj_3R_555()) return true; return false; } - inline bool jj_3R_690() + inline bool jj_3R_662() { if (jj_done) return true; - if (jj_3R_247()) return true; + if (jj_3R_245()) return true; return false; } @@ -3313,84 +3151,84 @@ void parseInline(); if (jj_scan_token(IS_T)) return true; if (jj_scan_token(NEW_T)) return true; if (jj_3R_63()) return true; - if (jj_3R_247()) return true; + if (jj_3R_245()) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_248()) jj_scanpos = xsp; + if (jj_3R_246()) jj_scanpos = xsp; if (jj_scan_token(SEMI_T)) return true; return false; } - inline bool jj_3R_448() + inline bool jj_3R_438() { if (jj_done) return true; - if (jj_3R_353()) return true; + if (jj_3R_348()) return true; return false; } - inline bool jj_3R_617() + inline bool jj_3R_597() { if (jj_done) return true; if (jj_scan_token(ALL_T)) return true; return false; } - inline bool jj_3R_447() + inline bool jj_3R_437() { if (jj_done) return true; - if (jj_3R_351()) return true; + if (jj_3R_346()) return true; return false; } - inline bool jj_3R_616() + inline bool jj_3R_596() { if (jj_done) return true; if (jj_scan_token(OTHER_T)) return true; return false; } - inline bool jj_3R_354() + inline bool jj_3R_349() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_446()) return false; + if (!jj_3R_436()) return false; jj_scanpos = xsp; - if (!jj_3R_447()) return false; + if (!jj_3R_437()) return false; jj_scanpos = xsp; - if (jj_3R_448()) return true; + if (jj_3R_438()) return true; return false; } - inline bool jj_3R_446() + inline bool jj_3R_436() { if (jj_done) return true; - if (jj_3R_352()) return true; + if (jj_3R_347()) return true; return false; } - inline bool jj_3R_615() + inline bool jj_3R_595() { if (jj_done) return true; - if (jj_3R_666()) return true; + if (jj_3R_644()) return true; Token * xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_667()) { jj_scanpos = xsp; break; } + if (jj_3R_645()) { jj_scanpos = xsp; break; } } return false; } - inline bool jj_3R_566() + inline bool jj_3R_554() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_615()) return false; + if (!jj_3R_595()) return false; jj_scanpos = xsp; - if (!jj_3R_616()) return false; + if (!jj_3R_596()) return false; jj_scanpos = xsp; - if (jj_3R_617()) return true; + if (jj_3R_597()) return true; return false; } @@ -3403,42 +3241,42 @@ void parseInline(); Token * xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_190()) { jj_scanpos = xsp; break; } + if (jj_3R_188()) { jj_scanpos = xsp; break; } } if (jj_scan_token(END_T)) return true; xsp = jj_scanpos; if (jj_scan_token(32)) jj_scanpos = xsp; xsp = jj_scanpos; - if (jj_3R_191()) jj_scanpos = xsp; + if (jj_3R_189()) jj_scanpos = xsp; if (jj_scan_token(SEMI_T)) return true; return false; } - inline bool jj_3R_716() + inline bool jj_3R_683() { if (jj_done) return true; if (jj_3R_74()) return true; return false; } - inline bool jj_3R_666() + inline bool jj_3R_644() { if (jj_done) return true; - if (jj_3R_689()) return true; + if (jj_3R_661()) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_690()) jj_scanpos = xsp; + if (jj_3R_662()) jj_scanpos = xsp; return false; } - inline bool jj_3R_265() + inline bool jj_3R_263() { if (jj_done) return true; - if (jj_3R_387()) return true; + if (jj_3R_382()) return true; return false; } - inline bool jj_3R_353() + inline bool jj_3R_348() { if (jj_done) return true; if (jj_scan_token(CONTEXT_T)) return true; @@ -3446,27 +3284,27 @@ void parseInline(); Token * xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_445()) { jj_scanpos = xsp; break; } + if (jj_3R_435()) { jj_scanpos = xsp; break; } } if (jj_scan_token(SEMI_T)) return true; return false; } - inline bool jj_3R_727() + inline bool jj_3R_692() { if (jj_done) return true; - if (jj_3R_735()) return true; + if (jj_3R_700()) return true; if (jj_scan_token(SEMI_T)) return true; return false; } - inline bool jj_3R_715() + inline bool jj_3R_682() { if (jj_done) return true; Token * xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_727()) { jj_scanpos = xsp; break; } + if (jj_3R_692()) { jj_scanpos = xsp; break; } } return false; } @@ -3485,17 +3323,17 @@ void parseInline(); return false; } - inline bool jj_3R_755() + inline bool jj_3R_720() { if (jj_done) return true; - if (jj_3R_352()) return true; + if (jj_3R_347()) return true; return false; } - inline bool jj_3R_754() + inline bool jj_3R_719() { if (jj_done) return true; - if (jj_3R_400()) return true; + if (jj_3R_395()) return true; return false; } @@ -3506,65 +3344,65 @@ void parseInline(); return false; } - inline bool jj_3R_570() + inline bool jj_3R_558() { if (jj_done) return true; if (jj_scan_token(COMMA_T)) return true; - if (jj_3R_569()) return true; + if (jj_3R_557()) return true; return false; } - inline bool jj_3R_753() + inline bool jj_3R_718() { if (jj_done) return true; - if (jj_3R_369()) return true; + if (jj_3R_364()) return true; return false; } - inline bool jj_3R_735() + inline bool jj_3R_700() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_753()) return false; + if (!jj_3R_718()) return false; jj_scanpos = xsp; - if (!jj_3R_754()) return false; + if (!jj_3R_719()) return false; jj_scanpos = xsp; - if (jj_3R_755()) return true; + if (jj_3R_720()) return true; return false; } - inline bool jj_3R_714() + inline bool jj_3R_681() { if (jj_done) return true; if (jj_3R_74()) return true; return false; } - inline bool jj_3R_264() + inline bool jj_3R_262() { if (jj_done) return true; - if (jj_3R_386()) return true; + if (jj_3R_381()) return true; return false; } - inline bool jj_3R_688() + inline bool jj_3R_660() { if (jj_done) return true; if (jj_scan_token(PROTECTED_T)) return true; - if (jj_3R_715()) return true; + if (jj_3R_682()) return true; if (jj_scan_token(END_T)) return true; if (jj_scan_token(PROTECTED_T)) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_716()) jj_scanpos = xsp; + if (jj_3R_683()) jj_scanpos = xsp; return false; } - inline bool jj_3R_726() + inline bool jj_3R_691() { if (jj_done) return true; - if (jj_3R_734()) return true; + if (jj_3R_699()) return true; return false; } @@ -3575,25 +3413,25 @@ void parseInline(); return false; } - inline bool jj_3R_713() + inline bool jj_3R_680() { if (jj_done) return true; Token * xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_726()) { jj_scanpos = xsp; break; } + if (jj_3R_691()) { jj_scanpos = xsp; break; } } return false; } - inline bool jj_3R_752() + inline bool jj_3R_717() { if (jj_done) return true; - if (jj_3R_403()) return true; + if (jj_3R_398()) return true; return false; } - inline bool jj_3R_638() + inline bool jj_3R_618() { if (jj_done) return true; if (jj_scan_token(BOX_T)) return true; @@ -3607,28 +3445,28 @@ void parseInline(); return false; } - inline bool jj_3R_751() + inline bool jj_3R_716() { if (jj_done) return true; - if (jj_3R_352()) return true; + if (jj_3R_347()) return true; return false; } - inline bool jj_3R_750() + inline bool jj_3R_715() { if (jj_done) return true; - if (jj_3R_400()) return true; + if (jj_3R_395()) return true; return false; } - inline bool jj_3R_749() + inline bool jj_3R_714() { if (jj_done) return true; if (jj_3R_67()) return true; return false; } - inline bool jj_3R_371() + inline bool jj_3R_366() { if (jj_done) return true; if (jj_scan_token(ENTITY_T)) return true; @@ -3636,125 +3474,125 @@ void parseInline(); return false; } - inline bool jj_3R_748() + inline bool jj_3R_713() { if (jj_done) return true; - if (jj_3R_398()) return true; + if (jj_3R_393()) return true; return false; } - inline bool jj_3R_747() + inline bool jj_3R_712() { if (jj_done) return true; - if (jj_3R_397()) return true; + if (jj_3R_392()) return true; return false; } - inline bool jj_3R_746() + inline bool jj_3R_711() { if (jj_done) return true; - if (jj_3R_396()) return true; + if (jj_3R_391()) return true; return false; } - inline bool jj_3R_745() + inline bool jj_3R_710() { if (jj_done) return true; - if (jj_3R_394()) return true; + if (jj_3R_389()) return true; return false; } - inline bool jj_3R_744() + inline bool jj_3R_709() { if (jj_done) return true; - if (jj_3R_393()) return true; + if (jj_3R_388()) return true; return false; } - inline bool jj_3R_743() + inline bool jj_3R_708() { if (jj_done) return true; - if (jj_3R_392()) return true; + if (jj_3R_387()) return true; return false; } - inline bool jj_3R_742() + inline bool jj_3R_707() { if (jj_done) return true; - if (jj_3R_553()) return true; + if (jj_3R_540()) return true; return false; } - inline bool jj_3R_501() + inline bool jj_3R_491() { if (jj_done) return true; - if (jj_3R_569()) return true; + if (jj_3R_557()) return true; Token * xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_570()) { jj_scanpos = xsp; break; } + if (jj_3R_558()) { jj_scanpos = xsp; break; } } return false; } - inline bool jj_3R_741() + inline bool jj_3R_706() { if (jj_done) return true; if (jj_3R_98()) return true; return false; } - inline bool jj_3R_734() + inline bool jj_3R_699() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_741()) return false; + if (!jj_3R_706()) return false; jj_scanpos = xsp; - if (!jj_3R_742()) return false; + if (!jj_3R_707()) return false; jj_scanpos = xsp; - if (!jj_3R_743()) return false; + if (!jj_3R_708()) return false; jj_scanpos = xsp; - if (!jj_3R_744()) return false; + if (!jj_3R_709()) return false; jj_scanpos = xsp; - if (!jj_3R_745()) return false; + if (!jj_3R_710()) return false; jj_scanpos = xsp; - if (!jj_3R_746()) return false; + if (!jj_3R_711()) return false; jj_scanpos = xsp; - if (!jj_3R_747()) return false; + if (!jj_3R_712()) return false; jj_scanpos = xsp; - if (!jj_3R_748()) return false; + if (!jj_3R_713()) return false; jj_scanpos = xsp; - if (!jj_3R_749()) return false; + if (!jj_3R_714()) return false; jj_scanpos = xsp; - if (!jj_3R_750()) return false; + if (!jj_3R_715()) return false; jj_scanpos = xsp; - if (!jj_3R_751()) return false; + if (!jj_3R_716()) return false; jj_scanpos = xsp; if (!jj_3_113()) return false; jj_scanpos = xsp; - if (jj_3R_752()) return true; + if (jj_3R_717()) return true; return false; } - inline bool jj_3R_263() + inline bool jj_3R_261() { if (jj_done) return true; - if (jj_3R_385()) return true; + if (jj_3R_380()) return true; return false; } - inline bool jj_3R_569() + inline bool jj_3R_557() { if (jj_done) return true; - if (jj_3R_567()) return true; + if (jj_3R_555()) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_638()) jj_scanpos = xsp; + if (jj_3R_618()) jj_scanpos = xsp; return false; } - inline bool jj_3R_648() + inline bool jj_3R_626() { if (jj_done) return true; if (jj_scan_token(LPAREN_T)) return true; @@ -3763,14 +3601,14 @@ void parseInline(); return false; } - inline bool jj_3R_634() + inline bool jj_3R_614() { if (jj_done) return true; if (jj_scan_token(FILE_T)) return true; return false; } - inline bool jj_3R_556() + inline bool jj_3R_544() { if (jj_done) return true; if (jj_scan_token(AFTER_T)) return true; @@ -3778,21 +3616,21 @@ void parseInline(); return false; } - inline bool jj_3R_633() + inline bool jj_3R_613() { if (jj_done) return true; if (jj_scan_token(GROUP_T)) return true; return false; } - inline bool jj_3R_632() + inline bool jj_3R_612() { if (jj_done) return true; if (jj_scan_token(UNITS_T)) return true; return false; } - inline bool jj_3R_631() + inline bool jj_3R_611() { if (jj_done) return true; if (jj_scan_token(LITERAL_T)) return true; @@ -3804,174 +3642,174 @@ void parseInline(); if (jj_done) return true; if (jj_scan_token(PROTECTED_T)) return true; if (jj_scan_token(BODY_T)) return true; - if (jj_3R_713()) return true; + if (jj_3R_680()) return true; if (jj_scan_token(END_T)) return true; if (jj_scan_token(PROTECTED_T)) return true; if (jj_scan_token(BODY_T)) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_714()) jj_scanpos = xsp; + if (jj_3R_681()) jj_scanpos = xsp; return false; } - inline bool jj_3R_630() + inline bool jj_3R_610() { if (jj_done) return true; if (jj_scan_token(LABEL_T)) return true; return false; } - inline bool jj_3R_529() + inline bool jj_3R_519() { if (jj_done) return true; if (jj_scan_token(COMMA_T)) return true; - if (jj_3R_473()) return true; + if (jj_3R_463()) return true; return false; } - inline bool jj_3R_629() + inline bool jj_3R_609() { if (jj_done) return true; if (jj_scan_token(COMPONENT_T)) return true; return false; } - inline bool jj_3R_628() + inline bool jj_3R_608() { if (jj_done) return true; if (jj_scan_token(VARIABLE_T)) return true; return false; } - inline bool jj_3R_627() + inline bool jj_3R_607() { if (jj_done) return true; if (jj_scan_token(SIGNAL_T)) return true; return false; } - inline bool jj_3R_626() + inline bool jj_3R_606() { if (jj_done) return true; if (jj_scan_token(CONSTANT_T)) return true; return false; } - inline bool jj_3R_625() + inline bool jj_3R_605() { if (jj_done) return true; if (jj_scan_token(SUBTYPE_T)) return true; return false; } - inline bool jj_3R_624() + inline bool jj_3R_604() { if (jj_done) return true; if (jj_scan_token(TYPE_T)) return true; return false; } - inline bool jj_3R_623() + inline bool jj_3R_603() { if (jj_done) return true; if (jj_scan_token(PACKAGE_T)) return true; return false; } - inline bool jj_3R_622() + inline bool jj_3R_602() { if (jj_done) return true; if (jj_scan_token(FUNCTION_T)) return true; return false; } - inline bool jj_3R_621() + inline bool jj_3R_601() { if (jj_done) return true; if (jj_scan_token(PROCEDURE_T)) return true; return false; } - inline bool jj_3R_620() + inline bool jj_3R_600() { if (jj_done) return true; if (jj_scan_token(CONFIGURATION_T)) return true; return false; } - inline bool jj_3R_619() + inline bool jj_3R_599() { if (jj_done) return true; if (jj_scan_token(ARCHITECTURE_T)) return true; return false; } - inline bool jj_3R_473() + inline bool jj_3R_463() { if (jj_done) return true; if (jj_3R_61()) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_556()) jj_scanpos = xsp; + if (jj_3R_544()) jj_scanpos = xsp; return false; } - inline bool jj_3R_618() + inline bool jj_3R_598() { if (jj_done) return true; if (jj_scan_token(ENTITY_T)) return true; return false; } - inline bool jj_3R_567() + inline bool jj_3R_555() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_618()) return false; + if (!jj_3R_598()) return false; jj_scanpos = xsp; - if (!jj_3R_619()) return false; + if (!jj_3R_599()) return false; jj_scanpos = xsp; - if (!jj_3R_620()) return false; + if (!jj_3R_600()) return false; jj_scanpos = xsp; - if (!jj_3R_621()) return false; + if (!jj_3R_601()) return false; jj_scanpos = xsp; - if (!jj_3R_622()) return false; + if (!jj_3R_602()) return false; jj_scanpos = xsp; - if (!jj_3R_623()) return false; + if (!jj_3R_603()) return false; jj_scanpos = xsp; - if (!jj_3R_624()) return false; + if (!jj_3R_604()) return false; jj_scanpos = xsp; - if (!jj_3R_625()) return false; + if (!jj_3R_605()) return false; jj_scanpos = xsp; - if (!jj_3R_626()) return false; + if (!jj_3R_606()) return false; jj_scanpos = xsp; - if (!jj_3R_627()) return false; + if (!jj_3R_607()) return false; jj_scanpos = xsp; - if (!jj_3R_628()) return false; + if (!jj_3R_608()) return false; jj_scanpos = xsp; - if (!jj_3R_629()) return false; + if (!jj_3R_609()) return false; jj_scanpos = xsp; - if (!jj_3R_630()) return false; + if (!jj_3R_610()) return false; jj_scanpos = xsp; - if (!jj_3R_631()) return false; + if (!jj_3R_611()) return false; jj_scanpos = xsp; - if (!jj_3R_632()) return false; + if (!jj_3R_612()) return false; jj_scanpos = xsp; - if (!jj_3R_633()) return false; + if (!jj_3R_613()) return false; jj_scanpos = xsp; - if (jj_3R_634()) return true; + if (jj_3R_614()) return true; return false; } - inline bool jj_3R_596() + inline bool jj_3R_576() { if (jj_done) return true; if (jj_scan_token(OPEN_T)) return true; return false; } - inline bool jj_3R_595() + inline bool jj_3R_575() { if (jj_done) return true; if (jj_scan_token(CONFIGURATION_T)) return true; @@ -3979,61 +3817,61 @@ void parseInline(); return false; } - inline bool jj_3R_427() + inline bool jj_3R_422() { if (jj_done) return true; if (jj_scan_token(UNAFFECTED_T)) return true; return false; } - inline bool jj_3R_594() + inline bool jj_3R_574() { if (jj_done) return true; if (jj_scan_token(ENTITY_T)) return true; if (jj_3R_63()) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_648()) jj_scanpos = xsp; + if (jj_3R_626()) jj_scanpos = xsp; return false; } - inline bool jj_3R_534() + inline bool jj_3R_521() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_594()) return false; + if (!jj_3R_574()) return false; jj_scanpos = xsp; - if (!jj_3R_595()) return false; + if (!jj_3R_575()) return false; jj_scanpos = xsp; - if (jj_3R_596()) return true; + if (jj_3R_576()) return true; return false; } - inline bool jj_3R_334() + inline bool jj_3R_332() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_426()) return false; + if (!jj_3R_421()) return false; jj_scanpos = xsp; - if (jj_3R_427()) return true; + if (jj_3R_422()) return true; return false; } - inline bool jj_3R_426() + inline bool jj_3R_421() { if (jj_done) return true; - if (jj_3R_473()) return true; + if (jj_3R_463()) return true; Token * xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_529()) { jj_scanpos = xsp; break; } + if (jj_3R_519()) { jj_scanpos = xsp; break; } } return false; } - inline bool jj_3R_262() + inline bool jj_3R_260() { if (jj_done) return true; if (jj_3R_74()) return true; @@ -4046,14 +3884,14 @@ void parseInline(); if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_262()) jj_scanpos = xsp; + if (jj_3R_260()) jj_scanpos = xsp; if (jj_scan_token(WAIT_T)) return true; xsp = jj_scanpos; - if (jj_3R_263()) jj_scanpos = xsp; + if (jj_3R_261()) jj_scanpos = xsp; xsp = jj_scanpos; - if (jj_3R_264()) jj_scanpos = xsp; + if (jj_3R_262()) jj_scanpos = xsp; xsp = jj_scanpos; - if (jj_3R_265()) jj_scanpos = xsp; + if (jj_3R_263()) jj_scanpos = xsp; if (jj_scan_token(SEMI_T)) return true; return false; } @@ -4066,10 +3904,10 @@ void parseInline(); return false; } - inline bool jj_3R_740() + inline bool jj_3R_705() { if (jj_done) return true; - if (jj_3R_207()) return true; + if (jj_3R_205()) return true; if (jj_scan_token(COLON_T)) return true; if (jj_3R_89()) return true; if (jj_scan_token(SEMI_T)) return true; @@ -4083,11 +3921,11 @@ void parseInline(); return false; } - inline bool jj_3R_758() + inline bool jj_3R_723() { if (jj_done) return true; if (jj_scan_token(COMMA_T)) return true; - if (jj_3R_757()) return true; + if (jj_3R_722()) return true; return false; } @@ -4098,7 +3936,7 @@ void parseInline(); return false; } - inline bool jj_3R_381() + inline bool jj_3R_376() { if (jj_done) return true; if (jj_3R_90()) return true; @@ -4106,12 +3944,12 @@ void parseInline(); return false; } - inline bool jj_3R_249() + inline bool jj_3R_247() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_381()) jj_scanpos = xsp; + if (jj_3R_376()) jj_scanpos = xsp; if (jj_3R_61()) return true; return false; } @@ -4141,7 +3979,7 @@ void parseInline(); return false; } - inline bool jj_3R_490() + inline bool jj_3R_480() { if (jj_done) return true; if (jj_scan_token(VARASSIGN_T)) return true; @@ -4149,51 +3987,51 @@ void parseInline(); return false; } - inline bool jj_3R_499() + inline bool jj_3R_489() { if (jj_done) return true; - if (jj_3R_568()) return true; + if (jj_3R_556()) return true; if (jj_scan_token(COLON_T)) return true; if (jj_3R_63()) return true; return false; } - inline bool jj_3R_396() + inline bool jj_3R_391() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; if (jj_scan_token(101)) jj_scanpos = xsp; if (jj_scan_token(VARIABLE_T)) return true; - if (jj_3R_207()) return true; + if (jj_3R_205()) return true; if (jj_scan_token(COLON_T)) return true; if (jj_3R_89()) return true; xsp = jj_scanpos; - if (jj_3R_490()) jj_scanpos = xsp; + if (jj_3R_480()) jj_scanpos = xsp; if (jj_scan_token(SEMI_T)) return true; return false; } - inline bool jj_3R_500() + inline bool jj_3R_490() { if (jj_done) return true; if (jj_scan_token(COMMA_T)) return true; - if (jj_3R_444()) return true; + if (jj_3R_434()) return true; return false; } - inline bool jj_3R_468() + inline bool jj_3R_458() { if (jj_done) return true; - if (jj_3R_555()) return true; + if (jj_3R_542()) return true; return false; } - inline bool jj_3R_402() + inline bool jj_3R_397() { if (jj_done) return true; if (jj_scan_token(DISCONNECT_T)) return true; - if (jj_3R_499()) return true; + if (jj_3R_489()) return true; if (jj_scan_token(AFTER_T)) return true; if (jj_3R_61()) return true; if (jj_scan_token(SEMI_T)) return true; @@ -4215,18 +4053,18 @@ void parseInline(); return false; } - inline bool jj_3R_383() + inline bool jj_3R_378() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_467()) return false; + if (!jj_3R_457()) return false; jj_scanpos = xsp; - if (jj_3R_468()) return true; + if (jj_3R_458()) return true; return false; } - inline bool jj_3R_467() + inline bool jj_3R_457() { if (jj_done) return true; Token * xsp; @@ -4239,7 +4077,7 @@ void parseInline(); return false; } - inline bool jj_3R_487() + inline bool jj_3R_477() { if (jj_done) return true; if (jj_scan_token(VARASSIGN_T)) return true; @@ -4265,46 +4103,46 @@ void parseInline(); return false; } - inline bool jj_3R_601() + inline bool jj_3R_581() { if (jj_done) return true; - if (jj_3R_323()) return true; + if (jj_3R_321()) return true; return false; } - inline bool jj_3R_600() + inline bool jj_3R_580() { if (jj_done) return true; if (jj_3R_74()) return true; return false; } - inline bool jj_3R_549() + inline bool jj_3R_536() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_600()) return false; + if (!jj_3R_580()) return false; jj_scanpos = xsp; - if (jj_3R_601()) return true; + if (jj_3R_581()) return true; return false; } - inline bool jj_3R_352() + inline bool jj_3R_347() { if (jj_done) return true; if (jj_scan_token(USE_T)) return true; - if (jj_3R_444()) return true; + if (jj_3R_434()) return true; Token * xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_500()) { jj_scanpos = xsp; break; } + if (jj_3R_490()) { jj_scanpos = xsp; break; } } if (jj_scan_token(SEMI_T)) return true; return false; } - inline bool jj_3R_585() + inline bool jj_3R_573() { if (jj_done) return true; if (jj_scan_token(REJECT_T)) return true; @@ -4319,26 +4157,26 @@ void parseInline(); return false; } - inline bool jj_3R_528() + inline bool jj_3R_518() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_585()) jj_scanpos = xsp; + if (jj_3R_573()) jj_scanpos = xsp; if (jj_scan_token(INERTIAL_T)) return true; return false; } - inline bool jj_3R_739() + inline bool jj_3R_704() { if (jj_done) return true; if (jj_scan_token(ARRAY_T)) return true; if (jj_scan_token(LPAREN_T)) return true; - if (jj_3R_757()) return true; + if (jj_3R_722()) return true; Token * xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_758()) { jj_scanpos = xsp; break; } + if (jj_3R_723()) { jj_scanpos = xsp; break; } } if (jj_scan_token(RPAREN_T)) return true; if (jj_scan_token(OF_T)) return true; @@ -4346,7 +4184,7 @@ void parseInline(); return false; } - inline bool jj_3R_527() + inline bool jj_3R_517() { if (jj_done) return true; if (jj_scan_token(TRANSPORT_T)) return true; @@ -4360,14 +4198,14 @@ void parseInline(); return false; } - inline bool jj_3R_425() + inline bool jj_3R_420() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_527()) return false; + if (!jj_3R_517()) return false; jj_scanpos = xsp; - if (jj_3R_528()) return true; + if (jj_3R_518()) return true; return false; } @@ -4385,24 +4223,24 @@ void parseInline(); return false; } - inline bool jj_3R_195() + inline bool jj_3R_193() { if (jj_done) return true; if (jj_3R_139()) return true; return false; } - inline bool jj_3R_665() + inline bool jj_3R_643() { if (jj_done) return true; - if (jj_3R_688()) return true; + if (jj_3R_660()) return true; return false; } - inline bool jj_3R_189() + inline bool jj_3R_187() { if (jj_done) return true; - if (jj_3R_353()) return true; + if (jj_3R_348()) return true; return false; } @@ -4413,7 +4251,7 @@ void parseInline(); return false; } - inline bool jj_3R_188() + inline bool jj_3R_186() { if (jj_done) return true; if (jj_3R_87()) return true; @@ -4427,38 +4265,38 @@ void parseInline(); return false; } - inline bool jj_3R_664() + inline bool jj_3R_642() { if (jj_done) return true; - if (jj_3R_687()) return true; + if (jj_3R_659()) return true; return false; } - inline bool jj_3R_187() + inline bool jj_3R_185() { if (jj_done) return true; - if (jj_3R_352()) return true; + if (jj_3R_347()) return true; return false; } - inline bool jj_3R_663() + inline bool jj_3R_641() { if (jj_done) return true; - if (jj_3R_686()) return true; + if (jj_3R_658()) return true; return false; } - inline bool jj_3R_662() + inline bool jj_3R_640() { if (jj_done) return true; - if (jj_3R_685()) return true; + if (jj_3R_657()) return true; return false; } - inline bool jj_3R_186() + inline bool jj_3R_184() { if (jj_done) return true; - if (jj_3R_351()) return true; + if (jj_3R_346()) return true; return false; } @@ -4467,43 +4305,43 @@ void parseInline(); if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_186()) return false; + if (!jj_3R_184()) return false; jj_scanpos = xsp; - if (!jj_3R_187()) return false; + if (!jj_3R_185()) return false; jj_scanpos = xsp; - if (!jj_3R_188()) return false; + if (!jj_3R_186()) return false; jj_scanpos = xsp; - if (jj_3R_189()) return true; + if (jj_3R_187()) return true; return false; } - inline bool jj_3R_661() + inline bool jj_3R_639() { if (jj_done) return true; - if (jj_3R_684()) return true; + if (jj_3R_656()) return true; return false; } - inline bool jj_3R_608() + inline bool jj_3R_588() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_661()) return false; + if (!jj_3R_639()) return false; jj_scanpos = xsp; - if (!jj_3R_662()) return false; + if (!jj_3R_640()) return false; jj_scanpos = xsp; - if (!jj_3R_663()) return false; + if (!jj_3R_641()) return false; jj_scanpos = xsp; - if (!jj_3R_664()) return false; + if (!jj_3R_642()) return false; jj_scanpos = xsp; if (!jj_3_110()) return false; jj_scanpos = xsp; - if (jj_3R_665()) return true; + if (jj_3R_643()) return true; return false; } - inline bool jj_3R_288() + inline bool jj_3R_286() { if (jj_done) return true; if (jj_3R_65()) return true; @@ -4515,30 +4353,30 @@ void parseInline(); if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_287()) return false; + if (!jj_3R_285()) return false; jj_scanpos = xsp; - if (jj_3R_288()) return true; + if (jj_3R_286()) return true; return false; } - inline bool jj_3R_287() + inline bool jj_3R_285() { if (jj_done) return true; if (jj_3R_86()) return true; return false; } - inline bool jj_3R_194() + inline bool jj_3R_192() { if (jj_done) return true; if (jj_3R_63()) return true; return false; } - inline bool jj_3R_486() + inline bool jj_3R_476() { if (jj_done) return true; - if (jj_3R_559()) return true; + if (jj_3R_547()) return true; return false; } @@ -4549,14 +4387,14 @@ void parseInline(); return false; } - inline bool jj_3R_392() + inline bool jj_3R_387() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; if (!jj_3_109()) return false; jj_scanpos = xsp; - if (jj_3R_486()) return true; + if (jj_3R_476()) return true; return false; } @@ -4585,7 +4423,7 @@ void parseInline(); return false; } - inline bool jj_3R_738() + inline bool jj_3R_703() { if (jj_done) return true; if (jj_scan_token(ARRAY_T)) return true; @@ -4595,7 +4433,7 @@ void parseInline(); return false; } - inline bool jj_3R_387() + inline bool jj_3R_382() { if (jj_done) return true; if (jj_scan_token(FOR_T)) return true; @@ -4615,21 +4453,21 @@ void parseInline(); return false; } - inline bool jj_3R_394() + inline bool jj_3R_389() { if (jj_done) return true; if (jj_scan_token(CONSTANT_T)) return true; - if (jj_3R_207()) return true; + if (jj_3R_205()) return true; if (jj_scan_token(COLON_T)) return true; if (jj_3R_89()) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_487()) jj_scanpos = xsp; + if (jj_3R_477()) jj_scanpos = xsp; if (jj_scan_token(SEMI_T)) return true; return false; } - inline bool jj_3R_258() + inline bool jj_3R_256() { if (jj_done) return true; if (jj_3R_114()) return true; @@ -4641,9 +4479,9 @@ void parseInline(); if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_257()) return false; + if (!jj_3R_255()) return false; jj_scanpos = xsp; - if (jj_3R_258()) return true; + if (jj_3R_256()) return true; return false; } @@ -4654,7 +4492,7 @@ void parseInline(); return false; } - inline bool jj_3R_257() + inline bool jj_3R_255() { if (jj_done) return true; if (jj_3R_63()) return true; @@ -4668,41 +4506,41 @@ void parseInline(); return false; } - inline bool jj_3R_230() + inline bool jj_3R_228() { if (jj_done) return true; if (jj_scan_token(ALL_T)) return true; return false; } - inline bool jj_3R_401() + inline bool jj_3R_396() { if (jj_done) return true; if (jj_scan_token(FOR_T)) return true; - if (jj_3R_183()) return true; - if (jj_3R_349()) return true; + if (jj_3R_181()) return true; + if (jj_3R_344()) return true; if (jj_scan_token(SEMI_T)) return true; return false; } - inline bool jj_3R_229() + inline bool jj_3R_227() { if (jj_done) return true; - if (jj_3R_323()) return true; + if (jj_3R_321()) return true; return false; } - inline bool jj_3R_228() + inline bool jj_3R_226() { if (jj_done) return true; - if (jj_3R_374()) return true; + if (jj_3R_369()) return true; return false; } - inline bool jj_3R_599() + inline bool jj_3R_579() { if (jj_done) return true; - if (jj_3R_350()) return true; + if (jj_3R_345()) return true; return false; } @@ -4711,38 +4549,38 @@ void parseInline(); if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_227()) return false; + if (!jj_3R_225()) return false; jj_scanpos = xsp; - if (!jj_3R_228()) return false; + if (!jj_3R_226()) return false; jj_scanpos = xsp; - if (!jj_3R_229()) return false; + if (!jj_3R_227()) return false; jj_scanpos = xsp; - if (jj_3R_230()) return true; + if (jj_3R_228()) return true; return false; } - inline bool jj_3R_227() + inline bool jj_3R_225() { if (jj_done) return true; if (jj_3R_63()) return true; return false; } - inline bool jj_3R_598() + inline bool jj_3R_578() { if (jj_done) return true; if (jj_3R_84()) return true; return false; } - inline bool jj_3R_536() + inline bool jj_3R_523() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_598()) return false; + if (!jj_3R_578()) return false; jj_scanpos = xsp; - if (jj_3R_599()) return true; + if (jj_3R_579()) return true; return false; } @@ -4759,13 +4597,13 @@ void parseInline(); Token * xsp; xsp = jj_scanpos; if (jj_3_105()) jj_scanpos = xsp; - if (jj_3R_194()) return true; + if (jj_3R_192()) return true; while (true) { xsp = jj_scanpos; - if (jj_3R_194()) { jj_scanpos = xsp; break; } + if (jj_3R_192()) { jj_scanpos = xsp; break; } } xsp = jj_scanpos; - if (jj_3R_195()) jj_scanpos = xsp; + if (jj_3R_193()) jj_scanpos = xsp; return false; } @@ -4787,7 +4625,7 @@ void parseInline(); return false; } - inline bool jj_3R_393() + inline bool jj_3R_388() { if (jj_done) return true; if (jj_scan_token(SUBTYPE_T)) return true; @@ -4798,25 +4636,25 @@ void parseInline(); return false; } - inline bool jj_3R_659() + inline bool jj_3R_637() { if (jj_done) return true; if (jj_3R_117()) return true; return false; } - inline bool jj_3R_604() + inline bool jj_3R_584() { if (jj_done) return true; Token * xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_659()) { jj_scanpos = xsp; break; } + if (jj_3R_637()) { jj_scanpos = xsp; break; } } return false; } - inline bool jj_3R_372() + inline bool jj_3R_367() { if (jj_done) return true; if (jj_scan_token(CONFIGURATION_T)) return true; @@ -4824,7 +4662,7 @@ void parseInline(); return false; } - inline bool jj_3R_336() + inline bool jj_3R_334() { if (jj_done) return true; if (jj_scan_token(WHEN_T)) return true; @@ -4832,21 +4670,21 @@ void parseInline(); return false; } - inline bool jj_3R_335() + inline bool jj_3R_333() { if (jj_done) return true; if (jj_scan_token(WHEN_T)) return true; if (jj_3R_83()) return true; if (jj_scan_token(ELSE_T)) return true; - if (jj_3R_334()) return true; + if (jj_3R_332()) return true; return false; } - inline bool jj_3R_552() + inline bool jj_3R_539() { if (jj_done) return true; if (jj_scan_token(LPAREN_T)) return true; - if (jj_3R_602()) return true; + if (jj_3R_582()) return true; if (jj_scan_token(RPAREN_T)) return true; return false; } @@ -4854,14 +4692,14 @@ void parseInline(); inline bool jj_3R_173() { if (jj_done) return true; - if (jj_3R_334()) return true; + if (jj_3R_332()) return true; Token * xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_335()) { jj_scanpos = xsp; break; } + if (jj_3R_333()) { jj_scanpos = xsp; break; } } xsp = jj_scanpos; - if (jj_3R_336()) jj_scanpos = xsp; + if (jj_3R_334()) jj_scanpos = xsp; return false; } @@ -4876,7 +4714,7 @@ void parseInline(); return false; } - inline bool jj_3R_551() + inline bool jj_3R_538() { if (jj_done) return true; Token * xsp; @@ -4894,16 +4732,16 @@ void parseInline(); return false; } - inline bool jj_3R_461() + inline bool jj_3R_451() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_551()) jj_scanpos = xsp; + if (jj_3R_538()) jj_scanpos = xsp; if (jj_scan_token(FUNCTION_T)) return true; - if (jj_3R_549()) return true; + if (jj_3R_536()) return true; xsp = jj_scanpos; - if (jj_3R_552()) jj_scanpos = xsp; + if (jj_3R_539()) jj_scanpos = xsp; if (jj_scan_token(RETURN_T)) return true; if (jj_3R_161()) return true; return false; @@ -4916,16 +4754,16 @@ void parseInline(); return false; } - inline bool jj_3R_550() + inline bool jj_3R_537() { if (jj_done) return true; if (jj_scan_token(LPAREN_T)) return true; - if (jj_3R_329()) return true; + if (jj_3R_327()) return true; if (jj_scan_token(RPAREN_T)) return true; return false; } - inline bool jj_3R_386() + inline bool jj_3R_381() { if (jj_done) return true; if (jj_scan_token(UNTIL_T)) return true; @@ -4961,30 +4799,30 @@ void parseInline(); return false; } - inline bool jj_3R_369() + inline bool jj_3R_364() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_460()) return false; + if (!jj_3R_450()) return false; jj_scanpos = xsp; - if (jj_3R_461()) return true; + if (jj_3R_451()) return true; return false; } - inline bool jj_3R_460() + inline bool jj_3R_450() { if (jj_done) return true; if (jj_scan_token(PROCEDURE_T)) return true; - if (jj_3R_549()) return true; + if (jj_3R_536()) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_550()) jj_scanpos = xsp; + if (jj_3R_537()) jj_scanpos = xsp; xsp = jj_scanpos; if (jj_3_103()) jj_scanpos = xsp; xsp = jj_scanpos; if (jj_3_104()) jj_scanpos = xsp; - if (jj_3R_452()) return true; + if (jj_3R_442()) return true; return false; } @@ -5008,14 +4846,7 @@ void parseInline(); return false; } - inline bool jj_3R_593() - { - if (jj_done) return true; - if (jj_3R_82()) return true; - return false; - } - - inline bool jj_3R_660() + inline bool jj_3R_638() { if (jj_done) return true; Token * xsp; @@ -5026,45 +4857,24 @@ void parseInline(); return false; } - inline bool jj_3R_592() - { - if (jj_done) return true; - if (jj_3R_81()) return true; - return false; - } - - inline bool jj_3_20() - { - if (jj_done) return true; - if (jj_3R_78()) return true; - return false; - } - - inline bool jj_3R_658() + inline bool jj_3R_636() { if (jj_done) return true; - if (jj_3R_683()) return true; + if (jj_3R_655()) return true; return false; } - inline bool jj_3R_603() + inline bool jj_3R_583() { if (jj_done) return true; Token * xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_658()) { jj_scanpos = xsp; break; } + if (jj_3R_636()) { jj_scanpos = xsp; break; } } return false; } - inline bool jj_3R_591() - { - if (jj_done) return true; - if (jj_3R_80()) return true; - return false; - } - inline bool jj_3R_77() { if (jj_done) return true; @@ -5085,13 +4895,6 @@ void parseInline(); return false; } - inline bool jj_3R_590() - { - if (jj_done) return true; - if (jj_3R_92()) return true; - return false; - } - inline bool jj_3R_76() { if (jj_done) return true; @@ -5117,31 +4920,24 @@ void parseInline(); return false; } - inline bool jj_3R_708() - { - if (jj_done) return true; - if (jj_3R_403()) return true; - return false; - } - - inline bool jj_3R_589() + inline bool jj_3R_675() { if (jj_done) return true; - if (jj_3R_647()) return true; + if (jj_3R_398()) return true; return false; } - inline bool jj_3R_588() + inline bool jj_3_20() { if (jj_done) return true; if (jj_3R_78()) return true; return false; } - inline bool jj_3R_707() + inline bool jj_3R_674() { if (jj_done) return true; - if (jj_3R_352()) return true; + if (jj_3R_347()) return true; return false; } @@ -5152,70 +4948,31 @@ void parseInline(); return false; } - inline bool jj_3R_706() - { - if (jj_done) return true; - if (jj_3R_400()) return true; - return false; - } - - inline bool jj_3R_587() + inline bool jj_3R_673() { if (jj_done) return true; - if (jj_3R_93()) return true; + if (jj_3R_395()) return true; return false; } - inline bool jj_3R_705() + inline bool jj_3R_672() { if (jj_done) return true; if (jj_3R_67()) return true; return false; } - inline bool jj_3R_704() - { - if (jj_done) return true; - if (jj_3R_398()) return true; - return false; - } - - inline bool jj_3R_586() - { - if (jj_done) return true; - if (jj_3R_646()) return true; - return false; - } - - inline bool jj_3R_531() + inline bool jj_3R_671() { if (jj_done) return true; - Token * xsp; - xsp = jj_scanpos; - if (!jj_3R_586()) return false; - jj_scanpos = xsp; - if (!jj_3R_587()) return false; - jj_scanpos = xsp; - if (!jj_3R_588()) return false; - jj_scanpos = xsp; - if (!jj_3R_589()) return false; - jj_scanpos = xsp; - if (!jj_3R_590()) return false; - jj_scanpos = xsp; - if (!jj_3R_591()) return false; - jj_scanpos = xsp; - if (!jj_3R_592()) return false; - jj_scanpos = xsp; - if (!jj_3R_593()) return false; - jj_scanpos = xsp; - if (jj_scan_token(189)) return true; + if (jj_3R_393()) return true; return false; } - inline bool jj_3R_703() + inline bool jj_3R_670() { if (jj_done) return true; - if (jj_3R_397()) return true; + if (jj_3R_392()) return true; return false; } @@ -5226,96 +4983,96 @@ void parseInline(); return false; } - inline bool jj_3R_702() + inline bool jj_3R_669() { if (jj_done) return true; - if (jj_3R_396()) return true; + if (jj_3R_391()) return true; return false; } - inline bool jj_3R_606() + inline bool jj_3R_586() { if (jj_done) return true; - if (jj_3R_549()) return true; + if (jj_3R_536()) return true; return false; } - inline bool jj_3R_701() + inline bool jj_3R_668() { if (jj_done) return true; - if (jj_3R_394()) return true; + if (jj_3R_389()) return true; return false; } - inline bool jj_3R_700() + inline bool jj_3R_667() { if (jj_done) return true; - if (jj_3R_393()) return true; + if (jj_3R_388()) return true; return false; } - inline bool jj_3R_699() + inline bool jj_3R_666() { if (jj_done) return true; - if (jj_3R_553()) return true; + if (jj_3R_540()) return true; return false; } - inline bool jj_3R_698() + inline bool jj_3R_665() { if (jj_done) return true; - if (jj_3R_392()) return true; + if (jj_3R_387()) return true; return false; } - inline bool jj_3R_178() + inline bool jj_3R_176() { if (jj_done) return true; - if (jj_3R_342()) return true; + if (jj_3R_337()) return true; return false; } - inline bool jj_3R_697() + inline bool jj_3R_664() { if (jj_done) return true; if (jj_3R_98()) return true; return false; } - inline bool jj_3R_683() + inline bool jj_3R_655() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_697()) return false; + if (!jj_3R_664()) return false; jj_scanpos = xsp; - if (!jj_3R_698()) return false; + if (!jj_3R_665()) return false; jj_scanpos = xsp; - if (!jj_3R_699()) return false; + if (!jj_3R_666()) return false; jj_scanpos = xsp; - if (!jj_3R_700()) return false; + if (!jj_3R_667()) return false; jj_scanpos = xsp; - if (!jj_3R_701()) return false; + if (!jj_3R_668()) return false; jj_scanpos = xsp; - if (!jj_3R_702()) return false; + if (!jj_3R_669()) return false; jj_scanpos = xsp; - if (!jj_3R_703()) return false; + if (!jj_3R_670()) return false; jj_scanpos = xsp; - if (!jj_3R_704()) return false; + if (!jj_3R_671()) return false; jj_scanpos = xsp; - if (!jj_3R_705()) return false; + if (!jj_3R_672()) return false; jj_scanpos = xsp; - if (!jj_3R_706()) return false; + if (!jj_3R_673()) return false; jj_scanpos = xsp; - if (!jj_3R_707()) return false; + if (!jj_3R_674()) return false; jj_scanpos = xsp; if (!jj_3_102()) return false; jj_scanpos = xsp; - if (jj_3R_708()) return true; + if (jj_3R_675()) return true; return false; } - inline bool jj_3R_177() + inline bool jj_3R_175() { if (jj_done) return true; if (jj_3R_75()) return true; @@ -5330,7 +5087,7 @@ void parseInline(); return false; } - inline bool jj_3R_489() + inline bool jj_3R_479() { if (jj_done) return true; if (jj_scan_token(VARASSIGN_T)) return true; @@ -5347,9 +5104,9 @@ void parseInline(); xsp = jj_scanpos; if (jj_scan_token(79)) jj_scanpos = xsp; xsp = jj_scanpos; - if (!jj_3R_177()) return false; + if (!jj_3R_175()) return false; jj_scanpos = xsp; - if (jj_3R_178()) return true; + if (jj_3R_176()) return true; return false; } @@ -5360,21 +5117,21 @@ void parseInline(); return false; } - inline bool jj_3R_370() + inline bool jj_3R_365() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_462()) return false; + if (!jj_3R_452()) return false; jj_scanpos = xsp; if (jj_scan_token(137)) return true; return false; } - inline bool jj_3R_462() + inline bool jj_3R_452() { if (jj_done) return true; - if (jj_3R_553()) return true; + if (jj_3R_540()) return true; return false; } @@ -5394,7 +5151,7 @@ void parseInline(); if (jj_3_15()) jj_scanpos = xsp; xsp = jj_scanpos; if (jj_scan_token(79)) jj_scanpos = xsp; - if (jj_3R_182()) return true; + if (jj_3R_180()) return true; if (jj_scan_token(SEMI_T)) return true; return false; } @@ -5414,11 +5171,11 @@ void parseInline(); return false; } - inline bool jj_3R_211() + inline bool jj_3R_209() { if (jj_done) return true; - if (jj_3R_369()) return true; - if (jj_3R_370()) return true; + if (jj_3R_364()) return true; + if (jj_3R_365()) return true; return false; } @@ -5430,19 +5187,19 @@ void parseInline(); if (jj_3_14()) jj_scanpos = xsp; xsp = jj_scanpos; if (jj_scan_token(79)) jj_scanpos = xsp; - if (jj_3R_198()) return true; + if (jj_3R_196()) return true; if (jj_scan_token(SEMI_T)) return true; return false; } - inline bool jj_3R_605() + inline bool jj_3R_585() { if (jj_done) return true; - if (jj_3R_660()) return true; + if (jj_3R_638()) return true; return false; } - inline bool jj_3R_210() + inline bool jj_3R_208() { if (jj_done) return true; if (jj_3R_135()) return true; @@ -5454,9 +5211,9 @@ void parseInline(); if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_210()) return false; + if (!jj_3R_208()) return false; jj_scanpos = xsp; - if (jj_3R_211()) return true; + if (jj_3R_209()) return true; return false; } @@ -5468,63 +5225,63 @@ void parseInline(); return false; } - inline bool jj_3R_712() + inline bool jj_3R_679() { if (jj_done) return true; - if (jj_3R_725()) return true; + if (jj_3R_690()) return true; return false; } - inline bool jj_3R_711() + inline bool jj_3R_678() { if (jj_done) return true; - if (jj_3R_724()) return true; + if (jj_3R_689()) return true; return false; } - inline bool jj_3R_685() + inline bool jj_3R_657() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_711()) return false; + if (!jj_3R_678()) return false; jj_scanpos = xsp; - if (jj_3R_712()) return true; + if (jj_3R_679()) return true; return false; } - inline bool jj_3R_181() + inline bool jj_3R_179() { if (jj_done) return true; - if (jj_3R_346()) return true; + if (jj_3R_341()) return true; return false; } - inline bool jj_3R_180() + inline bool jj_3R_178() { if (jj_done) return true; if (jj_3R_73()) return true; return false; } - inline bool jj_3R_497() + inline bool jj_3R_487() { if (jj_done) return true; if (jj_3R_74()) return true; return false; } - inline bool jj_3R_488() + inline bool jj_3R_478() { if (jj_done) return true; - if (jj_3R_560()) return true; + if (jj_3R_548()) return true; return false; } - inline bool jj_3R_183() + inline bool jj_3R_181() { if (jj_done) return true; - if (jj_3R_348()) return true; + if (jj_3R_343()) return true; if (jj_scan_token(COLON_T)) return true; if (jj_3R_63()) return true; return false; @@ -5538,19 +5295,19 @@ void parseInline(); return false; } - inline bool jj_3R_553() + inline bool jj_3R_540() { if (jj_done) return true; if (jj_scan_token(IS_T)) return true; - if (jj_3R_603()) return true; + if (jj_3R_583()) return true; if (jj_scan_token(BEGIN_T)) return true; - if (jj_3R_604()) return true; + if (jj_3R_584()) return true; if (jj_scan_token(END_T)) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_605()) jj_scanpos = xsp; + if (jj_3R_585()) jj_scanpos = xsp; xsp = jj_scanpos; - if (jj_3R_606()) jj_scanpos = xsp; + if (jj_3R_586()) jj_scanpos = xsp; if (jj_scan_token(SEMI_T)) return true; return false; } @@ -5560,53 +5317,53 @@ void parseInline(); if (jj_done) return true; if (jj_3R_74()) return true; if (jj_scan_token(COLON_T)) return true; - if (jj_3R_179()) return true; + if (jj_3R_177()) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_180()) jj_scanpos = xsp; + if (jj_3R_178()) jj_scanpos = xsp; xsp = jj_scanpos; - if (jj_3R_181()) jj_scanpos = xsp; + if (jj_3R_179()) jj_scanpos = xsp; if (jj_scan_token(SEMI_T)) return true; return false; } - inline bool jj_3R_378() + inline bool jj_3R_373() { if (jj_done) return true; if (jj_scan_token(STRINGLITERAL)) return true; return false; } - inline bool jj_3R_496() + inline bool jj_3R_486() { if (jj_done) return true; - if (jj_3R_565()) return true; + if (jj_3R_553()) return true; return false; } - inline bool jj_3R_495() + inline bool jj_3R_485() { if (jj_done) return true; if (jj_3R_69()) return true; return false; } - inline bool jj_3R_185() + inline bool jj_3R_183() { if (jj_done) return true; - if (jj_3R_350()) return true; + if (jj_3R_345()) return true; return false; } - inline bool jj_3R_184() + inline bool jj_3R_182() { if (jj_done) return true; - if (jj_3R_349()) return true; + if (jj_3R_344()) return true; if (jj_scan_token(SEMI_T)) return true; return false; } - inline bool jj_3R_463() + inline bool jj_3R_453() { if (jj_done) return true; if (jj_scan_token(COMMA_T)) return true; @@ -5614,15 +5371,15 @@ void parseInline(); return false; } - inline bool jj_3R_197() + inline bool jj_3R_195() { if (jj_done) return true; if (jj_scan_token(BAR_T)) return true; - if (jj_3R_196()) return true; + if (jj_3R_194()) return true; return false; } - inline bool jj_3R_399() + inline bool jj_3R_394() { if (jj_done) return true; if (jj_scan_token(COMPONENT_T)) return true; @@ -5631,30 +5388,21 @@ void parseInline(); xsp = jj_scanpos; if (jj_scan_token(56)) jj_scanpos = xsp; xsp = jj_scanpos; - if (jj_3R_495()) jj_scanpos = xsp; + if (jj_3R_485()) jj_scanpos = xsp; xsp = jj_scanpos; - if (jj_3R_496()) jj_scanpos = xsp; + if (jj_3R_486()) jj_scanpos = xsp; if (jj_scan_token(END_T)) return true; if (jj_scan_token(COMPONENT_T)) return true; - xsp = jj_scanpos; - if (jj_3R_497()) jj_scanpos = xsp; - if (jj_scan_token(SEMI_T)) return true; - return false; - } - - inline bool jj_3R_163() - { - if (jj_done) return true; - if (jj_3R_330()) return true; + xsp = jj_scanpos; + if (jj_3R_487()) jj_scanpos = xsp; + if (jj_scan_token(SEMI_T)) return true; return false; } - inline bool jj_3R_677() + inline bool jj_3R_163() { if (jj_done) return true; - if (jj_scan_token(LPAREN_T)) return true; - if (jj_3R_61()) return true; - if (jj_scan_token(RPAREN_T)) return true; + if (jj_3R_328()) return true; return false; } @@ -5676,19 +5424,19 @@ void parseInline(); { if (jj_done) return true; if (jj_scan_token(FOR_T)) return true; - if (jj_3R_183()) return true; + if (jj_3R_181()) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_184()) jj_scanpos = xsp; + if (jj_3R_182()) jj_scanpos = xsp; xsp = jj_scanpos; - if (jj_3R_185()) jj_scanpos = xsp; + if (jj_3R_183()) jj_scanpos = xsp; if (jj_scan_token(END_T)) return true; if (jj_scan_token(FOR_T)) return true; if (jj_scan_token(SEMI_T)) return true; return false; } - inline bool jj_3R_380() + inline bool jj_3R_375() { if (jj_done) return true; if (jj_scan_token(RETURN_T)) return true; @@ -5696,7 +5444,7 @@ void parseInline(); return false; } - inline bool jj_3R_668() + inline bool jj_3R_646() { if (jj_done) return true; if (jj_scan_token(COMMA_T)) return true; @@ -5704,14 +5452,14 @@ void parseInline(); return false; } - inline bool jj_3R_379() + inline bool jj_3R_374() { if (jj_done) return true; if (jj_3R_63()) return true; Token * xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_463()) { jj_scanpos = xsp; break; } + if (jj_3R_453()) { jj_scanpos = xsp; break; } } return false; } @@ -5726,24 +5474,24 @@ void parseInline(); inline bool jj_3R_90() { if (jj_done) return true; - if (jj_3R_196()) return true; + if (jj_3R_194()) return true; Token * xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_197()) { jj_scanpos = xsp; break; } + if (jj_3R_195()) { jj_scanpos = xsp; break; } } return false; } - inline bool jj_3R_247() + inline bool jj_3R_245() { if (jj_done) return true; if (jj_scan_token(LBRACKET_T)) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_379()) jj_scanpos = xsp; + if (jj_3R_374()) jj_scanpos = xsp; xsp = jj_scanpos; - if (jj_3R_380()) jj_scanpos = xsp; + if (jj_3R_375()) jj_scanpos = xsp; if (jj_scan_token(RBRACKET_T)) return true; return false; } @@ -5755,21 +5503,21 @@ void parseInline(); return false; } - inline bool jj_3R_637() + inline bool jj_3R_617() { if (jj_done) return true; if (jj_scan_token(ALL_T)) return true; return false; } - inline bool jj_3R_359() + inline bool jj_3R_354() { if (jj_done) return true; if (jj_scan_token(OTHER_T)) return true; return false; } - inline bool jj_3R_636() + inline bool jj_3R_616() { if (jj_done) return true; if (jj_scan_token(OTHER_T)) return true; @@ -5784,138 +5532,138 @@ void parseInline(); return false; } - inline bool jj_3R_358() + inline bool jj_3R_353() { if (jj_done) return true; if (jj_3R_74()) return true; return false; } - inline bool jj_3R_635() + inline bool jj_3R_615() { if (jj_done) return true; if (jj_3R_63()) return true; Token * xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_668()) { jj_scanpos = xsp; break; } + if (jj_3R_646()) { jj_scanpos = xsp; break; } } return false; } - inline bool jj_3R_568() + inline bool jj_3R_556() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_635()) return false; + if (!jj_3R_615()) return false; jj_scanpos = xsp; - if (!jj_3R_636()) return false; + if (!jj_3R_616()) return false; jj_scanpos = xsp; - if (jj_3R_637()) return true; + if (jj_3R_617()) return true; return false; } - inline bool jj_3R_610() + inline bool jj_3R_590() { if (jj_done) return true; if (jj_scan_token(BUS_T)) return true; return false; } - inline bool jj_3R_357() + inline bool jj_3R_352() { if (jj_done) return true; if (jj_3R_72()) return true; return false; } - inline bool jj_3R_609() + inline bool jj_3R_589() { if (jj_done) return true; if (jj_scan_token(REGISTER_T)) return true; return false; } - inline bool jj_3R_560() + inline bool jj_3R_548() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_609()) return false; + if (!jj_3R_589()) return false; jj_scanpos = xsp; - if (jj_3R_610()) return true; + if (jj_3R_590()) return true; return false; } - inline bool jj_3R_356() + inline bool jj_3R_351() { if (jj_done) return true; if (jj_3R_70()) return true; return false; } - inline bool jj_3R_196() + inline bool jj_3R_194() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_355()) return false; + if (!jj_3R_350()) return false; jj_scanpos = xsp; - if (!jj_3R_356()) return false; + if (!jj_3R_351()) return false; jj_scanpos = xsp; - if (!jj_3R_357()) return false; + if (!jj_3R_352()) return false; jj_scanpos = xsp; - if (!jj_3R_358()) return false; + if (!jj_3R_353()) return false; jj_scanpos = xsp; - if (jj_3R_359()) return true; + if (jj_3R_354()) return true; return false; } - inline bool jj_3R_355() + inline bool jj_3R_350() { if (jj_done) return true; if (jj_3R_88()) return true; return false; } - inline bool jj_3R_656() + inline bool jj_3R_634() { if (jj_done) return true; if (jj_3R_74()) return true; return false; } - inline bool jj_3R_374() + inline bool jj_3R_369() { if (jj_done) return true; if (jj_scan_token(CHARACTER_LITERAL)) return true; return false; } - inline bool jj_3R_395() + inline bool jj_3R_390() { if (jj_done) return true; if (jj_scan_token(SIGNAL_T)) return true; - if (jj_3R_207()) return true; + if (jj_3R_205()) return true; if (jj_scan_token(COLON_T)) return true; if (jj_3R_89()) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_488()) jj_scanpos = xsp; + if (jj_3R_478()) jj_scanpos = xsp; xsp = jj_scanpos; - if (jj_3R_489()) jj_scanpos = xsp; + if (jj_3R_479()) jj_scanpos = xsp; if (jj_scan_token(SEMI_T)) return true; return false; } - inline bool jj_3R_654() + inline bool jj_3R_632() { if (jj_done) return true; if (jj_scan_token(WHEN_T)) return true; if (jj_3R_90()) return true; if (jj_scan_token(ARROW_T)) return true; - if (jj_3R_270()) return true; + if (jj_3R_268()) return true; return false; } @@ -5926,25 +5674,10 @@ void parseInline(); return false; } - inline bool jj_3R_681() - { - if (jj_done) return true; - if (jj_3R_74()) return true; - return false; - } - - inline bool jj_3R_655() - { - if (jj_done) return true; - if (jj_3R_654()) return true; - return false; - } - - inline bool jj_3R_719() + inline bool jj_3R_633() { if (jj_done) return true; - if (jj_3R_73()) return true; - if (jj_scan_token(SEMI_T)) return true; + if (jj_3R_632()) return true; return false; } @@ -5955,10 +5688,10 @@ void parseInline(); return false; } - inline bool jj_3R_554() + inline bool jj_3R_541() { if (jj_done) return true; - if (jj_3R_425()) return true; + if (jj_3R_420()) return true; return false; } @@ -5970,7 +5703,7 @@ void parseInline(); return false; } - inline bool jj_3R_466() + inline bool jj_3R_456() { if (jj_done) return true; Token * xsp; @@ -5979,48 +5712,48 @@ void parseInline(); if (jj_3R_119()) return true; if (jj_scan_token(LESSTHAN_T)) return true; xsp = jj_scanpos; - if (jj_3R_554()) jj_scanpos = xsp; - if (jj_3R_334()) return true; + if (jj_3R_541()) jj_scanpos = xsp; + if (jj_3R_332()) return true; if (jj_scan_token(SEMI_T)) return true; return false; } - inline bool jj_3R_465() + inline bool jj_3R_455() { if (jj_done) return true; if (jj_3R_132()) return true; return false; } - inline bool jj_3R_407() + inline bool jj_3R_402() { if (jj_done) return true; - if (jj_3R_504()) return true; + if (jj_3R_494()) return true; if (jj_3R_70()) return true; return false; } - inline bool jj_3R_382() + inline bool jj_3R_377() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_464()) return false; + if (!jj_3R_454()) return false; jj_scanpos = xsp; - if (!jj_3R_465()) return false; + if (!jj_3R_455()) return false; jj_scanpos = xsp; - if (jj_3R_466()) return true; + if (jj_3R_456()) return true; return false; } - inline bool jj_3R_464() + inline bool jj_3R_454() { if (jj_done) return true; if (jj_3R_131()) return true; return false; } - inline bool jj_3R_267() + inline bool jj_3R_265() { if (jj_done) return true; if (jj_3R_74()) return true; @@ -6031,7 +5764,7 @@ void parseInline(); return false; } - inline bool jj_3R_422() + inline bool jj_3R_417() { if (jj_done) return true; if (jj_scan_token(MINUS_T)) return true; @@ -6043,174 +5776,125 @@ void parseInline(); if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_267()) jj_scanpos = xsp; + if (jj_3R_265()) jj_scanpos = xsp; if (jj_scan_token(CASE_T)) return true; if (jj_3R_61()) return true; if (jj_scan_token(IS_T)) return true; - if (jj_3R_654()) return true; + if (jj_3R_632()) return true; while (true) { xsp = jj_scanpos; - if (jj_3R_655()) { jj_scanpos = xsp; break; } + if (jj_3R_633()) { jj_scanpos = xsp; break; } } if (jj_scan_token(END_T)) return true; if (jj_scan_token(CASE_T)) return true; xsp = jj_scanpos; - if (jj_3R_656()) jj_scanpos = xsp; + if (jj_3R_634()) jj_scanpos = xsp; if (jj_scan_token(SEMI_T)) return true; return false; } - inline bool jj_3R_694() - { - if (jj_done) return true; - if (jj_3R_531()) return true; - return false; - } - - inline bool jj_3R_330() + inline bool jj_3R_328() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_421()) return false; + if (!jj_3R_416()) return false; jj_scanpos = xsp; - if (jj_3R_422()) return true; + if (jj_3R_417()) return true; return false; } - inline bool jj_3R_421() + inline bool jj_3R_416() { if (jj_done) return true; if (jj_scan_token(PLUS_T)) return true; return false; } - inline bool jj_3R_680() - { - if (jj_done) return true; - Token * xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_694()) { jj_scanpos = xsp; break; } - } - return false; - } - - inline bool jj_3R_579() + inline bool jj_3R_567() { if (jj_done) return true; if (jj_scan_token(ROR_T)) return true; return false; } - inline bool jj_3R_578() + inline bool jj_3R_566() { if (jj_done) return true; if (jj_scan_token(ROL_T)) return true; return false; } - inline bool jj_3R_577() + inline bool jj_3R_565() { if (jj_done) return true; if (jj_scan_token(SRA_T)) return true; return false; } - inline bool jj_3R_576() + inline bool jj_3R_564() { if (jj_done) return true; if (jj_scan_token(SLA_T)) return true; return false; } - inline bool jj_3R_575() + inline bool jj_3R_563() { if (jj_done) return true; if (jj_scan_token(SRL_T)) return true; return false; } - inline bool jj_3R_574() + inline bool jj_3R_562() { if (jj_done) return true; if (jj_scan_token(SLL_T)) return true; return false; } - inline bool jj_3R_504() + inline bool jj_3R_494() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_574()) return false; + if (!jj_3R_562()) return false; jj_scanpos = xsp; - if (!jj_3R_575()) return false; + if (!jj_3R_563()) return false; jj_scanpos = xsp; - if (!jj_3R_576()) return false; + if (!jj_3R_564()) return false; jj_scanpos = xsp; - if (!jj_3R_577()) return false; + if (!jj_3R_565()) return false; jj_scanpos = xsp; - if (!jj_3R_578()) return false; + if (!jj_3R_566()) return false; jj_scanpos = xsp; - if (jj_3R_579()) return true; - return false; - } - - inline bool jj_3R_720() - { - if (jj_done) return true; - if (jj_3R_346()) return true; - if (jj_scan_token(SEMI_T)) return true; + if (jj_3R_567()) return true; return false; } - inline bool jj_3R_535() + inline bool jj_3R_522() { if (jj_done) return true; if (jj_scan_token(LPAREN_T)) return true; - if (jj_3R_597()) return true; + if (jj_3R_577()) return true; if (jj_scan_token(RPAREN_T)) return true; return false; } - inline bool jj_3R_320() + inline bool jj_3R_318() { if (jj_done) return true; if (jj_3R_70()) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_407()) jj_scanpos = xsp; - return false; - } - - inline bool jj_3R_646() - { - if (jj_done) return true; - if (jj_3R_74()) return true; - if (jj_scan_token(COLON_T)) return true; - if (jj_scan_token(BLOCK_T)) return true; - Token * xsp; - xsp = jj_scanpos; - if (jj_3R_677()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_scan_token(56)) jj_scanpos = xsp; - if (jj_3R_678()) return true; - if (jj_3R_679()) return true; - if (jj_scan_token(BEGIN_T)) return true; - if (jj_3R_680()) return true; - if (jj_scan_token(END_T)) return true; - if (jj_scan_token(BLOCK_T)) return true; - xsp = jj_scanpos; - if (jj_3R_681()) jj_scanpos = xsp; - if (jj_scan_token(SEMI_T)) return true; + if (jj_3R_402()) jj_scanpos = xsp; return false; } - inline bool jj_3R_256() + inline bool jj_3R_254() { if (jj_done) return true; - if (jj_3R_384()) return true; + if (jj_3R_379()) return true; return false; } @@ -6228,13 +5912,13 @@ void parseInline(); return false; } - inline bool jj_3R_441() + inline bool jj_3R_431() { if (jj_done) return true; if (jj_3R_63()) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_535()) jj_scanpos = xsp; + if (jj_3R_522()) jj_scanpos = xsp; return false; } @@ -6252,16 +5936,6 @@ void parseInline(); return false; } - inline bool jj_3R_692() - { - if (jj_done) return true; - if (jj_3R_565()) return true; - Token * xsp; - xsp = jj_scanpos; - if (jj_3R_720()) jj_scanpos = xsp; - return false; - } - inline bool jj_3R_123() { if (jj_done) return true; @@ -6270,16 +5944,6 @@ void parseInline(); return false; } - inline bool jj_3R_691() - { - if (jj_done) return true; - if (jj_3R_69()) return true; - Token * xsp; - xsp = jj_scanpos; - if (jj_3R_719()) jj_scanpos = xsp; - return false; - } - inline bool jj_3_88() { if (jj_done) return true; @@ -6298,24 +5962,6 @@ void parseInline(); return false; } - inline bool jj_3R_678() - { - if (jj_done) return true; - Token * xsp; - xsp = jj_scanpos; - if (jj_3R_691()) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_3R_692()) jj_scanpos = xsp; - return false; - } - - inline bool jj_3R_693() - { - if (jj_done) return true; - if (jj_3R_146()) return true; - return false; - } - inline bool jj_3_91() { if (jj_done) return true; @@ -6323,17 +5969,6 @@ void parseInline(); return false; } - inline bool jj_3R_679() - { - if (jj_done) return true; - Token * xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_693()) { jj_scanpos = xsp; break; } - } - return false; - } - inline bool jj_3_90() { if (jj_done) return true; @@ -6348,10 +5983,10 @@ void parseInline(); return false; } - inline bool jj_3R_313() + inline bool jj_3R_311() { if (jj_done) return true; - if (jj_3R_403()) return true; + if (jj_3R_398()) return true; return false; } @@ -6370,10 +6005,10 @@ void parseInline(); return false; } - inline bool jj_3R_255() + inline bool jj_3R_253() { if (jj_done) return true; - if (jj_3R_383()) return true; + if (jj_3R_378()) return true; return false; } @@ -6395,17 +6030,17 @@ void parseInline(); return false; } - inline bool jj_3R_312() + inline bool jj_3R_310() { if (jj_done) return true; - if (jj_3R_352()) return true; + if (jj_3R_347()) return true; return false; } - inline bool jj_3R_311() + inline bool jj_3R_309() { if (jj_done) return true; - if (jj_3R_402()) return true; + if (jj_3R_397()) return true; return false; } @@ -6416,17 +6051,17 @@ void parseInline(); return false; } - inline bool jj_3R_310() + inline bool jj_3R_308() { if (jj_done) return true; - if (jj_3R_401()) return true; + if (jj_3R_396()) return true; return false; } - inline bool jj_3R_309() + inline bool jj_3R_307() { if (jj_done) return true; - if (jj_3R_400()) return true; + if (jj_3R_395()) return true; return false; } @@ -6437,14 +6072,14 @@ void parseInline(); return false; } - inline bool jj_3R_307() + inline bool jj_3R_305() { if (jj_done) return true; - if (jj_3R_399()) return true; + if (jj_3R_394()) return true; return false; } - inline bool jj_3R_308() + inline bool jj_3R_306() { if (jj_done) return true; if (jj_3R_67()) return true; @@ -6458,34 +6093,34 @@ void parseInline(); return false; } - inline bool jj_3R_306() + inline bool jj_3R_304() { if (jj_done) return true; - if (jj_3R_398()) return true; + if (jj_3R_393()) return true; return false; } - inline bool jj_3R_533() + inline bool jj_3R_520() { if (jj_done) return true; if (jj_scan_token(COMMA_T)) return true; - if (jj_3R_334()) return true; + if (jj_3R_332()) return true; if (jj_scan_token(WHEN_T)) return true; if (jj_3R_90()) return true; return false; } - inline bool jj_3R_305() + inline bool jj_3R_303() { if (jj_done) return true; - if (jj_3R_397()) return true; + if (jj_3R_392()) return true; return false; } - inline bool jj_3R_304() + inline bool jj_3R_302() { if (jj_done) return true; - if (jj_3R_396()) return true; + if (jj_3R_391()) return true; return false; } @@ -6494,7 +6129,7 @@ void parseInline(); if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_254()) return false; + if (!jj_3R_252()) return false; jj_scanpos = xsp; if (!jj_3_85()) return false; jj_scanpos = xsp; @@ -6502,7 +6137,7 @@ void parseInline(); jj_scanpos = xsp; if (!jj_3_87()) return false; jj_scanpos = xsp; - if (!jj_3R_255()) return false; + if (!jj_3R_253()) return false; jj_scanpos = xsp; if (!jj_3_89()) return false; jj_scanpos = xsp; @@ -6518,32 +6153,32 @@ void parseInline(); jj_scanpos = xsp; if (!jj_3_95()) return false; jj_scanpos = xsp; - if (jj_3R_256()) return true; + if (jj_3R_254()) return true; return false; } - inline bool jj_3R_254() + inline bool jj_3R_252() { if (jj_done) return true; - if (jj_3R_382()) return true; + if (jj_3R_377()) return true; return false; } - inline bool jj_3R_303() + inline bool jj_3R_301() { if (jj_done) return true; - if (jj_3R_395()) return true; + if (jj_3R_390()) return true; return false; } - inline bool jj_3R_302() + inline bool jj_3R_300() { if (jj_done) return true; - if (jj_3R_394()) return true; + if (jj_3R_389()) return true; return false; } - inline bool jj_3R_537() + inline bool jj_3R_524() { if (jj_done) return true; if (jj_scan_token(COMMA_T)) return true; @@ -6551,31 +6186,31 @@ void parseInline(); return false; } - inline bool jj_3R_301() + inline bool jj_3R_299() { if (jj_done) return true; - if (jj_3R_393()) return true; + if (jj_3R_388()) return true; return false; } - inline bool jj_3R_443() + inline bool jj_3R_433() { if (jj_done) return true; - if (jj_3R_536()) return true; + if (jj_3R_523()) return true; return false; } - inline bool jj_3R_300() + inline bool jj_3R_298() { if (jj_done) return true; - if (jj_3R_392()) return true; + if (jj_3R_387()) return true; return false; } - inline bool jj_3R_442() + inline bool jj_3R_432() { if (jj_done) return true; - if (jj_3R_352()) return true; + if (jj_3R_347()) return true; return false; } @@ -6584,6 +6219,10 @@ void parseInline(); if (jj_done) return true; Token * xsp; xsp = jj_scanpos; + if (!jj_3R_297()) return false; + jj_scanpos = xsp; + if (!jj_3R_298()) return false; + jj_scanpos = xsp; if (!jj_3R_299()) return false; jj_scanpos = xsp; if (!jj_3R_300()) return false; @@ -6608,17 +6247,13 @@ void parseInline(); jj_scanpos = xsp; if (!jj_3R_310()) return false; jj_scanpos = xsp; - if (!jj_3R_311()) return false; - jj_scanpos = xsp; - if (!jj_3R_312()) return false; - jj_scanpos = xsp; if (!jj_3_8()) return false; jj_scanpos = xsp; - if (jj_3R_313()) return true; + if (jj_3R_311()) return true; return false; } - inline bool jj_3R_299() + inline bool jj_3R_297() { if (jj_done) return true; if (jj_3R_98()) return true; @@ -6632,7 +6267,7 @@ void parseInline(); return false; } - inline bool jj_3R_270() + inline bool jj_3R_268() { if (jj_done) return true; Token * xsp; @@ -6643,19 +6278,19 @@ void parseInline(); return false; } - inline bool jj_3R_350() + inline bool jj_3R_345() { if (jj_done) return true; if (jj_scan_token(FOR_T)) return true; - if (jj_3R_441()) return true; + if (jj_3R_431()) return true; Token * xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_442()) { jj_scanpos = xsp; break; } + if (jj_3R_432()) { jj_scanpos = xsp; break; } } while (true) { xsp = jj_scanpos; - if (jj_3R_443()) { jj_scanpos = xsp; break; } + if (jj_3R_433()) { jj_scanpos = xsp; break; } } if (jj_scan_token(END_T)) return true; if (jj_scan_token(FOR_T)) return true; @@ -6663,7 +6298,7 @@ void parseInline(); return false; } - inline bool jj_3R_252() + inline bool jj_3R_250() { if (jj_done) return true; if (jj_scan_token(LPAREN_T)) return true; @@ -6672,37 +6307,37 @@ void parseInline(); return false; } - inline bool jj_3R_450() + inline bool jj_3R_440() { if (jj_done) return true; if (jj_3R_63()) return true; Token * xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_537()) { jj_scanpos = xsp; break; } + if (jj_3R_524()) { jj_scanpos = xsp; break; } } return false; } - inline bool jj_3R_362() + inline bool jj_3R_357() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_449()) return false; + if (!jj_3R_439()) return false; jj_scanpos = xsp; - if (jj_3R_450()) return true; + if (jj_3R_440()) return true; return false; } - inline bool jj_3R_449() + inline bool jj_3R_439() { if (jj_done) return true; if (jj_scan_token(ALL_T)) return true; return false; } - inline bool jj_3R_278() + inline bool jj_3R_276() { if (jj_done) return true; if (jj_3R_61()) return true; @@ -6716,71 +6351,71 @@ void parseInline(); return false; } - inline bool jj_3R_385() + inline bool jj_3R_380() { if (jj_done) return true; if (jj_scan_token(ON_T)) return true; - if (jj_3R_362()) return true; + if (jj_3R_357()) return true; return false; } - inline bool jj_3R_440() + inline bool jj_3R_430() { if (jj_done) return true; - if (jj_3R_346()) return true; + if (jj_3R_341()) return true; return false; } - inline bool jj_3R_439() + inline bool jj_3R_429() { if (jj_done) return true; if (jj_3R_73()) return true; return false; } - inline bool jj_3R_433() + inline bool jj_3R_423() { if (jj_done) return true; - if (jj_3R_334()) return true; + if (jj_3R_332()) return true; if (jj_scan_token(WHEN_T)) return true; if (jj_3R_90()) return true; Token * xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_533()) { jj_scanpos = xsp; break; } + if (jj_3R_520()) { jj_scanpos = xsp; break; } } return false; } - inline bool jj_3R_438() + inline bool jj_3R_428() { if (jj_done) return true; if (jj_scan_token(USE_T)) return true; - if (jj_3R_534()) return true; + if (jj_3R_521()) return true; return false; } - inline bool jj_3R_349() + inline bool jj_3R_344() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_438()) jj_scanpos = xsp; + if (jj_3R_428()) jj_scanpos = xsp; xsp = jj_scanpos; - if (jj_3R_439()) jj_scanpos = xsp; + if (jj_3R_429()) jj_scanpos = xsp; xsp = jj_scanpos; - if (jj_3R_440()) jj_scanpos = xsp; + if (jj_3R_430()) jj_scanpos = xsp; return false; } - inline bool jj_3R_251() + inline bool jj_3R_249() { if (jj_done) return true; if (jj_3R_63()) return true; return false; } - inline bool jj_3R_342() + inline bool jj_3R_337() { if (jj_done) return true; if (jj_scan_token(WITH_T)) return true; @@ -6789,19 +6424,19 @@ void parseInline(); if (jj_3R_119()) return true; if (jj_scan_token(LESSTHAN_T)) return true; if (jj_3R_172()) return true; - if (jj_3R_433()) return true; + if (jj_3R_423()) return true; if (jj_scan_token(SEMI_T)) return true; return false; } - inline bool jj_3R_723() + inline bool jj_3R_688() { if (jj_done) return true; - if (jj_3R_729()) return true; + if (jj_3R_694()) return true; return false; } - inline bool jj_3R_444() + inline bool jj_3R_434() { if (jj_done) return true; if (jj_3R_74()) return true; @@ -6810,7 +6445,7 @@ void parseInline(); return false; } - inline bool jj_3R_756() + inline bool jj_3R_721() { if (jj_done) return true; if (jj_3R_74()) return true; @@ -6827,35 +6462,35 @@ void parseInline(); return false; } - inline bool jj_3R_710() + inline bool jj_3R_677() { if (jj_done) return true; if (jj_3R_86()) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_723()) jj_scanpos = xsp; + if (jj_3R_688()) jj_scanpos = xsp; return false; } - inline bool jj_3R_709() + inline bool jj_3R_676() { if (jj_done) return true; if (jj_3R_116()) return true; return false; } - inline bool jj_3R_684() + inline bool jj_3R_656() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_709()) return false; + if (!jj_3R_676()) return false; jj_scanpos = xsp; - if (jj_3R_710()) return true; + if (jj_3R_677()) return true; return false; } - inline bool jj_3R_361() + inline bool jj_3R_356() { if (jj_done) return true; if (jj_scan_token(SEVERITY_T)) return true; @@ -6863,7 +6498,7 @@ void parseInline(); return false; } - inline bool jj_3R_277() + inline bool jj_3R_275() { if (jj_done) return true; if (jj_3R_74()) return true; @@ -6876,15 +6511,15 @@ void parseInline(); if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_277()) jj_scanpos = xsp; + if (jj_3R_275()) jj_scanpos = xsp; if (jj_scan_token(RETURN_T)) return true; xsp = jj_scanpos; - if (jj_3R_278()) jj_scanpos = xsp; + if (jj_3R_276()) jj_scanpos = xsp; if (jj_scan_token(SEMI_T)) return true; return false; } - inline bool jj_3R_261() + inline bool jj_3R_259() { if (jj_done) return true; if (jj_scan_token(SEVERITY_T)) return true; @@ -6892,24 +6527,24 @@ void parseInline(); return false; } - inline bool jj_3R_400() + inline bool jj_3R_395() { if (jj_done) return true; if (jj_scan_token(ATTRIBUTE_T)) return true; - if (jj_3R_232()) return true; + if (jj_3R_230()) return true; if (jj_scan_token(OF_T)) return true; - if (jj_3R_498()) return true; + if (jj_3R_488()) return true; if (jj_scan_token(IS_T)) return true; if (jj_3R_61()) return true; if (jj_scan_token(SEMI_T)) return true; return false; } - inline bool jj_3R_332() + inline bool jj_3R_330() { if (jj_done) return true; if (jj_scan_token(COMMA_T)) return true; - if (jj_3R_331()) return true; + if (jj_3R_329()) return true; return false; } @@ -6922,13 +6557,13 @@ void parseInline(); xsp = jj_scanpos; if (!jj_scan_token(85)) return false; jj_scanpos = xsp; - if (jj_3R_251()) return true; + if (jj_3R_249()) return true; xsp = jj_scanpos; - if (jj_3R_252()) jj_scanpos = xsp; + if (jj_3R_250()) jj_scanpos = xsp; return false; } - inline bool jj_3R_260() + inline bool jj_3R_258() { if (jj_done) return true; if (jj_3R_74()) return true; @@ -6936,18 +6571,18 @@ void parseInline(); return false; } - inline bool jj_3R_377() + inline bool jj_3R_372() { if (jj_done) return true; if (jj_scan_token(RANGE_T)) return true; return false; } - inline bool jj_3R_321() + inline bool jj_3R_319() { if (jj_done) return true; - if (jj_3R_408()) return true; - if (jj_3R_320()) return true; + if (jj_3R_403()) return true; + if (jj_3R_318()) return true; return false; } @@ -6956,83 +6591,83 @@ void parseInline(); if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_260()) jj_scanpos = xsp; + if (jj_3R_258()) jj_scanpos = xsp; if (jj_scan_token(REPORT_T)) return true; if (jj_3R_61()) return true; xsp = jj_scanpos; - if (jj_3R_261()) jj_scanpos = xsp; + if (jj_3R_259()) jj_scanpos = xsp; if (jj_scan_token(SEMI_T)) return true; return false; } - inline bool jj_3R_232() + inline bool jj_3R_230() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_376()) return false; + if (!jj_3R_371()) return false; jj_scanpos = xsp; - if (jj_3R_377()) return true; + if (jj_3R_372()) return true; return false; } - inline bool jj_3R_376() + inline bool jj_3R_371() { if (jj_done) return true; if (jj_3R_74()) return true; return false; } - inline bool jj_3R_516() + inline bool jj_3R_506() { if (jj_done) return true; if (jj_scan_token(QNEQU_T)) return true; return false; } - inline bool jj_3R_515() + inline bool jj_3R_505() { if (jj_done) return true; if (jj_scan_token(QEQU_T)) return true; return false; } - inline bool jj_3R_514() + inline bool jj_3R_504() { if (jj_done) return true; if (jj_scan_token(QL_T)) return true; return false; } - inline bool jj_3R_733() + inline bool jj_3R_698() { if (jj_done) return true; if (jj_3R_63()) return true; return false; } - inline bool jj_3R_513() + inline bool jj_3R_503() { if (jj_done) return true; if (jj_scan_token(QG_T)) return true; return false; } - inline bool jj_3R_512() + inline bool jj_3R_502() { if (jj_done) return true; if (jj_scan_token(QLT_T)) return true; return false; } - inline bool jj_3R_511() + inline bool jj_3R_501() { if (jj_done) return true; if (jj_scan_token(QGT_T)) return true; return false; } - inline bool jj_3R_510() + inline bool jj_3R_500() { if (jj_done) return true; if (jj_scan_token(NOTEQU_T)) return true; @@ -7058,14 +6693,14 @@ void parseInline(); return false; } - inline bool jj_3R_509() + inline bool jj_3R_499() { if (jj_done) return true; if (jj_scan_token(LESSTHAN_T)) return true; return false; } - inline bool jj_3R_360() + inline bool jj_3R_355() { if (jj_done) return true; if (jj_scan_token(REPORT_T)) return true; @@ -7073,59 +6708,59 @@ void parseInline(); return false; } - inline bool jj_3R_508() + inline bool jj_3R_498() { if (jj_done) return true; if (jj_scan_token(GREATERTHAN_T)) return true; return false; } - inline bool jj_3R_507() + inline bool jj_3R_497() { if (jj_done) return true; if (jj_scan_token(EQU_T)) return true; return false; } - inline bool jj_3R_506() + inline bool jj_3R_496() { if (jj_done) return true; if (jj_scan_token(GT_T)) return true; return false; } - inline bool jj_3R_408() + inline bool jj_3R_403() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_505()) return false; + if (!jj_3R_495()) return false; jj_scanpos = xsp; - if (!jj_3R_506()) return false; + if (!jj_3R_496()) return false; jj_scanpos = xsp; - if (!jj_3R_507()) return false; + if (!jj_3R_497()) return false; jj_scanpos = xsp; - if (!jj_3R_508()) return false; + if (!jj_3R_498()) return false; jj_scanpos = xsp; - if (!jj_3R_509()) return false; + if (!jj_3R_499()) return false; jj_scanpos = xsp; - if (!jj_3R_510()) return false; + if (!jj_3R_500()) return false; jj_scanpos = xsp; - if (!jj_3R_511()) return false; + if (!jj_3R_501()) return false; jj_scanpos = xsp; - if (!jj_3R_512()) return false; + if (!jj_3R_502()) return false; jj_scanpos = xsp; - if (!jj_3R_513()) return false; + if (!jj_3R_503()) return false; jj_scanpos = xsp; - if (!jj_3R_514()) return false; + if (!jj_3R_504()) return false; jj_scanpos = xsp; - if (!jj_3R_515()) return false; + if (!jj_3R_505()) return false; jj_scanpos = xsp; - if (jj_3R_516()) return true; + if (jj_3R_506()) return true; return false; } - inline bool jj_3R_505() + inline bool jj_3R_495() { if (jj_done) return true; if (jj_scan_token(LT_T)) return true; @@ -7135,11 +6770,11 @@ void parseInline(); inline bool jj_3R_169() { if (jj_done) return true; - if (jj_3R_331()) return true; + if (jj_3R_329()) return true; Token * xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_332()) { jj_scanpos = xsp; break; } + if (jj_3R_330()) { jj_scanpos = xsp; break; } } return false; } @@ -7147,14 +6782,14 @@ void parseInline(); inline bool jj_3R_151() { if (jj_done) return true; - if (jj_3R_320()) return true; + if (jj_3R_318()) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_321()) jj_scanpos = xsp; + if (jj_3R_319()) jj_scanpos = xsp; return false; } - inline bool jj_3R_423() + inline bool jj_3R_418() { if (jj_done) return true; if (jj_3R_66()) return true; @@ -7162,24 +6797,24 @@ void parseInline(); return false; } - inline bool jj_3R_732() + inline bool jj_3R_697() { if (jj_done) return true; - if (jj_3R_740()) return true; + if (jj_3R_705()) return true; return false; } - inline bool jj_3R_331() + inline bool jj_3R_329() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_423()) jj_scanpos = xsp; - if (jj_3R_424()) return true; + if (jj_3R_418()) jj_scanpos = xsp; + if (jj_3R_419()) return true; return false; } - inline bool jj_3R_259() + inline bool jj_3R_257() { if (jj_done) return true; if (jj_3R_145()) return true; @@ -7187,20 +6822,20 @@ void parseInline(); return false; } - inline bool jj_3R_725() + inline bool jj_3R_690() { if (jj_done) return true; if (jj_scan_token(RECORD_T)) return true; Token * xsp; - if (jj_3R_732()) return true; + if (jj_3R_697()) return true; while (true) { xsp = jj_scanpos; - if (jj_3R_732()) { jj_scanpos = xsp; break; } + if (jj_3R_697()) { jj_scanpos = xsp; break; } } if (jj_scan_token(END_T)) return true; if (jj_scan_token(RECORD_T)) return true; xsp = jj_scanpos; - if (jj_3R_733()) jj_scanpos = xsp; + if (jj_3R_698()) jj_scanpos = xsp; return false; } @@ -7209,8 +6844,8 @@ void parseInline(); if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_259()) jj_scanpos = xsp; - if (jj_3R_198()) return true; + if (jj_3R_257()) jj_scanpos = xsp; + if (jj_3R_196()) return true; if (jj_scan_token(SEMI_T)) return true; return false; } @@ -7239,16 +6874,16 @@ void parseInline(); return false; } - inline bool jj_3R_198() + inline bool jj_3R_196() { if (jj_done) return true; if (jj_scan_token(ASSERT_T)) return true; if (jj_3R_83()) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_360()) jj_scanpos = xsp; + if (jj_3R_355()) jj_scanpos = xsp; xsp = jj_scanpos; - if (jj_3R_361()) jj_scanpos = xsp; + if (jj_3R_356()) jj_scanpos = xsp; return false; } @@ -7268,14 +6903,14 @@ void parseInline(); return false; } - inline bool jj_3R_193() + inline bool jj_3R_191() { if (jj_done) return true; if (jj_3R_115()) return true; return false; } - inline bool jj_3R_192() + inline bool jj_3R_190() { if (jj_done) return true; if (jj_3R_70()) return true; @@ -7289,20 +6924,20 @@ void parseInline(); if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_192()) return false; + if (!jj_3R_190()) return false; jj_scanpos = xsp; - if (jj_3R_193()) return true; + if (jj_3R_191()) return true; return false; } - inline bool jj_3R_731() + inline bool jj_3R_696() { if (jj_done) return true; - if (jj_3R_739()) return true; + if (jj_3R_704()) return true; return false; } - inline bool jj_3R_240() + inline bool jj_3R_238() { if (jj_done) return true; if (jj_scan_token(LPAREN_T)) return true; @@ -7311,25 +6946,25 @@ void parseInline(); return false; } - inline bool jj_3R_730() + inline bool jj_3R_695() { if (jj_done) return true; - if (jj_3R_738()) return true; + if (jj_3R_703()) return true; return false; } - inline bool jj_3R_724() + inline bool jj_3R_689() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_730()) return false; + if (!jj_3R_695()) return false; jj_scanpos = xsp; - if (jj_3R_731()) return true; + if (jj_3R_696()) return true; return false; } - inline bool jj_3R_239() + inline bool jj_3R_237() { if (jj_done) return true; if (jj_3R_114()) return true; @@ -7343,53 +6978,53 @@ void parseInline(); if (jj_scan_token(APOSTROPHE_T)) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_239()) return false; + if (!jj_3R_237()) return false; jj_scanpos = xsp; - if (jj_3R_240()) return true; + if (jj_3R_238()) return true; return false; } - inline bool jj_3R_364() + inline bool jj_3R_359() { if (jj_done) return true; if (jj_3R_117()) return true; return false; } - inline bool jj_3R_202() + inline bool jj_3R_200() { if (jj_done) return true; Token * xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_364()) { jj_scanpos = xsp; break; } + if (jj_3R_359()) { jj_scanpos = xsp; break; } } return false; } - inline bool jj_3R_203() + inline bool jj_3R_201() { if (jj_done) return true; if (jj_3R_74()) return true; return false; } - inline bool jj_3R_494() + inline bool jj_3R_484() { if (jj_done) return true; - if (jj_3R_247()) return true; + if (jj_3R_245()) return true; return false; } - inline bool jj_3R_250() + inline bool jj_3R_248() { if (jj_done) return true; if (jj_scan_token(COMMA_T)) return true; - if (jj_3R_249()) return true; + if (jj_3R_247()) return true; return false; } - inline bool jj_3R_246() + inline bool jj_3R_244() { if (jj_done) return true; if (jj_scan_token(NEW_T)) return true; @@ -7397,11 +7032,11 @@ void parseInline(); return false; } - inline bool jj_3R_200() + inline bool jj_3R_198() { if (jj_done) return true; if (jj_scan_token(LPAREN_T)) return true; - if (jj_3R_362()) return true; + if (jj_3R_357()) return true; if (jj_scan_token(RPAREN_T)) return true; return false; } @@ -7413,7 +7048,7 @@ void parseInline(); xsp = jj_scanpos; if (!jj_3_4()) return false; jj_scanpos = xsp; - if (jj_3R_246()) return true; + if (jj_3R_244()) return true; return false; } @@ -7425,21 +7060,21 @@ void parseInline(); return false; } - inline bool jj_3R_564() + inline bool jj_3R_552() { if (jj_done) return true; - if (jj_3R_323()) return true; + if (jj_3R_321()) return true; return false; } - inline bool jj_3R_563() + inline bool jj_3R_551() { if (jj_done) return true; if (jj_scan_token(CHARACTER_LITERAL)) return true; return false; } - inline bool jj_3R_199() + inline bool jj_3R_197() { if (jj_done) return true; if (jj_3R_74()) return true; @@ -7447,23 +7082,23 @@ void parseInline(); return false; } - inline bool jj_3R_562() + inline bool jj_3R_550() { if (jj_done) return true; if (jj_3R_74()) return true; return false; } - inline bool jj_3R_492() + inline bool jj_3R_482() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_562()) return false; + if (!jj_3R_550()) return false; jj_scanpos = xsp; - if (!jj_3R_563()) return false; + if (!jj_3R_551()) return false; jj_scanpos = xsp; - if (jj_3R_564()) return true; + if (jj_3R_552()) return true; return false; } @@ -7472,53 +7107,53 @@ void parseInline(); if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_199()) jj_scanpos = xsp; + if (jj_3R_197()) jj_scanpos = xsp; xsp = jj_scanpos; if (jj_scan_token(79)) jj_scanpos = xsp; if (jj_scan_token(PROCESS_T)) return true; xsp = jj_scanpos; - if (jj_3R_200()) jj_scanpos = xsp; + if (jj_3R_198()) jj_scanpos = xsp; xsp = jj_scanpos; if (jj_scan_token(56)) jj_scanpos = xsp; - if (jj_3R_201()) return true; + if (jj_3R_199()) return true; if (jj_scan_token(BEGIN_T)) return true; - if (jj_3R_202()) return true; + if (jj_3R_200()) return true; if (jj_scan_token(END_T)) return true; xsp = jj_scanpos; if (jj_scan_token(79)) jj_scanpos = xsp; if (jj_scan_token(PROCESS_T)) return true; xsp = jj_scanpos; - if (jj_3R_203()) jj_scanpos = xsp; + if (jj_3R_201()) jj_scanpos = xsp; if (jj_scan_token(SEMI_T)) return true; return false; } - inline bool jj_3R_363() + inline bool jj_3R_358() { if (jj_done) return true; - if (jj_3R_451()) return true; + if (jj_3R_441()) return true; return false; } - inline bool jj_3R_201() + inline bool jj_3R_199() { if (jj_done) return true; Token * xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_363()) { jj_scanpos = xsp; break; } + if (jj_3R_358()) { jj_scanpos = xsp; break; } } return false; } - inline bool jj_3R_547() + inline bool jj_3R_534() { if (jj_done) return true; - if (jj_3R_403()) return true; + if (jj_3R_398()) return true; return false; } - inline bool jj_3R_493() + inline bool jj_3R_483() { if (jj_done) return true; if (jj_scan_token(COLON_T)) return true; @@ -7526,10 +7161,10 @@ void parseInline(); return false; } - inline bool jj_3R_546() + inline bool jj_3R_533() { if (jj_done) return true; - if (jj_3R_352()) return true; + if (jj_3R_347()) return true; return false; } @@ -7540,33 +7175,33 @@ void parseInline(); return false; } - inline bool jj_3R_545() + inline bool jj_3R_532() { if (jj_done) return true; - if (jj_3R_400()) return true; + if (jj_3R_395()) return true; return false; } - inline bool jj_3R_398() + inline bool jj_3R_393() { if (jj_done) return true; if (jj_scan_token(ALIAS_T)) return true; - if (jj_3R_492()) return true; + if (jj_3R_482()) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_493()) jj_scanpos = xsp; + if (jj_3R_483()) jj_scanpos = xsp; if (jj_scan_token(IS_T)) return true; if (jj_3R_63()) return true; xsp = jj_scanpos; - if (jj_3R_494()) jj_scanpos = xsp; + if (jj_3R_484()) jj_scanpos = xsp; if (jj_scan_token(SEMI_T)) return true; return false; } - inline bool jj_3R_544() + inline bool jj_3R_531() { if (jj_done) return true; - if (jj_3R_398()) return true; + if (jj_3R_393()) return true; return false; } @@ -7574,11 +7209,11 @@ void parseInline(); { if (jj_done) return true; if (jj_scan_token(LPAREN_T)) return true; - if (jj_3R_249()) return true; + if (jj_3R_247()) return true; Token * xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_250()) { jj_scanpos = xsp; break; } + if (jj_3R_248()) { jj_scanpos = xsp; break; } } if (jj_scan_token(RPAREN_T)) return true; return false; @@ -7591,52 +7226,52 @@ void parseInline(); return false; } - inline bool jj_3R_543() + inline bool jj_3R_530() { if (jj_done) return true; - if (jj_3R_397()) return true; + if (jj_3R_392()) return true; return false; } - inline bool jj_3R_542() + inline bool jj_3R_529() { if (jj_done) return true; - if (jj_3R_396()) return true; + if (jj_3R_391()) return true; return false; } - inline bool jj_3R_541() + inline bool jj_3R_528() { if (jj_done) return true; - if (jj_3R_394()) return true; + if (jj_3R_389()) return true; return false; } - inline bool jj_3R_540() + inline bool jj_3R_527() { if (jj_done) return true; - if (jj_3R_393()) return true; + if (jj_3R_388()) return true; return false; } - inline bool jj_3R_284() + inline bool jj_3R_282() { if (jj_done) return true; if (jj_scan_token(MINUS_T)) return true; return false; } - inline bool jj_3R_285() + inline bool jj_3R_283() { if (jj_done) return true; if (jj_scan_token(AMPERSAND_T)) return true; return false; } - inline bool jj_3R_539() + inline bool jj_3R_526() { if (jj_done) return true; - if (jj_3R_392()) return true; + if (jj_3R_387()) return true; return false; } @@ -7653,64 +7288,64 @@ void parseInline(); if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_283()) return false; + if (!jj_3R_281()) return false; jj_scanpos = xsp; - if (!jj_3R_284()) return false; + if (!jj_3R_282()) return false; jj_scanpos = xsp; - if (jj_3R_285()) return true; + if (jj_3R_283()) return true; return false; } - inline bool jj_3R_283() + inline bool jj_3R_281() { if (jj_done) return true; if (jj_scan_token(PLUS_T)) return true; return false; } - inline bool jj_3R_538() + inline bool jj_3R_525() { if (jj_done) return true; if (jj_3R_98()) return true; return false; } - inline bool jj_3R_451() + inline bool jj_3R_441() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_538()) return false; + if (!jj_3R_525()) return false; jj_scanpos = xsp; - if (!jj_3R_539()) return false; + if (!jj_3R_526()) return false; jj_scanpos = xsp; - if (!jj_3R_540()) return false; + if (!jj_3R_527()) return false; jj_scanpos = xsp; - if (!jj_3R_541()) return false; + if (!jj_3R_528()) return false; jj_scanpos = xsp; - if (!jj_3R_542()) return false; + if (!jj_3R_529()) return false; jj_scanpos = xsp; - if (!jj_3R_543()) return false; + if (!jj_3R_530()) return false; jj_scanpos = xsp; - if (!jj_3R_544()) return false; + if (!jj_3R_531()) return false; jj_scanpos = xsp; if (!jj_3_77()) return false; jj_scanpos = xsp; - if (!jj_3R_545()) return false; + if (!jj_3R_532()) return false; jj_scanpos = xsp; - if (!jj_3R_546()) return false; + if (!jj_3R_533()) return false; jj_scanpos = xsp; if (!jj_3_78()) return false; jj_scanpos = xsp; - if (jj_3R_547()) return true; + if (jj_3R_534()) return true; return false; } - inline bool jj_3R_347() + inline bool jj_3R_342() { if (jj_done) return true; if (jj_scan_token(LPAREN_T)) return true; - if (jj_3R_238()) return true; + if (jj_3R_236()) return true; if (jj_scan_token(RPAREN_T)) return true; return false; } @@ -7722,7 +7357,7 @@ void parseInline(); return false; } - inline bool jj_3R_526() + inline bool jj_3R_516() { if (jj_done) return true; if (jj_3R_63()) return true; @@ -7732,7 +7367,7 @@ void parseInline(); return false; } - inline bool jj_3R_525() + inline bool jj_3R_515() { if (jj_done) return true; if (jj_scan_token(BOX_T)) return true; @@ -7753,42 +7388,42 @@ void parseInline(); Token * xsp; xsp = jj_scanpos; if (jj_3_76()) jj_scanpos = xsp; - if (jj_3R_182()) return true; + if (jj_3R_180()) return true; if (jj_scan_token(SEMI_T)) return true; return false; } - inline bool jj_3R_524() + inline bool jj_3R_514() { if (jj_done) return true; if (jj_3R_62()) return true; return false; } - inline bool jj_3R_424() + inline bool jj_3R_419() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_524()) return false; + if (!jj_3R_514()) return false; jj_scanpos = xsp; - if (!jj_3R_525()) return false; + if (!jj_3R_515()) return false; jj_scanpos = xsp; - if (jj_3R_526()) return true; + if (jj_3R_516()) return true; return false; } - inline bool jj_3R_182() + inline bool jj_3R_180() { if (jj_done) return true; if (jj_3R_63()) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_347()) jj_scanpos = xsp; + if (jj_3R_342()) jj_scanpos = xsp; return false; } - inline bool jj_3R_238() + inline bool jj_3R_236() { if (jj_done) return true; if (jj_3R_169()) return true; @@ -7802,17 +7437,17 @@ void parseInline(); return false; } - inline bool jj_3R_216() + inline bool jj_3R_214() { if (jj_done) return true; if (jj_3R_87()) return true; return false; } - inline bool jj_3R_215() + inline bool jj_3R_213() { if (jj_done) return true; - if (jj_3R_373()) return true; + if (jj_3R_368()) return true; return false; } @@ -7837,17 +7472,17 @@ void parseInline(); return false; } - inline bool jj_3R_214() + inline bool jj_3R_212() { if (jj_done) return true; if (jj_3R_91()) return true; return false; } - inline bool jj_3R_213() + inline bool jj_3R_211() { if (jj_done) return true; - if (jj_3R_372()) return true; + if (jj_3R_367()) return true; return false; } @@ -7858,10 +7493,10 @@ void parseInline(); return false; } - inline bool jj_3R_212() + inline bool jj_3R_210() { if (jj_done) return true; - if (jj_3R_371()) return true; + if (jj_3R_366()) return true; return false; } @@ -7870,17 +7505,17 @@ void parseInline(); if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_212()) return false; + if (!jj_3R_210()) return false; jj_scanpos = xsp; - if (!jj_3R_213()) return false; + if (!jj_3R_211()) return false; jj_scanpos = xsp; - if (!jj_3R_214()) return false; + if (!jj_3R_212()) return false; jj_scanpos = xsp; if (!jj_3_75()) return false; jj_scanpos = xsp; - if (!jj_3R_215()) return false; + if (!jj_3R_213()) return false; jj_scanpos = xsp; - if (jj_3R_216()) return true; + if (jj_3R_214()) return true; return false; } @@ -7925,7 +7560,7 @@ void parseInline(); return false; } - inline bool jj_3R_485() + inline bool jj_3R_475() { if (jj_done) return true; if (jj_3R_114()) return true; @@ -7939,7 +7574,7 @@ void parseInline(); return false; } - inline bool jj_3R_686() + inline bool jj_3R_658() { if (jj_done) return true; if (jj_scan_token(ACCESS_T)) return true; @@ -7947,7 +7582,7 @@ void parseInline(); return false; } - inline bool jj_3R_484() + inline bool jj_3R_474() { if (jj_done) return true; if (jj_3R_113()) return true; @@ -7961,14 +7596,14 @@ void parseInline(); return false; } - inline bool jj_3R_483() + inline bool jj_3R_473() { if (jj_done) return true; if (jj_3R_63()) return true; return false; } - inline bool jj_3R_237() + inline bool jj_3R_235() { if (jj_done) return true; if (jj_scan_token(BASED_LITERAL)) return true; @@ -7984,14 +7619,14 @@ void parseInline(); return false; } - inline bool jj_3R_236() + inline bool jj_3R_234() { if (jj_done) return true; if (jj_scan_token(INTEGER)) return true; return false; } - inline bool jj_3R_482() + inline bool jj_3R_472() { if (jj_done) return true; if (jj_3R_112()) return true; @@ -8003,22 +7638,22 @@ void parseInline(); if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_235()) return false; + if (!jj_3R_233()) return false; jj_scanpos = xsp; - if (!jj_3R_236()) return false; + if (!jj_3R_234()) return false; jj_scanpos = xsp; - if (jj_3R_237()) return true; + if (jj_3R_235()) return true; return false; } - inline bool jj_3R_235() + inline bool jj_3R_233() { if (jj_done) return true; if (jj_scan_token(DECIMAL_LITERAL)) return true; return false; } - inline bool jj_3R_737() + inline bool jj_3R_702() { if (jj_done) return true; if (jj_3R_63()) return true; @@ -8032,21 +7667,21 @@ void parseInline(); return false; } - inline bool jj_3R_481() + inline bool jj_3R_471() { if (jj_done) return true; if (jj_3R_111()) return true; return false; } - inline bool jj_3R_480() + inline bool jj_3R_470() { if (jj_done) return true; if (jj_3R_64()) return true; return false; } - inline bool jj_3R_479() + inline bool jj_3R_469() { if (jj_done) return true; if (jj_scan_token(LPAREN_T)) return true; @@ -8055,37 +7690,37 @@ void parseInline(); return false; } - inline bool jj_3R_391() + inline bool jj_3R_386() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_478()) return false; + if (!jj_3R_468()) return false; jj_scanpos = xsp; - if (!jj_3R_479()) return false; + if (!jj_3R_469()) return false; jj_scanpos = xsp; - if (!jj_3R_480()) return false; + if (!jj_3R_470()) return false; jj_scanpos = xsp; - if (!jj_3R_481()) return false; + if (!jj_3R_471()) return false; jj_scanpos = xsp; - if (!jj_3R_482()) return false; + if (!jj_3R_472()) return false; jj_scanpos = xsp; - if (!jj_3R_483()) return false; + if (!jj_3R_473()) return false; jj_scanpos = xsp; - if (!jj_3R_484()) return false; + if (!jj_3R_474()) return false; jj_scanpos = xsp; - if (jj_3R_485()) return true; + if (jj_3R_475()) return true; return false; } - inline bool jj_3R_478() + inline bool jj_3R_468() { if (jj_done) return true; if (jj_3R_110()) return true; return false; } - inline bool jj_3R_346() + inline bool jj_3R_341() { if (jj_done) return true; if (jj_scan_token(PORT_T)) return true; @@ -8096,32 +7731,32 @@ void parseInline(); return false; } - inline bool jj_3R_614() + inline bool jj_3R_594() { if (jj_done) return true; - if (jj_3R_329()) return true; + if (jj_3R_327()) return true; return false; } - inline bool jj_3R_736() + inline bool jj_3R_701() { if (jj_done) return true; - if (jj_3R_756()) return true; + if (jj_3R_721()) return true; return false; } - inline bool jj_3R_565() + inline bool jj_3R_553() { if (jj_done) return true; if (jj_scan_token(PORT_T)) return true; if (jj_scan_token(LPAREN_T)) return true; - if (jj_3R_614()) return true; + if (jj_3R_594()) return true; if (jj_scan_token(RPAREN_T)) return true; if (jj_scan_token(SEMI_T)) return true; return false; } - inline bool jj_3R_729() + inline bool jj_3R_694() { if (jj_done) return true; if (jj_scan_token(UNITS_T)) return true; @@ -8130,12 +7765,12 @@ void parseInline(); Token * xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_736()) { jj_scanpos = xsp; break; } + if (jj_3R_701()) { jj_scanpos = xsp; break; } } if (jj_scan_token(END_T)) return true; if (jj_scan_token(UNITS_T)) return true; xsp = jj_scanpos; - if (jj_3R_737()) jj_scanpos = xsp; + if (jj_3R_702()) jj_scanpos = xsp; return false; } @@ -8146,7 +7781,7 @@ void parseInline(); return false; } - inline bool jj_3R_234() + inline bool jj_3R_232() { if (jj_done) return true; if (jj_3R_109()) return true; @@ -8158,12 +7793,12 @@ void parseInline(); if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_234()) jj_scanpos = xsp; + if (jj_3R_232()) jj_scanpos = xsp; if (jj_3R_63()) return true; return false; } - inline bool jj_3R_428() + inline bool jj_3R_543() { if (jj_done) return true; if (jj_3R_74()) return true; @@ -8193,7 +7828,7 @@ void parseInline(); return false; } - inline bool jj_3R_373() + inline bool jj_3R_368() { if (jj_done) return true; if (jj_scan_token(PACKAGE_T)) return true; @@ -8208,10 +7843,10 @@ void parseInline(); return false; } - inline bool jj_3R_333() + inline bool jj_3R_331() { if (jj_done) return true; - if (jj_3R_425()) return true; + if (jj_3R_420()) return true; return false; } @@ -8222,39 +7857,39 @@ void parseInline(); xsp = jj_scanpos; if (jj_scan_token(50)) jj_scanpos = xsp; xsp = jj_scanpos; - if (jj_3R_333()) jj_scanpos = xsp; + if (jj_3R_331()) jj_scanpos = xsp; return false; } - inline bool jj_3R_272() + inline bool jj_3R_270() { if (jj_done) return true; if (jj_3R_74()) return true; return false; } - inline bool jj_3R_323() + inline bool jj_3R_321() { if (jj_done) return true; if (jj_scan_token(STRINGLITERAL)) return true; return false; } - inline bool jj_3R_676() + inline bool jj_3R_654() { if (jj_done) return true; if (jj_scan_token(TYPE_T)) return true; return false; } - inline bool jj_3R_675() + inline bool jj_3R_653() { if (jj_done) return true; if (jj_scan_token(FILE_T)) return true; return false; } - inline bool jj_3R_674() + inline bool jj_3R_652() { if (jj_done) return true; if (jj_scan_token(SHARED_T)) return true; @@ -8269,47 +7904,47 @@ void parseInline(); return false; } - inline bool jj_3R_673() + inline bool jj_3R_651() { if (jj_done) return true; if (jj_scan_token(VARIABLE_T)) return true; return false; } - inline bool jj_3R_672() + inline bool jj_3R_650() { if (jj_done) return true; if (jj_scan_token(SIGNAL_T)) return true; return false; } - inline bool jj_3R_671() + inline bool jj_3R_649() { if (jj_done) return true; if (jj_scan_token(CONSTANT_T)) return true; return false; } - inline bool jj_3R_645() + inline bool jj_3R_625() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_671()) return false; + if (!jj_3R_649()) return false; jj_scanpos = xsp; - if (!jj_3R_672()) return false; + if (!jj_3R_650()) return false; jj_scanpos = xsp; - if (!jj_3R_673()) return false; + if (!jj_3R_651()) return false; jj_scanpos = xsp; - if (!jj_3R_674()) return false; + if (!jj_3R_652()) return false; jj_scanpos = xsp; - if (!jj_3R_675()) return false; + if (!jj_3R_653()) return false; jj_scanpos = xsp; - if (jj_3R_676()) return true; + if (jj_3R_654()) return true; return false; } - inline bool jj_3R_375() + inline bool jj_3R_370() { if (jj_done) return true; if (jj_scan_token(COMMA_T)) return true; @@ -8317,14 +7952,14 @@ void parseInline(); return false; } - inline bool jj_3R_218() + inline bool jj_3R_216() { if (jj_done) return true; if (jj_3R_109()) return true; return false; } - inline bool jj_3R_217() + inline bool jj_3R_215() { if (jj_done) return true; if (jj_3R_108()) return true; @@ -8336,13 +7971,13 @@ void parseInline(); if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_217()) return false; + if (!jj_3R_215()) return false; jj_scanpos = xsp; - if (jj_3R_218()) return true; + if (jj_3R_216()) return true; return false; } - inline bool jj_3R_469() + inline bool jj_3R_459() { if (jj_done) return true; if (jj_3R_74()) return true; @@ -8350,12 +7985,12 @@ void parseInline(); return false; } - inline bool jj_3R_384() + inline bool jj_3R_379() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_469()) jj_scanpos = xsp; + if (jj_3R_459()) jj_scanpos = xsp; if (jj_scan_token(NULL_T)) return true; if (jj_scan_token(SEMI_T)) return true; return false; @@ -8369,7 +8004,7 @@ void parseInline(); return false; } - inline bool jj_3R_273() + inline bool jj_3R_271() { if (jj_done) return true; if (jj_scan_token(WHEN_T)) return true; @@ -8377,7 +8012,7 @@ void parseInline(); return false; } - inline bool jj_3R_271() + inline bool jj_3R_269() { if (jj_done) return true; if (jj_3R_74()) return true; @@ -8397,17 +8032,17 @@ void parseInline(); if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_271()) jj_scanpos = xsp; + if (jj_3R_269()) jj_scanpos = xsp; if (jj_scan_token(NEXT_T)) return true; xsp = jj_scanpos; - if (jj_3R_272()) jj_scanpos = xsp; + if (jj_3R_270()) jj_scanpos = xsp; xsp = jj_scanpos; - if (jj_3R_273()) jj_scanpos = xsp; + if (jj_3R_271()) jj_scanpos = xsp; if (jj_scan_token(SEMI_T)) return true; return false; } - inline bool jj_3R_233() + inline bool jj_3R_231() { if (jj_done) return true; if (jj_scan_token(LPAREN_T)) return true; @@ -8430,10 +8065,10 @@ void parseInline(); return false; } - inline bool jj_3R_231() + inline bool jj_3R_229() { if (jj_done) return true; - if (jj_3R_247()) return true; + if (jj_3R_245()) return true; return false; } @@ -8442,11 +8077,11 @@ void parseInline(); if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_231()) jj_scanpos = xsp; + if (jj_3R_229()) jj_scanpos = xsp; if (jj_scan_token(APOSTROPHE_T)) return true; - if (jj_3R_232()) return true; + if (jj_3R_230()) return true; xsp = jj_scanpos; - if (jj_3R_233()) jj_scanpos = xsp; + if (jj_3R_231()) jj_scanpos = xsp; return false; } @@ -8502,7 +8137,7 @@ void parseInline(); return false; } - inline bool jj_3R_226() + inline bool jj_3R_224() { if (jj_done) return true; if (jj_scan_token(LPAREN_T)) return true; @@ -8510,7 +8145,7 @@ void parseInline(); Token * xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_375()) { jj_scanpos = xsp; break; } + if (jj_3R_370()) { jj_scanpos = xsp; break; } } if (jj_scan_token(RPAREN_T)) return true; return false; @@ -8524,14 +8159,14 @@ void parseInline(); return false; } - inline bool jj_3R_221() + inline bool jj_3R_219() { if (jj_done) return true; if (jj_3R_104()) return true; return false; } - inline bool jj_3R_225() + inline bool jj_3R_223() { if (jj_done) return true; if (jj_scan_token(LPAREN_T)) return true; @@ -8540,35 +8175,35 @@ void parseInline(); return false; } - inline bool jj_3R_224() + inline bool jj_3R_222() { if (jj_done) return true; if (jj_3R_106()) return true; return false; } - inline bool jj_3R_324() + inline bool jj_3R_322() { if (jj_done) return true; if (jj_3R_103()) return true; return false; } - inline bool jj_3R_326() + inline bool jj_3R_324() { if (jj_done) return true; if (jj_3R_103()) return true; return false; } - inline bool jj_3R_327() + inline bool jj_3R_325() { if (jj_done) return true; if (jj_3R_103()) return true; return false; } - inline bool jj_3R_223() + inline bool jj_3R_221() { if (jj_done) return true; if (jj_scan_token(DOT_T)) return true; @@ -8576,7 +8211,7 @@ void parseInline(); return false; } - inline bool jj_3R_222() + inline bool jj_3R_220() { if (jj_done) return true; if (jj_scan_token(APOSTROPHE_T)) return true; @@ -8589,15 +8224,15 @@ void parseInline(); if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_222()) return false; + if (!jj_3R_220()) return false; jj_scanpos = xsp; - if (!jj_3R_223()) return false; + if (!jj_3R_221()) return false; jj_scanpos = xsp; - if (!jj_3R_224()) return false; + if (!jj_3R_222()) return false; jj_scanpos = xsp; - if (!jj_3R_225()) return false; + if (!jj_3R_223()) return false; jj_scanpos = xsp; - if (jj_3R_226()) return true; + if (jj_3R_224()) return true; return false; } @@ -8608,7 +8243,7 @@ void parseInline(); Token * xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_221()) { jj_scanpos = xsp; break; } + if (jj_3R_219()) { jj_scanpos = xsp; break; } } return false; } @@ -8619,27 +8254,27 @@ void parseInline(); if (jj_3R_74()) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_327()) jj_scanpos = xsp; + if (jj_3R_325()) jj_scanpos = xsp; return false; } inline bool jj_3R_157() { if (jj_done) return true; - if (jj_3R_325()) return true; + if (jj_3R_323()) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_326()) jj_scanpos = xsp; + if (jj_3R_324()) jj_scanpos = xsp; return false; } inline bool jj_3R_156() { if (jj_done) return true; - if (jj_3R_323()) return true; + if (jj_3R_321()) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_324()) jj_scanpos = xsp; + if (jj_3R_322()) jj_scanpos = xsp; return false; } @@ -8656,21 +8291,21 @@ void parseInline(); return false; } - inline bool jj_3R_292() + inline bool jj_3R_290() { if (jj_done) return true; if (jj_scan_token(REM_T)) return true; return false; } - inline bool jj_3R_291() + inline bool jj_3R_289() { if (jj_done) return true; if (jj_scan_token(MOD_T)) return true; return false; } - inline bool jj_3R_290() + inline bool jj_3R_288() { if (jj_done) return true; if (jj_scan_token(SLASH_T)) return true; @@ -8682,90 +8317,90 @@ void parseInline(); if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_289()) return false; + if (!jj_3R_287()) return false; jj_scanpos = xsp; - if (!jj_3R_290()) return false; + if (!jj_3R_288()) return false; jj_scanpos = xsp; - if (!jj_3R_291()) return false; + if (!jj_3R_289()) return false; jj_scanpos = xsp; - if (jj_3R_292()) return true; + if (jj_3R_290()) return true; return false; } - inline bool jj_3R_289() + inline bool jj_3R_287() { if (jj_done) return true; if (jj_scan_token(MULT_T)) return true; return false; } - inline bool jj_3R_657() + inline bool jj_3R_635() { if (jj_done) return true; if (jj_3R_74()) return true; return false; } - inline bool jj_3R_459() + inline bool jj_3R_449() { if (jj_done) return true; if (jj_scan_token(LINKAGE_T)) return true; return false; } - inline bool jj_3R_458() + inline bool jj_3R_448() { if (jj_done) return true; if (jj_scan_token(BUFFER_T)) return true; return false; } - inline bool jj_3R_457() + inline bool jj_3R_447() { if (jj_done) return true; if (jj_scan_token(INOUT_T)) return true; return false; } - inline bool jj_3R_456() + inline bool jj_3R_446() { if (jj_done) return true; if (jj_scan_token(OUT_T)) return true; return false; } - inline bool jj_3R_368() + inline bool jj_3R_363() { if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_455()) return false; + if (!jj_3R_445()) return false; jj_scanpos = xsp; - if (!jj_3R_456()) return false; + if (!jj_3R_446()) return false; jj_scanpos = xsp; - if (!jj_3R_457()) return false; + if (!jj_3R_447()) return false; jj_scanpos = xsp; - if (!jj_3R_458()) return false; + if (!jj_3R_448()) return false; jj_scanpos = xsp; - if (jj_3R_459()) return true; + if (jj_3R_449()) return true; return false; } - inline bool jj_3R_455() + inline bool jj_3R_445() { if (jj_done) return true; if (jj_scan_token(IN_T)) return true; return false; } - inline bool jj_3R_269() + inline bool jj_3R_267() { if (jj_done) return true; - if (jj_3R_388()) return true; + if (jj_3R_383()) return true; return false; } - inline bool jj_3R_268() + inline bool jj_3R_266() { if (jj_done) return true; if (jj_3R_74()) return true; @@ -8778,15 +8413,15 @@ void parseInline(); if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (jj_3R_268()) jj_scanpos = xsp; + if (jj_3R_266()) jj_scanpos = xsp; xsp = jj_scanpos; - if (jj_3R_269()) jj_scanpos = xsp; + if (jj_3R_267()) jj_scanpos = xsp; if (jj_scan_token(LOOP_T)) return true; - if (jj_3R_270()) return true; + if (jj_3R_268()) return true; if (jj_scan_token(END_T)) return true; if (jj_scan_token(LOOP_T)) return true; xsp = jj_scanpos; - if (jj_3R_657()) jj_scanpos = xsp; + if (jj_3R_635()) jj_scanpos = xsp; if (jj_scan_token(SEMI_T)) return true; return false; } @@ -8805,7 +8440,7 @@ void parseInline(); return false; } - inline bool jj_3R_245() + inline bool jj_3R_243() { if (jj_done) return true; if (jj_scan_token(NULL_T)) return true; @@ -8819,21 +8454,21 @@ void parseInline(); return false; } - inline bool jj_3R_244() + inline bool jj_3R_242() { if (jj_done) return true; - if (jj_3R_378()) return true; + if (jj_3R_373()) return true; return false; } - inline bool jj_3R_243() + inline bool jj_3R_241() { if (jj_done) return true; if (jj_3R_102()) return true; return false; } - inline bool jj_3R_242() + inline bool jj_3R_240() { if (jj_done) return true; if (jj_3R_101()) return true; @@ -8845,19 +8480,19 @@ void parseInline(); if (jj_done) return true; Token * xsp; xsp = jj_scanpos; - if (!jj_3R_241()) return false; + if (!jj_3R_239()) return false; jj_scanpos = xsp; - if (!jj_3R_242()) return false; + if (!jj_3R_240()) return false; jj_scanpos = xsp; - if (!jj_3R_243()) return false; + if (!jj_3R_241()) return false; jj_scanpos = xsp; - if (!jj_3R_244()) return false; + if (!jj_3R_242()) return false; jj_scanpos = xsp; - if (jj_3R_245()) return true; + if (jj_3R_243()) return true; return false; } - inline bool jj_3R_241() + inline bool jj_3R_239() { if (jj_done) return true; if (jj_3R_100()) return true; @@ -8871,11 +8506,11 @@ void parseInline(); return false; } - inline bool jj_3R_351() + inline bool jj_3R_346() { if (jj_done) return true; if (jj_scan_token(LIBRARY_T)) return true; - if (jj_3R_207()) return true; + if (jj_3R_205()) return true; if (jj_scan_token(SEMI_T)) return true; return false; } -- cgit v0.12 From e6a6e65d46196125a5baad4aeb1942aa043236fa Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 12 Jun 2020 13:35:46 +0200 Subject: Catch all wrong mkdir calls (coverity) - Always catch the output of `mkdir` - corrected an incorrect message (context.cpp) --- src/cite.cpp | 6 +++++- src/context.cpp | 2 +- src/template.cpp | 6 +++++- src/util.cpp | 10 ++++++++-- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/cite.cpp b/src/cite.cpp index 4adf6f2..82f9e6d 100644 --- a/src/cite.cpp +++ b/src/cite.cpp @@ -203,7 +203,11 @@ void CitationManager::generatePage() QCString bibOutputDir = outputDir+"/"+bibTmpDir; QCString bibOutputFiles = ""; QDir thisDir; - thisDir.mkdir(bibOutputDir); + if (!thisDir.exists(bibOutputDir) && !thisDir.mkdir(bibOutputDir)) + { + err("Failed to create temorary output directory '%s', skiping citations\n",bibOutputDir.data()); + return; + } int i = 0; for (const auto &bibdata : citeDataList) { diff --git a/src/context.cpp b/src/context.cpp index d21b1d0..3d71706 100644 --- a/src/context.cpp +++ b/src/context.cpp @@ -10343,7 +10343,7 @@ void generateTemplateFiles(const char *templateDir) QCString outDir = QCString(templateDir)+"/html"; if (!thisDir.exists(outDir) && !thisDir.mkdir(outDir)) { - err("Failed to create output directory '%s'\n",templateDir); + err("Failed to create output directory '%s'\n",outDir.data()); return; } ResourceMgr::instance().writeCategory("html",outDir); diff --git a/src/template.cpp b/src/template.cpp index 1763eec..c836c6b 100644 --- a/src/template.cpp +++ b/src/template.cpp @@ -2843,7 +2843,11 @@ template class TemplateNodeCreator : public TemplateNode if (d.exists()) { bool ok = d.mkdir(fileName.mid(j,i-j)); - if (!ok) break; + if (!ok) + { + err("Failed to create directory '%s'\n",(fileName.mid(j,i-j)).data()); + break; + } QCString dirName = outputDir+'/'+fileName.left(i); d = QDir(dirName); j = i+1; diff --git a/src/util.cpp b/src/util.cpp index 7006f26..1624b1c 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -5022,10 +5022,16 @@ void createSubDirs(QDir &d) int l1,l2; for (l1=0;l1<16;l1++) { - d.mkdir(QCString().sprintf("d%x",l1)); + if (!d.mkdir(QCString().sprintf("d%x",l1))) + { + term("Failed to create output directory '%s'\n",(QCString().sprintf("d%x",l1)).data()); + } for (l2=0;l2<256;l2++) { - d.mkdir(QCString().sprintf("d%x/d%02x",l1,l2)); + if (!d.mkdir(QCString().sprintf("d%x/d%02x",l1,l2))) + { + term("Failed to create output directory '%s'\n",(QCString().sprintf("d%x/d%02x",l1,l2)).data()); + } } } } -- cgit v0.12 From 906f429414678e0bcecf3c67d1f49f436bac2876 Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 12 Jun 2020 15:28:22 +0200 Subject: Coverity uninitialized variable in mscgen_api.cpp - Initialize the variable ymax - add an extended example with "parallel events" triggered by a `,` instead of `;` between events --- libmscgen/mscgen_api.c | 1 + testing/037/037__msc_8cpp.xml | 27 +++++++++++++++++++++++++++ testing/037/class_receiver.xml | 4 ++-- testing/037/class_sender.xml | 4 ++-- testing/037_msc.cpp | 18 ++++++++++++++++++ 5 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 testing/037/037__msc_8cpp.xml diff --git a/libmscgen/mscgen_api.c b/libmscgen/mscgen_api.c index 376b9d8..e2cdcb9 100644 --- a/libmscgen/mscgen_api.c +++ b/libmscgen/mscgen_api.c @@ -457,6 +457,7 @@ static RowInfo *computeCanvasSize(Context *ctx, nextYmin = ymin = ctx->opts.entityHeadGap; yskipmax = 0; + ymax = 0; MscResetArcIterator(m); do { diff --git a/testing/037/037__msc_8cpp.xml b/testing/037/037__msc_8cpp.xml new file mode 100644 index 0000000..3de730d --- /dev/null +++ b/testing/037/037__msc_8cpp.xml @@ -0,0 +1,27 @@ + + + + 037_msc.cpp + Sender + Receiver + + + + A bit more complex msc diagram, with also parallel events. +Sender_1,Receiver_1,Sender1_1, +Sender,Receiver,Sender1, +Sender_2,Receiver_2,Sender1_2; + +Sender_1->Receiver_1 [label="Command()", URL="nref Receiver::Command()"], +Sender1_1<-Receiver_1 [label="Ack()", URL="nref Ack()", ID="1"]; + +Sender->Receiver [label="Command()", URL="nref Receiver::Command()"]; +Sender1<-Receiver [label="Ack()", URL="nref Ack()", ID="1"]; +Sender_2->Receiver_2 [label="Command()", URL="nref Receiver::Command()"], +Sender1_2<-Receiver_2 [label="Ack()", URL="nref Ack()", ID="1"]; + + + + + + diff --git a/testing/037/class_receiver.xml b/testing/037/class_receiver.xml index 24e82fd..b3c9c5a 100644 --- a/testing/037/class_receiver.xml +++ b/testing/037/class_receiver.xml @@ -19,7 +19,7 @@ - + @@ -32,7 +32,7 @@ - + Receiver diff --git a/testing/037/class_sender.xml b/testing/037/class_sender.xml index 525ab0a..14f29d1 100644 --- a/testing/037/class_sender.xml +++ b/testing/037/class_sender.xml @@ -19,7 +19,7 @@ - + @@ -32,7 +32,7 @@ - + Sender diff --git a/testing/037_msc.cpp b/testing/037_msc.cpp index 84ffc55..a3c0e4b 100644 --- a/testing/037_msc.cpp +++ b/testing/037_msc.cpp @@ -1,6 +1,24 @@ // objective: test the \msc and \endmsc commands // check: class_sender.xml // check: class_receiver.xml +// check: 037__msc_8cpp.xml + +/** \file + * A bit more complex msc diagram, with also parallel events. + * \msc + * Sender_1,Receiver_1,Sender1_1, + * Sender,Receiver,Sender1, + * Sender_2,Receiver_2,Sender1_2; + * + * Sender_1->Receiver_1 [label="Command()", URL="nref Receiver::Command()"], + * Sender1_1<-Receiver_1 [label="Ack()", URL="nref Ack()", ID="1"]; + * + * Sender->Receiver [label="Command()", URL="nref Receiver::Command()"]; + * Sender1<-Receiver [label="Ack()", URL="nref Ack()", ID="1"]; + * Sender_2->Receiver_2 [label="Command()", URL="nref Receiver::Command()"], + * Sender1_2<-Receiver_2 [label="Ack()", URL="nref Ack()", ID="1"]; + * \endmsc + */ /** Sender class. Can be used to send a command to the server. * The receiver will acknowledge the command by calling Ack(). -- cgit v0.12 From e7637f9dd977e9821394e7bed4dec02aec41ab9e Mon Sep 17 00:00:00 2001 From: albert-github Date: Sat, 13 Jun 2020 14:54:25 +0200 Subject: Number of translatable terms (like Chapter) are in English instead of Greek (#7841) * Number of translatable terms (like Chapter) are in English instead of Greek When running tests in Greek OUTPUT_LANGUAGE mode for LaTeX a number of terms like Chapter were still in English instead of Greek. Some used references: https://tex.stackexchange.com/questions/548584/ascii-text-set-in-greek-script-when-using-usepackagegreekbabel https://tex.stackexchange.com/questions/548761/missing-characters-in-output-due-to-renewcommand-familydefault-sfdefault https://tex.stackexchange.com/questions/58624/variables-for-hiding-or-showing-text-in-latex * Number of translatable terms (like Chapter) are in English instead of Greek - adding the possibilities for mono spaced font (for code parts) - creating a more flexible way to change fonts for different languages See also discussion at https://tex.stackexchange.com/questions/548901/missing-characters-in-greek-output-due-to-ttfamily --- src/latexgen.cpp | 10 ++++++---- src/translator.h | 5 +++++ src/translator_gr.h | 24 ++++++++++++++++++++++-- 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/src/latexgen.cpp b/src/latexgen.cpp index f3cce3e..cb42863 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -560,11 +560,13 @@ static void writeDefaultHeaderPart1(FTextStream &t) { t << "\\usepackage[" << fontenc << "]{fontenc}\n"; } - t << "\\usepackage[scaled=.90]{helvet}\n" - "\\usepackage{courier}\n" - "\\usepackage{amssymb}\n" + QCString font = theTranslator->latexFont(); + if (!font.isEmpty()) + { + t << font; + } + t << "\\usepackage{amssymb}\n" "\\usepackage{sectsty}\n" - "\\renewcommand{\\familydefault}{\\sfdefault}\n" "\\allsectionsfont{%\n" " \\fontseries{bc}\\selectfont%\n" " \\color{darkgray}%\n" diff --git a/src/translator.h b/src/translator.h index 188b775..991e637 100644 --- a/src/translator.h +++ b/src/translator.h @@ -50,6 +50,11 @@ class Translator * can be returned. */ virtual QCString latexFontenc() { return "T1"; } + virtual QCString latexFont() { + return "\\usepackage[scaled=.90]{helvet}\n" + "\\usepackage{courier}\n" + "\\renewcommand{\\familydefault}{\\sfdefault}\n"; + } /*! * Sets the commands to be inserted directly after the `\\begin{document}` * in the LaTeX document. diff --git a/src/translator_gr.h b/src/translator_gr.h index 6ed43db..854a956 100644 --- a/src/translator_gr.h +++ b/src/translator_gr.h @@ -59,8 +59,18 @@ class TranslatorGreek : public TranslatorAdapter_1_8_15 virtual QCString latexLanguageSupportCommand() { - return "\\usepackage[greek,english]{babel}\n" - "\\usepackage{alphabeta}\n"; + return "\\usepackage{fontspec}\n" + "\\usepackage[greek]{babel}\n"; + } + + virtual QCString latexFontenc() + { + return ""; + } + virtual QCString latexFont() + { + return "\\setmainfont{Libertinus Sans}\n" + "\\setmonofont{Courier New}\n"; } // --- Language translation methods ------------------- @@ -1159,6 +1169,16 @@ class TranslatorGreek : public TranslatorAdapter_1_8_15 return "1253"; } + virtual QCString latexCommandName() + { + QCString latex_command = Config_getString(LATEX_CMD_NAME); + if (latex_command.isEmpty()) latex_command = "latex"; + if (Config_getBool(USE_PDFLATEX)) + { + if (latex_command == "latex") latex_command = "xelatex"; + } + return latex_command; + } /*! Used as ansicpg for RTF fcharset */ -- cgit v0.12 From e53fa89addc9659ad406298d27a6376d1eb53e0d Mon Sep 17 00:00:00 2001 From: albert-github Date: Sat, 13 Jun 2020 14:55:13 +0200 Subject: Incorrect label in map of dot files in xhtml (#7840) When a filename of a file starts with a digit the mapping of the resulting dot files results in message like: ``` Syntax of value for attribute id of map is not valid ``` an id cannot start with a digit, so an "a" is placed in front of it (unconditionally to overcome problems with a double label id i.e filename 087.cpp and a087.cpp). --- src/dotfilepatcher.cpp | 2 +- src/dotgraph.cpp | 2 +- src/util.cpp | 10 ++++++++++ src/util.h | 1 + 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/dotfilepatcher.cpp b/src/dotfilepatcher.cpp index 20ce4c1..17f8cb7 100644 --- a/src/dotfilepatcher.cpp +++ b/src/dotfilepatcher.cpp @@ -460,7 +460,7 @@ bool DotFilePatcher::run() const convertMapFile(tt,map->mapFile,map->relPath,map->urlOnly,map->context); if (!result.isEmpty()) { - t << "label << "\" id=\"" << map->label << "\">" << endl; + t << "label << "\" id=\"" << correctId(map->label) << "\">" << endl; t << result; t << "" << endl; } diff --git a/src/dotgraph.cpp b/src/dotgraph.cpp index c0cc4fd..1ad85e1 100644 --- a/src/dotgraph.cpp +++ b/src/dotgraph.cpp @@ -236,7 +236,7 @@ void DotGraph::generateCode(FTextStream &t) else // add link to bitmap file with image map { if (!m_noDivTag) t << "
      "; - t << "\"""; + t << "\"""; if (!m_noDivTag) t << "
      "; t << endl; if (m_regenerate || !insertMapFile(t, absMapName(), m_relPath, getMapLabel())) diff --git a/src/util.cpp b/src/util.cpp index 1624b1c..a298ace 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -5278,6 +5278,16 @@ QCString convertToId(const char *s) return growBuf.get(); } +/*! Some strings have been corrected but the requirement regarding the fact + * that an id cannot have a digit at the first position. To overcome problems + * with double labels we always place an "a" in front + */ +QCString correctId(QCString s) +{ + if (s.isEmpty()) return s; + return "a" + s; +} + /*! Converts a string to an XML-encoded string */ QCString convertToXML(const char *s, bool keepEntities) { diff --git a/src/util.h b/src/util.h index a93220c..65d164a 100644 --- a/src/util.h +++ b/src/util.h @@ -278,6 +278,7 @@ QCString insertTemplateSpecifierInScope(const QCString &scope,const QCString &te QCString stripScope(const char *name); QCString convertToId(const char *s); +QCString correctId(QCString s); QCString convertToHtml(const char *s,bool keepEntities=TRUE); -- cgit v0.12 From 963b8da31e03d149eefb9d61033db9f7263728da Mon Sep 17 00:00:00 2001 From: Sergei Izmailov Date: Sat, 13 Jun 2020 15:56:14 +0300 Subject: Add namespace inline flag in xml output (#7828) * Flag namespace as inline in xml output * Add inline namespace flag to innernamespace tag as well suggested by @mosra --- src/xmlgen.cpp | 7 +++++-- templates/xml/compound.xsd | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index 3a649e9..593f69a 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -1150,7 +1150,8 @@ static void writeInnerNamespaces(const NamespaceSDict *nl,FTextStream &t) if (!nd->isHidden() && !nd->isAnonymous()) { t << " getOutputFileBase() - << "\">" << convertToXML(nd->name()) << "" << endl; + << "\"" << (nd->isInline() ? " inline=\"yes\"" : "") + << ">" << convertToXML(nd->name()) << "" << endl; } } } @@ -1458,7 +1459,9 @@ static void generateXMLForNamespace(const NamespaceDef *nd,FTextStream &ti) writeXMLHeader(t); t << " getOutputFileBase() - << "\" kind=\"namespace\" language=\"" + << "\" kind=\"namespace\" " + << (nd->isInline()?"inline=\"yes\" ":"") + << "language=\"" << langToString(nd->getLanguage()) << "\">" << endl; t << " "; writeXMLString(t,nd->name()); diff --git a/templates/xml/compound.xsd b/templates/xml/compound.xsd index e17d2fa..4df19ce 100644 --- a/templates/xml/compound.xsd +++ b/templates/xml/compound.xsd @@ -43,6 +43,7 @@ + @@ -104,6 +105,7 @@ + -- cgit v0.12 From 42e36bdfa05f0a553f11bfd50f4a4eb2e9c74f82 Mon Sep 17 00:00:00 2001 From: albert-github Date: Sat, 13 Jun 2020 15:00:02 +0200 Subject: Addon option --pool to the test run script for parallel execution of tests (#7827) To make better use of the processors of a computer the possibility has been build to execute the tests in parallel, this is especially of an advantage for PDF tests. To make use of this option the number of parallel tests `np` has to be specified by means of `--pool=np`, the default is 1. --- testing/runtests.py | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/testing/runtests.py b/testing/runtests.py index 7896cdd..52fab66 100755 --- a/testing/runtests.py +++ b/testing/runtests.py @@ -183,7 +183,7 @@ class Tester: # check if the file we need to check is actually generated if not os.path.isfile(check_file): print('Non-existing file %s after \'check:\' statement' % check_file) - return + return False # convert output to canonical form data = xpopen('%s --format --noblanks --nowarning %s' % (self.args.xmllint,check_file)) if data: @@ -191,12 +191,13 @@ class Tester: data = re.sub(r'xsd" version="[0-9.-]+"','xsd" version=""',data).rstrip('\n') else: print('Failed to run %s on the doxygen output file %s' % (self.args.xmllint,self.test_out)) - return + return False out_file='%s/%s' % (self.test_out,check) with xopen(out_file,'w') as f: print(data,file=f) shutil.rmtree(self.test_out+'/out',ignore_errors=True) os.remove(self.test_out+'/Doxyfile') + return True # check the relevant files of a doxygen run with the reference material def perform_test(self,testmgr): @@ -401,17 +402,22 @@ class Tester: if failed_xml or failed_html or failed_latex or failed_docbook or failed_rtf or failed_xmlxsd: testmgr.ok(False,self.test_name,msg) - return + return False testmgr.ok(True,self.test_name) if not self.args.keep: shutil.rmtree(self.test_out,ignore_errors=True) + return True def run(self,testmgr): if self.update: - self.update_test(testmgr) + return self.update_test(testmgr) else: - self.perform_test(testmgr) + return self.perform_test(testmgr) + +def do_generation_work(test): + tester = Tester(test[0].args,test[1]) + return tester.run(test[0]) class TestManager: def __init__(self,args,tests): @@ -426,10 +432,10 @@ class TestManager: def ok(self,result,test_name,msg='Ok'): if result: - print('ok %s - %s' % (self.count,test_name)) + print('ok - %s' % (test_name)) self.passed = self.passed + 1 else: - print('not ok %s - %s' % (self.count,test_name)) + print('not ok - %s' % (test_name)) print('-------------------------------------') for o in msg: print(o) @@ -444,9 +450,20 @@ class TestManager: return 0 if self.passed==self.num_tests else 1 def perform_tests(self): - for test in self.tests: - tester = Tester(self.args,test) - tester.run(self) + if (self.args.pool == 1): + passed = 0 + for test in self.tests: + tester = Tester(self.args,test) + passed += tester.run(self) + self.passed = passed + else: + dl = [] + for test in self.tests: + dl += [(self, test)] + import multiprocessing as mp + p = mp.Pool(processes=self.args.pool) + passed = p.map(do_generation_work, dl) + self.passed = sum(passed) res=self.result() if self.args.xhtml and self.args.inputdir!='.' and not res and not self.args.keep: shutil.rmtree("dtd",ignore_errors=True) @@ -483,6 +500,8 @@ def main(): 'output directory to write the doxygen output to') parser.add_argument('--noredir',help= 'disable redirection of doxygen warnings',action="store_true") + parser.add_argument('--pool',nargs='?',default='1',type=int,help= + 'pool size of multiprocess tests') parser.add_argument('--xml',help='create xml output and check', action="store_true") parser.add_argument('--rtf',help= -- cgit v0.12 From 9438348bfc2fdf30ec96483679a3504cb8e17dfc Mon Sep 17 00:00:00 2001 From: albert-github Date: Sat, 13 Jun 2020 15:00:28 +0200 Subject: Create link for GENERATE_XML (#7824) Small documentation consistency. --- doc/customize.doc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/customize.doc b/doc/customize.doc index 7b2729d..52f8d7a 100644 --- a/doc/customize.doc +++ b/doc/customize.doc @@ -372,7 +372,8 @@ generated output! If the above two methods still do not provide enough flexibility, you can also use the XML output produced by doxygen as a basis to -generate the output you like. To do this set GENERATE_XML to YES. +generate the output you like. To do this set +\ref cfg_generate_xml "GENERATE_XML" to \c YES. The XML output consists of an index file named \c index.xml which lists all items extracted by doxygen with references to the other XML files -- cgit v0.12 From e4a9056a5d0fb6764fadd4dac72e4a68184b9387 Mon Sep 17 00:00:00 2001 From: albert-github Date: Sat, 13 Jun 2020 15:01:50 +0200 Subject: issue #7810 LaTeX manual not built, but make install tries to install it (#7821) Give a meaningful fatal error when the pdf does not exists (when it exists automatically also the html directory with content exists). Give a meaningful fatal error when the chm does not exists. --- doc/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 537089b..df9c2a6 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -212,12 +212,22 @@ install(FILES DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 ) +install(CODE "if(NOT EXISTS \"${PROJECT_BINARY_DIR}/latex/doxygen_manual.pdf\") + message(FATAL_ERROR \"\nTerminating:\n documentation has not been generated, \n create documentation by using the 'docs' target followed by an 'install'\n\") +endif()" +) + install(FILES "${PROJECT_BINARY_DIR}/latex/doxygen_manual.pdf" DESTINATION "${CMAKE_INSTALL_PREFIX}/${DOC_INSTALL_DIR}" ) if (build_doc_chm) +install(CODE "if(NOT EXISTS \"${PROJECT_BINARY_DIR}/chm/doxygen_manual.chm\") + message(FATAL_ERROR \"\nTerminating:\n CHM documentation has not been generated, \n create CHM documentation by using the 'docs_chm' target followed by an 'install'\n\") +endif()" +) + install(FILES "${PROJECT_BINARY_DIR}/chm/doxygen_manual.chm" DESTINATION "${CMAKE_INSTALL_PREFIX}/${DOC_INSTALL_DIR}" -- cgit v0.12 From fce24d0725943a9b1a1ac069449fda1d0bdf9ab7 Mon Sep 17 00:00:00 2001 From: David Hebbeker Date: Sat, 13 Jun 2020 15:02:20 +0200 Subject: Add `const` qualifier to UsedDir::m_dir. (#7820) --- src/dirdef.cpp | 2 +- src/dirdef.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dirdef.cpp b/src/dirdef.cpp index 7f0b524..dd8444e 100644 --- a/src/dirdef.cpp +++ b/src/dirdef.cpp @@ -750,7 +750,7 @@ int FilePairDict::compareValues(const FilePair *left,const FilePair *right) cons //---------------------------------------------------------------------- -UsedDir::UsedDir(DirDef *dir,bool inherited) : +UsedDir::UsedDir(const DirDef *dir,bool inherited) : m_dir(dir), m_filePairs(7), m_inherited(inherited) { m_filePairs.setAutoDelete(TRUE); diff --git a/src/dirdef.h b/src/dirdef.h index 399e0c2..468901d 100644 --- a/src/dirdef.h +++ b/src/dirdef.h @@ -104,7 +104,7 @@ class FilePairDict : public SDict class UsedDir { public: - UsedDir(DirDef *dir,bool inherited); + UsedDir(const DirDef *dir,bool inherited); virtual ~UsedDir(); void addFileDep(FileDef *srcFd,FileDef *dstFd); FilePair *findFilePair(const char *name); @@ -114,7 +114,7 @@ class UsedDir void sort(); private: - DirDef *m_dir; + const DirDef *m_dir; FilePairDict m_filePairs; bool m_inherited; }; -- cgit v0.12 From 2aef0e0e4f91038b0b1d952efad0a3aba7d6a6cd Mon Sep 17 00:00:00 2001 From: albert-github Date: Sat, 13 Jun 2020 15:04:37 +0200 Subject: bug_121547 extern variable is being referenced in documentation incorrectly (#7792) It is made clear that where the variable is declared "extern" that it is also shown at that place in the documentation --- src/memberdef.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/memberdef.cpp b/src/memberdef.cpp index d857fa6..1d7909b 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -2733,7 +2733,7 @@ void MemberDefImpl::getLabels(QStrList &sl,const Definition *container) const isFriend() || isRelated() || (isInline() && inlineInfo) || isSignal() || isSlot() || - isStatic() || + isStatic() || isExternal() || (getClassDef() && getClassDef()!=container && container->definitionType()==TypeClass) || (m_impl->memSpec & ~Entry::Inline)!=0 ) @@ -2745,7 +2745,7 @@ void MemberDefImpl::getLabels(QStrList &sl,const Definition *container) const //ol.docify(" ["); SrcLangExt lang = getLanguage(); bool optVhdl = lang==SrcLangExt_VHDL; - bool extractPrivate = Config_getBool(EXTRACT_PRIVATE); + static bool extractPrivate = Config_getBool(EXTRACT_PRIVATE); if (optVhdl) { sl.append(theTranslator->trVhdlType(getMemberSpecifiers(),TRUE)); @@ -2756,7 +2756,8 @@ void MemberDefImpl::getLabels(QStrList &sl,const Definition *container) const else if (isRelated()) sl.append("related"); else { - if (Config_getBool(INLINE_INFO) && isInline()) sl.append("inline"); + if (isExternal()) sl.append("extern"); + if (inlineInfo && isInline()) sl.append("inline"); if (isExplicit()) sl.append("explicit"); if (isMutable()) sl.append("mutable"); if (isStatic()) sl.append("static"); -- cgit v0.12 From 22d8ffd11ad8b864941ba73f2161622d693f4f49 Mon Sep 17 00:00:00 2001 From: albert-github Date: Sat, 13 Jun 2020 15:05:45 +0200 Subject: Running doxygen tests with variable with spaces (#7819) When having a run command like: ``` nmake tests TEST_FLAGS="--xhtml --keep --cfg GENERATE_HTMLHELP=YES --cfg HHC_LOCATION=\"c:\Program Files (x86)\HTML Help Workshop\hhc.exe\" --cfg HTML_FILE_EXTENSION=.html --cfg SEARCHENGINE=NO --id=1" ``` we get an error like ``` Not a doxygen configuration item, missing '=' sign: 'Files'. ``` this is due to the usage of the `split()` that does a brute force split on spaces. Making the splitting a bit more intelligent: - splitting on `--` - splitting on space after "command" --- testing/runtests.py | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/testing/runtests.py b/testing/runtests.py index 52fab66..5d5cee1 100755 --- a/testing/runtests.py +++ b/testing/runtests.py @@ -150,11 +150,11 @@ class Tester: if (self.args.clang): print('CLANG_ASSISTED_PARSING=YES', file=f) if (self.args.cfgs): - for cfg in list(itertools.chain.from_iterable(self.args.cfgs)): - if cfg.find('=') == -1: + for cfg in self.args.cfgs: + if cfg[0].find('=') == -1: print("Not a doxygen configuration item, missing '=' sign: '%s'."%cfg) sys.exit(1) - print(cfg, file=f) + print(cfg[0], file=f) if 'check' not in self.config or not self.config['check']: print('Test doesn\'t specify any files to check') @@ -474,6 +474,25 @@ class TestManager: shutil.rmtree("dtd",ignore_errors=True) shutil.copytree(self.args.inputdir+"/dtd", "dtd") +def split_and_keep(s, sep): + if not s: return [] + + # Find replacement character that is not used in string + # i.e. just use the highest available character plus one + # Note: This fails if ord(max(s)) = 0x10FFFF (ValueError) + p=chr(ord(max(s))+1) + + retVal = [] + for val in s.replace(sep, p+sep).split(p): + vv = val.split(" ",1) + if ((len(vv) == 1) and not vv[0] == ''): + retVal += vv + if ((len(vv) == 2) and not vv[1] == ''): + retVal += vv + if ((len(vv) == 2) and vv[1] == ''): + retVal += [vv[0]] + return retVal + def main(): # argument handling parser = argparse.ArgumentParser(description='run doxygen tests') @@ -524,7 +543,9 @@ def main(): parser.add_argument('--cfg',nargs='+',dest='cfgs',action='append',help= 'run test with extra doxygen configuration settings ' '(the option may be specified multiple times') - test_flags = os.getenv('TEST_FLAGS', default='').split() + + test_flags = split_and_keep(os.getenv('TEST_FLAGS', default=''), '--') + args = parser.parse_args(test_flags + sys.argv[1:]) # sanity check -- cgit v0.12 From 65bf92c94f2118b0f6e6c19e62993c6e27ebbef9 Mon Sep 17 00:00:00 2001 From: albert-github Date: Sat, 13 Jun 2020 15:07:52 +0200 Subject: issue #7796 Backticks (`) in Doxygen-markup-in-C in Markdown collapses (#7797) * issue #7796 Backticks (`) in Doxygen-markup-in-C in Markdown collapses The problem occurs when the backtick is just before the end of line. The fenced block will only terminate when the same number of fence characters are present, otherwise the search will continue. * issue #7796 Backticks (`) in Doxygen-markup-in-C in Markdown collapses Removed unintentional tab. --- src/markdown.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/markdown.cpp b/src/markdown.cpp index c4dd9fb..06b714a 100644 --- a/src/markdown.cpp +++ b/src/markdown.cpp @@ -1501,8 +1501,11 @@ static bool isFencedCodeBlock(const char *data,int size,int refIndent, while (i Date: Sat, 13 Jun 2020 19:51:29 +0200 Subject: Spelling correction in cite code Correction of 2 spelling errors (thanks to Fossies). --- src/cite.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cite.cpp b/src/cite.cpp index 82f9e6d..78df0c3 100644 --- a/src/cite.cpp +++ b/src/cite.cpp @@ -205,7 +205,7 @@ void CitationManager::generatePage() QDir thisDir; if (!thisDir.exists(bibOutputDir) && !thisDir.mkdir(bibOutputDir)) { - err("Failed to create temorary output directory '%s', skiping citations\n",bibOutputDir.data()); + err("Failed to create temporary output directory '%s', skipping citations\n",bibOutputDir.data()); return; } int i = 0; -- cgit v0.12 From 07dd4ae9033c9872d70d68ff1d83ec46f1db7cb4 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Sat, 13 Jun 2020 20:45:58 +0200 Subject: Add options to enable various sanitizers New CMAKE options (default OFF): - SANITIZE_ADDRESS:BOOL=OFF - SANITIZE_LINK_STATIC:BOOL=OFF - SANITIZE_MEMORY:BOOL=OFF - SANITIZE_THREAD:BOOL=OFF - SANITIZE_UNDEFINED:BOOL=OFF --- CMakeLists.txt | 2 + cmake/Sanitizers/FindASan.cmake | 59 +++++++++++ cmake/Sanitizers/FindMSan.cmake | 57 ++++++++++ cmake/Sanitizers/FindSanitizers.cmake | 94 +++++++++++++++++ cmake/Sanitizers/FindTSan.cmake | 65 ++++++++++++ cmake/Sanitizers/FindUBSan.cmake | 46 +++++++++ cmake/Sanitizers/asan-wrapper | 55 ++++++++++ cmake/Sanitizers/sanitize-helpers.cmake | 177 ++++++++++++++++++++++++++++++++ src/CMakeLists.txt | 4 + src/perlmodgen.cpp | 10 -- 10 files changed, 559 insertions(+), 10 deletions(-) create mode 100644 cmake/Sanitizers/FindASan.cmake create mode 100644 cmake/Sanitizers/FindMSan.cmake create mode 100644 cmake/Sanitizers/FindSanitizers.cmake create mode 100644 cmake/Sanitizers/FindTSan.cmake create mode 100644 cmake/Sanitizers/FindUBSan.cmake create mode 100644 cmake/Sanitizers/asan-wrapper create mode 100644 cmake/Sanitizers/sanitize-helpers.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 16c0454..88b99d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,6 +31,7 @@ option(enable_coverage "Enable coverage reporting for gcc/clang [development]" O SET(enlarge_lex_buffers "262144" CACHE INTERNAL "Sets the lex input and read buffers to the specified size") list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") +list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Sanitizers") set(TOP "${CMAKE_SOURCE_DIR}") include(version) @@ -102,6 +103,7 @@ if (BISON_VERSION VERSION_LESS 2.7) message(SEND_ERROR "Doxygen requires at least bison version 2.7 (installed: ${BISON_VERSION})") endif() find_package(Threads) +find_package(Sanitizers) if (sqlite3) find_package(SQLite3 REQUIRED) diff --git a/cmake/Sanitizers/FindASan.cmake b/cmake/Sanitizers/FindASan.cmake new file mode 100644 index 0000000..98ea7cb --- /dev/null +++ b/cmake/Sanitizers/FindASan.cmake @@ -0,0 +1,59 @@ +# The MIT License (MIT) +# +# Copyright (c) +# 2013 Matthew Arsenault +# 2015-2016 RWTH Aachen University, Federal Republic of Germany +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +option(SANITIZE_ADDRESS "Enable AddressSanitizer for sanitized targets." Off) + +set(FLAG_CANDIDATES + # Clang 3.2+ use this version. The no-omit-frame-pointer option is optional. + "-g -fsanitize=address -fno-omit-frame-pointer" + "-g -fsanitize=address" + + # Older deprecated flag for ASan + "-g -faddress-sanitizer" +) + + +if (SANITIZE_ADDRESS AND (SANITIZE_THREAD OR SANITIZE_MEMORY)) + message(FATAL_ERROR "AddressSanitizer is not compatible with " + "ThreadSanitizer or MemorySanitizer.") +endif () + + +include(sanitize-helpers) + +if (SANITIZE_ADDRESS) + sanitizer_check_compiler_flags("${FLAG_CANDIDATES}" "AddressSanitizer" + "ASan") + + find_program(ASan_WRAPPER "asan-wrapper" PATHS ${CMAKE_MODULE_PATH}) + mark_as_advanced(ASan_WRAPPER) +endif () + +function (add_sanitize_address TARGET) + if (NOT SANITIZE_ADDRESS) + return() + endif () + + sanitizer_add_flags(${TARGET} "AddressSanitizer" "ASan") +endfunction () diff --git a/cmake/Sanitizers/FindMSan.cmake b/cmake/Sanitizers/FindMSan.cmake new file mode 100644 index 0000000..22d0050 --- /dev/null +++ b/cmake/Sanitizers/FindMSan.cmake @@ -0,0 +1,57 @@ +# The MIT License (MIT) +# +# Copyright (c) +# 2013 Matthew Arsenault +# 2015-2016 RWTH Aachen University, Federal Republic of Germany +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +option(SANITIZE_MEMORY "Enable MemorySanitizer for sanitized targets." Off) + +set(FLAG_CANDIDATES + "-g -fsanitize=memory" +) + + +include(sanitize-helpers) + +if (SANITIZE_MEMORY) + if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + message(WARNING "MemorySanitizer disabled for target ${TARGET} because " + "MemorySanitizer is supported for Linux systems only.") + set(SANITIZE_MEMORY Off CACHE BOOL + "Enable MemorySanitizer for sanitized targets." FORCE) + elseif (NOT ${CMAKE_SIZEOF_VOID_P} EQUAL 8) + message(WARNING "MemorySanitizer disabled for target ${TARGET} because " + "MemorySanitizer is supported for 64bit systems only.") + set(SANITIZE_MEMORY Off CACHE BOOL + "Enable MemorySanitizer for sanitized targets." FORCE) + else () + sanitizer_check_compiler_flags("${FLAG_CANDIDATES}" "MemorySanitizer" + "MSan") + endif () +endif () + +function (add_sanitize_memory TARGET) + if (NOT SANITIZE_MEMORY) + return() + endif () + + sanitizer_add_flags(${TARGET} "MemorySanitizer" "MSan") +endfunction () diff --git a/cmake/Sanitizers/FindSanitizers.cmake b/cmake/Sanitizers/FindSanitizers.cmake new file mode 100644 index 0000000..101bab8 --- /dev/null +++ b/cmake/Sanitizers/FindSanitizers.cmake @@ -0,0 +1,94 @@ +# The MIT License (MIT) +# +# Copyright (c) +# 2013 Matthew Arsenault +# 2015-2016 RWTH Aachen University, Federal Republic of Germany +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +# If any of the used compiler is a GNU compiler, add a second option to static +# link against the sanitizers. +option(SANITIZE_LINK_STATIC "Try to link static against sanitizers." Off) + + + + +set(FIND_QUIETLY_FLAG "") +if (DEFINED Sanitizers_FIND_QUIETLY) + set(FIND_QUIETLY_FLAG "QUIET") +endif () + +find_package(ASan ${FIND_QUIETLY_FLAG}) +find_package(TSan ${FIND_QUIETLY_FLAG}) +find_package(MSan ${FIND_QUIETLY_FLAG}) +find_package(UBSan ${FIND_QUIETLY_FLAG}) + + + + +function(sanitizer_add_blacklist_file FILE) + if(NOT IS_ABSOLUTE ${FILE}) + set(FILE "${CMAKE_CURRENT_SOURCE_DIR}/${FILE}") + endif() + get_filename_component(FILE "${FILE}" REALPATH) + + sanitizer_check_compiler_flags("-fsanitize-blacklist=${FILE}" + "SanitizerBlacklist" "SanBlist") +endfunction() + +function(add_sanitizers ...) + # If no sanitizer is enabled, return immediately. + if (NOT (SANITIZE_ADDRESS OR SANITIZE_MEMORY OR SANITIZE_THREAD OR + SANITIZE_UNDEFINED)) + return() + endif () + + foreach (TARGET ${ARGV}) + # Check if this target will be compiled by exactly one compiler. Other- + # wise sanitizers can't be used and a warning should be printed once. + get_target_property(TARGET_TYPE ${TARGET} TYPE) + if (TARGET_TYPE STREQUAL "INTERFACE_LIBRARY") + message(WARNING "Can't use any sanitizers for target ${TARGET}, " + "because it is an interface library and cannot be " + "compiled directly.") + return() + endif () + sanitizer_target_compilers(${TARGET} TARGET_COMPILER) + list(LENGTH TARGET_COMPILER NUM_COMPILERS) + if (NUM_COMPILERS GREATER 1) + message(WARNING "Can't use any sanitizers for target ${TARGET}, " + "because it will be compiled by incompatible compilers. " + "Target will be compiled without sanitizers.") + return() + + # If the target is compiled by no or no known compiler, give a warning. + elseif (NUM_COMPILERS EQUAL 0) + message(WARNING "Sanitizers for target ${TARGET} may not be" + " usable, because it uses no or an unknown compiler. " + "This is a false warning for targets using only " + "object lib(s) as input.") + endif () + + # Add sanitizers for target. + add_sanitize_address(${TARGET}) + add_sanitize_thread(${TARGET}) + add_sanitize_memory(${TARGET}) + add_sanitize_undefined(${TARGET}) + endforeach () +endfunction(add_sanitizers) diff --git a/cmake/Sanitizers/FindTSan.cmake b/cmake/Sanitizers/FindTSan.cmake new file mode 100644 index 0000000..3cba3c0 --- /dev/null +++ b/cmake/Sanitizers/FindTSan.cmake @@ -0,0 +1,65 @@ +# The MIT License (MIT) +# +# Copyright (c) +# 2013 Matthew Arsenault +# 2015-2016 RWTH Aachen University, Federal Republic of Germany +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +option(SANITIZE_THREAD "Enable ThreadSanitizer for sanitized targets." Off) + +set(FLAG_CANDIDATES + "-g -fsanitize=thread" +) + + +# ThreadSanitizer is not compatible with MemorySanitizer. +if (SANITIZE_THREAD AND SANITIZE_MEMORY) + message(FATAL_ERROR "ThreadSanitizer is not compatible with " + "MemorySanitizer.") +endif () + + +include(sanitize-helpers) + +if (SANITIZE_THREAD) + if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND + NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + message(WARNING "ThreadSanitizer disabled for target ${TARGET} because " + "ThreadSanitizer is supported for Linux systems and macOS only.") + set(SANITIZE_THREAD Off CACHE BOOL + "Enable ThreadSanitizer for sanitized targets." FORCE) + elseif (NOT ${CMAKE_SIZEOF_VOID_P} EQUAL 8) + message(WARNING "ThreadSanitizer disabled for target ${TARGET} because " + "ThreadSanitizer is supported for 64bit systems only.") + set(SANITIZE_THREAD Off CACHE BOOL + "Enable ThreadSanitizer for sanitized targets." FORCE) + else () + sanitizer_check_compiler_flags("${FLAG_CANDIDATES}" "ThreadSanitizer" + "TSan") + endif () +endif () + +function (add_sanitize_thread TARGET) + if (NOT SANITIZE_THREAD) + return() + endif () + + sanitizer_add_flags(${TARGET} "ThreadSanitizer" "TSan") +endfunction () diff --git a/cmake/Sanitizers/FindUBSan.cmake b/cmake/Sanitizers/FindUBSan.cmake new file mode 100644 index 0000000..ae103f7 --- /dev/null +++ b/cmake/Sanitizers/FindUBSan.cmake @@ -0,0 +1,46 @@ +# The MIT License (MIT) +# +# Copyright (c) +# 2013 Matthew Arsenault +# 2015-2016 RWTH Aachen University, Federal Republic of Germany +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +option(SANITIZE_UNDEFINED + "Enable UndefinedBehaviorSanitizer for sanitized targets." Off) + +set(FLAG_CANDIDATES + "-g -fsanitize=undefined" +) + + +include(sanitize-helpers) + +if (SANITIZE_UNDEFINED) + sanitizer_check_compiler_flags("${FLAG_CANDIDATES}" + "UndefinedBehaviorSanitizer" "UBSan") +endif () + +function (add_sanitize_undefined TARGET) + if (NOT SANITIZE_UNDEFINED) + return() + endif () + + sanitizer_add_flags(${TARGET} "UndefinedBehaviorSanitizer" "UBSan") +endfunction () diff --git a/cmake/Sanitizers/asan-wrapper b/cmake/Sanitizers/asan-wrapper new file mode 100644 index 0000000..5d54103 --- /dev/null +++ b/cmake/Sanitizers/asan-wrapper @@ -0,0 +1,55 @@ +#!/bin/sh + +# The MIT License (MIT) +# +# Copyright (c) +# 2013 Matthew Arsenault +# 2015-2016 RWTH Aachen University, Federal Republic of Germany +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +# This script is a wrapper for AddressSanitizer. In some special cases you need +# to preload AddressSanitizer to avoid error messages - e.g. if you're +# preloading another library to your application. At the moment this script will +# only do something, if we're running on a Linux platform. OSX might not be +# affected. + + +# Exit immediately, if platform is not Linux. +if [ "$(uname)" != "Linux" ] +then + exec $@ +fi + + +# Get the used libasan of the application ($1). If a libasan was found, it will +# be prepended to LD_PRELOAD. +libasan=$(ldd $1 | grep libasan | sed "s/^[[:space:]]//" | cut -d' ' -f1) +if [ -n "$libasan" ] +then + if [ -n "$LD_PRELOAD" ] + then + export LD_PRELOAD="$libasan:$LD_PRELOAD" + else + export LD_PRELOAD="$libasan" + fi +fi + +# Execute the application. +exec $@ diff --git a/cmake/Sanitizers/sanitize-helpers.cmake b/cmake/Sanitizers/sanitize-helpers.cmake new file mode 100644 index 0000000..3649b07 --- /dev/null +++ b/cmake/Sanitizers/sanitize-helpers.cmake @@ -0,0 +1,177 @@ +# The MIT License (MIT) +# +# Copyright (c) +# 2013 Matthew Arsenault +# 2015-2016 RWTH Aachen University, Federal Republic of Germany +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +# Helper function to get the language of a source file. +function (sanitizer_lang_of_source FILE RETURN_VAR) + get_filename_component(LONGEST_EXT "${FILE}" EXT) + # If extension is empty return. This can happen for extensionless headers + if("${LONGEST_EXT}" STREQUAL "") + set(${RETURN_VAR} "" PARENT_SCOPE) + return() + endif() + # Get shortest extension as some files can have dot in their names + string(REGEX REPLACE "^.*(\\.[^.]+)$" "\\1" FILE_EXT ${LONGEST_EXT}) + string(TOLOWER "${FILE_EXT}" FILE_EXT) + string(SUBSTRING "${FILE_EXT}" 1 -1 FILE_EXT) + + get_property(ENABLED_LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES) + foreach (LANG ${ENABLED_LANGUAGES}) + list(FIND CMAKE_${LANG}_SOURCE_FILE_EXTENSIONS "${FILE_EXT}" TEMP) + if (NOT ${TEMP} EQUAL -1) + set(${RETURN_VAR} "${LANG}" PARENT_SCOPE) + return() + endif () + endforeach() + + set(${RETURN_VAR} "" PARENT_SCOPE) +endfunction () + + +# Helper function to get compilers used by a target. +function (sanitizer_target_compilers TARGET RETURN_VAR) + # Check if all sources for target use the same compiler. If a target uses + # e.g. C and Fortran mixed and uses different compilers (e.g. clang and + # gfortran) this can trigger huge problems, because different compilers may + # use different implementations for sanitizers. + set(BUFFER "") + get_target_property(TSOURCES ${TARGET} SOURCES) + foreach (FILE ${TSOURCES}) + # If expression was found, FILE is a generator-expression for an object + # library. Object libraries will be ignored. + string(REGEX MATCH "TARGET_OBJECTS:([^ >]+)" _file ${FILE}) + if ("${_file}" STREQUAL "") + sanitizer_lang_of_source(${FILE} LANG) + if (LANG) + list(APPEND BUFFER ${CMAKE_${LANG}_COMPILER_ID}) + endif () + endif () + endforeach () + + list(REMOVE_DUPLICATES BUFFER) + set(${RETURN_VAR} "${BUFFER}" PARENT_SCOPE) +endfunction () + + +# Helper function to check compiler flags for language compiler. +function (sanitizer_check_compiler_flag FLAG LANG VARIABLE) + if (${LANG} STREQUAL "C") + include(CheckCCompilerFlag) + check_c_compiler_flag("${FLAG}" ${VARIABLE}) + + elseif (${LANG} STREQUAL "CXX") + include(CheckCXXCompilerFlag) + check_cxx_compiler_flag("${FLAG}" ${VARIABLE}) + + elseif (${LANG} STREQUAL "Fortran") + # CheckFortranCompilerFlag was introduced in CMake 3.x. To be compatible + # with older Cmake versions, we will check if this module is present + # before we use it. Otherwise we will define Fortran coverage support as + # not available. + include(CheckFortranCompilerFlag OPTIONAL RESULT_VARIABLE INCLUDED) + if (INCLUDED) + check_fortran_compiler_flag("${FLAG}" ${VARIABLE}) + elseif (NOT CMAKE_REQUIRED_QUIET) + message(STATUS "Performing Test ${VARIABLE}") + message(STATUS "Performing Test ${VARIABLE}" + " - Failed (Check not supported)") + endif () + endif() +endfunction () + + +# Helper function to test compiler flags. +function (sanitizer_check_compiler_flags FLAG_CANDIDATES NAME PREFIX) + set(CMAKE_REQUIRED_QUIET ${${PREFIX}_FIND_QUIETLY}) + + get_property(ENABLED_LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES) + foreach (LANG ${ENABLED_LANGUAGES}) + # Sanitizer flags are not dependend on language, but the used compiler. + # So instead of searching flags foreach language, search flags foreach + # compiler used. + set(COMPILER ${CMAKE_${LANG}_COMPILER_ID}) + if (NOT DEFINED ${PREFIX}_${COMPILER}_FLAGS) + foreach (FLAG ${FLAG_CANDIDATES}) + if(NOT CMAKE_REQUIRED_QUIET) + message(STATUS "Try ${COMPILER} ${NAME} flag = [${FLAG}]") + endif() + + set(CMAKE_REQUIRED_FLAGS "${FLAG}") + unset(${PREFIX}_FLAG_DETECTED CACHE) + sanitizer_check_compiler_flag("${FLAG}" ${LANG} + ${PREFIX}_FLAG_DETECTED) + + if (${PREFIX}_FLAG_DETECTED) + # If compiler is a GNU compiler, search for static flag, if + # SANITIZE_LINK_STATIC is enabled. + if (SANITIZE_LINK_STATIC AND (${COMPILER} STREQUAL "GNU")) + string(TOLOWER ${PREFIX} PREFIX_lower) + sanitizer_check_compiler_flag( + "-static-lib${PREFIX_lower}" ${LANG} + ${PREFIX}_STATIC_FLAG_DETECTED) + + if (${PREFIX}_STATIC_FLAG_DETECTED) + set(FLAG "-static-lib${PREFIX_lower} ${FLAG}") + endif () + endif () + + set(${PREFIX}_${COMPILER}_FLAGS "${FLAG}" CACHE STRING + "${NAME} flags for ${COMPILER} compiler.") + mark_as_advanced(${PREFIX}_${COMPILER}_FLAGS) + break() + endif () + endforeach () + + if (NOT ${PREFIX}_FLAG_DETECTED) + set(${PREFIX}_${COMPILER}_FLAGS "" CACHE STRING + "${NAME} flags for ${COMPILER} compiler.") + mark_as_advanced(${PREFIX}_${COMPILER}_FLAGS) + + message(WARNING "${NAME} is not available for ${COMPILER} " + "compiler. Targets using this compiler will be " + "compiled without ${NAME}.") + endif () + endif () + endforeach () +endfunction () + + +# Helper to assign sanitizer flags for TARGET. +function (sanitizer_add_flags TARGET NAME PREFIX) + # Get list of compilers used by target and check, if sanitizer is available + # for this target. Other compiler checks like check for conflicting + # compilers will be done in add_sanitizers function. + sanitizer_target_compilers(${TARGET} TARGET_COMPILER) + list(LENGTH TARGET_COMPILER NUM_COMPILERS) + if ("${${PREFIX}_${TARGET_COMPILER}_FLAGS}" STREQUAL "") + return() + endif() + + # Set compile- and link-flags for target. + set_property(TARGET ${TARGET} APPEND_STRING + PROPERTY COMPILE_FLAGS " ${${PREFIX}_${TARGET_COMPILER}_FLAGS}") + set_property(TARGET ${TARGET} APPEND_STRING + PROPERTY COMPILE_FLAGS " ${SanBlist_${TARGET_COMPILER}_FLAGS}") + set_property(TARGET ${TARGET} APPEND_STRING + PROPERTY LINK_FLAGS " ${${PREFIX}_${TARGET_COMPILER}_FLAGS}") +endfunction () diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 598f73c..c8f1b86 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -167,6 +167,7 @@ add_library(doxycfg STATIC message.cpp debug.cpp ) +add_sanitizers(doxycfg) add_library(doxymain STATIC # generated for/by flex/bison @@ -296,6 +297,7 @@ add_library(doxymain STATIC xmldocvisitor.cpp xmlgen.cpp ) +add_sanitizers(doxymain) # LLVM/clang headers give a lot of warnings with -Wshadow and -Wcast-align so we disable them for # the one file that includes them @@ -311,6 +313,7 @@ endif() add_executable(doxygen main.cpp ) +add_sanitizers(doxygen) if (use_libclang) find_package(LLVM REQUIRED CONFIG) @@ -359,5 +362,6 @@ set_project_coverage(doxycfg) set_project_coverage(doxymain) set_project_coverage(doxygen) + install(TARGETS doxygen DESTINATION bin) diff --git a/src/perlmodgen.cpp b/src/perlmodgen.cpp index a08e480..843341f 100644 --- a/src/perlmodgen.cpp +++ b/src/perlmodgen.cpp @@ -1446,16 +1446,6 @@ static void addTemplateArgumentList(const ArgumentList &al,PerlModOutput &output output.closeList(); } -#if 0 -static void addMemberTemplateLists(MemberDef *md,PerlModOutput &output) -{ - ClassDef *cd = md->getClassDef(); - const char *cname = cd ? cd->name().data() : 0; - if (md->templateArguments()) // function template prefix - addTemplateArgumentList(md->templateArguments(),output,cname); -} -#endif - static void addTemplateList(const ClassDef *cd,PerlModOutput &output) { addTemplateArgumentList(cd->templateArguments(),output,cd->name()); -- cgit v0.12 From 5ee4689955e27dad85e9d722d48692f60593a812 Mon Sep 17 00:00:00 2001 From: Thomas Vogt Date: Sun, 14 Jun 2020 14:24:51 +0200 Subject: Updated formatting rules for paragraphs within table header cells. Only present paragraphs within table headers (th) with font weight strong, keep normal table cells (td) unaffected. --- templates/html/doxygen.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/html/doxygen.css b/templates/html/doxygen.css index 8f2c213..30eb1ac 100644 --- a/templates/html/doxygen.css +++ b/templates/html/doxygen.css @@ -66,7 +66,7 @@ p.startli, p.startdd { margin-top: 2px; } -th p.starttd, p.intertd, p.endtd { +th p.starttd, th p.intertd, th p.endtd { font-size: 100%; font-weight: 700; } -- cgit v0.12 From 3040df2f0aa29a4207de5b37da1d20e3d27340bb Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Sun, 14 Jun 2020 17:00:10 +0200 Subject: Added atomic reference counting to QString --- qtools/qshared.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/qtools/qshared.h b/qtools/qshared.h index 79fab7b..58ad6fc 100644 --- a/qtools/qshared.h +++ b/qtools/qshared.h @@ -1,5 +1,5 @@ /**************************************************************************** -** +** ** ** Definition of QShared struct ** @@ -42,13 +42,15 @@ #include "qglobal.h" #endif // QT_H +#include + struct QShared { - QShared() { count = 1; } + QShared() : count(1) { } void ref() { count++; } bool deref() { return !--count; } - uint count; + std::atomic_uint count; }; -- cgit v0.12 From df070ebb578db360f4b888a6d674d9e20b58a523 Mon Sep 17 00:00:00 2001 From: albert-github Date: Tue, 16 Jun 2020 15:18:25 +0200 Subject: Show doxywizard version by means of --version Analogous to show help information (`--help`) also show the, full, version of the doxywizard (in the about box only the short version is shown). --- addon/doxywizard/doxywizard.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/addon/doxywizard/doxywizard.cpp b/addon/doxywizard/doxywizard.cpp index 27c99da..ce22367 100755 --- a/addon/doxywizard/doxywizard.cpp +++ b/addon/doxywizard/doxywizard.cpp @@ -698,6 +698,13 @@ int main(int argc,char **argv) msgBox.exec(); exit(0); } + else if (!qstrcmp(argv[1],"--version")) + { + QMessageBox msgBox; + msgBox.setText(QString::fromLatin1("Doxywizard version: %1").arg(QString::fromLatin1(getFullVersion()))); + msgBox.exec(); + exit(0); + } } if (argc > 2) { -- cgit v0.12 From e922facbb92cda058eae33f58f7640be8d1fb5b8 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Mon, 15 Jun 2020 19:25:46 +0200 Subject: Refactor: modernize markdown and make it thread-safe --- addon/doxyapp/CMakeLists.txt | 1 + addon/doxyparse/CMakeLists.txt | 1 + src/classdef.cpp | 12 +- src/commentscan.h | 8 +- src/commentscan.l | 2095 ++++++++++++++++++++-------------------- src/context.cpp | 3 +- src/dirdef.cpp | 15 +- src/docparser.cpp | 11 +- src/docparser.h | 103 +- src/doctokenizer.h | 8 +- src/doctokenizer.l | 16 +- src/doxygen.cpp | 9 +- src/doxygen.h | 2 +- src/filedef.cpp | 9 +- src/fortranscanner.l | 8 +- src/ftvhelp.cpp | 3 +- src/groupdef.cpp | 24 +- src/growbuf.h | 1 + src/index.cpp | 25 +- src/markdown.cpp | 725 ++++++-------- src/markdown.h | 83 +- src/memberdef.cpp | 33 +- src/memberlist.cpp | 9 +- src/namespacedef.cpp | 12 +- src/outputlist.cpp | 5 +- src/outputlist.h | 5 +- src/pagedef.cpp | 60 +- src/perlmodgen.cpp | 3 +- src/pyscanner.l | 6 +- src/scanner.l | 12 +- src/sqlite3gen.cpp | 6 +- src/util.cpp | 6 +- src/vhdldocgen.cpp | 11 +- src/vhdljjparser.cpp | 16 +- src/xmlgen.cpp | 3 +- 35 files changed, 1688 insertions(+), 1661 deletions(-) diff --git a/addon/doxyapp/CMakeLists.txt b/addon/doxyapp/CMakeLists.txt index 9d74fbc..8ec4d2e 100644 --- a/addon/doxyapp/CMakeLists.txt +++ b/addon/doxyapp/CMakeLists.txt @@ -12,6 +12,7 @@ include_directories( add_executable(doxyapp doxyapp.cpp ) +add_sanitizers(doxyapp) if (use_libclang) set(CLANG_LIBS libclang clangTooling ${llvm_libs}) diff --git a/addon/doxyparse/CMakeLists.txt b/addon/doxyparse/CMakeLists.txt index 8e0ad49..6ddc113 100644 --- a/addon/doxyparse/CMakeLists.txt +++ b/addon/doxyparse/CMakeLists.txt @@ -12,6 +12,7 @@ include_directories( add_executable(doxyparse doxyparse.cpp ) +add_sanitizers(doxyparse) if (use_libclang) set(CLANG_LIBS libclang clangTooling ${llvm_libs}) diff --git a/src/classdef.cpp b/src/classdef.cpp index 04e057b..5dee0dc 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -1431,7 +1431,8 @@ void ClassDefImpl::writeBriefDescription(OutputList &ol,bool exampleFlag) const ol.writeString(" - "); ol.popGeneratorState(); ol.generateDoc(briefFile(),briefLine(),this,0, - briefDescription(),TRUE,FALSE,0,TRUE,FALSE); + briefDescription(),TRUE,FALSE,0, + TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT)); ol.pushGeneratorState(); ol.disable(OutputGenerator::RTF); ol.writeString(" \n"); @@ -1462,7 +1463,8 @@ void ClassDefImpl::writeDetailedDocumentationBody(OutputList &ol) const // repeat brief description if (!briefDescription().isEmpty() && repeatBrief) { - ol.generateDoc(briefFile(),briefLine(),this,0,briefDescription(),FALSE,FALSE); + ol.generateDoc(briefFile(),briefLine(),this,0,briefDescription(),FALSE,FALSE, + 0,FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT)); } if (!briefDescription().isEmpty() && repeatBrief && !documentation().isEmpty()) @@ -1475,7 +1477,8 @@ void ClassDefImpl::writeDetailedDocumentationBody(OutputList &ol) const // write documentation if (!documentation().isEmpty()) { - ol.generateDoc(docFile(),docLine(),this,0,documentation(),TRUE,FALSE); + ol.generateDoc(docFile(),docLine(),this,0,documentation(),TRUE,FALSE, + 0,FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT)); } // write type constraints writeTypeConstraints(ol,this,m_impl->typeConstraints); @@ -2572,7 +2575,8 @@ void ClassDefImpl::writeDeclarationLink(OutputList &ol,bool &found,const char *h if (!briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC)) { DocRoot *rootNode = validatingParseDoc(briefFile(),briefLine(),this,0, - briefDescription(),FALSE,FALSE,0,TRUE,FALSE); + briefDescription(),FALSE,FALSE, + 0,TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT)); if (rootNode && !rootNode->isEmpty()) { ol.startMemberDescription(anchor()); diff --git a/src/commentscan.h b/src/commentscan.h index be92920..a111352 100644 --- a/src/commentscan.h +++ b/src/commentscan.h @@ -3,8 +3,8 @@ * Copyright (C) 1997-2015 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its - * documentation under the terms of the GNU General Public License is hereby - * granted. No representations are made about the suitability of this software + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software * for any purpose. It is provided "as is" without express or implied warranty. * See the GNU General Public License for more details. * @@ -60,6 +60,7 @@ class CommentScanner * @param[out] newEntryNeeded Boolean that is TRUE if the comment block parser * finds that a the comment block finishes the entry and a new one * needs to be started. + * @param[in] markdownEnabled Indicates if markdown specific processing should be done. * @returns TRUE if the comment requires further processing. The * parameter \a newEntryNeeded will typically be true in this case and * \a position will indicate the offset inside the \a comment string @@ -76,7 +77,8 @@ class CommentScanner bool isInbody, Protection &prot, int &position, - bool &newEntryNeeded + bool &newEntryNeeded, + bool markdownEnabled ); void initGroupInfo(Entry *entry); void enterFile(const char *fileName,int lineNr); diff --git a/src/commentscan.l b/src/commentscan.l index 309a334..f521528 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -3,8 +3,8 @@ * Copyright (C) 1997-2020 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its - * documentation under the terms of the GNU General Public License is hereby - * granted. No representations are made about the suitability of this software + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software * for any purpose. It is provided "as is" without express or implied warranty. * See the GNU General Public License for more details. * @@ -24,7 +24,7 @@ %{ /* - * includes + * includes */ #include @@ -329,11 +329,11 @@ enum GuardType class GuardedSection { public: - GuardedSection(bool enabled,bool parentVisible) + GuardedSection(bool enabled,bool parentVisible) : m_enabled(enabled),m_parentVisible(parentVisible) {} bool isEnabled() const { return m_enabled; } bool parentVisible() const { return m_parentVisible; } - + private: bool m_enabled; bool m_parentVisible; @@ -341,7 +341,7 @@ class GuardedSection /* ----------------------------------------------------------------- * - * statics + * statics */ struct commentscanYY_state @@ -398,6 +398,7 @@ struct commentscanYY_state bool inInternalDocs = FALSE; int prevPosition = 0; DocGroup docGroup; + bool markdownSupport = TRUE; }; //----------------------------------------------------------------------------- @@ -428,20 +429,20 @@ static void addCite(yyscan_t yyscanner); //----------------------------------------------------------------------------- -#undef YY_INPUT -#define YY_INPUT(buf,result,max_size) result=yyread(yyscanner,buf,max_size); +#undef YY_INPUT +#define YY_INPUT(buf,result,max_size) result=yyread(yyscanner,buf,max_size); %} /* start command character */ -CMD ("\\"|"@") -XREFCMD {CMD}("bug"|"deprecated"|"test"|"todo"|"xrefitem") +CMD ("\\"|"@") +XREFCMD {CMD}("bug"|"deprecated"|"test"|"todo"|"xrefitem") PRE [pP][rR][eE] -TABLE [tT][aA][bB][lL][eE] -P [pP] +TABLE [tT][aA][bB][lL][eE] +P [pP] UL [uU][lL] -OL [oO][lL] -DL [dD][lL] +OL [oO][lL] +DL [dD][lL] IMG [iI][mM][gG] HR [hH][rR] PARA [pP][aA][rR][aA] @@ -452,13 +453,13 @@ DIV [dD][iI][vV] DETAILEDHTML {CENTER}|{DIV}|{PRE}|{UL}|{TABLE}|{OL}|{DL}|{P}|[Hh][1-6]|{IMG}|{HR}|{PARA} DETAILEDHTMLOPT {CODE} BN [ \t\n\r] -BL [ \t\r]*"\n" +BL [ \t\r]*"\n" B [ \t] BS ^(({B}*"//")?)(({B}*"*"+)?){B}* ATTR ({B}+[^>\n]*)? DOCNL "\n"|"\\_linebr" LC "\\"{B}*"\n" -NW [^a-z_A-Z0-9] +NW [^a-z_A-Z0-9] FILESCHAR [a-z_A-Z0-9\x80-\xFF\\:\\\/\-\+@&#] FILEECHAR [a-z_A-Z0-9\x80-\xFF\-\+@&#] FILE ({FILESCHAR}*{FILEECHAR}+("."{FILESCHAR}*{FILEECHAR}+)*)|("\""[^\n\"]*"\"") @@ -470,7 +471,7 @@ CITEID {CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)*|"\""{CITESCHAR}{C SCOPEID {ID}({ID}*{BN}*"::"{BN}*)*({ID}?) SCOPENAME "$"?(({ID}?{BN}*("::"|"."){BN}*)*)((~{BN}*)?{ID}) TMPLSPEC "<"{BN}*[^>]+{BN}*">" -MAILADDR [a-z_A-Z0-9.+\-]+"@"[a-z_A-Z0-9\-]+("."[a-z_A-Z0-9\-]+)+[a-z_A-Z0-9\-]+ +MAILADDR [a-z_A-Z0-9.+\-]+"@"[a-z_A-Z0-9\-]+("."[a-z_A-Z0-9\-]+)+[a-z_A-Z0-9\-]+ RCSTAG "$"{ID}":"[^\n$]+"$" %option noyywrap @@ -489,34 +490,34 @@ RCSTAG "$"{ID}":"[^\n$]+"$" %x XRefItemParam3 %x FileDocArg1 %x ParamArg1 -%x EnumDocArg1 -%x NameSpaceDocArg1 -%x PackageDocArg1 -%x GroupDocArg1 -%x GroupDocArg2 -%x SectionLabel -%x SectionTitle -%x SubpageLabel -%x SubpageTitle -%x FormatBlock -%x LineParam -%x GuardParam -%x GuardParamEnd -%x SkipGuardedSection -%x SkipInternal +%x EnumDocArg1 +%x NameSpaceDocArg1 +%x PackageDocArg1 +%x GroupDocArg1 +%x GroupDocArg2 +%x SectionLabel +%x SectionTitle +%x SubpageLabel +%x SubpageTitle +%x FormatBlock +%x LineParam +%x GuardParam +%x GuardParamEnd +%x SkipGuardedSection +%x SkipInternal %x NameParam -%x InGroupParam -%x FnParam -%x OverloadParam -%x InheritParam -%x ExtendsParam +%x InGroupParam +%x FnParam +%x OverloadParam +%x InheritParam +%x ExtendsParam %x ReadFormulaShort -%x ReadFormulaLong -%x AnchorLabel +%x ReadFormulaLong +%x AnchorLabel %x HtmlComment %x SkipLang -%x CiteLabel -%x CopyDoc +%x CiteLabel +%x CopyDoc %x GuardExpr %x CdataSection %x Noop @@ -540,52 +541,52 @@ RCSTAG "$"{ID}":"[^\n$]+"$" * XML commands, */ -{CMD}{CMD}[a-z_A-Z]+{B}* { // escaped command - addOutput(yyscanner,yytext); - } -{CMD}{CMD}"~"[a-z_A-Z]* { // escaped command - addOutput(yyscanner,yytext); - } -{MAILADDR} { // mail address - addOutput(yyscanner,yytext); - } -"\""[^"\n]*"\"" { // quoted text +{CMD}{CMD}[a-z_A-Z]+{B}* { // escaped command + addOutput(yyscanner,yytext); + } +{CMD}{CMD}"~"[a-z_A-Z]* { // escaped command + addOutput(yyscanner,yytext); + } +{MAILADDR} { // mail address + addOutput(yyscanner,yytext); + } +"\""[^"\n]*"\"" { // quoted text addOutput(yyscanner,yytext); - } -("\\"[a-z_A-Z]+)+"\\" { // directory (or chain of commands!) - addOutput(yyscanner,yytext); - } -"<"{DETAILEDHTML}{ATTR}">" { // HTML command that ends a brief description - setOutput(yyscanner,OutputDoc); - // continue with the same input + } +("\\"[a-z_A-Z]+)+"\\" { // directory (or chain of commands!) + addOutput(yyscanner,yytext); + } +"<"{DETAILEDHTML}{ATTR}">" { // HTML command that ends a brief description + setOutput(yyscanner,OutputDoc); + // continue with the same input REJECT; - } -"<"{DETAILEDHTMLOPT}{ATTR}">" { // HTML command that ends a brief description - if (yyextra->current->lang==SrcLangExt_CSharp) + } +"<"{DETAILEDHTMLOPT}{ATTR}">" { // HTML command that ends a brief description + if (yyextra->current->lang==SrcLangExt_CSharp) { setOutput(yyscanner,OutputDoc); } - // continue with the same input + // continue with the same input REJECT; - } -"" { // start of a .NET XML style brief description - setOutput(yyscanner,OutputBrief); + } +"" { // start of a .NET XML style brief description + setOutput(yyscanner,OutputBrief); addOutput(yyscanner,yytext); - } -"" { // start of a .NET XML style detailed description - setOutput(yyscanner,OutputDoc); + } +"" { // start of a .NET XML style detailed description + setOutput(yyscanner,OutputDoc); addOutput(yyscanner,yytext); - } -"" { // start of a .NET XML style detailed description - setOutput(yyscanner,OutputBrief); + } +"" { // start of a .NET XML style detailed description + setOutput(yyscanner,OutputBrief); addOutput(yyscanner,yytext); - setOutput(yyscanner,OutputDoc); - } -"" { // end of a brief or detailed description - - setOutput(yyscanner,OutputDoc); + setOutput(yyscanner,OutputDoc); + } +"" { // end of a brief or detailed description + + setOutput(yyscanner,OutputDoc); addOutput(yyscanner,yytext); - } + } "<"{CAPTION}{ATTR}">" { QCString tag=yytext; int s=tag.find("id="); @@ -616,22 +617,22 @@ RCSTAG "$"{ID}":"[^\n$]+"$" setOutput(yyscanner,OutputDoc); REJECT; } -" ClassDef includeInfo for %s\n", nm.data())); DBG_CTX((" local : %d\n", ii->local)); DBG_CTX((" imported : %d\n", ii->imported)); - DBG_CTX((" indirect : %d\n", ii->indirect)); DBG_CTX(("header: %s\n", ii->fileDef->absFilePath().data())); DBG_CTX((" file_id : %d\n", file_id)); DBG_CTX((" header_id: %d\n", header_id)); @@ -2211,7 +2210,6 @@ static void generateSqlite3ForFile(const FileDef *fd) DBG_CTX(("-----> FileDef includeInfo for %s\n", ii->includeName.data())); DBG_CTX((" local: %d\n", ii->local)); DBG_CTX((" imported: %d\n", ii->imported)); - DBG_CTX((" indirect: %d\n", ii->indirect)); if(ii->fileDef) { DBG_CTX(("include: %s\n", ii->fileDef->absFilePath().data())); diff --git a/src/tagreader.cpp b/src/tagreader.cpp index 12010e8..3c493b4 100644 --- a/src/tagreader.cpp +++ b/src/tagreader.cpp @@ -1526,7 +1526,7 @@ void TagFileParser::addIncludes() // ifd->getOutputFileBase().data(),ii->id.data()); if (ifd->getOutputFileBase()==QCString(ii->id)) { - fd->addIncludeDependency(ifd.get(),ii->text,ii->isLocal,ii->isImported,FALSE); + fd->addIncludeDependency(ifd.get(),ii->text,ii->isLocal,ii->isImported); } } } -- cgit v0.12 From 442da6dfa5ab1d48b632ab24e15acb0719ab0bbd Mon Sep 17 00:00:00 2001 From: albert-github Date: Mon, 29 Jun 2020 18:14:20 +0200 Subject: Missing links in Fortran in case use statement with upper case characters in name Based on the question: https://stackoverflow.com/questions/62557644/automatic-link-to-fortran-classes-in-method-arguments-description-in-doxygen#62595302 The problem regarding the missing linking was checked and contrary to the idea that it was depending on the `ONLY` clause it was due to the fact that a conversion to lower case was missing. --- src/fortranscanner.l | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/fortranscanner.l b/src/fortranscanner.l index 195293f..2c3c23f 100644 --- a/src/fortranscanner.l +++ b/src/fortranscanner.l @@ -467,6 +467,7 @@ SCOPENAME ({ID}{BS}"::"{BS})* {ID} { DBG_CTX((stderr,"using dir %s\n",yytext)); yyextra->current->name=yytext; + yyextra->current->name=yyextra->current->name.lower(); yyextra->current->fileName = yyextra->fileName; yyextra->current->section=Entry::USINGDIR_SEC; yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current); @@ -475,12 +476,14 @@ SCOPENAME ({ID}{BS}"::"{BS})* } {ID}/, { yyextra->useModuleName=yytext; + yyextra->useModuleName=yyextra->useModuleName.lower(); } ,{BS}"ONLY" { BEGIN(UseOnly); } {BS},{BS} {} {ID} { yyextra->current->name= yyextra->useModuleName+"::"+yytext; + yyextra->current->name=yyextra->current->name.lower(); yyextra->current->fileName = yyextra->fileName; yyextra->current->section=Entry::USINGDECL_SEC; yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current); -- cgit v0.12 From 6b1543bbc7001cc67dbe55c7109c4c73fbb5f300 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Mon, 29 Jun 2020 21:46:50 +0200 Subject: Fix for compile issue on Travis --- src/pre.l | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pre.l b/src/pre.l index 9b27ff8..979e971 100644 --- a/src/pre.l +++ b/src/pre.l @@ -3365,7 +3365,7 @@ void Preprocessor::processFile(const char *fileName,BufStr &input,BufStr &output } } // add the macro definition for this file to the global map - Doxygen::macroDefinitions.emplace(std::make_pair(state->yyFileName,std::move(state->macroDefinitions))); + Doxygen::macroDefinitions.emplace(std::make_pair(state->yyFileName.str(),std::move(state->macroDefinitions))); } //yyextra->defineManager.endContext(); -- cgit v0.12 From 3e9d9386950cc67d155a920cf8483c4d5bdcec3c Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Mon, 29 Jun 2020 22:32:15 +0200 Subject: Fixed anothing compilation issue when use_libclang was not enabled --- src/doxygen.cpp | 18 ++++++++---------- src/doxygen.h | 1 + src/filedef.cpp | 6 ++---- src/scanner.l | 28 ++++++++++++---------------- 4 files changed, 23 insertions(+), 30 deletions(-) diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 01b47f5..089110b 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -160,6 +160,7 @@ QCString Doxygen::spaces; bool Doxygen::generatingXmlOutput = FALSE; GenericsSDict *Doxygen::genericsDict; DefinesPerFileList Doxygen::macroDefinitions; +bool Doxygen::clangAssistedParsing = FALSE; // locally accessible globals static std::unordered_map< std::string, const Entry* > g_classEntries; @@ -7477,8 +7478,7 @@ static void generateFileSources() if (!Doxygen::inputNameLinkedMap->empty()) { #if USE_LIBCLANG - static bool clangAssistedParsing = Config_getBool(CLANG_ASSISTED_PARSING); - if (clangAssistedParsing) + if (Doxygen::clangAssistedParsing) { QDict g_processedFiles(10007); @@ -9063,11 +9063,6 @@ static std::shared_ptr parseFile(OutlineParserInterface &parser, FileDef *fd,const char *fn, bool sameTu,QStrList &filesInSameTu) { -#if USE_LIBCLANG - static bool clangAssistedParsing = Config_getBool(CLANG_ASSISTED_PARSING); -#else - static bool clangAssistedParsing = FALSE; -#endif QCString fileName=fn; QCString extension; int ei = fileName.findRev('.'); @@ -9114,7 +9109,7 @@ static std::shared_ptr parseFile(OutlineParserInterface &parser, convBuf.addChar('\0'); - if (clangAssistedParsing && !sameTu) + if (Doxygen::clangAssistedParsing && !sameTu) { fd->getAllIncludeFilesRecursively(filesInSameTu); } @@ -9130,8 +9125,7 @@ static std::shared_ptr parseFile(OutlineParserInterface &parser, static void parseFiles(const std::shared_ptr &root) { #if USE_LIBCLANG - static bool clangAssistedParsing = Config_getBool(CLANG_ASSISTED_PARSING); - if (clangAssistedParsing) + if (Doxygen::clangAssistedParsing) { QDict g_processedFiles(10007); @@ -10707,6 +10701,10 @@ void parseInput() { atexit(exitDoxygen); +#if USE_LIBCLANG + Doxygen::clangAssistedParsing = Config_getBool(CLANG_ASSISTED_PARSING); +#endif + // we would like to show the versionString earlier, but we first have to handle the configuration file // to know the value of the QUIET setting. QCString versionString = getFullVersion(); diff --git a/src/doxygen.h b/src/doxygen.h index 2978052..e5757c3 100644 --- a/src/doxygen.h +++ b/src/doxygen.h @@ -152,6 +152,7 @@ class Doxygen static bool generatingXmlOutput; static GenericsSDict *genericsDict; static DefinesPerFileList macroDefinitions; + static bool clangAssistedParsing; }; void initDoxygen(); diff --git a/src/filedef.cpp b/src/filedef.cpp index 18e5cef..08f022b 100644 --- a/src/filedef.cpp +++ b/src/filedef.cpp @@ -1212,8 +1212,7 @@ void FileDefImpl::writeSource(OutputList &ol,bool sameTu,QStrList &filesInSameTu (void)sameTu; (void)filesInSameTu; #if USE_LIBCLANG - static bool clangAssistedParsing = Config_getBool(CLANG_ASSISTED_PARSING); - if (clangAssistedParsing && + if (Doxygen::clangAssistedParsing && (getLanguage()==SrcLangExt_Cpp || getLanguage()==SrcLangExt_ObjC)) { ol.startCodeFragment(); @@ -1276,8 +1275,7 @@ void FileDefImpl::parseSource(bool sameTu,QStrList &filesInSameTu) (void)sameTu; (void)filesInSameTu; #if USE_LIBCLANG - static bool clangAssistedParsing = Config_getBool(CLANG_ASSISTED_PARSING); - if (clangAssistedParsing && + if (Doxygen::clangAssistedParsing && (getLanguage()==SrcLangExt_Cpp || getLanguage()==SrcLangExt_ObjC)) { if (!sameTu) diff --git a/src/scanner.l b/src/scanner.l index cc5428d..d26a9b2 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -2045,7 +2045,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) BEGIN(FindMembers); } {SCOPENAME} { - if (Config_getBool(CLANG_ASSISTED_PARSING) && (yyextra->insideCpp || yyextra->insideObjC)) + if (Doxygen::clangAssistedParsing && (yyextra->insideCpp || yyextra->insideObjC)) { yyextra->current->id = ClangParser::instance()->lookup(yyextra->yyLineNr,yytext); } @@ -2348,7 +2348,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) */ {ID} { //printf("Define '%s' without args\n",yytext); - if (Config_getBool(CLANG_ASSISTED_PARSING) && (yyextra->insideCpp || yyextra->insideObjC)) + if (Doxygen::clangAssistedParsing && (yyextra->insideCpp || yyextra->insideObjC)) { yyextra->current->id = ClangParser::instance()->lookup(yyextra->yyLineNr,yytext); } @@ -3463,7 +3463,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) } . { yyextra->current->type += *yytext ; } {ID} { - if (Config_getBool(CLANG_ASSISTED_PARSING) && (yyextra->insideCpp || yyextra->insideObjC)) + if (Doxygen::clangAssistedParsing && (yyextra->insideCpp || yyextra->insideObjC)) { yyextra->current->id = ClangParser::instance()->lookup(yyextra->yyLineNr,yytext); } @@ -5334,7 +5334,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) } {SCOPENAME} { yyextra->current->name = yytext ; - if (Config_getBool(CLANG_ASSISTED_PARSING) && (yyextra->insideCpp || yyextra->insideObjC)) + if (Doxygen::clangAssistedParsing && (yyextra->insideCpp || yyextra->insideObjC)) { yyextra->current->id = ClangParser::instance()->lookup(yyextra->yyLineNr,yytext); } @@ -5399,7 +5399,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) } } {ID} { - if (Config_getBool(CLANG_ASSISTED_PARSING) && (yyextra->insideCpp || yyextra->insideObjC)) + if (Doxygen::clangAssistedParsing && (yyextra->insideCpp || yyextra->insideObjC)) { yyextra->current->id = ClangParser::instance()->lookup(yyextra->yyLineNr,yytext); } @@ -7255,19 +7255,15 @@ static void parseMain(yyscan_t yyscanner, yyextra->yyBegColNr = 0; yyextra->yyFileName = fileName; setContext(yyscanner); - if (Config_getBool(CLANG_ASSISTED_PARSING)) + if (Doxygen::clangAssistedParsing && (yyextra->insideCpp || yyextra->insideObjC)) { - bool processWithClang = yyextra->insideCpp || yyextra->insideObjC; - if (processWithClang) + if (!sameTranslationUnit) // new file { - if (!sameTranslationUnit) // new file - { - ClangParser::instance()->start(fileName,filesInSameTranslationUnit); - } - else - { - ClangParser::instance()->switchToFile(fileName); - } + ClangParser::instance()->start(fileName,filesInSameTranslationUnit); + } + else + { + ClangParser::instance()->switchToFile(fileName); } } rt->lang = yyextra->language; -- cgit v0.12 From bfe44c22752c443d1e74923137c065f901134478 Mon Sep 17 00:00:00 2001 From: albert-github Date: Tue, 30 Jun 2020 12:07:01 +0200 Subject: Misleading compiler warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When compiling on Cygwin (gcc version 9.3.0 (GCC)) in release mode we get: ``` In file included from /cygdrive/d/Programs/Doxygen/fork/doxygen/src/vhdldocgen.cpp:27: /cygdrive/d/Programs/Doxygen/fork/doxygen/qtools/qcstring.h: In static member function ‘static void FlowChart::colTextNodes()’: /cygdrive/d/Programs/Doxygen/fork/doxygen/qtools/qcstring.h:364:23: warning: ‘flno’ may be used uninitialized in this function [-Wmaybe-uninitialized] 364 | if (str) m_rep+=str; | ^~~ /cygdrive/d/Programs/Doxygen/fork/doxygen/src/vhdldocgen.cpp:3178:14: note: ‘flno’ was declared here 3178 | FlowChart *flno; | ^~~~ ``` The compiler doesn't "understand" that `flno` is guarded by `found` and this would be initialized. Local variable `text` is not used so removed. --- src/vhdldocgen.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/vhdldocgen.cpp b/src/vhdldocgen.cpp index ff96331..28a2028 100644 --- a/src/vhdldocgen.cpp +++ b/src/vhdldocgen.cpp @@ -3174,20 +3174,18 @@ void FlowChart::printFlowTree() void FlowChart::colTextNodes() { - QCString text; - FlowChart *flno; + FlowChart *flno = NULL; bool found=FALSE; for (uint j=0;jtype&TEXT_NO) { - text+=flo->text+'\n'; if (!found) { flno=flo; } - if (found) + else { flno->text+=flo->text; flowList.remove(flo); -- cgit v0.12 From 955f746f9b26ca49e085fb8d84cc16085c8e6d21 Mon Sep 17 00:00:00 2001 From: albert-github Date: Wed, 1 Jul 2020 16:30:09 +0200 Subject: Missing last item in htmlhelp level2 index At every second level index part the last item is missing. We should not only forward but also backward --- src/htmlhelp.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/htmlhelp.cpp b/src/htmlhelp.cpp index 44dea05..8ef3d19 100644 --- a/src/htmlhelp.cpp +++ b/src/htmlhelp.cpp @@ -171,7 +171,7 @@ void HtmlHelpIndex::writeFields(FTextStream &t) dict->sort(); IndexFieldSDict::Iterator ifli(*dict); IndexField *f; - QCString lastLevel1; + QCString prevLevel1; bool level2Started=FALSE; for (;(f=ifli.current());++ifli) { @@ -187,7 +187,6 @@ void HtmlHelpIndex::writeFields(FTextStream &t) level1 = f->name.copy(); } - //if (level1!=lastLevel1) { // finish old list at level 2 if (level2Started) t << " " << endl; level2Started=FALSE; @@ -206,10 +205,11 @@ void HtmlHelpIndex::writeFields(FTextStream &t) nextLevel1 = fnext->name.left(fnext->name.find('?')); --ifli; } - if (level1 != nextLevel1) + if (!(level1 == prevLevel1 || level1 == nextLevel1)) { level2 = ""; } + prevLevel1 = level1.copy(); // if (level2.isEmpty()) @@ -257,7 +257,6 @@ void HtmlHelpIndex::writeFields(FTextStream &t) t << "recode(level2) << "\">" "\n"; } - lastLevel1 = level1.copy(); } if (level2Started) t << " " << endl; } -- cgit v0.12 From c30fbe4eba7f27c6296dea587eefe3d8b489661a Mon Sep 17 00:00:00 2001 From: albert-github Date: Thu, 2 Jul 2020 12:22:00 +0200 Subject: issue #7890 Macro Expansion broken The defines from the doxygen configuration file were not taken into account du a wrong primary key. --- src/pre.l | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pre.l b/src/pre.l index 979e971..28d8f59 100644 --- a/src/pre.l +++ b/src/pre.l @@ -3191,7 +3191,7 @@ static void initPredefined(yyscan_t yyscanner,const char *fileName) def->nonRecursive = nonRecursive; def->fileDef = state->yyFileDef; def->fileName = fileName; - state->contextDefines.insert(std::make_pair(state->yyFileName.str(),std::move(def))); + state->contextDefines.insert(std::make_pair(toStdString(def->name),std::move(def))); //printf("#define '%s' '%s' #nargs=%d\n", // def->name.data(),def->definition.data(),def->nargs); @@ -3223,7 +3223,7 @@ static void initPredefined(yyscan_t yyscanner,const char *fileName) def->nonRecursive = nonRecursive; def->fileDef = state->yyFileDef; def->fileName = fileName; - state->contextDefines.insert(std::make_pair(state->yyFileName.str(),std::move(def))); + state->contextDefines.insert(std::make_pair(toStdString(def->name),std::move(def))); } } } -- cgit v0.12 From 8c12604a84faabf6beeef7f159692ccddcb94dc6 Mon Sep 17 00:00:00 2001 From: tttapa Date: Sat, 4 Jul 2020 16:27:59 +0200 Subject: Scalable search bar for high resolution displays (#7888) * Use SVG images for search bar icons * Update search bar CSS for high resolution displays Uses CSS shadows instead of PNG images of shadows * Limit the main-menu CSS rule to first level list #main-menu li:last-child applies to last childs of sub-lists as well #main-menu > li:last-child only applies to the top-level list --- src/htmlgen.cpp | 18 ++++---- templates/html/close.svg | 31 +++++++++++++ templates/html/htmlbase.tpl | 6 +-- templates/html/htmllayout.tpl | 6 +-- templates/html/htmltabs.tpl | 6 +-- templates/html/mag.svg | 37 ++++++++++++++++ templates/html/mag_sel.svg | 74 +++++++++++++++++++++++++++++++ templates/html/menu.js | 4 +- templates/html/search.css | 100 ++++++++++++++++++------------------------ templates/html/search.js | 2 +- 10 files changed, 205 insertions(+), 79 deletions(-) create mode 100644 templates/html/close.svg create mode 100644 templates/html/mag.svg create mode 100644 templates/html/mag_sel.svg diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index 900ea48..d869a2b 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -67,7 +67,7 @@ static void writeClientSearchBox(FTextStream &t,const char *relPath) { t << "
      \n"; t << " \n"; - t << " \"\"/\n"; @@ -78,7 +78,7 @@ static void writeClientSearchBox(FTextStream &t,const char *relPath) t << " onkeyup=\"searchBox.OnSearchFieldChange(event)\"/>\n"; t << " \n"; t << " " - << "\"\"/\n"; + << "\"\"/\n"; t << " \n"; t << "
      \n"; } @@ -100,7 +100,7 @@ static void writeServerSearchBox(FTextStream &t,const char *relPath,bool highlig t << "search.php"; } t << "\" method=\"get\">\n"; - t << " \"\"/\n"; + t << " \"\"/\n"; if (!highlightSearch) { t << " addImageFile("search/search_r.png"); if (serverBasedSearch) { - mgr.copyResource("mag.png",dir); - Doxygen::indexList->addImageFile("search/mag.png"); + mgr.copyResource("mag.svg",dir); + Doxygen::indexList->addImageFile("search/mag.svg"); } else { - mgr.copyResource("close.png",dir); - Doxygen::indexList->addImageFile("search/close.png"); - mgr.copyResource("mag_sel.png",dir); - Doxygen::indexList->addImageFile("search/mag_sel.png"); + mgr.copyResource("close.svg",dir); + Doxygen::indexList->addImageFile("search/close.svg"); + mgr.copyResource("mag_sel.svg",dir); + Doxygen::indexList->addImageFile("search/mag_sel.svg"); } QCString searchDirName = Config_getString(HTML_OUTPUT)+"/search"; diff --git a/templates/html/close.svg b/templates/html/close.svg new file mode 100644 index 0000000..a933eea --- /dev/null +++ b/templates/html/close.svg @@ -0,0 +1,31 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/templates/html/htmlbase.tpl b/templates/html/htmlbase.tpl index 47939fd..02741d2 100644 --- a/templates/html/htmlbase.tpl +++ b/templates/html/htmlbase.tpl @@ -100,7 +100,7 @@ $(function() {
      - + @@ -111,7 +111,7 @@ $(function() { {% else %}{# !SERVER_BASED_SEARCH #}
      - @@ -121,7 +121,7 @@ $(function() { onkeyup="searchBox.OnSearchFieldChange(event)"/>
      diff --git a/templates/html/htmllayout.tpl b/templates/html/htmllayout.tpl index b434d0c..74d83c6 100644 --- a/templates/html/htmllayout.tpl +++ b/templates/html/htmllayout.tpl @@ -44,14 +44,14 @@ {% if config.SERVER_BASED_SEARCH %} {# server side search resources #} - {% resource 'mag.png' as 'search/mag.png' %} + {% resource 'mag.svg' as 'search/mag.svg' %} {% resource 'extsearch.js as 'search/search.js' %} {% resource 'search_functions.php' as 'search/search_functions.php' %} {% resource 'search_opensearch.php' as 'search/search_opensearch.php' %} {% else %} {# client side search resources #} - {% resource 'mag_sel.png' as 'search/mag_sel.png' %} - {% resource 'close.png' as 'search/close.png' %} + {% resource 'mag_sel.svg' as 'search/mag_sel.svg' %} + {% resource 'close.svg' as 'search/close.svg' %} {% resource 'search.js' as 'search/search.js' %} {% endif %} diff --git a/templates/html/htmltabs.tpl b/templates/html/htmltabs.tpl index e7539d9..b8632cb 100644 --- a/templates/html/htmltabs.tpl +++ b/templates/html/htmltabs.tpl @@ -35,7 +35,7 @@
      - + {% if page.highlight!='search' %}
      - @@ -60,7 +60,7 @@ onkeyup="searchBox.OnSearchFieldChange(event)"/> + id="MSearchCloseImg" border="0" src="{{ page.relPath }}search/close.svg" alt=""/>
      diff --git a/templates/html/mag.svg b/templates/html/mag.svg new file mode 100644 index 0000000..9f46b30 --- /dev/null +++ b/templates/html/mag.svg @@ -0,0 +1,37 @@ + + + + + + image/svg+xml + + + + + + + + + diff --git a/templates/html/mag_sel.svg b/templates/html/mag_sel.svg new file mode 100644 index 0000000..03626f6 --- /dev/null +++ b/templates/html/mag_sel.svg @@ -0,0 +1,74 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/templates/html/menu.js b/templates/html/menu.js index d18a2fe..2fe2214 100644 --- a/templates/html/menu.js +++ b/templates/html/menu.js @@ -41,9 +41,9 @@ function initMenu(relPath,searchEnabled,serverSide,searchPage,search) { $('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu'); if (searchEnabled) { if (serverSide) { - $('#main-menu').append('
    1. '); + $('#main-menu').append('
    2. '); } else { - $('#main-menu').append('
    3. '); + $('#main-menu').append('
    4. '); } } $('#main-menu').smartmenus(); diff --git a/templates/html/search.css b/templates/html/search.css index 859cf6a..8af75a7 100644 --- a/templates/html/search.css +++ b/templates/html/search.css @@ -1,98 +1,82 @@ /*---------------- Search Box */ -#FSearchBox { - float: left; -} - #MSearchBox { white-space : nowrap; - float: none; - margin-top: 8px; - right: 0px; - width: 170px; - height: 24px; + background: white; + border-radius: 0.65em; + box-shadow: inset 0.5px 0.5px 3px 0px #555; z-index: 102; } -#MSearchBox .left -{ - display:block; - position:absolute; - left:10px; - width:20px; - height:19px; - background:url('search_l.png') no-repeat; - background-position:right; +#MSearchBox .left { + display: inline-block; + vertical-align: middle; + height: 1.4em; } #MSearchSelect { - display:block; - position:absolute; - width:20px; - height:19px; -} - -.left #MSearchSelect { - left:4px; -} - -.right #MSearchSelect { - right:5px; + display: inline-block; + vertical-align: middle; + height: 1.4em; + padding: 0 0 0 0.3em; + margin: 0; } #MSearchField { - display:block; - position:absolute; - height:19px; - background:url('search_m.png') repeat-x; + display: inline-block; + vertical-align: middle; + width: 7.5em; + height: 1.1em; + margin: 0 0.15em; + padding: 0; + line-height: 1em; border:none; - width:115px; - margin-left:20px; - padding-left:4px; color: #909090; outline: none; - font: 9pt Arial, Verdana, sans-serif; + font-family: Arial, Verdana, sans-serif; -webkit-border-radius: 0px; + border-radius: 0px; + background: none; } -#FSearchBox #MSearchField { - margin-left:15px; -} #MSearchBox .right { - display:block; - position:absolute; - right:10px; - top:8px; - width:20px; - height:19px; - background:url('search_r.png') no-repeat; - background-position:left; + display: inline-block; + vertical-align: middle; + width: 1.4em; + height: 1.4em; } #MSearchClose { display: none; - position: absolute; - top: 4px; + font-size: inherit; background : none; border: none; - margin: 0px 4px 0px 0px; - padding: 0px 0px; + margin: 0; + padding: 0; outline: none; -} -.left #MSearchClose { - left: 6px; } -.right #MSearchClose { - right: 2px; +#MSearchCloseImg { + height: 1.4em; + padding: 0.3em; + margin: 0; } .MSearchBoxActive #MSearchField { color: #000000; } +#main-menu > li:last-child { + /* This
    5. object is the parent of the search bar */ + display: flex; + justify-content: center; + align-items: center; + height: 36px; + margin-right: 1em; +} + /*---------------- Search filter selection */ #MSearchSelectWindow { diff --git a/templates/html/search.js b/templates/html/search.js index ff2b8c8..92b6094 100644 --- a/templates/html/search.js +++ b/templates/html/search.js @@ -364,7 +364,7 @@ function SearchBox(name, resultsPath, inFrame, label) if (domPopupSearchResultsWindow.style.display!='block') { var domSearchBox = this.DOMSearchBox(); - this.DOMSearchClose().style.display = 'inline'; + this.DOMSearchClose().style.display = 'inline-block'; if (this.insideFrame) { var domPopupSearchResults = this.DOMPopupSearchResults(); -- cgit v0.12 From e51bde4cca9e79ae11c54c45cbcc29233fad0ac1 Mon Sep 17 00:00:00 2001 From: albert-github Date: Mon, 6 Jul 2020 12:13:20 +0200 Subject: Superfluous space in "TEST_FLAGS" When having extra spaces in TEST_FLAGS like(note the double space before `--ip`): ``` make tests TEST_FLAGS="--keep --id=1" ``` or ``` make tests TEST_FLAGS="--id=1 --id=2" ``` we get a message like; ``` [100%] Running doxygen tests... usage: runtests.py [-h] [--updateref] [--doxygen [DOXYGEN]] [--xmllint [XMLLINT]] [--id IDS [IDS ...]] [--start_id START_ID] [--end_id END_ID] [--all] [--inputdir [INPUTDIR]] [--outputdir [OUTPUTDIR]] [--noredir] [--pool [POOL]] [--xml] [--rtf] [--docbook] [--xhtml] [--xmlxsd] [--pdf] [--subdirs] [--clang] [--keep] [--cfg CFGS [CFGS ...]] runtests.py: error: unrecognized arguments: NMAKE : fatal error U1077: 'D:\Programs\Python\Python37\python.exe' : return code '0x2' Stop. ``` By stripping the spaces in the arguments this can be overcome --- testing/runtests.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/testing/runtests.py b/testing/runtests.py index c7b7bc7..129a781 100755 --- a/testing/runtests.py +++ b/testing/runtests.py @@ -487,6 +487,8 @@ def split_and_keep(s, sep): vv = val.split(" ",1) if ((len(vv) == 1) and not vv[0] == ''): retVal += vv + if (len(vv) == 2): + vv[1] = vv[1].strip() if ((len(vv) == 2) and not vv[1] == ''): retVal += vv if ((len(vv) == 2) and vv[1] == ''): -- cgit v0.12 From 044fde94fc0ff1dfba618a72dbee286afa755405 Mon Sep 17 00:00:00 2001 From: albert-github Date: Mon, 6 Jul 2020 15:20:19 +0200 Subject: Compilation warning in debug.cpp When compiling debug.cpp on a 32-bit Windows system we get the warning: ``` ...\doxygen\src\debug.cpp(121): warning C4244: 'return': conversion from '_Rep' to 'int', possible loss of data with [ _Rep=__int64 ] ``` as we only use the seconds representation of the elapsed time we can do the conversion to seconds in the Timer class. --- src/debug.cpp | 10 +++++----- src/debug.h | 2 +- src/doxygen.cpp | 2 +- src/message.cpp | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/debug.cpp b/src/debug.cpp index ca3c1e9..6815b3b 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -114,11 +114,11 @@ class Timer { m_startTime = std::chrono::system_clock::now(); } - int elapsedTimeMs() + double elapsedTimeS() { - return std::chrono::duration_cast< + return (std::chrono::duration_cast< std::chrono::milliseconds>( - std::chrono::system_clock::now() - m_startTime).count(); + std::chrono::system_clock::now() - m_startTime).count()) / 1000.0; } private: std::chrono::time_point m_startTime; @@ -131,8 +131,8 @@ void Debug::startTimer() g_runningTime.start(); } -int Debug::elapsedTime() +double Debug::elapsedTime() { - return g_runningTime.elapsedTimeMs(); + return g_runningTime.elapsedTimeS(); } diff --git a/src/debug.h b/src/debug.h index 0c046f4..edc95e2 100644 --- a/src/debug.h +++ b/src/debug.h @@ -47,7 +47,7 @@ class Debug static void setPriority(int p); static void startTimer(); - static int elapsedTime(); + static double elapsedTime(); private: static DebugMask curMask; diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 089110b..50903b3 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -11583,7 +11583,7 @@ void generateOutput() if (Debug::isFlagSet(Debug::Time)) { msg("Total elapsed time: %.3f seconds\n(of which %.3f seconds waiting for external tools to finish)\n", - ((double)Debug::elapsedTime())/1000.0, + ((double)Debug::elapsedTime()), Portable::getSysElapsedTime() ); g_s.print(); diff --git a/src/message.cpp b/src/message.cpp index bbf578b..96c54a1 100644 --- a/src/message.cpp +++ b/src/message.cpp @@ -117,7 +117,7 @@ void msg(const char *fmt, ...) #endif if (Debug::isFlagSet(Debug::Time)) { - printf("%.3f sec: ",((double)Debug::elapsedTime())/1000.0); + printf("%.3f sec: ",((double)Debug::elapsedTime())); } va_list args; va_start(args, fmt); -- cgit v0.12 From 236080bf9b07dd036efc88f91e3718a1139cfa38 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Tue, 7 Jul 2020 22:23:29 +0200 Subject: Issue #7892: Incorrect search box on server-side search results page --- templates/html/search_functions.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/templates/html/search_functions.php b/templates/html/search_functions.php index 7374de9..22481db 100644 --- a/templates/html/search_functions.php +++ b/templates/html/search_functions.php @@ -7,7 +7,7 @@ function end_form($value) global $translator; if ($config['DISABLE_INDEX'] == false) { - echo " \n \n
    6. \n
      \n \n \n
      \n
      \n"; + echo "\n"; } if ($config['GENERATE_TREEVIEW']) { @@ -15,11 +15,6 @@ function end_form($value) } } -function end_page() -{ - echo ""; -} - function search_results() { global $translator; @@ -361,6 +356,5 @@ function main() end_form(preg_replace("/[^a-zA-Z0-9\-\_\.\x80-\xFF]/i", " ", $query )); // report results to the user report_results($sorted); - end_page(); } ?> -- cgit v0.12 From b11f1c4ec6309627004fce83f366c498bdaab429 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Tue, 7 Jul 2020 22:24:39 +0200 Subject: Refactoring: replace QDict by StringUnorderedSet for g_processedFiles and g_filesToProcess --- src/doxygen.cpp | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 089110b..3ed0e62 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -7480,15 +7480,16 @@ static void generateFileSources() #if USE_LIBCLANG if (Doxygen::clangAssistedParsing) { - QDict g_processedFiles(10007); + StringUnorderedSet processedFiles; // create a dictionary with files to process - QDict g_filesToProcess(10007); + StringUnorderedSet filesToProcess; + for (const auto &fn : *Doxygen::inputNameLinkedMap) { for (const auto &fd : *fn) { - g_filesToProcess.insert(fd->absFilePath(),(void*)0x8); + filesToProcess.insert(fd->absFilePath().str()); } } // process source files (and their include dependencies) @@ -7515,9 +7516,9 @@ static void generateFileSources() } char *incFile = filesInSameTu.first(); - while (incFile && g_filesToProcess.find(incFile)) + while (incFile && filesToProcess.find(incFile)!=filesToProcess.end()) { - if (fd->absFilePath()!=incFile && !g_processedFiles.find(incFile)) + if (fd->absFilePath()!=incFile && processedFiles.find(incFile)==processedFiles.end()) { QStrList moreFiles; bool ambig; @@ -7536,13 +7537,13 @@ static void generateFileSources() msg(" Parsing code for file %s...\n",ifd->docName().data()); ifd->parseSource(TRUE,moreFiles); } - g_processedFiles.insert(incFile,(void*)0x8); + processedFiles.insert(incFile); } } incFile = filesInSameTu.next(); } fd->finishParsing(); - g_processedFiles.insert(fd->absFilePath(),(void*)0x8); + processedFiles.insert(fd->absFilePath().str()); } } } @@ -7551,7 +7552,7 @@ static void generateFileSources() { for (const auto &fd : *fn) { - if (!g_processedFiles.find(fd->absFilePath())) // not yet processed + if (processedFiles.find(fd->absFilePath().str())==processedFiles.end()) // not yet processed { QStrList filesInSameTu; fd->startParsing(); @@ -9127,13 +9128,13 @@ static void parseFiles(const std::shared_ptr &root) #if USE_LIBCLANG if (Doxygen::clangAssistedParsing) { - QDict g_processedFiles(10007); + StringUnorderedSet processedFiles; // create a dictionary with files to process - QDict g_filesToProcess(10007); + StringUnorderedSet filesToProcess; for (const auto &s : g_inputFiles) { - g_filesToProcess.insert(s.c_str(),(void*)0x8); + filesToProcess.insert(s); } // process source files (and their include dependencies) @@ -9154,9 +9155,9 @@ static void parseFiles(const std::shared_ptr &root) // Now process any include files in the same translation unit // first. When libclang is used this is much more efficient. char *incFile = filesInSameTu.first(); - while (incFile && g_filesToProcess.find(incFile)) + while (incFile && filesToProcess.find(incFile)!=filesToProcess.end()) { - if (qstrcmp(incFile,s.c_str()) && !g_processedFiles.find(incFile)) + if (qstrcmp(incFile,s.c_str()) && processedFiles.find(incFile)==processedFiles.end()) { FileDef *ifd=findFileDef(Doxygen::inputNameLinkedMap,incFile,ambig); if (ifd && !ifd->isReference()) @@ -9165,19 +9166,19 @@ static void parseFiles(const std::shared_ptr &root) //printf(" Processing %s in same translation unit as %s\n",incFile,s->c_str()); fileRoot = parseFile(*parser.get(),ifd,incFile,TRUE,moreFiles); root->moveToSubEntryAndKeep(fileRoot); - g_processedFiles.insert(incFile,(void*)0x8); + processedFiles.insert(incFile); } } incFile = filesInSameTu.next(); } parser->finishTranslationUnit(); - g_processedFiles.insert(s.c_str(),(void*)0x8); + processedFiles.insert(s); } } // process remaining files for (const auto &s : g_inputFiles) { - if (!g_processedFiles.find(s.c_str())) // not yet processed + if (processedFiles.find(s)==processedFiles.end()) // not yet processed { bool ambig; QStrList filesInSameTu; @@ -9188,7 +9189,7 @@ static void parseFiles(const std::shared_ptr &root) std::shared_ptr fileRoot = parseFile(*parser.get(),fd,s.c_str(),FALSE,filesInSameTu); root->moveToSubEntryAndKeep(fileRoot); parser->finishTranslationUnit(); - g_processedFiles.insert(s.c_str(),(void*)0x8); + processedFiles.insert(s); } } } -- cgit v0.12 From 50fdb591d4abfdf88bfdda96ffd832cc4c024963 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Wed, 15 Jul 2020 21:23:12 +0200 Subject: Refactor: Modernize clang parser and make it run with multiple threads --- src/clangparser.cpp | 535 +++++++++++++++++++++++---------------------------- src/clangparser.h | 80 +++++++- src/doxygen.cpp | 276 +++++++++++++++++--------- src/filedef.cpp | 65 ++----- src/filedef.h | 10 +- src/fortranscanner.h | 11 +- src/fortranscanner.l | 3 +- src/markdown.cpp | 3 +- src/markdown.h | 5 +- src/parserintf.h | 26 +-- src/pyscanner.h | 15 +- src/pyscanner.l | 5 +- src/scanner.h | 13 +- src/scanner.l | 61 ++---- src/vhdldocgen.cpp | 6 +- src/vhdljjparser.cpp | 2 +- src/vhdljjparser.h | 7 +- 17 files changed, 573 insertions(+), 550 deletions(-) diff --git a/src/clangparser.cpp b/src/clangparser.cpp index e0a1640..2ca5998 100644 --- a/src/clangparser.cpp +++ b/src/clangparser.cpp @@ -20,17 +20,22 @@ #include "membername.h" #include "filename.h" #include "tooltip.h" +#if MULTITHREADED_INPUT +#include +#endif +#endif -static Definition *g_currentDefinition=0; -static MemberDef *g_currentMemberDef=0; -static uint g_currentLine=0; -static bool g_searchForBody=FALSE; -static bool g_insideBody=FALSE; -static uint g_bracketCount=0; +//-------------------------------------------------------------------------- + +#if MULTITHREADED_INPUT +std::mutex g_clangMutex; #endif ClangParser *ClangParser::instance() { +#if MULTITHREADED_INPUT + std::lock_guard lock(g_clangMutex); +#endif if (!s_instance) s_instance = new ClangParser; return s_instance; } @@ -40,29 +45,7 @@ ClangParser *ClangParser::s_instance = 0; //-------------------------------------------------------------------------- #if USE_LIBCLANG -class ClangParser::Private -{ - public: - enum DetectedLang { Detected_Cpp, Detected_ObjC, Detected_ObjCpp }; - Private() : tu(0), tokens(0), numTokens(0), cursors(0), - ufs(0), sources(0), numFiles(0), fileMapping(257), - detectedLang(Detected_Cpp) - { fileMapping.setAutoDelete(TRUE); } - int getCurrentTokenLine(); - CXIndex index; - CXTranslationUnit tu; - QCString fileName; - CXToken *tokens; - uint numTokens; - CXCursor *cursors; - uint curLine; - uint curToken; - CXUnsavedFile *ufs; - QCString *sources; - uint numFiles; - QDict fileMapping; - DetectedLang detectedLang; -}; +enum class DetectedLang { Cpp, ObjC, ObjCpp }; static QCString detab(const QCString &s) { @@ -118,83 +101,89 @@ static QCString detab(const QCString &s) return out.get(); } -/** Callback function called for each include in a translation unit */ -static void inclusionVisitor(CXFile includedFile, - CXSourceLocation* /*inclusionStack*/, - unsigned /*includeLen*/, - CXClientData clientData) +static QCString keywordToType(const char *keyword) { - QDict *fileDict = (QDict *)clientData; - CXString incFileName = clang_getFileName(includedFile); - //printf("--- file %s includes %s\n",fileName,clang_getCString(incFileName)); - fileDict->insert(clang_getCString(incFileName),(void*)0x8); - clang_disposeString(incFileName); + static const StringUnorderedSet flowKeywords({ + "break", "case", "catch", "continue", "default", "do", + "else", "finally", "for", "foreach", "for each", "goto", + "if", "return", "switch", "throw", "throws", "try", + "while", "@try", "@catch", "@finally" }); + static const StringUnorderedSet typeKeywords({ + "bool", "char", "double", "float", "int", "long", "object", + "short", "signed", "unsigned", "void", "wchar_t", "size_t", + "boolean", "id", "SEL", "string", "nullptr" }); + if (flowKeywords.find(keyword)!=flowKeywords.end()) return "keywordflow"; + if (typeKeywords.find(keyword)!=typeKeywords.end()) return "keywordtype"; + return "keyword"; } -/** filter the \a files and only keep those that are found as include files - * within the current translation unit. - * @param[in,out] files The list of files to filter. - */ -void ClangParser::determineInputFilesInSameTu(QStrList &files) + +//-------------------------------------------------------------------------- + +class ClangTUParser::Private +{ + public: + Private(const ClangParser &p,const FileDef *fd) + : parser(p), fileDef(fd) {} + const ClangParser &parser; + const FileDef *fileDef; + CXIndex index; + uint curToken = 0; + DetectedLang detectedLang = DetectedLang::Cpp; + uint numFiles = 0; + std::vector sources; + std::vector ufs; + std::vector cursors; + std::unordered_map fileMapping; + CXTranslationUnit tu; + CXToken *tokens = 0; + uint numTokens = 0; + StringVector filesInSameTU; + + // state while parsing sources + MemberDef *currentMemberDef=0; + uint currentLine=0; + bool searchForBody=FALSE; + bool insideBody=FALSE; + uint bracketCount=0; +}; + +ClangTUParser::ClangTUParser(const ClangParser &parser,const FileDef *fd) + : p(std::make_unique(parser,fd)) { - // put the files in this translation unit in a dictionary - QDict incFound(257); - clang_getInclusions(p->tu, - inclusionVisitor, - (CXClientData)&incFound - ); - // create a new filtered file list - QStrList resultIncludes; - QStrListIterator it2(files); - for (it2.toFirst();it2.current();++it2) - { - if (incFound.find(it2.current())) - { - resultIncludes.append(it2.current()); - } - } - // replace the original list - files=resultIncludes; } -void ClangParser::start(const char *fileName,QStrList &filesInTranslationUnit) +StringVector ClangTUParser::filesInSameTU() const { + return p->filesInSameTU; +} + +void ClangTUParser::parse() +{ + QCString fileName = p->fileDef->absFilePath(); + p->fileDef->getAllIncludeFilesRecursively(p->filesInSameTU); + //printf("ClangTUParser::ClangTUParser(fileName=%s,#filesInSameTU=%d)\n", + // qPrint(fileName),(int)p->filesInSameTU.size()); bool clangAssistedParsing = Config_getBool(CLANG_ASSISTED_PARSING); + bool filterSourceFiles = Config_getBool(FILTER_SOURCE_FILES); const StringVector &includePath = Config_getList(INCLUDE_PATH); const StringVector &clangOptions = Config_getList(CLANG_OPTIONS); - QCString clangCompileDatabase = Config_getString(CLANG_DATABASE_PATH); if (!clangAssistedParsing) return; //printf("ClangParser::start(%s)\n",fileName); - p->fileName = fileName; p->index = clang_createIndex(0, 0); - p->curLine = 1; p->curToken = 0; int argc=0; - std::string error; - // load a clang compilation database (https://clang.llvm.org/docs/JSONCompilationDatabase.html) - // this only needs to be loaded once, and could be refactored to a higher level function - static std::unique_ptr db = - clang::tooling::CompilationDatabase::loadFromDirectory(clangCompileDatabase.data(), error); - int clang_option_len = 0; + size_t clang_option_len = 0; std::vector command; - if (qstrcmp(clangCompileDatabase, "0") != 0) + if (p->parser.database()!=nullptr) { - if (db == nullptr) - { - // user specified a path, but DB file was not found - err("%s using clang compilation database path of: \"%s\"\n", error.c_str(), - clangCompileDatabase.data()); - } - else - { - // check if the file we are parsing is in the DB - command = db->getCompileCommands(fileName); - if (!command.empty() ) - { - // it's possible to have multiple entries for the same file, so use the last entry - clang_option_len = command[command.size()-1].CommandLine.size(); - } - } + // check if the file we are parsing is in the DB + command = p->parser.database()->getCompileCommands(fileName.data()); + if (!command.empty() ) + { + // it's possible to have multiple entries for the same file, so use the last entry + clang_option_len = command[command.size()-1].CommandLine.size(); + } } char **argv = (char**)malloc(sizeof(char*)* (4+Doxygen::inputPaths.size()+ @@ -203,14 +192,19 @@ void ClangParser::start(const char *fileName,QStrList &filesInTranslationUnit) clang_option_len)); if (!command.empty() ) { - std::vector options = command[command.size()-1].CommandLine; - // copy each compiler option used from the database. Skip the first which is compiler exe. - for (auto option = options.begin()+1; option != options.end(); option++) - { - argv[argc++] = qstrdup(option->c_str()); - } - // this extra addition to argv is accounted for as we are skipping the first entry in - argv[argc++]=qstrdup("-w"); // finally, turn off warnings. + std::vector options = command[command.size()-1].CommandLine; + // copy each compiler option used from the database. Skip the first which is compiler exe. + for (auto option = options.begin()+1; option != options.end(); option++) + { + argv[argc++] = qstrdup(option->c_str()); + } + // user specified options + for (size_t i=0;idetectedLang!=ClangParser::Private::Detected_Cpp) + if (lang==SrcLangExt_ObjC || p->detectedLang!=DetectedLang::Cpp) { QCString fn = fileName; - if (p->detectedLang==ClangParser::Private::Detected_Cpp && + if (p->detectedLang!=DetectedLang::Cpp && (fn.right(4).lower()==".cpp" || fn.right(4).lower()==".cxx" || fn.right(3).lower()==".cc" || fn.right(2).lower()==".c")) { // fall back to C/C++ once we see an extension that indicates this - p->detectedLang = ClangParser::Private::Detected_Cpp; + p->detectedLang = DetectedLang::Cpp; } else if (fn.right(3).lower()==".mm") // switch to Objective C++ { - p->detectedLang = ClangParser::Private::Detected_ObjCpp; + p->detectedLang = DetectedLang::ObjCpp; } else if (fn.right(2).lower()==".m") // switch to Objective C { - p->detectedLang = ClangParser::Private::Detected_ObjC; + p->detectedLang = DetectedLang::ObjC; } } - switch(p->detectedLang) + switch (p->detectedLang) { - case ClangParser::Private::Detected_Cpp: - argv[argc++]=qstrdup("c++"); - break; - case ClangParser::Private::Detected_ObjC: - argv[argc++]=qstrdup("objective-c"); - break; - case ClangParser::Private::Detected_ObjCpp: - argv[argc++]=qstrdup("objective-c++"); - break; + case DetectedLang::Cpp: argv[argc++]=qstrdup("c++"); break; + case DetectedLang::ObjC: argv[argc++]=qstrdup("objective-c"); break; + case DetectedLang::ObjCpp: argv[argc++]=qstrdup("objective-c++"); break; } // provide the input and and its dependencies as unsaved files so we can // pass the filtered versions argv[argc++]=qstrdup(fileName); } - static bool filterSourceFiles = Config_getBool(FILTER_SOURCE_FILES); //printf("source %s ----------\n%s\n-------------\n\n", // fileName,p->source.data()); - int numUnsavedFiles = filesInTranslationUnit.count()+1; + int numUnsavedFiles = static_cast(p->filesInSameTU.size()+1); p->numFiles = numUnsavedFiles; - p->sources = new QCString[numUnsavedFiles]; - p->ufs = new CXUnsavedFile[numUnsavedFiles]; + p->sources.resize(numUnsavedFiles); + p->ufs.resize(numUnsavedFiles); p->sources[0] = detab(fileToString(fileName,filterSourceFiles,TRUE)); p->ufs[0].Filename = qstrdup(fileName); p->ufs[0].Contents = p->sources[0].data(); p->ufs[0].Length = p->sources[0].length(); - QStrListIterator it(filesInTranslationUnit); + p->fileMapping.insert({fileName.data(),0}); int i=1; - for (it.toFirst();it.current() && ifilesInSameTU.begin(); + it != p->filesInSameTU.end() && ifileMapping.insert(it.current(),new uint(i)); - p->sources[i] = detab(fileToString(it.current(),filterSourceFiles,TRUE)); - p->ufs[i].Filename = qstrdup(it.current()); + p->fileMapping.insert({it->c_str(),static_cast(i)}); + p->sources[i] = detab(fileToString(it->c_str(),filterSourceFiles,TRUE)); + p->ufs[i].Filename = qstrdup(it->c_str()); p->ufs[i].Contents = p->sources[i].data(); p->ufs[i].Length = p->sources[i].length(); } // let libclang do the actual parsing p->tu = clang_parseTranslationUnit(p->index, 0, - argv, argc, p->ufs, numUnsavedFiles, + argv, argc, p->ufs.data(), numUnsavedFiles, CXTranslationUnit_DetailedPreprocessingRecord); + //printf(" tu=%p\n",p->tu); // free arguments for (i=0;itu) { - // filter out any includes not found by the clang parser - determineInputFilesInSameTu(filesInTranslationUnit); - // show any warnings that the compiler produced int n=clang_getNumDiagnostics(p->tu); for (i=0; i!=n; ++i) @@ -325,105 +312,74 @@ void ClangParser::start(const char *fileName,QStrList &filesInTranslationUnit) clang_disposeString(string); clang_disposeDiagnostic(diag); } - - // create a source range for the given file - QFileInfo fi(fileName); - CXFile f = clang_getFile(p->tu, fileName); - CXSourceLocation fileBegin = clang_getLocationForOffset(p->tu, f, 0); - CXSourceLocation fileEnd = clang_getLocationForOffset(p->tu, f, p->ufs[0].Length); - CXSourceRange fileRange = clang_getRange(fileBegin, fileEnd); - - // produce a token stream for the file - clang_tokenize(p->tu,fileRange,&p->tokens,&p->numTokens); - - // produce cursors for each token in the stream - p->cursors=new CXCursor[p->numTokens]; - clang_annotateTokens(p->tu,p->tokens,p->numTokens,p->cursors); } else { p->tokens = 0; p->numTokens = 0; - p->cursors = 0; - err("clang: Failed to parse translation unit %s\n",fileName); - } -} - -void ClangParser::switchToFile(const char *fileName) -{ - if (p->tu) - { - delete[] p->cursors; - clang_disposeTokens(p->tu,p->tokens,p->numTokens); - p->tokens = 0; - p->numTokens = 0; - p->cursors = 0; - - QFileInfo fi(fileName); - CXFile f = clang_getFile(p->tu, fileName); - uint *pIndex=p->fileMapping.find(fileName); - if (pIndex && *pIndexnumFiles) - { - uint i=*pIndex; - //printf("switchToFile %s: len=%ld\n",fileName,p->ufs[i].Length); - CXSourceLocation fileBegin = clang_getLocationForOffset(p->tu, f, 0); - CXSourceLocation fileEnd = clang_getLocationForOffset(p->tu, f, p->ufs[i].Length); - CXSourceRange fileRange = clang_getRange(fileBegin, fileEnd); - - clang_tokenize(p->tu,fileRange,&p->tokens,&p->numTokens); - p->cursors=new CXCursor[p->numTokens]; - clang_annotateTokens(p->tu,p->tokens,p->numTokens,p->cursors); - - p->curLine = 1; - p->curToken = 0; - } - else - { - err("clang: Failed to find input file %s in mapping\n",fileName); - } + p->cursors.clear(); + err("clang: Failed to parse translation unit %s\n",qPrint(fileName)); } } -void ClangParser::finish() +ClangTUParser::~ClangTUParser() { + //printf("ClangTUParser::~ClangTUParser() tu=%p\n",p->tu); static bool clangAssistedParsing = Config_getBool(CLANG_ASSISTED_PARSING); if (!clangAssistedParsing) return; if (p->tu) { - //printf("ClangParser::finish()\n"); - delete[] p->cursors; + p->cursors.clear(); clang_disposeTokens(p->tu,p->tokens,p->numTokens); clang_disposeTranslationUnit(p->tu); clang_disposeIndex(p->index); p->fileMapping.clear(); p->tokens = 0; p->numTokens = 0; - p->cursors = 0; } for (uint i=0;inumFiles;i++) { free((void *)p->ufs[i].Filename); } - delete[] p->ufs; - delete[] p->sources; - p->ufs = 0; - p->sources = 0; + p->ufs.clear(); + p->sources.clear(); p->numFiles = 0; p->tu = 0; } -int ClangParser::Private::getCurrentTokenLine() +void ClangTUParser::switchToFile(FileDef *fd) { - uint l, c; - if (numTokens==0) return 1; - // guard against filters that reduce the number of lines - if (curToken>=numTokens) curToken=numTokens-1; - CXSourceLocation start = clang_getTokenLocation(tu,tokens[curToken]); - clang_getSpellingLocation(start, 0, &l, &c, 0); - return l; + //printf("ClangTUParser::switchToFile(%s)\n",qPrint(fd->absFilePath())); + if (p->tu) + { + p->cursors.clear(); + clang_disposeTokens(p->tu,p->tokens,p->numTokens); + p->tokens = 0; + p->numTokens = 0; + + CXFile f = clang_getFile(p->tu, fd->absFilePath()); + auto it = p->fileMapping.find(fd->absFilePath().data()); + if (it!=p->fileMapping.end() && it->second < p->numFiles) + { + uint i = it->second; + //printf("switchToFile %s: len=%ld\n",fileName,p->ufs[i].Length); + CXSourceLocation fileBegin = clang_getLocationForOffset(p->tu, f, 0); + CXSourceLocation fileEnd = clang_getLocationForOffset(p->tu, f, p->ufs[i].Length); + CXSourceRange fileRange = clang_getRange(fileBegin, fileEnd); + + clang_tokenize(p->tu,fileRange,&p->tokens,&p->numTokens); + p->cursors.resize(p->numTokens); + clang_annotateTokens(p->tu,p->tokens,p->numTokens,p->cursors.data()); + p->curToken = 0; + } + else + { + err("clang: Failed to find input file %s in mapping\n",qPrint(fd->absFilePath())); + } + } } -QCString ClangParser::lookup(uint line,const char *symbol) +QCString ClangTUParser::lookup(uint line,const char *symbol) { //printf("ClangParser::lookup(%d,%s)\n",line,symbol); QCString result; @@ -431,19 +387,30 @@ QCString ClangParser::lookup(uint line,const char *symbol) static bool clangAssistedParsing = Config_getBool(CLANG_ASSISTED_PARSING); if (!clangAssistedParsing) return result; + auto getCurrentTokenLine = [=]() -> uint + { + uint l, c; + if (p->numTokens==0) return 1; + // guard against filters that reduce the number of lines + if (p->curToken>=p->numTokens) p->curToken=p->numTokens-1; + CXSourceLocation start = clang_getTokenLocation(p->tu,p->tokens[p->curToken]); + clang_getSpellingLocation(start, 0, &l, &c, 0); + return l; + }; + int sl = strlen(symbol); - uint l = p->getCurrentTokenLine(); + uint l = getCurrentTokenLine(); while (l>=line && p->curToken>0) { if (l==line) // already at the right line { p->curToken--; // linear search to start of the line - l = p->getCurrentTokenLine(); + l = getCurrentTokenLine(); } else { p->curToken/=2; // binary search backward - l = p->getCurrentTokenLine(); + l = getCurrentTokenLine(); } } bool found=FALSE; @@ -468,7 +435,7 @@ QCString ClangParser::lookup(uint line,const char *symbol) { break; // end of token stream } - l = p->getCurrentTokenLine(); + l = getCurrentTokenLine(); clang_disposeString(tokenString); tokenString = clang_getTokenSpelling(p->tu, p->tokens[p->curToken]); ts = clang_getCString(tokenString); @@ -505,7 +472,7 @@ QCString ClangParser::lookup(uint line,const char *symbol) p->curToken++; if (p->curTokennumTokens) { - l = p->getCurrentTokenLine(); + l = getCurrentTokenLine(); } } //if (!found) @@ -519,78 +486,23 @@ QCString ClangParser::lookup(uint line,const char *symbol) return result; } -static QCString keywordToType(const char *keyword) -{ - static bool init=TRUE; - static QDict flowKeywords(47); - static QDict typeKeywords(47); - if (init) - { - flowKeywords.insert("break",(void*)0x8); - flowKeywords.insert("case",(void*)0x8); - flowKeywords.insert("catch",(void*)0x8); - flowKeywords.insert("continue",(void*)0x8); - flowKeywords.insert("default",(void*)0x8); - flowKeywords.insert("do",(void*)0x8); - flowKeywords.insert("else",(void*)0x8); - flowKeywords.insert("finally",(void*)0x8); - flowKeywords.insert("for",(void*)0x8); - flowKeywords.insert("foreach",(void*)0x8); - flowKeywords.insert("for each",(void*)0x8); - flowKeywords.insert("goto",(void*)0x8); - flowKeywords.insert("if",(void*)0x8); - flowKeywords.insert("return",(void*)0x8); - flowKeywords.insert("switch",(void*)0x8); - flowKeywords.insert("throw",(void*)0x8); - flowKeywords.insert("throws",(void*)0x8); - flowKeywords.insert("try",(void*)0x8); - flowKeywords.insert("while",(void*)0x8); - flowKeywords.insert("@try",(void*)0x8); - flowKeywords.insert("@catch",(void*)0x8); - flowKeywords.insert("@finally",(void*)0x8); - - typeKeywords.insert("bool",(void*)0x8); - typeKeywords.insert("char",(void*)0x8); - typeKeywords.insert("double",(void*)0x8); - typeKeywords.insert("float",(void*)0x8); - typeKeywords.insert("int",(void*)0x8); - typeKeywords.insert("long",(void*)0x8); - typeKeywords.insert("object",(void*)0x8); - typeKeywords.insert("short",(void*)0x8); - typeKeywords.insert("signed",(void*)0x8); - typeKeywords.insert("unsigned",(void*)0x8); - typeKeywords.insert("void",(void*)0x8); - typeKeywords.insert("wchar_t",(void*)0x8); - typeKeywords.insert("size_t",(void*)0x8); - typeKeywords.insert("boolean",(void*)0x8); - typeKeywords.insert("id",(void*)0x8); - typeKeywords.insert("SEL",(void*)0x8); - typeKeywords.insert("string",(void*)0x8); - typeKeywords.insert("nullptr",(void*)0x8); - init=FALSE; - } - if (flowKeywords[keyword]) return "keywordflow"; - if (typeKeywords[keyword]) return "keywordtype"; - return "keyword"; -} -static void writeLineNumber(CodeOutputInterface &ol,FileDef *fd,uint line) +void ClangTUParser::writeLineNumber(CodeOutputInterface &ol,FileDef *fd,uint line) { Definition *d = fd ? fd->getSourceDefinition(line) : 0; if (d && d->isLinkable()) { - g_currentDefinition=d; - g_currentLine=line; + p->currentLine=line; MemberDef *md = fd->getSourceMember(line); if (md && md->isLinkable()) // link to member { - if (g_currentMemberDef!=md) // new member, start search for body + if (p->currentMemberDef!=md) // new member, start search for body { - g_searchForBody=TRUE; - g_insideBody=FALSE; - g_bracketCount=0; + p->searchForBody=TRUE; + p->insideBody=FALSE; + p->bracketCount=0; } - g_currentMemberDef=md; + p->currentMemberDef=md; ol.writeLineNumber(md->getReference(), md->getOutputFileBase(), md->anchor(), @@ -598,7 +510,7 @@ static void writeLineNumber(CodeOutputInterface &ol,FileDef *fd,uint line) } else // link to compound { - g_currentMemberDef=0; + p->currentMemberDef=0; ol.writeLineNumber(d->getReference(), d->getOutputFileBase(), d->anchor(), @@ -621,8 +533,8 @@ static void writeLineNumber(CodeOutputInterface &ol,FileDef *fd,uint line) //printf("writeLineNumber(%d) g_searchForBody=%d\n",line,g_searchForBody); } -static void codifyLines(CodeOutputInterface &ol,FileDef *fd,const char *text, - uint &line,uint &column,const char *fontClass=0) +void ClangTUParser::codifyLines(CodeOutputInterface &ol,FileDef *fd,const char *text, + uint &line,uint &column,const char *fontClass) { if (fontClass) ol.startFontClass(fontClass); const char *p=text,*sp=p; @@ -657,7 +569,7 @@ static void codifyLines(CodeOutputInterface &ol,FileDef *fd,const char *text, if (fontClass) ol.endFontClass(); } -static void writeMultiLineCodeLink(CodeOutputInterface &ol, +void ClangTUParser::writeMultiLineCodeLink(CodeOutputInterface &ol, FileDef *fd,uint &line,uint &column, Definition *d, const char *text) @@ -698,7 +610,7 @@ static void writeMultiLineCodeLink(CodeOutputInterface &ol, } } -void ClangParser::linkInclude(CodeOutputInterface &ol,FileDef *fd, +void ClangTUParser::linkInclude(CodeOutputInterface &ol,FileDef *fd, uint &line,uint &column,const char *text) { QCString incName = text; @@ -732,7 +644,7 @@ void ClangParser::linkInclude(CodeOutputInterface &ol,FileDef *fd, } } -void ClangParser::linkMacro(CodeOutputInterface &ol,FileDef *fd, +void ClangTUParser::linkMacro(CodeOutputInterface &ol,FileDef *fd, uint &line,uint &column,const char *text) { MemberName *mn=Doxygen::functionNameLinkedMap->find(text); @@ -751,7 +663,7 @@ void ClangParser::linkMacro(CodeOutputInterface &ol,FileDef *fd, } -void ClangParser::linkIdentifier(CodeOutputInterface &ol,FileDef *fd, +void ClangTUParser::linkIdentifier(CodeOutputInterface &ol,FileDef *fd, uint &line,uint &column,const char *text,int tokenIndex) { CXCursor c = p->cursors[tokenIndex]; @@ -782,11 +694,11 @@ void ClangParser::linkIdentifier(CodeOutputInterface &ol,FileDef *fd, //} if (d && d->isLinkable()) { - if (g_insideBody && - g_currentMemberDef && d->definitionType()==Definition::TypeMember && - (g_currentMemberDef!=d || g_currentLineinsideBody && + p->currentMemberDef && d->definitionType()==Definition::TypeMember && + (p->currentMemberDef!=d || p->currentLine(d)); + addDocCrossReference(p->currentMemberDef,dynamic_cast(d)); } writeMultiLineCodeLink(ol,fd,line,column,d,text); } @@ -797,45 +709,44 @@ void ClangParser::linkIdentifier(CodeOutputInterface &ol,FileDef *fd, clang_disposeString(usr); } -static void detectFunctionBody(const char *s) +void ClangTUParser::detectFunctionBody(const char *s) { //printf("punct=%s g_searchForBody=%d g_insideBody=%d g_bracketCount=%d\n", // s,g_searchForBody,g_insideBody,g_bracketCount); - if (g_searchForBody && (qstrcmp(s,":")==0 || qstrcmp(s,"{")==0)) // start of 'body' (: is for constructor) + if (p->searchForBody && (qstrcmp(s,":")==0 || qstrcmp(s,"{")==0)) // start of 'body' (: is for constructor) { - g_searchForBody=FALSE; - g_insideBody=TRUE; + p->searchForBody=FALSE; + p->insideBody=TRUE; } - else if (g_searchForBody && qstrcmp(s,";")==0) // declaration only + else if (p->searchForBody && qstrcmp(s,";")==0) // declaration only { - g_searchForBody=FALSE; - g_insideBody=FALSE; + p->searchForBody=FALSE; + p->insideBody=FALSE; } - if (g_insideBody && qstrcmp(s,"{")==0) // increase scoping level + if (p->insideBody && qstrcmp(s,"{")==0) // increase scoping level { - g_bracketCount++; + p->bracketCount++; } - if (g_insideBody && qstrcmp(s,"}")==0) // decrease scoping level + if (p->insideBody && qstrcmp(s,"}")==0) // decrease scoping level { - g_bracketCount--; - if (g_bracketCount<=0) // got outside of function body + p->bracketCount--; + if (p->bracketCount<=0) // got outside of function body { - g_insideBody=FALSE; - g_bracketCount=0; + p->insideBody=FALSE; + p->bracketCount=0; } } } -void ClangParser::writeSources(CodeOutputInterface &ol,FileDef *fd) +void ClangTUParser::writeSources(CodeOutputInterface &ol,FileDef *fd) { // (re)set global parser state - g_currentDefinition=0; - g_currentMemberDef=0; - g_currentLine=0; - g_searchForBody=FALSE; - g_insideBody=FALSE; - g_bracketCount=0; + p->currentMemberDef=0; + p->currentLine=0; + p->searchForBody=FALSE; + p->insideBody=FALSE; + p->bracketCount=0; unsigned int line=1,column=1; QCString lineNumber,lineAnchor; @@ -939,16 +850,47 @@ void ClangParser::writeSources(CodeOutputInterface &ol,FileDef *fd) ol.endCodeLine(); } -ClangParser::ClangParser() +//-------------------------------------------------------------------------- + +class ClangParser::Private +{ + public: + Private() + { + std::string error; + QCString clangCompileDatabase = Config_getString(CLANG_DATABASE_PATH); + // load a clang compilation database (https://clang.llvm.org/docs/JSONCompilationDatabase.html) + db = clang::tooling::CompilationDatabase::loadFromDirectory(clangCompileDatabase.data(), error); + if (clangCompileDatabase!="0" && db==nullptr) + { + // user specified a path, but DB file was not found + err("%s using clang compilation database path of: \"%s\"\n", error.c_str(), + clangCompileDatabase.data()); + } + } + + std::unique_ptr db; +}; + +const clang::tooling::CompilationDatabase *ClangParser::database() const +{ + return p->db.get(); +} + +ClangParser::ClangParser() : p(std::make_unique()) { - p = new Private; } ClangParser::~ClangParser() { - delete p; } +std::unique_ptr ClangParser::createTUParser(const FileDef *fd) const +{ + return std::make_unique(*this,fd); +} + + //-------------------------------------------------------------------------- #else // use stubbed functionality in case libclang support is disabled. @@ -982,7 +924,6 @@ ClangParser::~ClangParser() { } - #endif //-------------------------------------------------------------------------- diff --git a/src/clangparser.h b/src/clangparser.h index 8bb9aba..07907a6 100644 --- a/src/clangparser.h +++ b/src/clangparser.h @@ -3,9 +3,73 @@ #include #include +#include "containers.h" +#include class CodeOutputInterface; class FileDef; +class ClangParser; +class Definition; + +namespace clang { namespace tooling { + class CompilationDatabase; +} } + +/** @brief Clang parser object for a single translation unit, which consists of a source file + * and the directly or indirectly included headers + */ +class ClangTUParser +{ + public: + ClangTUParser(const ClangParser &parser,const FileDef *fd); + virtual ~ClangTUParser(); + + /** Parse the file given at construction time as a translation unit + * This file should already be preprocessed by doxygen preprocessor at the time of calling. + */ + void parse(); + + /** Switches to another file within the translation unit started with start(). + * @param[in] fileName The name of the file to switch to. + */ + void switchToFile(FileDef *fd); + + /** Returns the list of files for this translation unit */ + StringVector filesInSameTU() const; + + /** Looks for \a symbol which should be found at \a line. + * returns a clang unique reference to the symbol. + */ + QCString lookup(uint line,const char *symbol); + + /** writes the syntax highlighted source code for a file + * @param[out] ol The output generator list to write to. + * @param[in] fd The file to write sources for. + */ + void writeSources(CodeOutputInterface &ol,FileDef *fd); + + private: + void detectFunctionBody(const char *s); + void writeLineNumber(CodeOutputInterface &ol,FileDef *fd,uint line); + void codifyLines(CodeOutputInterface &ol,FileDef *fd,const char *text, + uint &line,uint &column,const char *fontClass=0); + void writeMultiLineCodeLink(CodeOutputInterface &ol, + FileDef *fd,uint &line,uint &column, + Definition *d, const char *text); + void linkIdentifier(CodeOutputInterface &ol,FileDef *fd, + uint &line,uint &column, + const char *text,int tokenIndex); + void linkMacro(CodeOutputInterface &ol,FileDef *fd, + uint &line,uint &column, + const char *text); + void linkInclude(CodeOutputInterface &ol,FileDef *fd, + uint &line,uint &column, + const char *text); + ClangTUParser(const ClangTUParser &) = delete; + ClangTUParser &operator=(const ClangTUParser &) = delete; + class Private; + std::unique_ptr p; +}; /** @brief Wrapper for to let libclang assisted parsing. */ class ClangParser @@ -13,16 +77,20 @@ class ClangParser public: /** Returns the one and only instance of the class */ static ClangParser *instance(); - + + std::unique_ptr createTUParser(const FileDef *fd) const; + const clang::tooling::CompilationDatabase *database() const; + +#if 0 /** Start parsing a file. * @param[in] fileName The name of the file to parse. * @param[in,out] filesInTranslationUnit Other files that are * part of the input and included by the file. * The function will return a subset of the files, - * only including the ones that were actually found + * only including the ones that were actually found * during parsing. */ - void start(const char *fileName,QStrList &filesInTranslationUnit); + void start(const char *fileName,StringVector &filesInTranslationUnit); /** Switches to another file within the translation unit started * with start(). @@ -45,8 +113,10 @@ class ClangParser * @param[in] fd The file to write sources for. */ void writeSources(CodeOutputInterface &ol,FileDef *fd); +#endif private: +#if 0 void linkIdentifier(CodeOutputInterface &ol,FileDef *fd, uint &line,uint &column, const char *text,int tokenIndex); @@ -56,9 +126,9 @@ class ClangParser void linkInclude(CodeOutputInterface &ol,FileDef *fd, uint &line,uint &column, const char *text); - void determineInputFilesInSameTu(QStrList &filesInTranslationUnit); +#endif class Private; - Private *p; + std::unique_ptr p; ClangParser(); virtual ~ClangParser(); static ClangParser *s_instance; diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 5ac1980..8c739ad 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -104,6 +104,7 @@ #include "plantuml.h" #include "stlsupport.h" #include "threadpool.h" +#include "clangparser.h" // provided by the generated file resources.cpp extern void initResources(); @@ -7499,50 +7500,48 @@ static void generateFileSources() { if (fd->isSource() && !fd->isReference()) { - QStrList filesInSameTu; - fd->getAllIncludeFilesRecursively(filesInSameTu); - fd->startParsing(); + auto clangParser = ClangParser::instance()->createTUParser(fd.get()); if (fd->generateSourceFile() && !g_useOutputTemplate) // sources need to be shown in the output { msg("Generating code for file %s...\n",fd->docName().data()); - fd->writeSource(*g_outputList,FALSE,filesInSameTu); + clangParser->parse(); + fd->writeSource(*g_outputList,clangParser.get()); } else if (!fd->isReference() && Doxygen::parseSourcesNeeded) // we needed to parse the sources even if we do not show them { msg("Parsing code for file %s...\n",fd->docName().data()); - fd->parseSource(FALSE,filesInSameTu); + clangParser->parse(); + fd->parseSource(clangParser.get()); } - char *incFile = filesInSameTu.first(); - while (incFile && filesToProcess.find(incFile)!=filesToProcess.end()) + for (auto incFile : clangParser->filesInSameTU()) { - if (fd->absFilePath()!=incFile && processedFiles.find(incFile)==processedFiles.end()) + if (filesToProcess.find(incFile)!=filesToProcess.end() && // part of input + fd->absFilePath()!=incFile && // not same file + processedFiles.find(incFile)==processedFiles.end()) // not yet marked as processed { - QStrList moreFiles; + StringVector moreFiles; bool ambig; - FileDef *ifd=findFileDef(Doxygen::inputNameLinkedMap,incFile,ambig); + FileDef *ifd=findFileDef(Doxygen::inputNameLinkedMap,incFile.c_str(),ambig); if (ifd && !ifd->isReference()) { if (ifd->generateSourceFile() && !g_useOutputTemplate) // sources need to be shown in the output { msg(" Generating code for file %s...\n",ifd->docName().data()); - ifd->writeSource(*g_outputList,TRUE,moreFiles); - + ifd->writeSource(*g_outputList,clangParser.get()); } else if (!ifd->isReference() && Doxygen::parseSourcesNeeded) // we needed to parse the sources even if we do not show them { msg(" Parsing code for file %s...\n",ifd->docName().data()); - ifd->parseSource(TRUE,moreFiles); + ifd->parseSource(clangParser.get()); } processedFiles.insert(incFile); } } - incFile = filesInSameTu.next(); } - fd->finishParsing(); processedFiles.insert(fd->absFilePath().str()); } } @@ -7554,21 +7553,21 @@ static void generateFileSources() { if (processedFiles.find(fd->absFilePath().str())==processedFiles.end()) // not yet processed { - QStrList filesInSameTu; - fd->startParsing(); + auto clangParser = ClangParser::instance()->createTUParser(fd.get()); if (fd->generateSourceFile() && !Htags::useHtags && !g_useOutputTemplate) // sources need to be shown in the output { msg("Generating code for file %s...\n",fd->docName().data()); - fd->writeSource(*g_outputList,FALSE,filesInSameTu); + clangParser->parse(); + fd->writeSource(*g_outputList,clangParser.get()); } else if (!fd->isReference() && Doxygen::parseSourcesNeeded) // we needed to parse the sources even if we do not show them { msg("Parsing code for file %s...\n",fd->docName().data()); - fd->parseSource(FALSE,filesInSameTu); + clangParser->parse(); + fd->parseSource(clangParser.get()); } - fd->finishParsing(); } } } @@ -7580,21 +7579,20 @@ static void generateFileSources() { for (const auto &fd : *fn) { - QStrList filesInSameTu; - fd->startParsing(); + StringVector filesInSameTu; + fd->getAllIncludeFilesRecursively(filesInSameTu); if (fd->generateSourceFile() && !Htags::useHtags && !g_useOutputTemplate) // sources need to be shown in the output { msg("Generating code for file %s...\n",fd->docName().data()); - fd->writeSource(*g_outputList,FALSE,filesInSameTu); + fd->writeSource(*g_outputList,nullptr); } else if (!fd->isReference() && Doxygen::parseSourcesNeeded) // we needed to parse the sources even if we do not show them { msg("Parsing code for file %s...\n",fd->docName().data()); - fd->parseSource(FALSE,filesInSameTu); + fd->parseSource(nullptr); } - fd->finishParsing(); } } } @@ -9062,7 +9060,7 @@ static std::unique_ptr getParserForFile(const char *fn) static std::shared_ptr parseFile(OutlineParserInterface &parser, FileDef *fd,const char *fn, - bool sameTu,QStrList &filesInSameTu) + ClangTUParser *clangParser,bool newTU) { QCString fileName=fn; QCString extension; @@ -9110,18 +9108,20 @@ static std::shared_ptr parseFile(OutlineParserInterface &parser, convBuf.addChar('\0'); - if (Doxygen::clangAssistedParsing && !sameTu) - { - fd->getAllIncludeFilesRecursively(filesInSameTu); - } - std::shared_ptr fileRoot = std::make_shared(); // use language parse to parse the file - parser.parseInput(fileName,convBuf.data(),fileRoot,sameTu,filesInSameTu); + if (clangParser) + { + if (newTU) clangParser->parse(); + clangParser->switchToFile(fd); + } + parser.parseInput(fileName,convBuf.data(),fileRoot,clangParser); fileRoot->setFileDef(fd); return fileRoot; } +#if MULTITHREADED_INPUT + //! parse the list of input files static void parseFiles(const std::shared_ptr &root) { @@ -9137,7 +9137,12 @@ static void parseFiles(const std::shared_ptr &root) filesToProcess.insert(s); } + std::mutex processedFilesLock; // process source files (and their include dependencies) + std::size_t numThreads = std::thread::hardware_concurrency(); + msg("Processing input using %lu threads.\n",numThreads); + ThreadPool threadPool(numThreads); + std::vector< std::future< std::vector< std::shared_ptr > > > results; for (const auto &s : g_inputFiles) { bool ambig; @@ -9145,70 +9150,89 @@ static void parseFiles(const std::shared_ptr &root) ASSERT(fd!=0); if (fd->isSource() && !fd->isReference()) // this is a source file { - QStrList filesInSameTu; - std::unique_ptr parser { getParserForFile(s.c_str()) }; - parser->startTranslationUnit(s.c_str()); - std::shared_ptr fileRoot = parseFile(*parser.get(),fd,s.c_str(),FALSE,filesInSameTu); - root->moveToSubEntryAndKeep(fileRoot); - //printf(" got %d extra files in tu\n",filesInSameTu.count()); - - // Now process any include files in the same translation unit - // first. When libclang is used this is much more efficient. - char *incFile = filesInSameTu.first(); - while (incFile && filesToProcess.find(incFile)!=filesToProcess.end()) - { - if (qstrcmp(incFile,s.c_str()) && processedFiles.find(incFile)==processedFiles.end()) + // lambda representing the work to executed by a thread + auto processFile = [s,&filesToProcess,&processedFilesLock,&processedFiles]() { + bool ambig; + std::vector< std::shared_ptr > roots; + FileDef *fd = findFileDef(Doxygen::inputNameLinkedMap,s.c_str(),ambig); + auto clangParser = ClangParser::instance()->createTUParser(fd); + auto parser = getParserForFile(s.c_str()); + auto fileRoot { parseFile(*parser.get(),fd,s.c_str(),clangParser.get(),true) }; + roots.push_back(fileRoot); + + // Now process any include files in the same translation unit + // first. When libclang is used this is much more efficient. + for (auto incFile : clangParser->filesInSameTU()) { - FileDef *ifd=findFileDef(Doxygen::inputNameLinkedMap,incFile,ambig); - if (ifd && !ifd->isReference()) + if (filesToProcess.find(incFile)!=filesToProcess.end()) { - QStrList moreFiles; - //printf(" Processing %s in same translation unit as %s\n",incFile,s->c_str()); - fileRoot = parseFile(*parser.get(),ifd,incFile,TRUE,moreFiles); - root->moveToSubEntryAndKeep(fileRoot); - processedFiles.insert(incFile); + bool needsToBeProcessed; + { + std::lock_guard lock(processedFilesLock); + needsToBeProcessed = processedFiles.find(incFile)==processedFiles.end(); + if (needsToBeProcessed) processedFiles.insert(incFile); + } + if (incFile!=s && needsToBeProcessed) + { + FileDef *ifd=findFileDef(Doxygen::inputNameLinkedMap,incFile.c_str(),ambig); + if (ifd && !ifd->isReference()) + { + //printf(" Processing %s in same translation unit as %s\n",incFile,s->c_str()); + fileRoot = parseFile(*parser.get(),ifd,incFile.c_str(),clangParser.get(),false); + roots.push_back(fileRoot); + } + } } } - incFile = filesInSameTu.next(); - } - parser->finishTranslationUnit(); - processedFiles.insert(s); + return roots; + }; + // dispatch the work and collect the future results + results.emplace_back(threadPool.queue(processFile)); + } + } + // synchronise with the Entry result lists produced and add them to the root + for (auto &f : results) + { + auto l = f.get(); + for (auto &e : l) + { + root->moveToSubEntryAndKeep(e); } } // process remaining files + results.clear(); for (const auto &s : g_inputFiles) { if (processedFiles.find(s)==processedFiles.end()) // not yet processed { - bool ambig; - QStrList filesInSameTu; - FileDef *fd=findFileDef(Doxygen::inputNameLinkedMap,s.c_str(),ambig); - ASSERT(fd!=0); - std::unique_ptr parser { getParserForFile(s.c_str()) }; - parser->startTranslationUnit(s.c_str()); - std::shared_ptr fileRoot = parseFile(*parser.get(),fd,s.c_str(),FALSE,filesInSameTu); - root->moveToSubEntryAndKeep(fileRoot); - parser->finishTranslationUnit(); - processedFiles.insert(s); + // lambda representing the work to executed by a thread + auto processFile = [s]() { + bool ambig; + std::vector< std::shared_ptr > roots; + FileDef *fd=findFileDef(Doxygen::inputNameLinkedMap,s.c_str(),ambig); + auto clangParser = ClangParser::instance()->createTUParser(fd); + auto parser { getParserForFile(s.c_str()) }; + auto fileRoot = parseFile(*parser.get(),fd,s.c_str(),clangParser.get(),true); + roots.push_back(fileRoot); + return roots; + }; + // dispatch the work and collect the future results + results.emplace_back(threadPool.queue(processFile)); + } + } + // synchronise with the Entry result lists produced and add them to the root + for (auto &f : results) + { + auto l = f.get(); + for (auto &e : l) + { + root->moveToSubEntryAndKeep(e); } } } else // normal processing #endif { -#if !MULTITHREADED_INPUT - for (const auto &s : g_inputFiles) - { - bool ambig; - QStrList filesInSameTu; - FileDef *fd=findFileDef(Doxygen::inputNameLinkedMap,s.c_str(),ambig); - ASSERT(fd!=0); - std::unique_ptr parser { getParserForFile(s.c_str()) }; - parser->startTranslationUnit(s.c_str()); - std::shared_ptr fileRoot = parseFile(*parser.get(),fd,s.c_str(),FALSE,filesInSameTu); - root->moveToSubEntryAndKeep(fileRoot); - } -#else std::size_t numThreads = std::thread::hardware_concurrency(); msg("Processing input using %lu threads.\n",numThreads); ThreadPool threadPool(numThreads); @@ -9218,12 +9242,10 @@ static void parseFiles(const std::shared_ptr &root) // lambda representing the work to executed by a thread auto processFile = [s]() { bool ambig; - QStrList filesInSameTu; FileDef *fd=findFileDef(Doxygen::inputNameLinkedMap,s.c_str(),ambig); - ASSERT(fd!=0); - std::unique_ptr parser { getParserForFile(s.c_str()) }; - parser->startTranslationUnit(s.c_str()); - std::shared_ptr fileRoot = parseFile(*parser.get(),fd,s.c_str(),FALSE,filesInSameTu); + auto clangParser = ClangParser::instance()->createTUParser(fd); + auto parser = getParserForFile(s.c_str()); + auto fileRoot = parseFile(*parser.get(),fd,s.c_str(),clangParser.get(),true); return fileRoot; }; // dispatch the work and collect the future results @@ -9235,10 +9257,92 @@ static void parseFiles(const std::shared_ptr &root) root->moveToSubEntryAndKeep(f.get()); } #warning "Multi-threaded input enabled. This is a highly experimental feature. Only use for doxygen development." + } +} + +#else // !MULTITHREADED_INPUT + +//! parse the list of input files +static void parseFiles(const std::shared_ptr &root) +{ +#if USE_LIBCLANG + if (Doxygen::clangAssistedParsing) + { + StringUnorderedSet processedFiles; + + // create a dictionary with files to process + StringUnorderedSet filesToProcess; + for (const auto &s : g_inputFiles) + { + filesToProcess.insert(s); + } + + // process source files (and their include dependencies) + for (const auto &s : g_inputFiles) + { + bool ambig; + FileDef *fd=findFileDef(Doxygen::inputNameLinkedMap,s.c_str(),ambig); + ASSERT(fd!=0); + if (fd->isSource() && !fd->isReference()) // this is a source file + { + auto clangParser = ClangParser::instance()->createTUParser(fd); + auto parser { getParserForFile(s.c_str()) }; + auto fileRoot = parseFile(*parser.get(),fd,s.c_str(),clangParser.get(),true); + root->moveToSubEntryAndKeep(fileRoot); + processedFiles.insert(s); + + // Now process any include files in the same translation unit + // first. When libclang is used this is much more efficient. + for (auto incFile : clangParser->filesInSameTU()) + { + //printf(" file %s\n",incFile.c_str()); + if (filesToProcess.find(incFile)!=filesToProcess.end() && // file need to be processed + processedFiles.find(incFile)==processedFiles.end()) // and is not processed already + { + FileDef *ifd=findFileDef(Doxygen::inputNameLinkedMap,incFile.c_str(),ambig); + if (ifd && !ifd->isReference()) + { + //printf(" Processing %s in same translation unit as %s\n",incFile.c_str(),s.c_str()); + fileRoot = parseFile(*parser.get(),ifd,incFile.c_str(),clangParser.get(),false); + root->moveToSubEntryAndKeep(fileRoot); + processedFiles.insert(incFile); + } + } + } + } + } + // process remaining files + for (const auto &s : g_inputFiles) + { + if (processedFiles.find(s)==processedFiles.end()) // not yet processed + { + bool ambig; + FileDef *fd=findFileDef(Doxygen::inputNameLinkedMap,s.c_str(),ambig); + auto clangParser = ClangParser::instance()->createTUParser(fd); + auto parser { getParserForFile(s.c_str()) }; + auto fileRoot = parseFile(*parser.get(),fd,s.c_str(),clangParser.get(),true); + root->moveToSubEntryAndKeep(fileRoot); + processedFiles.insert(s); + } + } + } + else // normal processing #endif + { + for (const auto &s : g_inputFiles) + { + bool ambig; + FileDef *fd=findFileDef(Doxygen::inputNameLinkedMap,s.c_str(),ambig); + ASSERT(fd!=0); + std::unique_ptr parser { getParserForFile(s.c_str()) }; + std::shared_ptr fileRoot = parseFile(*parser.get(),fd,s.c_str(),nullptr,true); + root->moveToSubEntryAndKeep(fileRoot); + } } } +#endif + // resolves a path that may include symlinks, if a recursive symlink is // found an empty string is returned. static QCString resolveSymlink(QCString path) @@ -9707,9 +9811,7 @@ static const char *getArg(int argc,char **argv,int &optind) class NullOutlineParser : public OutlineParserInterface { public: - void startTranslationUnit(const char *) {} - void finishTranslationUnit() {} - void parseInput(const char *, const char *,const std::shared_ptr &, bool, QStrList &) {} + void parseInput(const char *, const char *,const std::shared_ptr &, ClangTUParser*) {} bool needsPreprocessing(const QCString &) const { return FALSE; } void parsePrototype(const char *) {} }; diff --git a/src/filedef.cpp b/src/filedef.cpp index 08f022b..658023b 100644 --- a/src/filedef.cpp +++ b/src/filedef.cpp @@ -82,7 +82,7 @@ class FileDefImpl : public DefinitionImpl, public FileDef virtual SDict *getUsedClasses() const { return m_usingDeclList; } virtual QList *includeFileList() const { return m_includeList; } virtual QList *includedByFileList() const { return m_includedByList; } - virtual void getAllIncludeFilesRecursively(QStrList &incFiles) const; + virtual void getAllIncludeFilesRecursively(StringVector &incFiles) const; virtual MemberList *getMemberList(MemberListType lt) const; virtual const QList &getMemberLists() const { return m_memberLists; } virtual MemberGroupSDict *getMemberGroupSDict() const { return m_memberGroupSDict; } @@ -101,10 +101,8 @@ class FileDefImpl : public DefinitionImpl, public FileDef virtual void writeQuickMemberLinks(OutputList &ol,const MemberDef *currentMd) const; virtual void writeSummaryLinks(OutputList &ol) const; virtual void writeTagFile(FTextStream &t); - virtual void startParsing(); - virtual void writeSource(OutputList &ol,bool sameTu,QStrList &filesInSameTu); - virtual void parseSource(bool sameTu,QStrList &filesInSameTu); - virtual void finishParsing(); + virtual void writeSource(OutputList &ol,ClangTUParser *clangParser); + virtual void parseSource(ClangTUParser *clangParser); virtual void setDiskName(const QCString &name); virtual void insertMember(MemberDef *md); virtual void insertClass(ClassDef *cd); @@ -1151,7 +1149,7 @@ void FileDefImpl::writeQuickMemberLinks(OutputList &ol,const MemberDef *currentM } /*! Write a source listing of this file to the output */ -void FileDefImpl::writeSource(OutputList &ol,bool sameTu,QStrList &filesInSameTu) +void FileDefImpl::writeSource(OutputList &ol,ClangTUParser *clangParser) { static bool generateTreeView = Config_getBool(GENERATE_TREEVIEW); static bool filterSourceFiles = Config_getBool(FILTER_SOURCE_FILES); @@ -1209,22 +1207,13 @@ void FileDefImpl::writeSource(OutputList &ol,bool sameTu,QStrList &filesInSameTu ol.popGeneratorState(); } - (void)sameTu; - (void)filesInSameTu; #if USE_LIBCLANG - if (Doxygen::clangAssistedParsing && + if (Doxygen::clangAssistedParsing && clangParser && (getLanguage()==SrcLangExt_Cpp || getLanguage()==SrcLangExt_ObjC)) { ol.startCodeFragment(); - if (!sameTu) - { - ClangParser::instance()->start(absFilePath(),filesInSameTu); - } - else - { - ClangParser::instance()->switchToFile(absFilePath()); - } - ClangParser::instance()->writeSources(ol,this); + clangParser->switchToFile(this); + clangParser->writeSources(ol,this); ol.endCodeFragment(); } else @@ -1268,25 +1257,16 @@ void FileDefImpl::writeSource(OutputList &ol,bool sameTu,QStrList &filesInSameTu ol.enableAll(); } -void FileDefImpl::parseSource(bool sameTu,QStrList &filesInSameTu) +void FileDefImpl::parseSource(ClangTUParser *clangParser) { static bool filterSourceFiles = Config_getBool(FILTER_SOURCE_FILES); DevNullCodeDocInterface devNullIntf; - (void)sameTu; - (void)filesInSameTu; #if USE_LIBCLANG - if (Doxygen::clangAssistedParsing && + if (Doxygen::clangAssistedParsing && clangParser && (getLanguage()==SrcLangExt_Cpp || getLanguage()==SrcLangExt_ObjC)) { - if (!sameTu) - { - ClangParser::instance()->start(absFilePath(),filesInSameTu); - } - else - { - ClangParser::instance()->switchToFile(absFilePath()); - } - ClangParser::instance()->writeSources(devNullIntf,this); + clangParser->switchToFile(this); + clangParser->writeSources(devNullIntf,this); } else #endif @@ -1302,15 +1282,6 @@ void FileDefImpl::parseSource(bool sameTu,QStrList &filesInSameTu) } } -void FileDefImpl::startParsing() -{ -} - -void FileDefImpl::finishParsing() -{ - ClangParser::instance()->finish(); -} - void FileDefImpl::addMembersToMemberGroup() { QListIterator mli(m_memberLists); @@ -2159,7 +2130,7 @@ bool FileDefImpl::isLinkableInProject() const } static void getAllIncludeFilesRecursively( - QDict *filesVisited,const FileDef *fd,QStrList &incFiles) + StringUnorderedSet &filesVisited,const FileDef *fd,StringVector &incFiles) { if (fd->includeFileList()) { @@ -2168,21 +2139,21 @@ static void getAllIncludeFilesRecursively( for (iii.toFirst();(ii=iii.current());++iii) { if (ii->fileDef && !ii->fileDef->isReference() && - !filesVisited->find(ii->fileDef->absFilePath())) + filesVisited.find(ii->fileDef->absFilePath().str())==filesVisited.end()) { //printf("FileDefImpl::addIncludeDependency(%s)\n",ii->fileDef->absFilePath().data()); - incFiles.append(ii->fileDef->absFilePath()); - filesVisited->insert(ii->fileDef->absFilePath(),(void*)0x8); + incFiles.push_back(ii->fileDef->absFilePath().str()); + filesVisited.insert(ii->fileDef->absFilePath().str()); getAllIncludeFilesRecursively(filesVisited,ii->fileDef,incFiles); } } } } -void FileDefImpl::getAllIncludeFilesRecursively(QStrList &incFiles) const +void FileDefImpl::getAllIncludeFilesRecursively(StringVector &incFiles) const { - QDict includes(257); - ::getAllIncludeFilesRecursively(&includes,this,incFiles); + StringUnorderedSet includes; + ::getAllIncludeFilesRecursively(includes,this,incFiles); } QCString FileDefImpl::title() const diff --git a/src/filedef.h b/src/filedef.h index c03e7ef..e4bb549 100644 --- a/src/filedef.h +++ b/src/filedef.h @@ -25,6 +25,7 @@ #include "definition.h" #include "sortdict.h" #include "memberlist.h" +#include "containers.h" class MemberList; class FileDef; @@ -40,6 +41,7 @@ class MemberGroupSDict; class PackageDef; class DirDef; class FTextStream; +class ClangTUParser; /** Class representing the data associated with a \#include statement. */ struct IncludeInfo @@ -118,7 +120,7 @@ class FileDef : virtual public Definition virtual SDict *getUsedClasses() const = 0; virtual QList *includeFileList() const = 0; virtual QList *includedByFileList() const = 0; - virtual void getAllIncludeFilesRecursively(QStrList &incFiles) const = 0; + virtual void getAllIncludeFilesRecursively(StringVector &incFiles) const = 0; virtual MemberList *getMemberList(MemberListType lt) const = 0; virtual const QList &getMemberLists() const = 0; @@ -148,10 +150,8 @@ class FileDef : virtual public Definition virtual void writeSummaryLinks(OutputList &ol) const = 0; virtual void writeTagFile(FTextStream &t) = 0; - virtual void startParsing() = 0; - virtual void writeSource(OutputList &ol,bool sameTu,QStrList &filesInSameTu) = 0; - virtual void parseSource(bool sameTu,QStrList &filesInSameTu) = 0; - virtual void finishParsing() = 0; + virtual void writeSource(OutputList &ol,ClangTUParser *clangParser) = 0; + virtual void parseSource(ClangTUParser *clangParser) = 0; virtual void setDiskName(const QCString &name) = 0; virtual void insertMember(MemberDef *md) = 0; diff --git a/src/fortranscanner.h b/src/fortranscanner.h index 6ffcb1f..0e67bb2 100644 --- a/src/fortranscanner.h +++ b/src/fortranscanner.h @@ -1,12 +1,12 @@ /****************************************************************************** * - * + * * * Copyright (C) 1997-2015 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its - * documentation under the terms of the GNU General Public License is hereby - * granted. No representations are made about the suitability of this software + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software * for any purpose. It is provided "as is" without express or implied warranty. * See the GNU General Public License for more details. * @@ -29,13 +29,10 @@ class FortranOutlineParser : public OutlineParserInterface public: FortranOutlineParser(FortranFormat format=FortranFormat_Unknown); ~FortranOutlineParser(); - void startTranslationUnit(const char *) {} - void finishTranslationUnit() {} void parseInput(const char *fileName, const char *fileBuf, const std::shared_ptr &root, - bool sameTranslationUnit, - QStrList &filesInSameTranslationUnit); + ClangTUParser *clangParser); bool needsPreprocessing(const QCString &extension) const; void parsePrototype(const char *text); diff --git a/src/fortranscanner.l b/src/fortranscanner.l index 195293f..9714602 100644 --- a/src/fortranscanner.l +++ b/src/fortranscanner.l @@ -2803,8 +2803,7 @@ FortranOutlineParser::~FortranOutlineParser() void FortranOutlineParser::parseInput(const char *fileName, const char *fileBuf, const std::shared_ptr &root, - bool /*sameTranslationUnit*/, - QStrList & /*filesInSameTranslationUnit*/) + ClangTUParser * /*clangParser*/) { struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner; yyextra->thisParser = this; diff --git a/src/markdown.cpp b/src/markdown.cpp index 583ad17..1a96d45 100644 --- a/src/markdown.cpp +++ b/src/markdown.cpp @@ -2528,8 +2528,7 @@ MarkdownOutlineParser::~MarkdownOutlineParser() void MarkdownOutlineParser::parseInput(const char *fileName, const char *fileBuf, const std::shared_ptr &root, - bool /*sameTranslationUnit*/, - QStrList & /*filesInSameTranslationUnit*/) + ClangTUParser* /*clangParser*/) { std::shared_ptr current = std::make_shared(); current->lang = SrcLangExt_Markdown; diff --git a/src/markdown.h b/src/markdown.h index 6ac59cb..43a17cc 100644 --- a/src/markdown.h +++ b/src/markdown.h @@ -93,13 +93,10 @@ class MarkdownOutlineParser : public OutlineParserInterface public: MarkdownOutlineParser(); virtual ~MarkdownOutlineParser(); - void startTranslationUnit(const char *) {} - void finishTranslationUnit() {} void parseInput(const char *fileName, const char *fileBuf, const std::shared_ptr &root, - bool sameTranslationUnit, - QStrList &filesInSameTranslationUnit); + ClangTUParser *clangParser); bool needsPreprocessing(const QCString &) const { return FALSE; } void parsePrototype(const char *text); private: diff --git a/src/parserintf.h b/src/parserintf.h index f11352e..911b707 100644 --- a/src/parserintf.h +++ b/src/parserintf.h @@ -26,12 +26,14 @@ #include #include "types.h" +#include "containers.h" class Entry; class FileDef; class CodeOutputInterface; class MemberDef; class Definition; +class ClangTUParser; /** \brief Abstract interface for outline parsers. * @@ -44,36 +46,18 @@ class OutlineParserInterface public: virtual ~OutlineParserInterface() {} - /** Starts processing a translation unit (source files + headers). - * After this call parseInput() is called with sameTranslationUnit - * set to FALSE. If parseInput() returns additional include files, - * these are also processed using parseInput() with - * sameTranslationUnit set to TRUE. After that - * finishTranslationUnit() is called. - */ - virtual void startTranslationUnit(const char *fileName) = 0; - - /** Called after all files in a translation unit have been - * processed. - */ - virtual void finishTranslationUnit() = 0; - /** Parses a single input file with the goal to build an Entry tree. * @param[in] fileName The full name of the file. * @param[in] fileBuf The contents of the file (zero terminated). * @param[in,out] root The root of the tree of Entry *nodes * representing the information extracted from the file. - * @param[in] sameTranslationUnit TRUE if this file was found in the same - * translation unit (in the filesInSameTranslationUnit list - * returned for another file). - * @param[in,out] filesInSameTranslationUnit other files expected to be - * found in the same translation unit (used for libclang) + * @param[in] clangParser The clang translation unit parser object + * or nullptr if disabled. */ virtual void parseInput(const char *fileName, const char *fileBuf, const std::shared_ptr &root, - bool sameTranslationUnit, - QStrList &filesInSameTranslationUnit) = 0; + ClangTUParser *clangParser) = 0; /** Returns TRUE if the language identified by \a extension needs * the C preprocessor to be run before feed the result to the input diff --git a/src/pyscanner.h b/src/pyscanner.h index d6e8672..4f0ae38 100644 --- a/src/pyscanner.h +++ b/src/pyscanner.h @@ -1,12 +1,12 @@ /****************************************************************************** * - * + * * * Copyright (C) 1997-2015 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its - * documentation under the terms of the GNU General Public License is hereby - * granted. No representations are made about the suitability of this software + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software * for any purpose. It is provided "as is" without express or implied warranty. * See the GNU General Public License for more details. * @@ -36,13 +36,10 @@ class PythonOutlineParser : public OutlineParserInterface public: PythonOutlineParser(); virtual ~PythonOutlineParser(); - void startTranslationUnit(const char *) {} - void finishTranslationUnit() {} - void parseInput(const char * fileName, - const char *fileBuf, + void parseInput(const char * fileName, + const char *fileBuf, const std::shared_ptr &root, - bool sameTranslationUnit, - QStrList &filesInSameTranslationUnit); + ClangTUParser *clangParser); bool needsPreprocessing(const QCString &extension) const; void parsePrototype(const char *text); private: diff --git a/src/pyscanner.l b/src/pyscanner.l index a3dbaba..07b39d6 100644 --- a/src/pyscanner.l +++ b/src/pyscanner.l @@ -1517,7 +1517,7 @@ static void newFunction(yyscan_t yyscanner) static inline int computeIndent(const char *s) { int col=0; - static int tabSize=Config_getInt(TAB_SIZE); + int tabSize=Config_getInt(TAB_SIZE); const char *p=s; char c; while ((c=*p++)) @@ -1936,8 +1936,7 @@ PythonOutlineParser::~PythonOutlineParser() void PythonOutlineParser::parseInput(const char *fileName, const char *fileBuf, const std::shared_ptr &root, - bool /*sameTranslationUnit*/, - QStrList & /*filesInSameTranslationUnit*/) + ClangTUParser * /*clangParser*/) { struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner; yyextra->thisParser = this; diff --git a/src/scanner.h b/src/scanner.h index 70df660..cefc934 100644 --- a/src/scanner.h +++ b/src/scanner.h @@ -1,12 +1,12 @@ /****************************************************************************** * - * + * * * Copyright (C) 1997-2015 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its - * documentation under the terms of the GNU General Public License is hereby - * granted. No representations are made about the suitability of this software + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software * for any purpose. It is provided "as is" without express or implied warranty. * See the GNU General Public License for more details. * @@ -23,7 +23,7 @@ /** \brief C-like language parser using state-based lexical scanning. * * This is the language parser for doxygen. It is somewhat fuzzy and - * supports C++ and various languages that are closely related to C++, + * supports C++ and various languages that are closely related to C++, * such as C, C#, Objective-C, Java, PHP, and IDL. */ class COutlineParser : public OutlineParserInterface @@ -31,13 +31,10 @@ class COutlineParser : public OutlineParserInterface public: COutlineParser(); virtual ~COutlineParser(); - void startTranslationUnit(const char *fileName); - void finishTranslationUnit(); void parseInput(const char *fileName, const char *fileBuf, const std::shared_ptr &root, - bool sameTranslationUnit, - QStrList &filesInSameTranslationUnit); + ClangTUParser *clangParser); bool needsPreprocessing(const QCString &extension) const; void parsePrototype(const char *text); private: diff --git a/src/scanner.l b/src/scanner.l index d26a9b2..d9ad41c 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -193,6 +193,8 @@ struct scannerYY_state uint fencedSize = 0; bool nestedComment = false; std::vector< std::pair > > outerScopeEntries; + + ClangTUParser * clangParser = 0; }; #if USE_STATE2STRING @@ -766,9 +768,9 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) yyextra->current->type = "id"; } yyextra->current->name = yytext; - if (yyextra->insideCpp || yyextra->insideObjC) + if (yyextra->clangParser && (yyextra->insideCpp || yyextra->insideObjC)) { - yyextra->current->id = ClangParser::instance()->lookup(yyextra->yyLineNr,yytext); + yyextra->current->id = yyextra->clangParser->lookup(yyextra->yyLineNr,yytext); } } ":"{B}* { // start of parameter list @@ -2045,9 +2047,9 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) BEGIN(FindMembers); } {SCOPENAME} { - if (Doxygen::clangAssistedParsing && (yyextra->insideCpp || yyextra->insideObjC)) + if (yyextra->clangParser && (yyextra->insideCpp || yyextra->insideObjC)) { - yyextra->current->id = ClangParser::instance()->lookup(yyextra->yyLineNr,yytext); + yyextra->current->id = yyextra->clangParser->lookup(yyextra->yyLineNr,yytext); } yyextra->yyBegColNr=yyextra->yyColNr; yyextra->yyBegLineNr=yyextra->yyLineNr; @@ -2348,9 +2350,9 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) */ {ID} { //printf("Define '%s' without args\n",yytext); - if (Doxygen::clangAssistedParsing && (yyextra->insideCpp || yyextra->insideObjC)) + if (yyextra->clangParser && (yyextra->insideCpp || yyextra->insideObjC)) { - yyextra->current->id = ClangParser::instance()->lookup(yyextra->yyLineNr,yytext); + yyextra->current->id = yyextra->clangParser->lookup(yyextra->yyLineNr,yytext); } yyextra->current->bodyLine = yyextra->yyLineNr; yyextra->current->bodyColumn = yyextra->yyColNr; @@ -3463,9 +3465,9 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) } . { yyextra->current->type += *yytext ; } {ID} { - if (Doxygen::clangAssistedParsing && (yyextra->insideCpp || yyextra->insideObjC)) + if (yyextra->clangParser && (yyextra->insideCpp || yyextra->insideObjC)) { - yyextra->current->id = ClangParser::instance()->lookup(yyextra->yyLineNr,yytext); + yyextra->current->id = yyextra->clangParser->lookup(yyextra->yyLineNr,yytext); } yyextra->current->bodyLine = yyextra->yyLineNr; yyextra->current->bodyColumn = yyextra->yyColNr; @@ -5334,9 +5336,9 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) } {SCOPENAME} { yyextra->current->name = yytext ; - if (Doxygen::clangAssistedParsing && (yyextra->insideCpp || yyextra->insideObjC)) + if (yyextra->clangParser && (yyextra->insideCpp || yyextra->insideObjC)) { - yyextra->current->id = ClangParser::instance()->lookup(yyextra->yyLineNr,yytext); + yyextra->current->id = yyextra->clangParser->lookup(yyextra->yyLineNr,yytext); } lineCount(yyscanner); if (yyextra->current->spec & Entry::Protocol) @@ -5399,9 +5401,9 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) } } {ID} { - if (Doxygen::clangAssistedParsing && (yyextra->insideCpp || yyextra->insideObjC)) + if (yyextra->clangParser && (yyextra->insideCpp || yyextra->insideObjC)) { - yyextra->current->id = ClangParser::instance()->lookup(yyextra->yyLineNr,yytext); + yyextra->current->id = yyextra->clangParser->lookup(yyextra->yyLineNr,yytext); } if (yyextra->insideIDL && qstrcmp(yytext,"switch")==0) { @@ -7232,8 +7234,7 @@ static void parseMain(yyscan_t yyscanner, const char *fileName, const char *fileBuf, const std::shared_ptr &rt, - bool sameTranslationUnit, - QStrList & filesInSameTranslationUnit) + ClangTUParser *clangParser) { struct yyguts_t *yyg = (struct yyguts_t*)yyscanner; initParser(yyscanner); @@ -7254,18 +7255,8 @@ static void parseMain(yyscan_t yyscanner, yyextra->yyBegLineNr = 1; yyextra->yyBegColNr = 0; yyextra->yyFileName = fileName; + yyextra->clangParser = clangParser; setContext(yyscanner); - if (Doxygen::clangAssistedParsing && (yyextra->insideCpp || yyextra->insideObjC)) - { - if (!sameTranslationUnit) // new file - { - ClangParser::instance()->start(fileName,filesInSameTranslationUnit); - } - else - { - ClangParser::instance()->switchToFile(fileName); - } - } rt->lang = yyextra->language; msg("Parsing file %s...\n",yyextra->yyFileName.data()); @@ -7402,33 +7393,17 @@ COutlineParser::~COutlineParser() scannerYYlex_destroy(p->yyscanner); } -void COutlineParser::startTranslationUnit(const char *) -{ -} - -void COutlineParser::finishTranslationUnit() -{ - struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner; - bool processWithClang = yyextra->insideCpp || yyextra->insideObjC; - if (processWithClang) - { - ClangParser::instance()->finish(); - } -} - void COutlineParser::parseInput(const char *fileName, const char *fileBuf, const std::shared_ptr &root, - bool sameTranslationUnit, - QStrList & filesInSameTranslationUnit) + ClangTUParser *clangParser) { struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner; yyextra->thisParser = this; printlex(yy_flex_debug, TRUE, __FILE__, fileName); - ::parseMain(p->yyscanner, fileName,fileBuf,root, - sameTranslationUnit,filesInSameTranslationUnit); + ::parseMain(p->yyscanner,fileName,fileBuf,root,clangParser); printlex(yy_flex_debug, FALSE, __FILE__, fileName); } diff --git a/src/vhdldocgen.cpp b/src/vhdldocgen.cpp index 28a2028..5cc57ec 100644 --- a/src/vhdldocgen.cpp +++ b/src/vhdldocgen.cpp @@ -2942,10 +2942,8 @@ void VhdlDocGen::createFlowChart(const MemberDef *mdef) auto parser { Doxygen::parserManager->getOutlineParser(".vhd") }; VhdlDocGen::setFlowMember(mdef); std::shared_ptr root = std::make_shared(); - QStrList filesInSameTu; - parser->startTranslationUnit(""); - parser->parseInput("",codeFragment.data(),root,FALSE,filesInSameTu); - parser->finishTranslationUnit(); + StringVector filesInSameTu; + parser->parseInput("",codeFragment.data(),root,nullptr); } void VhdlDocGen::resetCodeVhdlParserState() diff --git a/src/vhdljjparser.cpp b/src/vhdljjparser.cpp index aa566ae..9ad9e23 100644 --- a/src/vhdljjparser.cpp +++ b/src/vhdljjparser.cpp @@ -126,7 +126,7 @@ VHDLOutlineParser::~VHDLOutlineParser() } void VHDLOutlineParser::parseInput(const char *fileName,const char *fileBuf, - const std::shared_ptr &root, bool ,QStrList&) + const std::shared_ptr &root, ClangTUParser *) { VhdlParser::SharedState *s = &p->shared; p->thisParser=this; diff --git a/src/vhdljjparser.h b/src/vhdljjparser.h index 940631d..651221c 100755 --- a/src/vhdljjparser.h +++ b/src/vhdljjparser.h @@ -32,20 +32,17 @@ class VHDLOutlineParser : public OutlineParserInterface public: VHDLOutlineParser(); virtual ~VHDLOutlineParser(); - void startTranslationUnit(const char *) {} - void finishTranslationUnit() {} void parseInput(const char * fileName, const char *fileBuf, const std::shared_ptr &root, - bool sameTranslationUnit, - QStrList &filesInSameTranslationUnit); + ClangTUParser *clangParser); bool needsPreprocessing(const QCString &) const { return TRUE; } void parsePrototype(const char *text); // interface for generated parser code - + void setLineParsed(int tok); int getLine(int tok); int getLine(); -- cgit v0.12 From 9eaa0b08fc4a09cff8abbd4993b5c644ef6f6e9a Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Thu, 16 Jul 2020 19:13:37 +0200 Subject: Cleanup some disabled code sections --- src/clangparser.h | 49 ++----------------------------------------------- 1 file changed, 2 insertions(+), 47 deletions(-) diff --git a/src/clangparser.h b/src/clangparser.h index 07907a6..8ee1bdb 100644 --- a/src/clangparser.h +++ b/src/clangparser.h @@ -74,59 +74,14 @@ class ClangTUParser /** @brief Wrapper for to let libclang assisted parsing. */ class ClangParser { + friend class ClangTUParser; public: /** Returns the one and only instance of the class */ static ClangParser *instance(); - std::unique_ptr createTUParser(const FileDef *fd) const; - const clang::tooling::CompilationDatabase *database() const; - -#if 0 - /** Start parsing a file. - * @param[in] fileName The name of the file to parse. - * @param[in,out] filesInTranslationUnit Other files that are - * part of the input and included by the file. - * The function will return a subset of the files, - * only including the ones that were actually found - * during parsing. - */ - void start(const char *fileName,StringVector &filesInTranslationUnit); - - /** Switches to another file within the translation unit started - * with start(). - * @param[in] fileName The name of the file to switch to. - */ - void switchToFile(const char *fileName); - - /** Finishes parsing a translation unit. Free any resources that - * were needed for parsing. - */ - void finish(); - - /** Looks for \a symbol which should be found at \a line and - * returns a clang unique reference to the symbol. - */ - QCString lookup(uint line,const char *symbol); - - /** writes the syntax highlighted source code for a file - * @param[out] ol The output generator list to write to. - * @param[in] fd The file to write sources for. - */ - void writeSources(CodeOutputInterface &ol,FileDef *fd); -#endif private: -#if 0 - void linkIdentifier(CodeOutputInterface &ol,FileDef *fd, - uint &line,uint &column, - const char *text,int tokenIndex); - void linkMacro(CodeOutputInterface &ol,FileDef *fd, - uint &line,uint &column, - const char *text); - void linkInclude(CodeOutputInterface &ol,FileDef *fd, - uint &line,uint &column, - const char *text); -#endif + const clang::tooling::CompilationDatabase *database() const; class Private; std::unique_ptr p; ClangParser(); -- cgit v0.12 From 08686b4117ae8b0f8dc3711e169e3da3fa1fe8fc Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Thu, 16 Jul 2020 19:16:19 +0200 Subject: Restructured the split_and_keep function --- testing/runtests.py | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/testing/runtests.py b/testing/runtests.py index 129a781..6b3e54e 100755 --- a/testing/runtests.py +++ b/testing/runtests.py @@ -474,26 +474,13 @@ class TestManager: shutil.rmtree("dtd",ignore_errors=True) shutil.copytree(self.args.inputdir+"/dtd", "dtd") -def split_and_keep(s, sep): - if not s: return [] - - # Find replacement character that is not used in string - # i.e. just use the highest available character plus one - # Note: This fails if ord(max(s)) = 0x10FFFF (ValueError) - p=chr(ord(max(s))+1) - - retVal = [] - for val in s.replace(sep, p+sep).split(p): - vv = val.split(" ",1) - if ((len(vv) == 1) and not vv[0] == ''): - retVal += vv - if (len(vv) == 2): - vv[1] = vv[1].strip() - if ((len(vv) == 2) and not vv[1] == ''): - retVal += vv - if ((len(vv) == 2) and vv[1] == ''): - retVal += [vv[0]] - return retVal +def split_and_keep(s,sep): + s = s.replace(sep,'\0'+sep) # add token separator + s = s.split('\0') # split by null delimiter + s = [x.strip() for x in filter(None,s)] # strip and remove empty elements + s = [z.split(' ',1) for z in s] # split by first space + s = [i for ss in s for i in ss] # flatten the list + return s def main(): # argument handling -- cgit v0.12 From 8c02f1e963682edfebfd0da619c65112cf30448b Mon Sep 17 00:00:00 2001 From: albert-github Date: Thu, 16 Jul 2020 19:25:44 +0200 Subject: issue #6846 Doxygen parsing global variable as function in certain cases (#7903) A parameter can only be present for a function, so we should test on the member being a function it as well. This fix is for the problem as reported by @tgpfeiffer --- src/memberdef.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 2b8bbbc..7d6acb5 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -4167,6 +4167,7 @@ void MemberDefImpl::warnIfUndocumentedParams() const if (!Config_getBool(EXTRACT_ALL) && Config_getBool(WARN_IF_UNDOCUMENTED) && Config_getBool(WARN_NO_PARAMDOC) && + isFunction() && !isDeleted() && !isReference() && !Doxygen::suppressDocWarnings) @@ -4179,7 +4180,7 @@ void MemberDefImpl::warnIfUndocumentedParams() const qPrint(qualifiedName())); } if (!m_impl->hasDocumentedReturnType && - isFunction() && hasDocumentation() && !returnType.isEmpty()) + hasDocumentation() && !returnType.isEmpty()) { warn_doc_error(getDefFileName(),getDefLine(), "return type of member %s is not documented", -- cgit v0.12