diff options
76 files changed, 3674 insertions, 366 deletions
@@ -13,4 +13,4 @@ /doxygen_docs /doxygen.tag -/build +/build* diff --git a/addon/doxmlparser/src/dochandler.h b/addon/doxmlparser/src/dochandler.h index 4340dbd..59af4e3 100644 --- a/addon/doxmlparser/src/dochandler.h +++ b/addon/doxmlparser/src/dochandler.h @@ -571,7 +571,7 @@ class EMailHandler : public DocEMailImpl, public BaseHandler<EMailHandler> //----------------------------------------------------------------------------- -/* \brief Node representing a link to an URL +/* \brief Node representing a link to a URL * */ class ULinkHandler : public DocULinkImpl, public BaseHandler<ULinkHandler> diff --git a/addon/doxywizard/config_doxyw.l b/addon/doxywizard/config_doxyw.l index 7874a19..960b7cb 100644 --- a/addon/doxywizard/config_doxyw.l +++ b/addon/doxywizard/config_doxyw.l @@ -540,22 +540,34 @@ void writeStringValue(QTextStream &t,QTextCodec *codec,const QString &s) { QChar c; bool needsEscaping=false; + bool needsHashEscaping=false; // convert the string back to it original encoding //QByteArray se = codec->fromUnicode(s); t.setCodec(codec); const QChar *p=s.data(); if (!s.isEmpty() && !p->isNull()) { - while (!(c=*p++).isNull() && !needsEscaping) + if (*p != QChar::fromLatin1('"')) { - needsEscaping = (c==QChar::fromLatin1(' ') || - c==QChar::fromLatin1('\n') || - c==QChar::fromLatin1('\t') || - c==QChar::fromLatin1('"')); + while (!(c=*p++).isNull() && !needsEscaping) + { + needsEscaping = (c==QChar::fromLatin1(' ') || + c==QChar::fromLatin1('\n') || + c==QChar::fromLatin1('\t') || + c==QChar::fromLatin1('"')); + } + p=s.data(); + while (!(c=*p++).isNull() && !needsHashEscaping) + { + needsHashEscaping = (c==QChar::fromLatin1('#')); + } } - if (needsEscaping) + if (needsHashEscaping || needsEscaping) { t << "\""; + } + if (needsEscaping) + { p=s.data(); while (!p->isNull()) { @@ -564,12 +576,15 @@ void writeStringValue(QTextStream &t,QTextCodec *codec,const QString &s) if (*p ==QChar::fromLatin1('"')) t << "\\"; // escape quotes t << *p++; } - t << "\""; } else { t << s; } + if (needsHashEscaping || needsEscaping) + { + t << "\""; + } } } diff --git a/addon/doxywizard/wizard.cpp b/addon/doxywizard/wizard.cpp index b320aaa..ae8fa61 100644 --- a/addon/doxywizard/wizard.cpp +++ b/addon/doxywizard/wizard.cpp @@ -1210,18 +1210,23 @@ void Step4::setCallerGraphEnabled(int state) void Step4::init() { + int id = 0; if (getBoolOption(m_modelData,STR_HAVE_DOT)) { m_diagramModeGroup->button(2)->setChecked(true); // Dot + id = 2; } else if (getBoolOption(m_modelData,STR_CLASS_DIAGRAMS)) { m_diagramModeGroup->button(1)->setChecked(true); // Builtin diagrams + id = 1; } else { m_diagramModeGroup->button(0)->setChecked(true); // no diagrams + id = 0; } + m_dotGroup->setEnabled(id==2); m_dotClass->setChecked(getBoolOption(m_modelData,STR_CLASS_GRAPH)); m_dotCollaboration->setChecked(getBoolOption(m_modelData,STR_COLLABORATION_GRAPH)); m_dotInheritance->setChecked(getBoolOption(m_modelData,STR_GRAPHICAL_HIERARCHY)); diff --git a/doc/arch.doc b/doc/arch.doc index e5fbbdc..ed9d579 100644 --- a/doc/arch.doc +++ b/doc/arch.doc @@ -41,14 +41,14 @@ available through the global functions \c Config_getXXX(), where \c XXX is the type of the option. The argument of these function is a string naming the option as it appears in the configuration file. For instance: \c Config_getBool("GENERATE_TESTLIST") returns a reference to a boolean -value that is \c TRUE if the test list was enabled in the config file. +value that is \c TRUE if the test list was enabled in the configuration file. The function \c readConfiguration() in \c src/doxygen.cpp reads the command line options and then calls the configuration parser. <h3>C Preprocessor</h3> -The input files mentioned in the config file are (by default) fed to the +The input files mentioned in the configuration file are (by default) fed to the C Preprocessor (after being piped through a user defined filter if available). The way the preprocessor works differs somewhat from a standard C Preprocessor. @@ -139,8 +139,8 @@ strings and executes the commands it finds in it (this is the second pass in parsing the documentation). It writes the result directly to the output generators. -The parser is written in C++ and can be found in src/docparser.cpp. The -tokens that are eaten by the parser come from src/doctokenizer.l. +The parser is written in C++ and can be found in \c src/docparser.cpp. The +tokens that are eaten by the parser come from \c src/doctokenizer.l. Code fragments found in the comment blocks are passed on to the source parser. The main entry point for the documentation parser is \c validatingParseDoc() @@ -190,12 +190,12 @@ could extract information from the XML output. Possible tools could be: Since doxygen uses a lot of \c flex code it is important to understand how \c flex works (for this one should read the \c man page) and to understand what it is doing when \c flex is parsing some input. -Fortunately, when flex is used with the `-d` option it outputs what rules +Fortunately, when \c flex is used with the `-d` option it outputs what rules matched. This makes it quite easy to follow what is going on for a particular input fragment. -To make it easier to toggle debug information for a given flex file I -wrote the following perl script, which automatically adds or removes `-d` +To make it easier to toggle debug information for a given \c flex file I +wrote the following \c perl script, which automatically adds or removes `-d` from the correct line in the \c Makefile: \verbatim @@ -240,11 +240,16 @@ $now = time; utime $now, $now, $file; \endverbatim Another way to get rules matching / debugging information -from the \c flex code is setting LEX_FLAGS with \c make (`make LEX_FLAGS=-d`). +from the \c flex code is setting \c LEX_FLAGS with \c make (`make LEX_FLAGS=-d`). Note that by running doxygen with `-d lex` you get information about which `flex codefile` is used. +<h3>Testing</h3> + +Doxygen has a small set of tests available to test, some, code integrity. +The tests can be run by means of the command `make tests`. When only one or a few tests are required one can set the variable \c TEST_FLAGS when running the test e.g. `make TEST_FLAGS="--id 5" tests` or for multiple tests `make TEST_FLAGS="--id 5 --id 7" tests`. + \htmlonly Return to the <a href="index.html">index</a>. \endhtmlonly diff --git a/doc/changelog.doc b/doc/changelog.doc index 0dcbfa9..50f2209 100644 --- a/doc/changelog.doc +++ b/doc/changelog.doc @@ -20,7 +20,7 @@ <li>Bug <a href="https://bugzilla.gnome.org/show_bug.cgi?id=743367">743367</a> - Duplicate attribute (target="_top" target="_top") generated in .SVG files [<a href="http://github.com/doxygen/doxygen/commit/97bfbfa6c4d4eb07ac8c60545086c3370e9683b8">view</a>] <li>Bug <a href="https://bugzilla.gnome.org/show_bug.cgi?id=775493">775493</a> - Usage of underscore's in parameter names [<a href="http://github.com/doxygen/doxygen/commit/c10af45c61a1f9b25c514f397ace16c94cc7c8df">view</a>] <li>Bug <a href="https://bugzilla.gnome.org/show_bug.cgi?id=776791">776791</a> - [1.8.13 Regression] Segfault building the breathe docs [<a href="http://github.com/doxygen/doxygen/commit/0f02761a158a5e9ddbd5801682482af8986dbc35">view</a>] -<li>Bug <a href="https://bugzilla.gnome.org/show_bug.cgi?id=776870">776870</a> - XML Parsing Error for operator<< methods when outputing to XHTML [<a href="http://github.com/doxygen/doxygen/commit/0e8530e42b69c909ef2c26468b24dfb88cc0997f">view</a>] +<li>Bug <a href="https://bugzilla.gnome.org/show_bug.cgi?id=776870">776870</a> - XML Parsing Error for operator<< methods when outputting to XHTML [<a href="http://github.com/doxygen/doxygen/commit/0e8530e42b69c909ef2c26468b24dfb88cc0997f">view</a>] <li>Bug <a href="https://bugzilla.gnome.org/show_bug.cgi?id=776964">776964</a> - Menu does not work without Javascript [<a href="http://github.com/doxygen/doxygen/commit/1be97720b7820361e85242d08d4cac3e46570bfe">view</a>] <li>Bug <a href="https://bugzilla.gnome.org/show_bug.cgi?id=776988">776988</a> - Too greedy behavior of @ref const matching [<a href="http://github.com/doxygen/doxygen/commit/04001c8926fb0f37dfcf284b3637b182125bba75">view</a>] <li>Bug <a href="https://bugzilla.gnome.org/show_bug.cgi?id=778730">778730</a> - doxygen build fails [<a href="http://github.com/doxygen/doxygen/commit/bb5c8dd29782ecbb05a4ef9788f2507e9a156848">view</a>] @@ -153,7 +153,7 @@ <li>Bug <a href="https://bugzilla.gnome.org/show_bug.cgi?id=773354">773354</a> - "name" attribute of image map not urlencoded, not working in Chrome [<a href="http://github.com/doxygen/doxygen/commit/6300c03b6201ca7981388a6d3c01486f8a8adba0">view</a>] <li>Bug <a href="https://bugzilla.gnome.org/show_bug.cgi?id=774138">774138</a> - Please add HTML classes to "Definition at..." & "Referenced by..." for CSS [<a href="http://github.com/doxygen/doxygen/commit/d2593e56cd52ecee2424d844916f95e12fef27c8">view</a>] <li>Bug <a href="https://bugzilla.gnome.org/show_bug.cgi?id=774273">774273</a> - INLINE_SIMPLE_STRUCTS with enums in classes does not work [<a href="http://github.com/doxygen/doxygen/commit/71d7a9399db016cba83ccd63c6ba7e0fac1cd44d">view</a>] -<li>Bug <a href="https://bugzilla.gnome.org/show_bug.cgi?id=774514">774514</a> - Modify in some pronounciation expression in Korean [<a href="http://github.com/doxygen/doxygen/commit/cd3e39d7db634d9e11afc8e46269eb509ae10e40">view</a>] +<li>Bug <a href="https://bugzilla.gnome.org/show_bug.cgi?id=774514">774514</a> - Modify in some pronunciation expression in Korean [<a href="http://github.com/doxygen/doxygen/commit/cd3e39d7db634d9e11afc8e46269eb509ae10e40">view</a>] <li>Bug <a href="https://bugzilla.gnome.org/show_bug.cgi?id=774949">774949</a> - Unknown reference in manual [<a href="http://github.com/doxygen/doxygen/commit/dde15c9748053ecb68ba046ebd0fdfe625be0e2e">view</a>] <li>Bug <a href="https://bugzilla.gnome.org/show_bug.cgi?id=775245">775245</a> - referencing Python files via tagfile broken [<a href="http://github.com/doxygen/doxygen/commit/dc02bb977ebc6c683012c106e16e0190ac72b454">view</a>] <li>Add NVARCHAR as a SQL type [<a href="http://github.com/doxygen/doxygen/commit/6a85240e65bb5e3d59d2cd161eb8cf241e27ed7d">view</a>] @@ -1073,7 +1073,7 @@ <li>Added support for \-- and \--- to prevent interpretation as ndash and mdash [<a href="http://github.com/doxygen/doxygen/commit/385b87e08c23b1392d0e6d6fbdb6ef463fa28477">view</a>]</li> <li>Added support for elif to the template language [<a href="http://github.com/doxygen/doxygen/commit/ae3a22ba276a2e446a460274e0bff8a9bdf4af7d">view</a>]</li> <li>Added support for range tag in the template language [<a href="http://github.com/doxygen/doxygen/commit/b98846d0b57b78cd45d34e0962a8bcdc2e643e18">view</a>]</li> -<li>Alterative way to get rules information from flex [<a href="http://github.com/doxygen/doxygen/commit/224fa96dd9c9245bfdf68ee6f92160b7aa05f8d1">view</a>]</li> +<li>Alternative way to get rules information from flex [<a href="http://github.com/doxygen/doxygen/commit/224fa96dd9c9245bfdf68ee6f92160b7aa05f8d1">view</a>]</li> <li>Better message in case doxygen -u is used [<a href="http://github.com/doxygen/doxygen/commit/cfd8c2415e7d0744a00bf1990f26aab538940f20">view</a>]</li> <li>Changed "See Also" back to "See also" [<a href="http://github.com/doxygen/doxygen/commit/0754c968a4a06c8217c9301a5ca82c6212c228ec">view</a>]</li> <li>Chm don't add images multiple times [<a href="http://github.com/doxygen/doxygen/commit/3b339813794390bdce59fa1009cf71506e0cec2b">view</a>]</li> @@ -1296,7 +1296,7 @@ <li> Small spelling correction to generate an rtf extensions file -> to generate a rtf extensions file</li> <li> Some texts can be independent of \htmlonly / \latexonly</li> <li> Space missing in error message. the word 'in' and the vale of filesOption were concatenated</li> -<li> This patch contains changes regarding the build system so that the *nix and Windows systems use the same information (consistency). Some use names routine names have been changed (from .l files with -P option) to reflect the file name that generated the routines, this makes it easier to create a general procedure. A number of include / header files are files are generated from different file types (html, xml, js), due some limitations of the windows build system the generated file names had to be changed (the extension in the windows build system is only available including the '.' so e.g. the file jquery_fx.js generates now jquery_fx.js.h instead of jquery_fx_js.h) In the windows version the creation of .cpp files from .l files has been adjusted to correct for the YY_BUF_SIZE problems. Furthermore on windows (and also used on *nix) some commends have been replaced with python scripts so that on windows only python is need (besides flex and bison). On *nix also perl is required for the generation using tmake.</li> +<li> This patch contains changes regarding the build system so that the *nix and Windows systems use the same information (consistency). Some use names routine names have been changed (from .l files with -P option) to reflect the file name that generated the routines, this makes it easier to create a general procedure. A number of include / header files are files are generated from different file types (html, xml, js), due some limitations of the windows build system the generated file names had to be changed (the extension in the windows build system is only available including the '.' so e.g. the file jquery_fx.js generates now jquery_fx.js.h instead of jquery_fx_js.h) In the windows version the creation of .cpp files from .l files has been adjusted to correct for the YY_BUF_SIZE problems. Furthermore on windows (and also used on *nix) some commands have been replaced with python scripts so that on windows only python is need (besides flex and bison). On *nix also perl is required for the generation using tmake.</li> <li> Updated Visual Studio project files to include new source files</li> <li> Usage of the -d option corrected Giving an error when a wrong -d option is given. Made some error messages more consistent. Corrected usage of the exit call, in case of an error: exit(1) otherwise exit(0). A closer look should be made on exitDoxygen as it does not contain any exit statements and it is unclear (to me) when it is used.</li> <li> VHDL-2008 and arrays on unconstrained elements</li> <li> consider currentFile when searching for global symbols</li> @@ -2162,7 +2162,7 @@ make sure you add the following: <h3>Changes</h3> <ul> <li> Auto list items can now consist of multiple paragraphs. - The indentation of the (first line) of a new paragraph detemines + The indentation of the (first line) of a new paragraph determines to which list item the paragraph belongs or if it marks the end of the list. </li> <li> When UML_LOOK is enabled, relations shown on the edge of a graph @@ -2590,7 +2590,7 @@ make sure you add the following: <li> id <a href="https://bugzilla.gnome.org/show_bug.cgi?id=655178">655178</a>: Fortran: Fixed parse issue when using variable name starting with the word interface.</li> <li> id <a href="https://bugzilla.gnome.org/show_bug.cgi?id=655591">655591</a>: Improved error handling for empty html style list.</li> -<li> id <a href="https://bugzilla.gnome.org/show_bug.cgi?id=655935">655935</a>: Fixed case where %s could end up in a warning messge.</li> +<li> id <a href="https://bugzilla.gnome.org/show_bug.cgi?id=655935">655935</a>: Fixed case where %s could end up in a warning message.</li> <li> id <a href="https://bugzilla.gnome.org/show_bug.cgi?id=656005">656005</a>: Methods of Objective-C categories defined in an .m file are now marked as private.</li> </ul> diff --git a/doc/commands.doc b/doc/commands.doc index 12b85db..1c7e7cf 100644 --- a/doc/commands.doc +++ b/doc/commands.doc @@ -697,7 +697,7 @@ Structural indicators command are considered to be internal as well. Only a new section at the same level will end the fragment that is considered internal. - You can use \ref cfg_internal_docs "INTERNAL_DOCS" in the config file + You can use \ref cfg_internal_docs "INTERNAL_DOCS" in the configuration file to show (\c YES) or hide (\c NO) the internal documentation. \sa section \ref cmdendinternal "\\endinternal". diff --git a/doc/customize.doc b/doc/customize.doc index 9ef3891..e2d53db 100644 --- a/doc/customize.doc +++ b/doc/customize.doc @@ -114,7 +114,7 @@ This will create 3 files: referencing those extra files via \ref cfg_html_extra_stylesheet "HTML_EXTRA_STYLESHEET". -You should edit these files and then reference them from the config file. +You should edit these files and then reference them from the configuration file. - \ref cfg_html_header "HTML_HEADER" = \c header.html - \ref cfg_html_footer "HTML_FOOTER" = \c footer.html - \ref cfg_html_extra_stylesheet "HTML_EXTRA_STYLESHEET" = \c my_customdoxygen.css @@ -158,7 +158,7 @@ doxygen -l optionally the name of the layout file can be specified, if omitted \c DoxygenLayout.xml will be used. -The next step is to mention the layout file in the config file +The next step is to mention the layout file in the configuration file \verbatim LAYOUT_FILE = DoxygenLayout.xml \endverbatim diff --git a/doc/docblocks.doc b/doc/docblocks.doc index 81cfdd0..e72ce95 100644 --- a/doc/docblocks.doc +++ b/doc/docblocks.doc @@ -293,7 +293,7 @@ The brief descriptions are included in the member overview of a class, namespace or file and are printed using a small italic font (this description can be hidden by setting \ref cfg_brief_member_desc "BRIEF_MEMBER_DESC" to \c NO in -the config file). By default the brief descriptions become the first +the configuration file). By default the brief descriptions become the first sentence of the detailed descriptions (but this can be changed by setting the \ref cfg_repeat_brief "REPEAT_BRIEF" tag to \c NO). Both the brief and the detailed descriptions are optional @@ -473,7 +473,7 @@ Here is the same example again but now using doxygen style comments: Since python looks more like Java than like C or C++, you should set \ref cfg_optimize_output_java "OPTIMIZE_OUTPUT_JAVA" to \c YES in the -config file. +configuration file. \subsection vhdlblocks Comment blocks in VHDL @@ -503,7 +503,7 @@ Here is an example VHDL file with doxygen comments: To get proper looking output you need to set \ref cfg_optimize_output_vhdl "OPTIMIZE_OUTPUT_VHDL" to \c YES in the -config file. This will also affect a number of other settings. When they +configuration file. This will also affect a number of other settings. When they were not already set correctly doxygen will produce a warning telling which settings where overruled. @@ -595,7 +595,7 @@ before the command. <!-- To use your own keywords you an map these keyword to the recognized commands -using the \ref cfg_tcl_subs "TCL_SUBST" entry in the config file. +using the \ref cfg_tcl_subs "TCL_SUBST" entry in the configuration file. The entry contain a list of word-keyword mappings. To use the itcl::* commands without the leading namespace use p.e.: diff --git a/doc/doxygen_usage.doc b/doc/doxygen_usage.doc index bcb14e8..20a5763 100644 --- a/doc/doxygen_usage.doc +++ b/doc/doxygen_usage.doc @@ -80,8 +80,8 @@ doxygen -w html header.html footer.html stylesheet.css <config_file> doxygen -w latex header.tex footer.tex doxygen.sty <config_file> \endverbatim 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 +you need to make a configuration file with those options set correctly and then specify +that configuration 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). <li>For RTF output, you can generate the default style sheet file (see diff --git a/doc/extsearch.doc b/doc/extsearch.doc index 99a7219..36116ff 100644 --- a/doc/extsearch.doc +++ b/doc/extsearch.doc @@ -58,7 +58,7 @@ browser via an URL starting with http:) How to setup a web server is outside the scope of this document, but if you for instance have Apache installed, you could simply copy the -`doxysearch.cgi` file from doxygen's `bin` dir to the `cgi-bin` of the +`doxysearch.cgi` file from doxygen's `bin` directory to the `cgi-bin` directory of the Apache web server. Read the <a href="http://httpd.apache.org/docs/2.2/howto/cgi.html">apache documentation</a> for details. To test if `doxysearch.cgi` is accessible start your web browser and @@ -73,7 +73,7 @@ You should get the following message: If you use Internet Explorer you may be prompted to download a file, which will then contain this message. -Since we didn't create or install a doxysearch.db it is ok for the test to +Since we didn't create or install a doxysearch.db it is OK for the test to fail for this reason. How to correct this is discussed in the next section. Before continuing with the next section add the above diff --git a/doc/faq.doc b/doc/faq.doc index bbad8c0..a91a2f5 100644 --- a/doc/faq.doc +++ b/doc/faq.doc @@ -43,14 +43,14 @@ You should use the \ref cmdmainpage "\\mainpage" command inside a comment block <ol> <li>Is your class / file / namespace documented? If not, it will not be extracted from the sources unless \ref cfg_extract_all "EXTRACT_ALL" is set to \c YES - in the config file. + in the configuration file. <li>Are the members private? If so, you must set \ref cfg_extract_private "EXTRACT_PRIVATE" to \c YES to make them appear in the documentation. <li>Is there a function macro in your class that does not end with a semicolon (e.g. MY_MACRO())? If so then you have to instruct doxygen's preprocessor to remove it. - This typically boils down to the following settings in the config file: + This typically boils down to the following settings in the configuration file: \verbatim ENABLE_PREPROCESSING = YES @@ -110,10 +110,10 @@ around the blocks that should be hidden and put: \verbatim PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS \endverbatim -in the config file then all blocks should be skipped by doxygen as long +in the configuration file then all blocks should be skipped by doxygen as long as \ref cfg_enable_preprocessing "ENABLE_PREPROCESSING" is set to `YES`. -\section faq_code_inc How can I change what is after the <code>\#include</code> in the class documentation? +\section faq_code_inc How can I change what is after the \#include in the class documentation? In most cases you can use \ref cfg_strip_from_inc_path "STRIP_FROM_INC_PATH" to strip a user defined part of a path. @@ -210,7 +210,7 @@ remove the % and keep the word unlinked. No, not as such; doxygen needs to understand the structure of what it reads. If you don't mind spending some time on it, there are several options: - If the grammar of X is close to C or C++, then it is probably not too hard to - tweak src/scanner.l a bit so the language is supported. This is done + tweak \c src/scanner.l a bit so the language is supported. This is done for all other languages directly supported by doxygen (i.e. Java, IDL, C#, PHP). - If the grammar of X is somewhat different than you can write an input @@ -219,7 +219,7 @@ If you don't mind spending some time on it, there are several options: Javascript, see http://www.stack.nl/~dimitri/doxygen/download.html#helpers). - If the grammar is completely different one could write a parser for X and write a backend that produces a similar syntax tree as is done by - src/scanner.l (and also by src/tagreader.cpp while reading tag files). + \c src/scanner.l (and also by \c src/tagreader.cpp while reading tag files). \section faq_lex Help! I get the cryptic message "input buffer overflow, can't enlarge buffer because scanner uses REJECT" @@ -235,7 +235,7 @@ should send me a code fragment that triggers the message. To work around the problem, put some line-breaks into your file, split it up into smaller parts, or exclude it from the input using EXCLUDE. -\section faq_latex When running make in the latex dir I get "TeX capacity exceeded". Now what? +\section faq_latex When running make in the latex directory I get "TeX capacity exceeded". Now what? You can edit the texmf.cfg file to increase the default values of the various buffers and then run "texconfig init". diff --git a/doc/formulas.doc b/doc/formulas.doc index 1649c19..ee4ff61 100644 --- a/doc/formulas.doc +++ b/doc/formulas.doc @@ -32,7 +32,7 @@ have the following tools installed For the HTML output there is also an alternative solution using <a href="https://www.mathjax.org">MathJax</a> which does not require the above tools. If you enable \ref cfg_use_mathjax "USE_MATHJAX" in -the config then the latex formulas will be copied to the HTML "as is" and a +the configuration then the latex formulas will be copied to the HTML "as is" and a client side javascript will parse them and turn them into (interactive) images. There are three ways to include formulas in the documentation. diff --git a/doc/install.doc b/doc/install.doc index 6db8102..f981431 100644 --- a/doc/install.doc +++ b/doc/install.doc @@ -203,13 +203,13 @@ of the GraphViz package to render nicer diagrams, see the \ref cfg_have_dot "HAVE_DOT" option in the configuration file. If you want to produce compressed HTML files (see \ref -cfg_generate_htmlhelp "GENERATE_HTMLHELP") in the config file, then +cfg_generate_htmlhelp "GENERATE_HTMLHELP") in the configuration file, then you need the Microsoft HTML help workshop. You can download it from <a href="http://www.microsoft.com/en-us/download/details.aspx?id=21138">Microsoft</a>. If you want to produce Qt Compressed Help files (see \ref -cfg_qhg_location "QHG_LOCATION") in the config file, then +cfg_qhg_location "QHG_LOCATION") in the configuration file, then you need qhelpgenerator which is part of Qt. You can download Qt from <a href="http://qt-project.org/downloads">Qt Software Downloads</a>. diff --git a/doc/markdown.doc b/doc/markdown.doc index e5aebd1..92612ca 100644 --- a/doc/markdown.doc +++ b/doc/markdown.doc @@ -300,6 +300,9 @@ to produce a table of contents at the start of the page, listing all sections. Note that using `[TOC]` is the same as using a \ref cmdtableofcontents "\\tableofcontents" command. +Note that the \ref cfg_toc_include_headings "TOC_INCLUDE_HEADINGS" has to be set +to a value > 0 otherwise no table of contents is shown when using \ref md_headers "Markdown Headers". + \subsection md_tables Tables Of the features defined by "Markdown Extra" is support for @@ -515,7 +518,7 @@ and in other sections that need to be processed without changes Markdown allows both a single tab or 4 spaces to start a code block. Since doxygen already replaces tabs by spaces before doing Markdown -processing, the effect will only be same if TAB_SIZE in the config file +processing, the effect will only be same if TAB_SIZE in the configuration file has been set to 4. When it is set to a higher value spaces will be present in the code block. A lower value will prevent a single tab to be interpreted as the start of a code block. diff --git a/doc/preprocessing.doc b/doc/preprocessing.doc index 30d4cf3..882e60d 100644 --- a/doc/preprocessing.doc +++ b/doc/preprocessing.doc @@ -55,7 +55,7 @@ both statements, i.e.: \endverbatim In case you want to expand the \c CONST_STRING macro, you should set the -\ref cfg_macro_expansion "MACRO_EXPANSION" tag in the config file +\ref cfg_macro_expansion "MACRO_EXPANSION" tag in the configuration file to \c YES. Then the result after preprocessing becomes: \verbatim @@ -130,7 +130,7 @@ without macro expansion doxygen will get confused, but we may not want to expand the \c REFIID macro, because it is documented and the user that reads the documentation should use it when implementing the interface. -By setting the following in the config file: +By setting the following in the configuration file: \verbatim ENABLE_PREPROCESSING = YES diff --git a/doc/searching.doc b/doc/searching.doc index 00c6141..cb6b84a 100644 --- a/doc/searching.doc +++ b/doc/searching.doc @@ -35,7 +35,7 @@ has its own advantages and disadvantages: required to make it work. To enable it set - \ref cfg_searchengine "SEARCHENGINE" to \c YES in the config file + \ref cfg_searchengine "SEARCHENGINE" to \c YES in the configuration file and make sure \ref cfg_server_based_search "SERVER_BASED_SEARCH" is set to \c NO. @@ -53,7 +53,7 @@ has its own advantages and disadvantages: To enable this set both \ref cfg_searchengine "SEARCHENGINE" and - \ref cfg_server_based_search "SERVER_BASED_SEARCH" to \c YES in the config + \ref cfg_server_based_search "SERVER_BASED_SEARCH" to \c YES in the configuration file and set \ref cfg_external_search "EXTERNAL_SEARCH" to \c NO. Advantages over the client side search engine are that it provides full @@ -100,9 +100,9 @@ has its own advantages and disadvantages: and Windows even supports it natively. To enable this set \ref cfg_generate_htmlhelp "GENERATE_HTMLHELP" to \c YES - in the config file. To let doxygen compile the HTML Help file for you, + in the configuration file. To let doxygen compile the HTML Help file for you, you also need to specify the path to the HTML compiler (hhc.exe) using the - \ref cfg_hhc_location "HHC_LOCATION" config option and the name of the + \ref cfg_hhc_location "HHC_LOCATION" configuration option and the name of the resulting CHM file using \ref cfg_chm_file "CHM_FILE". An advantage of this method is that the result is a single file that can @@ -122,7 +122,7 @@ has its own advantages and disadvantages: provided by Apple). To enable the creation of doc sets set \ref cfg_generate_docset "GENERATE_DOCSET" - to \c YES in the config file. There are a couple of other doc set related + to \c YES in the configuration file. There are a couple of other doc set related options you may want to set. After doxygen has finished you will find a Makefile in the HTML output directory. Running "make install" on this Makefile will compile and install the doc set. diff --git a/doc/starting.doc b/doc/starting.doc index c869867..e39aa25 100644 --- a/doc/starting.doc +++ b/doc/starting.doc @@ -77,7 +77,7 @@ You can probably leave the values of most tags in a generated template configuration file to their default value. See section \ref config for more details about the configuration file. -If you do not wish to edit the config file with a text editor, you should +If you do not wish to edit the configuration file with a text editor, you should have a look at \ref doxywizard_usage "doxywizard", which is a GUI front-end that can create, read and write doxygen configuration files, and allows setting configuration options by entering them via dialogs. diff --git a/doc/trouble.doc b/doc/trouble.doc index 9584c0c..c99c407 100644 --- a/doc/trouble.doc +++ b/doc/trouble.doc @@ -113,7 +113,7 @@ always try to include the following information in your bug report: - It is usually a good idea to send along the configuration file as well, but please use doxygen with the <code>-s</code> flag while generating it to keep it small (use <code>doxygen -s -u [configName]</code> to strip - the comments from an existing config file). + the comments from an existing configuration file). - The easiest (and often the only) way for me to fix bugs is if you can attach a small example demonstrating the problem you have to the bug report, so I can reproduce it on my machine. Please make sure the example is valid diff --git a/examples/define.h b/examples/define.h index c330447..0cd7ae3 100644 --- a/examples/define.h +++ b/examples/define.h @@ -10,7 +10,9 @@ */ /*! - Computes the absolute value of its argument \a x. + \brief Computes the absolute value of its argument \a x. + \param x input value. + \returns absolute value of \a x. */ #define ABS(x) (((x)>0)?(x):-(x)) #define MAX(x,y) ((x)>(y)?(x):(y)) diff --git a/examples/tclexample.tcl b/examples/tclexample.tcl index 6edef66..e512aee 100644 --- a/examples/tclexample.tcl +++ b/examples/tclexample.tcl @@ -10,7 +10,7 @@ exec tclsh "$0" "$@" #\code namespace eval ns { ## Documented proc \c ns_proc . - # param[in] arg some argument + # \param[in] arg some argument proc ns_proc {arg} {} ## Documented var \c ns_var . # Some documentation. @@ -22,13 +22,13 @@ namespace eval ns { ## Destroy object. destructor {exit} ## Documented itcl method \c itcl_method_x . - # param[in] arg Argument + # \param[in] arg Argument private method itcl_method_x {arg} ## Documented itcl method \c itcl_method_y . - # param[in] arg Argument + # \param[in] arg Argument protected method itcl_method_y {arg} {} ## Documented itcl method \c itcl_method_z . - # param[in] arg Argument + # \param[in] arg Argument public method itcl_method_z {arg} {} ## Documented common itcl var \c itcl_Var . common itcl_Var @@ -49,13 +49,13 @@ namespace eval ns { # Defined inside class variable oo_var ## \private Documented oo method \c oo_method_x . - # param[in] arg Argument + # \param[in] arg Argument method oo_method_x {arg} {} ## \protected Documented oo method \c oo_method_y . - # param[in] arg Argument + # \param[in] arg Argument method oo_method_y {arg} {} ## \public Documented oo method \c oo_method_z . - # param[in] arg Argument + # \param[in] arg Argument method oo_method_z {arg} {} } } @@ -72,7 +72,7 @@ oo::define ns::oo_class { } ## Documented global proc \c glob_proc . -# param[in] arg Argument +# \param[in] arg Argument proc glob_proc {arg} {puts $arg} variable glob_var;#< Documented global var \c glob_var\ diff --git a/src/cite.cpp b/src/cite.cpp index f86350b..b17800f 100644 --- a/src/cite.cpp +++ b/src/cite.cpp @@ -268,7 +268,7 @@ void CiteDict::generatePage() const { if (!bibFile.isEmpty()) { - // bug_700510, multile times the same name were overwriting; creating new names + // bug_700510, multiple times the same name were overwriting; creating new names // also for names with spaces ++i; copyFile(bibFile,latexOutputDir + bibTmpFile + QCString().setNum(i) + ".bib"); diff --git a/src/clangparser.h b/src/clangparser.h index 6072208..8bb9aba 100644 --- a/src/clangparser.h +++ b/src/clangparser.h @@ -19,7 +19,7 @@ class ClangParser * @param[in,out] filesInTranslationUnit Other files that are * part of the input and included by the file. * The function will return a subset of the files, - * only including the onces that were actually found + * only including the ones that were actually found * during parsing. */ void start(const char *fileName,QStrList &filesInTranslationUnit); diff --git a/src/classdef.cpp b/src/classdef.cpp index e1a80ce..4ce48a7 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -2687,7 +2687,7 @@ bool ClassDef::hasNonReferenceSuperClass() return found; } -/*! called from MemberDef::writeDeclaration() to (recusively) write the +/*! called from MemberDef::writeDeclaration() to (recursively) write the * definition of an anonymous struct, union or class. */ void ClassDef::writeDeclaration(OutputList &ol,MemberDef *md,bool inGroup, @@ -2873,7 +2873,7 @@ static bool isStandardFunc(MemberDef *md) } /*! - * recusively merges the `all members' lists of a class base + * recursively merges the `all members' lists of a class base * with that of this class. Must only be called for classes without * subclasses! */ diff --git a/src/classdef.h b/src/classdef.h index 23c5c5c..b169221 100644 --- a/src/classdef.h +++ b/src/classdef.h @@ -200,7 +200,7 @@ class ClassDef : public Definition MemberDef *getMemberByName(const QCString &) const; /** Returns TRUE iff \a bcd is a direct or indirect base class of this - * class. This function will recusively traverse all branches of the + * class. This function will recursively traverse all branches of the * inheritance tree. */ bool isBaseClass(ClassDef *bcd,bool followInstances,int level=0); @@ -116,6 +116,7 @@ static int g_memCallContext; static int g_lastCContext; static int g_skipInlineInitContext; +static bool g_insideCpp; static bool g_insideObjC; static bool g_insideJava; static bool g_insideCS; @@ -1823,7 +1824,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"|"set"|"get"|"inline"|"internal"|"mutable"|"namespace"|"new"|"nullptr"|"override"|"operator"|"pin_ptr"|"private"|"protected"|"public"|"raise"|"register"|"remove"|"self"|"sizeof"|"static"|"struct"|"__super"|"function"|"template"|"generic"|"this"|"true"|"typedef"|"typeid"|"typename"|"union"|"using"|"virtual"|"volatile"|"abstract"|"final"|"import"|"synchronized"|"transient"|"alignas"|"alignof"|{KEYWORD_OBJC}) +KEYWORD ("asm"|"__assume"|"auto"|"class"|"const"|"delete"|"enum"|"explicit"|"extern"|"false"|"friend"|"gcnew"|"gcroot"|"set"|"get"|"inline"|"internal"|"mutable"|"namespace"|"new"|"null"|"nullptr"|"override"|"operator"|"pin_ptr"|"private"|"protected"|"public"|"raise"|"register"|"remove"|"self"|"sizeof"|"static"|"struct"|"__super"|"function"|"template"|"generic"|"this"|"true"|"typedef"|"typeid"|"typename"|"union"|"using"|"virtual"|"volatile"|"abstract"|"final"|"import"|"synchronized"|"transient"|"alignas"|"alignof"|{KEYWORD_OBJC}) FLOWKW ("break"|"catch"|"continue"|"default"|"do"|"else"|"finally"|"return"|"switch"|"throw"|"throws"|"@catch"|"@finally") FLOWCONDITION ("case"|"for"|"foreach"|"for each"|"goto"|"if"|"try"|"while"|"@try") TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"object"|"short"|"signed"|"unsigned"|"void"|"wchar_t"|"size_t"|"boolean"|"id"|"SEL"|"string"|"nullptr") @@ -2415,6 +2416,8 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" g_prefixed_with_this_keyword = TRUE; } <Body>{KEYWORD}/([^a-z_A-Z0-9]) { + if (g_insideJava && qstrcmp("internal",yytext) ==0) REJECT; + if (g_insideCpp && (QCString(yytext) =="set" ||QCString(yytext) =="get")) REJECT; startFontClass("keyword"); codifyLines(yytext); if (QCString(yytext)=="typedef") @@ -2425,11 +2428,13 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" endFontClass(); } <Body>{KEYWORD}/{B}* { + if (g_insideCpp && (QCString(yytext) =="set" ||QCString(yytext) =="get")) REJECT; startFontClass("keyword"); codifyLines(yytext); endFontClass(); } <Body>{KEYWORD}/{BN}*"(" { + if (g_insideCpp && (QCString(yytext) =="set" ||QCString(yytext) =="get")) REJECT; startFontClass("keyword"); codifyLines(yytext); endFontClass(); @@ -2984,6 +2989,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" <MemberCall2,FuncCall>{KEYWORD}/([^a-z_A-Z0-9]) { //addParmType(); //g_parmName=yytext; + if (g_insideCpp && (QCString(yytext) =="set" ||QCString(yytext) =="get")) REJECT; startFontClass("keyword"); g_code->codify(yytext); endFontClass(); @@ -3742,6 +3748,7 @@ void parseCCode(CodeOutputInterface &od,const char *className,const QCString &s, g_insideJava = lang==SrcLangExt_Java; g_insideCS = lang==SrcLangExt_CSharp; g_insidePHP = lang==SrcLangExt_PHP; + g_insideCpp = lang==SrcLangExt_Cpp; if (g_sourceFileDef) { setCurrentDoc("l00001"); diff --git a/src/commentcnv.l b/src/commentcnv.l index 44e2543..89d2fea 100644 --- a/src/commentcnv.l +++ b/src/commentcnv.l @@ -294,12 +294,12 @@ void replaceComment(int offset); } else { - /* check for fixed format; we might have some conditional as part of multilene if like C<5 .and. & */ + /* check for fixed format; we might have some conditional as part of multiline if like C<5 .and. & */ if (isFixedForm && (g_col == 0)) { copyToOutput(yytext,(int)yyleng); g_nestingCount=0; - g_commentStack.clear(); /* to be on the save side */ + g_commentStack.clear(); /* to be on the safe side */ BEGIN(CComment); g_commentStack.push(new CommentCtx(g_lineNr)); } @@ -1093,7 +1093,9 @@ void convertCppComments(BufStr *inBuf,BufStr *outBuf,const char *fileName) if (Debug::isFlagSet(Debug::CommentCnv)) { g_outBuf->at(g_outBuf->curPos())='\0'; - msg("-------------\n%s\n-------------\n",g_outBuf->data()); + Debug::print(Debug::CommentCnv,0,"-----------\nCommentCnv: %s\n" + "output=[\n%s]\n-----------\n",fileName,g_outBuf->data() + ); } printlex(yy_flex_debug, FALSE, __FILE__, fileName); } diff --git a/src/commentscan.l b/src/commentscan.l index 588d40a..de31b2e 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -563,14 +563,7 @@ static void addXRefItem(const char *listName,const char *itemTitle, RefItem *item = refList->getRefItem(lii->itemId); ASSERT(item!=0); item->text += " <p>"; - if (Doxygen::markdownSupport) - { - item->text += processMarkdown(yyFileName,yyLineNr,current,outputXRef); - } - else - { - item->text += outputXRef; - } + item->text += outputXRef; //printf("%s: text +=%s\n",listName,item->text.data()); } else // new item @@ -585,14 +578,7 @@ static void addXRefItem(const char *listName,const char *itemTitle, sprintf(anchorLabel,"_%s%06d",listName,itemId); RefItem *item = refList->getRefItem(itemId); ASSERT(item!=0); - if (Doxygen::markdownSupport) - { - item->text = processMarkdown(yyFileName,yyLineNr,current,outputXRef); - } - else - { - item->text = outputXRef; - } + item->text = outputXRef; item->listAnchor = anchorLabel; docEntry->addSpecialListItem(listName,itemId); QCString cmdString; @@ -1517,14 +1503,16 @@ RCSTAG "$"{ID}":"[^\n$]+"$" if (*yytext=='\n') yyLineNr++; BEGIN( Comment ); } +<GroupDocArg1>. { // ignore other stuff + } <GroupDocArg2>"\\"{B}*"\n" { // line continuation yyLineNr++; addOutput('\n'); } -<GroupDocArg2>[^\n\\\*]+ { // title (stored in type) +<GroupDocArg2>[^\n\*]+ { // title (stored in type) current->type += yytext; current->type = current->type.stripWhiteSpace(); - } + } <GroupDocArg2>{DOCNL} { if ( current->groupDocType==Entry::GROUPDOC_NORMAL && current->type.isEmpty() @@ -1860,10 +1848,10 @@ RCSTAG "$"{ID}":"[^\n$]+"$" addOutput(*yytext); } <FormatBlock><<EOF>> { - QCString endTag = "@end"+blockName; + QCString endTag = "end"+blockName; if (blockName=="startuml") endTag="enduml"; warn(yyFileName,yyLineNr, - "reached end of comment while inside a @%s block; check for missing @%s tag!", + "reached end of comment while inside a \\%s block; check for missing \\%s tag!", blockName.data(),endTag.data() ); yyterminate(); @@ -1944,7 +1932,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$" if (guards.isEmpty()) { warn(yyFileName,yyLineNr, - "found @endif without matching start command"); + "found \\endif without matching start command"); } else { @@ -1962,7 +1950,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$" if (guards.isEmpty()) { warn(yyFileName,yyLineNr, - "found @else without matching start command"); + "found \\else without matching start command"); } else { @@ -1979,7 +1967,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$" if (guards.isEmpty()) { warn(yyFileName,yyLineNr, - "found @elseif without matching start command"); + "found \\elseif without matching start command"); } else { @@ -2943,7 +2931,19 @@ bool parseCommentBlock(/* in */ ParserInterface *parser, langParser = parser; current = curEntry; if (comment.isEmpty()) return FALSE; // avoid empty strings - inputString = comment; + if (Doxygen::markdownSupport) + { + inputString = processMarkdown(fileName,lineNr,NULL,comment); + QString qq(inputString); + while (qq.startsWith(" ")) qq = qq.mid(1); + while (qq.startsWith("\n")) qq = qq.mid(1); + if (qq.startsWith("<br>")) qq = qq.mid(4); + inputString = QCString(qq.data()); + } + else + { + inputString = comment; + } inputString.append(" "); inputPosition = position; yyLineNr = lineNr; @@ -2970,7 +2970,7 @@ bool parseCommentBlock(/* in */ ParserInterface *parser, } Debug::print(Debug::CommentScan,0,"-----------\nCommentScanner: %s:%d\n" - "input=[\n%s]\n",qPrint(fileName),lineNr,qPrint(comment) + "input=[\n%s]\n",qPrint(fileName),lineNr,qPrint(inputString) ); commentscanYYrestart( commentscanYYin ); @@ -3008,15 +3008,9 @@ bool parseCommentBlock(/* in */ ParserInterface *parser, openGroup(current,yyFileName,yyLineNr); } - if (Doxygen::markdownSupport) - { - current->brief = processMarkdown(fileName,lineNr,current,current->brief); - current->doc = processMarkdown(fileName,lineNr,current,current->doc); - current->inbodyDocs = processMarkdown(fileName,lineNr,current,current->inbodyDocs); - } - - Debug::print(Debug::CommentScan,0, - "brief=[line=%d\n%s]\ndocs=[line=%d\n%s]\ninbody=[line=%d\n%s]\n===========\n", + Debug::print(Debug::CommentScan,0,"-----------\nCommentScanner: %s:%d\noutput=[\n" + "brief=[line=%d\n%s]\ndocs=[line=%d\n%s]\ninbody=[line=%d\n%s]\n]\n===========\n", + qPrint(fileName),lineNr, current->briefLine,qPrint(current->brief), current->docLine,qPrint(current->doc), current->inbodyLine,qPrint(current->inbodyDocs) diff --git a/src/condparser.cpp b/src/condparser.cpp index 6c5d787..ab33ae3 100644 --- a/src/condparser.cpp +++ b/src/condparser.cpp @@ -283,7 +283,7 @@ bool CondParser::parseVar() } /** - * evaluate an operator for given valuess + * evaluate an operator for given values */ bool CondParser::evalOperator(int opId, bool lhs, bool rhs) { diff --git a/src/config.xml b/src/config.xml index d4c8c4a..2dcc0f4 100644 --- a/src/config.xml +++ b/src/config.xml @@ -125,7 +125,7 @@ SEARCHENGINE = YES \endverbatim To regenerate the Qt-1.44 documentation from the sources, you could use the -following config file: +following configuration file: \verbatim PROJECT_NAME = Qt OUTPUT_DIRECTORY = qt_docs @@ -212,7 +212,7 @@ Go to the <a href="commands.html">next</a> section or return to the <option type='string' id='DOXYFILE_ENCODING' format='string' defval='UTF-8'> <docs> <![CDATA[ - This tag specifies the encoding used for all characters in the config file that + This tag specifies the encoding used for all characters in the configuration file that follow. The default is UTF-8 which is also the encoding used for all text before the first occurrence of this tag. Doxygen uses \c libiconv (or the iconv built into \c libc) for the transcoding. See https://www.gnu.org/software/libiconv/ for the list of @@ -1606,7 +1606,7 @@ to disable this feature. <br> To use it do the following: -# Install the latest version of \c global - -# Enable \ref cfg_source_browser "SOURCE_BROWSER" and \c USE_HTAGS in the config file + -# Enable \ref cfg_source_browser "SOURCE_BROWSER" and \c USE_HTAGS in the configuration file -# Make sure the \ref cfg_input "INPUT" points to the root of the source tree -# Run \c doxygen as normal <br> @@ -2773,7 +2773,7 @@ or <docs> <![CDATA[ Load stylesheet definitions from file. Syntax is similar to doxygen's - config file, i.e. a series of assignments. You only have to provide + configuration file, i.e. a series of assignments. You only have to provide replacements, missing definitions are set to their default value. <br> See also section \ref doxygen_usage for information on how to generate @@ -2786,7 +2786,7 @@ or <docs> <![CDATA[ Set optional variables used in the generation of an RTF document. - Syntax is similar to doxygen's config file. + Syntax is similar to doxygen's configuration file. A template extensions file can be generated using <code>doxygen -e rtf extensionFile</code>. ]]> diff --git a/src/context.cpp b/src/context.cpp index 896c4e0..4584920 100644 --- a/src/context.cpp +++ b/src/context.cpp @@ -246,7 +246,6 @@ class PropertyMapper /** Add a property to the map * @param[in] name The name of the property to add. - * @param[in] obj The object handling access to the property. * @param[in] handle The method to call when the property is accessed. */ void addProperty(const char *name,typename PropertyFunc::Handler handle) @@ -262,6 +261,7 @@ class PropertyMapper } /** Gets the value of a property. + * @param[in] obj The object handling access to the property. * @param[in] name The name of the property. * @returns A variant representing the properties value or an * invalid variant if it was not found. diff --git a/src/definition.cpp b/src/definition.cpp index ff30429..92baf0c 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -1034,15 +1034,15 @@ void Definition::writeSourceDef(OutputList &ol,const char *) ol.pushGeneratorState(); ol.disable(OutputGenerator::Man); - if (!latexSourceCode) + ol.disableAllBut(OutputGenerator::Html); + if (latexSourceCode) { - ol.disable(OutputGenerator::Latex); + ol.enable(OutputGenerator::Latex); } - if (!rtfSourceCode) + if (rtfSourceCode) { - ol.disable(OutputGenerator::RTF); + ol.enable(OutputGenerator::RTF); } - ol.disableAllBut(OutputGenerator::Html); // write line link (HTML only) ol.writeObjectLink(0,fn,anchorStr,lineStr); ol.enableAll(); diff --git a/src/diagram.cpp b/src/diagram.cpp index 42792ad..667aa85 100644 --- a/src/diagram.cpp +++ b/src/diagram.cpp @@ -833,7 +833,7 @@ void TreeDiagram::drawConnectors(FTextStream &t,Image *image, } ++rit; di=rit.current(); } - // add last horizonal line and a vertical connection line + // add last horizontal line and a vertical connection line if (bitmap) { if (doBase) // base classes diff --git a/src/dirdef.cpp b/src/dirdef.cpp index eb6f5d1..9a94050 100644 --- a/src/dirdef.cpp +++ b/src/dirdef.cpp @@ -930,14 +930,14 @@ void buildDirectories() for (;(fd=fni.current());++fni) { //printf("buildDirectories %s\n",fd->name().data()); - if (fd->getReference().isEmpty() && !fd->isDocumentationFile()) + if (fd->getReference().isEmpty()) { DirDef *dir; if ((dir=Doxygen::directories->find(fd->getPath()))==0) // new directory { dir = DirDef::mergeDirectoryInTree(fd->getPath()); } - if (dir) dir->addFile(fd); + if (dir && !fd->isDocumentationFile()) dir->addFile(fd); } else { diff --git a/src/docparser.cpp b/src/docparser.cpp index 893c3ff..c3a87d8 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -451,11 +451,12 @@ static void checkArgumentName(const QCString &name,bool isParam) } /*! Checks if the parameters that have been specified using \@param are - * indeed all parameters. + * indeed all parameters and that a parameter does not have multiple + * \@param blocks. * Must be called after checkArgumentName() has been called for each * argument. */ -static void checkUndocumentedParams() +static void checkUnOrMultipleDocumentedParams() { if (g_memberDef && g_hasParamCommand && Config_getBool(WARN_IF_DOC_ERROR)) { @@ -470,18 +471,37 @@ static void checkUndocumentedParams() bool found=FALSE; for (ali.toFirst();(a=ali.current());++ali) { + int count = 0; QCString argName = g_memberDef->isDefine() ? a->type : a->name; if (lang==SrcLangExt_Fortran) argName = argName.lower(); argName=argName.stripWhiteSpace(); + QCString aName = argName; if (argName.right(3)=="...") argName=argName.left(argName.length()-3); - if (g_memberDef->getLanguage()==SrcLangExt_Python && (argName=="self" || argName=="cls")) + if (lang==SrcLangExt_Python && (argName=="self" || argName=="cls")) { // allow undocumented self / cls parameter for Python } else if (!argName.isEmpty() && g_paramsFound.find(argName)==0 && a->docs.isEmpty()) { found = TRUE; - break; + } + else + { + QDictIterator<void> it1(g_paramsFound); + void *item1; + for (;(item1=it1.current());++it1) + { + if (argName == it1.currentKey()) count++; + } + } + if (count > 1) + { + warn_doc_error(g_memberDef->getDefFileName(), + g_memberDef->getDefLine(), + "argument '" + aName + + "' from the argument list of " + + QCString(g_memberDef->qualifiedName()) + + " has muliple @param documentation sections"); } } if (found) @@ -497,7 +517,7 @@ static void checkUndocumentedParams() QCString argName = g_memberDef->isDefine() ? a->type : a->name; if (lang==SrcLangExt_Fortran) argName = argName.lower(); argName=argName.stripWhiteSpace(); - if (g_memberDef->getLanguage()==SrcLangExt_Python && (argName=="self" || argName=="cls")) + if (lang==SrcLangExt_Python && (argName=="self" || argName=="cls")) { // allow undocumented self / cls parameter for Python } @@ -6125,16 +6145,15 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta } } } - else if (findAttribute(tagHtmlAttribs,"langword",&cref)) // <see langword="..."/> or <see langworld="..."></see> + else if (findAttribute(tagHtmlAttribs,"langword",&cref)) // <see langword="..."/> or <see langword="..."></see> { - doctokenizerYYsetStatePara(); - DocLink *lnk = new DocLink(this,cref); - m_children.append(lnk); - QCString leftOver = lnk->parse(FALSE,TRUE); - if (!leftOver.isEmpty()) - { - m_children.append(new DocWord(this,leftOver)); - } + bool inSeeBlock = g_inSeeBlock; + g_token->name = cref; + g_inSeeBlock = TRUE; + m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Code,TRUE)); + handleLinkedWord(this,m_children,TRUE); + m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Code,FALSE)); + g_inSeeBlock = inSeeBlock; } else { @@ -7541,7 +7560,7 @@ DocRoot *validatingParseDoc(const char *fileName,int startLine, delete v; } - checkUndocumentedParams(); + checkUnOrMultipleDocumentedParams(); detectNoDocumentedParams(); // TODO: These should be called at the end of the program. diff --git a/src/docparser.h b/src/docparser.h index 8fcbed6..d7390c2 100644 --- a/src/docparser.h +++ b/src/docparser.h @@ -277,7 +277,7 @@ class DocLinkedWord : public DocNode QCString m_tooltip; }; -/** Node representing an URL (or email address) */ +/** Node representing a URL (or email address) */ class DocURL : public DocNode { public: @@ -306,7 +306,7 @@ class DocLineBreak : public DocNode private: }; -/** Node representing a horizonal ruler */ +/** Node representing a horizontal ruler */ class DocHorRuler : public DocNode { public: diff --git a/src/doctokenizer.l b/src/doctokenizer.l index 90a8c55..e6b8865 100644 --- a/src/doctokenizer.l +++ b/src/doctokenizer.l @@ -387,7 +387,8 @@ LNKWORD2 (({SCOPEPRE}*"operator"{OPMASK})|({SCOPEPRE}"operator"{OPMASKOPT})|((" LNKWORD3 ([0-9a-z_A-Z\-]+("/"|"\\"))*[0-9a-z_A-Z\-]+("."[0-9a-z_A-Z]+)+ CHARWORDQ [^ \t\n\r\\@<>()\[\]:;\?{}&%$#,."='] ESCWORD ("%"{ID}(("::"|"."){ID})*)|("%'") -WORD1 {ESCWORD}|{CHARWORDQ}+|"{"|"}"|"'\"'"|("\""[^"\n]*\n?[^"\n]*"\"") +CHARWORDQ1 [^ \-+0-9\t\n\r\\@<>()\[\]:;\?{}&%$#,."='] +WORD1 {ESCWORD}|{CHARWORDQ1}+|"{"|"}"|"'\"'"|("\""[^"\n]*\n?[^"\n]*"\"") WORD2 "."|","|"("|")"|"["|"]"|":"|";"|"\?"|"="|"'" WORD1NQ {ESCWORD}|{CHARWORDQ}+|"{"|"}" WORD2NQ "."|","|"("|")"|"["|"]"|":"|";"|"\?"|"="|"'" @@ -554,7 +555,7 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} g_token->indent = computeIndent(text,dotPos); return TK_ENDLIST; } -<St_Para>"{"{BLANK}*"@link" { +<St_Para>"{"{BLANK}*"@link"/{BLANK}+ { g_token->name = "javalink"; return TK_COMMAND; } @@ -696,6 +697,7 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} } /********* patterns for normal words ******************/ +<St_Para,St_Text>[\-+0-9] | <St_Para,St_Text>{WORD1} | <St_Para,St_Text>{WORD2} { /* function call */ if (yytext[0]=='%') // strip % if present @@ -931,6 +933,7 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} g_token->name = yytext; return TK_WORD; } +<St_TitleN>[\-+0-9] | <St_TitleN>{WORD1} | <St_TitleN>{WORD2} { /* word */ if (yytext[0]=='%') // strip % if present diff --git a/src/dot.cpp b/src/dot.cpp index 80703b9..eeb8b8b 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -266,6 +266,7 @@ static void writeGraphHeader(FTextStream &t,const QCString &title=QCString()) { t << " // INTERACTIVE_SVG=YES\n"; } + t << " // LATEX_PDF_SIZE\n"; // write placeholder for LaTeX PDF bounding box size repacement if (Config_getBool(DOT_TRANSPARENT)) { t << " bgcolor=\"transparent\";" << endl; @@ -437,6 +438,55 @@ static void unsetDotFontPath() g_dotFontPath=""; } +static bool resetPDFSize(const int width,const int height, const char *base) +{ + QString tmpName = QString::fromUtf8(QCString(base)+".tmp"); + QString patchFile = QString::fromUtf8(QCString(base)+".dot"); + if (!QDir::current().rename(patchFile,tmpName)) + { + err("Failed to rename file %s to %s!\n",patchFile.data(),tmpName.data()); + return FALSE; + } + QFile fi(tmpName); + QFile fo(patchFile); + if (!fi.open(IO_ReadOnly)) + { + err("problem opening file %s for patching!\n",tmpName.data()); + QDir::current().rename(tmpName,patchFile); + return FALSE; + } + if (!fo.open(IO_WriteOnly)) + { + err("problem opening file %s for patching!\n",patchFile.data()); + QDir::current().rename(tmpName,patchFile); + fi.close(); + return FALSE; + } + FTextStream t(&fo); + const int maxLineLen=100*1024; + while (!fi.atEnd()) // foreach line + { + QCString line(maxLineLen); + int numBytes = fi.readLine(line.rawData(),maxLineLen); + if (numBytes<=0) + { + break; + } + line.resize(numBytes+1); + if (line.find("LATEX_PDF_SIZE") != -1) + { + double scale = (width > height ? width : height)/double(MAX_LATEX_GRAPH_INCH); + t << " size=\""<<width/scale << "," <<height/scale <<"\";\n"; + } + else + t << line; + } + fi.close(); + fo.close(); + // remove temporary file + QDir::current().remove(tmpName); + return TRUE; +} static bool readBoundingBox(const char *fileName,int *width,int *height,bool isEps) { QCString bb = isEps ? QCString("%%PageBoundingBox:") : QCString("/MediaBox ["); @@ -765,10 +815,10 @@ DotRunner::DotRunner(const QCString &file,const QCString &path, m_jobs.setAutoDelete(TRUE); } -void DotRunner::addJob(const char *format,const char *output) +void DotRunner::addJob(const char *format,const char *output, const char *base) { QCString args = QCString("-T")+format+" -o \""+output+"\""; - m_jobs.append(new DotConstString(args)); + m_jobs.append(new DotConstString(args, base)); } void DotRunner::addPostProcessing(const char *cmd,const char *args) @@ -780,6 +830,7 @@ void DotRunner::addPostProcessing(const char *cmd,const char *args) bool DotRunner::run() { int exitCode=0; + int width=0,height=0; QCString dotArgs; QListIterator<DotConstString> li(m_jobs); @@ -792,9 +843,26 @@ bool DotRunner::run() dotArgs+=' '; dotArgs+=s->data(); } - if ((exitCode=portable_system(m_dotExe.data(),dotArgs,FALSE))!=0) + if ((exitCode=portable_system(m_dotExe.data(),dotArgs,FALSE))!=0) goto error; + dotArgs=QCString("\"")+m_file.data()+"\""; + bool redo = FALSE; + for (li.toFirst();(s=li.current());++li) + { + if (s->pdfData()) + { + if (!readBoundingBox(QCString(s->pdfData())+".pdf",&width,&height,FALSE)) goto error; + if ((width > MAX_LATEX_GRAPH_SIZE) || (height > MAX_LATEX_GRAPH_SIZE)) + { + if (!resetPDFSize(width,height,s->pdfData())) goto error; + dotArgs+=' '; + dotArgs+=s->data(); + redo = TRUE; + } + } + } + if (redo) { - goto error; + if ((exitCode=portable_system(m_dotExe.data(),dotArgs,FALSE))!=0) goto error; } } else @@ -802,9 +870,15 @@ bool DotRunner::run() for (li.toFirst();(s=li.current());++li) { dotArgs=QCString("\"")+m_file.data()+"\" "+s->data(); - if ((exitCode=portable_system(m_dotExe.data(),dotArgs,FALSE))!=0) + if ((exitCode=portable_system(m_dotExe.data(),dotArgs,FALSE))!=0) goto error; + if (s->pdfData()) { - goto error; + if (!readBoundingBox(QCString(s->pdfData())+".pdf",&width,&height,FALSE)) goto error; + if ((width > MAX_LATEX_GRAPH_SIZE) || (height > MAX_LATEX_GRAPH_SIZE)) + { + if (!resetPDFSize(width,height,s->pdfData())) goto error; + if ((exitCode=portable_system(m_dotExe.data(),dotArgs,FALSE))!=0) goto error; + } } } } @@ -3150,7 +3224,7 @@ QCString DotClassGraph::writeGraph(FTextStream &out, DotRunner *dotRun = new DotRunner(absDotName,d.absPath().data(),FALSE); if (usePDFLatex) { - dotRun->addJob("pdf",absPdfName); + dotRun->addJob("pdf",absPdfName,absBaseName); } else { @@ -3508,7 +3582,7 @@ QCString DotInclDepGraph::writeGraph(FTextStream &out, DotRunner *dotRun = new DotRunner(absDotName,d.absPath().data(),FALSE); if (usePDFLatex) { - dotRun->addJob("pdf",absPdfName); + dotRun->addJob("pdf",absPdfName,absBaseName); } else { @@ -3826,7 +3900,7 @@ QCString DotCallGraph::writeGraph(FTextStream &out, GraphOutputFormat graphForma DotRunner *dotRun = new DotRunner(absDotName,d.absPath().data(),FALSE); if (usePDFLatex) { - dotRun->addJob("pdf",absPdfName); + dotRun->addJob("pdf",absPdfName,absBaseName); } else { @@ -3992,7 +4066,7 @@ QCString DotDirDeps::writeGraph(FTextStream &out, DotRunner *dotRun = new DotRunner(absDotName,d.absPath().data(),FALSE); if (usePDFLatex) { - dotRun->addJob("pdf",absPdfName); + dotRun->addJob("pdf",absPdfName,absBaseName); } else { @@ -4170,7 +4244,7 @@ void writeDotGraphFromFile(const char *inFile,const char *outDir, { if (Config_getBool(USE_PDFLATEX)) { - dotRun.addJob("pdf",absOutFile+".pdf"); + dotRun.addJob("pdf",absOutFile+".pdf",absOutFile); } else { @@ -4555,7 +4629,7 @@ QCString DotGroupCollaboration::writeGraph( FTextStream &t, DotRunner *dotRun = new DotRunner(absDotName,d.absPath().data(),FALSE); if (usePDFLatex) { - dotRun->addJob("pdf",absPdfName); + dotRun->addJob("pdf",absPdfName,absBaseName); } else { @@ -42,6 +42,12 @@ class DotRunnerQueue; enum GraphOutputFormat { GOF_BITMAP, GOF_EPS }; enum EmbeddedOutputFormat { EOF_Html, EOF_LaTeX, EOF_Rtf, EOF_DocBook }; +// the graphicx LaTeX has a limitation of maximum size of 16384 +// To be on the save side we take it a little bit smaller i.e. 150 inch * 72 dpi +// It is anyway hard to view these size of images +#define MAX_LATEX_GRAPH_INCH 150 +#define MAX_LATEX_GRAPH_SIZE (MAX_LATEX_GRAPH_INCH * 72) + /** Attributes of an edge of a dot graph */ struct EdgeInfo { @@ -338,11 +344,12 @@ class DotGroupCollaboration class DotConstString { public: - DotConstString() { m_str=0; } - ~DotConstString() { delete[] m_str; } - DotConstString(const QCString &s) : m_str(0) { set(s); } - DotConstString(const DotConstString &s) : m_str(0) { set(s.data()); } + DotConstString() { m_str=0; m_pdfstr=0;} + ~DotConstString() { delete[] m_str; delete[] m_pdfstr;} + DotConstString(const QCString &s, const QCString &p = NULL) : m_str(0), m_pdfstr(0) { set(s); setpdf(p);} + DotConstString(const DotConstString &s) : m_str(0), m_pdfstr(0) { set(s.data()); } const char *data() const { return m_str; } + const char *pdfData() const { return m_pdfstr; } bool isEmpty() const { return m_str==0 || m_str[0]=='\0'; } void set(const QCString &s) { @@ -354,9 +361,20 @@ class DotConstString qstrcpy(m_str,s.data()); } } + void setpdf(const QCString &p) + { + delete[] m_pdfstr; + m_pdfstr=0; + if (!p.isEmpty()) + { + m_pdfstr=new char[p.length()+1]; + qstrcpy(m_pdfstr,p.data()); + } + } private: DotConstString &operator=(const DotConstString &); char *m_str; + char *m_pdfstr; }; /** Helper class to run dot from doxygen. @@ -377,7 +395,7 @@ class DotRunner /** Adds an additional job to the run. * Performing multiple jobs one file can be faster. */ - void addJob(const char *format,const char *output); + void addJob(const char *format,const char *output, const char *base = NULL); void addPostProcessing(const char *cmd,const char *args); diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 00826d6..263b59f 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -10965,7 +10965,7 @@ void parseInput() /************************************************************************** - * Check/create output directorties * + * Check/create output directories * **************************************************************************/ QCString htmlOutput; diff --git a/src/filedef.cpp b/src/filedef.cpp index b919f74..6947f83 100644 --- a/src/filedef.cpp +++ b/src/filedef.cpp @@ -1425,8 +1425,7 @@ bool FileDef::generateSourceFile() const (sourceBrowser || (verbatimHeaders && guessSection(name())==Entry::HEADER_SEC) ) && - extension!=".doc" && extension!=".txt" && extension!=".dox" && - extension!=".md" && name().right(9)!=".markdown"; + !isDocumentationFile(); } diff --git a/src/fortrancode.l b/src/fortrancode.l index 501b492..14268cf 100644 --- a/src/fortrancode.l +++ b/src/fortrancode.l @@ -159,6 +159,9 @@ static char stringStartSymbol; // single or double quote // declared from referenced names static int bracketCount = 0; +// signal when in type / class /procedure declaration +static int inTypeDecl = 0; + static bool g_endComment; static void endFontClass() @@ -687,14 +690,14 @@ CHAR (CHARACTER{ARGS}?|CHARACTER{BS}"*"({BS}[0-9]+|{ARGS})) TYPE_SPEC (({NUM_TYPE}({BS}"*"{BS}[0-9]+)?)|({NUM_TYPE}{KIND})|DOUBLE{BS}COMPLEX|DOUBLE{BS}PRECISION|{CHAR}|TYPE|CLASS|PROCEDURE) INTENT_SPEC intent{BS}"("{BS}(in|out|in{BS}out){BS}")" -ATTR_SPEC (IMPLICIT|ALLOCATABLE|DIMENSION{ARGS}|EXTERNAL|{INTENT_SPEC}|INTRINSIC|OPTIONAL|PARAMETER|POINTER|PROTECTED|PRIVATE|PUBLIC|SAVE|TARGET|RECURSIVE|PURE|IMPURE|ELEMENTAL|VALUE|NOPASS|DEFERRED|CONTIGUOUS|VOLATILE) +ATTR_SPEC (IMPLICIT|ALLOCATABLE|DIMENSION{ARGS}|EXTERNAL|{INTENT_SPEC}|INTRINSIC|OPTIONAL|PARAMETER|POINTER|PROTECTED|PRIVATE|PUBLIC|SAVE|TARGET|(NON_)?RECURSIVE|PURE|IMPURE|ELEMENTAL|VALUE|NOPASS|DEFERRED|CONTIGUOUS|VOLATILE) ACCESS_SPEC (PROTECTED|PRIVATE|PUBLIC) /* Assume that attribute statements are almost the same as attributes. */ ATTR_STMT {ATTR_SPEC}|DIMENSION FLOW (DO|SELECT|CASE|SELECT{BS}(CASE|TYPE)|WHERE|IF|THEN|ELSE|WHILE|FORALL|ELSEWHERE|ELSEIF|RETURN|CONTINUE|EXIT|GO{BS}TO) COMMANDS (FORMAT|CONTAINS|MODULE{BS_}PROCEDURE|WRITE|READ|ALLOCATE|ALLOCATED|ASSOCIATED|PRESENT|DEALLOCATE|NULLIFY|SIZE|INQUIRE|OPEN|CLOSE|FLUSH|DATA|COMMON) IGNORE (CALL) -PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|IMPURE|PURE|ELEMENTAL)? +PREFIX ((NON_)?RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,4}((NON_)?RECURSIVE|IMPURE|PURE|ELEMENTAL)? /* | */ @@ -813,7 +816,8 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I unput(*yytext); yy_pop_state();YY_FTN_RESET } -<Start>"import"{BS_} { +<*>"import"{BS}/"\n" | +<*>"import"{BS_} { startFontClass("keywordtype"); codifyLines(yytext); endFontClass(); @@ -825,6 +829,11 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I generateLink(*g_code, yytext); g_insideBody=FALSE; } +<Import>("ONLY"|"NONE"|"ALL") { + startFontClass("keywordtype"); + codifyLines(yytext); + endFontClass(); + } /*-------- fortran module -----------------------------------------*/ <Start>("block"{BS}"data"|"program"|"module"|"interface")/{BS_}|({COMMA}{ACCESS_SPEC})|\n { // startScope(); @@ -836,14 +845,14 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I if (!qstricmp(yytext,"module")) currentModule="module"; } <Start>("type")/{BS_}|({COMMA}({ACCESS_SPEC}|ABSTRACT|EXTENDS))|\n { // - startScope(); - startFontClass("keyword"); - codifyLines(yytext); - endFontClass(); + startScope(); + startFontClass("keyword"); + codifyLines(yytext); + endFontClass(); yy_push_state(YY_START); - BEGIN(ClassName); - currentClass="class"; - } + BEGIN(ClassName); + currentClass="class"; + } <ClassName>{ID} { if (currentModule == "module") { @@ -853,7 +862,7 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I generateLink(*g_code,yytext); yy_pop_state(); } -<ClassName>({ACCESS_SPEC}|ABSTRACT|EXTENDS)/[,:( ] { //| variable deklaration +<ClassName>({ACCESS_SPEC}|ABSTRACT|EXTENDS)/[,:( ] { //| variable declaration startFontClass("keyword"); g_code->codify(yytext); endFontClass(); @@ -876,7 +885,7 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I codifyLines(yytext); endFontClass(); } -<Start>({PREFIX}{BS_})?{SUBPROG}{BS_} { // Fortran subroutine or function found +<Start>({PREFIX}{BS_})?{SUBPROG}{BS_} { // Fortran subroutine or function found startFontClass("keyword"); codifyLines(yytext); endFontClass(); @@ -922,7 +931,18 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I endFontClass(); } /*-------- variable declaration ----------------------------------*/ +<Start>^{BS}"real"/[,:( ] { // real is a bit tricky as it is a data type but also a function. + yy_push_state(YY_START); + BEGIN(Declaration); + startFontClass("keywordtype"); + g_code->codify(yytext); + endFontClass(); + } <Start>{TYPE_SPEC}/[,:( ] { + QCString typ = yytext; + typ = removeRedundantWhiteSpace(typ.lower()); + if (QString(typ).startsWith("real")) YY_FTN_REJECT; + if (typ == "type" || typ == "class" || typ == "procedure") inTypeDecl = 1; yy_push_state(YY_START); BEGIN(Declaration); startFontClass("keywordtype"); @@ -934,7 +954,7 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I g_code->codify(yytext); endFontClass(); } -<Declaration>({TYPE_SPEC}|{ATTR_SPEC})/[,:( ] { //| variable deklaration +<Declaration>({TYPE_SPEC}|{ATTR_SPEC})/[,:( ] { //| variable declaration startFontClass("keywordtype"); g_code->codify(yytext); endFontClass(); @@ -946,7 +966,7 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I g_code->codify(yytext); endFontClass(); } - else if (g_currentMemberDef && ((g_currentMemberDef->isFunction() && (g_currentMemberDef->typeString() != QCString("subroutine"))) || + else if (g_currentMemberDef && ((g_currentMemberDef->isFunction() && (g_currentMemberDef->typeString() != QCString("subroutine") || inTypeDecl)) || g_currentMemberDef->isVariable())) { generateLink(*g_code, yytext); @@ -956,22 +976,23 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I g_code->codify(yytext); addLocalVar(yytext); } - } -<Declaration>{BS}("=>"|"="){BS} { // Procedure binding - BEGIN(DeclarationBinding); - g_code->codify(yytext); - } -<DeclarationBinding>{ID} { // Type bound procedure link + } +<Declaration>{BS}("=>"|"="){BS} { // Procedure binding + BEGIN(DeclarationBinding); + g_code->codify(yytext); + } +<DeclarationBinding>{ID} { // Type bound procedure link generateLink(*g_code, yytext); yy_pop_state(); - } -<Declaration>[(] { // start of array specification + } +<Declaration>[(] { // start of array or type / class specification bracketCount++; g_code->codify(yytext); } <Declaration>[)] { // end array specification bracketCount--; + if (!bracketCount) inTypeDecl = 0; g_code->codify(yytext); } @@ -1175,14 +1196,16 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I /*-----------------------------------------------------------------------------*/ <*>\n { - if (g_endComment) - { - g_endComment=FALSE; - } - else - { - codifyLines(yytext); - } + if (g_endComment) + { + g_endComment=FALSE; + } + else + { + codifyLines(yytext); + // comment cannot extend over the end of a line so should always be terminatd at the end of the line. + if (g_currentFontClass && !strcmp(g_currentFontClass,"comment")) endFontClass(); + } g_contLineNr++; YY_FTN_RESET } diff --git a/src/fortranscanner.l b/src/fortranscanner.l index 85b6de9..774251b 100644 --- a/src/fortranscanner.l +++ b/src/fortranscanner.l @@ -198,6 +198,8 @@ static SymbolModifiers currentModifiers; //! Holds program scope->symbol name->symbol modifiers. static QMap<Entry*,QMap<QCString,SymbolModifiers> > modifiers; +static Entry *global_scope = NULL; + //----------------------------------------------------------------------------- static int yyread(char *buf,int max_size); @@ -248,6 +250,7 @@ SUBPROG (subroutine|function) B [ \t] BS [ \t]* BS_ [ \t]+ +BT_ ([ \t]+|[ \t]*"(") COMMA {BS},{BS} ARGS_L0 ("("[^)]*")") ARGS_L1a [^()]*"("[^)]*")"[^)]* @@ -271,7 +274,7 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} EXTERNAL_STMT (EXTERNAL) CONTAINS CONTAINS -PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|IMPURE|PURE|ELEMENTAL)? +PREFIX ((NON_)?RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,4}((NON_)?RECURSIVE|IMPURE|PURE|ELEMENTAL)? SCOPENAME ({ID}{BS}"::"{BS})* %option noyywrap @@ -558,7 +561,18 @@ SCOPENAME ({ID}{BS}"::"{BS})* if (!endScope(current_root)) yyterminate(); defaultProtection = Public; - yy_pop_state(); + if (global_scope) + { + if (global_scope != (Entry *) -1) + yy_push_state(Start); + else + yy_pop_state(); // cannot pop artrificial entry + } + else + { + yy_push_state(Start); + global_scope = (Entry *)-1; // signal that the global_scope has already been used. + } } <Module>{ID} { addModule(yytext, TRUE); @@ -602,7 +616,7 @@ abstract { current->spec |= Entry::AbstractClass; } extends{ARGS} { - QCString basename = extractFromParens(yytext); + QCString basename = extractFromParens(yytext).lower(); current->extends->append(new BaseInfo(basename, Public, Normal)); } public { @@ -667,7 +681,8 @@ private { addCurrentEntry(1); } {BS}"=>"[^(\n|\!)]* { /* Specific bindings come after the ID. */ - last_entry->args = yytext; + QCString args = yytext; + last_entry->args = args.lower(); } "\n" { currentModifiers = SymbolModifiers(); @@ -773,8 +788,10 @@ private { } {ID} { } -^{BS}"type"{BS_}"is"/{BS_} { } +^{BS}"type"{BS_}"is"/{BT_} { } ^{BS}"type"{BS}"=" { } +^{BS}"class"{BS_}"is"/{BT_} { } +^{BS}"class"{BS_}"default" { } } <AttributeList>{ {COMMA} {} @@ -1098,7 +1115,6 @@ private { yy_push_state(YY_START); BEGIN(StrIgnore); debugStr="*!"; - //fprintf(stderr,"start comment %d\n",yyLineNr); } } } @@ -1552,7 +1568,10 @@ const char* prepassFixedForm(const char* contents, int *hasContLine) } // fallthrough default: - if(column==6 && emptyLabel) { // continuation + if ((column < 6) && ((c - '0') >= 0) && ((c - '0') <= 9)) { // remove numbers, i.e. labels from first 5 positions. + newContents[j]=' '; + } + else if(column==6 && emptyLabel) { // continuation if (!commented) fullCommentLine=FALSE; if (c != '0') { // 0 not allowed as continuation character, see f95 standard paragraph 3.3.2.3 newContents[j]=' '; @@ -2017,14 +2036,23 @@ static void startScope(Entry *scope) */ static bool endScope(Entry *scope, bool isGlobalRoot) { + if (global_scope == scope) + { + global_scope = NULL; + return TRUE; + } + if (global_scope == (Entry *) -1) + { + return TRUE; + } //cout<<"end scope: "<<scope->name<<endl; if (current_root->parent() || isGlobalRoot) { current_root= current_root->parent(); /* end substructure */ } - else + else // if (current_root != scope) { - fprintf(stderr,"parse error in end <scopename>"); + fprintf(stderr,"parse error in end <scopename>\n"); scanner_abort(); return FALSE; } @@ -2558,6 +2586,7 @@ static void parseMain(const char *fileName,const char *fileBuf,Entry *rt, Fortra yyFileName = fileName; msg("Parsing file %s...\n",yyFileName.data()); + global_scope = rt; startScope(rt); // implies current_root = rt initParser(); groupEnterFile(yyFileName,yyLineNr); @@ -2579,7 +2608,7 @@ static void parseMain(const char *fileName,const char *fileBuf,Entry *rt, Fortra fortranscannerYYlex(); groupLeaveFile(yyFileName,yyLineNr); - endScope(current_root, TRUE); // TRUE - global root + if (global_scope && global_scope != (Entry *) -1) endScope(current_root, TRUE); // TRUE - global root //debugCompounds(rt); //debug diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp index 539aea8..e0f9038 100644 --- a/src/htmldocvisitor.cpp +++ b/src/htmldocvisitor.cpp @@ -126,21 +126,29 @@ static bool mustBeOutsideParagraph(DocNode *n) return FALSE; } -static QString htmlAttribsToString(const HtmlAttribList &attribs) +static QString htmlAttribsToString(const HtmlAttribList &attribs, const bool img_tag = FALSE) { QString result; HtmlAttribListIterator li(attribs); HtmlAttrib *att; + bool alt_set = FALSE; + for (li.toFirst();(att=li.current());++li) { if (!att->value.isEmpty()) // ignore attribute without values as they - // are not XHTML compliant + // are not XHTML compliant, with the exception + // of the alt attribute with the img tag { result+=" "; result+=att->name; result+="=\""+convertToXML(att->value)+"\""; + if (att->name == "alt") alt_set = TRUE; } } + if (!alt_set && img_tag) + { + result+=" alt=\"\""; + } return result; } @@ -1521,7 +1529,7 @@ void HtmlDocVisitor::visitPre(DocImage *img) else { m_t << "<img src=\"" << correctURL(url,img->relPath()) << "\"" - << sizeAttribs << htmlAttribsToString(img->attribs()) + << sizeAttribs << htmlAttribsToString(img->attribs(), TRUE) << "/>" << endl; } } diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index cc3e61d..accc6a0 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -375,7 +375,7 @@ static QCString substituteHtmlKeywords(const QCString &s, mathJaxJs += "\n"; } mathJaxJs += "</script>"; - mathJaxJs += "<script type=\"text/javascript\" async src=\"" + path + "MathJax.js\"></script>\n"; + mathJaxJs += "<script type=\"text/javascript\" async=\"async\" src=\"" + path + "MathJax.js\"></script>\n"; } // first substitute generic keywords @@ -2354,7 +2354,7 @@ void HtmlGenerator::writeSearchPage() if (cf.open(IO_WriteOnly)) { FTextStream t(&cf); - t << "<script language=\"php\">\n\n"; + t << "<?php\n\n"; t << "$config = array(\n"; t << " 'PROJECT_NAME' => \"" << convertToHtml(projectName) << "\",\n"; t << " 'GENERATE_TREEVIEW' => " << (generateTreeView?"true":"false") << ",\n"; @@ -2372,7 +2372,7 @@ void HtmlGenerator::writeSearchPage() t << " 'split_bar' => \"" << substitute(substitute(writeSplitBarAsString("search",""), "\"","\\\""), "\n","\\n") << "\",\n"; t << " 'logo' => \"" << substitute(substitute(writeLogoAsString(""), "\"","\\\""), "\n","\\n") << "\",\n"; t << ");\n\n"; - t << "</script>\n"; + t << "?>\n"; } ResourceMgr::instance().copyResource("search_functions.php",htmlOutput); @@ -2403,10 +2403,10 @@ void HtmlGenerator::writeSearchPage() t << "</div>" << endl; } - t << "<script language=\"php\">\n"; + t << "<?php\n"; t << "require_once \"search_functions.php\";\n"; t << "main();\n"; - t << "</script>\n"; + t << "?>\n"; // Write empty navigation path, to make footer connect properly if (generateTreeView) diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp index aa6981e..7080d02 100644 --- a/src/latexdocvisitor.cpp +++ b/src/latexdocvisitor.cpp @@ -526,7 +526,19 @@ void LatexDocVisitor::visit(DocIncOperator *op) void LatexDocVisitor::visit(DocFormula *f) { if (m_hide) return; - m_t << f->text(); + const char *p=f->text(); + char c; + if (p) + { + while ((c=*p++)) + { + switch (c) + { + case '\'': m_t << "\\text{'}"; break; + default: m_t << c; break; + } + } + } } void LatexDocVisitor::visit(DocIndexEntry *i) @@ -927,7 +939,7 @@ static void writeStartTableCommand(FTextStream &t,const DocNode *n,int cols) } else { - t << "\\tabulinesep=1mm\n\\begin{longtabu} spread 0pt [c]{*{" << cols << "}{|X[-1]}|}\n"; + t << "\\tabulinesep=1mm\n\\begin{longtabu}spread 0pt [c]{*{" << cols << "}{|X[-1]}|}\n"; } //return isNested ? "TabularNC" : "TabularC"; } diff --git a/src/latexgen.cpp b/src/latexgen.cpp index c192a97..a90dc64 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -38,6 +38,7 @@ #include "filename.h" #include "resourcemgr.h" +static bool DoxyCodeOpen = FALSE; //------------------------------- LatexCodeGenerator::LatexCodeGenerator(FTextStream &t,const QCString &relPath,const QCString &sourceFileName) @@ -77,8 +78,8 @@ void LatexCodeGenerator::codify(const char *str) //char cs[5]; int spacesToNextTabStop; static int tabSize = Config_getInt(TAB_SIZE); - const int maxLineLen = 108; - QCString result(4*maxLineLen+1); // worst case for 1 line of 4-byte chars + static char *result = NULL; + static int lresult = 0; int i; while ((c=*p)) { @@ -86,9 +87,17 @@ void LatexCodeGenerator::codify(const char *str) { case 0x0c: p++; // remove ^L break; + case ' ': m_t <<" "; + m_col++; + p++; + break; + case '^': m_t <<"\\string^"; + m_col++; + p++; + break; case '\t': spacesToNextTabStop = tabSize - (m_col%tabSize); - m_t << Doxygen::spaces.left(spacesToNextTabStop); + for (i = 0; i < spacesToNextTabStop; i++) m_t <<" "; m_col+=spacesToNextTabStop; p++; break; @@ -100,6 +109,11 @@ void LatexCodeGenerator::codify(const char *str) #undef COPYCHAR // helper macro to copy a single utf8 character, dealing with multibyte chars. #define COPYCHAR() do { \ + if (lresult < (i + 5)) \ + { \ + lresult += 512; \ + result = (char *)realloc(result, lresult); \ + } \ result[i++]=c; p++; \ if (c<0) /* multibyte utf-8 character */ \ { \ @@ -116,30 +130,16 @@ void LatexCodeGenerator::codify(const char *str) result[i++]=*p++; \ } \ } \ - m_col++; \ + m_col++; \ } while(0) - // gather characters until we find whitespace or are at - // the end of a line + // gather characters until we find whitespace or another special character COPYCHAR(); - if (m_col>=maxLineLen) // force line break - { - m_t << "\n "; - m_col=0; - } - else // copy more characters + while ((c=*p) && + c!=0x0c && c!='\t' && c!='\n' && c!=' ' && c!='^' + ) { - while (m_col<maxLineLen && (c=*p) && - c!=0x0c && c!='\t' && c!='\n' && c!=' ' - ) - { - COPYCHAR(); - } - if (m_col>=maxLineLen) // force line break - { - m_t << "\n "; - m_col=0; - } + COPYCHAR(); } result[i]=0; // add terminator //if (m_prettyCode) @@ -190,6 +190,11 @@ void LatexCodeGenerator::writeLineNumber(const char *ref,const char *fileName,co { static bool usePDFLatex = Config_getBool(USE_PDFLATEX); static bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS); + if (!DoxyCodeOpen) + { + m_t << "\\DoxyCodeLine{"; + DoxyCodeOpen = TRUE; + } if (m_prettyCode) { QCString lineNumber; @@ -223,10 +228,20 @@ void LatexCodeGenerator::writeLineNumber(const char *ref,const char *fileName,co void LatexCodeGenerator::startCodeLine(bool) { m_col=0; + if (!DoxyCodeOpen) + { + m_t << "\\DoxyCodeLine{"; + DoxyCodeOpen = TRUE; + } } void LatexCodeGenerator::endCodeLine() { + if (DoxyCodeOpen) + { + m_t << "}"; + DoxyCodeOpen = FALSE; + } codify("\n"); } @@ -478,8 +493,7 @@ static void writeDefaultHeaderPart1(FTextStream &t) t << "% Packages required by doxygen\n" "\\usepackage{fixltx2e}\n" // for \textsubscript "\\usepackage{calc}\n" - "\\usepackage{doxygen}\n" - "\\usepackage[export]{adjustbox} % also loads graphicx\n"; + "\\usepackage{doxygen}\n"; QStrList extraLatexStyle = Config_getList(LATEX_EXTRA_STYLESHEET); for (uint i=0; i<extraLatexStyle.count(); ++i) { @@ -636,6 +650,23 @@ static void writeDefaultHeaderPart1(FTextStream &t) bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS); if (pdfHyperlinks) { + unsigned char minus[4]; // Superscript minus + char *pminus = (char *)minus; + unsigned char sup2[3]; // Superscript two + char *psup2 = (char *)sup2; + unsigned char sup3[3]; + char *psup3 = (char *)sup3; // Superscript three + minus[0]= 0xE2; + minus[1]= 0x81; + minus[2]= 0xBB; + minus[3]= 0; + sup2[0]= 0xC2; + sup2[1]= 0xB2; + sup2[2]= 0; + sup3[0]= 0xC2; + sup3[1]= 0xB3; + sup3[2]= 0; + t << "% Hyperlinks (required, but should be loaded last)\n" "\\ifpdf\n" " \\usepackage[pdftex,pagebackref=true]{hyperref}\n" @@ -646,6 +677,19 @@ static void writeDefaultHeaderPart1(FTextStream &t) " \\usepackage[ps2pdf,pagebackref=true]{hyperref}\n" " \\fi\n" "\\fi\n" + "\\ifpdf\n" + " \\DeclareUnicodeCharacter{207B}{${}^{-}$}% Superscript minus\n" + " \\DeclareUnicodeCharacter{C2B2}{${}^{2}$}% Superscript two\n" + " \\DeclareUnicodeCharacter{C2B3}{${}^{3}$}% Superscript three\n" + "\\else\n" + " \\catcode`\\" << pminus << "=13% Superscript minus\n" + " \\def" << pminus << "{${}^{-}$}\n" + " \\catcode`\\" << psup2 << "=13% Superscript two\n" + " \\def" << psup2 << "{${}^{2}$}\n" + " \\catcode`\\"<<psup3<<"=13% Superscript three\n" + " \\def"<<psup3<<"{${}^{3}$}\n" + "\\fi\n" + "\n" "\\hypersetup{%\n" " colorlinks=true,%\n" " linkcolor=blue,%\n" @@ -765,7 +809,7 @@ static void writeDefaultFooter(FTextStream &t) t << "\\newpage\n" "\\phantomsection\n" "\\clearemptydoublepage\n" - "\\addcontentsline{toc}{" << unit << "}{" << theTranslator->trRTFGeneralIndex() << "}\n" + "\\addcontentsline{toc}{" << unit << "}{\\indexname}\n" "\\printindex\n" "\n"; QCString documentPost = theTranslator->latexDocumentPost(); diff --git a/src/markdown.cpp b/src/markdown.cpp index d3ec3f1..f7526dc 100644 --- a/src/markdown.cpp +++ b/src/markdown.cpp @@ -240,7 +240,7 @@ static QCString isBlockCommand(const char *data,int offset,int size) { return "f]"; } - else if (data[end]=='}') + else if (data[end]=='{') { return "f}"; } @@ -483,6 +483,8 @@ static int processNmdash(GrowBuf &out,const char *data,int off,int size) { count++; } + if (count==2 && off>=2 && qstrncmp(data-2,"<!",2)==0) return 0; // start HTML comment + if (count==2 && (data[2]=='>')) return 0; // end HTML comment if (count==2 && (off<8 || qstrncmp(data-8,"operator",8)!=0)) // -- => ndash { out.addStr("–"); @@ -2548,7 +2550,7 @@ QCString processMarkdown(const QCString &fileName,const int lineNr,Entry *e,cons // finally process the inline markup (links, emphasis and code spans) processInline(out,s,s.length()); out.addChar(0); - Debug::print(Debug::Markdown,0,"======== Markdown =========\n---- input ------- \n%s\n---- output -----\n%s\n---------\n",qPrint(input),qPrint(out.get())); + Debug::print(Debug::Markdown,0,"======== Markdown =========\n---- input ------- \n%s\n---- output -----\n%s\n=========\n",qPrint(input),qPrint(out.get())); return out.get(); } diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 922b75d..256865b 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -101,7 +101,7 @@ static QCString addTemplateNames(const QCString &s,const QCString &n,const QCStr // ol.endParameterName(last==FALSE) // ... // ol.startParameterType(first=FALSE) -// ol.endParamtereType +// ol.endParameterType // ol.startParameterName // ol.endParameterName(last==TRUE) // ... @@ -571,7 +571,7 @@ class MemberDefImpl bool stat; // is it a static function? bool proto; // is it a prototype; bool docEnumValues; // is an enum with documented enum values. - bool annScope; // member is part of an annoymous scope + bool annScope; // member is part of an anonymous scope bool annUsed; bool hasCallGraph; bool hasCallerGraph; @@ -3212,7 +3212,10 @@ QCString MemberDef::memberTypeName() const void MemberDef::warnIfUndocumented() { - if (m_impl->memberGroup) return; + /* + * Removed bug_303020: + * if (m_impl->memberGroup) return; + */ ClassDef *cd = getClassDef(); NamespaceDef *nd = getNamespaceDef(); FileDef *fd = getFileDef(); diff --git a/src/pyscanner.l b/src/pyscanner.l index 9c21d41..5c9aef5 100644 --- a/src/pyscanner.l +++ b/src/pyscanner.l @@ -109,7 +109,7 @@ static QCString g_packageName; //static bool g_hideClassDocs; -static QCString g_defVal; +static QGString g_defVal; static int g_braceCount; static bool g_lexInit = FALSE; @@ -993,35 +993,49 @@ STARTDOCSYMS "##" } <FunctionParamDefVal>{ - "(" { // internal opening brace + "[" | + "(" { // internal opening brace, assumption is that we have correct code so braces do match g_braceCount++; g_defVal+=*yytext; } "," | + "]" | ")" { if (g_braceCount==0) // end of default argument { if (current->argList->getLast()) { - current->argList->getLast()->defval=g_defVal.stripWhiteSpace(); + current->argList->getLast()->defval=QCString(g_defVal.data()).stripWhiteSpace(); } - if (*yytext == ')') + if (*yytext != ',') current->args = argListToString(current->argList); BEGIN(FunctionParams); } else // continue { - if (*yytext == ')')g_braceCount--; + if (*yytext != ',')g_braceCount--; g_defVal+=*yytext; } } - . { - g_defVal+=*yytext; - } + "'" { + g_defVal+=*yytext; + g_copyString=&g_defVal; + g_stringContext=FunctionParamDefVal; + BEGIN( SingleQuoteString ); + } + "\"" { + g_defVal+=*yytext; + g_copyString=&g_defVal; + g_stringContext=FunctionParamDefVal; + BEGIN( DoubleQuoteString ); + } \n { g_defVal+=*yytext; incLineNr(); } + . { + g_defVal+=*yytext; + } } @@ -1168,13 +1182,17 @@ STARTDOCSYMS "##" current->program+=yytext; BEGIN(TripleComment); } - {TRISINGLEQUOTE} { // start of a comment block initTriSingleQuoteBlock(); current->program+=yytext; BEGIN(TripleComment); } - + {STARTDOCSYMS}[#]* { // start of a special comment + initSpecialBlock(); + BEGIN(SpecialComment); + } + {POUNDCOMMENT} { // ignore comment with just one # + } ^{BB} { current->program+=yytext; //current->startLine = yyLineNr; @@ -1187,7 +1205,6 @@ STARTDOCSYMS "##" } ""/({NONEMPTY}|{EXPCHAR}) { - // Just pushback an empty class, and // resume parsing the body. newEntry(); diff --git a/src/scanner.l b/src/scanner.l index 08a5e52..381ad6b 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -2382,10 +2382,6 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) { current->protection = Protected; } - else if (javaLike && qstrcmp(yytext,"internal")==0) - { - current->protection = Package; - } else if (javaLike && qstrcmp(yytext,"private")==0) { current->protection = Private; @@ -3639,7 +3635,10 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) current->fileName = yyFileName; current->startLine = yyLineNr; current->startColumn = yyColNr; - current->type = "@"; // enum marker + if (!(current_root->spec&Entry::Enum)) + { + current->type = "@"; // enum marker + } current->args = current->args.simplifyWhiteSpace(); current->name = current->name.stripWhiteSpace(); current->section = Entry::VARIABLE_SEC; diff --git a/src/tclscanner.l b/src/tclscanner.l index 791ecc4..56d2e3d 100644 --- a/src/tclscanner.l +++ b/src/tclscanner.l @@ -703,6 +703,7 @@ static void tcl_codify(const char *s,const char *str) } else { + if (*(p-2)==0x1A) *(p-2) = '\0'; // remove ^Z tcl.code->codify(sp); done=TRUE; } @@ -3024,11 +3025,6 @@ void TclLanguageScanner::parseCode(CodeOutputInterface & codeOutIntf, } tcl_inf("%s (%d,%d) %d %d\n",myStr.ascii(),startLine,endLine,isExampleBlock,inlineFragment); //tcl_inf("%s\n"input.data()); - if (isExampleBlock) - { - tcl_codify(NULL,input); - return; - } tcl_init(); tcl.collectXRefs = collectXRefs; tcl.memberdef = memberDef; @@ -3047,8 +3043,15 @@ tcl_inf("%s (%d,%d) %d %d\n",myStr.ascii(),startLine,endLine,isExampleBlock,inli } tcl.file_name = ""; tcl.this_parser = NULL; - tcl.entry_main = tcl_entry_new(); - tcl_parse(myNs,myCls); + if (isExampleBlock) + { + tcl_codify(NULL,input); + } + else + { + tcl.entry_main = tcl_entry_new(); + tcl_parse(myNs,myCls); + } tcl.code->endCodeLine(); tcl.scan.clear(); tcl.ns.clear(); diff --git a/src/util.cpp b/src/util.cpp index 25b805a..5a22fef 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -7917,7 +7917,7 @@ bool readInputFile(const char *fileName,BufStr &inBuf,bool filter,bool isSourceC int start=0; if (size>=2 && - ((inBuf.at(0)==-1 && inBuf.at(1)==-2) || // Litte endian BOM + ((inBuf.at(0)==-1 && inBuf.at(1)==-2) || // Little endian BOM (inBuf.at(0)==-2 && inBuf.at(1)==-1) // big endian BOM ) ) // UCS-2 encoded file @@ -8081,7 +8081,7 @@ QCString externalRef(const QCString &relPath,const QCString &ref,bool href) return result; } -/** Writes the intensity only bitmap representated by \a data as an image to +/** Writes the intensity only bitmap represented by \a data as an image to * directory \a dir using the colors defined by HTML_COLORSTYLE_*. */ void writeColoredImgData(const char *dir,ColoredImgDataItem data[]) diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index 697a4d8..63fc8ad 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -175,7 +175,7 @@ static void writeCombineScript() " <xsl:output method=\"xml\" version=\"1.0\" indent=\"no\" standalone=\"yes\" />\n" " <xsl:template match=\"/\">\n" " <doxygen version=\"{doxygenindex/@version}\">\n" - " <!-- Load all doxgen generated xml files -->\n" + " <!-- Load all doxygen generated xml files -->\n" " <xsl:for-each select=\"doxygenindex/compound\">\n" " <xsl:copy-of select=\"document( concat( @refid, '.xml' ) )/doxygen/*\" />\n" " </xsl:for-each>\n" diff --git a/templates/html/search_functions.php b/templates/html/search_functions.php index caa9e3b..7374de9 100644 --- a/templates/html/search_functions.php +++ b/templates/html/search_functions.php @@ -1,4 +1,4 @@ -<script language="PHP"> +<?php require_once "search_config.php"; function end_form($value) @@ -363,4 +363,4 @@ function main() report_results($sorted); end_page(); } -</script> +?> diff --git a/templates/html/search_opensearch.php b/templates/html/search_opensearch.php index 58ee4ab..95c1c2c 100644 --- a/templates/html/search_opensearch.php +++ b/templates/html/search_opensearch.php @@ -1,4 +1,4 @@ -<script language="PHP"> +<?php require "search_functions.php"; $mode = array_key_exists('v', $_GET)?$_GET['v']:""; @@ -125,4 +125,4 @@ function invalid_format($query, array $results) print "Search results for '$query':\n\n"; print_r($results); } -</script> +?> diff --git a/templates/latex/doxygen.sty b/templates/latex/doxygen.sty index e457acc..bee23c5 100644 --- a/templates/latex/doxygen.sty +++ b/templates/latex/doxygen.sty @@ -11,8 +11,15 @@ \RequirePackage[table]{xcolor} \RequirePackage{longtable} \RequirePackage{tabu} +\RequirePackage{fancyvrb} \RequirePackage{tabularx} \RequirePackage{multirow} +\RequirePackage{hanging} +\RequirePackage{ifpdf} +\RequirePackage{adjustbox} +\RequirePackage{amssymb} +\RequirePackage{stackengine} + %---------- Internal commands used in this style file ---------------- @@ -77,17 +84,49 @@ \end{alltt}% \normalsize% } +% Necessary for redefining not defined charcaters, i.e. "Replacement Character" in tex output. +\newlength{\CodeWidthChar} +\newlength{\CodeHeightChar} +% Necessary for hanging indent +\newlength{\DoxyCodeWidth} + +\newcommand\DoxyCodeLine[1]{\hangpara{\DoxyCodeWidth}{1}{#1}\par} + +\newcommand\NiceSpace{% + \discretionary{}{\kern\fontdimen2\font}{\kern\fontdimen2\font}% +} % Used by @code ... @endcode \newenvironment{DoxyCode}{% \par% \scriptsize% - \begin{alltt}% + \normalfont\ttfamily% + \rightskip0pt plus 1fil% + \settowidth{\DoxyCodeWidth}{000000}% + \settowidth{\CodeWidthChar}{?}% + \settoheight{\CodeHeightChar}{?}% + \setlength{\parskip}{0ex plus 0ex minus 0ex}% + {\lccode`~32 \lowercase{\global\let~}\NiceSpace}\obeyspaces% + }{% - \end{alltt}% + \normalfont% \normalsize% } +% Redefining not defined charcaters, i.e. "Replacement Character" in tex output. +\def\ucr{\adjustbox{width=\CodeWidthChar,height=\CodeHeightChar}{\stackinset{c}{}{c}{-.2pt}{% + \textcolor{white}{\sffamily\bfseries\small ?}}{% + \rotatebox{45}{$\blacksquare$}}}} + +% Choosing right setup for "Replacement character" +\ifpdf + \RequirePackage[utf8]{inputenc} + \DeclareUnicodeCharacter{FFFD}{\ucr} +\else + \catcode`\�=13 + \def�{\ucr} +\fi + % Used by @example, @include, @includelineno and @dontinclude \newenvironment{DoxyCodeInclude}{% \DoxyCode% @@ -273,10 +312,10 @@ \tabulinesep=1mm% \par% \ifthenelse{\equal{#1}{}}% - {\begin{longtabu} spread 0pt [l]{|X[-1,l]|X[-1,l]|}}% name + description + {\begin{longtabu*}spread 0pt [l]{|X[-1,l]|X[-1,l]|}}% name + description {\ifthenelse{\equal{#1}{1}}% - {\begin{longtabu} spread 0pt [l]{|X[-1,l]|X[-1,l]|X[-1,l]|}}% in/out + name + desc - {\begin{longtabu} spread 0pt [l]{|X[-1,l]|X[-1,l]|X[-1,l]|X[-1,l]|}}% in/out + type + name + desc + {\begin{longtabu*}spread 0pt [l]{|X[-1,l]|X[-1,l]|X[-1,l]|}}% in/out + name + desc + {\begin{longtabu*}spread 0pt [l]{|X[-1,l]|X[-1,l]|X[-1,l]|X[-1,l]|}}% in/out + type + name + desc } \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #2}\\[1ex]% \hline% @@ -285,7 +324,7 @@ \hline% \endhead% }{% - \end{longtabu}% + \end{longtabu*}% \vspace{6pt}% } @@ -293,7 +332,7 @@ \newenvironment{DoxyFields}[1]{% \tabulinesep=1mm% \par% - \begin{longtabu} spread 0pt [l]{|X[-1,r]|X[-1,l]|X[-1,l]|}% + \begin{longtabu*}spread 0pt [l]{|X[-1,r]|X[-1,l]|X[-1,l]|}% \multicolumn{3}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% \hline% \endfirsthead% @@ -301,7 +340,7 @@ \hline% \endhead% }{% - \end{longtabu}% + \end{longtabu*}% \vspace{6pt}% } @@ -309,7 +348,7 @@ \newenvironment{DoxyEnumFields}[1]{% \tabulinesep=1mm% \par% - \begin{longtabu} spread 0pt [l]{|X[-1,r]|X[-1,l]|}% + \begin{longtabu*}spread 0pt [l]{|X[-1,r]|X[-1,l]|}% \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% \hline% \endfirsthead% @@ -317,7 +356,7 @@ \hline% \endhead% }{% - \end{longtabu}% + \end{longtabu*}% \vspace{6pt}% } @@ -331,7 +370,7 @@ \newenvironment{DoxyRetVals}[1]{% \tabulinesep=1mm% \par% - \begin{longtabu} spread 0pt [l]{|X[-1,r]|X[-1,l]|}% + \begin{longtabu*}spread 0pt [l]{|X[-1,r]|X[-1,l]|}% \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% \hline% \endfirsthead% @@ -339,7 +378,7 @@ \hline% \endhead% }{% - \end{longtabu}% + \end{longtabu*}% \vspace{6pt}% } @@ -347,7 +386,7 @@ \newenvironment{DoxyExceptions}[1]{% \tabulinesep=1mm% \par% - \begin{longtabu} spread 0pt [l]{|X[-1,r]|X[-1,l]|}% + \begin{longtabu*}spread 0pt [l]{|X[-1,r]|X[-1,l]|}% \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% \hline% \endfirsthead% @@ -355,7 +394,7 @@ \hline% \endhead% }{% - \end{longtabu}% + \end{longtabu*}% \vspace{6pt}% } @@ -363,7 +402,7 @@ \newenvironment{DoxyTemplParams}[1]{% \tabulinesep=1mm% \par% - \begin{longtabu} spread 0pt [l]{|X[-1,r]|X[-1,l]|}% + \begin{longtabu*}spread 0pt [l]{|X[-1,r]|X[-1,l]|}% \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% \hline% \endfirsthead% @@ -371,7 +410,7 @@ \hline% \endhead% }{% - \end{longtabu}% + \end{longtabu*}% \vspace{6pt}% } @@ -439,11 +478,11 @@ \newcommand{\PBS}[1]{\let\temp=\\#1\let\\=\temp}% \newenvironment{TabularC}[1]% {\tabulinesep=1mm -\begin{longtabu} spread 0pt [c]{*#1{|X[-1]}|}}% -{\end{longtabu}\par}% +\begin{longtabu*}spread 0pt [c]{*#1{|X[-1]}|}}% +{\end{longtabu*}\par}% \newenvironment{TabularNC}[1]% -{\begin{tabu} spread 0pt [l]{*#1{|X[-1]}|}}% +{\begin{tabu}spread 0pt [l]{*#1{|X[-1]}|}}% {\end{tabu}\par}% % Used for member group headers diff --git a/testing/054/054__parblock_8cpp.xml b/testing/054/054__parblock_8cpp.xml index ae6e462..5567908 100644 --- a/testing/054/054__parblock_8cpp.xml +++ b/testing/054/054__parblock_8cpp.xml @@ -80,6 +80,96 @@ <parameterdescription> <para> <parblock> + <para>First paragraph of the param description.</para> + <para>Second paragraph of the param description. </para> + </parblock> + </para> + </parameterdescription> + </parameteritem> + </parameterlist> + </para> + </detaileddescription> + <inbodydescription> + </inbodydescription> + <location file="054_parblock.cpp" line="33" column="1"/> + </memberdef> + <memberdef kind="function" id="054__parblock_8cpp_1a5cded03ec9e6fd626da35ab05f624f39" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual"> + <type>void</type> + <definition>void function_2</definition> + <argsstring>(int client, int *resource, int parblock, int *test, int p)</argsstring> + <name>function_2</name> + <param> + <type>int</type> + <declname>client</declname> + </param> + <param> + <type>int *</type> + <declname>resource</declname> + </param> + <param> + <type>int</type> + <declname>parblock</declname> + </param> + <param> + <type>int *</type> + <declname>test</declname> + </param> + <param> + <type>int</type> + <declname>p</declname> + </param> + <briefdescription> + </briefdescription> + <detaileddescription> + <para>call by target-specific code to manage resources required by the client.</para> + <para> + <parameterlist kind="param"> + <parameteritem> + <parameternamelist> + <parametername direction="in">client</parametername> + </parameternamelist> + <parameterdescription> + <para>ID of client requesting resource. </para> + </parameterdescription> + </parameteritem> + <parameteritem> + <parameternamelist> + <parametername direction="out">resource</parametername> + </parameternamelist> + <parameterdescription> + <para>Requested resource </para> + </parameterdescription> + </parameteritem> + <parameteritem> + <parameternamelist> + <parametername direction="in">parblock</parametername> + </parameternamelist> + <parameterdescription> + <para> + <parblock> + <para>This is a test for the @parblock command.</para> + <para>A list if values for the parblock param:<itemizedlist><listitem><para>Item 1. This is short one-line description.</para></listitem><listitem><para>Item 2. This is a long bullet item; sometimes they wrap on multiple lines like this one.</para></listitem></itemizedlist> +</para> + <para>This is the second paragraph description for the @parblock parameter. Always end the text inside the @parblock command with an @endparblock command. </para> + </parblock> + </para> + </parameterdescription> + </parameteritem> + <parameteritem> + <parameternamelist> + <parametername direction="out">test</parametername> + </parameternamelist> + <parameterdescription> + <para>This is a test parameter for this function to see if it is included in the parameter table </para> + </parameterdescription> + </parameteritem> + <parameteritem> + <parameternamelist> + <parametername direction="in">p</parametername> + </parameternamelist> + <parameterdescription> + <para> + <parblock> <para>First paragraph of the param description. <verbatim> Second paragraph of the param description. </verbatim> </para> </parblock> @@ -91,7 +181,7 @@ </detaileddescription> <inbodydescription> </inbodydescription> - <location file="054_parblock.cpp" line="32" column="1"/> + <location file="054_parblock.cpp" line="60" column="1"/> </memberdef> </sectiondef> <briefdescription> diff --git a/testing/054_parblock.cpp b/testing/054_parblock.cpp index 186feb5..4f303c6 100644 --- a/testing/054_parblock.cpp +++ b/testing/054_parblock.cpp @@ -24,9 +24,37 @@ @endparblock @param[out] test This is a test parameter for this function to see if it is included in the parameter table + @param[in] p + @parblock First paragraph of the param description. + + Second paragraph of the param description. + @endparblock + */ +void function(int client,int *resource,int parblock,int *test,int p); +/** + call by target-specific code to manage resources required by the client. + + @param[in] client ID of client requesting resource. + @param[out] resource Requested resource + @param[in] parblock @parblock This is a test for the \@parblock + command. + + A list if values for the parblock param: + - Item 1. This is short one-line description. + - Item 2. This is a long bullet item; + sometimes they wrap on multiple lines like this + one. + + This is the second paragraph description for the + \@parblock parameter. Always end the text inside + the \@parblock command with an \@endparblock + command. + @endparblock + @param[out] test This is a test parameter for this function to see if + it is included in the parameter table @param[in] p @parblock First paragraph of the param description. Second paragraph of the param description. - @endparblock + @endparblock */ -void function(int client,int *resource,int parblock,int *test,int p); +void function_2(int client,int *resource,int parblock,int *test,int p); diff --git a/testing/067/067__using_8cpp.xml b/testing/072/072__using_8cpp.xml index c278161..e368966 100644 --- a/testing/067/067__using_8cpp.xml +++ b/testing/072/072__using_8cpp.xml @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> <doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version=""> - <compounddef id="067__using_8cpp" kind="file" language="C++"> - <compoundname>067_using.cpp</compoundname> + <compounddef id="072__using_8cpp" kind="file" language="C++"> + <compoundname>072_using.cpp</compoundname> <sectiondef kind="typedef"> - <memberdef kind="typedef" id="067__using_8cpp_1a1b01c504448c96cd2191a5184dd31acf" prot="public" static="no"> + <memberdef kind="typedef" id="072__using_8cpp_1a1b01c504448c96cd2191a5184dd31acf" prot="public" static="no"> <templateparamlist> <param> <type>class T</type> @@ -20,13 +20,13 @@ </detaileddescription> <inbodydescription> </inbodydescription> - <location file="067_using.cpp" line="7" column="1" bodyfile="067_using.cpp" bodystart="7" bodyend="-1"/> + <location file="072_using.cpp" line="7" column="1" bodyfile="072_using.cpp" bodystart="7" bodyend="-1"/> </memberdef> </sectiondef> <briefdescription> </briefdescription> <detaileddescription> </detaileddescription> - <location file="067_using.cpp"/> + <location file="072_using.cpp"/> </compounddef> </doxygen> diff --git a/testing/067_using.cpp b/testing/072_using.cpp index eb2f5cc..ca02902 100644 --- a/testing/067_using.cpp +++ b/testing/072_using.cpp @@ -1,5 +1,5 @@ // objective: test template parameters for a type alias -// check: 067__using_8cpp.xml +// check: 072__using_8cpp.xml /** \file */ diff --git a/testing/068/068__typed__enum_8cpp.xml b/testing/073/073__typed__enum_8cpp.xml index 880bf14..9dda417 100644 --- a/testing/068/068__typed__enum_8cpp.xml +++ b/testing/073/073__typed__enum_8cpp.xml @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> <doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version=""> - <compounddef id="068__typed__enum_8cpp" kind="file" language="C++"> - <compoundname>068_typed_enum.cpp</compoundname> + <compounddef id="073__typed__enum_8cpp" kind="file" language="C++"> + <compoundname>073_typed_enum.cpp</compoundname> <sectiondef kind="enum"> - <memberdef kind="enum" id="068__typed__enum_8cpp_1aa72902e6181db009a6a84502f81612c2" prot="public" static="no" strong="yes"> + <memberdef kind="enum" id="073__typed__enum_8cpp_1aa72902e6181db009a6a84502f81612c2" prot="public" static="no" strong="yes"> <type>unsigned short</type> <name>E</name> <briefdescription> @@ -13,13 +13,13 @@ </detaileddescription> <inbodydescription> </inbodydescription> - <location file="068_typed_enum.cpp" line="7" column="1" bodyfile="068_typed_enum.cpp" bodystart="7" bodyend="7"/> + <location file="073_typed_enum.cpp" line="7" column="1" bodyfile="073_typed_enum.cpp" bodystart="7" bodyend="7"/> </memberdef> </sectiondef> <briefdescription> </briefdescription> <detaileddescription> </detaileddescription> - <location file="068_typed_enum.cpp"/> + <location file="073_typed_enum.cpp"/> </compounddef> </doxygen> diff --git a/testing/068_typed_enum.cpp b/testing/073_typed_enum.cpp index 44c4123..0818463 100644 --- a/testing/068_typed_enum.cpp +++ b/testing/073_typed_enum.cpp @@ -1,5 +1,5 @@ // objective: test underlying type and strongness for an enum -// check: 068__typed__enum_8cpp.xml +// check: 073__typed__enum_8cpp.xml /** \file */ diff --git a/testing/CMakeLists.txt b/testing/CMakeLists.txt index 97b4868..ae5c24f 100644 --- a/testing/CMakeLists.txt +++ b/testing/CMakeLists.txt @@ -1,9 +1,9 @@ add_custom_target(tests COMMENT "Running doxygen tests..." - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/testing/runtests.py --all --doxygen ${PROJECT_BINARY_DIR}/bin/doxygen --inputdir ${CMAKE_SOURCE_DIR}/testing --outputdir ${PROJECT_BINARY_DIR}/testing + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/testing/runtests.py $(TEST_FLAGS) --doxygen ${PROJECT_BINARY_DIR}/bin/doxygen --inputdir ${CMAKE_SOURCE_DIR}/testing --outputdir ${PROJECT_BINARY_DIR}/testing DEPENDS doxygen ) add_test(NAME suite - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/testing/runtests.py --all --doxygen $<TARGET_FILE:doxygen> --inputdir ${CMAKE_SOURCE_DIR}/testing --outputdir ${PROJECT_BINARY_DIR}/testing + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/testing/runtests.py $(TEST_FLAGS) --doxygen $<TARGET_FILE:doxygen> --inputdir ${CMAKE_SOURCE_DIR}/testing --outputdir ${PROJECT_BINARY_DIR}/testing ) diff --git a/testing/README.txt b/testing/README.txt index ee3de59..a5a0ad9 100644 --- a/testing/README.txt +++ b/testing/README.txt @@ -7,19 +7,29 @@ has the same 3 digit number. The directory contains one or more reference files that are compared against the XML output produced by doxygen. If the result is the same, there is no regression and the test passes. If there is a difference the test fails and the difference (in diff -u format) will be shown. +It is also possible to see whether or not the test can be build to a xhtml set +of files (and tested against a DTD), it is also possible to create a pdf file +for each test to see if the LaTeX / pdf generation is possible. The runtest.py script responsible for running the tests takes a number of optional parameters: --id n: run test with number n only (the option may be specified - multiple times) default is to run all tests. --updateref: update the reference files. Should be used in combination - with -id to update the reference file(s) for the given test. --all: can be used in combination with -updateref to update the - reference files for all tests. --doxygen exe: run the specified doxygen executable. --xmllint exe: run the specified xmllint executable. - -The runtest.pl has the following dependenies on 3rd party tools: + --updateref update the reference data for a test + --doxygen [DOXYGEN] path/name of the doxygen executable + --xmllint [XMLLINT] path/name of the xmllint executable + --id IDS [IDS ...] id of the test to perform + --all perform all tests + --inputdir [INPUTDIR] + input directory containing the tests + --outputdir [OUTPUTDIR] + output directory to write the doxygen output to + --noredir disable redirection of doxygen warnings + --xml create xml output and check + --xhtml create xhtml output and check with xmllint + --pdf create LaTeX output and create pdf from it + --keep keep result directories +In case neither --xml, --pdf or --xhtml is used the default is set to --xml. + +The runtest.pl has the following dependencies on 3rd party tools: - python to run the script - xmllint to normalize the XML output - diff to show the differences in case a test fails @@ -44,5 +54,7 @@ Example to update the reference files for a test python runtest.py -updateref -id 10 There is also a CMakeLists.txt, which can be used from the build directory -to run all tests by simply invoking 'make tests'. +to run all tests by simply invoking 'make tests', to use the specific options use +the flag TEST_FLAGS with make + e.g. make tests TEST_FLAGS="--id=5 --id=10 --pdf --xhtml" diff --git a/testing/dtd/xhtml-lat1.ent b/testing/dtd/xhtml-lat1.ent new file mode 100755 index 0000000..ffee223 --- /dev/null +++ b/testing/dtd/xhtml-lat1.ent @@ -0,0 +1,196 @@ +<!-- Portions (C) International Organization for Standardization 1986 + Permission to copy in any form is granted for use with + conforming SGML systems and applications as defined in + ISO 8879, provided this notice is included in all copies. +--> +<!-- Character entity set. Typical invocation: + <!ENTITY % HTMLlat1 PUBLIC + "-//W3C//ENTITIES Latin 1 for XHTML//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent"> + %HTMLlat1; +--> + +<!ENTITY nbsp " "> <!-- no-break space = non-breaking space, + U+00A0 ISOnum --> +<!ENTITY iexcl "¡"> <!-- inverted exclamation mark, U+00A1 ISOnum --> +<!ENTITY cent "¢"> <!-- cent sign, U+00A2 ISOnum --> +<!ENTITY pound "£"> <!-- pound sign, U+00A3 ISOnum --> +<!ENTITY curren "¤"> <!-- currency sign, U+00A4 ISOnum --> +<!ENTITY yen "¥"> <!-- yen sign = yuan sign, U+00A5 ISOnum --> +<!ENTITY brvbar "¦"> <!-- broken bar = broken vertical bar, + U+00A6 ISOnum --> +<!ENTITY sect "§"> <!-- section sign, U+00A7 ISOnum --> +<!ENTITY uml "¨"> <!-- diaeresis = spacing diaeresis, + U+00A8 ISOdia --> +<!ENTITY copy "©"> <!-- copyright sign, U+00A9 ISOnum --> +<!ENTITY ordf "ª"> <!-- feminine ordinal indicator, U+00AA ISOnum --> +<!ENTITY laquo "«"> <!-- left-pointing double angle quotation mark + = left pointing guillemet, U+00AB ISOnum --> +<!ENTITY not "¬"> <!-- not sign = angled dash, + U+00AC ISOnum --> +<!ENTITY shy "­"> <!-- soft hyphen = discretionary hyphen, + U+00AD ISOnum --> +<!ENTITY reg "®"> <!-- registered sign = registered trade mark sign, + U+00AE ISOnum --> +<!ENTITY macr "¯"> <!-- macron = spacing macron = overline + = APL overbar, U+00AF ISOdia --> +<!ENTITY deg "°"> <!-- degree sign, U+00B0 ISOnum --> +<!ENTITY plusmn "±"> <!-- plus-minus sign = plus-or-minus sign, + U+00B1 ISOnum --> +<!ENTITY sup2 "²"> <!-- superscript two = superscript digit two + = squared, U+00B2 ISOnum --> +<!ENTITY sup3 "³"> <!-- superscript three = superscript digit three + = cubed, U+00B3 ISOnum --> +<!ENTITY acute "´"> <!-- acute accent = spacing acute, + U+00B4 ISOdia --> +<!ENTITY micro "µ"> <!-- micro sign, U+00B5 ISOnum --> +<!ENTITY para "¶"> <!-- pilcrow sign = paragraph sign, + U+00B6 ISOnum --> +<!ENTITY middot "·"> <!-- middle dot = Georgian comma + = Greek middle dot, U+00B7 ISOnum --> +<!ENTITY cedil "¸"> <!-- cedilla = spacing cedilla, U+00B8 ISOdia --> +<!ENTITY sup1 "¹"> <!-- superscript one = superscript digit one, + U+00B9 ISOnum --> +<!ENTITY ordm "º"> <!-- masculine ordinal indicator, + U+00BA ISOnum --> +<!ENTITY raquo "»"> <!-- right-pointing double angle quotation mark + = right pointing guillemet, U+00BB ISOnum --> +<!ENTITY frac14 "¼"> <!-- vulgar fraction one quarter + = fraction one quarter, U+00BC ISOnum --> +<!ENTITY frac12 "½"> <!-- vulgar fraction one half + = fraction one half, U+00BD ISOnum --> +<!ENTITY frac34 "¾"> <!-- vulgar fraction three quarters + = fraction three quarters, U+00BE ISOnum --> +<!ENTITY iquest "¿"> <!-- inverted question mark + = turned question mark, U+00BF ISOnum --> +<!ENTITY Agrave "À"> <!-- latin capital letter A with grave + = latin capital letter A grave, + U+00C0 ISOlat1 --> +<!ENTITY Aacute "Á"> <!-- latin capital letter A with acute, + U+00C1 ISOlat1 --> +<!ENTITY Acirc "Â"> <!-- latin capital letter A with circumflex, + U+00C2 ISOlat1 --> +<!ENTITY Atilde "Ã"> <!-- latin capital letter A with tilde, + U+00C3 ISOlat1 --> +<!ENTITY Auml "Ä"> <!-- latin capital letter A with diaeresis, + U+00C4 ISOlat1 --> +<!ENTITY Aring "Å"> <!-- latin capital letter A with ring above + = latin capital letter A ring, + U+00C5 ISOlat1 --> +<!ENTITY AElig "Æ"> <!-- latin capital letter AE + = latin capital ligature AE, + U+00C6 ISOlat1 --> +<!ENTITY Ccedil "Ç"> <!-- latin capital letter C with cedilla, + U+00C7 ISOlat1 --> +<!ENTITY Egrave "È"> <!-- latin capital letter E with grave, + U+00C8 ISOlat1 --> +<!ENTITY Eacute "É"> <!-- latin capital letter E with acute, + U+00C9 ISOlat1 --> +<!ENTITY Ecirc "Ê"> <!-- latin capital letter E with circumflex, + U+00CA ISOlat1 --> +<!ENTITY Euml "Ë"> <!-- latin capital letter E with diaeresis, + U+00CB ISOlat1 --> +<!ENTITY Igrave "Ì"> <!-- latin capital letter I with grave, + U+00CC ISOlat1 --> +<!ENTITY Iacute "Í"> <!-- latin capital letter I with acute, + U+00CD ISOlat1 --> +<!ENTITY Icirc "Î"> <!-- latin capital letter I with circumflex, + U+00CE ISOlat1 --> +<!ENTITY Iuml "Ï"> <!-- latin capital letter I with diaeresis, + U+00CF ISOlat1 --> +<!ENTITY ETH "Ð"> <!-- latin capital letter ETH, U+00D0 ISOlat1 --> +<!ENTITY Ntilde "Ñ"> <!-- latin capital letter N with tilde, + U+00D1 ISOlat1 --> +<!ENTITY Ograve "Ò"> <!-- latin capital letter O with grave, + U+00D2 ISOlat1 --> +<!ENTITY Oacute "Ó"> <!-- latin capital letter O with acute, + U+00D3 ISOlat1 --> +<!ENTITY Ocirc "Ô"> <!-- latin capital letter O with circumflex, + U+00D4 ISOlat1 --> +<!ENTITY Otilde "Õ"> <!-- latin capital letter O with tilde, + U+00D5 ISOlat1 --> +<!ENTITY Ouml "Ö"> <!-- latin capital letter O with diaeresis, + U+00D6 ISOlat1 --> +<!ENTITY times "×"> <!-- multiplication sign, U+00D7 ISOnum --> +<!ENTITY Oslash "Ø"> <!-- latin capital letter O with stroke + = latin capital letter O slash, + U+00D8 ISOlat1 --> +<!ENTITY Ugrave "Ù"> <!-- latin capital letter U with grave, + U+00D9 ISOlat1 --> +<!ENTITY Uacute "Ú"> <!-- latin capital letter U with acute, + U+00DA ISOlat1 --> +<!ENTITY Ucirc "Û"> <!-- latin capital letter U with circumflex, + U+00DB ISOlat1 --> +<!ENTITY Uuml "Ü"> <!-- latin capital letter U with diaeresis, + U+00DC ISOlat1 --> +<!ENTITY Yacute "Ý"> <!-- latin capital letter Y with acute, + U+00DD ISOlat1 --> +<!ENTITY THORN "Þ"> <!-- latin capital letter THORN, + U+00DE ISOlat1 --> +<!ENTITY szlig "ß"> <!-- latin small letter sharp s = ess-zed, + U+00DF ISOlat1 --> +<!ENTITY agrave "à"> <!-- latin small letter a with grave + = latin small letter a grave, + U+00E0 ISOlat1 --> +<!ENTITY aacute "á"> <!-- latin small letter a with acute, + U+00E1 ISOlat1 --> +<!ENTITY acirc "â"> <!-- latin small letter a with circumflex, + U+00E2 ISOlat1 --> +<!ENTITY atilde "ã"> <!-- latin small letter a with tilde, + U+00E3 ISOlat1 --> +<!ENTITY auml "ä"> <!-- latin small letter a with diaeresis, + U+00E4 ISOlat1 --> +<!ENTITY aring "å"> <!-- latin small letter a with ring above + = latin small letter a ring, + U+00E5 ISOlat1 --> +<!ENTITY aelig "æ"> <!-- latin small letter ae + = latin small ligature ae, U+00E6 ISOlat1 --> +<!ENTITY ccedil "ç"> <!-- latin small letter c with cedilla, + U+00E7 ISOlat1 --> +<!ENTITY egrave "è"> <!-- latin small letter e with grave, + U+00E8 ISOlat1 --> +<!ENTITY eacute "é"> <!-- latin small letter e with acute, + U+00E9 ISOlat1 --> +<!ENTITY ecirc "ê"> <!-- latin small letter e with circumflex, + U+00EA ISOlat1 --> +<!ENTITY euml "ë"> <!-- latin small letter e with diaeresis, + U+00EB ISOlat1 --> +<!ENTITY igrave "ì"> <!-- latin small letter i with grave, + U+00EC ISOlat1 --> +<!ENTITY iacute "í"> <!-- latin small letter i with acute, + U+00ED ISOlat1 --> +<!ENTITY icirc "î"> <!-- latin small letter i with circumflex, + U+00EE ISOlat1 --> +<!ENTITY iuml "ï"> <!-- latin small letter i with diaeresis, + U+00EF ISOlat1 --> +<!ENTITY eth "ð"> <!-- latin small letter eth, U+00F0 ISOlat1 --> +<!ENTITY ntilde "ñ"> <!-- latin small letter n with tilde, + U+00F1 ISOlat1 --> +<!ENTITY ograve "ò"> <!-- latin small letter o with grave, + U+00F2 ISOlat1 --> +<!ENTITY oacute "ó"> <!-- latin small letter o with acute, + U+00F3 ISOlat1 --> +<!ENTITY ocirc "ô"> <!-- latin small letter o with circumflex, + U+00F4 ISOlat1 --> +<!ENTITY otilde "õ"> <!-- latin small letter o with tilde, + U+00F5 ISOlat1 --> +<!ENTITY ouml "ö"> <!-- latin small letter o with diaeresis, + U+00F6 ISOlat1 --> +<!ENTITY divide "÷"> <!-- division sign, U+00F7 ISOnum --> +<!ENTITY oslash "ø"> <!-- latin small letter o with stroke, + = latin small letter o slash, + U+00F8 ISOlat1 --> +<!ENTITY ugrave "ù"> <!-- latin small letter u with grave, + U+00F9 ISOlat1 --> +<!ENTITY uacute "ú"> <!-- latin small letter u with acute, + U+00FA ISOlat1 --> +<!ENTITY ucirc "û"> <!-- latin small letter u with circumflex, + U+00FB ISOlat1 --> +<!ENTITY uuml "ü"> <!-- latin small letter u with diaeresis, + U+00FC ISOlat1 --> +<!ENTITY yacute "ý"> <!-- latin small letter y with acute, + U+00FD ISOlat1 --> +<!ENTITY thorn "þ"> <!-- latin small letter thorn, + U+00FE ISOlat1 --> +<!ENTITY yuml "ÿ"> <!-- latin small letter y with diaeresis, + U+00FF ISOlat1 --> diff --git a/testing/dtd/xhtml-special.ent b/testing/dtd/xhtml-special.ent new file mode 100755 index 0000000..ca358b2 --- /dev/null +++ b/testing/dtd/xhtml-special.ent @@ -0,0 +1,80 @@ +<!-- Special characters for XHTML --> + +<!-- Character entity set. Typical invocation: + <!ENTITY % HTMLspecial PUBLIC + "-//W3C//ENTITIES Special for XHTML//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent"> + %HTMLspecial; +--> + +<!-- Portions (C) International Organization for Standardization 1986: + Permission to copy in any form is granted for use with + conforming SGML systems and applications as defined in + ISO 8879, provided this notice is included in all copies. +--> + +<!-- Relevant ISO entity set is given unless names are newly introduced. + New names (i.e., not in ISO 8879 list) do not clash with any + existing ISO 8879 entity names. ISO 10646 character numbers + are given for each character, in hex. values are decimal + conversions of the ISO 10646 values and refer to the document + character set. Names are Unicode names. +--> + +<!-- C0 Controls and Basic Latin --> +<!ENTITY quot """> <!-- quotation mark, U+0022 ISOnum --> +<!ENTITY amp "&#38;"> <!-- ampersand, U+0026 ISOnum --> +<!ENTITY lt "&#60;"> <!-- less-than sign, U+003C ISOnum --> +<!ENTITY gt ">"> <!-- greater-than sign, U+003E ISOnum --> +<!ENTITY apos "'"> <!-- apostrophe = APL quote, U+0027 ISOnum --> + +<!-- Latin Extended-A --> +<!ENTITY OElig "Œ"> <!-- latin capital ligature OE, + U+0152 ISOlat2 --> +<!ENTITY oelig "œ"> <!-- latin small ligature oe, U+0153 ISOlat2 --> +<!-- ligature is a misnomer, this is a separate character in some languages --> +<!ENTITY Scaron "Š"> <!-- latin capital letter S with caron, + U+0160 ISOlat2 --> +<!ENTITY scaron "š"> <!-- latin small letter s with caron, + U+0161 ISOlat2 --> +<!ENTITY Yuml "Ÿ"> <!-- latin capital letter Y with diaeresis, + U+0178 ISOlat2 --> + +<!-- Spacing Modifier Letters --> +<!ENTITY circ "ˆ"> <!-- modifier letter circumflex accent, + U+02C6 ISOpub --> +<!ENTITY tilde "˜"> <!-- small tilde, U+02DC ISOdia --> + +<!-- General Punctuation --> +<!ENTITY ensp " "> <!-- en space, U+2002 ISOpub --> +<!ENTITY emsp " "> <!-- em space, U+2003 ISOpub --> +<!ENTITY thinsp " "> <!-- thin space, U+2009 ISOpub --> +<!ENTITY zwnj "‌"> <!-- zero width non-joiner, + U+200C NEW RFC 2070 --> +<!ENTITY zwj "‍"> <!-- zero width joiner, U+200D NEW RFC 2070 --> +<!ENTITY lrm "‎"> <!-- left-to-right mark, U+200E NEW RFC 2070 --> +<!ENTITY rlm "‏"> <!-- right-to-left mark, U+200F NEW RFC 2070 --> +<!ENTITY ndash "–"> <!-- en dash, U+2013 ISOpub --> +<!ENTITY mdash "—"> <!-- em dash, U+2014 ISOpub --> +<!ENTITY lsquo "‘"> <!-- left single quotation mark, + U+2018 ISOnum --> +<!ENTITY rsquo "’"> <!-- right single quotation mark, + U+2019 ISOnum --> +<!ENTITY sbquo "‚"> <!-- single low-9 quotation mark, U+201A NEW --> +<!ENTITY ldquo "“"> <!-- left double quotation mark, + U+201C ISOnum --> +<!ENTITY rdquo "”"> <!-- right double quotation mark, + U+201D ISOnum --> +<!ENTITY bdquo "„"> <!-- double low-9 quotation mark, U+201E NEW --> +<!ENTITY dagger "†"> <!-- dagger, U+2020 ISOpub --> +<!ENTITY Dagger "‡"> <!-- double dagger, U+2021 ISOpub --> +<!ENTITY permil "‰"> <!-- per mille sign, U+2030 ISOtech --> +<!ENTITY lsaquo "‹"> <!-- single left-pointing angle quotation mark, + U+2039 ISO proposed --> +<!-- lsaquo is proposed but not yet ISO standardized --> +<!ENTITY rsaquo "›"> <!-- single right-pointing angle quotation mark, + U+203A ISO proposed --> +<!-- rsaquo is proposed but not yet ISO standardized --> + +<!-- Currency Symbols --> +<!ENTITY euro "€"> <!-- euro sign, U+20AC NEW --> diff --git a/testing/dtd/xhtml-symbol.ent b/testing/dtd/xhtml-symbol.ent new file mode 100755 index 0000000..63c2abf --- /dev/null +++ b/testing/dtd/xhtml-symbol.ent @@ -0,0 +1,237 @@ +<!-- Mathematical, Greek and Symbolic characters for XHTML --> + +<!-- Character entity set. Typical invocation: + <!ENTITY % HTMLsymbol PUBLIC + "-//W3C//ENTITIES Symbols for XHTML//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent"> + %HTMLsymbol; +--> + +<!-- Portions (C) International Organization for Standardization 1986: + Permission to copy in any form is granted for use with + conforming SGML systems and applications as defined in + ISO 8879, provided this notice is included in all copies. +--> + +<!-- Relevant ISO entity set is given unless names are newly introduced. + New names (i.e., not in ISO 8879 list) do not clash with any + existing ISO 8879 entity names. ISO 10646 character numbers + are given for each character, in hex. values are decimal + conversions of the ISO 10646 values and refer to the document + character set. Names are Unicode names. +--> + +<!-- Latin Extended-B --> +<!ENTITY fnof "ƒ"> <!-- latin small letter f with hook = function + = florin, U+0192 ISOtech --> + +<!-- Greek --> +<!ENTITY Alpha "Α"> <!-- greek capital letter alpha, U+0391 --> +<!ENTITY Beta "Β"> <!-- greek capital letter beta, U+0392 --> +<!ENTITY Gamma "Γ"> <!-- greek capital letter gamma, + U+0393 ISOgrk3 --> +<!ENTITY Delta "Δ"> <!-- greek capital letter delta, + U+0394 ISOgrk3 --> +<!ENTITY Epsilon "Ε"> <!-- greek capital letter epsilon, U+0395 --> +<!ENTITY Zeta "Ζ"> <!-- greek capital letter zeta, U+0396 --> +<!ENTITY Eta "Η"> <!-- greek capital letter eta, U+0397 --> +<!ENTITY Theta "Θ"> <!-- greek capital letter theta, + U+0398 ISOgrk3 --> +<!ENTITY Iota "Ι"> <!-- greek capital letter iota, U+0399 --> +<!ENTITY Kappa "Κ"> <!-- greek capital letter kappa, U+039A --> +<!ENTITY Lambda "Λ"> <!-- greek capital letter lamda, + U+039B ISOgrk3 --> +<!ENTITY Mu "Μ"> <!-- greek capital letter mu, U+039C --> +<!ENTITY Nu "Ν"> <!-- greek capital letter nu, U+039D --> +<!ENTITY Xi "Ξ"> <!-- greek capital letter xi, U+039E ISOgrk3 --> +<!ENTITY Omicron "Ο"> <!-- greek capital letter omicron, U+039F --> +<!ENTITY Pi "Π"> <!-- greek capital letter pi, U+03A0 ISOgrk3 --> +<!ENTITY Rho "Ρ"> <!-- greek capital letter rho, U+03A1 --> +<!-- there is no Sigmaf, and no U+03A2 character either --> +<!ENTITY Sigma "Σ"> <!-- greek capital letter sigma, + U+03A3 ISOgrk3 --> +<!ENTITY Tau "Τ"> <!-- greek capital letter tau, U+03A4 --> +<!ENTITY Upsilon "Υ"> <!-- greek capital letter upsilon, + U+03A5 ISOgrk3 --> +<!ENTITY Phi "Φ"> <!-- greek capital letter phi, + U+03A6 ISOgrk3 --> +<!ENTITY Chi "Χ"> <!-- greek capital letter chi, U+03A7 --> +<!ENTITY Psi "Ψ"> <!-- greek capital letter psi, + U+03A8 ISOgrk3 --> +<!ENTITY Omega "Ω"> <!-- greek capital letter omega, + U+03A9 ISOgrk3 --> + +<!ENTITY alpha "α"> <!-- greek small letter alpha, + U+03B1 ISOgrk3 --> +<!ENTITY beta "β"> <!-- greek small letter beta, U+03B2 ISOgrk3 --> +<!ENTITY gamma "γ"> <!-- greek small letter gamma, + U+03B3 ISOgrk3 --> +<!ENTITY delta "δ"> <!-- greek small letter delta, + U+03B4 ISOgrk3 --> +<!ENTITY epsilon "ε"> <!-- greek small letter epsilon, + U+03B5 ISOgrk3 --> +<!ENTITY zeta "ζ"> <!-- greek small letter zeta, U+03B6 ISOgrk3 --> +<!ENTITY eta "η"> <!-- greek small letter eta, U+03B7 ISOgrk3 --> +<!ENTITY theta "θ"> <!-- greek small letter theta, + U+03B8 ISOgrk3 --> +<!ENTITY iota "ι"> <!-- greek small letter iota, U+03B9 ISOgrk3 --> +<!ENTITY kappa "κ"> <!-- greek small letter kappa, + U+03BA ISOgrk3 --> +<!ENTITY lambda "λ"> <!-- greek small letter lamda, + U+03BB ISOgrk3 --> +<!ENTITY mu "μ"> <!-- greek small letter mu, U+03BC ISOgrk3 --> +<!ENTITY nu "ν"> <!-- greek small letter nu, U+03BD ISOgrk3 --> +<!ENTITY xi "ξ"> <!-- greek small letter xi, U+03BE ISOgrk3 --> +<!ENTITY omicron "ο"> <!-- greek small letter omicron, U+03BF NEW --> +<!ENTITY pi "π"> <!-- greek small letter pi, U+03C0 ISOgrk3 --> +<!ENTITY rho "ρ"> <!-- greek small letter rho, U+03C1 ISOgrk3 --> +<!ENTITY sigmaf "ς"> <!-- greek small letter final sigma, + U+03C2 ISOgrk3 --> +<!ENTITY sigma "σ"> <!-- greek small letter sigma, + U+03C3 ISOgrk3 --> +<!ENTITY tau "τ"> <!-- greek small letter tau, U+03C4 ISOgrk3 --> +<!ENTITY upsilon "υ"> <!-- greek small letter upsilon, + U+03C5 ISOgrk3 --> +<!ENTITY phi "φ"> <!-- greek small letter phi, U+03C6 ISOgrk3 --> +<!ENTITY chi "χ"> <!-- greek small letter chi, U+03C7 ISOgrk3 --> +<!ENTITY psi "ψ"> <!-- greek small letter psi, U+03C8 ISOgrk3 --> +<!ENTITY omega "ω"> <!-- greek small letter omega, + U+03C9 ISOgrk3 --> +<!ENTITY thetasym "ϑ"> <!-- greek theta symbol, + U+03D1 NEW --> +<!ENTITY upsih "ϒ"> <!-- greek upsilon with hook symbol, + U+03D2 NEW --> +<!ENTITY piv "ϖ"> <!-- greek pi symbol, U+03D6 ISOgrk3 --> + +<!-- General Punctuation --> +<!ENTITY bull "•"> <!-- bullet = black small circle, + U+2022 ISOpub --> +<!-- bullet is NOT the same as bullet operator, U+2219 --> +<!ENTITY hellip "…"> <!-- horizontal ellipsis = three dot leader, + U+2026 ISOpub --> +<!ENTITY prime "′"> <!-- prime = minutes = feet, U+2032 ISOtech --> +<!ENTITY Prime "″"> <!-- double prime = seconds = inches, + U+2033 ISOtech --> +<!ENTITY oline "‾"> <!-- overline = spacing overscore, + U+203E NEW --> +<!ENTITY frasl "⁄"> <!-- fraction slash, U+2044 NEW --> + +<!-- Letterlike Symbols --> +<!ENTITY weierp "℘"> <!-- script capital P = power set + = Weierstrass p, U+2118 ISOamso --> +<!ENTITY image "ℑ"> <!-- black-letter capital I = imaginary part, + U+2111 ISOamso --> +<!ENTITY real "ℜ"> <!-- black-letter capital R = real part symbol, + U+211C ISOamso --> +<!ENTITY trade "™"> <!-- trade mark sign, U+2122 ISOnum --> +<!ENTITY alefsym "ℵ"> <!-- alef symbol = first transfinite cardinal, + U+2135 NEW --> +<!-- alef symbol is NOT the same as hebrew letter alef, + U+05D0 although the same glyph could be used to depict both characters --> + +<!-- Arrows --> +<!ENTITY larr "←"> <!-- leftwards arrow, U+2190 ISOnum --> +<!ENTITY uarr "↑"> <!-- upwards arrow, U+2191 ISOnum--> +<!ENTITY rarr "→"> <!-- rightwards arrow, U+2192 ISOnum --> +<!ENTITY darr "↓"> <!-- downwards arrow, U+2193 ISOnum --> +<!ENTITY harr "↔"> <!-- left right arrow, U+2194 ISOamsa --> +<!ENTITY crarr "↵"> <!-- downwards arrow with corner leftwards + = carriage return, U+21B5 NEW --> +<!ENTITY lArr "⇐"> <!-- leftwards double arrow, U+21D0 ISOtech --> +<!-- Unicode does not say that lArr is the same as the 'is implied by' arrow + but also does not have any other character for that function. So lArr can + be used for 'is implied by' as ISOtech suggests --> +<!ENTITY uArr "⇑"> <!-- upwards double arrow, U+21D1 ISOamsa --> +<!ENTITY rArr "⇒"> <!-- rightwards double arrow, + U+21D2 ISOtech --> +<!-- Unicode does not say this is the 'implies' character but does not have + another character with this function so rArr can be used for 'implies' + as ISOtech suggests --> +<!ENTITY dArr "⇓"> <!-- downwards double arrow, U+21D3 ISOamsa --> +<!ENTITY hArr "⇔"> <!-- left right double arrow, + U+21D4 ISOamsa --> + +<!-- Mathematical Operators --> +<!ENTITY forall "∀"> <!-- for all, U+2200 ISOtech --> +<!ENTITY part "∂"> <!-- partial differential, U+2202 ISOtech --> +<!ENTITY exist "∃"> <!-- there exists, U+2203 ISOtech --> +<!ENTITY empty "∅"> <!-- empty set = null set, U+2205 ISOamso --> +<!ENTITY nabla "∇"> <!-- nabla = backward difference, + U+2207 ISOtech --> +<!ENTITY isin "∈"> <!-- element of, U+2208 ISOtech --> +<!ENTITY notin "∉"> <!-- not an element of, U+2209 ISOtech --> +<!ENTITY ni "∋"> <!-- contains as member, U+220B ISOtech --> +<!ENTITY prod "∏"> <!-- n-ary product = product sign, + U+220F ISOamsb --> +<!-- prod is NOT the same character as U+03A0 'greek capital letter pi' though + the same glyph might be used for both --> +<!ENTITY sum "∑"> <!-- n-ary summation, U+2211 ISOamsb --> +<!-- sum is NOT the same character as U+03A3 'greek capital letter sigma' + though the same glyph might be used for both --> +<!ENTITY minus "−"> <!-- minus sign, U+2212 ISOtech --> +<!ENTITY lowast "∗"> <!-- asterisk operator, U+2217 ISOtech --> +<!ENTITY radic "√"> <!-- square root = radical sign, + U+221A ISOtech --> +<!ENTITY prop "∝"> <!-- proportional to, U+221D ISOtech --> +<!ENTITY infin "∞"> <!-- infinity, U+221E ISOtech --> +<!ENTITY ang "∠"> <!-- angle, U+2220 ISOamso --> +<!ENTITY and "∧"> <!-- logical and = wedge, U+2227 ISOtech --> +<!ENTITY or "∨"> <!-- logical or = vee, U+2228 ISOtech --> +<!ENTITY cap "∩"> <!-- intersection = cap, U+2229 ISOtech --> +<!ENTITY cup "∪"> <!-- union = cup, U+222A ISOtech --> +<!ENTITY int "∫"> <!-- integral, U+222B ISOtech --> +<!ENTITY there4 "∴"> <!-- therefore, U+2234 ISOtech --> +<!ENTITY sim "∼"> <!-- tilde operator = varies with = similar to, + U+223C ISOtech --> +<!-- tilde operator is NOT the same character as the tilde, U+007E, + although the same glyph might be used to represent both --> +<!ENTITY cong "≅"> <!-- approximately equal to, U+2245 ISOtech --> +<!ENTITY asymp "≈"> <!-- almost equal to = asymptotic to, + U+2248 ISOamsr --> +<!ENTITY ne "≠"> <!-- not equal to, U+2260 ISOtech --> +<!ENTITY equiv "≡"> <!-- identical to, U+2261 ISOtech --> +<!ENTITY le "≤"> <!-- less-than or equal to, U+2264 ISOtech --> +<!ENTITY ge "≥"> <!-- greater-than or equal to, + U+2265 ISOtech --> +<!ENTITY sub "⊂"> <!-- subset of, U+2282 ISOtech --> +<!ENTITY sup "⊃"> <!-- superset of, U+2283 ISOtech --> +<!ENTITY nsub "⊄"> <!-- not a subset of, U+2284 ISOamsn --> +<!ENTITY sube "⊆"> <!-- subset of or equal to, U+2286 ISOtech --> +<!ENTITY supe "⊇"> <!-- superset of or equal to, + U+2287 ISOtech --> +<!ENTITY oplus "⊕"> <!-- circled plus = direct sum, + U+2295 ISOamsb --> +<!ENTITY otimes "⊗"> <!-- circled times = vector product, + U+2297 ISOamsb --> +<!ENTITY perp "⊥"> <!-- up tack = orthogonal to = perpendicular, + U+22A5 ISOtech --> +<!ENTITY sdot "⋅"> <!-- dot operator, U+22C5 ISOamsb --> +<!-- dot operator is NOT the same character as U+00B7 middle dot --> + +<!-- Miscellaneous Technical --> +<!ENTITY lceil "⌈"> <!-- left ceiling = APL upstile, + U+2308 ISOamsc --> +<!ENTITY rceil "⌉"> <!-- right ceiling, U+2309 ISOamsc --> +<!ENTITY lfloor "⌊"> <!-- left floor = APL downstile, + U+230A ISOamsc --> +<!ENTITY rfloor "⌋"> <!-- right floor, U+230B ISOamsc --> +<!ENTITY lang "〈"> <!-- left-pointing angle bracket = bra, + U+2329 ISOtech --> +<!-- lang is NOT the same character as U+003C 'less than sign' + or U+2039 'single left-pointing angle quotation mark' --> +<!ENTITY rang "〉"> <!-- right-pointing angle bracket = ket, + U+232A ISOtech --> +<!-- rang is NOT the same character as U+003E 'greater than sign' + or U+203A 'single right-pointing angle quotation mark' --> + +<!-- Geometric Shapes --> +<!ENTITY loz "◊"> <!-- lozenge, U+25CA ISOpub --> + +<!-- Miscellaneous Symbols --> +<!ENTITY spades "♠"> <!-- black spade suit, U+2660 ISOpub --> +<!-- black here seems to mean filled as opposed to hollow --> +<!ENTITY clubs "♣"> <!-- black club suit = shamrock, + U+2663 ISOpub --> +<!ENTITY hearts "♥"> <!-- black heart suit = valentine, + U+2665 ISOpub --> +<!ENTITY diams "♦"> <!-- black diamond suit, U+2666 ISOpub --> diff --git a/testing/dtd/xhtml1-strict.dtd b/testing/dtd/xhtml1-strict.dtd new file mode 100755 index 0000000..2927b9e --- /dev/null +++ b/testing/dtd/xhtml1-strict.dtd @@ -0,0 +1,978 @@ +<!-- + Extensible HTML version 1.0 Strict DTD + + This is the same as HTML 4 Strict except for + changes due to the differences between XML and SGML. + + Namespace = http://www.w3.org/1999/xhtml + + For further information, see: http://www.w3.org/TR/xhtml1 + + Copyright (c) 1998-2002 W3C (MIT, INRIA, Keio), + All Rights Reserved. + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" + + $Revision: 1.1 $ + $Date: 2002/08/01 13:56:03 $ + +--> + +<!--================ Character mnemonic entities =========================--> + +<!ENTITY % HTMLlat1 PUBLIC + "-//W3C//ENTITIES Latin 1 for XHTML//EN" + "xhtml-lat1.ent"> +%HTMLlat1; + +<!ENTITY % HTMLsymbol PUBLIC + "-//W3C//ENTITIES Symbols for XHTML//EN" + "xhtml-symbol.ent"> +%HTMLsymbol; + +<!ENTITY % HTMLspecial PUBLIC + "-//W3C//ENTITIES Special for XHTML//EN" + "xhtml-special.ent"> +%HTMLspecial; + +<!--================== Imported Names ====================================--> + +<!ENTITY % ContentType "CDATA"> + <!-- media type, as per [RFC2045] --> + +<!ENTITY % ContentTypes "CDATA"> + <!-- comma-separated list of media types, as per [RFC2045] --> + +<!ENTITY % Charset "CDATA"> + <!-- a character encoding, as per [RFC2045] --> + +<!ENTITY % Charsets "CDATA"> + <!-- a space separated list of character encodings, as per [RFC2045] --> + +<!ENTITY % LanguageCode "NMTOKEN"> + <!-- a language code, as per [RFC3066] --> + +<!ENTITY % Character "CDATA"> + <!-- a single character, as per section 2.2 of [XML] --> + +<!ENTITY % Number "CDATA"> + <!-- one or more digits --> + +<!ENTITY % LinkTypes "CDATA"> + <!-- space-separated list of link types --> + +<!ENTITY % MediaDesc "CDATA"> + <!-- single or comma-separated list of media descriptors --> + +<!ENTITY % URI "CDATA"> + <!-- a Uniform Resource Identifier, see [RFC2396] --> + +<!ENTITY % UriList "CDATA"> + <!-- a space separated list of Uniform Resource Identifiers --> + +<!ENTITY % Datetime "CDATA"> + <!-- date and time information. ISO date format --> + +<!ENTITY % Script "CDATA"> + <!-- script expression --> + +<!ENTITY % StyleSheet "CDATA"> + <!-- style sheet data --> + +<!ENTITY % Text "CDATA"> + <!-- used for titles etc. --> + +<!ENTITY % Length "CDATA"> + <!-- nn for pixels or nn% for percentage length --> + +<!ENTITY % MultiLength "CDATA"> + <!-- pixel, percentage, or relative --> + +<!ENTITY % Pixels "CDATA"> + <!-- integer representing length in pixels --> + +<!-- these are used for image maps --> + +<!ENTITY % Shape "(rect|circle|poly|default)"> + +<!ENTITY % Coords "CDATA"> + <!-- comma separated list of lengths --> + +<!--=================== Generic Attributes ===============================--> + +<!-- core attributes common to most elements + id document-wide unique id + class space separated list of classes + style associated style info + title advisory title/amplification +--> +<!ENTITY % coreattrs + "id ID #IMPLIED + class CDATA #IMPLIED + style %StyleSheet; #IMPLIED + title %Text; #IMPLIED" + > + +<!-- internationalization attributes + lang language code (backwards compatible) + xml:lang language code (as per XML 1.0 spec) + dir direction for weak/neutral text +--> +<!ENTITY % i18n + "lang %LanguageCode; #IMPLIED + xml:lang %LanguageCode; #IMPLIED + dir (ltr|rtl) #IMPLIED" + > + +<!-- attributes for common UI events + onclick a pointer button was clicked + ondblclick a pointer button was double clicked + onmousedown a pointer button was pressed down + onmouseup a pointer button was released + onmousemove a pointer was moved onto the element + onmouseout a pointer was moved away from the element + onkeypress a key was pressed and released + onkeydown a key was pressed down + onkeyup a key was released +--> +<!ENTITY % events + "onclick %Script; #IMPLIED + ondblclick %Script; #IMPLIED + onmousedown %Script; #IMPLIED + onmouseup %Script; #IMPLIED + onmouseover %Script; #IMPLIED + onmousemove %Script; #IMPLIED + onmouseout %Script; #IMPLIED + onkeypress %Script; #IMPLIED + onkeydown %Script; #IMPLIED + onkeyup %Script; #IMPLIED" + > + +<!-- attributes for elements that can get the focus + accesskey accessibility key character + tabindex position in tabbing order + onfocus the element got the focus + onblur the element lost the focus +--> +<!ENTITY % focus + "accesskey %Character; #IMPLIED + tabindex %Number; #IMPLIED + onfocus %Script; #IMPLIED + onblur %Script; #IMPLIED" + > + +<!ENTITY % attrs "%coreattrs; %i18n; %events;"> + +<!--=================== Text Elements ====================================--> + +<!ENTITY % special.pre + "br | span | bdo | map"> + + +<!ENTITY % special + "%special.pre; | object | img "> + +<!ENTITY % fontstyle "tt | i | b | big | small "> + +<!ENTITY % phrase "em | strong | dfn | code | q | + samp | kbd | var | cite | abbr | acronym | sub | sup "> + +<!ENTITY % inline.forms "input | select | textarea | label | button"> + +<!-- these can occur at block or inline level --> +<!ENTITY % misc.inline "ins | del | script"> + +<!-- these can only occur at block level --> +<!ENTITY % misc "noscript | %misc.inline;"> + +<!ENTITY % inline "a | %special; | %fontstyle; | %phrase; | %inline.forms;"> + +<!-- %Inline; covers inline or "text-level" elements --> +<!ENTITY % Inline "(#PCDATA | %inline; | %misc.inline;)*"> + +<!--================== Block level elements ==============================--> + +<!ENTITY % heading "h1|h2|h3|h4|h5|h6"> +<!ENTITY % lists "ul | ol | dl"> +<!ENTITY % blocktext "pre | hr | blockquote | address"> + +<!ENTITY % block + "p | %heading; | div | %lists; | %blocktext; | fieldset | table"> + +<!ENTITY % Block "(%block; | form | %misc;)*"> + +<!-- %Flow; mixes block and inline and is used for list items etc. --> +<!ENTITY % Flow "(#PCDATA | %block; | form | %inline; | %misc;)*"> + +<!--================== Content models for exclusions =====================--> + +<!-- a elements use %Inline; excluding a --> + +<!ENTITY % a.content + "(#PCDATA | %special; | %fontstyle; | %phrase; | %inline.forms; | %misc.inline;)*"> + +<!-- pre uses %Inline excluding big, small, sup or sup --> + +<!ENTITY % pre.content + "(#PCDATA | a | %fontstyle; | %phrase; | %special.pre; | %misc.inline; + | %inline.forms;)*"> + +<!-- form uses %Block; excluding form --> + +<!ENTITY % form.content "(%block; | %misc;)*"> + +<!-- button uses %Flow; but excludes a, form and form controls --> + +<!ENTITY % button.content + "(#PCDATA | p | %heading; | div | %lists; | %blocktext; | + table | %special; | %fontstyle; | %phrase; | %misc;)*"> + +<!--================ Document Structure ==================================--> + +<!-- the namespace URI designates the document profile --> + +<!ELEMENT html (head, body)> +<!ATTLIST html + %i18n; + id ID #IMPLIED + xmlns %URI; #FIXED 'http://www.w3.org/1999/xhtml' + > + +<!--================ Document Head =======================================--> + +<!ENTITY % head.misc "(script|style|meta|link|object)*"> + +<!-- content model is %head.misc; combined with a single + title and an optional base element in any order --> + +<!ELEMENT head (%head.misc;, + ((title, %head.misc;, (base, %head.misc;)?) | + (base, %head.misc;, (title, %head.misc;))))> + +<!ATTLIST head + %i18n; + id ID #IMPLIED + profile %URI; #IMPLIED + > + +<!-- The title element is not considered part of the flow of text. + It should be displayed, for example as the page header or + window title. Exactly one title is required per document. + --> +<!ELEMENT title (#PCDATA)> +<!ATTLIST title + %i18n; + id ID #IMPLIED + > + +<!-- document base URI --> + +<!ELEMENT base EMPTY> +<!ATTLIST base + href %URI; #REQUIRED + id ID #IMPLIED + > + +<!-- generic metainformation --> +<!ELEMENT meta EMPTY> +<!ATTLIST meta + %i18n; + id ID #IMPLIED + http-equiv CDATA #IMPLIED + name CDATA #IMPLIED + content CDATA #REQUIRED + scheme CDATA #IMPLIED + > + +<!-- + Relationship values can be used in principle: + + a) for document specific toolbars/menus when used + with the link element in document head e.g. + start, contents, previous, next, index, end, help + b) to link to a separate style sheet (rel="stylesheet") + c) to make a link to a script (rel="script") + d) by stylesheets to control how collections of + html nodes are rendered into printed documents + e) to make a link to a printable version of this document + e.g. a PostScript or PDF version (rel="alternate" media="print") +--> + +<!ELEMENT link EMPTY> +<!ATTLIST link + %attrs; + charset %Charset; #IMPLIED + href %URI; #IMPLIED + hreflang %LanguageCode; #IMPLIED + type %ContentType; #IMPLIED + rel %LinkTypes; #IMPLIED + rev %LinkTypes; #IMPLIED + media %MediaDesc; #IMPLIED + > + +<!-- style info, which may include CDATA sections --> +<!ELEMENT style (#PCDATA)> +<!ATTLIST style + %i18n; + id ID #IMPLIED + type %ContentType; #REQUIRED + media %MediaDesc; #IMPLIED + title %Text; #IMPLIED + xml:space (preserve) #FIXED 'preserve' + > + +<!-- script statements, which may include CDATA sections --> +<!ELEMENT script (#PCDATA)> +<!ATTLIST script + id ID #IMPLIED + charset %Charset; #IMPLIED + type %ContentType; #REQUIRED + src %URI; #IMPLIED + defer (defer) #IMPLIED + xml:space (preserve) #FIXED 'preserve' + > + +<!-- alternate content container for non script-based rendering --> + +<!ELEMENT noscript %Block;> +<!ATTLIST noscript + %attrs; + > + +<!--=================== Document Body ====================================--> + +<!ELEMENT body %Block;> +<!ATTLIST body + %attrs; + onload %Script; #IMPLIED + onunload %Script; #IMPLIED + > + +<!ELEMENT div %Flow;> <!-- generic language/style container --> +<!ATTLIST div + %attrs; + > + +<!--=================== Paragraphs =======================================--> + +<!ELEMENT p %Inline;> +<!ATTLIST p + %attrs; + > + +<!--=================== Headings =========================================--> + +<!-- + There are six levels of headings from h1 (the most important) + to h6 (the least important). +--> + +<!ELEMENT h1 %Inline;> +<!ATTLIST h1 + %attrs; + > + +<!ELEMENT h2 %Inline;> +<!ATTLIST h2 + %attrs; + > + +<!ELEMENT h3 %Inline;> +<!ATTLIST h3 + %attrs; + > + +<!ELEMENT h4 %Inline;> +<!ATTLIST h4 + %attrs; + > + +<!ELEMENT h5 %Inline;> +<!ATTLIST h5 + %attrs; + > + +<!ELEMENT h6 %Inline;> +<!ATTLIST h6 + %attrs; + > + +<!--=================== Lists ============================================--> + +<!-- Unordered list --> + +<!ELEMENT ul (li)+> +<!ATTLIST ul + %attrs; + > + +<!-- Ordered (numbered) list --> + +<!ELEMENT ol (li)+> +<!ATTLIST ol + %attrs; + > + +<!-- list item --> + +<!ELEMENT li %Flow;> +<!ATTLIST li + %attrs; + > + +<!-- definition lists - dt for term, dd for its definition --> + +<!ELEMENT dl (dt|dd)+> +<!ATTLIST dl + %attrs; + > + +<!ELEMENT dt %Inline;> +<!ATTLIST dt + %attrs; + > + +<!ELEMENT dd %Flow;> +<!ATTLIST dd + %attrs; + > + +<!--=================== Address ==========================================--> + +<!-- information on author --> + +<!ELEMENT address %Inline;> +<!ATTLIST address + %attrs; + > + +<!--=================== Horizontal Rule ==================================--> + +<!ELEMENT hr EMPTY> +<!ATTLIST hr + %attrs; + > + +<!--=================== Preformatted Text ================================--> + +<!-- content is %Inline; excluding "img|object|big|small|sub|sup" --> + +<!ELEMENT pre %pre.content;> +<!ATTLIST pre + %attrs; + xml:space (preserve) #FIXED 'preserve' + > + +<!--=================== Block-like Quotes ================================--> + +<!ELEMENT blockquote %Block;> +<!ATTLIST blockquote + %attrs; + cite %URI; #IMPLIED + > + +<!--=================== Inserted/Deleted Text ============================--> + +<!-- + ins/del are allowed in block and inline content, but its + inappropriate to include block content within an ins element + occurring in inline content. +--> +<!ELEMENT ins %Flow;> +<!ATTLIST ins + %attrs; + cite %URI; #IMPLIED + datetime %Datetime; #IMPLIED + > + +<!ELEMENT del %Flow;> +<!ATTLIST del + %attrs; + cite %URI; #IMPLIED + datetime %Datetime; #IMPLIED + > + +<!--================== The Anchor Element ================================--> + +<!-- content is %Inline; except that anchors shouldn't be nested --> + +<!ELEMENT a %a.content;> +<!ATTLIST a + %attrs; + %focus; + charset %Charset; #IMPLIED + type %ContentType; #IMPLIED + name NMTOKEN #IMPLIED + href %URI; #IMPLIED + hreflang %LanguageCode; #IMPLIED + rel %LinkTypes; #IMPLIED + rev %LinkTypes; #IMPLIED + shape %Shape; "rect" + coords %Coords; #IMPLIED + > + +<!--===================== Inline Elements ================================--> + +<!ELEMENT span %Inline;> <!-- generic language/style container --> +<!ATTLIST span + %attrs; + > + +<!ELEMENT bdo %Inline;> <!-- I18N BiDi over-ride --> +<!ATTLIST bdo + %coreattrs; + %events; + lang %LanguageCode; #IMPLIED + xml:lang %LanguageCode; #IMPLIED + dir (ltr|rtl) #REQUIRED + > + +<!ELEMENT br EMPTY> <!-- forced line break --> +<!ATTLIST br + %coreattrs; + > + +<!ELEMENT em %Inline;> <!-- emphasis --> +<!ATTLIST em %attrs;> + +<!ELEMENT strong %Inline;> <!-- strong emphasis --> +<!ATTLIST strong %attrs;> + +<!ELEMENT dfn %Inline;> <!-- definitional --> +<!ATTLIST dfn %attrs;> + +<!ELEMENT code %Inline;> <!-- program code --> +<!ATTLIST code %attrs;> + +<!ELEMENT samp %Inline;> <!-- sample --> +<!ATTLIST samp %attrs;> + +<!ELEMENT kbd %Inline;> <!-- something user would type --> +<!ATTLIST kbd %attrs;> + +<!ELEMENT var %Inline;> <!-- variable --> +<!ATTLIST var %attrs;> + +<!ELEMENT cite %Inline;> <!-- citation --> +<!ATTLIST cite %attrs;> + +<!ELEMENT abbr %Inline;> <!-- abbreviation --> +<!ATTLIST abbr %attrs;> + +<!ELEMENT acronym %Inline;> <!-- acronym --> +<!ATTLIST acronym %attrs;> + +<!ELEMENT q %Inline;> <!-- inlined quote --> +<!ATTLIST q + %attrs; + cite %URI; #IMPLIED + > + +<!ELEMENT sub %Inline;> <!-- subscript --> +<!ATTLIST sub %attrs;> + +<!ELEMENT sup %Inline;> <!-- superscript --> +<!ATTLIST sup %attrs;> + +<!ELEMENT tt %Inline;> <!-- fixed pitch font --> +<!ATTLIST tt %attrs;> + +<!ELEMENT i %Inline;> <!-- italic font --> +<!ATTLIST i %attrs;> + +<!ELEMENT b %Inline;> <!-- bold font --> +<!ATTLIST b %attrs;> + +<!ELEMENT big %Inline;> <!-- bigger font --> +<!ATTLIST big %attrs;> + +<!ELEMENT small %Inline;> <!-- smaller font --> +<!ATTLIST small %attrs;> + +<!--==================== Object ======================================--> +<!-- + object is used to embed objects as part of HTML pages. + param elements should precede other content. Parameters + can also be expressed as attribute/value pairs on the + object element itself when brevity is desired. +--> + +<!ELEMENT object (#PCDATA | param | %block; | form | %inline; | %misc;)*> +<!ATTLIST object + %attrs; + declare (declare) #IMPLIED + classid %URI; #IMPLIED + codebase %URI; #IMPLIED + data %URI; #IMPLIED + type %ContentType; #IMPLIED + codetype %ContentType; #IMPLIED + archive %UriList; #IMPLIED + standby %Text; #IMPLIED + height %Length; #IMPLIED + width %Length; #IMPLIED + usemap %URI; #IMPLIED + name NMTOKEN #IMPLIED + tabindex %Number; #IMPLIED + > + +<!-- + param is used to supply a named property value. + In XML it would seem natural to follow RDF and support an + abbreviated syntax where the param elements are replaced + by attribute value pairs on the object start tag. +--> +<!ELEMENT param EMPTY> +<!ATTLIST param + id ID #IMPLIED + name CDATA #IMPLIED + value CDATA #IMPLIED + valuetype (data|ref|object) "data" + type %ContentType; #IMPLIED + > + +<!--=================== Images ===========================================--> + +<!-- + To avoid accessibility problems for people who aren't + able to see the image, you should provide a text + description using the alt and longdesc attributes. + In addition, avoid the use of server-side image maps. + Note that in this DTD there is no name attribute. That + is only available in the transitional and frameset DTD. +--> + +<!ELEMENT img EMPTY> +<!ATTLIST img + %attrs; + src %URI; #REQUIRED + alt %Text; #REQUIRED + longdesc %URI; #IMPLIED + height %Length; #IMPLIED + width %Length; #IMPLIED + usemap %URI; #IMPLIED + ismap (ismap) #IMPLIED + > + +<!-- usemap points to a map element which may be in this document + or an external document, although the latter is not widely supported --> + +<!--================== Client-side image maps ============================--> + +<!-- These can be placed in the same document or grouped in a + separate document although this isn't yet widely supported --> + +<!ELEMENT map ((%block; | form | %misc;)+ | area+)> +<!ATTLIST map + %i18n; + %events; + id ID #REQUIRED + class CDATA #IMPLIED + style %StyleSheet; #IMPLIED + title %Text; #IMPLIED + name NMTOKEN #IMPLIED + > + +<!ELEMENT area EMPTY> +<!ATTLIST area + %attrs; + %focus; + shape %Shape; "rect" + coords %Coords; #IMPLIED + href %URI; #IMPLIED + nohref (nohref) #IMPLIED + alt %Text; #REQUIRED + > + +<!--================ Forms ===============================================--> +<!ELEMENT form %form.content;> <!-- forms shouldn't be nested --> + +<!ATTLIST form + %attrs; + action %URI; #REQUIRED + method (get|post) "get" + enctype %ContentType; "application/x-www-form-urlencoded" + onsubmit %Script; #IMPLIED + onreset %Script; #IMPLIED + accept %ContentTypes; #IMPLIED + accept-charset %Charsets; #IMPLIED + > + +<!-- + Each label must not contain more than ONE field + Label elements shouldn't be nested. +--> +<!ELEMENT label %Inline;> +<!ATTLIST label + %attrs; + for IDREF #IMPLIED + accesskey %Character; #IMPLIED + onfocus %Script; #IMPLIED + onblur %Script; #IMPLIED + > + +<!ENTITY % InputType + "(text | password | checkbox | + radio | submit | reset | + file | hidden | image | button)" + > + +<!-- the name attribute is required for all but submit & reset --> + +<!ELEMENT input EMPTY> <!-- form control --> +<!ATTLIST input + %attrs; + %focus; + type %InputType; "text" + name CDATA #IMPLIED + value CDATA #IMPLIED + checked (checked) #IMPLIED + disabled (disabled) #IMPLIED + readonly (readonly) #IMPLIED + size CDATA #IMPLIED + maxlength %Number; #IMPLIED + src %URI; #IMPLIED + alt CDATA #IMPLIED + usemap %URI; #IMPLIED + onselect %Script; #IMPLIED + onchange %Script; #IMPLIED + accept %ContentTypes; #IMPLIED + > + +<!ELEMENT select (optgroup|option)+> <!-- option selector --> +<!ATTLIST select + %attrs; + name CDATA #IMPLIED + size %Number; #IMPLIED + multiple (multiple) #IMPLIED + disabled (disabled) #IMPLIED + tabindex %Number; #IMPLIED + onfocus %Script; #IMPLIED + onblur %Script; #IMPLIED + onchange %Script; #IMPLIED + > + +<!ELEMENT optgroup (option)+> <!-- option group --> +<!ATTLIST optgroup + %attrs; + disabled (disabled) #IMPLIED + label %Text; #REQUIRED + > + +<!ELEMENT option (#PCDATA)> <!-- selectable choice --> +<!ATTLIST option + %attrs; + selected (selected) #IMPLIED + disabled (disabled) #IMPLIED + label %Text; #IMPLIED + value CDATA #IMPLIED + > + +<!ELEMENT textarea (#PCDATA)> <!-- multi-line text field --> +<!ATTLIST textarea + %attrs; + %focus; + name CDATA #IMPLIED + rows %Number; #REQUIRED + cols %Number; #REQUIRED + disabled (disabled) #IMPLIED + readonly (readonly) #IMPLIED + onselect %Script; #IMPLIED + onchange %Script; #IMPLIED + > + +<!-- + The fieldset element is used to group form fields. + Only one legend element should occur in the content + and if present should only be preceded by whitespace. +--> +<!ELEMENT fieldset (#PCDATA | legend | %block; | form | %inline; | %misc;)*> +<!ATTLIST fieldset + %attrs; + > + +<!ELEMENT legend %Inline;> <!-- fieldset label --> +<!ATTLIST legend + %attrs; + accesskey %Character; #IMPLIED + > + +<!-- + Content is %Flow; excluding a, form and form controls +--> +<!ELEMENT button %button.content;> <!-- push button --> +<!ATTLIST button + %attrs; + %focus; + name CDATA #IMPLIED + value CDATA #IMPLIED + type (button|submit|reset) "submit" + disabled (disabled) #IMPLIED + > + +<!--======================= Tables =======================================--> + +<!-- Derived from IETF HTML table standard, see [RFC1942] --> + +<!-- + The border attribute sets the thickness of the frame around the + table. The default units are screen pixels. + + The frame attribute specifies which parts of the frame around + the table should be rendered. The values are not the same as + CALS to avoid a name clash with the valign attribute. +--> +<!ENTITY % TFrame "(void|above|below|hsides|lhs|rhs|vsides|box|border)"> + +<!-- + The rules attribute defines which rules to draw between cells: + + If rules is absent then assume: + "none" if border is absent or border="0" otherwise "all" +--> + +<!ENTITY % TRules "(none | groups | rows | cols | all)"> + +<!-- horizontal alignment attributes for cell contents + + char alignment char, e.g. char=':' + charoff offset for alignment char +--> +<!ENTITY % cellhalign + "align (left|center|right|justify|char) #IMPLIED + char %Character; #IMPLIED + charoff %Length; #IMPLIED" + > + +<!-- vertical alignment attributes for cell contents --> +<!ENTITY % cellvalign + "valign (top|middle|bottom|baseline) #IMPLIED" + > + +<!ELEMENT table + (caption?, (col*|colgroup*), thead?, tfoot?, (tbody+|tr+))> +<!ELEMENT caption %Inline;> +<!ELEMENT thead (tr)+> +<!ELEMENT tfoot (tr)+> +<!ELEMENT tbody (tr)+> +<!ELEMENT colgroup (col)*> +<!ELEMENT col EMPTY> +<!ELEMENT tr (th|td)+> +<!ELEMENT th %Flow;> +<!ELEMENT td %Flow;> + +<!ATTLIST table + %attrs; + summary %Text; #IMPLIED + width %Length; #IMPLIED + border %Pixels; #IMPLIED + frame %TFrame; #IMPLIED + rules %TRules; #IMPLIED + cellspacing %Length; #IMPLIED + cellpadding %Length; #IMPLIED + > + +<!ATTLIST caption + %attrs; + > + +<!-- +colgroup groups a set of col elements. It allows you to group +several semantically related columns together. +--> +<!ATTLIST colgroup + %attrs; + span %Number; "1" + width %MultiLength; #IMPLIED + %cellhalign; + %cellvalign; + > + +<!-- + col elements define the alignment properties for cells in + one or more columns. + + The width attribute specifies the width of the columns, e.g. + + width=64 width in screen pixels + width=0.5* relative width of 0.5 + + The span attribute causes the attributes of one + col element to apply to more than one column. +--> +<!ATTLIST col + %attrs; + span %Number; "1" + width %MultiLength; #IMPLIED + %cellhalign; + %cellvalign; + > + +<!-- + Use thead to duplicate headers when breaking table + across page boundaries, or for static headers when + tbody sections are rendered in scrolling panel. + + Use tfoot to duplicate footers when breaking table + across page boundaries, or for static footers when + tbody sections are rendered in scrolling panel. + + Use multiple tbody sections when rules are needed + between groups of table rows. +--> +<!ATTLIST thead + %attrs; + %cellhalign; + %cellvalign; + > + +<!ATTLIST tfoot + %attrs; + %cellhalign; + %cellvalign; + > + +<!ATTLIST tbody + %attrs; + %cellhalign; + %cellvalign; + > + +<!ATTLIST tr + %attrs; + %cellhalign; + %cellvalign; + > + + +<!-- Scope is simpler than headers attribute for common tables --> +<!ENTITY % Scope "(row|col|rowgroup|colgroup)"> + +<!-- th is for headers, td for data and for cells acting as both --> + +<!ATTLIST th + %attrs; + abbr %Text; #IMPLIED + axis CDATA #IMPLIED + headers IDREFS #IMPLIED + scope %Scope; #IMPLIED + rowspan %Number; "1" + colspan %Number; "1" + %cellhalign; + %cellvalign; + > + +<!ATTLIST td + %attrs; + abbr %Text; #IMPLIED + axis CDATA #IMPLIED + headers IDREFS #IMPLIED + scope %Scope; #IMPLIED + rowspan %Number; "1" + colspan %Number; "1" + %cellhalign; + %cellvalign; + > + diff --git a/testing/dtd/xhtml1-transitional.dtd b/testing/dtd/xhtml1-transitional.dtd new file mode 100755 index 0000000..628f27a --- /dev/null +++ b/testing/dtd/xhtml1-transitional.dtd @@ -0,0 +1,1201 @@ +<!-- + Extensible HTML version 1.0 Transitional DTD + + This is the same as HTML 4 Transitional except for + changes due to the differences between XML and SGML. + + Namespace = http://www.w3.org/1999/xhtml + + For further information, see: http://www.w3.org/TR/xhtml1 + + Copyright (c) 1998-2002 W3C (MIT, INRIA, Keio), + All Rights Reserved. + + This DTD module is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" + + $Revision: 1.2 $ + $Date: 2002/08/01 18:37:55 $ + +--> + +<!--================ Character mnemonic entities =========================--> + +<!ENTITY % HTMLlat1 PUBLIC + "-//W3C//ENTITIES Latin 1 for XHTML//EN" + "xhtml-lat1.ent"> +%HTMLlat1; + +<!ENTITY % HTMLsymbol PUBLIC + "-//W3C//ENTITIES Symbols for XHTML//EN" + "xhtml-symbol.ent"> +%HTMLsymbol; + +<!ENTITY % HTMLspecial PUBLIC + "-//W3C//ENTITIES Special for XHTML//EN" + "xhtml-special.ent"> +%HTMLspecial; + +<!--================== Imported Names ====================================--> + +<!ENTITY % ContentType "CDATA"> + <!-- media type, as per [RFC2045] --> + +<!ENTITY % ContentTypes "CDATA"> + <!-- comma-separated list of media types, as per [RFC2045] --> + +<!ENTITY % Charset "CDATA"> + <!-- a character encoding, as per [RFC2045] --> + +<!ENTITY % Charsets "CDATA"> + <!-- a space separated list of character encodings, as per [RFC2045] --> + +<!ENTITY % LanguageCode "NMTOKEN"> + <!-- a language code, as per [RFC3066] --> + +<!ENTITY % Character "CDATA"> + <!-- a single character, as per section 2.2 of [XML] --> + +<!ENTITY % Number "CDATA"> + <!-- one or more digits --> + +<!ENTITY % LinkTypes "CDATA"> + <!-- space-separated list of link types --> + +<!ENTITY % MediaDesc "CDATA"> + <!-- single or comma-separated list of media descriptors --> + +<!ENTITY % URI "CDATA"> + <!-- a Uniform Resource Identifier, see [RFC2396] --> + +<!ENTITY % UriList "CDATA"> + <!-- a space separated list of Uniform Resource Identifiers --> + +<!ENTITY % Datetime "CDATA"> + <!-- date and time information. ISO date format --> + +<!ENTITY % Script "CDATA"> + <!-- script expression --> + +<!ENTITY % StyleSheet "CDATA"> + <!-- style sheet data --> + +<!ENTITY % Text "CDATA"> + <!-- used for titles etc. --> + +<!ENTITY % FrameTarget "NMTOKEN"> + <!-- render in this frame --> + +<!ENTITY % Length "CDATA"> + <!-- nn for pixels or nn% for percentage length --> + +<!ENTITY % MultiLength "CDATA"> + <!-- pixel, percentage, or relative --> + +<!ENTITY % Pixels "CDATA"> + <!-- integer representing length in pixels --> + +<!-- these are used for image maps --> + +<!ENTITY % Shape "(rect|circle|poly|default)"> + +<!ENTITY % Coords "CDATA"> + <!-- comma separated list of lengths --> + +<!-- used for object, applet, img, input and iframe --> +<!ENTITY % ImgAlign "(top|middle|bottom|left|right)"> + +<!-- a color using sRGB: #RRGGBB as Hex values --> +<!ENTITY % Color "CDATA"> + +<!-- There are also 16 widely known color names with their sRGB values: + + Black = #000000 Green = #008000 + Silver = #C0C0C0 Lime = #00FF00 + Gray = #808080 Olive = #808000 + White = #FFFFFF Yellow = #FFFF00 + Maroon = #800000 Navy = #000080 + Red = #FF0000 Blue = #0000FF + Purple = #800080 Teal = #008080 + Fuchsia= #FF00FF Aqua = #00FFFF +--> + +<!--=================== Generic Attributes ===============================--> + +<!-- core attributes common to most elements + id document-wide unique id + class space separated list of classes + style associated style info + title advisory title/amplification +--> +<!ENTITY % coreattrs + "id ID #IMPLIED + class CDATA #IMPLIED + style %StyleSheet; #IMPLIED + title %Text; #IMPLIED" + > + +<!-- internationalization attributes + lang language code (backwards compatible) + xml:lang language code (as per XML 1.0 spec) + dir direction for weak/neutral text +--> +<!ENTITY % i18n + "lang %LanguageCode; #IMPLIED + xml:lang %LanguageCode; #IMPLIED + dir (ltr|rtl) #IMPLIED" + > + +<!-- attributes for common UI events + onclick a pointer button was clicked + ondblclick a pointer button was double clicked + onmousedown a pointer button was pressed down + onmouseup a pointer button was released + onmousemove a pointer was moved onto the element + onmouseout a pointer was moved away from the element + onkeypress a key was pressed and released + onkeydown a key was pressed down + onkeyup a key was released +--> +<!ENTITY % events + "onclick %Script; #IMPLIED + ondblclick %Script; #IMPLIED + onmousedown %Script; #IMPLIED + onmouseup %Script; #IMPLIED + onmouseover %Script; #IMPLIED + onmousemove %Script; #IMPLIED + onmouseout %Script; #IMPLIED + onkeypress %Script; #IMPLIED + onkeydown %Script; #IMPLIED + onkeyup %Script; #IMPLIED" + > + +<!-- attributes for elements that can get the focus + accesskey accessibility key character + tabindex position in tabbing order + onfocus the element got the focus + onblur the element lost the focus +--> +<!ENTITY % focus + "accesskey %Character; #IMPLIED + tabindex %Number; #IMPLIED + onfocus %Script; #IMPLIED + onblur %Script; #IMPLIED" + > + +<!ENTITY % attrs "%coreattrs; %i18n; %events;"> + +<!-- text alignment for p, div, h1-h6. The default is + align="left" for ltr headings, "right" for rtl --> + +<!ENTITY % TextAlign "align (left|center|right|justify) #IMPLIED"> + +<!--=================== Text Elements ====================================--> + +<!ENTITY % special.extra + "object | applet | img | map | iframe"> + +<!ENTITY % special.basic + "br | span | bdo"> + +<!ENTITY % special + "%special.basic; | %special.extra;"> + +<!ENTITY % fontstyle.extra "big | small | font | basefont"> + +<!ENTITY % fontstyle.basic "tt | i | b | u + | s | strike "> + +<!ENTITY % fontstyle "%fontstyle.basic; | %fontstyle.extra;"> + +<!ENTITY % phrase.extra "sub | sup"> +<!ENTITY % phrase.basic "em | strong | dfn | code | q | + samp | kbd | var | cite | abbr | acronym"> + +<!ENTITY % phrase "%phrase.basic; | %phrase.extra;"> + +<!ENTITY % inline.forms "input | select | textarea | label | button"> + +<!-- these can occur at block or inline level --> +<!ENTITY % misc.inline "ins | del | script"> + +<!-- these can only occur at block level --> +<!ENTITY % misc "noscript | %misc.inline;"> + +<!ENTITY % inline "a | %special; | %fontstyle; | %phrase; | %inline.forms;"> + +<!-- %Inline; covers inline or "text-level" elements --> +<!ENTITY % Inline "(#PCDATA | %inline; | %misc.inline;)*"> + +<!--================== Block level elements ==============================--> + +<!ENTITY % heading "h1|h2|h3|h4|h5|h6"> +<!ENTITY % lists "ul | ol | dl | menu | dir"> +<!ENTITY % blocktext "pre | hr | blockquote | address | center | noframes"> + +<!ENTITY % block + "p | %heading; | div | %lists; | %blocktext; | isindex |fieldset | table"> + +<!-- %Flow; mixes block and inline and is used for list items etc. --> +<!ENTITY % Flow "(#PCDATA | %block; | form | %inline; | %misc;)*"> + +<!--================== Content models for exclusions =====================--> + +<!-- a elements use %Inline; excluding a --> + +<!ENTITY % a.content + "(#PCDATA | %special; | %fontstyle; | %phrase; | %inline.forms; | %misc.inline;)*"> + +<!-- pre uses %Inline excluding img, object, applet, big, small, + font, or basefont --> + +<!ENTITY % pre.content + "(#PCDATA | a | %special.basic; | %fontstyle.basic; | %phrase.basic; | + %inline.forms; | %misc.inline;)*"> + +<!-- form uses %Flow; excluding form --> + +<!ENTITY % form.content "(#PCDATA | %block; | %inline; | %misc;)*"> + +<!-- button uses %Flow; but excludes a, form, form controls, iframe --> + +<!ENTITY % button.content + "(#PCDATA | p | %heading; | div | %lists; | %blocktext; | + table | br | span | bdo | object | applet | img | map | + %fontstyle; | %phrase; | %misc;)*"> + +<!--================ Document Structure ==================================--> + +<!-- the namespace URI designates the document profile --> + +<!ELEMENT html (head, body)> +<!ATTLIST html + %i18n; + id ID #IMPLIED + xmlns %URI; #FIXED 'http://www.w3.org/1999/xhtml' + > + +<!--================ Document Head =======================================--> + +<!ENTITY % head.misc "(script|style|meta|link|object|isindex)*"> + +<!-- content model is %head.misc; combined with a single + title and an optional base element in any order --> + +<!ELEMENT head (%head.misc;, + ((title, %head.misc;, (base, %head.misc;)?) | + (base, %head.misc;, (title, %head.misc;))))> + +<!ATTLIST head + %i18n; + id ID #IMPLIED + profile %URI; #IMPLIED + > + +<!-- The title element is not considered part of the flow of text. + It should be displayed, for example as the page header or + window title. Exactly one title is required per document. + --> +<!ELEMENT title (#PCDATA)> +<!ATTLIST title + %i18n; + id ID #IMPLIED + > + +<!-- document base URI --> + +<!ELEMENT base EMPTY> +<!ATTLIST base + id ID #IMPLIED + href %URI; #IMPLIED + target %FrameTarget; #IMPLIED + > + +<!-- generic metainformation --> +<!ELEMENT meta EMPTY> +<!ATTLIST meta + %i18n; + id ID #IMPLIED + http-equiv CDATA #IMPLIED + name CDATA #IMPLIED + content CDATA #REQUIRED + scheme CDATA #IMPLIED + > + +<!-- + Relationship values can be used in principle: + + a) for document specific toolbars/menus when used + with the link element in document head e.g. + start, contents, previous, next, index, end, help + b) to link to a separate style sheet (rel="stylesheet") + c) to make a link to a script (rel="script") + d) by stylesheets to control how collections of + html nodes are rendered into printed documents + e) to make a link to a printable version of this document + e.g. a PostScript or PDF version (rel="alternate" media="print") +--> + +<!ELEMENT link EMPTY> +<!ATTLIST link + %attrs; + charset %Charset; #IMPLIED + href %URI; #IMPLIED + hreflang %LanguageCode; #IMPLIED + type %ContentType; #IMPLIED + rel %LinkTypes; #IMPLIED + rev %LinkTypes; #IMPLIED + media %MediaDesc; #IMPLIED + target %FrameTarget; #IMPLIED + > + +<!-- style info, which may include CDATA sections --> +<!ELEMENT style (#PCDATA)> +<!ATTLIST style + %i18n; + id ID #IMPLIED + type %ContentType; #REQUIRED + media %MediaDesc; #IMPLIED + title %Text; #IMPLIED + xml:space (preserve) #FIXED 'preserve' + > + +<!-- script statements, which may include CDATA sections --> +<!ELEMENT script (#PCDATA)> +<!ATTLIST script + id ID #IMPLIED + charset %Charset; #IMPLIED + type %ContentType; #REQUIRED + language CDATA #IMPLIED + src %URI; #IMPLIED + defer (defer) #IMPLIED + xml:space (preserve) #FIXED 'preserve' + > + +<!-- alternate content container for non script-based rendering --> + +<!ELEMENT noscript %Flow;> +<!ATTLIST noscript + %attrs; + > + +<!--======================= Frames =======================================--> + +<!-- inline subwindow --> + +<!ELEMENT iframe %Flow;> +<!ATTLIST iframe + %coreattrs; + longdesc %URI; #IMPLIED + name NMTOKEN #IMPLIED + src %URI; #IMPLIED + frameborder (1|0) "1" + marginwidth %Pixels; #IMPLIED + marginheight %Pixels; #IMPLIED + scrolling (yes|no|auto) "auto" + align %ImgAlign; #IMPLIED + height %Length; #IMPLIED + width %Length; #IMPLIED + > + +<!-- alternate content container for non frame-based rendering --> + +<!ELEMENT noframes %Flow;> +<!ATTLIST noframes + %attrs; + > + +<!--=================== Document Body ====================================--> + +<!ELEMENT body %Flow;> +<!ATTLIST body + %attrs; + onload %Script; #IMPLIED + onunload %Script; #IMPLIED + background %URI; #IMPLIED + bgcolor %Color; #IMPLIED + text %Color; #IMPLIED + link %Color; #IMPLIED + vlink %Color; #IMPLIED + alink %Color; #IMPLIED + > + +<!ELEMENT div %Flow;> <!-- generic language/style container --> +<!ATTLIST div + %attrs; + %TextAlign; + > + +<!--=================== Paragraphs =======================================--> + +<!ELEMENT p %Inline;> +<!ATTLIST p + %attrs; + %TextAlign; + > + +<!--=================== Headings =========================================--> + +<!-- + There are six levels of headings from h1 (the most important) + to h6 (the least important). +--> + +<!ELEMENT h1 %Inline;> +<!ATTLIST h1 + %attrs; + %TextAlign; + > + +<!ELEMENT h2 %Inline;> +<!ATTLIST h2 + %attrs; + %TextAlign; + > + +<!ELEMENT h3 %Inline;> +<!ATTLIST h3 + %attrs; + %TextAlign; + > + +<!ELEMENT h4 %Inline;> +<!ATTLIST h4 + %attrs; + %TextAlign; + > + +<!ELEMENT h5 %Inline;> +<!ATTLIST h5 + %attrs; + %TextAlign; + > + +<!ELEMENT h6 %Inline;> +<!ATTLIST h6 + %attrs; + %TextAlign; + > + +<!--=================== Lists ============================================--> + +<!-- Unordered list bullet styles --> + +<!ENTITY % ULStyle "(disc|square|circle)"> + +<!-- Unordered list --> + +<!ELEMENT ul (li)+> +<!ATTLIST ul + %attrs; + type %ULStyle; #IMPLIED + compact (compact) #IMPLIED + > + +<!-- Ordered list numbering style + + 1 arabic numbers 1, 2, 3, ... + a lower alpha a, b, c, ... + A upper alpha A, B, C, ... + i lower roman i, ii, iii, ... + I upper roman I, II, III, ... + + The style is applied to the sequence number which by default + is reset to 1 for the first list item in an ordered list. +--> +<!ENTITY % OLStyle "CDATA"> + +<!-- Ordered (numbered) list --> + +<!ELEMENT ol (li)+> +<!ATTLIST ol + %attrs; + type %OLStyle; #IMPLIED + compact (compact) #IMPLIED + start %Number; #IMPLIED + > + +<!-- single column list (DEPRECATED) --> +<!ELEMENT menu (li)+> +<!ATTLIST menu + %attrs; + compact (compact) #IMPLIED + > + +<!-- multiple column list (DEPRECATED) --> +<!ELEMENT dir (li)+> +<!ATTLIST dir + %attrs; + compact (compact) #IMPLIED + > + +<!-- LIStyle is constrained to: "(%ULStyle;|%OLStyle;)" --> +<!ENTITY % LIStyle "CDATA"> + +<!-- list item --> + +<!ELEMENT li %Flow;> +<!ATTLIST li + %attrs; + type %LIStyle; #IMPLIED + value %Number; #IMPLIED + > + +<!-- definition lists - dt for term, dd for its definition --> + +<!ELEMENT dl (dt|dd)+> +<!ATTLIST dl + %attrs; + compact (compact) #IMPLIED + > + +<!ELEMENT dt %Inline;> +<!ATTLIST dt + %attrs; + > + +<!ELEMENT dd %Flow;> +<!ATTLIST dd + %attrs; + > + +<!--=================== Address ==========================================--> + +<!-- information on author --> + +<!ELEMENT address (#PCDATA | %inline; | %misc.inline; | p)*> +<!ATTLIST address + %attrs; + > + +<!--=================== Horizontal Rule ==================================--> + +<!ELEMENT hr EMPTY> +<!ATTLIST hr + %attrs; + align (left|center|right) #IMPLIED + noshade (noshade) #IMPLIED + size %Pixels; #IMPLIED + width %Length; #IMPLIED + > + +<!--=================== Preformatted Text ================================--> + +<!-- content is %Inline; excluding + "img|object|applet|big|small|sub|sup|font|basefont" --> + +<!ELEMENT pre %pre.content;> +<!ATTLIST pre + %attrs; + width %Number; #IMPLIED + xml:space (preserve) #FIXED 'preserve' + > + +<!--=================== Block-like Quotes ================================--> + +<!ELEMENT blockquote %Flow;> +<!ATTLIST blockquote + %attrs; + cite %URI; #IMPLIED + > + +<!--=================== Text alignment ===================================--> + +<!-- center content --> +<!ELEMENT center %Flow;> +<!ATTLIST center + %attrs; + > + +<!--=================== Inserted/Deleted Text ============================--> + +<!-- + ins/del are allowed in block and inline content, but its + inappropriate to include block content within an ins element + occurring in inline content. +--> +<!ELEMENT ins %Flow;> +<!ATTLIST ins + %attrs; + cite %URI; #IMPLIED + datetime %Datetime; #IMPLIED + > + +<!ELEMENT del %Flow;> +<!ATTLIST del + %attrs; + cite %URI; #IMPLIED + datetime %Datetime; #IMPLIED + > + +<!--================== The Anchor Element ================================--> + +<!-- content is %Inline; except that anchors shouldn't be nested --> + +<!ELEMENT a %a.content;> +<!ATTLIST a + %attrs; + %focus; + charset %Charset; #IMPLIED + type %ContentType; #IMPLIED + name NMTOKEN #IMPLIED + href %URI; #IMPLIED + hreflang %LanguageCode; #IMPLIED + rel %LinkTypes; #IMPLIED + rev %LinkTypes; #IMPLIED + shape %Shape; "rect" + coords %Coords; #IMPLIED + target %FrameTarget; #IMPLIED + > + +<!--===================== Inline Elements ================================--> + +<!ELEMENT span %Inline;> <!-- generic language/style container --> +<!ATTLIST span + %attrs; + > + +<!ELEMENT bdo %Inline;> <!-- I18N BiDi over-ride --> +<!ATTLIST bdo + %coreattrs; + %events; + lang %LanguageCode; #IMPLIED + xml:lang %LanguageCode; #IMPLIED + dir (ltr|rtl) #REQUIRED + > + +<!ELEMENT br EMPTY> <!-- forced line break --> +<!ATTLIST br + %coreattrs; + clear (left|all|right|none) "none" + > + +<!ELEMENT em %Inline;> <!-- emphasis --> +<!ATTLIST em %attrs;> + +<!ELEMENT strong %Inline;> <!-- strong emphasis --> +<!ATTLIST strong %attrs;> + +<!ELEMENT dfn %Inline;> <!-- definitional --> +<!ATTLIST dfn %attrs;> + +<!ELEMENT code %Inline;> <!-- program code --> +<!ATTLIST code %attrs;> + +<!ELEMENT samp %Inline;> <!-- sample --> +<!ATTLIST samp %attrs;> + +<!ELEMENT kbd %Inline;> <!-- something user would type --> +<!ATTLIST kbd %attrs;> + +<!ELEMENT var %Inline;> <!-- variable --> +<!ATTLIST var %attrs;> + +<!ELEMENT cite %Inline;> <!-- citation --> +<!ATTLIST cite %attrs;> + +<!ELEMENT abbr %Inline;> <!-- abbreviation --> +<!ATTLIST abbr %attrs;> + +<!ELEMENT acronym %Inline;> <!-- acronym --> +<!ATTLIST acronym %attrs;> + +<!ELEMENT q %Inline;> <!-- inlined quote --> +<!ATTLIST q + %attrs; + cite %URI; #IMPLIED + > + +<!ELEMENT sub %Inline;> <!-- subscript --> +<!ATTLIST sub %attrs;> + +<!ELEMENT sup %Inline;> <!-- superscript --> +<!ATTLIST sup %attrs;> + +<!ELEMENT tt %Inline;> <!-- fixed pitch font --> +<!ATTLIST tt %attrs;> + +<!ELEMENT i %Inline;> <!-- italic font --> +<!ATTLIST i %attrs;> + +<!ELEMENT b %Inline;> <!-- bold font --> +<!ATTLIST b %attrs;> + +<!ELEMENT big %Inline;> <!-- bigger font --> +<!ATTLIST big %attrs;> + +<!ELEMENT small %Inline;> <!-- smaller font --> +<!ATTLIST small %attrs;> + +<!ELEMENT u %Inline;> <!-- underline --> +<!ATTLIST u %attrs;> + +<!ELEMENT s %Inline;> <!-- strike-through --> +<!ATTLIST s %attrs;> + +<!ELEMENT strike %Inline;> <!-- strike-through --> +<!ATTLIST strike %attrs;> + +<!ELEMENT basefont EMPTY> <!-- base font size --> +<!ATTLIST basefont + id ID #IMPLIED + size CDATA #REQUIRED + color %Color; #IMPLIED + face CDATA #IMPLIED + > + +<!ELEMENT font %Inline;> <!-- local change to font --> +<!ATTLIST font + %coreattrs; + %i18n; + size CDATA #IMPLIED + color %Color; #IMPLIED + face CDATA #IMPLIED + > + +<!--==================== Object ======================================--> +<!-- + object is used to embed objects as part of HTML pages. + param elements should precede other content. Parameters + can also be expressed as attribute/value pairs on the + object element itself when brevity is desired. +--> + +<!ELEMENT object (#PCDATA | param | %block; | form | %inline; | %misc;)*> +<!ATTLIST object + %attrs; + declare (declare) #IMPLIED + classid %URI; #IMPLIED + codebase %URI; #IMPLIED + data %URI; #IMPLIED + type %ContentType; #IMPLIED + codetype %ContentType; #IMPLIED + archive %UriList; #IMPLIED + standby %Text; #IMPLIED + height %Length; #IMPLIED + width %Length; #IMPLIED + usemap %URI; #IMPLIED + name NMTOKEN #IMPLIED + tabindex %Number; #IMPLIED + align %ImgAlign; #IMPLIED + border %Pixels; #IMPLIED + hspace %Pixels; #IMPLIED + vspace %Pixels; #IMPLIED + > + +<!-- + param is used to supply a named property value. + In XML it would seem natural to follow RDF and support an + abbreviated syntax where the param elements are replaced + by attribute value pairs on the object start tag. +--> +<!ELEMENT param EMPTY> +<!ATTLIST param + id ID #IMPLIED + name CDATA #REQUIRED + value CDATA #IMPLIED + valuetype (data|ref|object) "data" + type %ContentType; #IMPLIED + > + +<!--=================== Java applet ==================================--> +<!-- + One of code or object attributes must be present. + Place param elements before other content. +--> +<!ELEMENT applet (#PCDATA | param | %block; | form | %inline; | %misc;)*> +<!ATTLIST applet + %coreattrs; + codebase %URI; #IMPLIED + archive CDATA #IMPLIED + code CDATA #IMPLIED + object CDATA #IMPLIED + alt %Text; #IMPLIED + name NMTOKEN #IMPLIED + width %Length; #REQUIRED + height %Length; #REQUIRED + align %ImgAlign; #IMPLIED + hspace %Pixels; #IMPLIED + vspace %Pixels; #IMPLIED + > + +<!--=================== Images ===========================================--> + +<!-- + To avoid accessibility problems for people who aren't + able to see the image, you should provide a text + description using the alt and longdesc attributes. + In addition, avoid the use of server-side image maps. +--> + +<!ELEMENT img EMPTY> +<!ATTLIST img + %attrs; + src %URI; #REQUIRED + alt %Text; #REQUIRED + name NMTOKEN #IMPLIED + longdesc %URI; #IMPLIED + height %Length; #IMPLIED + width %Length; #IMPLIED + usemap %URI; #IMPLIED + ismap (ismap) #IMPLIED + align %ImgAlign; #IMPLIED + border %Length; #IMPLIED + hspace %Pixels; #IMPLIED + vspace %Pixels; #IMPLIED + > + +<!-- usemap points to a map element which may be in this document + or an external document, although the latter is not widely supported --> + +<!--================== Client-side image maps ============================--> + +<!-- These can be placed in the same document or grouped in a + separate document although this isn't yet widely supported --> + +<!ELEMENT map ((%block; | form | %misc;)+ | area+)> +<!ATTLIST map + %i18n; + %events; + id ID #REQUIRED + class CDATA #IMPLIED + style %StyleSheet; #IMPLIED + title %Text; #IMPLIED + name CDATA #IMPLIED + > + +<!ELEMENT area EMPTY> +<!ATTLIST area + %attrs; + %focus; + shape %Shape; "rect" + coords %Coords; #IMPLIED + href %URI; #IMPLIED + nohref (nohref) #IMPLIED + alt %Text; #REQUIRED + target %FrameTarget; #IMPLIED + > + +<!--================ Forms ===============================================--> + +<!ELEMENT form %form.content;> <!-- forms shouldn't be nested --> + +<!ATTLIST form + %attrs; + action %URI; #REQUIRED + method (get|post) "get" + name NMTOKEN #IMPLIED + enctype %ContentType; "application/x-www-form-urlencoded" + onsubmit %Script; #IMPLIED + onreset %Script; #IMPLIED + accept %ContentTypes; #IMPLIED + accept-charset %Charsets; #IMPLIED + target %FrameTarget; #IMPLIED + > + +<!-- + Each label must not contain more than ONE field + Label elements shouldn't be nested. +--> +<!ELEMENT label %Inline;> +<!ATTLIST label + %attrs; + for IDREF #IMPLIED + accesskey %Character; #IMPLIED + onfocus %Script; #IMPLIED + onblur %Script; #IMPLIED + > + +<!ENTITY % InputType + "(text | password | checkbox | + radio | submit | reset | + file | hidden | image | button)" + > + +<!-- the name attribute is required for all but submit & reset --> + +<!ELEMENT input EMPTY> <!-- form control --> +<!ATTLIST input + %attrs; + %focus; + type %InputType; "text" + name CDATA #IMPLIED + value CDATA #IMPLIED + checked (checked) #IMPLIED + disabled (disabled) #IMPLIED + readonly (readonly) #IMPLIED + size CDATA #IMPLIED + maxlength %Number; #IMPLIED + src %URI; #IMPLIED + alt CDATA #IMPLIED + usemap %URI; #IMPLIED + onselect %Script; #IMPLIED + onchange %Script; #IMPLIED + accept %ContentTypes; #IMPLIED + align %ImgAlign; #IMPLIED + > + +<!ELEMENT select (optgroup|option)+> <!-- option selector --> +<!ATTLIST select + %attrs; + name CDATA #IMPLIED + size %Number; #IMPLIED + multiple (multiple) #IMPLIED + disabled (disabled) #IMPLIED + tabindex %Number; #IMPLIED + onfocus %Script; #IMPLIED + onblur %Script; #IMPLIED + onchange %Script; #IMPLIED + > + +<!ELEMENT optgroup (option)+> <!-- option group --> +<!ATTLIST optgroup + %attrs; + disabled (disabled) #IMPLIED + label %Text; #REQUIRED + > + +<!ELEMENT option (#PCDATA)> <!-- selectable choice --> +<!ATTLIST option + %attrs; + selected (selected) #IMPLIED + disabled (disabled) #IMPLIED + label %Text; #IMPLIED + value CDATA #IMPLIED + > + +<!ELEMENT textarea (#PCDATA)> <!-- multi-line text field --> +<!ATTLIST textarea + %attrs; + %focus; + name CDATA #IMPLIED + rows %Number; #REQUIRED + cols %Number; #REQUIRED + disabled (disabled) #IMPLIED + readonly (readonly) #IMPLIED + onselect %Script; #IMPLIED + onchange %Script; #IMPLIED + > + +<!-- + The fieldset element is used to group form fields. + Only one legend element should occur in the content + and if present should only be preceded by whitespace. +--> +<!ELEMENT fieldset (#PCDATA | legend | %block; | form | %inline; | %misc;)*> +<!ATTLIST fieldset + %attrs; + > + +<!ENTITY % LAlign "(top|bottom|left|right)"> + +<!ELEMENT legend %Inline;> <!-- fieldset label --> +<!ATTLIST legend + %attrs; + accesskey %Character; #IMPLIED + align %LAlign; #IMPLIED + > + +<!-- + Content is %Flow; excluding a, form, form controls, iframe +--> +<!ELEMENT button %button.content;> <!-- push button --> +<!ATTLIST button + %attrs; + %focus; + name CDATA #IMPLIED + value CDATA #IMPLIED + type (button|submit|reset) "submit" + disabled (disabled) #IMPLIED + > + +<!-- single-line text input control (DEPRECATED) --> +<!ELEMENT isindex EMPTY> +<!ATTLIST isindex + %coreattrs; + %i18n; + prompt %Text; #IMPLIED + > + +<!--======================= Tables =======================================--> + +<!-- Derived from IETF HTML table standard, see [RFC1942] --> + +<!-- + The border attribute sets the thickness of the frame around the + table. The default units are screen pixels. + + The frame attribute specifies which parts of the frame around + the table should be rendered. The values are not the same as + CALS to avoid a name clash with the valign attribute. +--> +<!ENTITY % TFrame "(void|above|below|hsides|lhs|rhs|vsides|box|border)"> + +<!-- + The rules attribute defines which rules to draw between cells: + + If rules is absent then assume: + "none" if border is absent or border="0" otherwise "all" +--> + +<!ENTITY % TRules "(none | groups | rows | cols | all)"> + +<!-- horizontal placement of table relative to document --> +<!ENTITY % TAlign "(left|center|right)"> + +<!-- horizontal alignment attributes for cell contents + + char alignment char, e.g. char=':' + charoff offset for alignment char +--> +<!ENTITY % cellhalign + "align (left|center|right|justify|char) #IMPLIED + char %Character; #IMPLIED + charoff %Length; #IMPLIED" + > + +<!-- vertical alignment attributes for cell contents --> +<!ENTITY % cellvalign + "valign (top|middle|bottom|baseline) #IMPLIED" + > + +<!ELEMENT table + (caption?, (col*|colgroup*), thead?, tfoot?, (tbody+|tr+))> +<!ELEMENT caption %Inline;> +<!ELEMENT thead (tr)+> +<!ELEMENT tfoot (tr)+> +<!ELEMENT tbody (tr)+> +<!ELEMENT colgroup (col)*> +<!ELEMENT col EMPTY> +<!ELEMENT tr (th|td)+> +<!ELEMENT th %Flow;> +<!ELEMENT td %Flow;> + +<!ATTLIST table + %attrs; + summary %Text; #IMPLIED + width %Length; #IMPLIED + border %Pixels; #IMPLIED + frame %TFrame; #IMPLIED + rules %TRules; #IMPLIED + cellspacing %Length; #IMPLIED + cellpadding %Length; #IMPLIED + align %TAlign; #IMPLIED + bgcolor %Color; #IMPLIED + > + +<!ENTITY % CAlign "(top|bottom|left|right)"> + +<!ATTLIST caption + %attrs; + align %CAlign; #IMPLIED + > + +<!-- +colgroup groups a set of col elements. It allows you to group +several semantically related columns together. +--> +<!ATTLIST colgroup + %attrs; + span %Number; "1" + width %MultiLength; #IMPLIED + %cellhalign; + %cellvalign; + > + +<!-- + col elements define the alignment properties for cells in + one or more columns. + + The width attribute specifies the width of the columns, e.g. + + width=64 width in screen pixels + width=0.5* relative width of 0.5 + + The span attribute causes the attributes of one + col element to apply to more than one column. +--> +<!ATTLIST col + %attrs; + span %Number; "1" + width %MultiLength; #IMPLIED + %cellhalign; + %cellvalign; + > + +<!-- + Use thead to duplicate headers when breaking table + across page boundaries, or for static headers when + tbody sections are rendered in scrolling panel. + + Use tfoot to duplicate footers when breaking table + across page boundaries, or for static footers when + tbody sections are rendered in scrolling panel. + + Use multiple tbody sections when rules are needed + between groups of table rows. +--> +<!ATTLIST thead + %attrs; + %cellhalign; + %cellvalign; + > + +<!ATTLIST tfoot + %attrs; + %cellhalign; + %cellvalign; + > + +<!ATTLIST tbody + %attrs; + %cellhalign; + %cellvalign; + > + +<!ATTLIST tr + %attrs; + %cellhalign; + %cellvalign; + bgcolor %Color; #IMPLIED + > + +<!-- Scope is simpler than headers attribute for common tables --> +<!ENTITY % Scope "(row|col|rowgroup|colgroup)"> + +<!-- th is for headers, td for data and for cells acting as both --> + +<!ATTLIST th + %attrs; + abbr %Text; #IMPLIED + axis CDATA #IMPLIED + headers IDREFS #IMPLIED + scope %Scope; #IMPLIED + rowspan %Number; "1" + colspan %Number; "1" + %cellhalign; + %cellvalign; + nowrap (nowrap) #IMPLIED + bgcolor %Color; #IMPLIED + width %Length; #IMPLIED + height %Length; #IMPLIED + > + +<!ATTLIST td + %attrs; + abbr %Text; #IMPLIED + axis CDATA #IMPLIED + headers IDREFS #IMPLIED + scope %Scope; #IMPLIED + rowspan %Number; "1" + colspan %Number; "1" + %cellhalign; + %cellvalign; + nowrap (nowrap) #IMPLIED + bgcolor %Color; #IMPLIED + width %Length; #IMPLIED + height %Length; #IMPLIED + > + diff --git a/testing/runtests.py b/testing/runtests.py index 83647c6..a714cd8 100644 --- a/testing/runtests.py +++ b/testing/runtests.py @@ -30,6 +30,19 @@ class Tester: return (True,'Difference between generated output and reference:\n%s' % diff) return (False,'') + def cleanup_xmllint(self,errmsg): + msg = errmsg.split('\n') + rtnmsg = "" + for o in msg: + if (o): + if (o.startswith("I/O error : Attempt")): + pass + else: + if (rtnmsg): + rtnmsg += '\n' + rtnmsg += o + return rtnmsg + def get_config(self): config = {} with open(self.args.inputdir+'/'+self.test,'r') as f: @@ -52,11 +65,23 @@ class Tester: with open(self.test_out+'/Doxyfile','a') as f: print('INPUT=%s/%s' % (self.args.inputdir,self.test), file=f) print('STRIP_FROM_PATH=%s' % self.args.inputdir, file=f) - print('XML_OUTPUT=%s/out' % self.test_out, file=f) print('EXAMPLE_PATH=%s' % self.args.inputdir, file=f) if 'config' in self.config: for option in self.config['config']: print(option, file=f) + if (self.args.xml): + print('GENERATE_XML=YES', file=f) + print('XML_OUTPUT=%s/out' % self.test_out, file=f) + else: + print('GENERATE_XML=NO', file=f) + if (self.args.xhtml): + print('GENERATE_HTML=YES', file=f) + # HTML_OUTPUT can also be set locally + print('HTML_OUTPUT=%s/html' % self.test_out, file=f) + print('HTML_FILE_EXTENSION=.xhtml', file=f) + if (self.args.pdf): + print('GENERATE_LATEX=YES', file=f) + print('LATEX_OUTPUT=%s/latex' % self.test_out, file=f) if 'check' not in self.config or not self.config['check']: print('Test doesn\'t specify any files to check') @@ -64,10 +89,14 @@ class Tester: # run doxygen if (sys.platform == 'win32'): - redir=' > nul:' + redir=' > nul:' else: - redir=' 2> /dev/null' - if os.system('%s %s/Doxyfile %s' % (self.args.doxygen,self.test_out, redir))!=0: + redir=' 2> /dev/null > /dev/null' + + if (self.args.noredir): + redir='' + + if os.system('%s %s/Doxyfile %s' % (self.args.doxygen,self.test_out,redir))!=0: print('Error: failed to run %s on %s/Doxyfile' % (self.args.doxygen,self.test_out)); sys.exit(1) @@ -98,32 +127,92 @@ class Tester: # check the relevant files of a doxygen run with the reference material def perform_test(self,testmgr): + if (sys.platform == 'win32'): + redir=' > nul:' + separ='&' + else: + redir=' 2> /dev/null' + separ=';' + + if (self.args.noredir): + redir='' + + failed_xml=False + failed_html=False + failed_latex=False + msg = () # look for files to check against the reference - if 'check' in self.config: - for check in self.config['check']: - check_file='%s/out/%s' % (self.test_out,check) - # check if the file we need to check is actually generated - if not os.path.isfile(check_file): - testmgr.ok(False,self.test_name,msg='Non-existing file %s after \'check:\' statement' % check_file) - return - # convert output to canonical form - data = os.popen('%s --format --noblanks --nowarning %s' % (self.args.xmllint,check_file)).read() - if data: - # strip version - data = re.sub(r'xsd" version="[0-9.-]+"','xsd" version=""',data).rstrip('\n') - else: - testmgr.ok(False,self.test_name,msg='Failed to run %s on the doxygen output file %s' % (self.args.xmllint,self.test_out)) - return - out_file='%s/%s' % (self.test_out,check) - with open(out_file,'w') as f: - print(data,file=f) - ref_file='%s/%s/%s' % (self.args.inputdir,self.test_id,check) - (failed,msg) = self.compare_ok(out_file,ref_file,self.test_name) - if failed: - testmgr.ok(False,self.test_name,msg) - return - shutil.rmtree(self.test_out,ignore_errors=True) + if self.args.xml: + failed_xml=True + if 'check' in self.config: + for check in self.config['check']: + check_file='%s/out/%s' % (self.test_out,check) + # check if the file we need to check is actually generated + if not os.path.isfile(check_file): + msg += ('Non-existing file %s after \'check:\' statement' % check_file,) + break + # convert output to canonical form + data = os.popen('%s --format --noblanks --nowarning %s' % (self.args.xmllint,check_file)).read() + if data: + # strip version + data = re.sub(r'xsd" version="[0-9.-]+"','xsd" version=""',data).rstrip('\n') + else: + msg += ('Failed to run %s on the doxygen output file %s' % (self.args.xmllint,self.test_out),) + break + out_file='%s/%s' % (self.test_out,check) + with open(out_file,'w') as f: + print(data,file=f) + ref_file='%s/%s/%s' % (self.args.inputdir,self.test_id,check) + (failed_xml,xml_msg) = self.compare_ok(out_file,ref_file,self.test_name) + if failed_xml: + msg+= (xml_msg,) + break + if not failed_xml and not self.args.keep: + xml_output='%s/out' % self.test_out + shutil.rmtree(xml_output,ignore_errors=True) + + if (self.args.xhtml): + html_output='%s/html' % self.test_out + if (sys.platform == 'win32'): + redirx=' 2> %s/temp >nul:'%html_output + else: + redirx='2>%s/temp >/dev/null'%html_output + exe_string = '%s --path dtd --nonet --postvalid %s/*xhtml %s %s ' % (self.args.xmllint,html_output,redirx,separ) + exe_string += 'more "%s/temp"' % (html_output) + failed_html=False + xmllint_out = os.popen(exe_string).read() + xmllint_out = self.cleanup_xmllint(xmllint_out) + if xmllint_out: + msg += (xmllint_out,) + failed_html=True + elif not self.args.keep: + shutil.rmtree(html_output,ignore_errors=True) + if (self.args.pdf): + failed_latex=False + latex_output='%s/latex' % self.test_out + if (sys.platform == 'win32'): + redirl='>nul: 2>temp' + else: + redirl='>/dev/null 2>temp' + exe_string = 'cd %s %s echo "q" | make %s %s' % (latex_output,separ,redirl,separ) + exe_string += 'more temp' + latex_out = os.popen(exe_string).read() + if latex_out.find("Error")!=-1: + msg += ("PDF generation failed\n For a description of the problem see 'refman.log' in the latex directory of this test",) + failed_html=True + elif open(latex_output + "/refman.log",'r').read().find("Emergency stop")!= -1: + msg += ("PDF generation failed\n For a description of the problem see 'refman.log' in the latex directory of this test",) + failed_html=True + elif not self.args.keep: + shutil.rmtree(latex_output,ignore_errors=True) + + if failed_xml or failed_html or failed_latex: + testmgr.ok(False,self.test_name,msg) + return + testmgr.ok(True,self.test_name) + if not self.args.keep: + shutil.rmtree(self.test_out,ignore_errors=True) def run(self,testmgr): if self.update: @@ -138,6 +227,8 @@ class TestManager: self.num_tests = len(tests) self.count=1 self.passed=0 + if self.args.xhtml: + self.prepare_dtd() print('1..%d' % self.num_tests) def ok(self,result,test_name,msg='Ok'): @@ -147,8 +238,9 @@ class TestManager: else: print('not ok %s - %s' % (self.count,test_name)) print('-------------------------------------') - print(msg) - print('-------------------------------------') + for o in msg: + print(o) + print('-------------------------------------') self.count = self.count + 1 def result(self): @@ -162,27 +254,56 @@ class TestManager: for test in self.tests: tester = Tester(self.args,test) tester.run(self) - return 0 if self.args.updateref else self.result() + res=self.result() + if self.args.xhtml and not res and not self.args.keep: + shutil.rmtree("dtd",ignore_errors=True) + return 0 if self.args.updateref else res + + def prepare_dtd(self): + shutil.rmtree("dtd",ignore_errors=True) + shutil.copytree(self.args.inputdir+"/dtd", "dtd") def main(): # argument handling parser = argparse.ArgumentParser(description='run doxygen tests') - parser.add_argument('--updateref',help='update the reference data for a test',action="store_true") - parser.add_argument('--doxygen',nargs='?',default='doxygen',help='path/name of the doxygen executable') - parser.add_argument('--xmllint',nargs='?',default='xmllint',help='path/name of the xmllint executable') - parser.add_argument('--id',nargs='+',dest='ids',action='append',type=int,help='id of the test to perform') - parser.add_argument('--all',help='perform all tests',action="store_true") - parser.add_argument('--inputdir',nargs='?',default='.',help='input directory containing the tests') - parser.add_argument('--outputdir',nargs='?',default='.',help='output directory to write the doxygen output to') + parser.add_argument('--updateref',help= + 'update the reference files. Should be used in combination with -id to ' + 'update the reference file(s) for the given test',action="store_true") + parser.add_argument('--doxygen',nargs='?',default='doxygen',help= + 'path/name of the doxygen executable') + parser.add_argument('--xmllint',nargs='?',default='xmllint',help= + 'path/name of the xmllint executable') + parser.add_argument('--id',nargs='+',dest='ids',action='append',type=int,help= + 'run test with number n only (the option may be specified run test with ' + 'number n only (the option may be specified') + parser.add_argument('--all',help= + 'can be used in combination with -updateref to update the reference files ' + 'for all tests.',action="store_true") + parser.add_argument('--inputdir',nargs='?',default='.',help= + 'input directory containing the tests') + parser.add_argument('--outputdir',nargs='?',default='.',help= + 'output directory to write the doxygen output to') + parser.add_argument('--noredir',help= + 'disable redirection of doxygen warnings',action="store_true") + parser.add_argument('--xml',help='create xml output and check', + action="store_true") + parser.add_argument('--xhtml',help= + 'create xhtml output and check with xmllint',action="store_true") + parser.add_argument('--pdf',help='create LaTeX output and create pdf from it', + action="store_true") + parser.add_argument('--keep',help='keep result directories', + action="store_true") args = parser.parse_args() - # sanity check + # sanity check + if (not args.xml) and (not args.pdf) and (not args.xhtml): + args.xml=True if (not args.updateref is None) and (args.ids is None) and (args.all is None): parser.error('--updateref requires either --id or --all') starting_directory = os.getcwd() os.chdir(args.inputdir) - # find the tests to run + # find the tests to run if args.ids: # test ids are given by user tests = [] for id in list(itertools.chain.from_iterable(args.ids)): diff --git a/vhdlparser/ErrorHandler.h b/vhdlparser/ErrorHandler.h index 55286b4..7500a5f 100644 --- a/vhdlparser/ErrorHandler.h +++ b/vhdlparser/ErrorHandler.h @@ -30,7 +30,7 @@ JAVACC_SIMPLE_STRING addUnicodeEscapes(JAVACC_STRING_TYPE str); // Called when the parser cannot continue parsing. // last - the last token successfully parsed. // unexpected - the token at which the error occurs. - // production - the production in which this error occurrs. + // production - the production in which this error occurs. virtual void handleParseError(Token *last, Token *unexpected, JAVACC_SIMPLE_STRING production, VhdlParser *parser) { error_count++; fprintf(stderr, "Encountered: %s at: %d:%d while parsing: %s\n", addUnicodeEscapes(unexpected->image).c_str(), unexpected->beginLine, unexpected->beginColumn, production.c_str()); diff --git a/vhdlparser/Makefile b/vhdlparser/Makefile index 4725470..84bdccf 100644 --- a/vhdlparser/Makefile +++ b/vhdlparser/Makefile @@ -7,16 +7,48 @@ # for any purpose. It is provided "as is" without express or implied warranty. # See the GNU General Public License for more details. # -# Documents produced by Doxygen are derivative works derived from the +# Documents produced by doxygen are derivative works derived from the # input used in their production; they are not affected by this license. # -regenerate: - rm -f CharStream.cc CharStream.h ErrorHandler.h ParseException.cc ParseException.h \ +# +# Files generated by javacc +# +GEN_FILES=CharStream.cc CharStream.h ErrorHandler.h ParseException.cc ParseException.h \ Token.cc Token.h TokenManager.h TokenMgrError.cc TokenMgrError.h VhdlParser.cc VhdlParser.h \ VhdlParserConstants.h VhdlParserTokenManager.cc VhdlParserTokenManager.h \ JavaCC.h - javacc vhdlparser.jj - cp JavaCC.h.in JavaCC.h +# +# Generate parser (default target) +# +# when generating the parser with debug options it will look like: +# make JAVACC_FLAGS=-debug_parser +# or +# make JAVACC_FLAGS="-debug_parser -debug_lookahead" +# +# Available debug options: +# -debug_parser +# -debug_token_manager +# -debug_lookahead +# +# For other javacc settings / options consult the documentation of javacc. + +regenerate: + @rm -f $(GEN_FILES) + @javacc $(JAVACC_FLAGS) vhdlparser.jj + @cp JavaCC.h.in JavaCC.h + +# +# reset the generated files back to their versions from git. +# + +reset_gen_files: + @rm -f $(GEN_FILES) + @git checkout $(GEN_FILES) + +help: + @echo "Targets:" + @echo " regenerate (default)" + @echo " reset_gen_files" FORCE: diff --git a/vhdlparser/ParseException.cc b/vhdlparser/ParseException.cc index 31ee7a3..99649af 100644 --- a/vhdlparser/ParseException.cc +++ b/vhdlparser/ParseException.cc @@ -53,7 +53,7 @@ namespace parser { /** * This is the last token that has been consumed successfully. If * this object has been created due to a parse error, the token - * followng this token will (therefore) be the first error token. + * following this token will (therefore) be the first error token. */ Token currentToken; diff --git a/vhdlparser/ParseException.h b/vhdlparser/ParseException.h index 1f3a3dc..b025912 100644 --- a/vhdlparser/ParseException.h +++ b/vhdlparser/ParseException.h @@ -50,7 +50,7 @@ class ParseException { /** * This is the last token that has been consumed successfully. If * this object has been created due to a parse error, the token - * followng this token will (therefore) be the first error token. + * following this token will (therefore) be the first error token. */ Token currentToken; diff --git a/vhdlparser/vhdlstring.h b/vhdlparser/vhdlstring.h index fde6ce4..4c64440 100644 --- a/vhdlparser/vhdlstring.h +++ b/vhdlparser/vhdlstring.h @@ -9,6 +9,7 @@ /** @brief Minimal string class with std::string like behaviour that fulfills the JavaCC * string requirements. */ + class VhdlString { public: @@ -93,6 +94,8 @@ class VhdlString void clear() { free(m_str); init(); } VhdlString &operator+=(char c) { char s[2]; s[0]=c; s[1]=0; return append(s); } VhdlString &operator+=(const char *s) { return append(s); } + VhdlString &operator+=(VhdlString s) { return append(s); } + VhdlString operator+ (const char *s) { return append(s); } private: void init() { m_str=(char*)calloc(1,1); m_len=0; } @@ -100,4 +103,9 @@ class VhdlString int m_len; }; +// declare it static otherwise we will get: +// multiple definition of `operator+(char const*, VhdlString)' +// as we are in an include file +static VhdlString operator+ (const char *s, VhdlString v) { return VhdlString(s).append(v); } + #endif |