From deaa34e0c1d990f37fe00e465ac7a22f705904f0 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Sun, 24 Mar 2013 11:51:51 +0000 Subject: Release-1.8.3.1-20130324 --- Doxyfile | 38 +- INSTALL | 4 +- Makefile.in | 2 +- README | 4 +- addon/doxywizard/expert.cpp | 237 ++++---- configure | 80 ++- doc/arch.doc | 4 + doc/autolink.doc | 6 + doc/commands.doc | 6 + doc/config.doc | 6 + doc/custcmd.doc | 7 + doc/customize.doc | 6 + doc/diagrams.doc | 12 +- doc/docblocks.doc | 9 - doc/doxygen_usage.doc | 24 +- doc/doxywizard_usage.doc | 6 + doc/extsearch.doc | 6 + doc/features.doc | 6 + doc/grouping.doc | 5 - doc/htmlcmds.doc | 7 + doc/index.doc | 5 + doc/install.doc | 22 +- doc/language.doc | 30 +- doc/maintainers.txt | 2 +- doc/output.doc | 6 + doc/perlmod.doc | 6 + doc/perlmod_tree.doc | 6 + doc/preprocessing.doc | 11 +- doc/searching.doc | 6 + doc/translator.py | 747 ++++++++++++------------ doc/translator_report.txt | 96 +--- doc/trouble.doc | 4 +- doc/xmlcmds.doc | 6 + examples/Makefile.in | 58 +- qtools/Doxyfile | 11 +- qtools/qcstring.h | 6 + src/bufstr.h | 4 + src/cite.cpp | 16 +- src/clangparser.cpp | 720 +++++++++++++++++++++++ src/clangparser.h | 35 ++ src/classdef.cpp | 12 +- src/classdef.h | 1 + src/code.h | 2 + src/code.l | 53 +- src/commentcnv.l | 3 +- src/commentscan.l | 16 +- src/config.xml | 42 +- src/configgen.py | 8 +- src/configoptions.cpp | 51 +- src/definition.cpp | 13 +- src/definition.h | 3 + src/diagram.h | 2 + src/docbookgen.cpp | 3 - src/doctokenizer.h | 1 + src/dot.cpp | 18 +- src/doxygen.cpp | 149 +++-- src/doxygen.h | 6 +- src/doxygen.md | 2 +- src/doxygen.pro.in | 4 +- src/entry.cpp | 2 + src/entry.h | 1 + src/filedef.cpp | 37 +- src/fortrancode.h | 2 + src/fortrancode.l | 16 +- src/fortranscanner.l | 4 +- src/groupdef.cpp | 2 +- src/htmlattrib.h | 3 + src/htmlgen.cpp | 7 +- src/htmlgen.h | 4 - src/htmlhelp.h | 1 + src/language.cpp | 2 +- src/latexdocvisitor.cpp | 2 +- src/latexgen.cpp | 945 +++++++++++++++--------------- src/latexgen.h | 1 - src/libdoxygen.pro.in | 2 + src/mangen.cpp | 2 +- src/mangen.h | 1 - src/markdown.cpp | 36 +- src/marshal.cpp | 2 + src/memberdef.cpp | 41 +- src/memberdef.h | 8 +- src/membergroup.cpp | 6 +- src/memberlist.cpp | 18 +- src/memberlist.h | 5 +- src/namespacedef.cpp | 2 +- src/outputgen.h | 2 - src/outputlist.h | 3 - src/pre.l | 68 ++- src/printdocvisitor.h | 1 + src/pycode.h | 1 + src/pycode.l | 11 +- src/rtfgen.cpp | 17 +- src/rtfgen.h | 1 - src/scanner.l | 101 +++- src/search.css | 2 +- src/search_css.h | 2 +- src/settings.h | 10 +- src/translator_adapter.h | 36 +- src/translator_ua.h | 1337 +++++++++++++++++++++++++++---------------- src/util.cpp | 31 +- src/util.h | 1 + src/vhdlcode.l | 9 +- src/vhdldocgen.cpp | 114 ++-- src/vhdldocgen.h | 15 +- src/vhdlparser.y | 72 ++- src/vhdlscanner.h | 9 +- src/vhdlscanner.l | 84 +-- src/xmlgen.cpp | 5 +- winbuild/Doxygen.vcproj | 16 +- 109 files changed, 3629 insertions(+), 2132 deletions(-) create mode 100644 src/clangparser.cpp create mode 100644 src/clangparser.h diff --git a/Doxyfile b/Doxyfile index 77b0522..b2f4ea7 100644 --- a/Doxyfile +++ b/Doxyfile @@ -1,4 +1,4 @@ -# Doxyfile 1.8.0 +# Doxyfile 1.8.3.1 #--------------------------------------------------------------------------- # Project related configuration options @@ -34,6 +34,7 @@ OPTIMIZE_FOR_FORTRAN = NO OPTIMIZE_OUTPUT_VHDL = NO EXTENSION_MAPPING = MARKDOWN_SUPPORT = YES +AUTOLINK_SUPPORT = YES BUILTIN_STL_SUPPORT = NO CPP_CLI_SUPPORT = NO SIP_SUPPORT = NO @@ -100,7 +101,7 @@ INPUT = src INPUT_ENCODING = UTF-8 FILE_PATTERNS = *.h \ *.cpp \ - *.md + *.md RECURSIVE = NO EXCLUDE = src/code.cpp \ src/ce_lex.cpp \ @@ -115,8 +116,6 @@ EXCLUDE = src/code.cpp \ src/logos.cpp \ src/suffixtree.cpp \ src/suffixtree.h \ - src/searchindex.cpp \ - src/searchindex.h \ src/commentcnv.cpp \ src/commentscan.cpp \ src/pycode.cpp \ @@ -128,7 +127,7 @@ EXCLUDE = src/code.cpp \ src/vhdlparser.cpp \ src/vhdlcode.cpp \ src/tclscanner.cpp \ - src/lodepng.cpp \ + src/lodepng.cpp \ src/doxygen_css.h \ src/doxygen_js.h \ src/doxygen_php.h \ @@ -147,9 +146,14 @@ EXCLUDE = src/code.cpp \ src/search_functions_php.h \ src/search_opensearch_php.h \ src/search_js.h \ - src/sizzle_js.h + src/sizzle_js.h \ + src/navtree_js.h \ + src/resize_js.h \ + src/svgpan_js.h \ + src/dynsections_js.h \ + src/extsearch_js.h \ + src/footer_html.h \ EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = EXCLUDE_SYMBOLS = EXAMPLE_PATH = EXAMPLE_PATTERNS = @@ -159,6 +163,7 @@ INPUT_FILTER = FILTER_PATTERNS = FILTER_SOURCE_FILES = NO FILTER_SOURCE_PATTERNS = +USE_MDFILE_AS_MAINPAGE = #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- @@ -170,6 +175,8 @@ REFERENCES_RELATION = YES REFERENCES_LINK_SOURCE = YES USE_HTAGS = NO VERBATIM_HEADERS = YES +CLANG_ASSISTED_PARSING = YES +CLANG_OPTIONS = #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- @@ -185,12 +192,14 @@ HTML_FILE_EXTENSION = .html HTML_HEADER = HTML_FOOTER = HTML_STYLESHEET = +HTML_EXTRA_STYLESHEET = HTML_EXTRA_FILES = HTML_COLORSTYLE_HUE = 220 HTML_COLORSTYLE_SAT = 100 HTML_COLORSTYLE_GAMMA = 80 HTML_TIMESTAMP = YES HTML_DYNAMIC_SECTIONS = YES +HTML_INDEX_NUM_ENTRIES = 100 GENERATE_DOCSET = YES DOCSET_FEEDNAME = "Doxygen docs" DOCSET_BUNDLE_ID = org.doxygen.Doxygen @@ -221,10 +230,16 @@ EXT_LINKS_IN_WINDOW = NO FORMULA_FONTSIZE = 10 FORMULA_TRANSPARENT = YES USE_MATHJAX = NO +MATHJAX_FORMAT = HTML-CSS MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest MATHJAX_EXTENSIONS = SEARCHENGINE = YES SERVER_BASED_SEARCH = YES +EXTERNAL_SEARCH = NO +SEARCHENGINE_URL = +SEARCHDATA_FILE = searchdata.xml +EXTERNAL_SEARCH_ID = +EXTRA_SEARCH_MAPPINGS = #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- @@ -237,6 +252,7 @@ PAPER_TYPE = a4wide EXTRA_PACKAGES = LATEX_HEADER = LATEX_FOOTER = +LATEX_EXTRA_FILES = PDF_HYPERLINKS = YES USE_PDFLATEX = NO LATEX_BATCHMODE = NO @@ -268,6 +284,11 @@ XML_SCHEMA = XML_DTD = XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- +# configuration options related to the DOCBOOK output +#--------------------------------------------------------------------------- +GENERATE_DOCBOOK = NO +DOCBOOK_OUTPUT = docbook +#--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- GENERATE_AUTOGEN_DEF = NO @@ -285,7 +306,7 @@ ENABLE_PREPROCESSING = YES MACRO_EXPANSION = YES EXPAND_ONLY_PREDEF = YES SEARCH_INCLUDES = YES -INCLUDE_PATH = +INCLUDE_PATH = qtools libmd5 INCLUDE_FILE_PATTERNS = PREDEFINED = EXPAND_AS_DEFINED = @@ -297,6 +318,7 @@ TAGFILES = qtools_docs/qtools.tag=../../qtools_docs/html GENERATE_TAGFILE = doxygen.tag ALLEXTERNALS = NO EXTERNAL_GROUPS = YES +EXTERNAL_PAGES = YES PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool diff --git a/INSTALL b/INSTALL index 5f397ae..c24819c 100644 --- a/INSTALL +++ b/INSTALL @@ -1,7 +1,7 @@ -DOXYGEN Version 1.8.3.1-20130209 +DOXYGEN Version 1.8.3.1-20130324 Please read the installation section of the manual (http://www.doxygen.org/install.html) for instructions. -------- -Dimitri van Heesch (09 February 2013) +Dimitri van Heesch (24 March 2013) diff --git a/Makefile.in b/Makefile.in index 1cd4f16..9183aec 100644 --- a/Makefile.in +++ b/Makefile.in @@ -45,7 +45,7 @@ distclean: clean -rm -f Makefile qtools/Makefile src/Makefile examples/Makefile doc/Makefile -rm -f .makeconfig .tmakeconfig -rm -f src/doxygen.pro src/libdoxygen.pro qtools/qtools.pro src/libdoxycfg.pro libmd5/libmd5.pro - -rm -f src/version.cpp + -rm -f src/version.cpp -rm -r addon/doxywizard/Makefile -rm -f addon/doxywizard/doxywizard.pro -rm -f VERSION diff --git a/README b/README index f3fdb00..19253fe 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -DOXYGEN Version 1.8.3.1_20130209 +DOXYGEN Version 1.8.3.1_20130324 Please read INSTALL for compilation instructions. @@ -26,4 +26,4 @@ forum. Enjoy, -Dimitri van Heesch (dimitri@stack.nl) (09 February 2013) +Dimitri van Heesch (dimitri@stack.nl) (24 March 2013) diff --git a/addon/doxywizard/expert.cpp b/addon/doxywizard/expert.cpp index 4bbb104..cf33192 100644 --- a/addon/doxywizard/expert.cpp +++ b/addon/doxywizard/expert.cpp @@ -8,6 +8,7 @@ #include #include "config.h" #include "version.h" +#include "../../src/settings.h" #undef SA #define SA(x) QString::fromAscii(x) @@ -120,144 +121,148 @@ QWidget *Expert::createTopicWidget(QDomElement &elem) int row=0; while (!child.isNull()) { - QString type = child.attribute(SA("type")); - if (type==SA("bool")) + QString setting = child.attribute(SA("setting")); + if (setting.isEmpty() || IS_SUPPORTED(setting.toAscii())) { - InputBool *boolOption = + QString type = child.attribute(SA("type")); + if (type==SA("bool")) + { + InputBool *boolOption = new InputBool( - layout,row, + layout,row, + child.attribute(SA("id")), + child.attribute(SA("defval"))==SA("1"), + child.attribute(SA("docs")) + ); + m_options.insert( child.attribute(SA("id")), - child.attribute(SA("defval"))==SA("1"), - child.attribute(SA("docs")) - ); - m_options.insert( - child.attribute(SA("id")), - boolOption - ); - connect(boolOption,SIGNAL(showHelp(Input*)),SLOT(showHelp(Input*))); - connect(boolOption,SIGNAL(changed()),SIGNAL(changed())); - } - else if (type==SA("string")) - { - InputString::StringMode mode; - QString format = child.attribute(SA("format")); - if (format==SA("dir")) - { - mode = InputString::StringDir; - } - else if (format==SA("file")) - { - mode = InputString::StringFile; + boolOption + ); + connect(boolOption,SIGNAL(showHelp(Input*)),SLOT(showHelp(Input*))); + connect(boolOption,SIGNAL(changed()),SIGNAL(changed())); } - else // format=="string" + else if (type==SA("string")) { - mode = InputString::StringFree; - } - InputString *stringOption = + InputString::StringMode mode; + QString format = child.attribute(SA("format")); + if (format==SA("dir")) + { + mode = InputString::StringDir; + } + else if (format==SA("file")) + { + mode = InputString::StringFile; + } + else // format=="string" + { + mode = InputString::StringFree; + } + InputString *stringOption = new InputString( - layout,row, + layout,row, + child.attribute(SA("id")), + child.attribute(SA("defval")), + mode, + child.attribute(SA("docs")), + child.attribute(SA("abspath")) + ); + m_options.insert( child.attribute(SA("id")), - child.attribute(SA("defval")), - mode, - child.attribute(SA("docs")), - child.attribute(SA("abspath")) - ); - m_options.insert( - child.attribute(SA("id")), - stringOption - ); - connect(stringOption,SIGNAL(showHelp(Input*)),SLOT(showHelp(Input*))); - connect(stringOption,SIGNAL(changed()),SIGNAL(changed())); - } - else if (type==SA("enum")) - { - InputString *enumList = new InputString( + stringOption + ); + connect(stringOption,SIGNAL(showHelp(Input*)),SLOT(showHelp(Input*))); + connect(stringOption,SIGNAL(changed()),SIGNAL(changed())); + } + else if (type==SA("enum")) + { + InputString *enumList = new InputString( layout,row, child.attribute(SA("id")), child.attribute(SA("defval")), InputString::StringFixed, child.attribute(SA("docs")) - ); - QDomElement enumVal = child.firstChildElement(); - while (!enumVal.isNull()) - { - enumList->addValue(enumVal.attribute(SA("name"))); - enumVal = enumVal.nextSiblingElement(); + ); + QDomElement enumVal = child.firstChildElement(); + while (!enumVal.isNull()) + { + enumList->addValue(enumVal.attribute(SA("name"))); + enumVal = enumVal.nextSiblingElement(); + } + enumList->setDefault(); + + m_options.insert(child.attribute(SA("id")),enumList); + connect(enumList,SIGNAL(showHelp(Input*)),SLOT(showHelp(Input*))); + connect(enumList,SIGNAL(changed()),SIGNAL(changed())); } - enumList->setDefault(); - - m_options.insert(child.attribute(SA("id")),enumList); - connect(enumList,SIGNAL(showHelp(Input*)),SLOT(showHelp(Input*))); - connect(enumList,SIGNAL(changed()),SIGNAL(changed())); - } - else if (type==SA("int")) - { - InputInt *intOption = + else if (type==SA("int")) + { + InputInt *intOption = new InputInt( - layout,row, + layout,row, + child.attribute(SA("id")), + child.attribute(SA("defval")).toInt(), + child.attribute(SA("minval")).toInt(), + child.attribute(SA("maxval")).toInt(), + child.attribute(SA("docs")) + ); + m_options.insert( child.attribute(SA("id")), - child.attribute(SA("defval")).toInt(), - child.attribute(SA("minval")).toInt(), - child.attribute(SA("maxval")).toInt(), - child.attribute(SA("docs")) - ); - m_options.insert( - child.attribute(SA("id")), - intOption - ); - connect(intOption,SIGNAL(showHelp(Input*)),SLOT(showHelp(Input*))); - connect(intOption,SIGNAL(changed()),SIGNAL(changed())); - } - else if (type==SA("list")) - { - InputStrList::ListMode mode; - QString format = child.attribute(SA("format")); - if (format==SA("dir")) - { - mode = InputStrList::ListDir; - } - else if (format==SA("file")) - { - mode = InputStrList::ListFile; + intOption + ); + connect(intOption,SIGNAL(showHelp(Input*)),SLOT(showHelp(Input*))); + connect(intOption,SIGNAL(changed()),SIGNAL(changed())); } - else if (format==SA("filedir")) + else if (type==SA("list")) { - mode = InputStrList::ListFileDir; + InputStrList::ListMode mode; + QString format = child.attribute(SA("format")); + if (format==SA("dir")) + { + mode = InputStrList::ListDir; + } + else if (format==SA("file")) + { + mode = InputStrList::ListFile; + } + else if (format==SA("filedir")) + { + mode = InputStrList::ListFileDir; + } + else // format=="string" + { + mode = InputStrList::ListString; + } + QStringList sl; + QDomElement listVal = child.firstChildElement(); + while (!listVal.isNull()) + { + sl.append(listVal.attribute(SA("name"))); + listVal = listVal.nextSiblingElement(); + } + InputStrList *listOption = + new InputStrList( + layout,row, + child.attribute(SA("id")), + sl, + mode, + child.attribute(SA("docs")) + ); + m_options.insert( + child.attribute(SA("id")), + listOption + ); + connect(listOption,SIGNAL(showHelp(Input*)),SLOT(showHelp(Input*))); + connect(listOption,SIGNAL(changed()),SIGNAL(changed())); } - else // format=="string" + else if (type==SA("obsolete")) { - mode = InputStrList::ListString; + // ignore } - QStringList sl; - QDomElement listVal = child.firstChildElement(); - while (!listVal.isNull()) + else // should not happen { - sl.append(listVal.attribute(SA("name"))); - listVal = listVal.nextSiblingElement(); + printf("Unsupported type %s\n",qPrintable(child.attribute(SA("type")))); } - InputStrList *listOption = - new InputStrList( - layout,row, - child.attribute(SA("id")), - sl, - mode, - child.attribute(SA("docs")) - ); - m_options.insert( - child.attribute(SA("id")), - listOption - ); - connect(listOption,SIGNAL(showHelp(Input*)),SLOT(showHelp(Input*))); - connect(listOption,SIGNAL(changed()),SIGNAL(changed())); - } - else if (type==SA("obsolete")) - { - // ignore - } - else // should not happen - { - printf("Unsupported type %s\n",qPrintable(child.attribute(SA("type")))); - } + } // IS_SUPPORTED child = child.nextSiblingElement(); } diff --git a/configure b/configure index 65c5f25..5efb26a 100755 --- a/configure +++ b/configure @@ -20,7 +20,7 @@ doxygen_version_minor=8 doxygen_version_revision=3.1 #NOTE: Setting version_mmn to "NO" will omit mmn info from the package. -doxygen_version_mmn=20130209 +doxygen_version_mmn=20130324 bin_dirs=`echo $PATH | sed -e "s/:/ /g"` @@ -41,6 +41,7 @@ f_bison=NO f_search=NO f_langs=nl,sv,cz,fr,id,it,de,jp,je,es,fi,ru,hr,pl,pt,hu,kr,ke,ro,si,cn,no,mk,br,dk,sk,ua,gr,tw,sr,ca,lt,za,ar,fa,sc,vi,tr,eo,am f_sqlite3=NO +f_libclang=NO while test -n "$1"; do case $1 in @@ -101,6 +102,9 @@ while test -n "$1"; do --with-sqlite3 | -with-sqlite3) f_sqlite3=YES ;; + --with-libclang | -with-libclang) + f_libclang=YES + ;; -h | -help | --help) f_help=y ;; @@ -152,6 +156,7 @@ Options: --enable-langs list Include support for output languages listed in list. [default: $f_langs] --with-sqlite3 Add support for sqlite3 output [experimental] + --with-libclang Add support for libclang parsing [experimental] --with-doxywizard Build the GUI frontend for doxygen. This requires Qt version 4. --with-doxysearch Build external search tools (doxysearch and doxyindexer) @@ -270,7 +275,7 @@ if test -z "$f_docdir"; then fi if test "$f_plf_auto" = NO; then - echo -n " Checking for platform $f_platform... " + printf " Checking for platform $f_platform... " if test '!' -d tmake/lib/$f_platform; then echo "not supported!" echo @@ -284,7 +289,7 @@ fi if test "$f_wizard" = YES; then if test -z "$QTDIR"; then echo " QTDIR environment variable not set!" - echo -n " Checking for Qt..." + printf " Checking for Qt..." for d in /usr/{lib,share,qt}/{qt-4,qt4,qt,qt*,4} /usr; do if test -x "$d/bin/qmake"; then QTDIR=$d @@ -292,7 +297,7 @@ if test "$f_wizard" = YES; then done else echo " Detected Qt via the QTDIR environment variable..." - echo -n " " + printf " " fi if test -z "$QTDIR"; then echo "QTDIR not set and Qt not found at standard locations!" @@ -307,7 +312,7 @@ fi if test "$f_search" = YES; then if test -z "$XAPIAN"; then - echo -n " Checking for Xapian..." + printf " Checking for Xapian..." for d in /usr /usr/local /opt/local; do if test -e "$d/include/xapian.h"; then XAPIAN=$d @@ -322,7 +327,7 @@ fi # - check for make ------------------------------------------------------------ -echo -n " Checking for GNU make tool... " +printf " Checking for GNU make tool... " if test "$f_make" = NO; then make_names="gmake make" make_dirs="$bin_dirs /usr/bin /usr/local/bin /bin /sbin" @@ -349,7 +354,7 @@ echo "using $f_make" # - check for install ------------------------------------------------------------ -echo -n " Checking for GNU install tool... " +printf " Checking for GNU install tool... " if test "$f_insttool" = NO; then install_names="ginstall install" install_dirs="$bin_dirs /usr/bin /usr/local/bin /bin /sbin /usr/ucb" @@ -386,7 +391,7 @@ echo "using $f_insttool"; # - check for dot ------------------------------------------------------------ -echo -n " Checking for dot (part of GraphViz)... " +printf " Checking for dot (part of GraphViz)... " if test "$f_dot" = NO; then dot_dirs="$bin_dirs /usr/bin /usr/local/bin /bin /sbin" dot_prog=NO @@ -408,7 +413,7 @@ fi # - check for sqlite3 --------------------------------------------------------- if test "$f_sqlite3" = YES; then - echo -n " Checking for sqlite3 ... " + printf " Checking for sqlite3 ... " sqlite3_hdr_dir="/usr/include /usr/local/include /opt/local/include" sqlite3_lib_dir="/usr/lib /usr/local/lib /opt/local/lib" sqlite3_lib_name="libsqlite3.so libsqlite3.dylib libsqlite3.a" @@ -439,10 +444,43 @@ if test "$f_sqlite3" = YES; then fi fi +# - check for libclang --------------------------------------------------------- + +if test "$f_libclang" = YES; then + printf " Checking for libclang ... " + libclang_hdr_dir="/usr/include /usr/local/include /opt/local/include" + libclang_lib_dir="/usr/lib /usr/local/lib /opt/local/lib" + libclang_lib_name="libclang.so libclang.dylib libclang.a" + libclang_hdr=NO + libclang_lib=NO + libclang_link= + for j in $libclang_hdr_dir; do + if test -f "$j/clang-c/Index.h"; then + libclang_hdr="$j/clang-c/Index.h" + break + fi + done + for i in $libclang_lib_dir; do + if test "$libclang_lib" = NO; then + for j in $libclang_lib_name; do + if test -f "$i/$j"; then + libclang_lib="$i/$j" + libclang_link="-L $i -lclang" + break + fi + done + fi + done + if test "$libclang_hdr" = NO -o "$libclang_lib" = NO; then + echo "not found!"; + else + echo "using header $libclang_hdr and library $libclang_lib..."; + fi +fi # - check for perl ------------------------------------------------------------ -echo -n " Checking for perl... " +printf " Checking for perl... " if test "$f_perl" = NO; then perl_names="perl perl5" perl_dirs="$bin_dirs /usr/bin /usr/local/bin /bin /sbin" @@ -475,7 +513,7 @@ echo "using $f_perl"; # - check for flex ------------------------------------------------------------ -echo -n " Checking for flex... " +printf " Checking for flex... " if test "$f_flex" = NO; then flex_dirs="$bin_dirs /usr/bin /usr/local/bin /bin" flex_prog=NO @@ -499,7 +537,7 @@ fi # - check for bison ------------------------------------------------------------ -echo -n " Checking for bison... " +printf " Checking for bison... " if test "$f_bison" = NO; then bison_dirs="$bin_dirs /usr/bin /usr/local/bin /bin" bison_prog=NO @@ -739,7 +777,7 @@ EOF #if test "$f_thread" = YES; then # realopts="$realopts thread" #fi - cat $SRC .tmakeconfig | sed -e "s/\$extraopts/$realopts/g" -e "s;%%SQLITE3_LIBS%%;$sqlite3_link;g" >> $DST + cat $SRC .tmakeconfig | sed -e "s/\$extraopts/$realopts/g" -e "s;%%SQLITE3_LIBS%%;$sqlite3_link;g" -e "s;%%LIBCLANG_LIBS%%;$libclang_link;g" >> $DST echo " Created $DST from $SRC..." done @@ -768,10 +806,22 @@ fi echo " Generating src/settings.h..." echo "#ifndef SETTINGS_H" > src/settings.h echo "#define SETTINGS_H" >> src/settings.h +echo "" >> src/settings.h if test "$f_sqlite3" != NO; then -echo "#define USE_SQLITE3 1" >> src/settings.h +echo "#define USE_SQLITE3 1" >> src/settings.h else -echo "#define USE_SQLITE3 0" >> src/settings.h +echo "#define USE_SQLITE3 0" >> src/settings.h fi +if test "$f_libclang" != NO; then +echo "#define USE_LIBCLANG 1" >> src/settings.h +else +echo "#define USE_LIBCLANG 0" >> src/settings.h +fi +echo "" >> src/settings.h +echo "#define IS_SUPPORTED(x) \\" >> src/settings.h +echo " ((USE_SQLITE3 && strcmp(\"USE_SQLITE3\",(x))==0) || \\" >> src/settings.h +echo " (USE_LIBCLANG && strcmp(\"USE_LIBCLANG\",(x))==0) || \\" >> src/settings.h +echo " 0)" >> src/settings.h +echo "" >> src/settings.h echo "#endif" >> src/settings.h echo diff --git a/doc/arch.doc b/doc/arch.doc index 4e756b2..c68d2f8 100644 --- a/doc/arch.doc +++ b/doc/arch.doc @@ -237,6 +237,10 @@ utime $now, $now, $file \endverbatim +\htmlonly +Return to the index. +\endhtmlonly + */ diff --git a/doc/autolink.doc b/doc/autolink.doc index f0e7f87..3c50435 100644 --- a/doc/autolink.doc +++ b/doc/autolink.doc @@ -131,4 +131,10 @@ typedef struct StructName TypeName Click here for the corresponding HTML documentation that is generated by Doxygen. \endhtmlonly + +\htmlonly +Go to the next section or return to the + index. +\endhtmlonly + */ diff --git a/doc/commands.doc b/doc/commands.doc index 2f30979..cb59feb 100644 --- a/doc/commands.doc +++ b/doc/commands.doc @@ -2909,5 +2909,11 @@ browser generator. Do \e not use these commands in your own documentation.
+ +\htmlonly +Go to the next section or return to the + index. +\endhtmlonly + */ diff --git a/doc/config.doc b/doc/config.doc index 15912a7..8ceef96 100644 --- a/doc/config.doc +++ b/doc/config.doc @@ -2840,5 +2840,11 @@ Here doxygen's preprocessor is used to substitute some macro names that are normally substituted by the C preprocessor, but without doing full macro expansion. + +\htmlonly +Go to the next section or return to the + index. +\endhtmlonly + */ diff --git a/doc/custcmd.doc b/doc/custcmd.doc index c4ec3ac..70d52e4 100644 --- a/doc/custcmd.doc +++ b/doc/custcmd.doc @@ -122,4 +122,11 @@ which will expand to \endverbatim +\htmlonly +
+Go to the next section or return to the + index. +\endhtmlonly + + */ diff --git a/doc/customize.doc b/doc/customize.doc index 158de5b..6e321bd 100644 --- a/doc/customize.doc +++ b/doc/customize.doc @@ -392,4 +392,10 @@ See the Breathe project fo a example that uses doxygen XML output from Python to bridge it with the Sphinx document generator. + +\htmlonly +Go to the next section or return to the + index. +\endhtmlonly + */ diff --git a/doc/diagrams.doc b/doc/diagrams.doc index 00d1415..ec9f329 100644 --- a/doc/diagrams.doc +++ b/doc/diagrams.doc @@ -133,15 +133,15 @@ that doxygen can generate: diagrams_e.h \verbinclude diagrams_e.h - \htmlonly - Click here - for the corresponding HTML documentation that is generated by doxygen
- (EXTRACT_ALL = YES is used here).

- \endhtmlonly +\htmlonly +Click here +for the corresponding HTML documentation that is generated by doxygen
+(EXTRACT_ALL = YES is used here). +\endhtmlonly \htmlonly Go to the next section or return to the - index. +index. \endhtmlonly */ diff --git a/doc/docblocks.doc b/doc/docblocks.doc index 4af0386..0363e7e 100644 --- a/doc/docblocks.doc +++ b/doc/docblocks.doc @@ -429,11 +429,6 @@ Since python looks more like Java than like C or C++, you should set config file. -\htmlonly -Go to the next section or return to the - index. -\endhtmlonly - \subsection vhdlblocks Comment blocks in VHDL For VHDL a comment normally start with "--". Doxygen will extract comments @@ -554,10 +549,6 @@ Following is a example using doxygen style comments: for the corresponding HTML documentation that is generated by doxygen. \endhtmlonly -\htmlonly -Go to the next section or return to the - index. -\endhtmlonly \section docstructure Anatomy of a comment block diff --git a/doc/doxygen_usage.doc b/doc/doxygen_usage.doc index 59cef23..430846a 100644 --- a/doc/doxygen_usage.doc +++ b/doc/doxygen_usage.doc @@ -71,15 +71,19 @@ doxygen -w html header.html footer.html stylesheet.css a file named Doxyfile and process that. When this is also not found it will used the default settings. -

  • For LaTeX output, you can generate the first part of \c refman.tex - (see \ref cfg_latex_header "LATEX_HEADER") and the style sheet included - by that header (normally doxygen.sty), using: +
  • For LaTeX output, you can generate the first and last part of \c refman.tex + (see \ref cfg_latex_header "LATEX_HEADER" and + \ref cfg_latex_footer "LATEX_FOOTER") and the style sheet included + by that header (normally doxygen.sty), using the following + command: \verbatim -doxygen -w latex header.tex doxygen.sty +doxygen -w latex header.tex footer.tex doxygen.sty \endverbatim -If you need non-default options (for instance to use pdflatex) you need -to make a config file with those options set correctly and then specify -that config file as the third argument. +If you need non-default options (for instance to use extra latex packages) +you need to make a config file with those options set correctly and then specify +that config file after the generated files (make a backup of the configuration +file first so you don't loose it in case you forget to specify one of the +output files).
  • For RTF output, you can generate the default style sheet file (see \ref cfg_rtf_stylesheet_file "RTF_STYLESHEET_FILE") using: \verbatim @@ -103,4 +107,10 @@ doxygen -w rtf rtfstyle.cfg a file, use \c - for the file name. + +\htmlonly +Go to the next section or return to the + index. +\endhtmlonly + */ diff --git a/doc/doxywizard_usage.doc b/doc/doxywizard_usage.doc index ffe95f2..6ae8373 100644 --- a/doc/doxywizard_usage.doc +++ b/doc/doxywizard_usage.doc @@ -135,4 +135,10 @@ The GUI front-end has a menu with a couple of useful items You will be asked to confirm the action. + +\htmlonly +Go to the next section or return to the + index. +\endhtmlonly + */ diff --git a/doc/extsearch.doc b/doc/extsearch.doc index d69b36e..e636b1a 100644 --- a/doc/extsearch.doc +++ b/doc/extsearch.doc @@ -304,4 +304,10 @@ The fields for such an item have the following meaning: These words should be wrapped in `` and `` tags to highlight them in the output. + +\htmlonly +Go to the next section or return to the + index. +\endhtmlonly + */ diff --git a/doc/features.doc b/doc/features.doc index aa106f3..3b55ccd 100644 --- a/doc/features.doc +++ b/doc/features.doc @@ -113,4 +113,10 @@ members or classes belonging to the Qt toolkit, a link will be generated to the Qt documentation. This is done independent of where this documentation is located! + +\htmlonly +Go to the next section or return to the + index. +\endhtmlonly + */ diff --git a/doc/grouping.doc b/doc/grouping.doc index c6b40dc..d7f6275 100644 --- a/doc/grouping.doc +++ b/doc/grouping.doc @@ -199,11 +199,6 @@ Here Group1 is displayed as a subsection of the "Public Members". And Group2 is a separate section because it contains members with different protection levels (i.e. public and protected). -\htmlonly -Go to the next section or return to the - index. -\endhtmlonly - \section subpaging Subpaging Information can be grouped into pages using the \ref cmdpage "\\page" and diff --git a/doc/htmlcmds.doc b/doc/htmlcmds.doc index e2a9514..66018d3 100644 --- a/doc/htmlcmds.doc +++ b/doc/htmlcmds.doc @@ -216,4 +216,11 @@ comments can be used: /*! Visible text */ \endverbatim + +\htmlonly +
    +Go to the next section or return to the + index. +\endhtmlonly + */ diff --git a/doc/index.doc b/doc/index.doc index 03c6456..f36e295 100644 --- a/doc/index.doc +++ b/doc/index.doc @@ -194,5 +194,10 @@ Thanks go to: providing hours of great music to listen to while coding.
  • many, many others for suggestions, patches and bug reports. + +\htmlonly +Go to the next section. +\endhtmlonly + */ diff --git a/doc/install.doc b/doc/install.doc index bbc0d13..566baac 100644 --- a/doc/install.doc +++ b/doc/install.doc @@ -46,12 +46,12 @@ tools should be installed.
    • Qt Software's GUI toolkit - Qt + Qt \addindex Qt version 4.3 or higher. This is needed to build the GUI front-end doxywizard.
    • A \f$\mbox{\LaTeX}\f$ distribution: for instance - teTeX 1.0 + TeX Live This is needed for generating LaTeX, Postscript, and PDF output.
    • the Graph visualization toolkit version 1.8.10 or higher @@ -536,7 +536,7 @@ install LaTeX and For LaTeX a number of distributions exists. Popular ones that should work with doxygen are MikTex -and XemTex. +and proTeXt. Ghostscript can be downloaded from Sourceforge. @@ -616,16 +616,12 @@ features: Doxygen was developed and tested under Linux & MacOSX using the following open-source tools:
        -
      • GCC version 3.3.6 (Linux) and 4.0.1 (MacOSX) -
      • GNU flex version 2.5.33 (Linux) and 2.5.4 (MacOSX) -
      • GNU bison version 1.75 -
      • GNU make version 3.80 -
      • Perl version 5.8.1 -
      • VIM version 6.2 -
      • Firefox 1.5 -
      • Trolltech's tmake version 1.3 (included in the distribution) -
      • teTeX version 2.0.2 -
      • CVS 1.12.12 +
      • GCC version 4.6.3 (Linux) and 4.2.1 (MacOSX) +
      • GNU flex version 2.5.35 +
      • GNU bison version 2.5 (Linux) and 2.3 (MacOSX) +
      • GNU make version 3.81 +
      • Perl version 5.12 +
      • TeX Live 2009 (or later)
      \htmlonly diff --git a/doc/language.doc b/doc/language.doc index da5aaa6..7321fbe 100644 --- a/doc/language.doc +++ b/doc/language.doc @@ -23,15 +23,15 @@ text fragments, generated by doxygen, can be produced in languages other than English (the default). The output language is chosen through the configuration file (with default name and known as Doxyfile). -Currently (version 1.8.3), 39 languages +Currently (version 1.8.3.1), 40 languages are supported (sorted alphabetically): Afrikaans, Arabic, Armenian, Brazilian Portuguese, Catalan, Chinese, Chinese Traditional, Croatian, Czech, Danish, Dutch, English, Esperanto, Finnish, French, German, Greek, Hungarian, Indonesian, -Italian, Japanese (+En), Korean (+En), Latvian, Lithuanian, Macedonian, -Norwegian, Persian, Polish, Portuguese, Romanian, Russian, Serbian, -SerbianCyrilic, Slovak, Slovene, Spanish, Swedish, Turkish, Ukrainian, -and Vietnamese.. +Italian, Japanese (+En), Korean (+En), Latvian, Lithuanian, +Macedonian, Norwegian, Persian, Polish, Portuguese, Romanian, Russian, +Serbian, SerbianCyrilic, Slovak, Slovene, Spanish, Swedish, Turkish, +Ukrainian, and Vietnamese.. The table of information related to the supported languages follows. It is sorted by language alphabetically. The Status column @@ -197,6 +197,12 @@ when the translator was updated. English based + Latvian + Lauris + lauris at nix.lv + up-to-date + + Lithuanian Tomas Simonaitis
      Mindaugas Radzius
      Aidas Berukstis
      -- searching for the maintainer -- [unreachable]
      [unreachable]
      [unreachable]
      [Please, try to help to find someone.] @@ -288,9 +294,9 @@ when the translator was updated. Ukrainian - Olexij Tkatchenko
      -- searching for the maintainer -- - [resigned]
      [Please, try to help to find someone.] - 1.4.1 + Olexij Tkatchenko
      Petro Yermolenko + [resigned]
      python at i dot ua + up-to-date Vietnamese @@ -309,7 +315,7 @@ when the translator was updated. \latexonly \footnotesize \begin{longtable}{|l|l|l|l|} - \hline + \hline {\bf Language} & {\bf Maintainer} & {\bf Contact address} & {\bf Status} \\ \hline @@ -377,6 +383,8 @@ when the translator was updated. \hline KoreanEn & see the Korean language & {\tt\tiny ~} & English based \\ \hline + Latvian & Lauris & {\tt\tiny lauris at nix.lv} & up-to-date \\ + \hline Lithuanian & Tomas Simonaitis & {\tt\tiny [unreachable] haden at homelan dot lt} & 1.4.6 \\ ~ & Mindaugas Radzius & {\tt\tiny [unreachable] mindaugasradzius at takas dot lt} & ~ \\ ~ & Aidas Berukstis & {\tt\tiny [unreachable] aidasber at takas dot lt} & ~ \\ @@ -417,8 +425,8 @@ when the translator was updated. \hline Turkish & Emin Ilker Cetinbas & {\tt\tiny niw3 at yahoo dot com} & 1.7.5 \\ \hline - Ukrainian & Olexij Tkatchenko & {\tt\tiny [resigned] olexij at tkatchenko dot com} & 1.4.1 \\ - ~ & -- searching for the maintainer -- & {\tt\tiny [Please, try to help to find someone.]} & ~ \\ + Ukrainian & Olexij Tkatchenko & {\tt\tiny [resigned] olexij at tkatchenko dot com} & up-to-date \\ + ~ & Petro Yermolenko & {\tt\tiny python at i dot ua} & ~ \\ \hline Vietnamese & Dang Minh Tuan & {\tt\tiny tuanvietkey at gmail dot com} & 1.6.0 \\ \hline diff --git a/doc/maintainers.txt b/doc/maintainers.txt index 2f9651b..306b123 100644 --- a/doc/maintainers.txt +++ b/doc/maintainers.txt @@ -157,7 +157,7 @@ Emin Ilker Cetinbas: niw3 at yahoo dot com TranslatorUkrainian Olexij Tkatchenko: [resigned] olexij at tkatchenko dot com --- searching for the maintainer --: [Please, try to help to find someone.] +Petro Yermolenko: python at i dot ua TranslatorVietnamese Dang Minh Tuan: tuanvietkey at gmail dot com diff --git a/doc/output.doc b/doc/output.doc index dea8753..752123b 100644 --- a/doc/output.doc +++ b/doc/output.doc @@ -61,4 +61,10 @@ The following output formats are \e indirectly supported by doxygen: \ref cfg_pdf_hyperlinks "PDF_HYPERLINKS". + +\htmlonly +Go to the next section or return to the + index. +\endhtmlonly + */ diff --git a/doc/perlmod.doc b/doc/perlmod.doc index b375e15..00bff63 100644 --- a/doc/perlmod.doc +++ b/doc/perlmod.doc @@ -190,4 +190,10 @@ you can look at the Perl scripts generated by Doxygen (such as doxylatex.pl or doxytemplate-latex.pl) to get an idea on how to use DoxyModel.pm. + +\htmlonly +Go to the next section or return to the + index. +\endhtmlonly + */ diff --git a/doc/perlmod_tree.doc b/doc/perlmod_tree.doc index be71315..a936320 100644 --- a/doc/perlmod_tree.doc +++ b/doc/perlmod_tree.doc @@ -374,4 +374,10 @@ The meaning of each node in the documentation tree is as follows:
    + +\htmlonly +Go to the next section or return to the + index. +\endhtmlonly + */ diff --git a/doc/preprocessing.doc b/doc/preprocessing.doc index aac389e..f480780 100644 --- a/doc/preprocessing.doc +++ b/doc/preprocessing.doc @@ -96,6 +96,15 @@ PREDEFINED = __declspec(x)= This will make sure the __declspec(dllexport) is removed before doxygen parses the source code. +Similar settings can be used for removing __attribute__ expressions from the input: + +\verbatim +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = YES +EXPAND_ONLY_PREDEF = YES +PREDEFINED = __attribute__(x)= +\endverbatim + For a more complex example, suppose you have the following obfuscated code fragment of an abstract base class called \c IUnknown: @@ -256,7 +265,7 @@ preprocessing has been done (Hint: set QUIET = YES and output). \htmlonly -Go to the next section or return to the +Go to the next section or return to the index. \endhtmlonly diff --git a/doc/searching.doc b/doc/searching.doc index ed5e48c..9d3261e 100644 --- a/doc/searching.doc +++ b/doc/searching.doc @@ -185,4 +185,10 @@ has its own advantages and disadvantages: Qt compressed help or CHM output, but it does require that Eclipse is installed and running. + +\htmlonly +Go to the next section or return to the + index. +\endhtmlonly + */ diff --git a/doc/translator.py b/doc/translator.py index 5a78ee2..816482b 100644 --- a/doc/translator.py +++ b/doc/translator.py @@ -4,25 +4,25 @@ related to internationalization (the translator classes). It uses the information to generate documentation (language.doc, translator_report.txt) from templates (language.tpl, maintainers.txt). - + Simply run the script without parameters to get the reports and documentation for all supported languages. If you want to generate the translator report only for some languages, pass their codes as arguments to the script. In that case, the language.doc will not be generated. Example: - + python translator.py en nl cz - + Originally, the script was written in Perl and was known as translator.pl. The last Perl version was dated 2002/05/21 (plus some later corrections) $Id$ - + Petr Prikryl (prikrylp@skil.cz) - + History: -------- - 2002/05/21 - This was the last Perl version. + 2002/05/21 - This was the last Perl version. 2003/05/16 - List of language marks can be passed as arguments. 2004/01/24 - Total reimplementation started: classes TrManager, and Transl. 2004/02/05 - First version that produces translator report. No language.doc yet. @@ -46,7 +46,7 @@ 2004/10/04 - Reporting of not called translator methods added. 2004/10/05 - Modified to check only doxygen/src sources for the previous report. 2005/02/28 - Slight modification to generate "mailto.txt" auxiliary file. - 2005/08/15 - Doxygen's root directory determined primarily from DOXYGEN + 2005/08/15 - Doxygen's root directory determined primarily from DOXYGEN environment variable. When not found, then relatively to the script. 2007/03/20 - The "translate me!" searched in comments and reported if found. 2008/06/09 - Warning when the MAX_DOT_GRAPH_HEIGHT is still part of trLegendDocs(). @@ -62,7 +62,8 @@ 2010/08/30 - Highlighting in what will be the table in langhowto.html modified. 2010/09/27 - The underscore in \latexonly part of the generated language.doc was prefixed by backslash (was LaTeX related error). - """ + 2013/02/19 - Better diagnostics when translator_xx.h is too crippled. + """ from __future__ import generators import codecs @@ -73,16 +74,16 @@ import sys def fill(s): """Returns string formated to the wrapped paragraph multiline string. - + Replaces whitespaces by one space and then uses he textwrap.fill().""" - + # Replace all whitespace by spaces, remove whitespaces that are not - # necessary, strip the left and right whitespaces, and break the string + # necessary, strip the left and right whitespaces, and break the string # to list of words. rexWS = re.compile(r'\s+') lst = rexWS.sub(' ', s).strip().split() - - # If the list is not empty, put the words together and form the lines + + # If the list is not empty, put the words together and form the lines # of maximum 70 characters. Build the list of lines. lines = [] if lst: @@ -96,17 +97,17 @@ def fill(s): lines.append(line) # the last line return '\n'.join(lines) - + # The following function dedent() is the verbatim copy from the textwrap.py # module. The textwrap.py was introduced in Python 2.3. To make this script -# working also in older Python versions, I have decided to copy it. +# working also in older Python versions, I have decided to copy it. # Notice that the textwrap.py is copyrighted: # # Copyright (C) 1999-2001 Gregory P. Ward. # Copyright (C) 2002, 2003 Python Software Foundation. # Written by Greg Ward # -# The explicit permission to use the code here was sent by Guido van Rossum +# The explicit permission to use the code here was sent by Guido van Rossum # (4th June, 2004). # def dedent(text): @@ -147,29 +148,29 @@ def dedent(text): lines[i] = lines[i][margin:] return '\n'.join(lines) - + class Transl: """One instance is build for each translator. - + The abbreviation of the source file--part after 'translator_'--is used as the identification of the object. The empty string is used for the abstract Translator class from translator.h. The other information is extracted from inside the source file.""" - + def __init__(self, fname, manager): """Bind to the manager and initialize.""" - + # Store the filename and the reference to the manager object. self.fname = fname self.manager = manager - + # The instance is responsible for loading the source file, so it checks # for its existence and quits if something goes wrong. if not os.path.isfile(fname): sys.stderr.write("\a\nFile '%s' not found!\n" % fname) sys.exit(1) - + # Initialize the other collected information. self.classId = None self.baseClassId = None @@ -186,11 +187,11 @@ class Transl: self.missingMethods = None # list of prototypes to be implemented self.implementedMethods = None # list of implemented required methods self.adaptMinClass = None # The newest adapter class that can be used - self.isDecodedTranslator = None # Flag related to internal usage of UTF-8 - + self.isDecodedTranslator = None # Flag related to internal usage of UTF-8 + def __tokenGenerator(self): """Generator that reads the file and yields tokens as 4-tuples. - + The tokens have the form (tokenId, tokenString, lineNo). The last returned token has the form ('eof', None, None). When trying to access next token afer that, the exception would be raised.""" @@ -205,14 +206,14 @@ class Transl: 'private': 'private', 'static': 'static', 'virtual': 'virtual', - ':': 'colon', + ':': 'colon', ';': 'semic', ',': 'comma', - '[': 'lsqbra', + '[': 'lsqbra', ']': 'rsqbra', - '(': 'lpar', + '(': 'lpar', ')': 'rpar', - '{': 'lcurly', + '{': 'lcurly', '}': 'rcurly', '=': 'assign', '*': 'star', @@ -230,7 +231,7 @@ class Transl: '~': 'tilde', '^': 'caret', } - + # Regular expression for recognizing identifiers. rexId = re.compile(r'^[a-zA-Z]\w*$') @@ -241,14 +242,14 @@ class Transl: line = '' # init -- see the pos initialization below linelen = 0 # init pos = 100 # init -- pos after the end of line - status = 0 - + status = 0 + tokenId = None # init tokenStr = '' # init -- the characters will be appended. tokenLineNo = 0 while status != 777: - + # Get the next character. Read next line first, if necessary. if pos < linelen: c = line[pos] @@ -263,18 +264,18 @@ class Transl: status = 777 else: c = line[pos] - + # Consume the character based on the status if status == 0: # basic status - + # This is the initial status. If tokenId is set, yield the # token here and only here (except when eof is found). # Initialize the token variables after the yield. if tokenId: # If it is an unknown item, it can still be recognized # here. Keywords and separators are the example. - if tokenId == 'unknown': + if tokenId == 'unknown': if tokenDic.has_key(tokenStr): tokenId = tokenDic[tokenStr] elif tokenStr.isdigit(): @@ -283,28 +284,28 @@ class Transl: tokenId = 'id' else: msg = '\aWarning: unknown token "' + tokenStr + '"' - msg += '\tfound on line %d' % tokenLineNo + msg += '\tfound on line %d' % tokenLineNo msg += ' in "' + self.fname + '".\n' sys.stderr.write(msg) - + yield (tokenId, tokenStr, tokenLineNo) - # If it is a comment that contains the self.translateMeText + # If it is a comment that contains the self.translateMeText # string, set the flag -- the situation will be reported. if tokenId == 'comment' and tokenStr.find(self.translateMeText) >= 0: self.translateMeFlag = True - + tokenId = None tokenStr = '' - tokenLineNo = 0 - + tokenLineNo = 0 + # Now process the character. When we just skip it (spaces), # stay in this status. All characters that will be part of # some token cause moving to the specific status. And only - # when moving to the status == 0 (or the final state 777), + # when moving to the status == 0 (or the final state 777), # the token is yielded. With respect to that the automaton - # behaves as Moore's one (output bound to status). When - # collecting tokens, the automaton is the Mealy's one + # behaves as Moore's one (output bound to status). When + # collecting tokens, the automaton is the Mealy's one # (actions bound to transitions). if c.isspace(): pass # just skip whitespace characters @@ -328,7 +329,7 @@ class Transl: tokenStr = c tokenLineNo = lineNo status = 8 - elif tokenDic.has_key(c): # known one-char token + elif tokenDic.has_key(c): # known one-char token tokenId = tokenDic[c] tokenStr = c tokenLineNo = lineNo @@ -338,30 +339,30 @@ class Transl: tokenStr = c tokenLineNo = lineNo status = 333 - + pos += 1 # move position in any case - + elif status == 1: # possibly a comment if c == '/': # ... definitely the C++ comment tokenId = 'comment' tokenStr += c - pos += 1 + pos += 1 status = 2 elif c == '*': # ... definitely the C comment tokenId = 'comment' tokenStr += c - pos += 1 + pos += 1 status = 3 else: status = 0 # unrecognized, don't move pos - + elif status == 2: # inside the C++ comment if c == '\n': # the end of C++ comment status = 0 # yield the token else: tokenStr += c # collect the C++ comment pos += 1 - + elif status == 3: # inside the C comment if c == '*': # possibly the end of the C comment tokenStr += c @@ -387,7 +388,7 @@ class Transl: else: tokenStr += c # collect the preproc pos += 1 - + elif status == 6: # inside the string if c == '\\': # escaped char inside the string tokenStr += c @@ -398,17 +399,17 @@ class Transl: else: tokenStr += c # collect the chars of the string pos += 1 - + elif status == 7: # escaped char inside the string tokenStr += c # collect the char of the string status = 6 pos += 1 - + elif status == 8: # inside the char literal tokenStr += c # collect the char of the literal status = 9 pos += 1 - + elif status == 9: # end of char literal expected if c == "'": # ... and found tokenStr += c @@ -428,32 +429,32 @@ class Transl: else: tokenStr += c # collect pos += 1 - - # We should have finished in the final status. If some token + + # We should have finished in the final status. If some token # have been extracted, yield it first. assert(status == 777) if tokenId: yield (tokenId, tokenStr, tokenLineNo) tokenId = None tokenStr = '' - tokenLineNo = 0 + tokenLineNo = 0 - # The file content is processed. Close the file. Then always yield + # The file content is processed. Close the file. Then always yield # the eof token. f.close() yield ('eof', None, None) - - + + def __collectClassInfo(self, tokenIterator): """Collect the information about the class and base class. - + The tokens including the opening left curly brace of the class are consumed.""" - + status = 0 # initial state - + while status != 777: # final state - + # Always assume that the previous tokens were processed. Get # the next one. tokenId, tokenStr, tokenLineNo = tokenIterator.next() @@ -462,14 +463,14 @@ class Transl: if status == 0: # waiting for the 'class' keyword. if tokenId == 'class': status = 1 - + elif status == 1: # expecting the class identification if tokenId == 'id': self.classId = tokenStr status = 2 else: self.__unexpectedToken(status, tokenId, tokenLineNo) - + elif status == 2: # expecting the curly brace or base class info if tokenId == 'lcurly': status = 777 # correctly finished @@ -477,20 +478,20 @@ class Transl: status = 3 else: self.__unexpectedToken(status, tokenId, tokenLineNo) - + elif status == 3: # expecting the 'public' in front of base class id if tokenId == 'public': status = 4 else: self.__unexpectedToken(status, tokenId, tokenLineNo) - + elif status == 4: # expecting the base class id if tokenId == 'id': self.baseClassId = tokenStr status = 5 else: self.__unexpectedToken(status, tokenId, tokenLineNo) - + elif status == 5: # expecting the curly brace and quitting if tokenId == 'lcurly': status = 777 # correctly finished @@ -498,7 +499,7 @@ class Transl: pass else: self.__unexpectedToken(status, tokenId, tokenLineNo) - + # Extract the status of the TranslatorXxxx class. The readable form # will be used in reports the status form is a string that can be # compared lexically (unified length, padding with zeros, etc.). @@ -523,13 +524,13 @@ class Transl: else: self.readableStatus = 'obsolete' self.status = '0.0.00' - + # Check whether status was set, or set 'strange'. - if self.status == None: + if self.status == None: self.status = 'strange' - if not self.readableStatus: + if not self.readableStatus: self.readableStatus = 'strange' - + # Extract the name of the language and the readable form. self.lang = self.classId[10:] # without 'Translator' if self.lang == 'Brazilian': @@ -538,11 +539,11 @@ class Transl: self.langReadable = 'Chinese Traditional' else: self.langReadable = self.lang - + def __unexpectedToken(self, status, tokenId, tokenLineNo): """Reports unexpected token and quits with exit code 1.""" - + import inspect calledFrom = inspect.stack()[1][3] msg = "\a\nUnexpected token '%s' on the line %d in '%s'.\n" @@ -550,25 +551,25 @@ class Transl: msg += 'status = %d in %s()\n' % (status, calledFrom) sys.stderr.write(msg) sys.exit(1) - - + + def collectPureVirtualPrototypes(self): """Returns dictionary 'unified prototype' -> 'full prototype'. The method is expected to be called only for the translator.h. It extracts only the pure virtual method and build the dictionary where key is the unified prototype without argument identifiers.""" - + # Prepare empty dictionary that will be returned. resultDic = {} - + # Start the token generator which parses the class source file. tokenIterator = self.__tokenGenerator() # Collect the class and the base class identifiers. self.__collectClassInfo(tokenIterator) assert(self.classId == 'Translator') - + # Let's collect readable form of the public virtual pure method # prototypes in the readable form -- as defined in translator.h. # Let's collect also unified form of the same prototype that omits @@ -576,7 +577,7 @@ class Transl: # identifiers. prototype = '' # readable prototype (with everything) uniPrototype = '' # unified prototype (without arg. identifiers) - + # Collect the pure virtual method prototypes. Stop on the closing # curly brace followed by the semicolon (end of class). status = 0 @@ -584,21 +585,21 @@ class Transl: # Loop until the final state 777 is reached. The errors are processed # immediately. In this implementation, it always quits the application. - while status != 777: - + while status != 777: + # Get the next token. tokenId, tokenStr, tokenLineNo = tokenIterator.next() - + if status == 0: # waiting for 'public:' if tokenId == 'public': status = 1 - + elif status == 1: # colon after the 'public' if tokenId == 'colon': status = 2 else: self.__unexpectedToken(status, tokenId, tokenLineNo) - + elif status == 2: # waiting for 'virtual' if tokenId == 'virtual': prototype = tokenStr # but not to unified prototype @@ -609,7 +610,7 @@ class Transl: status = 11 # expected end of class else: self.__unexpectedToken(status, tokenId, tokenLineNo) - + elif status == 3: # return type of the method expected if tokenId == 'id': prototype += ' ' + tokenStr @@ -619,7 +620,7 @@ class Transl: status = 4 else: self.__unexpectedToken(status, tokenId, tokenLineNo) - + elif status == 4: # method identifier expected if tokenId == 'id': prototype += ' ' + tokenStr @@ -627,7 +628,7 @@ class Transl: status = 5 else: self.__unexpectedToken(status, tokenId, tokenLineNo) - + elif status == 5: # left bracket of the argument list expected if tokenId == 'lpar': prototype += tokenStr @@ -635,7 +636,7 @@ class Transl: status = 6 else: self.__unexpectedToken(status, tokenId, tokenLineNo) - + elif status == 6: # collecting arguments of the method if tokenId == 'rpar': prototype += tokenStr @@ -651,22 +652,22 @@ class Transl: status = 13 else: self.__unexpectedToken(status, tokenId, tokenLineNo) - + elif status == 7: # assignment expected or left curly brace if tokenId == 'assign': status = 8 elif tokenId == 'lcurly': - curlyCnt = 1 # method body entered + curlyCnt = 1 # method body entered status = 10 else: self.__unexpectedToken(status, tokenId, tokenLineNo) - + elif status == 8: # zero expected if tokenId == 'num' and tokenStr == '0': status = 9 else: self.__unexpectedToken(status, tokenId, tokenLineNo) - + elif status == 9: # after semicolon, produce the dic item if tokenId == 'semic': assert(not resultDic.has_key(uniPrototype)) @@ -674,7 +675,7 @@ class Transl: status = 2 else: self.__unexpectedToken(status, tokenId, tokenLineNo) - + elif status == 10: # consuming the body of the method if tokenId == 'rcurly': curlyCnt -= 1 @@ -682,13 +683,13 @@ class Transl: status = 2 # body consumed elif tokenId == 'lcurly': curlyCnt += 1 - + elif status == 11: # probably the end of class if tokenId == 'semic': status = 777 else: self.__unexpectedToken(status, tokenId, tokenLineNo) - + elif status == 12: # type id for argument expected if tokenId == 'id': prototype += ' ' + tokenStr @@ -696,7 +697,7 @@ class Transl: status = 13 else: self.__unexpectedToken(status, tokenId, tokenLineNo) - + elif status == 13: # namespace qualification or * or & expected if tokenId == 'colon': # was namespace id prototype += tokenStr @@ -712,33 +713,33 @@ class Transl: status = 17 else: self.__unexpectedToken(status, tokenId, tokenLineNo) - + elif status == 14: # second colon for namespace:: expected - if tokenId == 'colon': + if tokenId == 'colon': prototype += tokenStr uniPrototype += tokenStr status = 15 else: self.__unexpectedToken(status, tokenId, tokenLineNo) - + elif status == 15: # type after namespace:: expected - if tokenId == 'id': + if tokenId == 'id': prototype += tokenStr uniPrototype += tokenStr status = 13 else: self.__unexpectedToken(status, tokenId, tokenLineNo) - + elif status == 16: # argument identifier expected - if tokenId == 'id': + if tokenId == 'id': prototype += ' ' + tokenStr # don't put this into unified prototype status = 17 else: self.__unexpectedToken(status, tokenId, tokenLineNo) - + elif status == 17: # comma or ')' after argument identifier expected - if tokenId == 'comma': + if tokenId == 'comma': prototype += ', ' uniPrototype += ', ' status = 6 @@ -748,26 +749,26 @@ class Transl: status = 7 else: self.__unexpectedToken(status, tokenId, tokenLineNo) - + # Eat the rest of the source to cause closing the file. while tokenId != 'eof': tokenId, tokenStr, tokenLineNo = tokenIterator.next() - + # Return the resulting dictionary with 'uniPrototype -> prototype'. return resultDic - - - def __collectPublicMethodPrototypes(self, tokenIterator): + + + def __collectPublicMethodPrototypes(self, tokenIterator): """Collects prototypes of public methods and fills self.prototypeDic. - - The dictionary is filled by items: uniPrototype -> prototype. + + The dictionary is filled by items: uniPrototype -> prototype. The method is expected to be called only for TranslatorXxxx classes, i.e. for the classes that implement translation to some language. It assumes that the openning curly brace of the class was already - consumed. The source is consumed until the end of the class. - The caller should consume the source until the eof to cause closing + consumed. The source is consumed until the end of the class. + The caller should consume the source until the eof to cause closing the source file.""" - + assert(self.classId != 'Translator') assert(self.baseClassId != None) @@ -779,7 +780,7 @@ class Transl: # TranslatorAdapterBase (states 8 and 9). Argument identifier inside # method argument lists can be omitted or commented. # - # Let's collect readable form of all public method prototypes in + # Let's collect readable form of all public method prototypes in # the readable form -- as defined in the source file. # Let's collect also unified form of the same prototype that omits # everything that can be omitted, namely 'virtual' and argument @@ -788,7 +789,7 @@ class Transl: uniPrototype = '' # unified prototype (without arg. identifiers) warning = '' # warning message -- if something special detected methodId = None # processed method id - + # Collect the method prototypes. Stop on the closing # curly brace followed by the semicolon (end of class). status = 0 @@ -796,23 +797,23 @@ class Transl: # Loop until the final state 777 is reached. The errors are processed # immediately. In this implementation, it always quits the application. - while status != 777: - + while status != 777: + # Get the next token. tokenId, tokenStr, tokenLineNo = tokenIterator.next() - + if status == 0: # waiting for 'public:' if tokenId == 'public': status = 1 elif tokenId == 'eof': # non-public things until the eof status = 777 - + elif status == 1: # colon after the 'public' if tokenId == 'colon': status = 2 else: self.__unexpectedToken(status, tokenId, tokenLineNo) - + elif status == 2: # waiting for 'virtual' (can be omitted) if tokenId == 'virtual': prototype = tokenStr # but not to unified prototype @@ -829,7 +830,7 @@ class Transl: status = 11 # expected end of class else: self.__unexpectedToken(status, tokenId, tokenLineNo) - + elif status == 3: # return type of the method expected if tokenId == 'id': prototype += ' ' + tokenStr @@ -837,7 +838,7 @@ class Transl: status = 4 else: self.__unexpectedToken(status, tokenId, tokenLineNo) - + elif status == 4: # method identifier expected if tokenId == 'id': prototype += ' ' + tokenStr @@ -846,7 +847,7 @@ class Transl: status = 5 else: self.__unexpectedToken(status, tokenId, tokenLineNo) - + elif status == 5: # left bracket of the argument list expected if tokenId == 'lpar': prototype += tokenStr @@ -854,7 +855,7 @@ class Transl: status = 6 else: self.__unexpectedToken(status, tokenId, tokenLineNo) - + elif status == 6: # collecting arguments of the method if tokenId == 'rpar': prototype += tokenStr @@ -870,10 +871,10 @@ class Transl: status = 13 else: self.__unexpectedToken(status, tokenId, tokenLineNo) - - elif status == 7: # left curly brace expected + + elif status == 7: # left curly brace expected if tokenId == 'lcurly': - curlyCnt = 1 # method body entered + curlyCnt = 1 # method body entered status = 10 elif tokenId == 'comment': pass @@ -882,14 +883,14 @@ class Transl: status = 8 else: self.__unexpectedToken(status, tokenId, tokenLineNo) - + elif status == 8: # zero expected (TranslatorAdapterBase) assert(self.classId == 'TranslatorAdapterBase') if tokenId == 'num' and tokenStr == '0': status = 9 else: self.__unexpectedToken(status, tokenId, tokenLineNo) - + elif status == 9: # after semicolon (TranslatorAdapterBase) assert(self.classId == 'TranslatorAdapterBase') if tokenId == 'semic': @@ -901,26 +902,36 @@ class Transl: if tokenId == 'rcurly': curlyCnt -= 1 if curlyCnt == 0: - # Insert new dictionary item. + # Check for possible copy/paste error when name + # of the method was not corrected (i.e. the same + # name already exists). + if uniPrototype in self.prototypeDic: + msg = "'%s' prototype found again (duplicity)\n" + msg += "in '%s'.\n" % self.fname + msg = msg % uniPrototype + sys.stderr.write(msg) + assert False + assert(not self.prototypeDic.has_key(uniPrototype)) + # Insert new dictionary item. self.prototypeDic[uniPrototype] = prototype status = 2 # body consumed methodId = None # outside of any method elif tokenId == 'lcurly': curlyCnt += 1 - - # Warn in special case. + + # Warn in special case. elif methodId == 'trLegendDocs' and tokenId == 'string' \ and tokenStr.find('MAX_DOT_GRAPH_HEIGHT') >= 0: - self.txtMAX_DOT_GRAPH_HEIGHT_flag = True - - + self.txtMAX_DOT_GRAPH_HEIGHT_flag = True + + elif status == 11: # probably the end of class if tokenId == 'semic': status = 777 else: self.__unexpectedToken(status, tokenId, tokenLineNo) - + elif status == 12: # type id for argument expected if tokenId == 'id': prototype += ' ' + tokenStr @@ -928,7 +939,7 @@ class Transl: status = 13 else: self.__unexpectedToken(status, tokenId, tokenLineNo) - + elif status == 13: # :: or * or & or id or ) expected if tokenId == 'colon': # was namespace id prototype += tokenStr @@ -948,31 +959,31 @@ class Transl: prototype += tokenStr uniPrototype += tokenStr status = 7 - elif tokenId == 'comma': + elif tokenId == 'comma': prototype += ', ' uniPrototype += ', ' status = 6 else: self.__unexpectedToken(status, tokenId, tokenLineNo) - + elif status == 14: # second colon for namespace:: expected - if tokenId == 'colon': + if tokenId == 'colon': prototype += tokenStr uniPrototype += tokenStr status = 15 else: self.__unexpectedToken(status, tokenId, tokenLineNo) - + elif status == 15: # type after namespace:: expected - if tokenId == 'id': + if tokenId == 'id': prototype += tokenStr uniPrototype += tokenStr status = 13 else: self.__unexpectedToken(status, tokenId, tokenLineNo) - + elif status == 16: # argument identifier or ) expected - if tokenId == 'id': + if tokenId == 'id': prototype += ' ' + tokenStr # don't put this into unified prototype status = 17 @@ -984,9 +995,9 @@ class Transl: prototype += tokenStr else: self.__unexpectedToken(status, tokenId, tokenLineNo) - + elif status == 17: # comma or ')' after argument identifier expected - if tokenId == 'comma': + if tokenId == 'comma': prototype += ', ' uniPrototype += ', ' status = 6 @@ -996,17 +1007,17 @@ class Transl: status = 7 else: self.__unexpectedToken(status, tokenId, tokenLineNo) - - + + def collectAdapterPrototypes(self): """Returns the dictionary of prototypes implemented by adapters. - - It is created to process the translator_adapter.h. The returned + + It is created to process the translator_adapter.h. The returned dictionary has the form: unifiedPrototype -> (version, classId) - thus by looking for the prototype, we get the information what is - the newest (least adapting) adapter that is sufficient for - implementing the method.""" + thus by looking for the prototype, we get the information what is + the newest (least adapting) adapter that is sufficient for + implementing the method.""" # Start the token generator which parses the class source file. assert(os.path.split(self.fname)[1] == 'translator_adapter.h') @@ -1017,8 +1028,8 @@ class Transl: # Create the empty dictionary that will be returned. adaptDic = {} - - + + # Loop through the source of the adapter file until no other adapter # class is found. while True: @@ -1038,16 +1049,16 @@ class Transl: version += '.' + ('%02d' % int(lst[3])) else: version += '.00' - + # Collect the prototypes of implemented public methods. self.__collectPublicMethodPrototypes(tokenIterator) - - # For the required methods, update the dictionary of methods + + # For the required methods, update the dictionary of methods # implemented by the adapter. for protoUni in self.prototypeDic: if reqDic.has_key(protoUni): # This required method will be marked as implemented - # by this adapter class. This implementation assumes + # by this adapter class. This implementation assumes # that newer adapters do not reimplement any required # methods already implemented by older adapters. assert(not adaptDic.has_key(protoUni)) @@ -1058,16 +1069,16 @@ class Transl: self.prototypeDic.clear() self.classId = None self.baseClassId = None - + except StopIteration: break # Return the result dictionary. - return adaptDic + return adaptDic + - def processing(self): - """Processing of the source file -- only for TranslatorXxxx classes.""" + """Processing of the source file -- only for TranslatorXxxx classes.""" # Start the token generator which parses the class source file. tokenIterator = self.__tokenGenerator() @@ -1076,10 +1087,10 @@ class Transl: self.__collectClassInfo(tokenIterator) assert(self.classId != 'Translator') assert(self.classId[:17] != 'TranslatorAdapter') - + # Collect the prototypes of implemented public methods. self.__collectPublicMethodPrototypes(tokenIterator) - + # Eat the rest of the source to cause closing the file. while True: try: @@ -1091,13 +1102,13 @@ class Transl: reqDic = self.manager.requiredMethodsDic adaptDic = self.manager.adaptMethodsDic myDic = self.prototypeDic - + # Build the list of obsolete methods. self.obsoleteMethods = [] for p in myDic: if not reqDic.has_key(p): self.obsoleteMethods.append(p) - + # Build the list of missing methods and the list of implemented # required methods. self.missingMethods = [] @@ -1114,17 +1125,17 @@ class Transl: self.isDecodedTranslator = self.classId in self.manager.decodedTranslators if self.isDecodedTranslator: self.note = 'Reimplementation using UTF-8 suggested.' - + # Check whether adapter must be used or suggest the newest one. # Change the status and set the note accordingly. if self.baseClassId != 'Translator': - if not self.missingMethods: + if not self.missingMethods: self.note = 'Change the base class to Translator.' self.status = '' self.readableStatus = 'up-to-date' elif self.baseClassId != 'TranslatorEnglish': # The translator uses some of the adapters. - # Look at the missing methods and check what adapter + # Look at the missing methods and check what adapter # implements them. Remember the one with the lowest version. adaptMinVersion = '9.9.99' adaptMinClass = 'TranslatorAdapter_9_9_99' @@ -1134,12 +1145,12 @@ class Transl: if version < adaptMinVersion: adaptMinVersion = version adaptMinClass = cls - + # Test against the current status -- preserve the self.status. - # Possibly, the translator implements enough methods to + # Possibly, the translator implements enough methods to # use some newer adapter. status = self.status - + # If the version of the used adapter is smaller than # the required, set the note and update the status as if # the newer adapter was used. @@ -1148,40 +1159,40 @@ class Transl: self.status = adaptMinVersion self.adaptMinClass = adaptMinClass self.readableStatus = adaptMinVersion # simplified - - # If everything seems OK, some explicit warning flags still could - # be set. + + # If everything seems OK, some explicit warning flags still could + # be set. if not self.note and self.status == '' and \ (self.translateMeFlag or self.txtMAX_DOT_GRAPH_HEIGHT_flag): - self.note = '' + self.note = '' if self.translateMeFlag: self.note += 'The "%s" found in a comment.' % self.translateMeText if self.note != '': - self.note += '\n\t\t' + self.note += '\n\t\t' if self.txtMAX_DOT_GRAPH_HEIGHT_flag: self.note += 'The MAX_DOT_GRAPH_HEIGHT found in trLegendDocs()' - - # If everything seems OK, but there are obsolete methods, set + + # If everything seems OK, but there are obsolete methods, set # the note to clean-up source. This note will be used only when # the previous code did not set another note (priority). if not self.note and self.status == '' and self.obsoleteMethods: self.note = 'Remove the obsolete methods (never used).' - - + + def report(self, fout): """Returns the report part for the source as a multiline string. - + No output for up-to-date translators without problem.""" - + # If there is nothing to report, return immediately. if self.status == '' and not self.note: return - + # Report the number of not implemented methods. fout.write('\n\n\n') fout.write(self.classId + ' (' + self.baseClassId + ')') percentImplemented = 100 # init - allNum = len(self.manager.requiredMethodsDic) + allNum = len(self.manager.requiredMethodsDic) if self.missingMethods: num = len(self.missingMethods) percentImplemented = 100 * (allNum - num) / allNum @@ -1191,11 +1202,11 @@ class Transl: fout.write('s') fout.write(' to implement (%d %%)' % (100 * num / allNum)) fout.write('\n' + '-' * len(self.classId)) - + # Write the info about the implemented required methods. fout.write('\n\n Implements %d' % len(self.implementedMethods)) fout.write(' of the required methods (%d %%).' % percentImplemented) - + # Report the missing method, but only when it is not English-based # translator. if self.missingMethods and self.status != 'En': @@ -1219,67 +1230,67 @@ class Transl: for p in self.implementedMethods: fout.write('\n ' + reqDic[p]) - + def getmtime(self): """Returns the last modification time of the source file.""" assert(os.path.isfile(self.fname)) return os.path.getmtime(self.fname) - - + + class TrManager: """Collects basic info and builds subordinate Transl objects.""" - + def __init__(self): """Determines paths, creates and initializes structures. - - The arguments of the script may explicitly say what languages should + + The arguments of the script may explicitly say what languages should be processed. Write the two letter identifications that are used for composing the source filenames, so... - + python translator.py cz - + this will process only translator_cz.h source. """ - + # Determine the path to the script and its name. - self.script = os.path.abspath(sys.argv[0]) - self.script_path, self.script_name = os.path.split(self.script) + self.script = os.path.abspath(sys.argv[0]) + self.script_path, self.script_name = os.path.split(self.script) self.script_path = os.path.abspath(self.script_path) - + # Determine the absolute path to the Doxygen's root subdirectory. # If DOXYGEN environment variable is not found, the directory is # determined from the path of the script. - doxy_default = os.path.join(self.script_path, '..') + doxy_default = os.path.join(self.script_path, '..') self.doxy_path = os.path.abspath(os.getenv('DOXYGEN', doxy_default)) - + # Get the explicit arguments of the script. self.script_argLst = sys.argv[1:] - + # Build the path names based on the Doxygen's root knowledge. self.doc_path = os.path.join(self.doxy_path, 'doc') self.src_path = os.path.join(self.doxy_path, 'src') - + # Create the empty dictionary for Transl object identitied by the - # class identifier of the translator. + # class identifier of the translator. self.__translDic = {} # Create the None dictionary of required methods. The key is the # unified prototype, the value is the full prototype. Set inside # the self.__build(). self.requiredMethodsDic = None - + # Create the empty dictionary that says what method is implemented # by what adapter. self.adaptMethodsDic = {} - + # The last modification time will capture the modification of this - # script, of the translator.h, of the translator_adapter.h (see the + # script, of the translator.h, of the translator_adapter.h (see the # self.__build() for the last two) of all the translator_xx.h files # and of the template for generating the documentation. So, this - # time can be compared with modification time of the generated + # time can be compared with modification time of the generated # documentation to decide, whether the doc should be re-generated. self.lastModificationTime = os.path.getmtime(self.script) - + # Set the names of the translator report text file, of the template # for generating "Internationalization" document, for the generated # file itself, and for the maintainers list. @@ -1287,36 +1298,36 @@ class TrManager: self.maintainersFileName = 'maintainers.txt' self.languageTplFileName = 'language.tpl' self.languageDocFileName = 'language.doc' - - # The information about the maintainers will be stored + + # The information about the maintainers will be stored # in the dictionary with the following name. self.__maintainersDic = None - + # Define the other used structures and variables for information. self.langLst = None # including English based self.supportedLangReadableStr = None # coupled En-based as a note self.numLang = None # excluding coupled En-based self.doxVersion = None # Doxygen version - + # Capture the knowledge about translators that are not implemented # to use UTF-8 internally. self.decodedTranslators = self.getDecodedTranslators() - + # Build objects where each one is responsible for one translator. self.__build() - - + + def getDecodedTranslators(self): """Parses language.cpp to find what translators do not use UTF-8 yet""" decodedTranslators = [] - + # Regular expression to detect the lines like # theTranslator=new TranslatorDecoder(new TranslatorSwedish); rex = re.compile(r'^\s*theTranslator\s*=\s*new\s+.*$') - + # Regular expression to get the (optional) TranslatorDecoder and TranslatorXXX rex2 = re.compile(r'\bTranslator\w+') - + # Parse the lines in the specific source code. f = open(os.path.join(self.src_path, 'language.cpp'), 'rU') for line in f: @@ -1325,20 +1336,20 @@ class TrManager: if lst[0] == 'TranslatorDecoder': decodedTranslators.append(lst[1]) f.close() - - # Display warning when all translator implementations were converted + + # Display warning when all translator implementations were converted # to UTF-8. if len(decodedTranslators) == 0: print 'This script should be updated. All translators do use UTF-8' print 'internally. The TranslatorDecoder adapter should be removed' print 'from the code and its usage should not be checked any more.' - + return decodedTranslators - - + + def __build(self): """Find the translator files and build the objects for translators.""" - + # The translator.h must exist (the Transl object will check it), # create the object for it and let it build the dictionary of # required methods. @@ -1347,7 +1358,7 @@ class TrManager: tim = tr.getmtime() if tim > self.lastModificationTime: self.lastModificationTime = tim - + # The translator_adapter.h must exist (the Transl object will check it), # create the object for it and store the reference in the dictionary. tr = Transl(os.path.join(self.src_path, 'translator_adapter.h'), self) @@ -1355,7 +1366,7 @@ class TrManager: tim = tr.getmtime() if tim > self.lastModificationTime: self.lastModificationTime = tim - + # Create the list of the filenames with language translator sources. # If the explicit arguments of the script were typed, process only # those files. @@ -1365,13 +1376,13 @@ class TrManager: if not os.path.isfile(os.path.join(self.src_path, fname)): sys.stderr.write("\a\nFile '%s' not found!\n" % fname) sys.exit(1) - else: + else: lst = os.listdir(self.src_path) lst = filter(lambda x: x[:11] == 'translator_' and x[-2:] == '.h' and x != 'translator_adapter.h', lst) - - # Build the object for the translator_xx.h files, and process the + + # Build the object for the translator_xx.h files, and process the # content of the file. Then insert the object to the dictionary # accessed via classId. for fname in lst: @@ -1381,12 +1392,12 @@ class TrManager: assert(tr.classId != 'Translator') self.__translDic[tr.classId] = tr - # Extract the global information of the processed info. + # Extract the global information of the processed info. self.__extractProcessedInfo() - - + + def __extractProcessedInfo(self): - """Build lists and strings of the processed info.""" + """Build lists and strings of the processed info.""" # Build the auxiliary list with strings compound of the status, # readable form of the language, and classId. @@ -1395,7 +1406,7 @@ class TrManager: assert(obj.classId != 'Translator') s = obj.status + '|' + obj.langReadable + '|' + obj.classId statLst.append(s) - + # Sort the list and extract the object identifiers (classId's) for # the up-to-date translators and English-based translators. statLst.sort() @@ -1406,13 +1417,13 @@ class TrManager: statLst.reverse() self.adaptIdLst = [x.split('|')[2] for x in statLst if x[0].isdigit()] - # Build the list of tuples that contain (langReadable, obj). + # Build the list of tuples that contain (langReadable, obj). # Sort it by readable name. self.langLst = [] for obj in self.__translDic.values(): self.langLst.append((obj.langReadable, obj)) self.langLst.sort(lambda a, b: cmp(a[0], b[0])) - + # Create the list with readable language names. If the language has # also the English-based version, modify the item by appending # the note. Number of the supported languages is equal to the length @@ -1420,28 +1431,28 @@ class TrManager: langReadableLst = [] for name, obj in self.langLst: if obj.status == 'En': continue - + # Append the 'En' to the classId to possibly obtain the classId # of the English-based object. If the object exists, modify the # name for the readable list of supported languages. classIdEn = obj.classId + 'En' if self.__translDic.has_key(classIdEn): name += ' (+En)' - + # Append the result name of the language, possibly with note. langReadableLst.append(name) - # Create the multiline string of readable language names, + # Create the multiline string of readable language names, # with punctuation, wrapped to paragraph. if len(langReadableLst) == 1: s = langReadableLst[0] elif len(langReadableLst) == 2: - s = ' and '.join(langReadableLst) - else: - s = ', '.join(langReadableLst[:-1]) + ', and ' + s = ' and '.join(langReadableLst) + else: + s = ', '.join(langReadableLst[:-1]) + ', and ' s += langReadableLst[-1] - - self.supportedLangReadableStr = fill(s + '.') + + self.supportedLangReadableStr = fill(s + '.') # Find the number of the supported languages. The English based # languages are not counted if the non-English based also exists. @@ -1451,32 +1462,32 @@ class TrManager: classId = obj.classId[:-2] if self.__translDic.has_key(classId): self.numLang -= 1 # the couple will be counted as one - + # Extract the version of Doxygen. f = open(os.path.join(self.doxy_path, 'VERSION')) self.doxVersion = f.readline().strip() f.close() - + # Update the last modification time. for tr in self.__translDic.values(): tim = tr.getmtime() if tim > self.lastModificationTime: self.lastModificationTime = tim - - + + def __getNoTrSourceFilesLst(self): """Returns the list of sources to be checked. - + All .cpp files and also .h files that do not declare or define - the translator methods are included in the list. The file names + the translator methods are included in the list. The file names are searched in doxygen/src directory. - """ + """ files = [] for item in os.listdir(self.src_path): # Split the bare name to get the extension. name, ext = os.path.splitext(item) ext = ext.lower() - + # Include only .cpp and .h files (case independent) and exclude # the files where the checked identifiers are defined. if ext == '.cpp' or (ext == '.h' and name.find('translator') == -1): @@ -1484,37 +1495,37 @@ class TrManager: assert os.path.isfile(fname) # assumes no directory with the ext files.append(fname) # full name return files - - + + def __removeUsedInFiles(self, fname, dic): """Removes items for method identifiers that are found in fname. - + The method reads the content of the file as one string and searches for all identifiers from dic. The identifiers that were found in the file are removed from the dictionary. - + Note: If more files is to be checked, the files where most items are - probably used should be checked first and the resulting reduced + probably used should be checked first and the resulting reduced dictionary should be used for checking the next files (speed up). """ lst_in = dic.keys() # identifiers to be searched for - + # Read content of the file as one string. assert os.path.isfile(fname) f = open(fname) cont = f.read() f.close() - + # Remove the items for identifiers that were found in the file. while lst_in: item = lst_in.pop(0) if cont.find(item) != -1: del dic[item] - + def __checkForNotUsedTrMethods(self): """Returns the dictionary of not used translator methods. - + The method can be called only after self.requiredMethodsDic has been built. The stripped prototypes are the values, the method identifiers are the keys. @@ -1526,45 +1537,45 @@ class TrManager: ri = prototype.split('(')[0] identifier = ri.split()[1].strip() trdic[identifier] = prototype - + # Build the list of source files where translator method identifiers # can be used. files = self.__getNoTrSourceFilesLst() - + # Loop through the files and reduce the dictionary of id -> proto. for fname in files: self.__removeUsedInFiles(fname, trdic) - + # Return the dictionary of not used translator methods. return trdic - - + + def __emails(self, classId): """Returns the list of maintainer emails. - + The method returns the list of e-mail adresses for the translator class, but only the addresses that were not marked as [xxx].""" lst = [] for m in self.__maintainersDic[classId]: if not m[1].startswith('['): email = m[1] - email = email.replace(' at ', '@') # Unmangle the mangled e-mail + email = email.replace(' at ', '@') # Unmangle the mangled e-mail email = email.replace(' dot ', '.') lst.append(email) return lst - - + + def generateTranslatorReport(self): """Generates the translator report.""" output = os.path.join(self.doc_path, self.translatorReportFileName) - + # Open the textual report file for the output. f = open(output, 'w') # Output the information about the version. f.write('(' + self.doxVersion + ')\n\n') - + # Output the information about the number of the supported languages # and the list of the languages, or only the note about the explicitly # given languages to process. @@ -1577,30 +1588,30 @@ class TrManager: f.write(str(self.numLang)) f.write(' languages (sorted alphabetically):\n\n') f.write(self.supportedLangReadableStr + '\n\n') - - # Write the summary about the status of language translators (how + + # Write the summary about the status of language translators (how # many translators) are up-to-date, etc. s = 'Of them, %d translators are up-to-date, ' % len(self.upToDateIdLst) - s += '%d translators are based on some adapter class, ' % len(self.adaptIdLst) + s += '%d translators are based on some adapter class, ' % len(self.adaptIdLst) s += 'and %d are English based.' % len(self.EnBasedIdLst) f.write(fill(s) + '\n\n') - - # The e-mail addresses of the maintainers will be collected to + + # The e-mail addresses of the maintainers will be collected to # the auxiliary file in the order of translator classes listed # in the translator report. fmail = open('mailto.txt', 'w') - - # Write the list of up-to-date translator classes. + + # Write the list of up-to-date translator classes. if self.upToDateIdLst: s = '''The following translator classes are up-to-date (sorted alphabetically). This means that they derive from the Translator class and they implement all %d of the required - methods. Anyway, there still may be some details listed even + methods. Anyway, there still may be some details listed even for them:''' - s = s % len(self.requiredMethodsDic) + s = s % len(self.requiredMethodsDic) f.write('-' * 70 + '\n') f.write(fill(s) + '\n\n') - + mailtoLst = [] for x in self.upToDateIdLst: obj = self.__translDic[x] @@ -1609,24 +1620,24 @@ class TrManager: f.write(' -- ' + obj.note) f.write('\n') mailtoLst.extend(self.__emails(obj.classId)) - + fmail.write('up-to-date\n') fmail.write('; '.join(mailtoLst)) # Write the list of the adapter based classes. The very obsolete # translators that derive from TranslatorEnglish are included. if self.adaptIdLst: - s = '''The following translator classes need some maintenance + s = '''The following translator classes need some maintenance (the most obsolete at the end). The other info shows the estimation of Doxygen version when the class was last updated and number of methods that must be implemented to become up-to-date:''' f.write('\n' + '-' * 70 + '\n') f.write(fill(s) + '\n\n') - + # Find also whether some adapter classes may be removed. adaptMinVersion = '9.9.99' - + mailtoLst = [] numRequired = len(self.requiredMethodsDic) for x in self.adaptIdLst: @@ -1643,48 +1654,48 @@ class TrManager: f.write('\n\tNote: ' + obj.note + '\n') f.write('\n') mailtoLst.extend(self.__emails(obj.classId)) # to maintainer - + # Check the level of required adapter classes. if obj.status != '0.0.00' and obj.status < adaptMinVersion: adaptMinVersion = obj.status fmail.write('\n\ntranslator based\n') fmail.write('; '.join(mailtoLst)) - - # Set the note if some old translator adapters are not needed + + # Set the note if some old translator adapters are not needed # any more. Do it only when the script is called without arguments, - # i.e. all languages were checked against the needed translator - # adapters. + # i.e. all languages were checked against the needed translator + # adapters. if not self.script_argLst: to_remove = {} for version, adaptClassId in self.adaptMethodsDic.values(): if version < adaptMinVersion: to_remove[adaptClassId] = True - + if to_remove: lst = to_remove.keys() lst.sort() plural = len(lst) > 1 note = 'Note: The adapter class' if plural: note += 'es' - note += ' ' + ', '.join(lst) - if not plural: + note += ' ' + ', '.join(lst) + if not plural: note += ' is' else: note += ' are' note += ' not used and can be removed.' f.write('\n' + fill(note) + '\n') - + # Write the list of the English-based classes. if self.EnBasedIdLst: - s = '''The following translator classes derive directly from the - TranslatorEnglish. The class identifier has the suffix 'En' - that says that this is intentional. Usually, there is also - a non-English based version of the translator for + s = '''The following translator classes derive directly from the + TranslatorEnglish. The class identifier has the suffix 'En' + that says that this is intentional. Usually, there is also + a non-English based version of the translator for the language:''' f.write('\n' + '-' * 70 + '\n') f.write(fill(s) + '\n\n') - + for x in self.EnBasedIdLst: obj = self.__translDic[x] f.write(' ' + obj.classId) @@ -1692,7 +1703,7 @@ class TrManager: if obj.note: f.write(' -- ' + obj.note) f.write('\n') - + # Check for not used translator methods and generate warning if found. # The check is rather time consuming, so it is not done when report # is restricted to explicitly given language identifiers. @@ -1700,42 +1711,42 @@ class TrManager: dic = self.__checkForNotUsedTrMethods() if dic: s = '''WARNING: The following translator methods are declared - in the Translator class but their identifiers do not appear - in source files. The situation should be checked. The .cpp - files and .h files excluding the '*translator*' files - in doxygen/src directory were simply searched for occurence + in the Translator class but their identifiers do not appear + in source files. The situation should be checked. The .cpp + files and .h files excluding the '*translator*' files + in doxygen/src directory were simply searched for occurence of the method identifiers:''' f.write('\n' + '=' * 70 + '\n') f.write(fill(s) + '\n\n') - + keys = dic.keys() keys.sort() for key in keys: f.write(' ' + dic[key] + '\n') f.write('\n') - + # Write the details for the translators. f.write('\n' + '=' * 70) f.write('\nDetails for translators (classes sorted alphabetically):\n') - + cls = self.__translDic.keys() cls.sort() - + for c in cls: obj = self.__translDic[c] - assert(obj.classId != 'Translator') + assert(obj.classId != 'Translator') obj.report(f) - - # Close the report file and the auxiliary file with e-mails. + + # Close the report file and the auxiliary file with e-mails. f.close() fmail.close() - - + + def __loadMaintainers(self): """Load and process the file with the maintainers. - + Fills the dictionary classId -> [(name, e-mail), ...].""" - + fname = os.path.join(self.doc_path, self.maintainersFileName) # Include the maintainers file to the group of files checked with @@ -1743,7 +1754,7 @@ class TrManager: tim = os.path.getmtime(fname) if tim > self.lastModificationTime: self.lastModificationTime = tim - + # Process the content of the maintainers file. f = codecs.open(fname, 'r', 'utf-8') inside = False # inside the record for the language @@ -1754,26 +1765,26 @@ class TrManager: while lineReady: line = f.readline() # next line lineReady = line != '' # when eof, then line == '' - + line = line.strip() # eof should also behave as separator if line != u'' and line[0] == u'%': # skip the comment line - continue - + continue + if not inside: # if outside of the record if line != u'': # should be language identifier classId = line maintainersLst = [] inside = True # Otherwise skip empty line that do not act as separator. - - else: # if inside the record + + else: # if inside the record if line == u'': # separator found inside = False else: # If it is the first maintainer, create the empty list. if not self.__maintainersDic.has_key(classId): self.__maintainersDic[classId] = [] - + # Split the information about the maintainer and append # the tuple. The address may be prefixed '[unreachable]' # or whatever '[xxx]'. This will be processed later. @@ -1783,11 +1794,11 @@ class TrManager: self.__maintainersDic[classId].append(t) f.close() - + def generateLanguageDoc(self): """Checks the modtime of files and generates language.doc.""" self.__loadMaintainers() - + # Check the last modification time of the template file. It is the # last file from the group that decide whether the documentation # should or should not be generated. @@ -1796,14 +1807,14 @@ class TrManager: if tim > self.lastModificationTime: self.lastModificationTime = tim - # If the generated documentation exists and is newer than any of - # the source files from the group, do not generate it and quit + # If the generated documentation exists and is newer than any of + # the source files from the group, do not generate it and quit # quietly. fDocName = os.path.join(self.doc_path, self.languageDocFileName) - if os.path.isfile(fDocName): + if os.path.isfile(fDocName): if os.path.getmtime(fDocName) > self.lastModificationTime: return - + # The document or does not exist or is older than some of the # sources. It must be generated again. # @@ -1817,15 +1828,15 @@ class TrManager: assert pos != -1 doctpl = doctpl[pos:] - # Fill the tplDic by symbols that will be inserted into the + # Fill the tplDic by symbols that will be inserted into the # document template. tplDic = {} - + s = u'Do not edit this file. It was generated by the %s script.' % self.script_name tplDic['editnote'] = s - + tplDic['doxVersion'] = self.doxVersion - tplDic['supportedLangReadableStr'] = self.supportedLangReadableStr + tplDic['supportedLangReadableStr'] = self.supportedLangReadableStr tplDic['translatorReportFileName'] = self.translatorReportFileName ahref = u'%s\n ' htmlTdTpl = u'\n %s' @@ -1868,10 +1879,10 @@ class TrManager: # Fill the table data elements for one row. The first element # contains the readable name of the language. lst = [ htmlTdTpl % obj.langReadable ] - - # The next two elements contain the list of maintainers + + # The next two elements contain the list of maintainers # and the list of their mangled e-mails. For English-based - # translators that are coupled with the non-English based, + # translators that are coupled with the non-English based, # insert the 'see' note. mm = None # init -- maintainer ee = None # init -- e-mail address @@ -1882,11 +1893,11 @@ class TrManager: lang = self.__translDic[classId].langReadable mm = u'see the %s language' % lang ee = u' ' - + if not mm and obj.classId in self.__maintainersDic: # Build a string of names separated by the HTML break element. # Special notes used instead of names are highlighted. - lm = [] + lm = [] for maintainer in self.__maintainersDic[obj.classId]: name = maintainer[0] if name.startswith(u'--'): @@ -1894,8 +1905,8 @@ class TrManager: + name + u'' lm.append(name) mm = u'
    '.join(lm) - - # The marked adresses (they start with the mark '[unreachable]', + + # The marked adresses (they start with the mark '[unreachable]', # '[resigned]', whatever '[xxx]') will not be displayed at all. # Only the mark will be used instead. rexMark = re.compile(ur'(?P\[.*?\])') @@ -1906,28 +1917,28 @@ class TrManager: if m is not None: address = u''\ + m.group(u'mark') + u'' - le.append(address) + le.append(address) ee = u'
    '.join(le) - + # Append the maintainer and e-mail elements. lst.append(htmlTdTpl % mm) lst.append(htmlTdTpl % ee) - + # The last element contains the readable form of the status. lst.append(htmlTdTpl % obj.readableStatus) - - # Join the table data to one table row. + + # Join the table data to one table row. trlst.append(htmlTrTpl % (''.join(lst))) - + # Join the table rows and insert into the template. htmlTable = htmlTableTpl % (''.join(trlst)) - + # Define templates for LaTeX table parts of the documentation. latexTableTpl = ur''' \latexonly \footnotesize \begin{longtable}{|l|l|l|l|} - \hline + \hline {\bf Language} & {\bf Maintainer} & {\bf Contact address} & {\bf Status} \\ \hline %s @@ -1936,7 +1947,7 @@ class TrManager: \normalsize \endlatexonly ''' - latexTableTpl = dedent(latexTableTpl) + latexTableTpl = dedent(latexTableTpl) latexLineTpl = u'\n' + r' %s & %s & {\tt\tiny %s} & %s \\' # Loop through transl objects in the order of sorted readable names @@ -1961,9 +1972,9 @@ class TrManager: langNE = self.__translDic[classId].langReadable maintainer = u'see the %s language' % langNE email = u'~' - + if not maintainer and (obj.classId in self.__maintainersDic): - lm = [ m[0] for m in self.__maintainersDic[obj.classId] ] + lm = [ m[0] for m in self.__maintainersDic[obj.classId] ] maintainer = maintainers[0][0] email = maintainers[0][1] @@ -1976,7 +1987,7 @@ class TrManager: s = latexLineTpl % (lang, maintainer, email, status) s = s.replace(u'_', u'\\_') trlst.append(s) - + # List the other maintainers for the language. Do not set # lang and status for them. lang = u'~' @@ -1987,26 +1998,26 @@ class TrManager: s = latexLineTpl % (lang, maintainer, email, status) s = s.replace(u'_', u'\\_') trlst.append(s) - + # Join the table lines and insert into the template. latexTable = latexTableTpl % (u''.join(trlst)) - + # Put the HTML and LaTeX parts together and define the dic item. - tplDic['informationTable'] = htmlTable + u'\n' + latexTable + tplDic['informationTable'] = htmlTable + u'\n' + latexTable # Insert the symbols into the document template and write it down. f = codecs.open(fDocName, 'w', 'utf-8') f.write(doctpl % tplDic) f.close() - + if __name__ == '__main__': - + # Create the manager, build the transl objects, and parse the related # sources. trMan = TrManager() # Generate the language.doc. trMan.generateLanguageDoc() - + # Generate the translator report. trMan.generateTranslatorReport() diff --git a/doc/translator_report.txt b/doc/translator_report.txt index d5d573c..b7fa558 100644 --- a/doc/translator_report.txt +++ b/doc/translator_report.txt @@ -1,16 +1,16 @@ -(1.8.3) +(1.8.3.1) -Doxygen supports the following 39 languages (sorted alphabetically): +Doxygen supports the following 40 languages (sorted alphabetically): Afrikaans, Arabic, Armenian, Brazilian Portuguese, Catalan, Chinese, Chinese Traditional, Croatian, Czech, Danish, Dutch, English, Esperanto, Finnish, French, German, Greek, Hungarian, Indonesian, -Italian, Japanese (+En), Korean (+En), Lithuanian, Macedonian, -Norwegian, Persian, Polish, Portuguese, Romanian, Russian, Serbian, -SerbianCyrilic, Slovak, Slovene, Spanish, Swedish, Turkish, Ukrainian, -and Vietnamese. +Italian, Japanese (+En), Korean (+En), Latvian, Lithuanian, +Macedonian, Norwegian, Persian, Polish, Portuguese, Romanian, Russian, +Serbian, SerbianCyrilic, Slovak, Slovene, Spanish, Swedish, Turkish, +Ukrainian, and Vietnamese. -Of them, 8 translators are up-to-date, 31 translators are based on +Of them, 10 translators are up-to-date, 30 translators are based on some adapter class, and 2 are English based. ---------------------------------------------------------------------- @@ -25,8 +25,10 @@ still may be some details listed even for them: TranslatorEsperanto TranslatorGerman TranslatorGreek + TranslatorLatvian -- Reimplementation using UTF-8 suggested. TranslatorSlovak TranslatorSpanish + TranslatorUkrainian ---------------------------------------------------------------------- The following translator classes need some maintenance (the most @@ -96,9 +98,6 @@ must be implemented to become up-to-date: TranslatorArabic 1.4.6 49 methods to implement (20 %) Note: Reimplementation using UTF-8 suggested. - TranslatorUkrainian 1.4.1 50 methods to implement (20 %) - Note: Reimplementation using UTF-8 suggested. - ---------------------------------------------------------------------- The following translator classes derive directly from the @@ -629,6 +628,12 @@ TranslatorKoreanEn (TranslatorEnglish) 237 methods to implement (97 %) virtual QCString latexLanguageSupportCommand() +TranslatorLatvian (Translator) +----------------- + + Implements 242 of the required methods (100 %). + + TranslatorLithuanian (TranslatorAdapter_1_4_6) 50 methods to implement (20 %) -------------------- @@ -1121,77 +1126,6 @@ TranslatorTurkish (TranslatorAdapter_1_7_5) 17 methods to implement (7 %) virtual QCString trInstanceMethods() -TranslatorUkrainian (TranslatorAdapter_1_4_1) 50 methods to implement (20 %) -------------------- - - Implements 192 of the required methods (79 %). - - Missing methods (should be implemented): - - virtual QCString trDetailLevel() - virtual QCString trCompoundMembersDescriptionFortran(bool extractAll) - virtual QCString trSearching() - virtual QCString trTemplateParameters() - virtual QCString trOverloadText() - virtual QCString trNoMatches() - virtual QCString trGeneratedFromFilesFortran(ClassDef::CompoundType compType, bool single) - virtual QCString trLoading() - virtual QCString trSubprograms() - virtual QCString trDateTime(int year, int month, int day, int dayOfWeek, int hour, int minutes, int seconds, bool includeTime) - virtual QCString trModulesListDescription(bool extractAll) - virtual QCString trModulesList() - virtual QCString trTypeConstraints() - virtual QCString trFileIn(const char * name) - virtual QCString trClassMethods() - virtual QCString trProvidedByCategory() - virtual QCString trGlobalNamespace() - virtual QCString trMemberFunctionDocumentationFortran() - virtual QCString trCompoundListDescriptionFortran() - virtual QCString trDesignOverview() - virtual QCString trTypeDocumentation() - virtual QCString trAndMore(const QCString & number) - virtual QCString trModuleReference(const char * namespaceName) - virtual QCString trModulesMemberDescription(bool extractAll) - virtual QCString trModulesMembers() - virtual QCString trDirDepGraph(const char * name) - virtual QCString trModulesIndex() - virtual QCString trDirRelation(const char * name) - virtual QCString trMethodDocumentation() - virtual QCString trCompoundListFortran() - virtual QCString trDataTypes() - virtual QCString trEnumReference(const char * name) - virtual QCString trInheritedFrom(const char * members, const char * what) - virtual QCString trCiteReferences() - virtual QCString trAdditionalInheritedMembers() - virtual QCString trDirDependency(const char * name) - virtual QCString trCopyright() - virtual QCString trIncludesFileIn(const char * name) - virtual QCString trEnumGeneratedFromFiles(bool single) - virtual QCString trCompoundIndexFortran() - virtual QCString trSubprogram(bool first_capital, bool singular) - virtual QCString trPanelSynchronisationTooltip(bool enable) - virtual QCString trCallerGraph() - virtual QCString trExtendsClass() - virtual QCString trCompoundReferenceFortran(const char * clName, ClassDef::CompoundType compType, bool isTemplate) - virtual QCString trType(bool first_capital, bool singular) - virtual QCString trModule(bool first_capital, bool singular) - virtual QCString trCompoundMembersFortran() - virtual QCString trSubprogramDocumentation() - virtual QCString trInstanceMethods() - - Obsolete methods (should be removed, never used): - - virtual QCString trHeaderFilesDescription() - virtual QCString trField(bool first_capital, bool singular) - virtual QCString trPackageDocumentation() - virtual QCString trSources() - virtual QCString trReimplementedForInternalReasons() - virtual QCString trInterfaces() - virtual QCString trHeaderFiles() - virtual QCString trBugsAndLimitations() - virtual QCString trNoDescriptionAvailable() - - TranslatorVietnamese (TranslatorAdapter_1_6_0) 26 methods to implement (10 %) -------------------- diff --git a/doc/trouble.doc b/doc/trouble.doc index c79c0cd..81604a2 100644 --- a/doc/trouble.doc +++ b/doc/trouble.doc @@ -134,8 +134,10 @@ one file please tar or zip everything, so I only have to save and download one file. \htmlonly -Return to the
    index. +Go to the next section or return to the + index. \endhtmlonly + */ diff --git a/doc/xmlcmds.doc b/doc/xmlcmds.doc index 8b38d38..16beed3 100644 --- a/doc/xmlcmds.doc +++ b/doc/xmlcmds.doc @@ -99,5 +99,11 @@ class Engine } \endcode + +\htmlonly +Go to the next section or return to the + index. +\endhtmlonly + */ diff --git a/examples/Makefile.in b/examples/Makefile.in index 26b7c24..33b4cb3 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -38,93 +38,91 @@ clean: memgrp docstring pyexample mux manual dbusxml tclexample class/html/index.html: class.h class.cfg - $(DOXYGEN)/bin/doxygen class.cfg + "$(DOXYGEN)/bin/doxygen" class.cfg define/html/index.html: define.h define.cfg - $(DOXYGEN)/bin/doxygen define.cfg + "$(DOXYGEN)/bin/doxygen" define.cfg enum/html/index.html: enum.h enum.cfg - $(DOXYGEN)/bin/doxygen enum.cfg + "$(DOXYGEN)/bin/doxygen" enum.cfg file/html/index.html: file.h file.cfg - $(DOXYGEN)/bin/doxygen file.cfg + "$(DOXYGEN)/bin/doxygen" file.cfg func/html/index.html: func.h func.cfg - $(DOXYGEN)/bin/doxygen func.cfg + "$(DOXYGEN)/bin/doxygen" func.cfg page/html/index.html: page.doc page.cfg - $(DOXYGEN)/bin/doxygen page.cfg + "$(DOXYGEN)/bin/doxygen" page.cfg relates/html/index.html: relates.cpp relates.cfg - $(DOXYGEN)/bin/doxygen relates.cfg + "$(DOXYGEN)/bin/doxygen" relates.cfg author/html/index.html: author.cpp author.cfg - $(DOXYGEN)/bin/doxygen author.cfg + "$(DOXYGEN)/bin/doxygen" author.cfg par/html/index.html: par.cpp par.cfg - $(DOXYGEN)/bin/doxygen par.cfg + "$(DOXYGEN)/bin/doxygen" par.cfg overload/html/index.html: overload.cpp overload.cfg - $(DOXYGEN)/bin/doxygen overload.cfg + "$(DOXYGEN)/bin/doxygen" overload.cfg example/html/index.html: example.cpp example_test.cpp example.cfg - $(DOXYGEN)/bin/doxygen example.cfg + "$(DOXYGEN)/bin/doxygen" example.cfg include/html/index.html: include.cpp example_test.cpp include.cfg - $(DOXYGEN)/bin/doxygen include.cfg + "$(DOXYGEN)/bin/doxygen" include.cfg qtstyle/html/index.html: qtstyle.cpp qtstyle.cfg - $(DOXYGEN)/bin/doxygen qtstyle.cfg + "$(DOXYGEN)/bin/doxygen" qtstyle.cfg jdstyle/html/index.html: jdstyle.cpp jdstyle.cfg - $(DOXYGEN)/bin/doxygen jdstyle.cfg + "$(DOXYGEN)/bin/doxygen" jdstyle.cfg structcmd/html/index.html: structcmd.h structcmd.cfg - $(DOXYGEN)/bin/doxygen structcmd.cfg + "$(DOXYGEN)/bin/doxygen" structcmd.cfg autolink/html/index.html: autolink.cpp autolink.cfg - $(DOXYGEN)/bin/doxygen autolink.cfg + "$(DOXYGEN)/bin/doxygen" autolink.cfg tag/html/index.html: tag.cpp tag.cfg example/html/index.html - $(DOXYGEN)/bin/doxygen tag.cfg -# sed -e "1,1s#perl#$(PERL)#g" tag/html/installdox >tag/html/installdox.perl -# cd tag/html ; $(PERL) installdox.perl -lexample.tag@../../example/html + "$(DOXYGEN)/bin/doxygen" tag.cfg restypedef/html/index.html: restypedef.cpp restypedef.cfg - $(DOXYGEN)/bin/doxygen restypedef.cfg + "$(DOXYGEN)/bin/doxygen" restypedef.cfg afterdoc/html/index.html: afterdoc.h afterdoc.cfg - $(DOXYGEN)/bin/doxygen afterdoc.cfg + "$(DOXYGEN)/bin/doxygen" afterdoc.cfg template/html/index.html: templ.cpp templ.cfg - $(DOXYGEN)/bin/doxygen templ.cfg + "$(DOXYGEN)/bin/doxygen" templ.cfg group/html/index.html: group.cpp group.cfg - $(DOXYGEN)/bin/doxygen group.cfg + "$(DOXYGEN)/bin/doxygen" group.cfg memgrp/html/index.html: memgrp.cpp memgrp.cfg - $(DOXYGEN)/bin/doxygen memgrp.cfg + "$(DOXYGEN)/bin/doxygen" memgrp.cfg pyexample/html/index.html: pyexample.py pyexample.cfg - $(DOXYGEN)/bin/doxygen pyexample.cfg + "$(DOXYGEN)/bin/doxygen" pyexample.cfg tclexample/html/index.html: tclexample.tcl tclexample.cfg - $(DOXYGEN)/bin/doxygen tclexample.cfg + "$(DOXYGEN)/bin/doxygen" tclexample.cfg mux/html/index.html: mux.vhdl mux.cfg - $(DOXYGEN)/bin/doxygen mux.cfg + "$(DOXYGEN)/bin/doxygen" mux.cfg manual/html/index.html: manual.c manual.cfg - $(DOXYGEN)/bin/doxygen manual.cfg + "$(DOXYGEN)/bin/doxygen" manual.cfg docstring/html/index.html: docstring.py docstring.cfg - $(DOXYGEN)/bin/doxygen docstring.cfg + "$(DOXYGEN)/bin/doxygen" docstring.cfg #dbusxml/html/index.html: dbusxml.xml dbusxml.cfg # $(DOXYGEN)/bin/doxygen dbusxml.cfg diagrams/html/index.html: diagrams_a.h diagrams_b.h diagrams_c.h diagrams_d.h diagrams_e.h diagrams.cfg ifneq ($(HAVE_DOT),) - $(DOXYGEN)/bin/doxygen diagrams.cfg + "$(DOXYGEN)/bin/doxygen" diagrams.cfg endif diff --git a/qtools/Doxyfile b/qtools/Doxyfile index fdf0741..9c31af8 100644 --- a/qtools/Doxyfile +++ b/qtools/Doxyfile @@ -50,7 +50,7 @@ LOOKUP_CACHE_SIZE = 0 # Build related configuration options #--------------------------------------------------------------------------- EXTRACT_ALL = YES -EXTRACT_PRIVATE = NO +EXTRACT_PRIVATE = YES EXTRACT_PACKAGE = NO EXTRACT_STATIC = YES EXTRACT_LOCAL_CLASSES = YES @@ -120,13 +120,14 @@ USE_MDFILE_AS_MAINPAGE = # configuration options related to source browsing #--------------------------------------------------------------------------- SOURCE_BROWSER = YES -INLINE_SOURCES = NO +INLINE_SOURCES = YES STRIP_CODE_COMMENTS = YES REFERENCED_BY_RELATION = YES REFERENCES_RELATION = YES REFERENCES_LINK_SOURCE = YES USE_HTAGS = NO VERBATIM_HEADERS = YES +CLANG_ASSISTED_PARSING = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- @@ -228,7 +229,7 @@ MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- -GENERATE_XML = YES +GENERATE_XML = NO XML_OUTPUT = xml XML_SCHEMA = XML_DTD = @@ -236,7 +237,7 @@ XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options related to the DOCBOOK output #--------------------------------------------------------------------------- -GENERATE_DOCBOOK = YES +GENERATE_DOCBOOK = NO DOCBOOK_OUTPUT = docbook #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output @@ -258,7 +259,7 @@ EXPAND_ONLY_PREDEF = YES SEARCH_INCLUDES = YES INCLUDE_PATH = INCLUDE_FILE_PATTERNS = -PREDEFINED = +PREDEFINED = Q_EXPORT= EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- diff --git a/qtools/qcstring.h b/qtools/qcstring.h index 08f6e82..8b652b4 100644 --- a/qtools/qcstring.h +++ b/qtools/qcstring.h @@ -88,6 +88,12 @@ Q_EXPORT void *qmemmove( void *dst, const void *src, uint len ); #define memmove(s1,s2,n) qmemmove((s1),(s2),(n)) #endif +#if defined(_OS_WIN32_) +#define qsnprintf _snprintf +#else +#define qsnprintf snprintf +#endif + Q_EXPORT char *qstrdup( const char * ); Q_EXPORT inline uint cstrlen( const char *str ) diff --git a/src/bufstr.h b/src/bufstr.h index 635b4cf..427b012 100644 --- a/src/bufstr.h +++ b/src/bufstr.h @@ -18,6 +18,10 @@ #ifndef _BUFSTR_H #define _BUFSTR_H +#include +#include +#include + /*! @brief Buffer used to store strings * * This buffer is used append characters and strings. It will automatically diff --git a/src/cite.cpp b/src/cite.cpp index 91dd1e1..d4860c8 100644 --- a/src/cite.cpp +++ b/src/cite.cpp @@ -88,11 +88,19 @@ static QCString getListOfBibFiles(const QCString &sep,bool namesOnly) void CiteDict::writeLatexBibliography(FTextStream &t) { - if (m_entries.count()==0) return; + if (m_entries.isEmpty()) + return; + QCString style = Config_getString("LATEX_BIB_STYLE"); - if (style.isEmpty()) style="plain"; - t << "\\newpage \\bibliographystyle{" << style << "}" << endl; - t << "\\bibliography{" << getListOfBibFiles(",",TRUE) << "}" << endl; + if (style.isEmpty()) + style="plain"; + t << "% Bibliography\n" + "\\newpage\n" + "\\phantomsection\n" + "\\addcontentsline{toc}{part}{" << theTranslator->trCiteReferences() << "}\n" + "\\bibliographystyle{" << style << "}\n" + "\\bibliography{" << getListOfBibFiles(",",TRUE) << "}\n" + "\n"; } void CiteDict::insert(const char *label) diff --git a/src/clangparser.cpp b/src/clangparser.cpp new file mode 100644 index 0000000..c9e192f --- /dev/null +++ b/src/clangparser.cpp @@ -0,0 +1,720 @@ +#include "clangparser.h" +#include "settings.h" +#include + +#if USE_LIBCLANG +#include +#include +#include +#include "message.h" +#include "sortdict.h" +#include "outputlist.h" +#include "filedef.h" +#include "memberdef.h" +#include "doxygen.h" +#include "util.h" +#include "config.h" +#include "growbuf.h" +#include "membername.h" +#include "filename.h" +#endif + +ClangParser *ClangParser::instance() +{ + if (!s_instance) s_instance = new ClangParser; + return s_instance; +} + +ClangParser *ClangParser::s_instance = 0; + +//-------------------------------------------------------------------------- +#if USE_LIBCLANG + +class ClangParser::Private +{ + public: + int getCurrentTokenLine(); + CXIndex index; + CXTranslationUnit tu; + QCString fileName; + CXToken *tokens; + uint numTokens; + CXCursor *cursors; + uint curLine; + uint curToken; + CXUnsavedFile uf; + QCString source; +}; + +static QCString detab(const QCString &s) +{ + static int tabSize = Config_getInt("TAB_SIZE"); + GrowBuf out; + int size = s.length(); + const char *data = s.data(); + int i=0; + int col=0; + const int maxIndent=1000000; // value representing infinity + int minIndent=maxIndent; + while (i update minIndent + out.addChar(c); + if (c<0 && i= 2 bytes + if (((uchar)c&0xE0)==0xE0 && ifileName = fileName; + p->index = clang_createIndex(0, 0); + p->curLine = 1; + p->curToken = 0; + char *argv[4+Doxygen::inputPaths.count()+includePath.count()+clangOptions.count()]; + QDictIterator di(Doxygen::inputPaths); + int argc=0; + // add include paths for input files + for (di.toFirst();di.current();++di,++argc) + { + QCString inc = QCString("-I")+di.currentKey(); + argv[argc]=strdup(inc.data()); + //printf("argv[%d]=%s\n",argc,argv[argc]); + } + // add external include paths + for (uint i=0;isource = detab(fileToString(fileName,filterSourceFiles,TRUE)); + //printf("source %s ----------\n%s\n-------------\n\n", + // fileName,p->source.data()); + p->uf.Filename = strdup(fileName); + p->uf.Contents = p->source.data(); + p->uf.Length = p->source.length(); + p->tu = clang_parseTranslationUnit(p->index, 0, + argv, argc, &p->uf, 1, + CXTranslationUnit_DetailedPreprocessingRecord); + for (int i=0;itu) + { + for (uint i=0, n=clang_getNumDiagnostics(p->tu); i!=n; ++i) + { + CXDiagnostic diag = clang_getDiagnostic(p->tu, i); + CXString string = clang_formatDiagnostic(diag, + clang_defaultDiagnosticDisplayOptions()); + err("%s\n",clang_getCString(string)); + clang_disposeString(string); + } + 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->uf.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); + } + else + { + p->tokens = 0; + p->numTokens = 0; + p->cursors = 0; + err("Failed to parse translation unit %s\n",fileName); + } +} + +void ClangParser::finish() +{ + static bool clangAssistedParsing = Config_getBool("CLANG_ASSISTED_PARSING"); + if (!clangAssistedParsing) return; + //printf("ClangParser::finish()\n"); + delete[] p->cursors; + clang_disposeTokens(p->tu,p->tokens,p->numTokens); + clang_disposeTranslationUnit(p->tu); + clang_disposeIndex(p->index); + free((void *)p->uf.Filename); + p->source.resize(0); + p->uf.Contents = 0; + p->uf.Filename = 0; + p->uf.Contents = 0; + p->tokens = 0; + p->numTokens = 0; + p->cursors = 0; +} + +int ClangParser::Private::getCurrentTokenLine() +{ + 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; +} + +/** Looks for \a symbol which should be found at \a line and returns + * a Clang unique identifier for the symbol. + */ +QCString ClangParser::lookup(uint line,const char *symbol) +{ + //printf("ClangParser::lookup(%d,%s)\n",line,symbol); + QCString result; + if (symbol==0) return result; + static bool clangAssistedParsing = Config_getBool("CLANG_ASSISTED_PARSING"); + if (!clangAssistedParsing) return result; + + int sl = strlen(symbol); + uint l = p->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(); + } + else + { + p->curToken/=2; // binary search backward + l = p->getCurrentTokenLine(); + } + } + bool found=FALSE; + while (l<=line && p->curTokennumTokens && !found) + { + CXString tokenString = clang_getTokenSpelling(p->tu, p->tokens[p->curToken]); + //if (l==line) + //{ + // printf("try to match symbol %s with token %s\n",symbol,clang_getCString(tokenString)); + //} + const char *ts = clang_getCString(tokenString); + int tl = strlen(ts); + int startIndex = p->curToken; + if (l==line && strncmp(ts,symbol,tl)==0) // found partial match at the correct line + { + int offset = tl; + while (offsetcurToken++; + if (p->curToken>=p->numTokens) + { + break; // end of token stream + } + l = p->getCurrentTokenLine(); + clang_disposeString(tokenString); + tokenString = clang_getTokenSpelling(p->tu, p->tokens[p->curToken]); + ts = clang_getCString(tokenString); + tl = ts ? strlen(ts) : 0; + // skip over any spaces in the symbol + char c; + while (offset'%s'\n",ts,symbol+offset); + break; // no match + } + //printf("partial match '%s'<->'%s'\n",ts,symbol+offset); + offset+=tl; + } + if (offset==sl) // symbol matches the token(s) + { + CXCursor c = p->cursors[p->curToken]; + CXString usr = clang_getCursorUSR(c); + //printf("found full match %s usr='%s'\n",symbol,clang_getCString(usr)); + result = clang_getCString(usr); + clang_disposeString(usr); + found=TRUE; + } + else // reset token cursor to start of the search + { + p->curToken = startIndex; + } + } + clang_disposeString(tokenString); + p->curToken++; + if (p->curTokennumTokens) + { + l = p->getCurrentTokenLine(); + } + } + //if (!found) + //{ + // printf("Did not find symbol %s at line %d :-(\n",symbol,line); + //} + //else + //{ + // printf("Found symbol %s usr=%s\n",symbol,result.data()); + //} + 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(OutputList &ol,FileDef *fd,uint line) +{ + Definition *d = fd ? fd->getSourceDefinition(line) : 0; + if (d && d->isLinkable()) + { + MemberDef *md = fd->getSourceMember(line); + if (md && md->isLinkable()) // link to member + { + ol.writeLineNumber(md->getReference(), + md->getOutputFileBase(), + md->anchor(), + line); + } + else // link to compound + { + ol.writeLineNumber(d->getReference(), + d->getOutputFileBase(), + d->anchor(), + line); + } + } + else // no link + { + ol.writeLineNumber(0,0,0,line); + } +} + +static void codifyLines(OutputList &ol,FileDef *fd,const char *text, + uint &line,uint &column,const char *fontClass=0) +{ + if (fontClass) ol.startFontClass(fontClass); + const char *p=text,*sp=p; + char c; + bool done=FALSE; + while (!done) + { + sp=p; + while ((c=*p++) && c!='\n') { column++; } + if (c=='\n') + { + line++; + int l = (int)(p-sp-1); + column=l+1; + char *tmp = (char*)malloc(l+1); + memcpy(tmp,sp,l); + tmp[l]='\0'; + ol.codify(tmp); + free(tmp); + if (fontClass) ol.endFontClass(); + ol.endCodeLine(); + ol.startCodeLine(TRUE); + writeLineNumber(ol,fd,line); + if (fontClass) ol.startFontClass(fontClass); + } + else + { + ol.codify(sp); + done=TRUE; + } + } + if (fontClass) ol.endFontClass(); +} + +static void writeMultiLineCodeLink(OutputList &ol, + FileDef *fd,uint &line,uint &column, + const char *ref,const char *file, + const char *anchor,const char *text, + const char *tooltip) +{ + bool done=FALSE; + char *p=(char *)text; + while (!done) + { + char *sp=p; + char c; + while ((c=*p++) && c!='\n') { column++; } + if (c=='\n') + { + line++; + *(p-1)='\0'; + //printf("writeCodeLink(%s,%s,%s,%s)\n",ref,file,anchor,sp); + ol.writeCodeLink(ref,file,anchor,sp,tooltip); + ol.endCodeLine(); + ol.startCodeLine(TRUE); + writeLineNumber(ol,fd,line); + } + else + { + //printf("writeCodeLink(%s,%s,%s,%s)\n",ref,file,anchor,sp); + ol.writeCodeLink(ref,file,anchor,sp,tooltip); + done=TRUE; + } + } +} + +void ClangParser::linkInclude(OutputList &ol,FileDef *fd, + uint &line,uint &column,const char *text) +{ + QCString incName = text; + incName = incName.mid(1,incName.length()-2); // strip ".." or <..> + FileDef *ifd=0; + FileName *fn = Doxygen::inputNameDict->find(incName); + if (fn) + { + bool found=false; + FileNameIterator fni(*fn); + // for each include name + for (fni.toFirst();!found && (ifd=fni.current());++fni) + { + // see if this source file actually includes the file + found = fd->isIncluded(ifd->absFilePath()); + //printf(" include file %s found=%d\n",ifd->absFilePath().data(),found); + } + } + if (ifd) + { + ol.writeCodeLink(ifd->getReference(),ifd->getOutputFileBase(),0,text,ifd->briefDescriptionAsTooltip()); + } + else + { + codifyLines(ol,ifd,text,line,column,"preprocessor"); + } +} + +void ClangParser::linkMacro(OutputList &ol,FileDef *fd, + uint &line,uint &column,const char *text) +{ + MemberName *mn=Doxygen::functionNameSDict->find(text); + if (mn) + { + MemberNameIterator mni(*mn); + MemberDef *md; + for (mni.toFirst();(md=mni.current());++mni) + { + if (md->isDefine()) + { + writeMultiLineCodeLink(ol, + fd,line,column, + md->getReference(), + md->getOutputFileBase(), + md->anchor(), + text, + md->briefDescriptionAsTooltip() + ); + return; + } + } + } + codifyLines(ol,fd,text,line,column); +} + +void ClangParser::linkIdentifier(OutputList &ol,FileDef *fd, + uint &line,uint &column,const char *text,int tokenIndex) +{ + CXCursor c = p->cursors[tokenIndex]; + CXCursor r = clang_getCursorReferenced(c); + if (!clang_equalCursors(r, c)) + { + c=r; // link to referenced location + } + CXCursor t = clang_getSpecializedCursorTemplate(c); + if (!clang_Cursor_isNull(t) && !clang_equalCursors(t,c)) + { + c=t; // link to template + } + CXString usr = clang_getCursorUSR(c); + const char *usrStr = clang_getCString(usr); + + Definition *d = usrStr ? Doxygen::clangUsrMap->find(usrStr) : 0; + //CXCursorKind kind = clang_getCursorKind(c); + //if (d==0) + //{ + // printf("didn't find definition for '%s' usr='%s' kind=%d\n", + // text,usrStr,kind); + //} + //else + //{ + // printf("found definition for '%s' usr='%s' name='%s'\n", + // text,usrStr,d->name().data()); + //} + if (d && d->isLinkable()) + { + writeMultiLineCodeLink(ol, + fd,line,column, + d->getReference(), + d->getOutputFileBase(), + d->anchor(), + text, + d->briefDescriptionAsTooltip() + ); + } + else + { + codifyLines(ol,fd,text,line,column); + } + clang_disposeString(usr); +} + +void ClangParser::writeSources(OutputList &ol,FileDef *fd) +{ + unsigned int line=1,column=1; + QCString lineNumber,lineAnchor; + ol.startCodeLine(TRUE); + writeLineNumber(ol,fd,line); + for (unsigned int i=0;inumTokens;i++) + { + CXSourceLocation start = clang_getTokenLocation(p->tu, p->tokens[i]); + unsigned int l, c; + clang_getSpellingLocation(start, 0, &l, &c, 0); + if (l > line) column = 1; + while (linetu, p->tokens[i]); + char const *s = clang_getCString(tokenString); + CXCursorKind cursorKind = clang_getCursorKind(p->cursors[i]); + CXTokenKind tokenKind = clang_getTokenKind(p->tokens[i]); + printf("%d:%d %s cursorKind=%d tokenKind=%d\n",line,column,s,cursorKind,tokenKind); + switch (tokenKind) + { + case CXToken_Keyword: + if (strcmp(s,"operator")==0) + { + linkIdentifier(ol,fd,line,column,s,i); + } + else + { + codifyLines(ol,fd,s,line,column, + cursorKind==CXCursor_PreprocessingDirective ? "preprocessor" : + keywordToType(s)); + } + break; + case CXToken_Literal: + if (cursorKind==CXCursor_InclusionDirective) + { + linkInclude(ol,fd,line,column,s); + } + else if (s[0]=='"' || s[0]=='\'') + { + codifyLines(ol,fd,s,line,column,"stringliteral"); + } + else + { + codifyLines(ol,fd,s,line,column); + } + break; + case CXToken_Comment: + codifyLines(ol,fd,s,line,column,"comment"); + break; + //case CXToken_Punctuation: return "CXToken_Punctation"; + //case CXToken_Identifier: return "CXToken_Indentifier"; + default: + switch (cursorKind) + { + case CXCursor_PreprocessingDirective: + codifyLines(ol,fd,s,line,column,"preprocessor"); + break; + case CXCursor_MacroDefinition: + codifyLines(ol,fd,s,line,column,"preprocessor"); + break; + case CXCursor_InclusionDirective: + linkInclude(ol,fd,line,column,s); + break; + case CXCursor_MacroExpansion: + linkMacro(ol,fd,line,column,s); + break; + default: + if (tokenKind==CXToken_Identifier) + { + linkIdentifier(ol,fd,line,column,s,i); + } + else + { + codifyLines(ol,fd,s,line,column); + } + break; + } + } + clang_disposeString(tokenString); + } + ol.endCodeLine(); +} + +ClangParser::ClangParser() +{ + p = new Private; +} + +ClangParser::~ClangParser() +{ + delete p; +} + +//-------------------------------------------------------------------------- +#else // use stubbed functionality in case libclang support is disabled. + +void ClangParser::start(const char *) +{ +} + +void ClangParser::finish() +{ +} + +QCString ClangParser::lookup(uint,const char *) +{ + return ""; +} + +void ClangParser::writeSources(OutputList &,FileDef *) +{ +} + +ClangParser::ClangParser() +{ +} + +ClangParser::~ClangParser() +{ +} + + +#endif +//-------------------------------------------------------------------------- + diff --git a/src/clangparser.h b/src/clangparser.h new file mode 100644 index 0000000..fc56b3a --- /dev/null +++ b/src/clangparser.h @@ -0,0 +1,35 @@ +#ifndef CLANGPARSER_H +#define CLANGPARSER_H + +#include + +class OutputList; +class FileDef; + +class ClangParser +{ + public: + static ClangParser *instance(); + void start(const char *fileName); + void finish(); + QCString lookup(uint line,const char *symbol); + void writeSources(OutputList &ol,FileDef *fd); + + private: + void linkIdentifier(OutputList &ol,FileDef *fd, + uint &line,uint &column, + const char *text,int tokenIndex); + void linkMacro(OutputList &ol,FileDef *fd, + uint &line,uint &column, + const char *text); + void linkInclude(OutputList &ol,FileDef *fd, + uint &line,uint &column, + const char *text); + class Private; + Private *p; + ClangParser(); + virtual ~ClangParser(); + static ClangParser *s_instance; +}; + +#endif diff --git a/src/classdef.cpp b/src/classdef.cpp index d9ee46d..bb29882 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -3503,8 +3503,9 @@ ClassDef *ClassDef::insertTemplateInstance(const QCString &fileName, if (templateClass==0) { Debug::print(Debug::Classes,0," New template instance class `%s'`%s'\n",name().data(),templSpec.data()); + QCString tcname = removeRedundantWhiteSpace(localName()+templSpec); templateClass = new ClassDef( - fileName,startLine,startColumn,localName()+templSpec,ClassDef::Class); + fileName,startLine,startColumn,tcname,ClassDef::Class); templateClass->setTemplateMaster(this); templateClass->setOuterScope(getOuterScope()); templateClass->setHidden(isHidden()); @@ -3525,7 +3526,8 @@ ClassDef *ClassDef::getVariableInstance(const char *templSpec) if (templateClass==0) { Debug::print(Debug::Classes,0," New template variable instance class `%s'`%s'\n",qPrint(name()),qPrint(templSpec)); - templateClass = new ClassDef("",1,1,name()+templSpec, + QCString tcname = removeRedundantWhiteSpace(name()+templSpec); + templateClass = new ClassDef("",1,1,tcname, ClassDef::Class,0,0,FALSE); templateClass->addMembersToTemplateInstance( this, templSpec ); templateClass->setTemplateMaster(this); @@ -4164,13 +4166,13 @@ void ClassDef::writeMemberDeclarations(OutputList &ol,MemberListType lt,const QC //static bool optimizeVhdl = Config_getBool("OPTIMIZE_OUTPUT_VHDL"); if (ml) { - ml->writeDeclarations(ol,this,0,0,0,title,subTitle,FALSE,showInline,inheritedFrom); + ml->writeDeclarations(ol,this,0,0,0,title,subTitle,definitionType(),FALSE,showInline,inheritedFrom); if (lt2!=-1) { MemberList * ml2 = getMemberList((MemberListType)lt2); if (ml2) { - ml2->writeDeclarations(ol,this,0,0,0,0,0,FALSE,showInline,inheritedFrom); + ml2->writeDeclarations(ol,this,0,0,0,0,0,definitionType(),FALSE,showInline,inheritedFrom); } } } @@ -4226,7 +4228,7 @@ void ClassDef::writePlainMemberDeclaration(OutputList &ol, if (ml) { ml->setInGroup(inGroup); - ml->writePlainDeclarations(ol,this,0,0,0,inheritedFrom,inheritId); + ml->writePlainDeclarations(ol,this,0,0,0,definitionType(),inheritedFrom,inheritId); } } diff --git a/src/classdef.h b/src/classdef.h index 19bf976..9db5cae 100644 --- a/src/classdef.h +++ b/src/classdef.h @@ -72,6 +72,7 @@ class ClassDef : public Definition * \param startColumn column number where the definition of this compound * starts. * \param name the name of this compound (including scope) + * \param symId unique Id for this symbol * \param ct the kind of Compound * \param ref the tag file from which this compound is extracted * or 0 if the compound doesn't come from a tag file diff --git a/src/code.h b/src/code.h index c2ed7e7..3825ac1 100644 --- a/src/code.h +++ b/src/code.h @@ -21,6 +21,8 @@ class CodeOutputInterface; class FileDef; class MemberDef; +class QCString; +class Definition; void parseCCode(CodeOutputInterface &,const char *,const QCString &, bool ,const char *,FileDef *fd, diff --git a/src/code.l b/src/code.l index 2269709..2026f0c 100644 --- a/src/code.l +++ b/src/code.l @@ -492,7 +492,6 @@ static void startCodeLine() { g_currentDefinition = d; g_currentMemberDef = g_sourceFileDef->getSourceMember(g_yyLineNr); - //printf("->startCodeLine(%s)=%p\n",d->name().data(),g_currentMemberDef); g_insideBody = FALSE; g_searchingForBody = TRUE; g_realScope = d->name(); @@ -526,6 +525,7 @@ static void startCodeLine() g_code->writeLineNumber(0,0,0,g_yyLineNr); } } + DBG_CTX((stderr,"startCodeLine(%d)\n",g_yyLineNr)); g_code->startCodeLine(g_sourceFileDef && g_lineNumbers); if (g_currentFontClass) { @@ -539,6 +539,7 @@ static void startFontClass(const char *s); static void endCodeLine() { + DBG_CTX((stderr,"endCodeLine(%d)\n",g_yyLineNr)); endFontClass(); g_code->endCodeLine(); } @@ -830,13 +831,12 @@ static void updateCallContextForSmartPointer() } } -static const char* fileLocation() +static QCString fileLocation() { - const int maxLen=4096; - static char floc[maxLen+1]; - floc[maxLen]='\0'; - snprintf(floc,maxLen,"%s:%d:%d",g_sourceFileDef?g_sourceFileDef->absFilePath().data():"[unknown]",g_yyLineNr,g_yyColNr); - return floc; + QCString result = g_sourceFileDef?g_sourceFileDef->absFilePath():QCString("[unknown]"); + result+=":"+QCString().setNum(g_yyLineNr); + result+=":"+QCString().setNum(g_yyColNr); + return result; } static void addDocCrossReference(MemberDef *src,MemberDef *dst) @@ -930,8 +930,6 @@ static bool getLinkInScope(const QCString &c, // scope } //printf("d->getReference()=`%s' d->getOutputBase()=`%s' name=`%s' member name=`%s'\n",d->getReference().data(),d->getOutputFileBase().data(),d->name().data(),md->name().data()); - ol.linkableSymbol(g_yyLineNr,md->name(),md, - g_currentMemberDef ? g_currentMemberDef : g_currentDefinition); writeMultiLineCodeLink(ol,md->getReference(), md->getOutputFileBase(), md->anchor(), @@ -1048,8 +1046,6 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,const char *clName g_anchorCount++; } } - ol.linkableSymbol(g_yyLineNr,cd->name(),cd, - g_currentMemberDef ? g_currentMemberDef : g_currentDefinition); writeMultiLineCodeLink(ol,cd->getReference(),cd->getOutputFileBase(),cd->anchor(),clName,cd->briefDescriptionAsTooltip()); addToSearchIndex(className); g_theCallContext.setClass(cd); @@ -1109,8 +1105,6 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,const char *clName { text=clName; } - ol.linkableSymbol(g_yyLineNr,md->name(),md, - g_currentMemberDef ? g_currentMemberDef : g_currentDefinition); writeMultiLineCodeLink(ol,md->getReference(),md->getOutputFileBase(),md->anchor(),text,md->briefDescriptionAsTooltip()); addToSearchIndex(clName); if (g_currentMemberDef) @@ -1124,8 +1118,6 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,const char *clName // nothing found, just write out the word DBG_CTX((stderr,"not found!\n")); - ol.linkableSymbol(g_yyLineNr,clName,0, - g_currentMemberDef?g_currentMemberDef:g_currentDefinition); codifyLines(clName); addToSearchIndex(clName); } @@ -1177,8 +1169,6 @@ static bool generateClassMemberLink(CodeOutputInterface &ol,MemberDef *xmd,const } // write the actual link - ol.linkableSymbol(g_yyLineNr,xmd->name(),xmd, - g_currentMemberDef ? g_currentMemberDef : g_currentDefinition); writeMultiLineCodeLink(ol,xmd->getReference(), xmd->getOutputFileBase(),xmd->anchor(),memName,xmd->briefDescriptionAsTooltip()); addToSearchIndex(memName); @@ -1298,8 +1288,6 @@ static void generateMemberLink(CodeOutputInterface &ol,const QCString &varName, } } // nothing found -> write result as is - ol.linkableSymbol(g_yyLineNr,memName,0, - g_currentMemberDef?g_currentMemberDef:g_currentDefinition); codifyLines(memName); addToSearchIndex(memName); return; @@ -1552,8 +1540,6 @@ static void writeObjCMethodCall(ObjCCallCtx *ctx) { if (ctx->method && ctx->method->isLinkable()) { - g_code->linkableSymbol(g_yyLineNr,ctx->method->name(),ctx->method, - g_currentMemberDef ? g_currentMemberDef : g_currentDefinition); writeMultiLineCodeLink(*g_code, ctx->method->getReference(), ctx->method->getOutputFileBase(), @@ -1567,8 +1553,6 @@ static void writeObjCMethodCall(ObjCCallCtx *ctx) } else { - g_code->linkableSymbol(g_yyLineNr,pName->data(),0, - g_currentMemberDef ? g_currentMemberDef : g_currentDefinition); codifyLines(pName->data()); } } @@ -1640,8 +1624,6 @@ static void writeObjCMethodCall(ObjCCallCtx *ctx) } else if (ctx->objectVar && ctx->objectVar->isLinkable()) // object is class variable { - g_code->linkableSymbol(g_yyLineNr,ctx->objectVar->name(),ctx->objectVar, - g_currentMemberDef ? g_currentMemberDef : g_currentDefinition); writeMultiLineCodeLink(*g_code, ctx->objectVar->getReference(), ctx->objectVar->getOutputFileBase(), @@ -1659,8 +1641,6 @@ static void writeObjCMethodCall(ObjCCallCtx *ctx) ) // object is class name { ClassDef *cd = ctx->objectType; - g_code->linkableSymbol(g_yyLineNr,cd->name(),cd, - g_currentMemberDef ? g_currentMemberDef : g_currentDefinition); writeMultiLineCodeLink(*g_code, cd->getReference(), cd->getOutputFileBase(), @@ -1675,8 +1655,6 @@ static void writeObjCMethodCall(ObjCCallCtx *ctx) if (cd && cd->isLinkable()) { if (ctx->objectType==0) ctx->objectType=cd; - g_code->linkableSymbol(g_yyLineNr,cd->name(),cd, - g_currentMemberDef ? g_currentMemberDef : g_currentDefinition); writeMultiLineCodeLink(*g_code, cd->getReference(), cd->getOutputFileBase(), @@ -1686,8 +1664,6 @@ static void writeObjCMethodCall(ObjCCallCtx *ctx) } else { - g_code->linkableSymbol(g_yyLineNr,pObject->data(),0, - g_currentMemberDef ? g_currentMemberDef : g_currentDefinition); codifyLines(pObject->data()); } } @@ -1750,8 +1726,6 @@ static void writeObjCMethodCall(ObjCCallCtx *ctx) QCString *pWord = g_wordDict.find(refId); if (pWord) { - g_code->linkableSymbol(g_yyLineNr,pWord->data(),0, - g_currentMemberDef ? g_currentMemberDef : g_currentDefinition); codifyLines(pWord->data()); } } @@ -1831,7 +1805,7 @@ TEMPLIST "<"[^\"\}\{\(\)\/\n\>]*">" SCOPETNAME (((({ID}{TEMPLIST}?){BN}*)?{SEP}{BN}*)*)((~{BN}*)?{ID}) SCOPEPREFIX ({ID}{TEMPLIST}?{BN}*{SEP}{BN}*)+ KEYWORD_OBJC ("@public"|"@private"|"@protected"|"@class"|"@implementation"|"@interface"|"@end"|"@selector"|"@protocol"|"@optional"|"@required"|"@throw"|"@synthesize"|"@property") -KEYWORD ("asm"|"__assume"|"auto"|"class"|"const"|"delete"|"enum"|"explicit"|"extern"|"false"|"friend"|"gcnew"|"gcroot"|"get"|"inline"|"internal"|"mutable"|"namespace"|"new"|"nullptr"|"override"|"operator"|"pin_ptr"|"private"|"protected"|"public"|"raise"|"register"|"remove"|"self"|"set"|"sizeof"|"static"|"struct"|"__super"|"function"|"template"|"generic"|"this"|"true"|"typedef"|"typeid"|"typename"|"union"|"using"|"virtual"|"volatile"|"abstract"|"final"|"import"|"synchronized"|"transient"|{KEYWORD_OBJC}) +KEYWORD ("asm"|"__assume"|"auto"|"class"|"const"|"delete"|"enum"|"explicit"|"extern"|"false"|"friend"|"gcnew"|"gcroot"|"get"|"inline"|"internal"|"mutable"|"namespace"|"new"|"nullptr"|"override"|"operator"|"pin_ptr"|"private"|"protected"|"public"|"raise"|"register"|"remove"|"self"|"sizeof"|"static"|"struct"|"__super"|"function"|"template"|"generic"|"this"|"true"|"typedef"|"typeid"|"typename"|"union"|"using"|"virtual"|"volatile"|"abstract"|"final"|"import"|"synchronized"|"transient"|{KEYWORD_OBJC}) FLOWKW ("break"|"case"|"catch"|"continue"|"default"|"do"|"else"|"finally"|"for"|"foreach"|"for each"|"goto"|"if"|"return"|"switch"|"throw"|"throws"|"try"|"while"|"@try"|"@catch"|"@finally") TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"object"|"short"|"signed"|"unsigned"|"void"|"wchar_t"|"size_t"|"boolean"|"id"|"SEL"|"string"|"nullptr") CASTKW ("const_cast"|"dynamic_cast"|"reinterpret_cast"|"static_cast") @@ -1986,8 +1960,6 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" BEGIN(ObjCParams); } {ID} { - g_code->linkableSymbol(g_yyLineNr,yytext,0, - g_currentMemberDef?g_currentMemberDef:g_currentDefinition); g_code->codify(yytext); g_parmName=yytext; g_theVarContext.addVariable(g_parmType,g_parmName); @@ -2682,8 +2654,6 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" { if (!generateClassMemberLink(*g_code,g_theCallContext.getClass(),yytext)) { - g_code->linkableSymbol(g_yyLineNr,yytext,0, - g_currentMemberDef?g_currentMemberDef:g_currentDefinition); g_code->codify(yytext); addToSearchIndex(yytext); } @@ -2691,8 +2661,6 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" } else { - g_code->linkableSymbol(g_yyLineNr,yytext,0, - g_currentMemberDef?g_currentMemberDef:g_currentDefinition); g_code->codify(yytext); addToSearchIndex(yytext); g_name.resize(0); @@ -2714,8 +2682,6 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" DBG_CTX((stderr,"g_theCallContext.getClass()=%p\n",g_theCallContext.getClass())); if (!generateClassMemberLink(*g_code,g_theCallContext.getClass(),yytext)) { - g_code->linkableSymbol(g_yyLineNr,yytext,0, - g_currentMemberDef?g_currentMemberDef:g_currentDefinition); g_code->codify(yytext); addToSearchIndex(yytext); } @@ -3356,7 +3322,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" if (Config_getBool("STRIP_CODE_COMMENTS")) { g_yyLineNr++; - nextCodeLine(); + //nextCodeLine(); } else { @@ -3645,6 +3611,7 @@ void parseCCode(CodeOutputInterface &od,const char *className,const QCString &s, if (g_needsTermination) { endFontClass(); + DBG_CTX((stderr,"endCodeLine(%d)\n",g_yyLineNr)); g_code->endCodeLine(); } if (cleanupSourceDef) diff --git a/src/commentcnv.l b/src/commentcnv.l index 46b8938..97f5194 100644 --- a/src/commentcnv.l +++ b/src/commentcnv.l @@ -341,7 +341,8 @@ void replaceComment(int offset); \n { /* new line */ copyToOutput(yytext,(int)yyleng); } -("//!"|"///"[/]*)/.*\n[ \t]*"//"[\/!][^\/] { /* start C++ style special comment block */ +"//!"/.*\n[ \t]*"//"[\/!][^\/] | /* start C++ style special comment block */ +("///"[/]*)/[^/].*\n[ \t]*"//"[\/!][^\/] { /* start C++ style special comment block */ if (g_mlBrief) { REJECT; // bail out if we do not need to convert diff --git a/src/commentscan.l b/src/commentscan.l index b851d81..9b2994a 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -1188,11 +1188,23 @@ RCSTAG "$"{ID}":"[^\n$]+"$" { // see bug 613024, we need to put the newlines after ending the XRef section. setOutput(OutputDoc); - addOutput("\n\n"); + int i; + for (i=0;i @@ -262,10 +262,10 @@ can mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in case of backward compatibilities issues. ' defval='1'/>