Imported Upstream version 1.8.17 upstream/1.8.17
authorDongHun Kwak <dh0128.kwak@samsung.com>
Fri, 15 Oct 2021 02:12:58 +0000 (11:12 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Fri, 15 Oct 2021 02:12:58 +0000 (11:12 +0900)
305 files changed:
.travis.yml
CMakeLists.txt
VERSION
addon/doxmlparser/Doxyfile
addon/doxmlparser/Doxyfile.impl
addon/doxmlparser/include/doxmlintf.h
addon/doxmlparser/src/basehandler.h
addon/doxmlparser/src/compoundhandler.cpp
addon/doxmlparser/src/compoundhandler.h
addon/doxmlparser/src/linkedtexthandler.cpp
addon/doxmlparser/src/memberhandler.cpp
addon/doxmlparser/test/main.cpp
addon/doxyapp/doxyapp.cpp
addon/doxyparse/doxyparse.cpp
addon/doxywizard/CMakeLists.txt
addon/doxywizard/config.h
addon/doxywizard/config_doxyw.l
addon/doxywizard/configdoc.h
addon/doxywizard/docintf.h
addon/doxywizard/doxywizard.cpp
addon/doxywizard/doxywizard.h
addon/doxywizard/expert.cpp
addon/doxywizard/expert.h
addon/doxywizard/helplabel.h
addon/doxywizard/input.h
addon/doxywizard/inputbool.cpp
addon/doxywizard/inputbool.h
addon/doxywizard/inputint.cpp
addon/doxywizard/inputint.h
addon/doxywizard/inputstring.cpp
addon/doxywizard/inputstring.h
addon/doxywizard/inputstrlist.cpp
addon/doxywizard/inputstrlist.h
addon/doxywizard/wizard.cpp
addon/doxywizard/wizard.h
appveyor.yml
cmake/FindJavacc.cmake [new file with mode: 0755]
cmake/git_watcher.cmake
doc/CMakeLists.txt
doc/Doxyfile
doc/Doxyfile_chm [new file with mode: 0644]
doc/changelog.doc
doc/commands.doc
doc/docblocks.doc
doc/doxygen.1
doc/doxygen_manual.tex
doc/emojisup.doc
doc/extsearch.doc
doc/faq.doc
doc/features.doc
doc/formulas.doc
doc/htmlcmds.doc
doc/index.doc
doc/markdown.doc
doc/preprocessing.doc
doc/searching.doc
doc/starting.doc
doc/tables.doc
doc/translator.py
examples/templ.cpp
liblodepng/lodepng.cpp
libmscgen/CMakeLists.txt
libmscgen/gd.c
libmscgen/gd.h
libmscgen/gd_intern.h
libmscgen/mscgen_adraw.h
libmscgen/mscgen_adraw_int.h
libmscgen/mscgen_api.c
libmscgen/mscgen_gd_out.c
libmscgen/mscgen_lexer.l
libmscgen/mscgen_msc.c
libmscgen/mscgen_msc.h
libmscgen/mscgen_usage.c
libmscgen/mscgen_utf8.c
qtools/qcache.h
qtools/qcstring.cpp
qtools/qcstring.h
qtools/qcstringlist.cpp
qtools/qdatetime.cpp
qtools/qdatetime.h
qtools/qdict.doc
qtools/qdict.h
qtools/qgcache.cpp
qtools/qgcache.h
qtools/qgdict.cpp
qtools/qgdict.h
qtools/qglobal.cpp
qtools/qglobal.h
qtools/qlist.doc
qtools/qstring.cpp
qtools/qstringlist.cpp
qtools/qtextcodec.cpp
qtools/qtl.doc
qtools/qvaluelist.doc
qtools/qxml.cpp
src/CMakeLists.txt
src/arguments.cpp
src/arguments.h
src/cite.cpp
src/clangparser.cpp
src/classdef.cpp
src/classdef.h
src/classlist.cpp
src/cmdmapper.cpp
src/cmdmapper.h
src/code.h
src/code.l
src/commentcnv.l
src/commentscan.h
src/commentscan.l
src/condparser.cpp
src/condparser.h
src/config.xml
src/configgen.py
src/configimpl.h
src/configimpl.l
src/constexp.h
src/constexp.l
src/constexp.y
src/constexp_p.h [new file with mode: 0644]
src/context.cpp
src/context.h
src/declinfo.l
src/defargs.h
src/defargs.l
src/defgen.cpp
src/definition.cpp
src/definition.h
src/definitionimpl.h
src/dia.cpp
src/diagram.cpp
src/dirdef.cpp
src/docbookgen.cpp
src/docbookgen.h
src/docbookvisitor.cpp
src/docgroup.cpp
src/docgroup.h
src/docparser.cpp
src/docparser.h
src/docsets.cpp
src/doctokenizer.h
src/doctokenizer.l
src/dot.cpp
src/dot.h
src/dotcallgraph.cpp
src/dotcallgraph.h
src/dotclassgraph.cpp
src/dotclassgraph.h
src/dotdirdeps.cpp
src/dotdirdeps.h
src/dotfilepatcher.cpp
src/dotfilepatcher.h
src/dotgfxhierarchytable.cpp
src/dotgraph.cpp
src/dotgraph.h
src/dotgroupcollaboration.cpp
src/dotincldepgraph.cpp
src/dotincldepgraph.h
src/dotlegendgraph.cpp [new file with mode: 0644]
src/dotlegendgraph.h [new file with mode: 0644]
src/dotnode.cpp
src/dotrunner.cpp
src/dotrunner.h
src/doxygen.cpp
src/doxygen.h
src/doxygen.md
src/eclipsehelp.cpp
src/entry.cpp
src/entry.h
src/filedef.cpp
src/fileparser.cpp
src/fileparser.h
src/formula.cpp
src/fortrancode.h
src/fortrancode.l
src/fortranscanner.h
src/fortranscanner.l
src/ftextstream.h
src/groupdef.cpp
src/groupdef.h
src/growbuf.h
src/htags.cpp
src/htmldocvisitor.cpp
src/htmlgen.cpp
src/htmlgen.h
src/htmlhelp.cpp
src/index.cpp
src/index.h
src/languages.py
src/latexdocvisitor.cpp
src/latexgen.cpp
src/latexgen.h
src/layout.cpp
src/mandocvisitor.cpp
src/mangen.cpp
src/mangen.h
src/markdown.cpp
src/markdown.h
src/memberdef.cpp
src/memberdef.h
src/membergroup.cpp
src/membergroup.h
src/memberlist.cpp
src/memberlist.h
src/message.cpp
src/message.h
src/msc.cpp
src/namespacedef.cpp
src/outputgen.cpp
src/outputgen.h
src/outputlist.cpp
src/outputlist.h
src/pagedef.cpp
src/parserintf.h
src/perlmodgen.cpp
src/plantuml.cpp
src/plantuml.h
src/portable.cpp
src/portable.h
src/pre.h
src/pre.l
src/printdocvisitor.h
src/pycode.h
src/pycode.l
src/pyscanner.h
src/pyscanner.l
src/qhp.cpp
src/reflist.cpp
src/rtfdocvisitor.cpp
src/rtfgen.cpp
src/rtfgen.h
src/scan_states.py [new file with mode: 0644]
src/scanner.h
src/scanner.l
src/searchindex.cpp
src/searchindex.h
src/section.h
src/sortdict.h
src/sqlcode.h
src/sqlcode.l
src/sqlite3gen.cpp
src/sqlscanner.h [deleted file]
src/stlsupport.cpp [new file with mode: 0644]
src/stlsupport.h [new file with mode: 0644]
src/tagreader.cpp
src/tagreader.h
src/tclscanner.h
src/tclscanner.l
src/template.cpp
src/tooltip.cpp
src/translator.h
src/types.h
src/util.cpp
src/util.h
src/vhdlcode.h
src/vhdlcode.l
src/vhdldocgen.cpp
src/vhdldocgen.h
src/vhdljjparser.cpp
src/vhdljjparser.h
src/xmlcode.h
src/xmlcode.l
src/xmldocvisitor.cpp
src/xmlgen.cpp
src/xmlscanner.h [deleted file]
templates/html/doxygen.css
templates/html/htmllayout.tpl
templates/html/htmltypeconstraints.tpl
templates/html/resize.js
templates/html/svgpan.js
templates/latex/doxygen.sty
templates/latex/tabu_doxygen.sty
templates/xml/compound.xsd
testing/012/indexpage.xml
testing/012_cite.dox
testing/069/069__link__variadic__template_8cpp.xml
testing/069_link_variadic_template.cpp
testing/070/070__ref__variadic__template_8cpp.xml
testing/070_ref_variadic_template.cpp
testing/071/namespace_a_namespace_1_1_0d0.xml
testing/082_decl_def.cpp
testing/083_decl_def.cpp
testing/086/086__style__tags_8h.xml
testing/086_style_tags.h
testing/runtests.py
testing/testsqlite3.py
vhdlparser/CMakeLists.txt
vhdlparser/CharStream.cc
vhdlparser/CharStream.h
vhdlparser/ErrorHandler.h
vhdlparser/JavaCC.h
vhdlparser/ParseException.cc
vhdlparser/ParseException.h
vhdlparser/Token.cc
vhdlparser/Token.h
vhdlparser/TokenManager.h
vhdlparser/TokenMgrError.cc
vhdlparser/TokenMgrError.h
vhdlparser/VhdlParser.cc
vhdlparser/VhdlParser.h
vhdlparser/VhdlParserConstants.h
vhdlparser/VhdlParserIF.cpp
vhdlparser/VhdlParserTokenManager.cc
vhdlparser/VhdlParserTokenManager.h
vhdlparser/vhdlparser.jj

index 48dcff4..0f6a704 100644 (file)
@@ -40,30 +40,31 @@ jobs:
           compiler: gcc
         - <<: *linux-ppc64le
           compiler: clang
-        - os: osx
-          compiler: clang
-          addons:
-              homebrew:
-                  packages:
-                      - ghostscript
-                      - bison
-                      - flex
-                  casks:
-                      - mactex-no-gui
+#        - os: osx
+#          compiler: clang
+#          addons:
+#              homebrew:
+#                  packages:
+#                      - ghostscript
+#                      - bison
+#                      - flex
+#                  casks:
+#                      - mactex-no-gui
 
 before_script:
     - |
       if [ "${TRAVIS_OS_NAME}" == "linux" ] && [ ! "${OS_NAME}" == "linux-ppc64le" ]; then
         printf "[requires]
-        libxml2/2.9.8@bincrafters/stable
+        libxml2/2.9.9@bincrafters/stable
         libiconv/1.15@bincrafters/stable" >> conanfile.txt;
       fi;
       if [ "${TRAVIS_OS_NAME}" == "osx" ]; then
         printf "[requires]
-        libxml2/2.9.8@bincrafters/stable
+        bzip2/1.0.8@bincrafters/stable
+        libxml2/2.9.9@bincrafters/stable
         libiconv/1.15@bincrafters/stable
         qt/5.12.0@bincrafters/stable
-        bison/3.0.5@bincrafters/stable 
+        bison/3.3.2@bincrafters/stable 
         [options]
         qt:shared=True" >> conanfile.txt;
       fi;
index 2621844..cd0fcaa 100644 (file)
@@ -19,14 +19,15 @@ option(build_app       "Example showing how to embed doxygen in an application."
 option(build_parse     "Parses source code and dumps the dependencies between the code elements." OFF)
 option(build_xmlparser "Example showing how to parse doxygen's XML output." OFF)
 option(build_search    "Build external search tools (doxysearch and doxyindexer)" OFF)
-option(build_doc       "Build user manual" OFF)
+option(build_doc       "Build user manual (HTML and PDF)" OFF)
+option(build_doc_chm   "Build user manual (CHM)" OFF)
 option(use_sqlite3     "Add support for sqlite3 output [experimental]." OFF)
 option(use_libclang    "Add support for libclang parsing." OFF)
 option(win_static      "Link with /MT in stead of /MD on windows" OFF)
 option(english_only    "Only compile in support for the English language" OFF)
 option(force_qt4       "Forces doxywizard to build using Qt4 even if Qt5 is installed" OFF)
 
-SET(enlarge_lex_buffers "262144" CACHE INTERNAL "Sets the lex input and read buffere to the specified size")
+SET(enlarge_lex_buffers "262144" CACHE INTERNAL "Sets the lex input and read buffers to the specified size")
 
 list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
 set(TOP "${CMAKE_SOURCE_DIR}")
@@ -48,8 +49,8 @@ if (use_libclang)
     endif()
 endif()
 
-# use C++11 standard for compiling (libclang option requires it)
-set(CMAKE_CXX_STANDARD 11)
+# use C++14 standard for compiling (libclang option requires it)
+set(CMAKE_CXX_STANDARD 14)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
 set(CMAKE_CXX_EXTENSIONS ON)
 
@@ -69,6 +70,9 @@ if (WIN32)
         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") # needed for language.cpp on 64bit
         add_definitions(-DLIBICONV_STATIC -D_CRT_SECURE_NO_WARNINGS)
     endif()
+    if (CMAKE_GENERATOR MATCHES "NMake Makefiles")
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
+    endif()
 endif()
 
 if(POLICY CMP0063)
@@ -81,9 +85,11 @@ set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
 if (CMAKE_GENERATOR MATCHES "Ninja")
   set(LEX_FLAGS )
   set(YACC_FLAGS )
+  set(JAVACC_FLAGS )
 else ()
   set(LEX_FLAGS $(LEX_FLAGS))
   set(YACC_FLAGS $(YACC_FLAGS))
+  set(JAVACC_FLAGS $(JAVACC_FLAGS))
 endif ()
 
 find_program(DOT NAMES dot)
@@ -160,6 +166,16 @@ add_subdirectory(qtools)
 add_subdirectory(vhdlparser)
 add_subdirectory(src)
 
+if (build_doc_chm)
+    if (WIN32)
+          find_package(HTMLHelp REQUIRED)
+          set(build_doc ON)
+    else ()
+          message(WARNING "CHM documentation generation not supported for this platform, ignoring setting.")
+          set(build_doc_chm OFF)
+    endif ()
+endif ()
+
 if (build_doc)
     add_subdirectory(examples)
     add_subdirectory(doc)
diff --git a/VERSION b/VERSION
index ece7349..f49e8ed 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.8.16
+1.8.17
index e95ee76..2cef6cf 100644 (file)
-# Doxyfile 1.2.12-20011209
+# Doxyfile 1.8.17
 
 #---------------------------------------------------------------------------
-# General configuration options
+# Project related configuration options
 #---------------------------------------------------------------------------
+DOXYFILE_ENCODING      = UTF-8
 PROJECT_NAME           = doxmlparser
-PROJECT_NUMBER         = 
+PROJECT_NUMBER         =
+PROJECT_BRIEF          =
+PROJECT_LOGO           =
 OUTPUT_DIRECTORY       = doc
+CREATE_SUBDIRS         = NO
+ALLOW_UNICODE_NAMES    = NO
 OUTPUT_LANGUAGE        = English
+OUTPUT_TEXT_DIRECTION  = None
+BRIEF_MEMBER_DESC      = YES
+REPEAT_BRIEF           = YES
+ABBREVIATE_BRIEF       = "The $name class" \
+                         "The $name widget" \
+                         "The $name file" \
+                         is \
+                         provides \
+                         specifies \
+                         contains \
+                         represents \
+                         a \
+                         an \
+                         the
+ALWAYS_DETAILED_SEC    = NO
+INLINE_INHERITED_MEMB  = NO
+FULL_PATH_NAMES        = NO
+STRIP_FROM_PATH        =
+STRIP_FROM_INC_PATH    =
+SHORT_NAMES            = NO
+JAVADOC_AUTOBRIEF      = NO
+JAVADOC_BANNER         = NO
+QT_AUTOBRIEF           = NO
+MULTILINE_CPP_IS_BRIEF = NO
+INHERIT_DOCS           = YES
+SEPARATE_MEMBER_PAGES  = NO
+TAB_SIZE               = 8
+ALIASES                =
+TCL_SUBST              =
+OPTIMIZE_OUTPUT_FOR_C  = NO
+OPTIMIZE_OUTPUT_JAVA   = NO
+OPTIMIZE_FOR_FORTRAN   = NO
+OPTIMIZE_OUTPUT_VHDL   = NO
+OPTIMIZE_OUTPUT_SLICE  = NO
+EXTENSION_MAPPING      =
+MARKDOWN_SUPPORT       = YES
+TOC_INCLUDE_HEADINGS   = 5
+AUTOLINK_SUPPORT       = YES
+BUILTIN_STL_SUPPORT    = NO
+CPP_CLI_SUPPORT        = NO
+SIP_SUPPORT            = NO
+IDL_PROPERTY_SUPPORT   = YES
+DISTRIBUTE_GROUP_DOC   = NO
+GROUP_NESTED_COMPOUNDS = NO
+SUBGROUPING            = YES
+INLINE_GROUPED_CLASSES = NO
+INLINE_SIMPLE_STRUCTS  = NO
+TYPEDEF_HIDES_STRUCT   = NO
+LOOKUP_CACHE_SIZE      = 0
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
 EXTRACT_ALL            = YES
 EXTRACT_PRIVATE        = YES
+EXTRACT_PRIV_VIRTUAL   = NO
+EXTRACT_PACKAGE        = NO
 EXTRACT_STATIC         = YES
 EXTRACT_LOCAL_CLASSES  = YES
+EXTRACT_LOCAL_METHODS  = NO
+EXTRACT_ANON_NSPACES   = NO
 HIDE_UNDOC_MEMBERS     = NO
 HIDE_UNDOC_CLASSES     = NO
-BRIEF_MEMBER_DESC      = YES
-REPEAT_BRIEF           = YES
-ALWAYS_DETAILED_SEC    = NO
-INLINE_INHERITED_MEMB  = NO
-FULL_PATH_NAMES        = NO
-STRIP_FROM_PATH        = 
+HIDE_FRIEND_COMPOUNDS  = NO
+HIDE_IN_BODY_DOCS      = NO
 INTERNAL_DOCS          = NO
-STRIP_CODE_COMMENTS    = YES
 CASE_SENSE_NAMES       = YES
-SHORT_NAMES            = NO
 HIDE_SCOPE_NAMES       = NO
-VERBATIM_HEADERS       = YES
+HIDE_COMPOUND_REFERENCE= NO
 SHOW_INCLUDE_FILES     = YES
-JAVADOC_AUTOBRIEF      = NO
-INHERIT_DOCS           = YES
+SHOW_GROUPED_MEMB_INC  = NO
+FORCE_LOCAL_INCLUDES   = NO
 INLINE_INFO            = YES
 SORT_MEMBER_DOCS       = YES
-DISTRIBUTE_GROUP_DOC   = NO
-TAB_SIZE               = 8
+SORT_BRIEF_DOCS        = NO
+SORT_MEMBERS_CTORS_1ST = NO
+SORT_GROUP_NAMES       = NO
+SORT_BY_SCOPE_NAME     = NO
+STRICT_PROTO_MATCHING  = NO
 GENERATE_TODOLIST      = YES
 GENERATE_TESTLIST      = YES
 GENERATE_BUGLIST       = YES
-ALIASES                = 
-ENABLED_SECTIONS       = 
+GENERATE_DEPRECATEDLIST= YES
+ENABLED_SECTIONS       =
 MAX_INITIALIZER_LINES  = 30
-OPTIMIZE_OUTPUT_FOR_C  = NO
 SHOW_USED_FILES        = YES
+SHOW_FILES             = YES
+SHOW_NAMESPACES        = YES
+FILE_VERSION_FILTER    =
+LAYOUT_FILE            =
+CITE_BIB_FILES         =
 #---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
+# Configuration options related to warning and progress messages
 #---------------------------------------------------------------------------
 QUIET                  = NO
 WARNINGS               = YES
 WARN_IF_UNDOCUMENTED   = YES
-WARN_FORMAT            = 
-WARN_LOGFILE           = 
+WARN_IF_DOC_ERROR      = YES
+WARN_NO_PARAMDOC       = NO
+WARN_AS_ERROR          = NO
+WARN_FORMAT            =
+WARN_LOGFILE           =
 #---------------------------------------------------------------------------
-# configuration options related to the input files
+# Configuration options related to the input files
 #---------------------------------------------------------------------------
 INPUT                  = include
+INPUT_ENCODING         = UTF-8
 FILE_PATTERNS          = *.h
 RECURSIVE              = NO
-EXCLUDE                = 
-EXCLUDE_PATTERNS       = 
-EXAMPLE_PATH           = 
-EXAMPLE_PATTERNS       = 
+EXCLUDE                =
+EXCLUDE_SYMLINKS       = NO
+EXCLUDE_PATTERNS       =
+EXCLUDE_SYMBOLS        =
+EXAMPLE_PATH           =
+EXAMPLE_PATTERNS       =
 EXAMPLE_RECURSIVE      = NO
-IMAGE_PATH             = 
-INPUT_FILTER           = 
+IMAGE_PATH             =
+INPUT_FILTER           =
+FILTER_PATTERNS        =
 FILTER_SOURCE_FILES    = NO
+FILTER_SOURCE_PATTERNS =
+USE_MDFILE_AS_MAINPAGE =
 #---------------------------------------------------------------------------
-# configuration options related to source browsing
+# Configuration options related to source browsing
 #---------------------------------------------------------------------------
 SOURCE_BROWSER         = YES
 INLINE_SOURCES         = NO
+STRIP_CODE_COMMENTS    = YES
 REFERENCED_BY_RELATION = YES
 REFERENCES_RELATION    = YES
+REFERENCES_LINK_SOURCE = YES
+SOURCE_TOOLTIPS        = YES
+USE_HTAGS              = NO
+VERBATIM_HEADERS       = YES
 #---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
+# Configuration options related to the alphabetical class index
 #---------------------------------------------------------------------------
 ALPHABETICAL_INDEX     = NO
 COLS_IN_ALPHA_INDEX    = 5
-IGNORE_PREFIX          = 
+IGNORE_PREFIX          =
 #---------------------------------------------------------------------------
-# configuration options related to the HTML output
+# Configuration options related to the HTML output
 #---------------------------------------------------------------------------
 GENERATE_HTML          = YES
-HTML_OUTPUT            = 
-HTML_HEADER            = 
-HTML_FOOTER            = 
-HTML_STYLESHEET        = 
-HTML_ALIGN_MEMBERS     = YES
+HTML_OUTPUT            =
+HTML_FILE_EXTENSION    = .html
+HTML_HEADER            =
+HTML_FOOTER            =
+HTML_STYLESHEET        =
+HTML_EXTRA_STYLESHEET  =
+HTML_EXTRA_FILES       =
+HTML_COLORSTYLE_HUE    = 220
+HTML_COLORSTYLE_SAT    = 100
+HTML_COLORSTYLE_GAMMA  = 80
+HTML_TIMESTAMP         = NO
+HTML_DYNAMIC_MENUS     = YES
+HTML_DYNAMIC_SECTIONS  = NO
+HTML_INDEX_NUM_ENTRIES = 100
+GENERATE_DOCSET        = NO
+DOCSET_FEEDNAME        = "Doxygen generated docs"
+DOCSET_BUNDLE_ID       = org.doxygen.Project
+DOCSET_PUBLISHER_ID    = org.doxygen.Publisher
+DOCSET_PUBLISHER_NAME  = Publisher
 GENERATE_HTMLHELP      = NO
+CHM_FILE               =
+HHC_LOCATION           =
 GENERATE_CHI           = NO
+CHM_INDEX_ENCODING     =
 BINARY_TOC             = NO
 TOC_EXPAND             = NO
+GENERATE_QHP           = NO
+QCH_FILE               =
+QHP_NAMESPACE          = org.doxygen.Project
+QHP_VIRTUAL_FOLDER     = doc
+QHP_CUST_FILTER_NAME   =
+QHP_CUST_FILTER_ATTRS  =
+QHP_SECT_FILTER_ATTRS  =
+QHG_LOCATION           =
+GENERATE_ECLIPSEHELP   = NO
+ECLIPSE_DOC_ID         = org.doxygen.Project
 DISABLE_INDEX          = NO
-ENUM_VALUES_PER_LINE   = 4
 GENERATE_TREEVIEW      = NO
+ENUM_VALUES_PER_LINE   = 4
 TREEVIEW_WIDTH         = 250
+EXT_LINKS_IN_WINDOW    = NO
+FORMULA_FONTSIZE       = 10
+FORMULA_TRANSPARENT    = YES
+USE_MATHJAX            = NO
+MATHJAX_FORMAT         = HTML-CSS
+MATHJAX_RELPATH        = https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/
+MATHJAX_EXTENSIONS     =
+MATHJAX_CODEFILE       =
+SEARCHENGINE           = NO
+SERVER_BASED_SEARCH    = NO
+EXTERNAL_SEARCH        = NO
+SEARCHENGINE_URL       =
+SEARCHDATA_FILE        = searchdata.xml
+EXTERNAL_SEARCH_ID     =
+EXTRA_SEARCH_MAPPINGS  =
 #---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
+# Configuration options related to the LaTeX output
 #---------------------------------------------------------------------------
 GENERATE_LATEX         = NO
-LATEX_OUTPUT           = 
+LATEX_OUTPUT           =
+LATEX_CMD_NAME         =
+MAKEINDEX_CMD_NAME     = makeindex
+LATEX_MAKEINDEX_CMD    = makeindex
 COMPACT_LATEX          = NO
 PAPER_TYPE             = a4wide
-EXTRA_PACKAGES         = 
-LATEX_HEADER           = 
+EXTRA_PACKAGES         =
+LATEX_HEADER           =
+LATEX_FOOTER           =
+LATEX_EXTRA_STYLESHEET =
+LATEX_EXTRA_FILES      =
 PDF_HYPERLINKS         = NO
 USE_PDFLATEX           = NO
 LATEX_BATCHMODE        = NO
+LATEX_HIDE_INDICES     = NO
+LATEX_SOURCE_CODE      = NO
+LATEX_BIB_STYLE        = plain
+LATEX_TIMESTAMP        = NO
+LATEX_EMOJI_DIRECTORY  =
 #---------------------------------------------------------------------------
-# configuration options related to the RTF output
+# Configuration options related to the RTF output
 #---------------------------------------------------------------------------
 GENERATE_RTF           = NO
-RTF_OUTPUT             = 
+RTF_OUTPUT             =
 COMPACT_RTF            = NO
 RTF_HYPERLINKS         = NO
-RTF_STYLESHEET_FILE    = 
-RTF_EXTENSIONS_FILE    = 
+RTF_STYLESHEET_FILE    =
+RTF_EXTENSIONS_FILE    =
+RTF_SOURCE_CODE        = NO
 #---------------------------------------------------------------------------
-# configuration options related to the man page output
+# Configuration options related to the man page output
 #---------------------------------------------------------------------------
 GENERATE_MAN           = NO
-MAN_OUTPUT             = 
-MAN_EXTENSION          = 
+MAN_OUTPUT             =
+MAN_EXTENSION          =
+MAN_SUBDIR             =
 MAN_LINKS              = NO
 #---------------------------------------------------------------------------
-# configuration options related to the XML output
+# Configuration options related to the XML output
 #---------------------------------------------------------------------------
 GENERATE_XML           = YES
+XML_OUTPUT             = xml
+XML_PROGRAMLISTING     = YES
+XML_NS_MEMB_FILE_SCOPE = NO
+#---------------------------------------------------------------------------
+# Configuration options related to the DOCBOOK output
+#---------------------------------------------------------------------------
+GENERATE_DOCBOOK       = NO
+DOCBOOK_OUTPUT         = docbook
+DOCBOOK_PROGRAMLISTING = NO
 #---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
+# Configuration options for the AutoGen Definitions output
 #---------------------------------------------------------------------------
 GENERATE_AUTOGEN_DEF   = NO
 #---------------------------------------------------------------------------
-# Configuration options related to the preprocessor   
+# Configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+GENERATE_PERLMOD       = NO
+PERLMOD_LATEX          = NO
+PERLMOD_PRETTY         = YES
+PERLMOD_MAKEVAR_PREFIX =
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
 #---------------------------------------------------------------------------
 ENABLE_PREPROCESSING   = YES
 MACRO_EXPANSION        = NO
 EXPAND_ONLY_PREDEF     = NO
 SEARCH_INCLUDES        = YES
-INCLUDE_PATH           = 
-INCLUDE_FILE_PATTERNS  = 
-PREDEFINED             = 
-EXPAND_AS_DEFINED      = 
+INCLUDE_PATH           =
+INCLUDE_FILE_PATTERNS  =
+PREDEFINED             =
+EXPAND_AS_DEFINED      =
 SKIP_FUNCTION_MACROS   = YES
 #---------------------------------------------------------------------------
-# Configuration::addtions related to external references   
+# Configuration options related to external references
 #---------------------------------------------------------------------------
 TAGFILES               = ../../qtools_docs/qtools.tag=../../../../qtools_docs/html
-GENERATE_TAGFILE       = 
+GENERATE_TAGFILE       =
 ALLEXTERNALS           = NO
+EXTERNAL_GROUPS        = YES
+EXTERNAL_PAGES         = YES
 #---------------------------------------------------------------------------
-# Configuration options related to the dot tool   
+# Configuration options related to the dot tool
 #---------------------------------------------------------------------------
 CLASS_DIAGRAMS         = NO
+DIA_PATH               =
+HIDE_UNDOC_RELATIONS   = YES
 HAVE_DOT               = NO
+DOT_NUM_THREADS        = 0
+DOT_FONTNAME           = Helvetica
+DOT_FONTSIZE           = 10
+DOT_FONTPATH           =
 CLASS_GRAPH            = YES
 COLLABORATION_GRAPH    = YES
+GROUP_GRAPHS           = YES
+UML_LOOK               = NO
+UML_LIMIT_NUM_FIELDS   = 10
 TEMPLATE_RELATIONS     = YES
-HIDE_UNDOC_RELATIONS   = YES
 INCLUDE_GRAPH          = YES
 INCLUDED_BY_GRAPH      = YES
+CALL_GRAPH             = NO
+CALLER_GRAPH           = NO
 GRAPHICAL_HIERARCHY    = YES
-DOT_PATH               = 
-DOTFILE_DIRS           = 
-MAX_DOT_GRAPH_WIDTH    = 1280
-MAX_DOT_GRAPH_HEIGHT   = 1024
+DIRECTORY_GRAPH        = YES
+DOT_IMAGE_FORMAT       = png
+INTERACTIVE_SVG        = NO
+DOT_PATH               =
+DOTFILE_DIRS           =
+MSCFILE_DIRS           =
+DIAFILE_DIRS           =
+PLANTUML_JAR_PATH      =
+PLANTUML_CFG_FILE      =
+PLANTUML_INCLUDE_PATH  =
+DOT_GRAPH_MAX_NODES    = 50
+MAX_DOT_GRAPH_DEPTH    = 0
+DOT_TRANSPARENT        = NO
+DOT_MULTI_TARGETS      = NO
 GENERATE_LEGEND        = YES
 DOT_CLEANUP            = YES
-#---------------------------------------------------------------------------
-# Configuration::addtions related to the search engine   
-#---------------------------------------------------------------------------
-SEARCHENGINE           = NO
-CGI_NAME               = 
-CGI_URL                = 
-DOC_URL                = 
-DOC_ABSPATH            = 
-BIN_ABSPATH            = 
-EXT_DOC_PATHS          = 
index 88818ab..5bddcc4 100644 (file)
-# Doxyfile 1.2.13.1
+# Doxyfile 1.8.17
 
 #---------------------------------------------------------------------------
-# General configuration options
+# Project related configuration options
 #---------------------------------------------------------------------------
+DOXYFILE_ENCODING      = UTF-8
 PROJECT_NAME           = doxmlparser
-PROJECT_NUMBER         = 
+PROJECT_NUMBER         =
+PROJECT_BRIEF          =
+PROJECT_LOGO           =
 OUTPUT_DIRECTORY       = doc_impl
+CREATE_SUBDIRS         = NO
+ALLOW_UNICODE_NAMES    = NO
 OUTPUT_LANGUAGE        = English
+OUTPUT_TEXT_DIRECTION  = None
+BRIEF_MEMBER_DESC      = YES
+REPEAT_BRIEF           = YES
+ABBREVIATE_BRIEF       = "The $name class" \
+                         "The $name widget" \
+                         "The $name file" \
+                         is \
+                         provides \
+                         specifies \
+                         contains \
+                         represents \
+                         a \
+                         an \
+                         the
+ALWAYS_DETAILED_SEC    = NO
+INLINE_INHERITED_MEMB  = NO
+FULL_PATH_NAMES        = NO
+STRIP_FROM_PATH        =
+STRIP_FROM_INC_PATH    =
+SHORT_NAMES            = NO
+JAVADOC_AUTOBRIEF      = NO
+JAVADOC_BANNER         = NO
+QT_AUTOBRIEF           = NO
+MULTILINE_CPP_IS_BRIEF = NO
+INHERIT_DOCS           = YES
+SEPARATE_MEMBER_PAGES  = NO
+TAB_SIZE               = 8
+ALIASES                =
+TCL_SUBST              =
+OPTIMIZE_OUTPUT_FOR_C  = NO
+OPTIMIZE_OUTPUT_JAVA   = NO
+OPTIMIZE_FOR_FORTRAN   = NO
+OPTIMIZE_OUTPUT_VHDL   = NO
+OPTIMIZE_OUTPUT_SLICE  = NO
+EXTENSION_MAPPING      =
+MARKDOWN_SUPPORT       = YES
+TOC_INCLUDE_HEADINGS   = 5
+AUTOLINK_SUPPORT       = YES
+BUILTIN_STL_SUPPORT    = NO
+CPP_CLI_SUPPORT        = NO
+SIP_SUPPORT            = NO
+IDL_PROPERTY_SUPPORT   = YES
+DISTRIBUTE_GROUP_DOC   = NO
+GROUP_NESTED_COMPOUNDS = NO
+SUBGROUPING            = YES
+INLINE_GROUPED_CLASSES = NO
+INLINE_SIMPLE_STRUCTS  = NO
+TYPEDEF_HIDES_STRUCT   = NO
+LOOKUP_CACHE_SIZE      = 0
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
 EXTRACT_ALL            = YES
 EXTRACT_PRIVATE        = YES
+EXTRACT_PRIV_VIRTUAL   = NO
+EXTRACT_PACKAGE        = NO
 EXTRACT_STATIC         = YES
 EXTRACT_LOCAL_CLASSES  = YES
+EXTRACT_LOCAL_METHODS  = NO
+EXTRACT_ANON_NSPACES   = NO
 HIDE_UNDOC_MEMBERS     = NO
 HIDE_UNDOC_CLASSES     = NO
-BRIEF_MEMBER_DESC      = YES
-REPEAT_BRIEF           = YES
-ALWAYS_DETAILED_SEC    = NO
-INLINE_INHERITED_MEMB  = NO
-FULL_PATH_NAMES        = NO
-STRIP_FROM_PATH        = 
+HIDE_FRIEND_COMPOUNDS  = NO
+HIDE_IN_BODY_DOCS      = NO
 INTERNAL_DOCS          = NO
-STRIP_CODE_COMMENTS    = YES
 CASE_SENSE_NAMES       = YES
-SHORT_NAMES            = NO
 HIDE_SCOPE_NAMES       = NO
-VERBATIM_HEADERS       = YES
+HIDE_COMPOUND_REFERENCE= NO
 SHOW_INCLUDE_FILES     = YES
-JAVADOC_AUTOBRIEF      = NO
-INHERIT_DOCS           = YES
+SHOW_GROUPED_MEMB_INC  = NO
+FORCE_LOCAL_INCLUDES   = NO
 INLINE_INFO            = YES
 SORT_MEMBER_DOCS       = YES
-DISTRIBUTE_GROUP_DOC   = NO
-TAB_SIZE               = 8
+SORT_BRIEF_DOCS        = NO
+SORT_MEMBERS_CTORS_1ST = NO
+SORT_GROUP_NAMES       = NO
+SORT_BY_SCOPE_NAME     = NO
+STRICT_PROTO_MATCHING  = NO
 GENERATE_TODOLIST      = YES
 GENERATE_TESTLIST      = YES
 GENERATE_BUGLIST       = YES
-ALIASES                = 
-ENABLED_SECTIONS       = 
+GENERATE_DEPRECATEDLIST= YES
+ENABLED_SECTIONS       =
 MAX_INITIALIZER_LINES  = 30
-OPTIMIZE_OUTPUT_FOR_C  = NO
 SHOW_USED_FILES        = YES
+SHOW_FILES             = YES
+SHOW_NAMESPACES        = YES
+FILE_VERSION_FILTER    =
+LAYOUT_FILE            =
+CITE_BIB_FILES         =
 #---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
+# Configuration options related to warning and progress messages
 #---------------------------------------------------------------------------
 QUIET                  = NO
 WARNINGS               = YES
 WARN_IF_UNDOCUMENTED   = YES
-WARN_FORMAT            = 
-WARN_LOGFILE           = 
+WARN_IF_DOC_ERROR      = YES
+WARN_NO_PARAMDOC       = NO
+WARN_AS_ERROR          = NO
+WARN_FORMAT            =
+WARN_LOGFILE           =
 #---------------------------------------------------------------------------
-# configuration options related to the input files
+# Configuration options related to the input files
 #---------------------------------------------------------------------------
 INPUT                  = src
-FILE_PATTERNS          = 
+INPUT_ENCODING         = UTF-8
+FILE_PATTERNS          =
 RECURSIVE              = NO
-EXCLUDE                = 
+EXCLUDE                =
 EXCLUDE_SYMLINKS       = NO
-EXCLUDE_PATTERNS       = 
-EXAMPLE_PATH           = 
-EXAMPLE_PATTERNS       = 
+EXCLUDE_PATTERNS       =
+EXCLUDE_SYMBOLS        =
+EXAMPLE_PATH           =
+EXAMPLE_PATTERNS       =
 EXAMPLE_RECURSIVE      = NO
-IMAGE_PATH             = 
-INPUT_FILTER           = 
+IMAGE_PATH             =
+INPUT_FILTER           =
+FILTER_PATTERNS        =
 FILTER_SOURCE_FILES    = NO
+FILTER_SOURCE_PATTERNS =
+USE_MDFILE_AS_MAINPAGE =
 #---------------------------------------------------------------------------
-# configuration options related to source browsing
+# Configuration options related to source browsing
 #---------------------------------------------------------------------------
 SOURCE_BROWSER         = NO
 INLINE_SOURCES         = NO
+STRIP_CODE_COMMENTS    = YES
 REFERENCED_BY_RELATION = YES
 REFERENCES_RELATION    = YES
+REFERENCES_LINK_SOURCE = YES
+SOURCE_TOOLTIPS        = YES
+USE_HTAGS              = NO
+VERBATIM_HEADERS       = YES
 #---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
+# Configuration options related to the alphabetical class index
 #---------------------------------------------------------------------------
 ALPHABETICAL_INDEX     = NO
 COLS_IN_ALPHA_INDEX    = 5
-IGNORE_PREFIX          = 
+IGNORE_PREFIX          =
 #---------------------------------------------------------------------------
-# configuration options related to the HTML output
+# Configuration options related to the HTML output
 #---------------------------------------------------------------------------
 GENERATE_HTML          = YES
-HTML_OUTPUT            = 
-HTML_HEADER            = 
-HTML_FOOTER            = 
-HTML_STYLESHEET        = 
-HTML_ALIGN_MEMBERS     = YES
+HTML_OUTPUT            =
+HTML_FILE_EXTENSION    = .html
+HTML_HEADER            =
+HTML_FOOTER            =
+HTML_STYLESHEET        =
+HTML_EXTRA_STYLESHEET  =
+HTML_EXTRA_FILES       =
+HTML_COLORSTYLE_HUE    = 220
+HTML_COLORSTYLE_SAT    = 100
+HTML_COLORSTYLE_GAMMA  = 80
+HTML_TIMESTAMP         = NO
+HTML_DYNAMIC_MENUS     = YES
+HTML_DYNAMIC_SECTIONS  = NO
+HTML_INDEX_NUM_ENTRIES = 100
+GENERATE_DOCSET        = NO
+DOCSET_FEEDNAME        = "Doxygen generated docs"
+DOCSET_BUNDLE_ID       = org.doxygen.Project
+DOCSET_PUBLISHER_ID    = org.doxygen.Publisher
+DOCSET_PUBLISHER_NAME  = Publisher
 GENERATE_HTMLHELP      = NO
+CHM_FILE               =
+HHC_LOCATION           =
 GENERATE_CHI           = NO
+CHM_INDEX_ENCODING     =
 BINARY_TOC             = NO
 TOC_EXPAND             = NO
+GENERATE_QHP           = NO
+QCH_FILE               =
+QHP_NAMESPACE          = org.doxygen.Project
+QHP_VIRTUAL_FOLDER     = doc
+QHP_CUST_FILTER_NAME   =
+QHP_CUST_FILTER_ATTRS  =
+QHP_SECT_FILTER_ATTRS  =
+QHG_LOCATION           =
+GENERATE_ECLIPSEHELP   = NO
+ECLIPSE_DOC_ID         = org.doxygen.Project
 DISABLE_INDEX          = NO
-ENUM_VALUES_PER_LINE   = 4
 GENERATE_TREEVIEW      = NO
+ENUM_VALUES_PER_LINE   = 4
 TREEVIEW_WIDTH         = 250
+EXT_LINKS_IN_WINDOW    = NO
+FORMULA_FONTSIZE       = 10
+FORMULA_TRANSPARENT    = YES
+USE_MATHJAX            = NO
+MATHJAX_FORMAT         = HTML-CSS
+MATHJAX_RELPATH        = https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/
+MATHJAX_EXTENSIONS     =
+MATHJAX_CODEFILE       =
+SEARCHENGINE           = NO
+SERVER_BASED_SEARCH    = NO
+EXTERNAL_SEARCH        = NO
+SEARCHENGINE_URL       =
+SEARCHDATA_FILE        = searchdata.xml
+EXTERNAL_SEARCH_ID     =
+EXTRA_SEARCH_MAPPINGS  =
 #---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
+# Configuration options related to the LaTeX output
 #---------------------------------------------------------------------------
 GENERATE_LATEX         = NO
-LATEX_OUTPUT           = 
+LATEX_OUTPUT           =
+LATEX_CMD_NAME         =
+MAKEINDEX_CMD_NAME     = makeindex
+LATEX_MAKEINDEX_CMD    = makeindex
 COMPACT_LATEX          = NO
 PAPER_TYPE             = a4wide
-EXTRA_PACKAGES         = 
-LATEX_HEADER           = 
+EXTRA_PACKAGES         =
+LATEX_HEADER           =
+LATEX_FOOTER           =
+LATEX_EXTRA_STYLESHEET =
+LATEX_EXTRA_FILES      =
 PDF_HYPERLINKS         = NO
 USE_PDFLATEX           = NO
 LATEX_BATCHMODE        = NO
+LATEX_HIDE_INDICES     = NO
+LATEX_SOURCE_CODE      = NO
+LATEX_BIB_STYLE        = plain
+LATEX_TIMESTAMP        = NO
+LATEX_EMOJI_DIRECTORY  =
 #---------------------------------------------------------------------------
-# configuration options related to the RTF output
+# Configuration options related to the RTF output
 #---------------------------------------------------------------------------
 GENERATE_RTF           = NO
-RTF_OUTPUT             = 
+RTF_OUTPUT             =
 COMPACT_RTF            = NO
 RTF_HYPERLINKS         = NO
-RTF_STYLESHEET_FILE    = 
-RTF_EXTENSIONS_FILE    = 
+RTF_STYLESHEET_FILE    =
+RTF_EXTENSIONS_FILE    =
+RTF_SOURCE_CODE        = NO
 #---------------------------------------------------------------------------
-# configuration options related to the man page output
+# Configuration options related to the man page output
 #---------------------------------------------------------------------------
 GENERATE_MAN           = NO
-MAN_OUTPUT             = 
-MAN_EXTENSION          = 
+MAN_OUTPUT             =
+MAN_EXTENSION          =
+MAN_SUBDIR             =
 MAN_LINKS              = NO
 #---------------------------------------------------------------------------
-# configuration options related to the XML output
+# Configuration options related to the XML output
 #---------------------------------------------------------------------------
 GENERATE_XML           = YES
+XML_OUTPUT             = xml
+XML_PROGRAMLISTING     = YES
+XML_NS_MEMB_FILE_SCOPE = NO
+#---------------------------------------------------------------------------
+# Configuration options related to the DOCBOOK output
+#---------------------------------------------------------------------------
+GENERATE_DOCBOOK       = NO
+DOCBOOK_OUTPUT         = docbook
+DOCBOOK_PROGRAMLISTING = NO
 #---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
+# Configuration options for the AutoGen Definitions output
 #---------------------------------------------------------------------------
 GENERATE_AUTOGEN_DEF   = NO
 #---------------------------------------------------------------------------
-# Configuration options related to the preprocessor   
+# Configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+GENERATE_PERLMOD       = NO
+PERLMOD_LATEX          = NO
+PERLMOD_PRETTY         = YES
+PERLMOD_MAKEVAR_PREFIX =
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
 #---------------------------------------------------------------------------
 ENABLE_PREPROCESSING   = YES
 MACRO_EXPANSION        = YES
 EXPAND_ONLY_PREDEF     = YES
 SEARCH_INCLUDES        = YES
-INCLUDE_PATH           = 
-INCLUDE_FILE_PATTERNS  = 
-PREDEFINED             = 
+INCLUDE_PATH           =
+INCLUDE_FILE_PATTERNS  =
+PREDEFINED             =
 EXPAND_AS_DEFINED      = DEFINE_CLS_IMPL
 SKIP_FUNCTION_MACROS   = YES
 #---------------------------------------------------------------------------
-# Configuration::addtions related to external references   
+# Configuration options related to external references
 #---------------------------------------------------------------------------
 TAGFILES               = ../../qtools_docs/qtools.tag=../../../../qtools_docs/html
-GENERATE_TAGFILE       = 
+GENERATE_TAGFILE       =
 ALLEXTERNALS           = NO
 EXTERNAL_GROUPS        = YES
+EXTERNAL_PAGES         = YES
 #---------------------------------------------------------------------------
-# Configuration options related to the dot tool   
+# Configuration options related to the dot tool
 #---------------------------------------------------------------------------
 CLASS_DIAGRAMS         = NO
+DIA_PATH               =
+HIDE_UNDOC_RELATIONS   = YES
 HAVE_DOT               = YES
+DOT_NUM_THREADS        = 0
+DOT_FONTNAME           = Helvetica
+DOT_FONTSIZE           = 10
+DOT_FONTPATH           =
 CLASS_GRAPH            = YES
 COLLABORATION_GRAPH    = YES
+GROUP_GRAPHS           = YES
+UML_LOOK               = NO
+UML_LIMIT_NUM_FIELDS   = 10
 TEMPLATE_RELATIONS     = YES
-HIDE_UNDOC_RELATIONS   = YES
 INCLUDE_GRAPH          = YES
 INCLUDED_BY_GRAPH      = YES
+CALL_GRAPH             = NO
+CALLER_GRAPH           = NO
 GRAPHICAL_HIERARCHY    = YES
-DOT_PATH               = 
-DOTFILE_DIRS           = 
-MAX_DOT_GRAPH_WIDTH    = 1280
-MAX_DOT_GRAPH_HEIGHT   = 1024
+DIRECTORY_GRAPH        = YES
+DOT_IMAGE_FORMAT       = png
+INTERACTIVE_SVG        = NO
+DOT_PATH               =
+DOTFILE_DIRS           =
+MSCFILE_DIRS           =
+DIAFILE_DIRS           =
+PLANTUML_JAR_PATH      =
+PLANTUML_CFG_FILE      =
+PLANTUML_INCLUDE_PATH  =
+DOT_GRAPH_MAX_NODES    = 50
+MAX_DOT_GRAPH_DEPTH    = 0
+DOT_TRANSPARENT        = NO
+DOT_MULTI_TARGETS      = NO
 GENERATE_LEGEND        = YES
 DOT_CLEANUP            = YES
-#---------------------------------------------------------------------------
-# Configuration::addtions related to the search engine   
-#---------------------------------------------------------------------------
-SEARCHENGINE           = NO
-CGI_NAME               = 
-CGI_URL                = 
-DOC_URL                = 
-DOC_ABSPATH            = 
-BIN_ABSPATH            = 
-EXT_DOC_PATHS          = 
index 22cecdb..cb4a9eb 100644 (file)
@@ -1114,7 +1114,7 @@ class IDoxygen
     virtual ICompoundIterator *memberByName(const char * name) const = 0;
 
     /*! Releases the memory for the object hierarchy obtained by 
-     *  createdObjecModelFromXML(). First release all iterators before calling
+     *  createdObjectModel(). First release all iterators before calling
      *  this function.
      */
     virtual void release() = 0;
index a82114d..1772d8a 100644 (file)
@@ -57,7 +57,7 @@ template<class T> class ElementMapper
          void operator()(const QXmlAttributes &attrib) 
            { if (m_parent) (m_parent->*m_handler)(attrib); }
        private:
-         T *m_parent;
+         T *m_parent = 0;
          Handler m_handler;
     };
 
@@ -71,7 +71,7 @@ template<class T> class ElementMapper
         void operator()() 
           { if (m_parent) (m_parent->*m_handler)(); }
       private:
-        T *m_parent;
+        T *m_parent = 0;
         Handler m_handler;
     };
 
@@ -277,9 +277,9 @@ template<class T> class BaseHandler : public QXmlDefaultHandler,
   protected:
     QString                     m_curString;
     QString                     m_skipUntil;
-    int                         m_skipCount;
-    QXmlDefaultHandler         *m_delegateHandler;
-    IFallBackHandler           *m_fallBackHandler;
+    int                         m_skipCount = 0;
+    QXmlDefaultHandler         *m_delegateHandler = 0;
+    IFallBackHandler           *m_fallBackHandler = 0;
 };
 
 //-----------------------------------------------------------------------------
index 077c8fb..69fb70c 100644 (file)
@@ -86,7 +86,7 @@ class CompoundIdIterator : public ICompoundIterator,
     { delete this; }
 
   private:
-    const MainHandler *m_mainHandler;
+    const MainHandler *m_mainHandler = 0;
 };
 
 //----------------------------------------------------------------------------
index b05ba3d..6f191dc 100644 (file)
@@ -54,10 +54,10 @@ class IncludeHandler : public IInclude, public BaseHandler<IncludeHandler>
     { return m_isLocal; }
 
   private:
-    IBaseHandler *m_parent;
+    IBaseHandler *m_parent = 0;
     StringImpl m_name;             // element's content
     StringImpl m_refId;            // refid
-    bool m_isLocal;                // local
+    bool m_isLocal = false;        // local
 };
 
 class IncludeIterator : public BaseIterator<IIncludeIterator,IInclude,IncludeHandler>
@@ -86,10 +86,10 @@ class RelatedCompound : public IRelatedCompound
     virtual const IString *name() const { return &m_name; }
     
   private:  
-    CompoundHandler *m_parent;
+    CompoundHandler *m_parent = 0;
     QString m_id;                  // refid
-    Protection m_protection;       // prot
-    Kind m_kind;                   // virt
+    Protection m_protection = Public; // prot
+    Kind m_kind = Normal;          // virt
     StringImpl m_name;             // element's content
 };
 
@@ -193,42 +193,42 @@ class CompoundHandler : public IClass,
                                                                 // XML elements:
                                                                 // -------------
     StringImpl                     m_name;                      // compoundname
-    TitleHandler*                  m_titleHandler;              // title
+    TitleHandler*                  m_titleHandler = 0;              // title
     QList<RelatedCompound>         m_subClasses;                // basecompoundref
     QList<RelatedCompound>         m_superClasses;              // derivedcompoundref
     QList<IncludeHandler>          m_includes;                  // includes
     QList<IncludeHandler>          m_includedBy;                // includedBy
-    GraphHandler*                  m_includeDependencyGraph;    // incdepgraph
-    GraphHandler*                  m_includedByDependencyGraph; // invincdepgraph
+    GraphHandler*                  m_includeDependencyGraph = 0;// incdepgraph
+    GraphHandler*                  m_includedByDependencyGraph = 0; // invincdepgraph
     QList<QString>                 m_innerCompounds;            // innerdir/innerfile/innerclass/innernamespace/innergroup
     TemplateParamListHandler*      m_templateParamList;         // templateparamlist
     QList<SectionHandler>          m_sections;                  // sectiondef
-    DocHandler*                    m_brief;                     // briefdescription
-    DocHandler*                    m_detailed;                  // detaileddescription
-    GraphHandler*                  m_inheritanceGraph;          // inheritancegraph
-    GraphHandler*                  m_collaborationGraph;        // collaborationgraph
-    ProgramListingHandler*         m_programListing;            // programlisting
+    DocHandler*                    m_brief = 0;                 // briefdescription
+    DocHandler*                    m_detailed = 0;              // detaileddescription
+    GraphHandler*                  m_inheritanceGraph = 0;      // inheritancegraph
+    GraphHandler*                  m_collaborationGraph = 0;    // collaborationgraph
+    ProgramListingHandler*         m_programListing = 0;        // programlisting
                                                                 // location
     StringImpl                     m_defFile;                   // - file
-    int                            m_defLine;                   // - line
+    int                            m_defLine = 0;               // - line
     StringImpl                     m_defBodyFile;               // - bodyfile
-    int                            m_defBodyStart;              // - bodystart 
-    int                            m_defBodyEnd;                // - bodyend
-    ListOfAllMembersHandler*       m_members;                   // listofallmember
+    int                            m_defBodyStart = 0;          // - bodystart 
+    int                            m_defBodyEnd = 0;            // - bodyend
+    ListOfAllMembersHandler*       m_members = 0;               // listofallmember
 
                                                                 // XML attributes:
                                                                 // ---------------
     StringImpl                     m_id;                        // id
-    CompoundKind                   m_kind;                      // kind
+    CompoundKind                   m_kind = Invalid;            // kind
     StringImpl                     m_kindString;                // kind as a string
     StringImpl                     m_protection;                // prot
 
     // local variables
     QString                        m_xmlDir;                    // directory where the info is found
-    int                            m_refCount;                  // object reference counter
+    int                            m_refCount = 0;              // object reference counter
     QDict<MemberHandler>           m_memberDict;                // id->member lookup
     QDict<QList<MemberHandler> >   m_memberNameDict;            // name->memberlist lookup
-    MainHandler*                   m_mainHandler;               // parent object
+    MainHandler*                   m_mainHandler = 0;           // parent object
 };
 
 void compoundhandler_init();
index b774f0f..140a48b 100644 (file)
@@ -51,7 +51,7 @@ class LT_Ref : public LinkedTextImpl, public ILT_Ref
     StringImpl    m_refId;
     StringImpl    m_extId;
     StringImpl    m_text;
-    TargetKind m_targetKind;
+    TargetKind m_targetKind = TargetKind::Member;
 };
 
 LinkedTextHandler::LinkedTextHandler(IBaseHandler *parent,
index 6042f91..df8c04f 100644 (file)
@@ -453,7 +453,7 @@ void MemberHandler::startArgsString(const QXmlAttributes&)
 void MemberHandler::endArgsString()
 {
   m_argsstring = m_curString.stripWhiteSpace();
-  debug(2,"arggstring=%s\n",m_argsstring.data());
+  debug(2,"argstring=%s\n",m_argsstring.data());
 }
   
 void MemberHandler::startParam(const QXmlAttributes& attrib)
index 70c79da..0d1f95e 100644 (file)
@@ -707,7 +707,7 @@ int main(int argc,char **argv)
       printf("==== inheritance graph ==== \n");
       DumpGraph(cls->inheritanceGraph());
 
-      printf("==== collabration graph ==== \n");
+      printf("==== collaboration graph ==== \n");
       DumpGraph(cls->collaborationGraph());
 
       printf("==== base classes ==== \n");
index c18f907..edd39e3 100644 (file)
@@ -109,19 +109,19 @@ class XRefDummyCodeGenerator : public CodeOutputInterface
 static void findXRefSymbols(FileDef *fd)
 {
   // get the interface to a parser that matches the file extension
-  ParserInterface *pIntf=Doxygen::parserManager->getParser(fd->getDefFileExtension());
+  CodeParserInterface &intf=Doxygen::parserManager->getCodeParser(fd->getDefFileExtension());
 
   // get the programming language from the file name
   SrcLangExt lang = getLanguageFromFileName(fd->name());
 
   // reset the parsers state
-  pIntf->resetCodeParserState();
+  intf.resetCodeParserState();
 
   // create a new backend object 
   XRefDummyCodeGenerator *xrefGen = new XRefDummyCodeGenerator(fd);
 
   // parse the source code
-  pIntf->parseCode(*xrefGen,
+  intf.parseCode(*xrefGen,
                 0,
                 fileToString(fd->absFilePath()),
                 lang,
index 592ac42..59b560f 100644 (file)
@@ -89,19 +89,19 @@ static bool is_c_code = true;
 static void findXRefSymbols(FileDef *fd)
 {
   // get the interface to a parser that matches the file extension
-  ParserInterface *pIntf=Doxygen::parserManager->getParser(fd->getDefFileExtension());
+  CodeParserInterface &intf=Doxygen::parserManager->getCodeParser(fd->getDefFileExtension());
 
   // get the programming language from the file name
   SrcLangExt lang = getLanguageFromFileName(fd->name());
 
   // reset the parsers state
-  pIntf->resetCodeParserState();
+  intf.resetCodeParserState();
 
   // create a new backend object
   Doxyparse *parse = new Doxyparse(fd);
 
   // parse the source code
-  pIntf->parseCode(*parse, 0, fileToString(fd->absFilePath()), lang, FALSE, 0, fd);
+  intf.parseCode(*parse, 0, fileToString(fd->absFilePath()), lang, FALSE, 0, fd);
 
   // dismiss the object.
   delete parse;
@@ -183,28 +183,25 @@ std::string sanitizeString(std::string data) {
   return !new_data.isEmpty() ? new_data.data() : "";
 }
 
-std::string argumentData(Argument *argument) {
+std::string argumentData(const Argument &argument) {
   std::string data = "";
-  if (argument->type != NULL && argument->type.size() > 1)
-    data = sanitizeString(argument->type.data());
-  else if (argument->name != NULL)
-    data = sanitizeString(argument->name.data());
+  if (argument.type.size() > 1)
+    data = sanitizeString(argument.type.data());
+  else if (!argument.name.isEmpty())
+    data = sanitizeString(argument.name.data());
   return data;
 }
 
 std::string functionSignature(MemberDef* md) {
   std::string signature = sanitizeString(md->name().data());
   if(md->isFunction()){
-    ArgumentList *argList = md->argumentList();
+    const ArgumentList &argList = md->argumentList();
     signature += "(";
-    if (argList) {
-      ArgumentListIterator iterator(*argList);
-      Argument * argument = iterator.toFirst();
-      if(argument != NULL) {
-        signature += argumentData(argument);
-        for(++iterator; (argument = iterator.current()); ++iterator) {
-          signature += std::string(",") + argumentData(argument);
-        }
+    auto it = argList.begin();
+    if(it!=argList.end()) {
+      signature += argumentData(*it);
+      for(++it; it!=argList.end(); ++it) {
+        signature += std::string(",") + argumentData(*it);
       }
     }
     signature += ")";
@@ -255,19 +252,14 @@ void cModule(ClassDef* cd) {
   }
 }
 
-static bool checkOverrideArg(ArgumentList *argList, MemberDef *md) {
-  ArgumentListIterator iterator(*argList);
-  Argument * argument = iterator.toFirst();
-
-  if(!md->isFunction() || argList->count() == 0){
-      return false;
+static bool checkOverrideArg(const ArgumentList &argList, MemberDef *md) {
+  if(!md->isFunction() || argList.empty()){
+    return false;
   }
 
-  if(argument != NULL) {
-    for(; (argument = iterator.current()); ++iterator){
-        if(md->name() == argument->name) {
-            return true;
-        }
+  for (const Argument &argument : argList) {
+    if(md->name() == argument.name) {
+      return true;
     }
   }
 
@@ -278,17 +270,15 @@ void functionInformation(MemberDef* md) {
   std::string temp = "";
   int size = md->getEndBodyLine() - md->getStartBodyLine() + 1;
   printNumberOfLines(size);
-  ArgumentList *argList = md->argumentList();
-  if (argList) {
-      ArgumentListIterator iterator(*argList);
-      Argument * argument = iterator.toFirst();
-      if(argument != NULL) {
-        temp = argumentData(argument);
+  const ArgumentList &argList = md->argumentList();
+  if (!argList.empty())
+  {
+    temp = argumentData(argList.front());
 // TODO: This is a workaround; better not include "void" in argList, in the first place. 
-          if(temp != "void") {
-              printNumberOfArguments(argList->count());
-          }
-      }
+    if (temp!="void")
+    {
+      printNumberOfArguments(argList.size());
+    }
   }
 
   printNumberOfConditionalPaths(md);
index 6ae71a6..6aacd8b 100644 (file)
@@ -31,7 +31,6 @@ endif()
 include_directories(
        .
         ${CMAKE_SOURCE_DIR}/libversion
-       ${CMAKE_SOURCE_DIR}/src
        ${CMAKE_SOURCE_DIR}/qtools
        ${GENERATED_SRC}
 )
@@ -72,7 +71,17 @@ OUTPUT ${GENERATED_SRC_WIZARD}/configdoc.cpp
 )
 set_source_files_properties(${GENERATED_SRC_WIZARD}/configdoc.cpp PROPERTIES GENERATED 1)
 
-FLEX_TARGET(config_doxyw config_doxyw.l ${GENERATED_SRC_WIZARD}/config_doxyw.cpp COMPILE_FLAGS "${LEX_FLAGS}")
+set(LEX_FILES config_doxyw) 
+foreach(lex_file ${LEX_FILES})
+    add_custom_command(
+           COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/scan_states.py ${CMAKE_SOURCE_DIR}/addon/doxywizard/${lex_file}.l > ${GENERATED_SRC_WIZARD}/${lex_file}.l.h
+        DEPENDS ${CMAKE_SOURCE_DIR}/src/scan_states.py ${CMAKE_SOURCE_DIR}/addon/doxywizard/${lex_file}.l
+       OUTPUT  ${GENERATED_SRC_WIZARD}/${lex_file}.l.h
+    )
+    set_source_files_properties(${GENERATED_SRC_WIZARD}/${lex_file}.l.h PROPERTIES GENERATED 1)
+
+    FLEX_TARGET(${lex_file}        ${lex_file}.l        ${GENERATED_SRC_WIZARD}/${lex_file}.cpp        COMPILE_FLAGS "${LEX_FLAGS}")
+endforeach()
 
 qt_wrap_cpp(doxywizard_MOC
 doxywizard.h
@@ -97,6 +106,7 @@ inputint.cpp
 inputstrlist.cpp
 ${GENERATED_SRC_WIZARD}/settings.h
 ${GENERATED_SRC_WIZARD}/config_doxyw.cpp
+${GENERATED_SRC_WIZARD}/config_doxyw.l.h
 ${GENERATED_SRC_WIZARD}/configdoc.cpp
 ${doxywizard_MOC}
 ${doxywizard_RESOURCES_RCC}
index 147056a..378ed13 100644 (file)
@@ -1,3 +1,15 @@
+/******************************************************************************
+ *
+ * Copyright (C) 1997-2019 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby 
+ * granted. No representations are made about the suitability of this software 
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+
 #ifndef CONFIG_H
 #define CONFIG_H
 
index 8549e6b..59fa427 100644 (file)
@@ -1,8 +1,6 @@
 /******************************************************************************
  *
- * $Id: config_templ.l,v 1.8 2001/01/01 10:15:16 root Exp $
- *
- * Copyright (C) 1997-2015 by Dimitri van Heesch.
+ * Copyright (C) 1997-2019 by Dimitri van Heesch.
  *
  * Permission to use, copy, modify, and distribute this software and its
  * documentation under the terms of the GNU General Public License is hereby 
@@ -66,6 +64,8 @@ static QString                        g_codecName = QString::fromLatin1("UTF-8")
 static int                            g_lastState;
 static QByteArray                     g_tmpString;
 
+static const char *stateToString(int state);
+
 /* -----------------------------------------------------------------
  */
 #undef YY_INPUT
@@ -587,4 +587,4 @@ void writeStringValue(QTextStream &t,QTextCodec *codec,const QString &s)
     }
   }
 }
-
+#include "config_doxyw.l.h"
index 97ed6c3..fa3bca7 100644 (file)
@@ -1,3 +1,15 @@
+/******************************************************************************
+ *
+ * Copyright (C) 1997-2019 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby 
+ * granted. No representations are made about the suitability of this software 
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+
 #ifndef CONFIGDOC_H
 #define CONFIGDOC_H
 
index 6c0ff26..ee54bda 100644 (file)
@@ -1,3 +1,15 @@
+/******************************************************************************
+ *
+ * Copyright (C) 1997-2019 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby 
+ * granted. No representations are made about the suitability of this software 
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+
 #ifndef DOCINTF_H
 #define DOCINTF_H
 
index 02e8cd0..dc0a6dc 100755 (executable)
@@ -1,3 +1,15 @@
+/******************************************************************************
+ *
+ * Copyright (C) 1997-2019 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby 
+ * granted. No representations are made about the suitability of this software 
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+
 #include "doxywizard.h"
 #include "version.h"
 #include "expert.h"
@@ -218,7 +230,7 @@ void MainWindow::about()
   t << QString::fromLatin1("<qt><center>A tool to configure and run doxygen version ")+
        QString::fromLatin1(getVersion())+
        QString::fromLatin1(" on your source files.</center><p><br>"
-       "<center>Written by<br> Dimitri van Heesch<br>&copy; 2000-2015</center><p>"
+       "<center>Written by<br> Dimitri van Heesch<br>&copy; 2000-2019</center><p>"
        "</qt>");
   QMessageBox::about(this,tr("Doxygen GUI"),msg);
 }
index 49b7c02..c64941e 100755 (executable)
@@ -1,3 +1,15 @@
+/******************************************************************************
+ *
+ * Copyright (C) 1997-2019 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby 
+ * granted. No representations are made about the suitability of this software 
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+
 #ifndef DOXYWIZARD_H
 #define DOXYWIZARD_H
 
index c875d8d..1303a22 100644 (file)
@@ -1,3 +1,15 @@
+/******************************************************************************
+ *
+ * Copyright (C) 1997-2019 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby 
+ * granted. No representations are made about the suitability of this software 
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+
 #include "expert.h"
 #include "inputbool.h"
 #include "inputstring.h"
@@ -386,6 +398,7 @@ static QString getDocsForNode(const QDomElement &child)
 
   // Remove / replace doxygen markup strings
   // the regular expressions are hard to read so the intention will be given
+  // Note: see also configgen.py in the src directory for other doxygen parts
   QRegExp regexp;
   // remove \n at end and replace by a space
   regexp.setPattern(SA("\\n$"));
@@ -420,6 +433,8 @@ static QString getDocsForNode(const QDomElement &child)
   docs.replace(regexp,SA("\"External Indexing and Searching\""));
   regexp.setPattern(SA("\\\\ref[ ]+external"));
   docs.replace(regexp,SA("\"Linking to external documentation\""));
+  regexp.setPattern(SA("\\\\ref[ ]+formulas"));
+  docs.replace(regexp,SA("\"Including formulas\""));
   // fallback for not handled
   docs.replace(SA("\\\\ref"),SA(""));
   // \b word -> <b>word<\b>
index ff571cb..f58ef62 100644 (file)
@@ -1,3 +1,15 @@
+/******************************************************************************
+ *
+ * Copyright (C) 1997-2019 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby 
+ * granted. No representations are made about the suitability of this software 
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+
 #ifndef EXPERT_H
 #define EXPERT_H
 
index 07e2932..362ebcd 100644 (file)
@@ -1,3 +1,15 @@
+/******************************************************************************
+ *
+ * Copyright (C) 1997-2019 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby 
+ * granted. No representations are made about the suitability of this software 
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+
 #ifndef HELPLABEL_H
 #define HELPLABEL_H
 
index 5d86cc8..ff8339a 100644 (file)
@@ -1,3 +1,15 @@
+/******************************************************************************
+ *
+ * Copyright (C) 1997-2019 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby 
+ * granted. No representations are made about the suitability of this software 
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+
 #ifndef INPUT_H
 #define INPUT_H
 
index ef71dd9..63d9998 100644 (file)
@@ -1,8 +1,6 @@
 /******************************************************************************
  *
- * 
- *
- * Copyright (C) 1997-2015 by Dimitri van Heesch.
+ * Copyright (C) 1997-2019 by Dimitri van Heesch.
  *
  * Permission to use, copy, modify, and distribute this software and its
  * documentation under the terms of the GNU General Public License is hereby 
index 5a90477..98f7f85 100644 (file)
@@ -1,8 +1,6 @@
 /******************************************************************************
  *
- * 
- *
- * Copyright (C) 1997-2015 by Dimitri van Heesch.
+ * Copyright (C) 1997-2019 by Dimitri van Heesch.
  *
  * Permission to use, copy, modify, and distribute this software and its
  * documentation under the terms of the GNU General Public License is hereby 
index a57e7f4..2aa019b 100644 (file)
@@ -1,8 +1,6 @@
 /******************************************************************************
  *
- * 
- *
- * Copyright (C) 1997-2015 by Dimitri van Heesch.
+ * Copyright (C) 1997-2019 by Dimitri van Heesch.
  *
  * Permission to use, copy, modify, and distribute this software and its
  * documentation under the terms of the GNU General Public License is hereby 
index 457c942..10d735e 100644 (file)
@@ -1,8 +1,6 @@
 /******************************************************************************
  *
- * 
- *
- * Copyright (C) 1997-2015 by Dimitri van Heesch.
+ * Copyright (C) 1997-2019 by Dimitri van Heesch.
  *
  * Permission to use, copy, modify, and distribute this software and its
  * documentation under the terms of the GNU General Public License is hereby 
index 7fb6ec3..5c0f2c9 100644 (file)
@@ -1,8 +1,6 @@
 /******************************************************************************
  *
- * 
- *
- * Copyright (C) 1997-2015 by Dimitri van Heesch.
+ * Copyright (C) 1997-2019 by Dimitri van Heesch.
  *
  * Permission to use, copy, modify, and distribute this software and its
  * documentation under the terms of the GNU General Public License is hereby 
index 6234256..4f4a7f7 100644 (file)
@@ -1,8 +1,6 @@
 /******************************************************************************
  *
- * 
- *
- * Copyright (C) 1997-2015 by Dimitri van Heesch.
+ * Copyright (C) 1997-2019 by Dimitri van Heesch.
  *
  * Permission to use, copy, modify, and distribute this software and its
  * documentation under the terms of the GNU General Public License is hereby 
index 822bc4c..dd1ecb2 100644 (file)
@@ -1,8 +1,6 @@
 /******************************************************************************
  *
- * 
- *
- * Copyright (C) 1997-2015 by Dimitri van Heesch.
+ * Copyright (C) 1997-2019 by Dimitri van Heesch.
  *
  * Permission to use, copy, modify, and distribute this software and its
  * documentation under the terms of the GNU General Public License is hereby 
index c374092..adb0fb0 100644 (file)
@@ -1,8 +1,6 @@
 /******************************************************************************
  *
- * 
- *
- * Copyright (C) 1997-2015 by Dimitri van Heesch.
+ * Copyright (C) 1997-2019 by Dimitri van Heesch.
  *
  * Permission to use, copy, modify, and distribute this software and its
  * documentation under the terms of the GNU General Public License is hereby 
index ae8fa61..2233379 100644 (file)
@@ -1,3 +1,15 @@
+/******************************************************************************
+ *
+ * Copyright (C) 1997-2019 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby 
+ * granted. No representations are made about the suitability of this software 
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+
 #include "wizard.h"
 #include "input.h"
 #include "doxywizard.h"
index 11a42be..810ab95 100644 (file)
@@ -1,8 +1,6 @@
 /******************************************************************************
  *
- * 
- *
- * Copyright (C) 1997-2015 by Dimitri van Heesch.
+ * Copyright (C) 1997-2019 by Dimitri van Heesch.
  *
  * Permission to use, copy, modify, and distribute this software and its
  * documentation under the terms of the GNU General Public License is hereby 
@@ -52,11 +50,11 @@ class TuneColorDialog : public QDialog
     void updateImage(int hue,int sat,int val);
 
   private:
-    QImage *m_image;
-    QLabel *m_imageLab;
-    int m_hue;
-    int m_sat;
-    int m_gam;
+    QImage *m_image = 0;
+    QLabel *m_imageLab = 0;
+    int m_hue = 0;
+    int m_sat = 0;
+    int m_gam = 0;
 };
 
 class ColorPicker : public QWidget
@@ -91,11 +89,11 @@ private:
     void setSat(int v);
     void setGam(int v);
 
-    QPixmap *m_pix;
-    Mode m_mode;
-    int m_gam;
-    int m_hue;
-    int m_sat;
+    QPixmap *m_pix = 0;
+    Mode m_mode = Hue;
+    int m_gam = 0;
+    int m_hue = 0;
+    int m_sat = 0;
 
 };
 
@@ -120,16 +118,16 @@ class Step1 : public QWidget
     void setRecursiveScan(int);
 
   private:
-    QLineEdit *m_projName;
-    QLineEdit *m_projBrief;
-    QLineEdit *m_projNumber;
-    QLineEdit *m_sourceDir;
-    QLineEdit *m_destDir;
-    QLabel    *m_projIconLab;
-    QCheckBox *m_recursive;
-    QPushButton *m_srcSelectDir;
-    QPushButton *m_dstSelectDir;
-    Wizard    *m_wizard;
+    QLineEdit *m_projName = 0;
+    QLineEdit *m_projBrief = 0;
+    QLineEdit *m_projNumber = 0;
+    QLineEdit *m_sourceDir = 0;
+    QLineEdit *m_destDir = 0;
+    QLabel    *m_projIconLab = 0;
+    QCheckBox *m_recursive = 0;
+    QPushButton *m_srcSelectDir = 0;
+    QPushButton *m_dstSelectDir = 0;
+    Wizard    *m_wizard = 0;
     const QHash<QString,Input *> &m_modelData;
 };
 
@@ -146,12 +144,12 @@ class Step2 : public QWidget
     void changeCrossRefState(int choice);
 
   private:
-    QGroupBox    *m_extractMode;
-    QGroupBox    *m_optimizeLang;
-    QButtonGroup *m_extractModeGroup;
-    QButtonGroup *m_optimizeLangGroup;
-    QCheckBox    *m_crossRef;
-    Wizard       *m_wizard;
+    QGroupBox    *m_extractMode = 0;
+    QGroupBox    *m_optimizeLang = 0;
+    QButtonGroup *m_extractModeGroup = 0;
+    QButtonGroup *m_optimizeLangGroup = 0;
+    QCheckBox    *m_crossRef = 0;
+    Wizard       *m_wizard = 0;
     const QHash<QString,Input *> &m_modelData;
 };
 
@@ -175,18 +173,18 @@ class Step3 : public QWidget
     void tuneColorDialog();
 
   private:
-    QGroupBox *m_texOptions;
-    QButtonGroup *m_texOptionsGroup;
-    QGroupBox *m_htmlOptions;
-    QButtonGroup *m_htmlOptionsGroup;
-    QCheckBox *m_htmlEnabled;
-    QCheckBox *m_latexEnabled;
-    QCheckBox *m_manEnabled;
-    QCheckBox *m_rtfEnabled;
-    QCheckBox *m_xmlEnabled;
-    QCheckBox *m_searchEnabled;
-    QPushButton *m_tuneColor;
-    Wizard    *m_wizard;
+    QGroupBox *m_texOptions = 0;
+    QButtonGroup *m_texOptionsGroup = 0;
+    QGroupBox *m_htmlOptions = 0;
+    QButtonGroup *m_htmlOptionsGroup = 0;
+    QCheckBox *m_htmlEnabled = 0;
+    QCheckBox *m_latexEnabled = 0;
+    QCheckBox *m_manEnabled = 0;
+    QCheckBox *m_rtfEnabled = 0;
+    QCheckBox *m_xmlEnabled = 0;
+    QCheckBox *m_searchEnabled = 0;
+    QPushButton *m_tuneColor = 0;
+    Wizard    *m_wizard = 0;
     const QHash<QString,Input *> &m_modelData;
 };
 
@@ -209,17 +207,17 @@ class Step4 : public QWidget
     void setCallerGraphEnabled(int state);
 
   private:
-    QGroupBox *m_diagramMode;
-    QButtonGroup *m_diagramModeGroup;
-    QGroupBox *m_dotGroup;
-    QCheckBox *m_dotClass;
-    QCheckBox *m_dotCollaboration;
-    QCheckBox *m_dotInclude;
-    QCheckBox *m_dotIncludedBy;
-    QCheckBox *m_dotInheritance;
-    QCheckBox *m_dotCall;
-    QCheckBox *m_dotCaller;
-    Wizard    *m_wizard;
+    QGroupBox *m_diagramMode = 0;
+    QButtonGroup *m_diagramModeGroup = 0;
+    QGroupBox *m_dotGroup = 0;
+    QCheckBox *m_dotClass = 0;
+    QCheckBox *m_dotCollaboration = 0;
+    QCheckBox *m_dotInclude = 0;
+    QCheckBox *m_dotIncludedBy = 0;
+    QCheckBox *m_dotInheritance = 0;
+    QCheckBox *m_dotCall = 0;
+    QCheckBox *m_dotCaller = 0;
+    Wizard    *m_wizard = 0;
     const QHash<QString,Input *> &m_modelData;
 };
 
@@ -243,14 +241,14 @@ class Wizard : public QSplitter
 
   private:
     const QHash<QString,Input *> &m_modelData;
-    QTreeWidget    *m_treeWidget;
-    QStackedWidget *m_topicStack;
-    Step1          *m_step1;
-    Step2          *m_step2;
-    Step3          *m_step3;
-    Step4          *m_step4;
-    QPushButton    *m_next;
-    QPushButton    *m_prev;
+    QTreeWidget    *m_treeWidget = 0;
+    QStackedWidget *m_topicStack = 0;
+    Step1          *m_step1 = 0;
+    Step2          *m_step2 = 0;
+    Step3          *m_step3 = 0;
+    Step4          *m_step4 = 0;
+    QPushButton    *m_next = 0;
+    QPushButton    *m_prev = 0;
 };
 
 #endif
index d18474f..7969be0 100644 (file)
@@ -29,9 +29,9 @@ init:
 install:
   # Static url: https://github.com/MiKTeX/miktex/issues/321#issuecomment-496286866
   # The setup is small enough, and does not need to be cached
-  - appveyor DownloadFile  https://miktex.org/download/win/miktexsetup-x64.zip
+  - appveyor-retry appveyor DownloadFile  https://miktex.org/download/win/miktexsetup-x64.zip
   - 7z e miktexsetup-x64.zip
-  - miktexsetup.exe --local-package-repository=C:\miktex-repository --package-set=essential download
+  - appveyor-retry miktexsetup.exe --local-package-repository=C:\miktex-repository --package-set=essential download
   - miktexsetup.exe --local-package-repository=C:\miktex-repository --package-set=essential --shared install
   - refreshenv
   - pip install conan
diff --git a/cmake/FindJavacc.cmake b/cmake/FindJavacc.cmake
new file mode 100755 (executable)
index 0000000..c7de776
--- /dev/null
@@ -0,0 +1,10 @@
+
+find_program(JAVACC_EXECUTABLE NAMES javacc javaCC Javacc JavaCC javacc.bat DOC "path to the javacc executable")
+mark_as_advanced(JAVACC_EXECUTABLE)
+if(JAVACC_EXECUTABLE)
+  set(JAVACC_FOUND 1)
+  message(STATUS "The javacc executable: ${JAVACC_EXECUTABLE}")
+else()
+  set(JAVACC_FOUND 0)
+  message(STATUS "The javacc executable not found, using existing files")
+endif()
index 6447b86..6a50476 100644 (file)
@@ -69,7 +69,7 @@ CHECK_OPTIONAL_VARIABLE(GIT_WORKING_DIR "${CMAKE_SOURCE_DIR}")
 # Check the optional git variable.
 # If it's not set, we'll try to find it using the CMake packaging system.
 if(NOT DEFINED GIT_EXECUTABLE)
-    find_package(Git QUIET REQUIRED)
+    find_package(Git QUIET)
 endif()
 CHECK_REQUIRED_VARIABLE(GIT_EXECUTABLE)
 
index 7beb485..032c16a 100644 (file)
@@ -27,17 +27,6 @@ else()
     # doxygen project variables are unknown so look for doxygen in PATH
     find_package(Doxygen)
 endif()
-#
-# set output directory for some extra HTML files
-#
-file(STRINGS Doxyfile DOXY_HTML_OUTPUT REGEX "HTML_OUTPUT.*")
-string(LENGTH "${DOXY_HTML_OUTPUT}" DOXY_HTML_OUTPUT_LEN)
-if (${DOXY_HTML_OUTPUT_LEN})
-  string(REGEX REPLACE ".*HTML_OUTPUT *= *\([^ ]*\)" "\\1" DOXY_HTML_OUTPUT ${DOXY_HTML_OUTPUT})
-else()
-  set(DOXY_HTML_OUTPUT "html")
-endif()
-set(PROJECT_BINARY_HTML_DIR ${PROJECT_BINARY_DIR}/${DOXY_HTML_OUTPUT}/)
 
 set(DOC_INSTALL_DIR "share/doc/packages/doxygen" CACHE STRING "Relative path where to install the documentation")
 set(DOC_FILES
@@ -96,7 +85,15 @@ set(DOC_FILES
         maintainers.txt
         translator.py
         smile.png
+        doxygen_logo.gif
+        doxygen_logo_low.gif
+)
+
+if (build_doc_chm)
+    set(DOC_FILES_CHM
+        Doxyfile_chm
 )
+endif ()
 file(GLOB LANG_FILES "${TOP}/src/translator_??.h")
 
 file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/man
@@ -117,6 +114,15 @@ set_source_files_properties(${PROJECT_BINARY_DIR}/doc/${f} PROPERTIES GENERATED
 list(APPEND OUT_DOC_FILES "${PROJECT_BINARY_DIR}/doc/${f}")
 endforeach()
 
+foreach (f  ${DOC_FILES_CHM})
+add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/doc/${f}
+    COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/doc/${f} ${PROJECT_BINARY_DIR}/doc/
+    DEPENDS ${CMAKE_SOURCE_DIR}/doc/${f}
+    )
+set_source_files_properties(${PROJECT_BINARY_DIR}/doc/${f} PROPERTIES GENERATED 1)
+list(APPEND OUT_DOC_CHM_FILES "${PROJECT_BINARY_DIR}/doc/${f}")
+endforeach()
+
 configure_file(${CMAKE_SOURCE_DIR}/doc/manual.sty         ${PROJECT_BINARY_DIR}/doc/manual.sty)
 configure_file(${CMAKE_SOURCE_DIR}/doc/doxygen_manual.tex ${PROJECT_BINARY_DIR}/doc/doxygen_manual.tex)
 configure_file(${CMAKE_SOURCE_DIR}/doc/doxygen.1          ${PROJECT_BINARY_DIR}/man/doxygen.1)
@@ -165,8 +171,6 @@ add_custom_target(doxygen_pdf
         WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/latex
 )
 add_custom_target(docs
-    COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/doc/doxygen_logo.gif      ${PROJECT_BINARY_HTML_DIR}
-    COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/doc/doxygen_logo_low.gif  ${PROJECT_BINARY_HTML_DIR}
         DEPENDS ${PROJECT_BINARY_DIR}/man/doxygen.1
                 ${PROJECT_BINARY_DIR}/man/doxywizard.1
                 ${PROJECT_BINARY_DIR}/man/doxysearch.1
@@ -175,6 +179,30 @@ add_custom_target(docs
         VERBATIM
         )
 
+# return status of ${HTML_HELP_COMPILER} is not correct, so we have to do a trick with an "or" statement
+# output is redirected to "nul" as we are on windows no problem
+if (build_doc_chm)
+add_custom_target(docs_chm
+    COMMENT "Generating CHM documentation."
+    COMMAND ${CMAKE_COMMAND} -E env VERSION=${VERSION} HTML_HELP_COMPILER=${HTML_HELP_COMPILER} ${DOXYGEN_EXECUTABLE} Doxyfile_chm
+    COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_BINARY_DIR}/html/examples ${PROJECT_BINARY_DIR}/chm/examples
+    COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/chm/index.hhp ${PROJECT_BINARY_DIR}/chm/doxygen_manual.hhp
+    COMMAND ${CMAKE_COMMAND} -E echo "import os" > ${PROJECT_BINARY_DIR}/chm/doxygen_manual_examples_chm.py
+    COMMAND ${CMAKE_COMMAND} -E echo "for root, dirs, files in os.walk('examples'):" >> ${PROJECT_BINARY_DIR}/chm/doxygen_manual_examples_chm.py
+    COMMAND ${CMAKE_COMMAND} -E echo "    for file in files:" >> ${PROJECT_BINARY_DIR}/chm/doxygen_manual_examples_chm.py
+    COMMAND ${CMAKE_COMMAND} -E echo "        if file.endswith('.html') or file.endswith('.png') or file.endswith('.css') or file.endswith('.gif'):" >> ${PROJECT_BINARY_DIR}/chm/doxygen_manual_examples_chm.py
+    COMMAND ${CMAKE_COMMAND} -E echo "            print(os.path.join(root, file))" >> ${PROJECT_BINARY_DIR}/chm/doxygen_manual_examples_chm.py
+    COMMAND ${CMAKE_COMMAND} -E chdir  ${PROJECT_BINARY_DIR}/chm ${PYTHON_EXECUTABLE} ${PROJECT_BINARY_DIR}/chm/doxygen_manual_examples_chm.py >> ${PROJECT_BINARY_DIR}/chm/doxygen_manual.hhp
+    COMMAND ${CMAKE_COMMAND} -E chdir ${PROJECT_BINARY_DIR}/chm "${HTML_HELP_COMPILER}" doxygen_manual.hhp || echo > nul
+    COMMAND ${CMAKE_COMMAND} -E rename ${PROJECT_BINARY_DIR}/chm/index.chm ${PROJECT_BINARY_DIR}/chm/doxygen_manual.chm
+        DEPENDS ${PROJECT_BINARY_DIR}/doc/language.doc ${PROJECT_BINARY_DIR}/doc/config.doc
+        DEPENDS ${OUT_DOC_FILES}
+        DEPENDS ${OUT_DOC_CHM_FILES}
+        DEPENDS examples
+        DEPENDS doxygen
+        WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/doc/
+)
+endif ()
 ################################################################################
 install(FILES
         "${PROJECT_BINARY_DIR}/man/doxygen.1"
@@ -189,6 +217,13 @@ install(FILES
         DESTINATION "${CMAKE_INSTALL_PREFIX}/${DOC_INSTALL_DIR}"
 )
 
+if (build_doc_chm)
+install(FILES
+        "${PROJECT_BINARY_DIR}/chm/doxygen_manual.chm"
+        DESTINATION "${CMAKE_INSTALL_PREFIX}/${DOC_INSTALL_DIR}"
+)
+endif ()
+
 install(DIRECTORY
         "${PROJECT_BINARY_DIR}/html"
         DESTINATION "${CMAKE_INSTALL_PREFIX}/${DOC_INSTALL_DIR}"
index 7697d70..2ff093f 100644 (file)
@@ -50,6 +50,8 @@ PDF_HYPERLINKS    = YES
 USE_PDFLATEX      = YES
 STRIP_CODE_COMMENTS = NO
 HTML_STYLESHEET   = doxygen_manual.css
+HTML_EXTRA_FILES  = doxygen_logo.gif
+HTML_EXTRA_FILES += doxygen_logo_low.gif
 ALIASES           = LaTeX="\f$\mbox{\LaTeX}\f$"
 ALIASES          += TeX="\f$\mbox{\TeX}\f$"
 LATEX_BATCHMODE   = YES
diff --git a/doc/Doxyfile_chm b/doc/Doxyfile_chm
new file mode 100644 (file)
index 0000000..8fb51a6
--- /dev/null
@@ -0,0 +1,20 @@
+#
+# Copyright (C) 1997-2019 by Dimitri van Heesch.
+#
+# Permission to use, copy, modify, and distribute this software and its
+# documentation under the terms of the GNU General Public License is hereby 
+# granted. No representations are made about the suitability of this software 
+# for any purpose. It is provided "as is" without express or implied warranty.
+# See the GNU General Public License for more details.
+#
+# Documents produced by Doxygen are derivative works derived from the
+# input used in their production; they are not affected by this license.
+
+@INCLUDE = Doxyfile
+      GENERATE_LATEX         = NO
+      HTML_OUTPUT            = chm
+      GENERATE_HTMLHELP      = YES
+      GENERATE_TREEVIEW      = NO
+      HHC_LOCATION           = "$(HTML_HELP_COMPILER)"
+      CHM_FILE               = index.chm
+      BINARY_TOC             = YES
index 98189ff..dca250a 100644 (file)
@@ -2,6 +2,249 @@
 \tableofcontents{html,latex}
 \section log_1_8 1.8 Series
 
+\subsection log_1_8_17 Release 1.8.17
+\htmlonly
+<b>(release date 27-12-2019)</b>
+<a name="1.8.17"></a>
+</p>
+<ul>
+<li>issue #6715: Errorneous matching of the immediately following block command after @ref [<a href="https://github.com/doxygen/doxygen/commit/4908c39f8bd18556f868bcc70d3f2f6ff0296c8e">view</a>] and [<a href="https://github.com/doxygen/doxygen/commit/81da20ff839843634ee6db5f517bfcb7ef87d4b9">view</a>]</li>
+<li>issue #7119 Doxygen does not link to C# snippets - regression [<a href="https://github.com/doxygen/doxygen/commit/4952c20194ab1b59e914cabdbe44d609a138b393">view</a>]</li>
+<li>issue #7189: wrong warning on ambiguous image files [<a href="https://github.com/doxygen/doxygen/commit/752753c044af46cc4a22f83be8e4e1ae6be8f373">view</a>]</li>
+<li>issue #7190 1.8.16: Blank FILE_PATTERNS =&gt; no files processed [<a href="https://github.com/doxygen/doxygen/commit/a27369dbf3cccbe4b96bfde1aca49d96d4b396f0">view</a>]</li>
+<li>issue #7200 Fortran warning: type not declared or defined [<a href="https://github.com/doxygen/doxygen/commit/b3f4bb7f95295359674c0a730a3ba649a6d49454">view</a>]</li>
+<li>issue #7206: Problems with Fortran and `@cond` [<a href="https://github.com/doxygen/doxygen/commit/a47c456eadf1895654a3e8c4a6232e67db20371b">view</a>]</li>
+<li>issue #7210: 1.8.16: Image inclusion is inconsistent [<a href="https://github.com/doxygen/doxygen/commit/5576550317561f0fc33c26db144d0bea5561bc9f">view</a>]</li>
+<li>issue #7212 1.8.16: Function returning void pointer generates warning [<a href="https://github.com/doxygen/doxygen/commit/94a797bcafb469d743ca36b153e01eb093efebf4">view</a>]</li>
+<li>issue #7216: non-const getGroupDef() called on aliased member [<a href="https://github.com/doxygen/doxygen/commit/12d999af7931c96dfb9dc366d785c3981ac244d4">view</a>] and [<a href="https://github.com/doxygen/doxygen/commit/8723f80b378bdd1c91ce3736ecece3ea06b89ff5">view</a>]</li>
+<li>issue #7218 Doxygen parsing word documents [<a href="https://github.com/doxygen/doxygen/commit/062257aee6b51deb6bfd64a5a9a3583cd333048c">view</a>]</li>
+<li>issue #7228 Using markdown causes wrong error and warning line numbers - v. 1.8.16 [<a href="https://github.com/doxygen/doxygen/commit/def222ab7fa1ad9e51dff1b11b610c9e1e4af067">view</a>]</li>
+<li>issue #7236: C++: bug when using function as parameter [<a href="https://github.com/doxygen/doxygen/commit/6a04051970cf66330a0a3bce49abf9f4f60b6d17">view</a>]</li>
+<li>issue #7243: Some PHP classes are not properly extracted/documented [<a href="https://github.com/doxygen/doxygen/commit/4fe4ce026d75972018516d81507ae20db9cdc589">view</a>]</li>
+<li>issue #7248: Including external tag files with TOC produces a broken index.qhp [<a href="https://github.com/doxygen/doxygen/commit/4a72a9b07e805b4ba27560e8e921bcee0002ef4c">view</a>]</li>
+<li>issue #7262 ALIASES not found when filename has more than one dot [<a href="https://github.com/doxygen/doxygen/commit/be506b7eea601886f7fea0594a153900db549050">view</a>]</li>
+<li>issue #7265: Double quote character in C++ raw string literal causes Doxygen to process the string contents [<a href="https://github.com/doxygen/doxygen/commit/f8ce2e4edbf986248b7382a702d982173c2f41d0">view</a>]</li>
+<li>issue #7268 Unable to build &quot;master&quot; branch [<a href="https://github.com/doxygen/doxygen/commit/488dac9a9ca0b50759fa06770551b7095e7c2c6d">view</a>]</li>
+<li>issue #7271 Tilde in preprocessor macro disappears in latex [<a href="https://github.com/doxygen/doxygen/commit/c35960af3b0b867cbcd31141e94fe1573ad2bcc0">view</a>]</li>
+<li>issue #7274 Subpages no longer possible under mainpage [<a href="https://github.com/doxygen/doxygen/commit/74c74077aa376e3b013f1d2533dd3d6e2b0b4e54">view</a>]</li>
+<li>issue #7277: C++ - Crash using all system memory on using parent constructor with same name [<a href="https://github.com/doxygen/doxygen/commit/40f187cc3c6bf8a0599a47557b0c7c60ad1756c9">view</a>]</li>
+<li>issue #7285 git executable required [<a href="https://github.com/doxygen/doxygen/commit/a872ee137c88b98c4d5ce2391c60e304d68faccb">view</a>]</li>
+<li>issue #7290 error: Problem running ghostscript gs -q -g562x56 -r384x384x -sDEVICE=ppmraw -sOutputFile=_form0.pnm -dNOPAUSE -dBATCH -- _form0.ps. Check your installation! [<a href="https://github.com/doxygen/doxygen/commit/f08e87623368134c6541af12995b811ef9aff069">view</a>]</li>
+<li>issue #7295 Doxygen documentation of C++17 nested namespace erroneous [<a href="https://github.com/doxygen/doxygen/commit/2734b80f2dcaac9dc6be842969d42414c7a37447">view</a>]</li>
+<li>issue #7302: Determination of anonymous is too restrictive [<a href="https://github.com/doxygen/doxygen/commit/b32afdbd35624376000aaf12d09930e311692c53">view</a>]</li>
+<li>issue #7313 VHDL attribute &#39;subtype is not supported and breaks parser [<a href="https://github.com/doxygen/doxygen/commit/f17438620e08b245bcf133c422bed433fb46bc13">view</a>]</li>
+<li>issue #7319: Bug 790856 - Namespace member functions links are broken [<a href="https://github.com/doxygen/doxygen/commit/926986081bf9b97d4a25b11846af55e51d9f9871">view</a>]</li>
+<li>issue #7325: Endless loop in preprocessor due to #define A() [<a href="https://github.com/doxygen/doxygen/commit/d4a0825b1d00ead2ce441c3407d1983f80401353">view</a>]</li>
+<li>issue #7326: Incorrect display of multiline #define value [<a href="https://github.com/doxygen/doxygen/commit/1dda553a6c80aae974c0bb90c1870bdbc09004ab">view</a>]</li>
+<li>issue #7328 Cannot generate DoxygenLayout.xml [<a href="https://github.com/doxygen/doxygen/commit/2a333e5703b32451811c7de2b43e4825863add89">view</a>]</li>
+<li>issue #7348 Better warning in case a graph would have been to large [<a href="https://github.com/doxygen/doxygen/commit/7acba2f316a6e8f02364d76ab96b7ff9e739aec1">view</a>]</li>
+<li>issue #7358: Ternary conditional and null-coalescing operator in constructor results in faulty warning [<a href="https://github.com/doxygen/doxygen/commit/35461e5fe44be0537e60fd659fec9215181d4fd0">view</a>]</li>
+<li>issue #7403: xref versus namespace in multiple file [<a href="https://github.com/doxygen/doxygen/commit/bc17f30dd77812177ec872f79e53d0556871d343">view</a>]</li>
+<li>issue #7412: HTML: Opening a reference link in a new tab does not scroll to the content [<a href="https://github.com/doxygen/doxygen/commit/994b081aac309954a7984929329fbcd5c5cf8883">view</a>]</li>
+<li>issue #7436 Incorrect handling of block comments in VHDL [<a href="https://github.com/doxygen/doxygen/commit/1a5bbadb43b2d30e338d26a0d495b60e2b12f704">view</a>], [<a href="http://github.com/doxygen/doxygen/commit/ac303e2ff9e3a66cbe128c30c2986ed92851ceb6">view</a>]</li>
+<li>issue #7446: C#: parameter named `extends` is broken in the documentation [<a href="https://github.com/doxygen/doxygen/commit/0fc0de19ba79068ff7b6bad1e161393adcd865b8">view</a>]</li>
+<li>issue #7456: function-like macros generate warnings [<a href="https://github.com/doxygen/doxygen/commit/7cf6e640540954d974374b28f692e4d05ef22049">view</a>]</li>
+<li>issue #3417: C++: friend template functions shown even with HIDE_FRIEND_COMPOUNDS=yes [<a href="https://github.com/doxygen/doxygen/commit/369c65635de29af6fd92c835879d70fdac7d2270">view</a>]</li>
+<li>issue #7302: Parsing of template args in single-quotes is incorrect. [<a href="https://github.com/doxygen/doxygen/commit/148162e48b8337fafffc61e5a1b5cdf86077d6ac">view</a>]</li>
+<li>Bug 164073 - There should be a dummy tag that Doxygen ignores [<a href="https://github.com/doxygen/doxygen/commit/a5d92dd49950dfddf739fd8808c0101965539a17">view</a>]</li>
+<li>Bug 335614 - HTML link incorrect when using tagfile [<a href="https://github.com/doxygen/doxygen/commit/cbbd26b39cf63148b25d40498f0ab174e6094df7">view</a>]</li>
+<li>Bug 340202 - @code: static_cast, const_cast, etc C++ keywords [<a href="https://github.com/doxygen/doxygen/commit/5a25a7f33af4a53462a6ddea9e8b82d0d9f23280">view</a>]</li>
+<li>Bug 550158 - EXTRACT_ALL=YES parses non doxygen comments [<a href="https://github.com/doxygen/doxygen/commit/27188292dfb9df6eaa5523d14e723cd1049afe9d">view</a>], [<a href="http://github.com/doxygen/doxygen/commit/a6da9a48ad520206462632496fc4c83d72bffe5a">view</a>]</li>
+<li>Bug 570798 - \\\&lt; does not work for php constants [<a href="https://github.com/doxygen/doxygen/commit/3367058c49f85c3d8a86377db08e90ec9e601c60">view</a>]</li>
+<li>Bug 674005 - Crop png formula environnment problem for HTML output [<a href="https://github.com/doxygen/doxygen/commit/54288872a1eb5c36a5d8b6fbcc9cafb1f38cefad">view</a>]</li>
+<li>Adding HTML s tag, XML corrections for other tags [<a href="https://github.com/doxygen/doxygen/commit/5b1eaf616f0edd430637d31eae51eea26fbac408">view</a>], [<a href="http://github.com/doxygen/doxygen/commit/cf82dae5f6a9fddcc24e9b7acc110f72fa0442df">view</a>]</li>
+<li>Adding JAVACC_FLAGS for javacc compilation [<a href="https://github.com/doxygen/doxygen/commit/fe233524d5637944e66d08a3f1bed05e14107956">view</a>]</li>
+<li>Adding possibility to automatically build vhdlparser from vhdlparser.jj file [<a href="https://github.com/doxygen/doxygen/commit/3789f8b4a07f43be96360d04bfb247cfa75a2cb0">view</a>], [<a href="http://github.com/doxygen/doxygen/commit/cda147996c774c7d35c8b2a942f1457cdd38d4f4">view</a>]</li>
+<li>Adding some links in search documentation [<a href="https://github.com/doxygen/doxygen/commit/e6d4940246e42bedca2c4faa925ddfa2813d7f01">view</a>]</li>
+<li>Also span entire line in case of a memTemplItemRight [<a href="https://github.com/doxygen/doxygen/commit/44695af0c77cff4099bc8a53c5f3270cc6a6e33c">view</a>]</li>
+<li>Avoid code duplication and make the keyword matching more robust [<a href="https://github.com/doxygen/doxygen/commit/fe66145d44ad4cf79e2bb4928b190c415aaf5b90">view</a>]</li>
+<li>Avoid warning in commentcnv.l about trailing context made variable due to preceding &#39;|&#39; action [<a href="https://github.com/doxygen/doxygen/commit/a571e7669a835bc998cb96b226537a6e8093bc09">view</a>]</li>
+<li>Backslash in href. [<a href="https://github.com/doxygen/doxygen/commit/9928ad99b8877702e2abecfdfe183cf961e08452">view</a>]</li>
+<li>Better termination message [<a href="https://github.com/doxygen/doxygen/commit/146bec22e9ff91e8274becd719149f7ab9c7cfb9">view</a>]</li>
+<li>Better warning in case of `@form` [<a href="https://github.com/doxygen/doxygen/commit/9664e0b46ba516069d5fd740aac4ef4eb5f874cf">view</a>]</li>
+<li>Better warning message in case of illegal command [<a href="https://github.com/doxygen/doxygen/commit/03fb8168b060f33fe6011604fb4b08549df36865">view</a>], [<a href="http://github.com/doxygen/doxygen/commit/fa2e951d698c99feac64f5a480142482781ef8b8">view</a>]</li>
+<li>Bogus explicit link warning message from irc protocol name [<a href="https://github.com/doxygen/doxygen/commit/10269d433ec433898ec61755568033c99c3cd301">view</a>]</li>
+<li>Checking of right usage of configuration list items [<a href="https://github.com/doxygen/doxygen/commit/b007be7c1671661f31f056b7b7b5f480279ddbd6">view</a>]</li>
+<li>Cleanup forward declarations of obsolete classes [<a href="https://github.com/doxygen/doxygen/commit/e8efa15a24b991332e2be0e44714d930d4d489a6">view</a>]</li>
+<li>Code highlighting. [<a href="https://github.com/doxygen/doxygen/commit/5e8da21d56dc821f27e1c8cded754bbf2594181e">view</a>]</li>
+<li>Consistent way to show scanner state [<a href="https://github.com/doxygen/doxygen/commit/aca16ea3b4e4beef9bf067d0b532dfa3802f7a3d">view</a>]</li>
+<li>Correct style in table header in case of paragraph is used [<a href="https://github.com/doxygen/doxygen/commit/844159503ac32293f1a11761687843b1ecf5fb3e">view</a>]</li>
+<li>Correcting visible year in copyright [<a href="https://github.com/doxygen/doxygen/commit/6f529de0c85d6e1de6a75f713af4785f6e81d81d">view</a>]</li>
+<li>Correction documentation `\image` command [<a href="https://github.com/doxygen/doxygen/commit/bc773f438cf7230b64fdba422d28ef5ad0d95696">view</a>]</li>
+<li>Coverity uninitialized [<a href="https://github.com/doxygen/doxygen/commit/ef06c8d14c7889e723331601ac847cc481966f5c">view</a>]</li>
+<li>Create possibility to define LaTeX commands for formulas [<a href="https://github.com/doxygen/doxygen/commit/fd3b60caa8bb99bec81b74d74f394c6043091c76">view</a>]</li>
+<li>Discrepancy between vhdl input and generated sources [<a href="https://github.com/doxygen/doxygen/commit/237f5cfe759a9e0abc9514824f02581f84058d50">view</a>]</li>
+<li>Double entry for ins in compound.xsd [<a href="https://github.com/doxygen/doxygen/commit/761ed7d34203e3c89541dfed08eebf49daedfc2b">view</a>]</li>
+<li>Email address seen as code starter [<a href="https://github.com/doxygen/doxygen/commit/72eed17195c6650d503c191fb8e3ed54d3426df4">view</a>]</li>
+<li>Embed TagInfo struct inside Entry [<a href="https://github.com/doxygen/doxygen/commit/d5a41b029fc13c7f07944260af312a7264215808">view</a>]</li>
+<li>Error in LaTeX with single quote in formula / math mode. [<a href="https://github.com/doxygen/doxygen/commit/6c4cd16b98e6d3abb6923b7bba0d87445cc891bf">view</a>]</li>
+<li>Extend built-in STL support with more classes [<a href="https://github.com/doxygen/doxygen/commit/742927e23a728fffe53e7bfd1d220f7df4c6f552">view</a>]</li>
+<li>Fix double delete in VHDL error handler. [<a href="https://github.com/doxygen/doxygen/commit/cc4675afcc5f6825b9302fd0915c0c4148f555ab">view</a>]</li>
+<li>Fix for use of non portable strnstr function [<a href="https://github.com/doxygen/doxygen/commit/54ec927d886b895b1ec7bbe62c143b052970fdf6">view</a>] and [<a href="https://github.com/doxygen/doxygen/commit/ecc4f838db18336c4afbc6dabb1a8edbc6d8bbd0">view</a>]</li>
+<li>Fix incorrect reference resolving of enum class values [<a href="https://github.com/doxygen/doxygen/commit/a2f09d6aae1260822fecf2f0de9c1d3fbcc312e7">view</a>]</li>
+<li>Fix lifetime issue for Entry objects. [<a href="https://github.com/doxygen/doxygen/commit/79f6a43c5fbd1f28f2fbdaa642cf42a0079b5be6">view</a>]</li>
+<li>Fix line count after multiline close group [<a href="https://github.com/doxygen/doxygen/commit/0809acf9d38525578080e50a4b23b61127706ebe">view</a>]</li>
+<li>Fix logic bug in SVG detection [<a href="https://github.com/doxygen/doxygen/commit/169545c73335cf4a45a2d7a21a40cc2fb17c3aaf">view</a>]</li>
+<li>Fix regression when expanding macro to an empty string [<a href="https://github.com/doxygen/doxygen/commit/15c1a199b08063d5fc31d0429e61019a162ee5c6">view</a>]</li>
+<li>Fix some typos [<a href="https://github.com/doxygen/doxygen/commit/3754d597b8e94e1ed33808457cfd22d2996c15ae">view</a>]</li>
+<li>Fix typo in source [<a href="https://github.com/doxygen/doxygen/commit/c47e6676a950e168c0f2c5736b9bc9056ab1e389">view</a>]</li>
+<li>Fix typos [<a href="https://github.com/doxygen/doxygen/commit/9b9c2c6101be61baefb73b0c414e93381070e21b">view</a>]</li>
+<li>Fixed a couple of compiler warnings on Windows [<a href="https://github.com/doxygen/doxygen/commit/8e1481ecba4a028dcd7e6a083619d88c5944a87f">view</a>]</li>
+<li>Fixed compiler warnings in docparser.cpp [<a href="https://github.com/doxygen/doxygen/commit/f7b187a8d6ee85f02ad28df7653547f1070da9e3">view</a>]</li>
+<li>Fixed endless loop during preprocessing [<a href="https://github.com/doxygen/doxygen/commit/73a410a00efb17ab7bc673bf2e3ecdc45eb876f4">view</a>]</li>
+<li>Fixed issue with &quot;QGDict::hashAsciiKey: Invalid null key&quot; in pre.l [<a href="https://github.com/doxygen/doxygen/commit/15a47ccc703c44d1355146a2744f1ccc38ee136f">view</a>]</li>
+<li>Fixed line count misaligned introduced with JAVADOC_BANNER [<a href="https://github.com/doxygen/doxygen/commit/26a634f60f53987d4d8b1f94259cc0a94e2414c3">view</a>]</li>
+<li>Fixed merge issue [<a href="https://github.com/doxygen/doxygen/commit/d376b8a80eb26feec66c22358d67ed134395169a">view</a>]</li>
+<li>Fixed preprocessor hangup regression [<a href="https://github.com/doxygen/doxygen/commit/dbd8ceb8efa2e7b413780a43e74b30f039670a72">view</a>]</li>
+<li>Fixed preprocessor issue that resulted in &quot;More #endif&#39;s than #if&#39;s found.&quot; warning. [<a href="https://github.com/doxygen/doxygen/commit/5fe991236c9042a1ea75d6693aca41b3256a0d89">view</a>]</li>
+<li>Fixed use of uninitialized data in VHDL generator [<a href="https://github.com/doxygen/doxygen/commit/2702af59b09e68ad2db9eff7ef4ae5594deb15ae">view</a>]</li>
+<li>Fixed use of uninitialized pointer in preprocessor [<a href="https://github.com/doxygen/doxygen/commit/bae74a501c520bc180ea329dbe8d91b1ce81d90e">view</a>]</li>
+<li>Fixes a @param&#39;s parameter name. [<a href="https://github.com/doxygen/doxygen/commit/6511868015b83421fc151888e1747426fa515582">view</a>]</li>
+<li>Generalized the HTML comment detection and handling [<a href="https://github.com/doxygen/doxygen/commit/0f90a399a886ea7f69bf482415e6c4cdcb7269b3">view</a>]</li>
+<li>Generating doxygen&#39;s documentation in CHM format [<a href="https://github.com/doxygen/doxygen/commit/46ecf6bf78f1c0d4aa140db74847fafc5613dfe7">view</a>], [<a href="http://github.com/doxygen/doxygen/commit/8a8e1c494e010b0ad6cc382247a02a2b41506aac">view</a>]</li>
+<li>HHC and directory elements starting with &quot;.&quot; [<a href="https://github.com/doxygen/doxygen/commit/4d173a0b2e13b2cd26c996894480afc65d50cd87">view</a>]</li>
+<li>HTML attribute name [<a href="https://github.com/doxygen/doxygen/commit/648d871ab448b81dc714dcbdca955afd9a9bc3c3">view</a>]</li>
+<li>HTML start comment with 3 dashes [<a href="https://github.com/doxygen/doxygen/commit/9481a8844e5412295dd232e44a04ff8bcf169b5a">view</a>]</li>
+<li>Illegal Character in XML output [<a href="https://github.com/doxygen/doxygen/commit/82e952f272b285b641a1980143826bf8816c70c1">view</a>]</li>
+<li>Incorrect NCName in docbook citations [<a href="https://github.com/doxygen/doxygen/commit/a390d6a9ad62019c7ca3d3689184fd3ce6afd57c">view</a>]</li>
+<li>Incorrect warning &quot;yyextra-&gt;inside&quot; instead of &quot;inside&quot; [<a href="https://github.com/doxygen/doxygen/commit/149d5e8f19dda2fa4d898fbbc7d922b29c8aa281">view</a>]</li>
+<li>Incorrect warning for ALIASES [<a href="https://github.com/doxygen/doxygen/commit/d269f239d7af8d3bd762abfd6a8557cd2d898eab">view</a>]</li>
+<li>Length of identifying fenced code block [<a href="https://github.com/doxygen/doxygen/commit/c42c0ae66542e4e154c2646fc725890554208d89">view</a>]</li>
+<li>Let $year support SOURCE_DATE_EPOCH [<a href="https://github.com/doxygen/doxygen/commit/c993785c8cae4712cd6fd34004c02041a128d7c7">view</a>]</li>
+<li>Made check for void return more strict [<a href="https://github.com/doxygen/doxygen/commit/361f3e10a86370a568733a7e4d862b180cf45fd9">view</a>]</li>
+<li>Made regexp more strict [<a href="https://github.com/doxygen/doxygen/commit/c68ae6ebd44ae66ba35154d868c686cf14c7f6b8">view</a>]</li>
+<li>Making tests valid for python 3 [<a href="https://github.com/doxygen/doxygen/commit/2dcdaa52ec90b7b5a8a6b0471b2eed3c82fa3db4">view</a>], [<a href="http://github.com/doxygen/doxygen/commit/36607693bace9db1e45ffcd08fec5a3c7674c3de">view</a>]</li>
+<li>Minor code cleanup for layout files [<a href="https://github.com/doxygen/doxygen/commit/ed4515149fd0839dba1f59858aec37b73c0ac805">view</a>]</li>
+<li>Minor fixes [<a href="https://github.com/doxygen/doxygen/commit/5698b7556966fe39c1a808f609a3e14bd648786d">view</a>], [<a href="http://github.com/doxygen/doxygen/commit/5970cae1c37dc07acb7fd495520e83f20171a821">view</a>]</li>
+<li>Minor tweaks [<a href="https://github.com/doxygen/doxygen/commit/5a0026acd0f273a4aad92dd45e9f7a9938322171">view</a>]</li>
+<li>Missing tables item in overview [<a href="https://github.com/doxygen/doxygen/commit/caf98e28a47f2a9134802efca8b4d5d48c904ab2">view</a>]</li>
+<li>Nicer warning for missing parameter [<a href="https://github.com/doxygen/doxygen/commit/23d8bd36a5b8eb1f4d913b50db31a567a63ad994">view</a>]</li>
+<li>Optimize UTF-8 nbsp conversion in markdown [<a href="https://github.com/doxygen/doxygen/commit/5c5d546a393e68203ab853a99575d643672655cc">view</a>]</li>
+<li>Order of commands in `&lt;table&gt;` [<a href="https://github.com/doxygen/doxygen/commit/c82179d0746d806ca1c655ea9a77d1d047d227cc">view</a>]</li>
+<li>Output of unknown xml/html tag [<a href="https://github.com/doxygen/doxygen/commit/2001c933292d3dd25ebc6634dab62aab7389c5bc">view</a>]</li>
+<li>Parsing `#` sign inserted by preprocessor in fixed Form Fortran [<a href="https://github.com/doxygen/doxygen/commit/78564eab5a92c7c80397c0b55ea92ddb2bf5f29e">view</a>]</li>
+<li>Prevent writing automatic anchors to the tag file [<a href="https://github.com/doxygen/doxygen/commit/5b5db5372a769fc15b29981164014b42815f9ae6">view</a>]</li>
+<li>Problem converting UCS big endian file [<a href="https://github.com/doxygen/doxygen/commit/42355ace21f6fb72fba49316c73c025a12482b09">view</a>]</li>
+<li>Problem with  `&lt;hr&gt;` in LaTeX multicolumn cell [<a href="https://github.com/doxygen/doxygen/commit/416ee572ba35b4d0cf30ccca66f0691c658f2e53">view</a>], [<a href="http://github.com/doxygen/doxygen/commit/a3093ff24ec75b70d6d7dc37ca2c7e68f36161fe">view</a>]</li>
+<li>Problem with &#39;&lt;td nowrap&gt;&#39; [<a href="https://github.com/doxygen/doxygen/commit/3f553a8e4266b24a67e5c7302ee81e1d5e648748">view</a>]</li>
+<li>Problem with horizontal ruler directly after fenced code section [<a href="https://github.com/doxygen/doxygen/commit/6b821a1da54e558947b631a7d2b836c8aa6935e7">view</a>]</li>
+<li>Problem with round brackets in PS output [<a href="https://github.com/doxygen/doxygen/commit/f23e59f2543f592bcbc2358c1d51825ab71f88bd">view</a>]</li>
+<li>Properly close quotes in warning [<a href="https://github.com/doxygen/doxygen/commit/78b5c447d516d64237f73e08a7ba2ad488201aa7">view</a>]</li>
+<li>Properly open quotes in warning [<a href="https://github.com/doxygen/doxygen/commit/80a264bf79f60c9ae4446cb93a3a93662779d885">view</a>]</li>
+<li>QGDict::hashAsciiKey: Invalid null key due to empty procedure name [<a href="https://github.com/doxygen/doxygen/commit/7e99e9b66c48da2dfeea29f14b207a30aae62a1e">view</a>]</li>
+<li>RTF extension file to standard output, make according documentation consistent. [<a href="https://github.com/doxygen/doxygen/commit/54516c3c66dc1b736b9ef3140e83495292766992">view</a>]</li>
+<li>Reduce the use of QString in favor of the more efficient QCString [<a href="https://github.com/doxygen/doxygen/commit/4a9541d1605333e70b5ab9193d65cb300d8ef18e">view</a>]</li>
+<li>Reduced code duplication [<a href="https://github.com/doxygen/doxygen/commit/4cd3cdfe95a2ed77963d1adc71a0de10135743da">view</a>]</li>
+<li>Refactoring code for dot related source files [<a href="https://github.com/doxygen/doxygen/commit/cc4253926526efc87385de9640e64cd5cf062ada">view</a>]</li>
+<li>Refactoring of portable.h and portable.cpp functions to be contained in a namespace Fixing some memory issues caused by not correctly freed pointers [<a href="https://github.com/doxygen/doxygen/commit/6382986b77d302be187d95aaa850eff132ec1d7d">view</a>]</li>
+<li>Remove global state from constexp lexer [<a href="https://github.com/doxygen/doxygen/commit/28c738d0319bf5de25bcf6aed90234419feded07">view</a>]</li>
+<li>Remove unneeded include directory for building doxywizard [<a href="https://github.com/doxygen/doxygen/commit/6b1372a68234686d5f82c8fca26868925d884ff3">view</a>]</li>
+<li>Removing left over debug statements [<a href="https://github.com/doxygen/doxygen/commit/4051a98915f2d831efce409c16126712880c9a28">view</a>]</li>
+<li>Renamed Portables to Portable [<a href="https://github.com/doxygen/doxygen/commit/352ac919116aa49cdae48daa5d6861089ddd6055">view</a>]</li>
+<li>Revert &quot;Minor code cleanup for layout files&quot; [<a href="https://github.com/doxygen/doxygen/commit/3bd04d0d99b4fbc36167ee6981ce3bfb4c0eb3b2">view</a>]</li>
+<li>Simple nospam email address [<a href="https://github.com/doxygen/doxygen/commit/ce4b7363932c1152060ba4b24d9a7e7bf438d4e4">view</a>]</li>
+<li>Simplied the logic for moving documentation to the most nested Entry [<a href="https://github.com/doxygen/doxygen/commit/4884295c6a3bc9af6e01c1688a3173ac6c3bc315">view</a>]</li>
+<li>Simplified code generated by scan_states.py [<a href="https://github.com/doxygen/doxygen/commit/cb013aff054c246d99f1211acf16312a27da7be1">view</a>]</li>
+<li>Skip empty HTML tag [<a href="https://github.com/doxygen/doxygen/commit/b0c0fc0b741f3c51ff9f891a0725d68bca6ecda5">view</a>]</li>
+<li>Small improvements of TCL output [<a href="https://github.com/doxygen/doxygen/commit/640ef05f26882c8abbba174d4758aa6c38d9862b">view</a>], [<a href="http://github.com/doxygen/doxygen/commit/7cd998a90790d4678d7a59f6774c60dc6aff4b98">view</a>]</li>
+<li>Split language parser into &quot;outline parser&quot; and &quot;code parser&quot; [<a href="https://github.com/doxygen/doxygen/commit/3bda58a7b7b4f9094c2fcb2bad71c7174367605e">view</a>]</li>
+<li>Strange &#39;*&zwj;/#39; in Fortran nad Markdown with conditional sections [<a href="https://github.com/doxygen/doxygen/commit/dd0920f6b863bba58b0a64e7e983469380b29033">view</a>]</li>
+<li>Support for &lt;a id=&quot;label&quot;&gt; [<a href="https://github.com/doxygen/doxygen/commit/1734f1a16f828013171bb67bb4dcb61be57fad04">view</a>]</li>
+<li>Table caption flows in first table field for RTF output [<a href="https://github.com/doxygen/doxygen/commit/6c4f10c375530d1baf82527787d4887cc343d9bb">view</a>], [<a href="http://github.com/doxygen/doxygen/commit/6d5ac50ae99b913a26a752fe86dfab1643b73a02">view</a>]</li>
+<li>Tests 31 for XHTML output [<a href="https://github.com/doxygen/doxygen/commit/20853fc59e43fafe67986d219d2c5307dccd2e24">view</a>]</li>
+<li>Tests 86  with check against xsd gives error [<a href="https://github.com/doxygen/doxygen/commit/67d45042f2f30c1c6543c2cecfb608228a158a85">view</a>]</li>
+<li>Text &#39;&amp;nbsp;&#39; appears in code segments [<a href="https://github.com/doxygen/doxygen/commit/4e2a1ac22f27046f16acc95ea7d763a67bb7f344">view</a>]</li>
+<li>Textual error [<a href="https://github.com/doxygen/doxygen/commit/4ab73bb872b443ad798be384171c5ff222cb2ba2">view</a>]</li>
+<li>Update doxywizard copyright year and add missing copyright statements [<a href="https://github.com/doxygen/doxygen/commit/80bbd1796e410d1822e16833bcf6002692ff54df">view</a>]</li>
+<li>Update of generated VhdlParser files. [<a href="https://github.com/doxygen/doxygen/commit/aa33a2a657b70e61208c07d9861d0f721e8e68b2">view</a>]</li>
+<li>Use the proper trailing comment. [<a href="https://github.com/doxygen/doxygen/commit/b30195e3060dba3f39b136dc5663fe9f07e6386b">view</a>]</li>
+<li>Warning in case of usage of a single quote in a code span. [<a href="https://github.com/doxygen/doxygen/commit/d43815b2d1aed4fd10a918f18688c35995298677">view</a>]</li>
+<li>Warning when using empty HTML tag [<a href="https://github.com/doxygen/doxygen/commit/ef3063ef59cb1f41f02d7658490b0e554bb7a288">view</a>]</li>
+<li>Warning when using empty p HTML tag [<a href="https://github.com/doxygen/doxygen/commit/056a6ba3de9b9a558ffa9c908bed28ae3494e121">view</a>]</li>
+<li>Warning whit Windows compilation using NMake [<a href="https://github.com/doxygen/doxygen/commit/e282382e78e7381fda85894dc588793185ed77d0">view</a>]</li>
+<li>Warning with XML / HTML style commands [<a href="https://github.com/doxygen/doxygen/commit/36c549da50d685fd8be82e88cb63db5cf13c57f5">view</a>]</li>
+<li>Warning with xrefitem from documentation [<a href="https://github.com/doxygen/doxygen/commit/a445ecc48e8152848e78fa2f167a556f0cac5616">view</a>]</li>
+<li>Wrong reference to code line [<a href="https://github.com/doxygen/doxygen/commit/89a35e4c65f3089f47e65b7c399c1ac53ba9015c">view</a>]</li>
+<li>bug fix of g_bracketCount in case of if( myobject.getPair() ) [<a href="https://github.com/doxygen/doxygen/commit/6b2def9ad52da8709ce9ffa91c792009f1902e41">view</a>]</li>
+<li>remove debug prints [<a href="https://github.com/doxygen/doxygen/commit/caea19d73d20faadddeab5ea23199fb3d6e306de">view</a>]</li>
+<li>Added missing debug flags for scanner that were made reentrant [<a href="https://github.com/doxygen/doxygen/commit/4a4fcdf7931efba208a57b658185de689f2ef7fb">view</a>]</li>
+<li>Made scanner.l reentrant [<a href="https://github.com/doxygen/doxygen/commit/ded73e043b0479451f0d9b5c0eee5ecab07a87e5">view</a>]</li>
+<li>Cleanup scanner.l code and naming [<a href="https://github.com/doxygen/doxygen/commit/d29c0e80865c70d1afceeef5e611aac8aa4f079f">view</a>]</li>
+<li>Make preprocess code reentrant [<a href="https://github.com/doxygen/doxygen/commit/1919a8e0457925ff63d91a0227729340121d461e">view</a>]</li>
+<li>Made code.l scanner reentrant [<a href="https://github.com/doxygen/doxygen/commit/e7d47ec23ba1b109754d6e47b1eb4d341efc3b36">view</a>]</li>
+<li>Made commentcnv.l reentrant [<a href="https://github.com/doxygen/doxygen/commit/2972f6ddc491f615f814b1277ec715b6f707c419">view</a>]</li>
+<li>Reduce boilerplate code by using C++11 variadic templates and perfect forwarding [<a href="https://github.com/doxygen/doxygen/commit/3e8fe63473b047bf3d48c734750334244e9981a8">view</a>]</li>
+<li>Remove bogus flex code [<a href="https://github.com/doxygen/doxygen/commit/26f6f1aec1be0361eac7c6ebc4de93904bf42a98">view</a>]</li>
+<li>Replace set of g_inside* booleans with a single g_lang variable [<a href="https://github.com/doxygen/doxygen/commit/c5854f5a8e819de82b73d14bbbd8583a36842fd5">view</a>]</li>
+<li>Use smartpointers to manage the lifetime of Entry objects [<a href="https://github.com/doxygen/doxygen/commit/ae0a5ec2a10371adbcdb0df4f3ce536ed6b43840">view</a>]</li>
+<li>Latest libclang needs C++14 [<a href="https://github.com/doxygen/doxygen/commit/64f1f2357ae764f2c8190d067aff801bc0a56721">view</a>]</li>
+<li>Changed ArgumentList to be an STL container [<a href="https://github.com/doxygen/doxygen/commit/c38a6fe88ceb3658ae4c09fa9550c770195d9401">view</a>]</li>
+<li>Changed implementation to use SkipString/SkipStringS. [<a href="https://github.com/doxygen/doxygen/commit/3fe10a7eba7d55d2e542f3cd354d5a52701249ef">view</a>]</li>
+<li>Changed std::unique_ptr&lt;Entry&gt; to std::shared_ptr&lt;Entry&gt; at avoid use after free issues [<a href="https://github.com/doxygen/doxygen/commit/6d4835dbe01a27923db8a1e4559b61da5065cb7a">view</a>]</li>
+<li>Replaced QList&lt;BaseInfo&gt; with std::vector&lt;BaseInfo&gt; [<a href="https://github.com/doxygen/doxygen/commit/94e8899c8013cf99a6f90d1c8f0a7815ccc3e1c3">view</a>]</li>
+<li>Replaced QList&lt;Grouping&gt; with std::vector&lt;Grouping&gt; [<a href="https://github.com/doxygen/doxygen/commit/d38df57916d5902abc9dbaf5891c14898ce675da">view</a>]</li>
+<li>Replaced QList&lt;ListItemInfo&gt; with std::vector&lt;ListItemInfo&gt; [<a href="https://github.com/doxygen/doxygen/commit/38f1441dc329e72ba4c782fdc721ce5199e01a67">view</a>]</li>
+<li>Replaced QList&lt;SectionInfo&gt; by std::vector&lt;SectionInfo&gt; [<a href="https://github.com/doxygen/doxygen/commit/4b745debaec0dbff60f7fe82ac32c59e3b21dfea">view</a>]</li>
+<li>Spelling corrections [<a href="https://github.com/doxygen/doxygen/commit/8142da33a9017373dc0cfe0dc9bd21921cabd309">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/c7716a291ca04369292d57e0a472bd2f350d1bf1">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/5ff3c02602652e60f5787e8b988f7b279f649d3e">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/4ca56cd603207078dfc1b793586aee1be3a6e4c1">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/83b138afee3405c1b08b671efccba5b3ec1ec45c">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/04df92f43f9a11c30c5855013dd285b168c621f5">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/e6c910b1480e4cdba1a8054d2c0d1442c483cd9b">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/812122864c7474e434606a3377deead0defb0be0">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/284188a8b2f7920653c61734ae2ff0e741a261af">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/f349b89d9c6f2692047848de8c0a6fa2a7f87b4d">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/5105f2530dddc8ad72c6d4a8f3b189e7e75c8251">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/07b5331ac7645e4d6b6c1fcaa12c5ef511e67921">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/dad40edfd610e5d2990357aa5a0a19ac031c906a">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/29af2efa0b07e01999a7a293c9708c74b8030ba2">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/3e888ce4a9f3d4695b81126adc485312c21f6069">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/988a515275cf76c4ea03a95b1d6c9d83cccd980a">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/07c727a22ff2eef071afbdcb210b6532f1ad03e8">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/16988c00c3f4a18f917a1e5187e8d9f6f628f0a6">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/8396c7da1f2178794849fa9059cd2c14cdf335db">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/82ce5b1b2296ee1af50a30174c34ec9ef39247d7">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/c87e282035af49705f403299cba67896bc199abf">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/22fd8af697ae1077ffc1f7f3ccc18fff597108e2">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/0af2abbe79a377a90a5a2406fa7f0a746387baeb">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/2b519c652639d6eb19070117db20f80dc0f6e770">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/e98563bbbf8b404e8bba3f0e0ff5bf57076a3ced">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/d4eb40dfa97855a93c463ad0d8d7feb706d062e9">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/7eac72cdaa0979f45110216fd3db22f6a8a535d1">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/d7bca4a0a3540f4228b4c2a913e05fb45f20df76">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/acec2aee49044fe4b92b8a8734d061a84ad1e70f">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/b550a04003c5d01afa5d3e28ac3ab12382eb52ca">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/87bb2edaa9cb464ff3256ff9aaa989d8a4b6413e">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/a3143765e8ed60f19babeed5c15ecfb96d28d08b">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/c8b19dc3fa8a5f351b6a7032bbfd4831194e9630">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/34e55d6cec842543dcf4275079e2e897c9e9c080">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/7ca8577c04479b40f9109f5df50b830885af0d37">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/3098ee986df6295fa148d2b24efe8339922aa3d2">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/a7c65f8b6449fbf87b73aa91af6a77ee99df6398">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/5f9161ea079259971d779ae05e62f7d84800d069">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/8598cc1347fcdb05b08b1347b86490aee6b11275">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/da08bf2be9c3470e1cf931cff3bd59c577543436">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/010934456e9ec6ce2066fd649af9e7c171c3b5c1">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/065c8b307ae2723b13e7eff1d627425ce322d664">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/087a6b203d25e81f002161dfca99b5c551ed9872">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/dda8cf39908bd5e2022b8ec44112777f43adf2ba">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/c65f1e96056b8d07f63bc2d016138bdd269dbb24">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/087ac17e246cfc70f5686ed5f3bbfda8088c5c40">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/1e473567e563a9e01dc0f260759b774ae3bfa95e">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/d527e488a94304fadc8af879c39de29162698da1">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/857177b9db33e6587aecefa15e2a20c6c9bdef44">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/66baf057dfce7f0a033103e9a79be09c5c3f0482">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/c27bde209f63d2dd26b5488f44026010fa2c9f16">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/35bcf5095043298ffd6a4122c1e442f9a43e612e">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/05aba97840b42f5a65ac4d71f75cb6c28a0d15b0">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/3dcf2fbbfdd0167e43b8ddfd1147daf3789eecd5">view</a>]
+, [<a href="https://github.com/doxygen/doxygen/commit/2e8eca2dc1733098dca42a8d1b14faa877844227">view</a>]
+and [<a href="https://github.com/doxygen/doxygen/commit/c9284a1aae6e876e0399c4757837bec3563751e2">view</a>]</li></ul>
+</ul>
+<p>
+\endhtmlonly
+
 \subsection log_1_8_16 Release 1.8.16
 \htmlonly
 <b>(release date 8-8-2019)</b>
 <li>Forgot to comment out debug print [<a href="https://github.com/doxygen/doxygen/commit/9ef21db5efbd521c570121cc7638de8d4d487536">view</a>]</li>
 <li>Give warning when a retval is used multiple times [<a href="https://github.com/doxygen/doxygen/commit/e6fb6ea2017e3245a6b45b6c8e73472829215b09">view</a>]</li>
 <li>Handling digraph versus label [<a href="https://github.com/doxygen/doxygen/commit/f3a08615439a4e82f14a5dc9d1a758b401905e30">view</a>]</li>
-<li>High consequence coverity mesages [<a href="https://github.com/doxygen/doxygen/commit/5059d796ea951d06cebc55f1a9158a8dd001af0e">view</a>]</li>
+<li>High consequence coverity messages [<a href="https://github.com/doxygen/doxygen/commit/5059d796ea951d06cebc55f1a9158a8dd001af0e">view</a>]</li>
 <li>Image not seen as svg image [<a href="https://github.com/doxygen/doxygen/commit/a3d574ecf12c71bc25579b38670f17ef663b82a6">view</a>]</li>
 <li>Implement a new EXTRACT_PRIVATE_VIRTUAL option. [<a href="https://github.com/doxygen/doxygen/commit/d18b3eaf3486e224fa9de7e77b536883952b40b9">view</a>]</li>
 <li>Implementing `&lt;hr&gt;` for LaTeX [<a href="https://github.com/doxygen/doxygen/commit/dbddf36cd10c3e6cd9419a08d688f8cbfd57f9c3">view</a>]</li>
 <li>Option for &#39;input buffer overflow&#39; [<a href="https://github.com/doxygen/doxygen/commit/efc67de9d1a4e36ab94164352778fd19f33652b3">view</a>]</li>
 <li>Option syntax for commands is unclear [<a href="https://github.com/doxygen/doxygen/commit/9ecbe35ae2826b2404f37cc7e5d4377e39430b51">view</a>], [<a href="http://github.com/doxygen/doxygen/commit/bd645c0e3ee05582adf30dcd91af5eafec7733c4">view</a>]</li>
 <li>PLANTUML_RUN_JAVA_ONCE is working well.  But some specific plantuml has error on ver 1.8.15 [<a href="https://github.com/doxygen/doxygen/commit/aeff95e38dca51f4a9ace9af8aa0387ad683f7f0">view</a>]</li>
-<li>Portuguse translators updated to Doxygen 1.8.16. [<a href="https://github.com/doxygen/doxygen/commit/6b4fd5000c6f6787155743dc93d67a249ca2b881">view</a>]</li>
+<li>Portuguese translators updated to Doxygen 1.8.16. [<a href="https://github.com/doxygen/doxygen/commit/6b4fd5000c6f6787155743dc93d67a249ca2b881">view</a>]</li>
 <li>Possibility to show converted fixed form [<a href="https://github.com/doxygen/doxygen/commit/1659f94a4c8acff1c2564226db21afbd2bc04736">view</a>]</li>
 <li>Problem with just an asterisks on a `\code` line [<a href="https://github.com/doxygen/doxygen/commit/3088ae34eda1fbeab287e2271a7f1804de2c784f">view</a>]</li>
 <li>Problem with with comment recognition for group open and closing commands [<a href="https://github.com/doxygen/doxygen/commit/ef5af7618fbec3ac240e7a1099607d9ff2b3cc4f">view</a>]</li>
 <li>Properly handle empty TOC in XML output. [<a href="https://github.com/doxygen/doxygen/commit/cfe381e3ee55b8291faeea55fe3b67bb9e545d60">view</a>]</li>
 <li>Reduce code duplication when printing version string [<a href="https://github.com/doxygen/doxygen/commit/40f507bedff94e269f9c32c941f65ed82fc25a67">view</a>]</li>
 <li>Refactored Definition and derived classes such that they are abstract interfaces [<a href="https://github.com/doxygen/doxygen/commit/960bae7191faf07f142b1ae5b0038905d33e2b1f">view</a>]</li>
-<li>Regression #6836 URL contains $ sign on second run in map of images [<a href="https://github.com/doxygen/doxygen/commit/c637dede9ec30c2e35f19636edc0b3fd424b45e5">view</a>],
-<li>Regression on Definition and derived classes that are abstract interfaces [<a href="https://github.com/doxygen/doxygen/commit/9d83d43f0d8b7058e2f89371a6ab276c06ddaa47">view</a>]</li>
+<li>Regression #6836 URL contains $ sign on second run in map of images [<a
+href="https://github.com/doxygen/doxygen/commit/c637dede9ec30c2e35f19636edc0b3fd424b45e5">view</a>]</li>
+<li>Regression on Definition and derived classes that are abstract interfaces
+[<a
+href="https://github.com/doxygen/doxygen/commit/9d83d43f0d8b7058e2f89371a6ab276c06ddaa47">view</a>],
 [<a href="https://github.com/doxygen/doxygen/commit/3523e1f6fdf68ea51ac2f0faf18dd93a100e32f2">view</a>],
 [<a href="http://github.com/doxygen/doxygen/commit/ab76916ebd1c0edd7973976a14b173412e305808">view</a>]</li>
 <li>Regression: python file with comment caused &quot;Reached end of file while still inside a comment&quot; warning. [<a href="https://github.com/doxygen/doxygen/commit/f96507054f1af54bee57734ec3d9a25b821feb27">view</a>]</li>
 <li>constexp.l: group the flex options [<a href="https://github.com/doxygen/doxygen/commit/306e3051b1374cf180b1464700ae79662ced95c2">view</a>]</li>
 <li>constexp.y: drop the = from name-prefix [<a href="https://github.com/doxygen/doxygen/commit/a18e967baabf5a9a234627e677d866bcf45741d4">view</a>]</li>
 <li>declinfo.l: enable reentrant [<a href="https://github.com/doxygen/doxygen/commit/2513172db2942a364e8af4a0d21d0fb2de328af1">view</a>]</li>
-<li>declinfo.l: group flex options toghether [<a href="https://github.com/doxygen/doxygen/commit/49c97e860a97615995eed4f58dec58d9a2a9339f">view</a>]</li>
+<li>declinfo.l: group flex options together [<a href="https://github.com/doxygen/doxygen/commit/49c97e860a97615995eed4f58dec58d9a2a9339f">view</a>]</li>
 <li>declinfo.l: move function declarations before [<a href="https://github.com/doxygen/doxygen/commit/44f678794f5338881620525a5e0fbe25962c7690">view</a>]</li>
 <li>delayed creation and update of .md5 files after successful creation of output files [<a href="https://github.com/doxygen/doxygen/commit/572035ffcd0e4f7313bab23d375d63008ebbe5a3">view</a>], [<a href="http://github.com/doxygen/doxygen/commit/9dda0c6ddc5117f800afcb19fb8c6be031fe6c27">view</a>]</li>
 <li>do not clobber version placeholder [<a href="https://github.com/doxygen/doxygen/commit/faafe83a69d2f3c27daca0974c9a063bdb81ecdc">view</a>]</li>
 <li>doxyparse addon new features and bugfixes [<a href="https://github.com/doxygen/doxygen/commit/69f51747c37bb24b7e296ff01bb7e45a624f6225">view</a>]</li>
-<li>doxysearch: added wildcard, partial and phrase sesarch [<a href="https://github.com/doxygen/doxygen/commit/6217e3026d29a6f54e0138452706caa1bbc86307">view</a>]</li>
+<li>doxysearch: added wildcard, partial and phrase search [<a href="https://github.com/doxygen/doxygen/commit/6217e3026d29a6f54e0138452706caa1bbc86307">view</a>]</li>
 <li>enable debug for re-entrant lexers [<a href="https://github.com/doxygen/doxygen/commit/2c8eec16b0a0ce46f69af9f09b66c2475066bbe6">view</a>]</li>
 <li>https link to sourceforge.net [<a href="https://github.com/doxygen/doxygen/commit/5705d50298b7b91f81f87baf0dc3a58224acd982">view</a>]</li>
 <li>make similar javadoc banner change for stripping special comments from code [<a href="https://github.com/doxygen/doxygen/commit/77dae25c166c71a57d9ecd64b765bcc616d435ec">view</a>]</li>
 <li>updated test case to reflect new node numbering [<a href="https://github.com/doxygen/doxygen/commit/0e013c9df38e69e13547a2329398ee9e0b32af5b">view</a>]</li>
 <li>warning: Member func2InGroup1() (function) of class Memgrp_Test is not documented. [<a href="https://github.com/doxygen/doxygen/commit/b0a9f75cc1894e8261ec2e95fa171a5534a65328">view</a>]</li>
 <li>warning: More #endif&#39;s than #if&#39;s found. [<a href="https://github.com/doxygen/doxygen/commit/b840290ec8d4204cc00e7a3d45f4ccf6a654c8db">view</a>]</li>
-<li>warning: Reached end of file while still inside a (nested) comment. [<a href="https://github.com/doxygen/doxygen/commit/a697caadf1912d0d74faa208f4cff887523c2e30">view</a>]</ul>
+<li>warning: Reached end of file while still inside a (nested) comment. [<a
+href="https://github.com/doxygen/doxygen/commit/a697caadf1912d0d74faa208f4cff887523c2e30">view</a>]</li>
+</ul>
 <p>
 \endhtmlonly
 
 <li>Problems and some enhancements for LaTeX tables [<a href="https://github.com/doxygen/doxygen/commit/d984f7dd21863fc01a1a6ede0878d3dd14af157a">view</a>]</li>
 <li>RTF layout regarding References and Referenced by [<a href="https://github.com/doxygen/doxygen/commit/c90505681054d51da05fd476d08c610d3e20ca38">view</a>]</li>
 <li>RTF lists more levels and removing extra paragraphs [<a href="https://github.com/doxygen/doxygen/commit/8fc23878b4375546bfb6a9149f009fbe0f7da42f">view</a>]</li>
-<li>Readded missing &quot;Span&quot; case to DocStyleChange::styleString [<a href="https://github.com/doxygen/doxygen/commit/6a3d1b3d12e353d0c6ebd642b691e5e2608f8df2">view</a>]</li>
+<li>Re-added missing &quot;Span&quot; case to DocStyleChange::styleString [<a href="https://github.com/doxygen/doxygen/commit/6a3d1b3d12e353d0c6ebd642b691e5e2608f8df2">view</a>]</li>
 <li>Redundant whitespace removal breaks some C++ links [with test case and Git bisect] (Origin: bugzilla #791942) [<a href="https://github.com/doxygen/doxygen/commit/449a7e2b4ff114a72be573013558bae19672ebbc">view</a>]</li>
 <li>Refactored code a bit [<a href="https://github.com/doxygen/doxygen/commit/4ed08b969b575d6dc1a49bca936a43eb43d337e2">view</a>]</li>
 <li>Refactored code a bit (use const references and made global functions members) [<a href="https://github.com/doxygen/doxygen/commit/3820f6a841115bd66ed409221c73824ec41ae6ab">view</a>]</li>
 <li>Bug <a href="https://github.com/doxygen/doxygen/issues/6128">6128</a> - Usage of underscore&#39;s in parameter names [<a href="https://github.com/doxygen/doxygen/commit/c10af45c61a1f9b25c514f397ace16c94cc7c8df">view</a>]</li>
 <li>Bug <a href="https://github.com/doxygen/doxygen/issues/6135">6135</a> - [1.8.13 Regression] Segfault building the breathe docs [<a href="https://github.com/doxygen/doxygen/commit/0f02761a158a5e9ddbd5801682482af8986dbc35">view</a>]</li>
 <li>Bug <a href="https://github.com/doxygen/doxygen/issues/6137">6137</a> - XML Parsing Error for operator&lt;&lt; methods when outputting to XHTML [<a href="https://github.com/doxygen/doxygen/commit/0e8530e42b69c909ef2c26468b24dfb88cc0997f">view</a>]</li>
-<li>Bug <a href="https://github.com/doxygen/doxygen/issues/6139">6139</a> - Menu does not work without Javascript [<a href="https://github.com/doxygen/doxygen/commit/1be97720b7820361e85242d08d4cac3e46570bfe">view</a>]</li>
+<li>Bug <a href="https://github.com/doxygen/doxygen/issues/6139">6139</a> - Menu does not work without JavaScript [<a href="https://github.com/doxygen/doxygen/commit/1be97720b7820361e85242d08d4cac3e46570bfe">view</a>]</li>
 <li>Bug <a href="https://github.com/doxygen/doxygen/issues/6141">6141</a> - Too greedy behavior of @ref const matching [<a href="https://github.com/doxygen/doxygen/commit/04001c8926fb0f37dfcf284b3637b182125bba75">view</a>]</li>
 <li>Bug <a href="https://github.com/doxygen/doxygen/issues/6169">6169</a> - doxygen build fails [<a href="https://github.com/doxygen/doxygen/commit/bb5c8dd29782ecbb05a4ef9788f2507e9a156848">view</a>]</li>
-<li>Bug <a href="https://github.com/doxygen/doxygen/issues/6170">6170</a> - Add &quot;\~&quot; command to internatioalization article [<a href="https://github.com/doxygen/doxygen/commit/e204b982eebd54bd15148a520da6608935e33e50">view</a>]</li>
+<li>Bug <a href="https://github.com/doxygen/doxygen/issues/6170">6170</a> - Add &quot;\~&quot; command to internationalization article [<a href="https://github.com/doxygen/doxygen/commit/e204b982eebd54bd15148a520da6608935e33e50">view</a>]</li>
 <li>Bug <a href="https://github.com/doxygen/doxygen/issues/6223">6223</a> - Problem RTF output: The class list &quot;classes&quot; within the namespace report is wrong indicated. [<a href="https://github.com/doxygen/doxygen/commit/753c06281f6b2e9172c449157fc9f863063232e3">view</a>]</li>
 <li>Bug <a href="https://github.com/doxygen/doxygen/issues/6238">6238</a> - parsing error in Fortran file with preprocessing [<a href="https://github.com/doxygen/doxygen/commit/2f5e22a4be9d237a150d04659bf6abec1349fbd9">view</a>]
 , [<a href="https://github.com/doxygen/doxygen/commit/ec12eb659d8c8e78ad4bb15d1a941ac3153a0f66">view</a>]</li>
 <li>Fixed problem where automatic line breaking caused missing vertical bars in the parameter table for Latex output. [<a href="https://github.com/doxygen/doxygen/commit/5fc82b2275e202438ac61b070ac5f4be0df792d6">view</a>]</li>
 <li>Fixes for cross platform build with new LLVM/CLANG version [<a href="https://github.com/doxygen/doxygen/commit/b0aae61c97966cb9d424b500d7ced5bdf500d8db">view</a>]</li>
 <li>Fixup man page NAME section when page has title [<a href="https://github.com/doxygen/doxygen/commit/9d0908359363dbb43236767669c214721700acf7">view</a>]</li>
-<li>Function declaration following a function definition incorrectly listed as calling dependencing [<a href="https://github.com/doxygen/doxygen/commit/436fc7ed1158d517dd6f6d25aa3e05568f8c3d94">view</a>]</li>
+<li>Function declaration following a function definition incorrectly listed as calling dependency [<a href="https://github.com/doxygen/doxygen/commit/436fc7ed1158d517dd6f6d25aa3e05568f8c3d94">view</a>]</li>
 <li>Further cleanup of lodepng code [<a href="https://github.com/doxygen/doxygen/commit/c627108f3315144f5d9fb84d0197502b939caf7d">view</a>]</li>
 <li>Implement &quot;double-space line breaks&quot; syntax in Markdown [<a href="https://github.com/doxygen/doxygen/commit/e4596c7eab90ba4d307e2c212cefeab8ac820269">view</a>]</li>
 <li>Improve Chinese translation [<a href="https://github.com/doxygen/doxygen/commit/ded5247523ec8d47129405df3999ce391cca9e2d">view</a>]</li>
 <li>Use hidden symbol visibility by default [<a href="https://github.com/doxygen/doxygen/commit/dcb3b2d0b888902a062eefd8200ea194ed1c42d6">view</a>]</li>
 <li>Use language identifier instead of file extension for language attribute [<a href="https://github.com/doxygen/doxygen/commit/ed9acb6e1bb81a2eec334180f7b8c1bf0598b444">view</a>]</li>
 <li>Use language in stead of lang for language name attribute [<a href="https://github.com/doxygen/doxygen/commit/4e4741221f4290412ef4a6b6bbfe9799abafaf6c">view</a>]</li>
-<li>Update of the Brazillian translation [<a href="https://github.com/doxygen/doxygen/commit/d283dfcdcaa0837e84d7995676d436fa04e96d1f">view</a>]</li>
+<li>Update of the Brazilian translation [<a href="https://github.com/doxygen/doxygen/commit/d283dfcdcaa0837e84d7995676d436fa04e96d1f">view</a>]</li>
 <li>[preprocessing.doc] typo amended [<a href="https://github.com/doxygen/doxygen/commit/6b67a64bd0bd1c6759294c323433dbd7d37df6ac">view</a>]</li>
 <li>add decimal to base identifier [<a href="https://github.com/doxygen/doxygen/commit/9cbc1a04e584e83d91ff3f7501f38b0a825e1953">view</a>]</li>
 <li>add the number of conditionals path and bugfix [<a href="https://github.com/doxygen/doxygen/commit/20af63f43e583a31dfe93f78807aa868f9b9ff14">view</a>]</li>
 <li>Bug <a href="https://github.com/doxygen/doxygen/issues/1662">1662</a> - Fix missing title in non-page docanchors from tag files [<a href="https://github.com/doxygen/doxygen/commit/616b392e9bc8984251d969577a5b63974efb1eef">view</a>]</li>
 <li>Bug <a href="https://github.com/doxygen/doxygen/issues/2763">2763</a> - FILTER_PATTERNS won&#39;t take command with arguments [<a href="https://github.com/doxygen/doxygen/commit/ce7a983c2849e4c8fa72189a896e594a8497dd4c">view</a>]</li>
 <li>Bug <a href="https://github.com/doxygen/doxygen/issues/4691">4691</a> - Uses &lt;img&gt; instead of &lt;object&gt; html tag for SVG images [<a href="https://github.com/doxygen/doxygen/commit/8ccd98643a3b88aaa3245b76202666900a2cd401">view</a>]</li>
-<li>Bug <a href="https://github.com/doxygen/doxygen/issues/5174">5174</a> - error state 21 with fortran code (fixed format) [<a href="https://github.com/doxygen/doxygen/commit/fdee5e9fade0ff5a578817048c6205f2a9acbced">view</a>]</li>
+<li>Bug <a href="https://github.com/doxygen/doxygen/issues/5174">5174</a> - error state 21 with Fortran code (fixed format) [<a href="https://github.com/doxygen/doxygen/commit/fdee5e9fade0ff5a578817048c6205f2a9acbced">view</a>]</li>
 <li>Bug <a href="https://github.com/doxygen/doxygen/issues/5323">5323</a> - Missing Page References in the Index Chapters of the LaTex/PDF output [<a href="https://github.com/doxygen/doxygen/commit/efd49dacfbae1ad55d7922a748e2c1d60068b014">view</a>]</li>
 <li>Bug <a href="https://github.com/doxygen/doxygen/issues/5411">5411</a> - Inherited member of template class issues warning and is not documented [<a href="https://github.com/doxygen/doxygen/commit/4dfc5887660284b345eb93b6c07dc1f91e780fac">view</a>]</li>
 <li>Bug <a href="https://github.com/doxygen/doxygen/issues/5711">5711</a> - Fortran: attributes after a blank line are ignored / Bug <a href="https://github.com/doxygen/doxygen/issues/3880">3880</a> - FORTRAN: comment in subroutine argument list [<a href="https://github.com/doxygen/doxygen/commit/e9ebf43585bffee80c31dd69538feae2a4525178">view</a>]</li>
 <li>Bug <a href="https://github.com/doxygen/doxygen/issues/5933">5933</a> - Phantom variables/functions in XML, created from non-code files [<a href="https://github.com/doxygen/doxygen/commit/7dc9b378a107b1ccae2245b3f3f3d628db2bd008">view</a>]</li>
 <li>Bug <a href="https://github.com/doxygen/doxygen/issues/5937">5937</a> - CASE_SENSE_NAMES ignored [<a href="https://github.com/doxygen/doxygen/commit/fab854a10f358c15a69291a59388ea0c184bce20">view</a>]</li>
 <li>Bug <a href="https://github.com/doxygen/doxygen/issues/5938">5938</a> - Spaces between the closing bracket of the typename and the opening bracket of the parameter list cause detection issues. [<a href="https://github.com/doxygen/doxygen/commit/622d18637f9d633b184e43fd3594b661cf4e9375">view</a>]</li>
-<li>Bug <a href="https://github.com/doxygen/doxygen/issues/5941">5941</a> - python unicode docstrings are ignored [<a href="https://github.com/doxygen/doxygen/commit/936f242956350825d870f7396ae5d6106fe3081d">view</a>]
+<li>Bug <a href="https://github.com/doxygen/doxygen/issues/5941">5941</a> - python Unicode docstrings are ignored [<a href="https://github.com/doxygen/doxygen/commit/936f242956350825d870f7396ae5d6106fe3081d">view</a>]
 , [<a href="https://github.com/doxygen/doxygen/commit/be100f882604a23d94025fee6d059bdb5ec28d3e">view</a>]</li>
 <li>Bug <a href="https://github.com/doxygen/doxygen/issues/5945">5945</a> - Do not allow ligatures in log output [<a href="https://github.com/doxygen/doxygen/commit/894bdfdf268ba24a268fa72d7b33899a9f3a126b">view</a>]</li>
 <li>Bug <a href="https://github.com/doxygen/doxygen/issues/5958">5958</a> - References for one function can inherit References from subsequent non documented function [<a href="https://github.com/doxygen/doxygen/commit/9abcad810b8d41d338d501ff5b32524e1ced7f33">view</a>]</li>
 <li>Bug <a href="https://github.com/doxygen/doxygen/issues/5981">5981</a> - quick link index in alphabetical class list in classes.html doesn&#39;t work [<a href="https://github.com/doxygen/doxygen/commit/ec1ef7b4971540bbe042b16d7ebd3f2a0e0e57f1">view</a>]</li>
 <li>Bug <a href="https://github.com/doxygen/doxygen/issues/5982">5982</a> - Bad character escaping scheme in HTML anchor generation. [<a href="https://github.com/doxygen/doxygen/commit/6136cf9e3ad70d58cac4d8022cce8c8729805119">view</a>]</li>
 <li>Bug <a href="https://github.com/doxygen/doxygen/issues/5983">5983</a> - `@addindex`entries fail to link to the exact location in Compiled HTML Help. [<a href="https://github.com/doxygen/doxygen/commit/8dea6e11faf3969c3b6b17b700533f43c9ca73f8">view</a>]</li>
-<li>Bug <a href="https://github.com/doxygen/doxygen/issues/5985">5985</a> - Java: final keyword on a parameter brakes docs inherinance [<a href="https://github.com/doxygen/doxygen/commit/dfd0336f1a97e189d49e29860db1c43915aced76">view</a>]</li>
+<li>Bug <a href="https://github.com/doxygen/doxygen/issues/5985">5985</a> - Java: final keyword on a parameter brakes docs inheritance [<a href="https://github.com/doxygen/doxygen/commit/dfd0336f1a97e189d49e29860db1c43915aced76">view</a>]</li>
 <li>Bug <a href="https://github.com/doxygen/doxygen/issues/5991">5991</a> - Using `@page` to add title to Markdown file generates surplus empty page. [<a href="https://github.com/doxygen/doxygen/commit/42c7d88ffc11651d1fb6b997fd23cc938bce4a39">view</a>]</li>
 <li>Bug <a href="https://github.com/doxygen/doxygen/issues/5998">5998</a> - DOT_PATH not expanded [<a href="https://github.com/doxygen/doxygen/commit/752523cd122d6ffdd72c89955005d77819740675">view</a>]</li>
 <li>Bug <a href="https://github.com/doxygen/doxygen/issues/5999">5999</a> - Files with incorrect extensions (.doc) are picked up by doxygen [<a href="https://github.com/doxygen/doxygen/commit/14b04be2af279e1093f17d6b933d1e9ab530e128">view</a>]</li>
 <li>Documentation for extensions .f95, .f03 and .f08 [<a href="https://github.com/doxygen/doxygen/commit/4c2e91c10dc6d007c410cd282a00fc7a42d38a0d">view</a>]</li>
 <li>Doxygen fails to copy logo image to LaTex output dir [<a href="https://github.com/doxygen/doxygen/commit/711c6c0bee87d47d70b3ffa9ca8b39b704e91723">view</a>]</li>
 <li>FORTRAN determination string in preprocessing [<a href="https://github.com/doxygen/doxygen/commit/4a7673fed2f28a24e0c7e8bb94621b0e14ac9ed5">view</a>]</li>
-<li>Feature: Translations for german language (changes since 1.8.4) [<a href="https://github.com/doxygen/doxygen/commit/261077497f2bcc3364e182e338d914c470a0a235">view</a>]</li>
+<li>Feature: Translations for German language (changes since 1.8.4) [<a href="https://github.com/doxygen/doxygen/commit/261077497f2bcc3364e182e338d914c470a0a235">view</a>]</li>
 <li>Fix STRIP_FROM_PATH when running from drive root [<a href="https://github.com/doxygen/doxygen/commit/fd808ae3c1e37a8d476d250cf6b4325624a9eccb">view</a>]</li>
 <li>Fix Windows build instructions. [<a href="https://github.com/doxygen/doxygen/commit/eec8d0a31161746041fc94ccbba5a54aecd8cf93">view</a>]</li>
 <li>Fix documentation typos [<a href="https://github.com/doxygen/doxygen/commit/770adb37b2072bbea5412f9cc2058d98d1de60e4">view</a>]</li>
 <li>Fix for HTML output when using server side search and the new menu bar [<a href="https://github.com/doxygen/doxygen/commit/0faf45600c6c640bfaf11b017d43a4b9de193ebf">view</a>]</li>
-<li>Fix for changed references due to different removeRedudantWhiteSpace() implementation [<a href="https://github.com/doxygen/doxygen/commit/f26cc41d0d3d436c809c293a56c66c1f5f953745">view</a>]</li>
+<li>Fix for changed references due to different removeRedundantWhiteSpace() implementation [<a href="https://github.com/doxygen/doxygen/commit/f26cc41d0d3d436c809c293a56c66c1f5f953745">view</a>]</li>
 <li>Fix for empty file name [<a href="https://github.com/doxygen/doxygen/commit/0fead5249b8ef2c3c5cbbbd712855bae877aa27b">view</a>]</li>
 <li>Fix for error in travis.yml [<a href="https://github.com/doxygen/doxygen/commit/81cf39f249c58db66368d60d596ac164d886ae90">view</a>]</li>
 <li>Fix issue escaping backslash inside markdown style code span [<a href="https://github.com/doxygen/doxygen/commit/402970f77f961b85b6371c8e53bd69981435c2d7">view</a>]</li>
 <li>Fix linker flags for building with clang on Windows [<a href="https://github.com/doxygen/doxygen/commit/41846b467bea58b904e26ce139394f7371ea5870">view</a>]</li>
-<li>Fix order of member initilaization [<a href="https://github.com/doxygen/doxygen/commit/6b1ebb6bcb345d8997054492c21276dc2dc36416">view</a>]</li>
+<li>Fix order of member initialization [<a href="https://github.com/doxygen/doxygen/commit/6b1ebb6bcb345d8997054492c21276dc2dc36416">view</a>]</li>
 <li>Fix return-type warnings with -DNDEBUG [<a href="https://github.com/doxygen/doxygen/commit/f4574baf118da6aa2051b865040a9948bb0d22c9">view</a>]</li>
 <li>Fix search box rendering in HTML when menu bar is disabled [<a href="https://github.com/doxygen/doxygen/commit/ee9a0664c03c306d0aeb127295ced29f8078ae03">view</a>]</li>
 <li>Fix uppercase letters B-Z being unnecessarily escaped in index HTML anchors. [<a href="https://github.com/doxygen/doxygen/commit/0f699ab17cb88beff0ae4aa9b10042c0ccaff937">view</a>]</li>
 <li>Fix error documentation of in flex debug script [<a href="https://github.com/doxygen/doxygen/commit/09c4e990e4e214900e613343fb9bfbbb08f1bc53">view</a>]</li>
 <li>Fix for broken link in the manual [<a href="https://github.com/doxygen/doxygen/commit/355370151b61f79633b3867634d76eaf8bacce54">view</a>]</li>
 <li>Fix hexChar for inputs 0 &lt;= i &lt; 10 [<a href="https://github.com/doxygen/doxygen/commit/327422d131ed5e6ddf280043b5a56a6fb92d3bbc">view</a> and [<a href="https://github.com/doxygen/doxygen/commit/62da4521880a03b8a92887539eaf76ccad2ee770">view</a>]</li>
-<li>Fix spelling in doc/commands.doc (descriptionm) [<a href="https://github.com/doxygen/doxygen/commit/bd7da008fac074202e3265787907434fbfb40e71">view</a>]</li>
+<li>Fix spelling in doc/commands.doc (description) [<a href="https://github.com/doxygen/doxygen/commit/bd7da008fac074202e3265787907434fbfb40e71">view</a>]</li>
 <li>Fix typo in function name [<a href="https://github.com/doxygen/doxygen/commit/ace0af42e330a96ad691b2d9a08dd3ff4abb2629">view</a> and [<a href="https://github.com/doxygen/doxygen/commit/b890f40d195b9dc5db12aaa398707de138093c66">view</a>]</li>
 <li>Fixed a couple of small memory leaks [<a href="https://github.com/doxygen/doxygen/commit/85ddfc814f33943199928447b4627d05b0920b99">view</a>]</li>
 <li>Fixed a number of memory leaks in the template engine [<a href="https://github.com/doxygen/doxygen/commit/d14bcd1f8f5bd4a2034bae842000630f4e098eb6">view</a>]</li>
 <li>Moved creation of inline class documentation to separate template file [<a href="https://github.com/doxygen/doxygen/commit/4bd50c9f0dc1d7b1413a6bda587b8a5999cd7a19">view</a>]</li>
 <li>RTF improvement: Example section was merged with next function title [<a href="https://github.com/doxygen/doxygen/commit/ca617e1e1cd42ee0080c8c13ce3884c8671629dd">view</a>]</li>
 <li>Remove obsolete py files [<a href="https://github.com/doxygen/doxygen/commit/183f36fe97cb95636f1947c2c4be61f7b78f87e0">view</a>]</li>
-<li>Removed BOM marker from greek translator to avoid Visual C warnings [<a href="https://github.com/doxygen/doxygen/commit/9ee8f777f5a4b7a49e644c2da5247fa509038feb">view</a>]</li>
+<li>Removed BOM marker from Greek translator to avoid Visual C warnings [<a href="https://github.com/doxygen/doxygen/commit/9ee8f777f5a4b7a49e644c2da5247fa509038feb">view</a>]</li>
 <li>Repaired breaking @include for LaTeX output [<a href="https://github.com/doxygen/doxygen/commit/ab861c197c596f78c7aea4f45c0e1252de10fc1f">view</a>]</li>
 <li>Revert &quot;Spelling correction for error message with USE_HTAGS usage&quot; [<a href="https://github.com/doxygen/doxygen/commit/a888543ca5f3fd28121f7eea4dbd25898fa7be57">view</a>]</li>
 <li>Revert using container-based infra as sudo is needed :-( [<a href="https://github.com/doxygen/doxygen/commit/f089c3fa4f47dc8bedd25d9d857d004525ee82c0">view</a>]</li>
 <li>Using tabu package for LaTeX tables [<a href="https://github.com/doxygen/doxygen/commit/647b6ac8669cd8ba1e8c60eeb3c2de961c7d6a1b">view</a>]</li>
 <li>[Bug <a href="https://github.com/doxygen/doxygen/issues/5872">5872</a>] On Windows, generated layout is with UNIX EOL [<a href="https://github.com/doxygen/doxygen/commit/78a80001223af290c7c7321ad2d210fb3cd16f11">view</a>]</li>
 <li>[Doxygen-users] plugin / filter not behaving as expected [<a href="https://github.com/doxygen/doxygen/commit/0c7f182016c7c2604a484367738e76cb40c0541b">view</a>]</li>
-<li>add spaces like &quot;Doyxgen&quot;CN_SPC-&gt;&quot;Doyxgen&quot; CN_SPC [<a href="https://github.com/doxygen/doxygen/commit/35d1aa8bf9208302601fa96462e246c98aa0b0e5">view</a>]</li>
+<li>add spaces like &quot;Doxygen&quot;CN_SPC-&gt;&quot;Doxygen&quot; CN_SPC [<a href="https://github.com/doxygen/doxygen/commit/35d1aa8bf9208302601fa96462e246c98aa0b0e5">view</a>]</li>
 <li>allow building with custom iconv on Windows [<a href="https://github.com/doxygen/doxygen/commit/3d684f6d123abdbf630bb19bc6095cc9d69efb68">view</a>]</li>
 <li>doc: generate doxygen&#39;s documentation. [<a href="https://github.com/doxygen/doxygen/commit/3c4a1ea2ee56f2604c2277f13737d53b3a0b0353">view</a>]</li>
 <li>doc: put man pages under share/man/man1 [<a href="https://github.com/doxygen/doxygen/commit/95d28153779810dc95afafa38ed838f32516a1f4">view</a>]</li>
 <li>Bug <a href="https://github.com/doxygen/doxygen/issues/5720">5720</a> - &lt;CAPTION&gt; inside &lt;TABLE&gt; no longer works for LaTex output [<a href="https://github.com/doxygen/doxygen/commit/0599f92d06ff433446f34136ffe2f3d65d6bd109">view</a>]</li>
 <li>Bug <a href="https://github.com/doxygen/doxygen/issues/5726">5726</a> - Duplicate anchors from tagfiles [<a href="https://github.com/doxygen/doxygen/commit/1f21c23c57c91ba6901c0de38bb236f7246e88c9">view</a>]</li>
 <li>Bug <a href="https://github.com/doxygen/doxygen/issues/5727">5727</a> - Tagfile anchors not generated for enumeration values [<a href="https://github.com/doxygen/doxygen/commit/1d4f37cb13a75ca8bdc49be3558438104e7eef19">view</a>]</li>
-<li>Bug <a href="https://github.com/doxygen/doxygen/issues/5728">5728</a> - Non-ascii characters are not emphasised [<a href="https://github.com/doxygen/doxygen/commit/8f67d4f63efd45b0d38502bdf68987d7fc1e92e9">view</a>]</li>
+<li>Bug <a href="https://github.com/doxygen/doxygen/issues/5728">5728</a> - Non-ascii characters are not emphasized [<a href="https://github.com/doxygen/doxygen/commit/8f67d4f63efd45b0d38502bdf68987d7fc1e92e9">view</a>]</li>
 <li>Bug <a href="https://github.com/doxygen/doxygen/issues/5744">5744</a> - Using TAGFILES prevents symbol extraction [<a href="https://github.com/doxygen/doxygen/commit/a735498be5a572236755cc3da65bf4774cbac25c">view</a>]</li>
 <li>Bug <a href="https://github.com/doxygen/doxygen/issues/5753">5753</a> - PATCH: please consider making doxygen output byte for byte identical between individual runs by default [<a href="https://github.com/doxygen/doxygen/commit/3f2e8a3067712b025623e4420e6eb161febfd42b">view</a>]</li>
 <li>Bug <a href="https://github.com/doxygen/doxygen/issues/5754">5754</a> - Doxygen generates bad &quot;More...&quot; file links for functions within a namespace [<a href="https://github.com/doxygen/doxygen/commit/ea202be55d68af33917658e3fec169da3a7fa7a8">view</a>]</li>
 <li>Bug <a href="https://github.com/doxygen/doxygen/issues/5690">5690</a> - Crash when building gtkmm documentation [<a href="https://github.com/doxygen/doxygen/commit/050fce2b73d6e4455808ab86da2fddcf2f26e9b5">view</a>]</li>
 <li>Bug <a href="https://github.com/doxygen/doxygen/issues/5694">5694</a> - \cite confused by labels ending with a dot (improved warning message) [<a href="https://github.com/doxygen/doxygen/commit/78fd02dc41384d81baddf17ff0bb3431267452fc">view</a>]</li>
 <li>fix docbook output [<a href="https://github.com/doxygen/doxygen/commit/1a403d80160458091bab7c442e54f836c0b90bca">view</a>]
-    <ol><li>support other than english</li>
+    <ol><li>support other than English</li>
         <li>fix broken example link id</li>
-        <li>fix incomplete TOC : no Classe etc.</li>
+        <li>fix incomplete TOC : no Classes etc.</li>
         <li>add brief description for Functions etc.</li>
         <li>Comply with REPEAT_BRIEF </li>
         <li>Do not output duplicated contents when detailed description is missing.</li>
 <li>Bug <a href="https://github.com/doxygen/doxygen/issues/5456">5456</a> - Crash on \addindex \term [<a href="https://github.com/doxygen/doxygen/commit/653a2a8b123b79835af9f684f8b92ef7f88712aa">view</a>]</li>
 <li>A new files have been added but is not incorporated in the windows build part [<a href="https://github.com/doxygen/doxygen/commit/d9dd873e25fba968ddcbcc79d6643f5df669b626">view</a>]</li>
 <li>Add docbook directory to be removed as well [<a href="https://github.com/doxygen/doxygen/commit/08ea10029e705a388ab14ee29544d496a203f23f">view</a>]</li>
-<li>Add extra (documenattion) directories to ignore pattern [<a href="https://github.com/doxygen/doxygen/commit/db358b1f219fecf0d7df96d8c70b47b245471c66">view</a>]</li>
+<li>Add extra (documentation) directories to ignore pattern [<a href="https://github.com/doxygen/doxygen/commit/db358b1f219fecf0d7df96d8c70b47b245471c66">view</a>]</li>
 <li>Add index support to context [<a href="https://github.com/doxygen/doxygen/commit/12cd22f4c32ed8b92da7b5a03181aa6735018a5b">view</a>]</li>
 <li>Add line numbers in case comment is not closed properly. [<a href="https://github.com/doxygen/doxygen/commit/b1d513b2ac65fe26ceec2fa494867713efa01cd5">view</a>]</li>
 <li>Add template context for annotated class index [<a href="https://github.com/doxygen/doxygen/commit/9434ecb13e1f3e2901b78d3e41e7f1d7d9469434">view</a>]</li>
 <li>Fix id parsing for atx markdown headers [<a href="https://github.com/doxygen/doxygen/commit/ee830bb8888535ac48c0c4fd90580542e7f70481">view</a>]</li>
 <li>Fix segfault on invalid bounding FIG when patching dot [<a href="https://github.com/doxygen/doxygen/commit/1bd2e38a2ce2d0823557381c48fe47cb53d6fba8">view</a>]</li>
 <li>Fix to VHDL scanner. [<a href="https://github.com/doxygen/doxygen/commit/5ca7d423a11337d5c31082f52a287a3dc0986642">view</a>]</li>
-<li>Fix typos in russian translation [<a href="https://github.com/doxygen/doxygen/commit/8ce2b0d7aec1d4398b5b4f365a7d3abbe75daf5f">view</a>]</li>
+<li>Fix typos in Russian translation [<a href="https://github.com/doxygen/doxygen/commit/8ce2b0d7aec1d4398b5b4f365a7d3abbe75daf5f">view</a>]</li>
 <li>Fixed Tidy&#39;s &#39;empty span&#39; warning in HTML output [<a href="https://github.com/doxygen/doxygen/commit/8cfac90d6c8632436db1a6b650a05a8dfcfab5d0">view</a>]</li>
 <li>Fixed compiler warnings in section.h [<a href="https://github.com/doxygen/doxygen/commit/683ef76f7bf1ba929f9c263064bb5f6c8e377275">view</a>]</li>
 <li>Fixed difference between generated XML schema and XML files for HTML entities [<a href="https://github.com/doxygen/doxygen/commit/836af2f9510d10f2dd7d832025f214983387b3c6">view</a>]</li>
 <li>Fixed typo in doxyindexer.vcproj [<a href="https://github.com/doxygen/doxygen/commit/2bc8a820b3e2fefaedb10a3129eed35581a1ea5b">view</a>]</li>
 <li>Fixes for missing build dependencies [<a href="https://github.com/doxygen/doxygen/commit/62379ff8fdb13d95c7651419d92db47150e15bcc">view</a>]</li>
 <li>Give message when PROJECT_LOGO cannot be found or cannot be converted [<a href="https://github.com/doxygen/doxygen/commit/164864d9bc8ea7e32a69fbc0e47cff54dc678a48">view</a>]</li>
-<li>Handlingh of -- by \c and &lt;code&gt; results in - adjusted documentation [<a href="https://github.com/doxygen/doxygen/commit/73d12cc5cf0656e94125baea62cdb19b67908b3d">view</a>]</li>
+<li>Handling of -- by \c and &lt;code&gt; results in - adjusted documentation [<a href="https://github.com/doxygen/doxygen/commit/73d12cc5cf0656e94125baea62cdb19b67908b3d">view</a>]</li>
 <li>Improve rendering of sub and superscripts in LaTeX [<a href="https://github.com/doxygen/doxygen/commit/a7c7f36ea2a67969bf3916c7600fe487e34438c0">view</a>]</li>
 <li>Improved handling of percent symbol [<a href="https://github.com/doxygen/doxygen/commit/0e080f486f67008ef427c834f6ab6ebca7578124">view</a>]</li>
 <li>Improved performance of rendering large index pages, by replacing images in the tables by spans [<a href="https://github.com/doxygen/doxygen/commit/956a7fb004e72923f737e387d053812f99b7bda2">view</a>]</li>
 <li>Use hook arrow for hyphens in symbol names in the LaTeX output. [<a href="https://github.com/doxygen/doxygen/commit/ac813134a85ba9bd999fb4cf8271c74e02cd4ebb">view</a>]</li>
 <li>Wrong UTF 8 codes [<a href="https://github.com/doxygen/doxygen/commit/fd4beb272e5f1a760a71ab8d85463b8356c6f786">view</a>]</li>
 <li>Fix broken links to subpages in LaTeX output [<a href="https://github.com/doxygen/doxygen/commit/10189681dcb46e543a287827e2096cef3dbc42ae">view</a>]</li>
-<li>\xmlonly aoppeared twice in see also section of \htmlonly and \docbookonly [<a href="https://github.com/doxygen/doxygen/commit/f1cdb27194dd180f1bff1fbdd87874bb0d15758d">view</a>]</li>
+<li>\xmlonly appeared twice in see also section of \htmlonly and \docbookonly [<a href="https://github.com/doxygen/doxygen/commit/f1cdb27194dd180f1bff1fbdd87874bb0d15758d">view</a>]</li>
 <li>add css-escape to avoid jquery based xss [<a href="https://github.com/doxygen/doxygen/commit/7fea82094723ecfb4e9b3ea6819137b99d7dfa9c">view</a>]</li>
 <li>add parameter [<a href="https://github.com/doxygen/doxygen/commit/c5bc9fc8c407aac845d594b2685d0c92699727d8">view</a>]</li>
 <li>add search.py, a client for doxygen_sqlite3.db [<a href="https://github.com/doxygen/doxygen/commit/697ac97aad7fa045b6cc205050b69cf3f22408ad">view</a>]</li>
 <li> Allow links to other markdown pages of the form [link text](page.md)</li>
 <li> Avoid accessing uninitialized memory in fileToString</li>
 <li> Build problem with unistd.h and Cygwin The standard g++ compiler under windows (win32-g++) has unistd.gh file; Microsoft windows does not have it, therefore it is better to use the winbuild directory in case of windows and no dependency otherwise</li>
-<li> Consistency in language part of the documentation Made documentation more inline with other parts of the documentation (regarding the way e.g. filenames are presented) Corrected some spelling errors Corrected the warning in the language.doc by placing ta reference to the files from which language.doc is generated Corrected the color for the languages that are still v1.4.6 (language name now also red  in stead of a pink background, was confusing with languages that were 1.5 / 1.6 compatible)</li>
+<li> Consistency in language part of the documentation Made documentation more inline with other parts of the documentation (regarding the way e.g. filenames are presented) Corrected some spelling errors Corrected the warning in the language.doc by placing a reference to the files from which language.doc is generated Corrected the color for the languages that are still v1.4.6 (language name now also red  in stead of a pink background, was confusing with languages that were 1.5 / 1.6 compatible)</li>
 <li> Corrected some inconsistencies in the comments</li>
 <li> Debug output for lexical analyzer</li>
 <li> Deleted generated files from source repository</li>
 <li> Bug <a href="https://github.com/doxygen/doxygen/issues/5225">5225</a> - Segmentation fault parsing a fortran file</li>
 <li> Bug <a href="https://github.com/doxygen/doxygen/issues/5226">5226</a> - Can't use @ref instead of \ref with msc</li>
 <li> Bug <a href="https://github.com/doxygen/doxygen/issues/5228">5228</a> - Misleading warning about DOT font</li>
-<li> Bug <a href="https://github.com/doxygen/doxygen/issues/5233">5233</a> - Out-of-line docs for class template specialisations failing</li>
+<li> Bug <a href="https://github.com/doxygen/doxygen/issues/5233">5233</a> - Out-of-line docs for class template specializations failing</li>
 <li> Bug <a href="https://github.com/doxygen/doxygen/issues/5234">5234</a> - Generated XML is malformed</li>
 <li> Bug <a href="https://github.com/doxygen/doxygen/issues/5239">5239</a> - Nested Aliases fail when the nested alias has two or more arguments.</li>
 <li> Bug <a href="https://github.com/doxygen/doxygen/issues/5242">5242</a> - doxygen don't hide private Inherited Members</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/5056">5056</a>: Added support for processing DocSets with Dash (thanks to
        Bogdan Popescu for the patch </li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/4900">4900</a>: Added option EXTERNAL_PAGES which can be used to determine
-       whether or not pages importated via tags will appear under related 
+       whether or not pages imported via tags will appear under related 
        pages (similar to EXTERNAL_GROUPS).</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/5042">5042</a>: Added new MathJax command MATHJAX_CODEFILE which supports
        including a file with MathJax related scripting to be inserted before
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/4650">4650</a>: Replaced "echo -n" with "printf" in the configure script.</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/4684">4684</a>: Removed warning when using \endinternal</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/4696">4696</a>: Added &amp;, @, and # as allowed characters for commands that</li>
-<li>   id <a href="https://github.com/doxygen/doxygen/issues/4788">4788</a>: Included patch by Abert to correctly link pages in the manual</li>
+<li>   id <a href="https://github.com/doxygen/doxygen/issues/4788">4788</a>: Included patch by Albert to correctly link pages in the manual</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/4850">4850</a>: Added support for single column Markdown tables.</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/4855">4855</a>: Incomplete documentation on doxygen -w latex</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/4877">4877</a>: Doxygen crashed when structural commands (like \var) appeared 
        rather than the file name.</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/5059">5059</a>: build using ./configure ; make did not work if the path
        contained a space.</li>
-<li>   id <a href="https://github.com/doxygen/doxygen/issues/5060">5060</a>: Tag files are now identfied by the full path instead of
+<li>   id <a href="https://github.com/doxygen/doxygen/issues/5060">5060</a>: Tag files are now identified by the full path instead of
        only the name of the tag file.</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/5086">5086</a>: In some cases members were missing from the tag file.</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/5079">5079</a>: Fortran: derive intent from documentation in case no 
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/5001">5001</a>: Fixed case where doxygen would during preprocessing.</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/5002">5002</a>: A file specified using HTML_EXTRA_STYLEHSHEET did not end
        up in the Qt Help index.</li>
-<li>   Improved the way enum's are rendered in the HTML output.</li>
+<li>   Improved the way enums are rendered in the HTML output.</li>
 <li>   When inlining structs (INLINE_SIMPLE_STRUCTS=YES) a &lt;p&gt; was missing
        for members with a detailed description, causing invalid XHTML.</li>
 <li>   Fixed problem loading the navigation tree when using .xhtml as the
 <li>   Added option AUTOLINK_SUPPORT which can be used to enable/disable
        autolinking globally.</li>
 <li>   Included language updates for Czech, Spanish, Greek, Slovak, and 
-       Esparanto.</li>
+       Esperanto.</li>
 </ul>
 <h3>Bug fixes</h3>
 <ul>
@@ -2865,8 +3113,8 @@ make sure you add the following:
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/4651">4651</a>: Included patch by Ryan Schmidt to make the Mac versions
        in qglobal.h match that of Apple header files.</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/4659">4659</a>: Added C++11 classes when BUILTIN_STL_SUPPORT is enabled.</li>
-<li>   id <a href="https://github.com/doxygen/doxygen/issues/4662">4662</a>: Using a backslash in a section cause 026E30F to appear in the
-       latex TOC.</li>
+<li>   id <a href="https://github.com/doxygen/doxygen/issues/4662">4662</a>: Using a backslash in a section causes 026E30F to appear in the
+       LaTeX TOC.</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/4675">4675</a>: Fortran: case sensitiveness for routines and functions 
        did not work</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/4676">4676</a>: Fortran: continuation by ampersand not placed in code output.</li>
@@ -2929,7 +3177,7 @@ make sure you add the following:
             (amount of &gt;'s determine the indentation level).</li>
        <li> emphasis using *emphasize this* or _emphasis this_ or
             strong emphasis using **emphasis this**. Unlike classic
-            Markdown 'some_great_indentifier' is not touched.</li>
+            Markdown 'some_great_identifier' is not touched.</li>
        <li> code spans can be created using back-ticks, i.e. `here's an example`</li>
        <li> Using three or more -'s or *'s alone on a line with only spaces
             will produce a horizontal ruler.</li>
@@ -3249,7 +3497,7 @@ make sure you add the following:
        depending on the code page (thanks to Hirao for the patch).</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/2867">2867</a>: The .spec file in the source distribution did not get
        updated to the latest version.</li>
-<li>   id <a href="https://github.com/doxygen/doxygen/issues/2872">2872</a>: Fortran: Continuation character was not recognised in 
+<li>   id <a href="https://github.com/doxygen/doxygen/issues/2872">2872</a>: Fortran: Continuation character was not recognized in 
        fixed format code.</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/2887">2887</a>: Fortran: @param checking was not case insensitive.</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/3168">3168</a>: Fixed problem combining @cond with preprocessor directives.</li>
@@ -3285,7 +3533,7 @@ make sure you add the following:
        GENERATE_TREEVIEW was enabled.</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/4242">4242</a>: Linking to a section on the main page could result in a
        broken link when GENERATE_TREEVIEW was enabled.</li>
-<li>   id <a href="https://github.com/doxygen/doxygen/issues/4243">4243</a>: Fixed invalid warning when using @deparated method with
+<li>   id <a href="https://github.com/doxygen/doxygen/issues/4243">4243</a>: Fixed invalid warning when using @deprecated method with
        default values for parameters.</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/4245">4245</a>: A function made related using @relates could end up in
        the wrong class if there was already a method with a matching
@@ -3373,7 +3621,7 @@ make sure you add the following:
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/4085">4085</a>: using @dot...@endot produced an image referenced with
                   absolute path.</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/4091">4091</a>: \mscfile did not work properly for LaTeX output.</li>
-<li>   id <a href="https://github.com/doxygen/doxygen/issues/4095">4095</a>: Fixed problem where #include's could cause phantom __pad__
+<li>   id <a href="https://github.com/doxygen/doxygen/issues/4095">4095</a>: Fixed problem where #include could cause phantom __pad__
                   members to appear in the output (appeared on Windows only).</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/4103">4103</a>: Options PROJECT_LOGO and PROJECT_BRIEF were missing
                   from the manual.</li>
@@ -3397,7 +3645,7 @@ make sure you add the following:
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/4128">4128</a>: Included patch to fix broken hyperlink to page entry 
                   in xreflists.</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/4136">4136</a>: Header of \page was wrong in Man page output.</li>
-<li>   id <a href="https://github.com/doxygen/doxygen/issues/4137">4137</a>: #include's to other directories were not always linked.</li>
+<li>   id <a href="https://github.com/doxygen/doxygen/issues/4137">4137</a>: #include to other directories were not always linked.</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/4140">4140</a>: Using "use Foo\Foo;" in PHP could cause doxygen to hang.</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/4142">4142</a>: In some cases the HTML output could contain an extra &lt;/p&gt;.</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/4147">4147</a>: Tooltips with HTML entities could be wrongly truncated.</li>
@@ -3423,7 +3671,7 @@ make sure you add the following:
 <h3>Changes</h3>
 <ul>
 <li>   Added a header for each HTML page above the navigation menu, 
-       showing the project name and logo and a short descriptin (all optional).
+       showing the project name and logo and a short description (all optional).
        Disabling the index (with DISABLE_INDEX) still shows the new header
        (you can still customize this using HTML_HEADER). This now works
        nicely in combination with GENERATE_TREEVIEW = YES and/or
@@ -3466,7 +3714,7 @@ make sure you add the following:
        (thanks to Albert).</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/3731">3731</a>: Fixed problem handling @cond..@endcond in Fortran code.</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/3779">3779</a>: Scope was missing in Tokens.xml when using docsets.</li>
-<li>   id <a href="https://github.com/doxygen/doxygen/issues/3870">3870</a>, <a href="https://github.com/doxygen/doxygen/issues/2891">2891</a>: Applied patch tp avoid stripping prefixes for Fortran 
+<li>   id <a href="https://github.com/doxygen/doxygen/issues/3870">3870</a>, <a href="https://github.com/doxygen/doxygen/issues/2891">2891</a>: Applied patch to avoid stripping prefixes for Fortran 
        subroutines.</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/3895">3895</a>: allow label before end statement in Fortran</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/3956">3956</a>: &lt;/see&gt; was not handled properly in comment block.</li>
@@ -3538,7 +3786,7 @@ make sure you add the following:
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/2097">2097</a>, <a href="https://github.com/doxygen/doxygen/issues/2669">2669</a>: /// were not stripped from formulas and \dot..\enddot</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/3190">3190</a>: dropped support for a4wide paper format for LaTeX, since
        it is on the LaTeX taboo list.</li>
-<li>   id <a href="https://github.com/doxygen/doxygen/issues/3261">3261</a>: Behaviour of CLASS_DIAGRAM=NO in combination with
+<li>   id <a href="https://github.com/doxygen/doxygen/issues/3261">3261</a>: Behavior of CLASS_DIAGRAM=NO in combination with
        HAVE_DOT=YES, was not properly documented.</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/3332">3332</a>: Python comments for next class or method could end up in
        code of a method/class when enabling INLINE_SOURCES.</li>
@@ -3578,7 +3826,7 @@ make sure you add the following:
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/3877">3877</a>: In the HTML output &lt;/div&gt; was missing for built-in
        class diagrams.</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/3876">3876</a>: References in example files with underscores were wrong.</li>
-<li>   id <a href="https://github.com/doxygen/doxygen/issues/"></a>: When using Japanese characters mixed with ascii characters
+<li>   id <a href="https://github.com/doxygen/doxygen/issues/"></a>: When using Japanese characters mixed with ASCII characters
        doxygen incorrectly ended the brief description with a dot.</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/3886">3886</a>: setting MULTILINE_CPP_IS_BRIEF to YES, cause /// to appear
        in the output.</li>
@@ -3590,7 +3838,7 @@ make sure you add the following:
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/3898">3898</a>: \copydoc did not work for array type arguments (e.g. int[]).</li>
 <li>   Use \dotfile did not produce the correct map file, so URLs in dot
        files did not work.</li>
-<li>   id <a href="https://github.com/doxygen/doxygen/issues/3907">3907</a>: #define's in files only found via INCLUDE_PATH were not
+<li>   id <a href="https://github.com/doxygen/doxygen/issues/3907">3907</a>: #define in files only found via INCLUDE_PATH were not
        correctly handled.</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/3918">3918</a>: auto brief description ending with .) cause the ) to
        end up in the detailed part.</li>
@@ -3602,7 +3850,7 @@ make sure you add the following:
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/3937">3937</a>: Latex makefile clean target used rm command also for Windows.</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/3939">3939</a>: the EXCLUDE_SYMBOLS option was missing form the online docs.</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/3962">3962</a>: \htmlinclude and \verbinclude ended the brief description.</li>
-<li>   id <a href="https://github.com/doxygen/doxygen/issues/3963">3963</a>: Inconsistent behaviour when a brief description was given 
+<li>   id <a href="https://github.com/doxygen/doxygen/issues/3963">3963</a>: Inconsistent behavior when a brief description was given 
        following by a detailed comment block with JAVADOC_AUTOBRIEF enabled.</li>
 <li>   Fixed a number of typos in the documentation 
        (thanks to Albert)</li>
@@ -3678,7 +3926,7 @@ make sure you add the following:
        and HTML_COLORSTYLE_GAMMA, which control respectively the hue, 
        saturation, and gamma of all elements in the HTML output.</li>
 <li>   Moved dot invocations to the end of a doxygen run. Doxygen will now
-       run multiple instances of dot in parallel (for better CPU utilisation
+       run multiple instances of dot in parallel (for better CPU utilization
        on multi-core systems). The new config option DOT_NUM_THREADS 
        determines the number of threads used (were 0 is auto-detect).</li>
 <li>   Added option EXT_LINKS_IN_WINDOW which controls whether or not
@@ -3693,7 +3941,7 @@ make sure you add the following:
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/2255">2255</a>, <a href="https://github.com/doxygen/doxygen/issues/3796">3796</a>: \if and \endif did not work properly inside auto lists.</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/3139">3139</a>: No warning for missing return type documentation even though
        WARN_NO_PARAMDOC was set to YES.</li>
-<li>   id <a href="https://github.com/doxygen/doxygen/issues/3341">3341</a>: Handling of nesting \defgroup's was not always working
+<li>   id <a href="https://github.com/doxygen/doxygen/issues/3341">3341</a>: Handling of nesting \defgroup was not always working
        properly.</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/3355">3355</a>: &oslash; was not translated correctly in the LaTeX output.</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/3401">3401</a>: Use relative paths for mscgen diagrams to avoid errors in the
@@ -3988,7 +4236,7 @@ make sure you add the following:
 <h3>Changes</h3>
 <ul>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/3372">3372</a>, <a href="https://github.com/doxygen/doxygen/issues/3012">3012</a>: Replaced the PHP based search engine by a 
-       Javascript/DHTML based one.
+       JavaScript/DHTML based one.
        As a result the search feature no longer requires a HTTP server
        with PHP enabled to be usable. Searching is limited to symbols
        though, but it is now possible to filter on symbol type.</li>
@@ -4058,7 +4306,7 @@ make sure you add the following:
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/3457">3457</a>: Fixed problem handling strings like a"\b" within a comment.</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/3459">3459</a>: Fixed problem matching explicitly scoped parameter in a 
        template class.</li>
-<li>   id <a href="https://github.com/doxygen/doxygen/issues/3473">3473</a>: A namespaced with name "internal" (C++/CLI keyword)
+<li>   id <a href="https://github.com/doxygen/doxygen/issues/3473">3473</a>: A namespace with name "internal" (C++/CLI keyword)
        could confuse doxygen's C++ parser.</li>
 <li>   id <a href="https://github.com/doxygen/doxygen/issues/3477">3477</a>: @optional/@required attributes for Objective-C were missing
        from the XML output.</li>
@@ -4178,8 +4426,8 @@ make sure you add the following:
 <li>   id 437346: Fixed issue handling multibyte characters in the RTF output.</li>
 <li>   id 475377: Improved error handling in case of character encoding
        problems.</li>
-<li>   id 486747: Inherited typedefs were not resolved propertly.</li>
-<li>   id 508752: Add support for BLOCK DATA to the fortran parser.</li>
+<li>   id 486747: Inherited typedefs were not resolved properly.</li>
+<li>   id 508752: Add support for BLOCK DATA to the Fortran parser.</li>
 <li>   id 532695: included documentation update about the use of \public
        and friends for object-oriented programming in C.</li>
 <li>   id 532808: References to class variables in PHP code did not already work.</li>
@@ -4201,7 +4449,7 @@ make sure you add the following:
        wrong line counting and missing cross-references.</li>
 <li>   id 545128: \overload didn't work if it was the last statement in a
        comment and not followed by a newline.</li>
-<li>   id 553380: Removed bogus warning refering to a namespace member from
+<li>   id 553380: Removed bogus warning referring to a namespace member from
        with a brief description that was converted to a tooltip.</li>
 <li>   id 553968: Added support for JavaDoc command {@code ... }</li>
 <li>   id 554444: Bullet lists were no longer correctly indented when using
@@ -4281,7 +4529,7 @@ make sure you add the following:
 <li>   Added new config options <code>GENERATE_QHP</code>
        which enables generating .qch (Qt compiled help) file via 
        the Qt's qthelpgenerator tool (part of Qt 4.4+).
-       This type of files can be read with Qt's Assisant to browse the 
+       This type of files can be read with Qt's Assistant to browse the 
        documentation in a similar way as is possible with Microsoft's 
        compiled HTML help (.chm). To further customize the output and run the
        help generator from within doxygen, the following options
@@ -4313,7 +4561,7 @@ make sure you add the following:
        <code>INCLUDED_BY_GRAPH</code>.
        Run doxygen with the -l option to generate the default layout file.</li>
 <li>   Included update for the Macedonian, Catalan, Brazilian, and Serbian 
-       translation and also support for Serbian with Cyrilic characters.</li>
+       translation and also support for Serbian with Cyrillic characters.</li>
 </ul>
 <h3>Bug fixes</h3>
 <ul>
@@ -4353,14 +4601,14 @@ make sure you add the following:
        from multi-byte UTF-8 characters.</li>
 <li>   id 544479: <code>SORT_MEMBER_DOCS</code> did not work for class members.</li>
 <li>   id 546621: Fixed makefile so that .svn stuff is removed from the 
-       tarball when doing "make archive".</li>
+       tar-ball when doing "make archive".</li>
 <li>   id 546812: Using a table with row span greater than 1 did not 
        produce correct LaTeX output.</li>
 <li>   id 545098: Fixed problem parsing where clauses in combination with C#
        generics.</li>
 <li>   id 545503: Nameless parameters of type "struct A" could end up wrongly
        in the XML output.</li>
-<li>   id 545970: Refering to the main page did not work as advertised.</li>
+<li>   id 545970: Referring to the main page did not work as advertised.</li>
 <li>   id 546158: The variable defined inside a foreach statement in C# code 
        was not considered for source linking, cause potentially incomplete call
        graphs.</li>
@@ -4391,7 +4639,7 @@ make sure you add the following:
 <li>   id 553616: One can now remove the automatic line breaks in the type 
        part of a declaration by using a custom stylesheet with
        BR.typebreak { display: none; }</li>
-<li>   id 553663: Aliases did not work in Fortan comments.</li>
+<li>   id 553663: Aliases did not work in Fortran comments.</li>
 <li>   id 549022: Reimplemented in links could be wrong in case of 
        overloaded members.</li>
 <li>   id 553225: Parser was confused by arrays inside an Obj-C message.</li>
@@ -4427,7 +4675,7 @@ make sure you add the following:
 <li>   id 519573: Included patch to make the font-size button visible in the
        CHM output.</li>
 <li>   id 521288: Added new options SHOW_NAMESPACES and SHOW_FILES to 
-       Suppress Namepace and Files Pages.</li>
+       Suppress Namespace and Files Pages.</li>
 <li>   id 521495: Included a patch that makes it easy to modify the root of
        the html treeview with an image using style sheets.</li>
 <li>   id 522300: Added option IDL_PROPERTY_SUPPORT to enable/disable special 
@@ -4456,8 +4704,8 @@ make sure you add the following:
 <li>   id 495687: Replaced MAX_DOT_GRAPH_MAX_NODES with DOT_GRAPH_MAX_NODES 
        in the docs &amp; config file.</li>
 <li>   id 508694 Fixed problem with mixed simple and double quotes in 
-       fortran format declaration</li>
-<li>   id 508752: Fixed problem where the fortran scanner didn't recognize END</li>
+       Fortran format declaration</li>
+<li>   id 508752: Fixed problem where the Fortran scanner didn't recognize END</li>
 <li>   id 510971: Fortran: parser was confused by double REAL() in processed 
        statements.</li>
 <li>   id 514488: Fixed problem matching argument lists with const qualifiers.</li>
@@ -4498,7 +4746,7 @@ make sure you add the following:
 <li>   id 524473: Removed incorrect warnings about parameters in VHDL.</li>
 <li>   id 525140: Improved handling of Objective-C 2.0 properties.</li>
 <li>   id 525143: Properties are now listed as attributes in the UML diagrams.</li>
-<li>   id 525144: GENERATE_DOCSET option greyed out in doxywizard.</li>
+<li>   id 525144: GENERATE_DOCSET option grayed out in doxywizard.</li>
 <li>   id 526155: Removed warning about QFile::setName when parsing VHDL files.</li>
 <li>   id 527781: Template arguments for bases class not shown in a consistent
        way.</li>
@@ -4540,7 +4788,7 @@ make sure you add the following:
        #define C(S,m) /** container S */ struct S { /** value m */ int m; }
        </code></li>
 <li>   id 493923: The options SOURCE_BROWSER, CALL_GRAPH, CALLER_GRAPH, 
-       REFERENCES_RELATION, and REFERENCED_BY_RELATION can now be indepently
+       REFERENCES_RELATION, and REFERENCED_BY_RELATION can now be independently
        enabled and disabled. By default the relations are now disabled.</li>
 </ul>
 <h3>New features</h3>
@@ -4548,7 +4796,7 @@ make sure you add the following:
 <li>   Added support for VHDL (.vhd or .vhdl extension) based on a patch by
        Martin Kreis. Use OPTIMIZE_OUTPUT_VHDL when parsing VHDL code. </li>
 <li>   id 374699: Added support for Objective-C 2.0 properties.</li>
-<li>   Added compilation support for MacOSX 10.5 (Leopard) incombination with 
+<li>   Added compilation support for MacOSX 10.5 (Leopard) in combination with 
        Xcode 3</li>
 <li>   Added support for docsets, which allow integration of doxygen generated 
        API documentation in Xcode 3. new options: 
@@ -4567,7 +4815,7 @@ make sure you add the following:
        the second and third argument of a \class command, when
        the documentation is already in front of a class definition.</li>
 <li>   Added translator support for Macedonian.</li>
-<li>   Added language updates for German, Perian, Spanish, Taiwanese,  
+<li>   Added language updates for German, Persian, Spanish, Taiwanese,  
        and Chinese, Korean, Croatian.</li>
 </ul>
 <h3>Bug fixes</h3>
@@ -4602,7 +4850,7 @@ make sure you add the following:
        some compilers.</li>
 <li>   id 492027: Ampersand (&amp;) in front of parameter stops documenting 
        of PHP source</li>
-<li>   id 493249: using a namespace (or fortran module) caused the namespace
+<li>   id 493249: using a namespace (or Fortran module) caused the namespace
        to appear in the documentation as if it was defined.</li>
 <li>   id 493434: Nested C# style XML lists in a comment block were not
        handled correctly.            </li>
@@ -4626,7 +4874,7 @@ make sure you add the following:
 <li>   id 500635: Project name is no longer placed before each top level 
        item in the treeview and other indices.</li>
 <li>   id 500465: Fixed some issues compiling for AIX.</li>
-<li>   id 500928: Fixed parser issue handling a tripple quoted 
+<li>   id 500928: Fixed parser issue handling a tipple quoted 
                   string when used to initialize a Python variable.</li>
 <li>   id 500944: Python variables with package scope were only extracted if
        EXTRACT_STATIC was enabled.</li>
@@ -4645,7 +4893,7 @@ make sure you add the following:
 <li>   id 507603: Enabling FILTER_SOURCE_FILES caused strange warnings when
        INPUT_FILTER is empty.</li>
 <li>   id 508740: Using upper case port mode specifiers did not work correctly.</li>
-<li>   id 508753: Fortran: Added .f as allowed fortran extension.</li>
+<li>   id 508753: Fortran: Added .f as allowed Fortran extension.</li>
 <li>   id 508759: Fortran: fixed potential memory corruption while scanning 
        parameter lists.</li>
 <li>   id 507528: XML output was not correct for pointer arrays.</li>
@@ -4654,7 +4902,7 @@ make sure you add the following:
        documentation.</li>
 <li>   id 509582: Fortran: Spaces in function return type were not parsed 
        properly.</li>
-<li>   id 510387: Fortran scanner didn't parse initialisation of complex type
+<li>   id 510387: Fortran scanner didn't parse initialization of complex type
        correctly. </li>
 <li>   id 511921: @file command ended brief description even when
        JAVADOC_AUTOBRIEF was enabled.</li>
@@ -4687,7 +4935,7 @@ make sure you add the following:
        (used for Python to C++ bindings).</li>
 <li>   id 475828: Added support for CLI/C++ style indexed properties.</li>
 <li>   Added config option TYPEDEF_HIDES_STRUCT which when enabled treats a typedef
-       of a struct as a struct with the name of the typedef. This behavious was
+       of a struct as a struct with the name of the typedef. This behavior was
        coupled to OPTIMIZE_OUTPUT_FOR_C in the previous version and is now an independent
        option.</li>
 <li>   Included updates for the Korean, Brazilian and Chinese translations.</li>
@@ -4779,7 +5027,7 @@ make sure you add the following:
 <li>   When <code>OPTIMIZE_OUTPUT_FOR_C</code> is enabled then a struct definition of the
        form <code>typedef struct _S { ... } S_t</code> will be shown in the output as a
        struct of type <code>S_t</code> and the typedef itself is omitted 
-       (previousily <code>_S</code> was shown
+       (previously <code>_S</code> was shown
        as well as a typedef of the form <code>typedef _S S_t</code>). </li>
 <li>   Improved the line-breaking rules for members whose return types have many characters
        (for example a function returning a pointer to a template class).</li>
@@ -4965,7 +5213,7 @@ make sure you add the following:
 <li>   id 390821: Fixed problem parsing Java 1.5 enums with initializers.</li>
 <li>   id 391619: When dot produces an non-zero return code, doxygen now prints the
                   return code and the command it tried to execute.</li>
-<li>   id 407815: Doxygen's got confused by certain combinations of " and ' s in PHP code.</li>
+<li>   id 407815: Doxygen got confused by certain combinations of " and ' in PHP code.</li>
 <li>   id 409935: Fixed bug in qcstring.cpp</li>
 <li>   id 411300: PDF/Latex output was broken for operator[] documentation.</li>
 <li>   id 411328: Fixed Accessibility/Section 508 Compliance issue.</li>
@@ -5029,7 +5277,7 @@ make sure you add the following:
 <li>   id 131445: Fixed autolinking for related functions.</li>
 <li>   id 137236: Updated documentation to make it clear that a lower-case only word
        is not a candidate for autolinking.</li>
-<li>   id 141758: Fixed a problem parsing &lt;?=...?&gt; contructs outside of functions in PHP.</li>
+<li>   id 141758: Fixed a problem parsing &lt;?=...?&gt; constructs outside of functions in PHP.</li>
 <li>   id 319169: Second level index not shown when DISABLE_INDEX=YES.</li>
 <li>   id 325337: Added "optimize output for C#" option to Doxywizard.</li>
 <li>   id 325426: Partial C# class inside a namespace where not handled properly.</li>
@@ -5063,7 +5311,7 @@ make sure you add the following:
        an anonymous namespace  </li>
 <li>   id 349867: Fixed issue handling brief and detailed description when
        both are positioned after an item. </li>
-<li>   id 350168: Doxygen didn't parse C# type contraints properly.</li>
+<li>   id 350168: Doxygen didn't parse C# type constraints properly.</li>
 <li>   id 351890: In some cases C# attributes were treated as properties.</li>
 <li>   id 353044: C99 style variadic macros were not handled properly by doxygen.</li>
 <li>   id 353195: Member grouping with SUBGROUPING = YES now works the same for files
@@ -5244,7 +5492,7 @@ make sure you add the following:
                   set.</li>
 <li>   id 318460: Multiply-defined labels if two function specializations 
        differ only on the name of a template parameter.</li>
-<li>   id 319219: Spurious space was inserted after inlined math formulae.</li>
+<li>   id 319219: Spurious space was inserted after inlined math formulas.</li>
 <li>   id 319826: The file name for template classes could become too 
        long causing files that cannot be created by some file systems.</li>
 <li>   id 320026: undocumented "typedef struct foo baz" causes subsequent 
@@ -5357,8 +5605,8 @@ make sure you add the following:
 <li>   id 311198: If JAVADOC_AUTOBRIEF was set to YES, a \todo or \bug like
        command always ended at the first dot.</li>
 <li>   id 311207: The /* and */ inside a \code ... \endcode code fragment 
-       were stipped.</li>
-<li>   id 311577: Putting a documentated class name in the title of the main
+       were stripped.</li>
+<li>   id 311577: Putting a documented class name in the title of the main
        page caused a LaTeX error if pdf hyperlinks were enabled.</li>
 <li>   id 311665: Fixed compile issue for Solaris.</li>
 <li>   id 312688: Typedefs of arrays were auto-linked to the base type 
@@ -5366,7 +5614,7 @@ make sure you add the following:
 <li>   id 312678: Fixed excessive memory usage for @fn commands 
        due to a memory leak of the scanner buffer 256K of memory was leaked 
        for each command!</li>
-<li>   id 312791: Undocumentated members did not result in warnings if 
+<li>   id 312791: Undocumented members did not result in warnings if 
        SOURCE_BROWSER was enable and the member's definition was part of
        the INPUT.</li>
 <li>   A C-comment inside a \code block could lead to parse problems in the
@@ -5459,13 +5707,13 @@ make sure you add the following:
 <li>   id 304598: Using operator-- in resulted in broken HTML output due to the
                   embedded doxytag that include the end of a HTML comment.</li>
 <li>   id 304623: Spreading a @fn command over multiple lines didn't work
-                  anymore without using line-contination characters.</li>
+                  anymore without using line-continuation characters.</li>
 <li>   id 304666: Attributes of the same class appeared separated with \n in 
                   collaboration diagrams</li>
-<li>   id 304751: A define "foo()" was indisguishable from a define "foo" in
+<li>   id 304751: A define "foo()" was indistinguishable from a define "foo" in
                   the XML output.</li>
 <li>   id 304752: XML location tag attribute "file" could have the
-                  syntactially wrong value "&lt;generated&gt;" in some cases.</li>
+                  syntactically wrong value "&lt;generated&gt;" in some cases.</li>
 <li>   id 305334: INPUT_FILTER tag did not work properly anymore due to
                   additional quotes.</li>
 <li>   id 305364: Improved argument matching routine to avoid cases where
@@ -5576,12 +5824,12 @@ make sure you add the following:
                   CASE_SENSE_NAME was set to NO.</li>
 <li>   id 170592: Using \ref for Objective-C methods did not work if the
                   name contained a colon.</li>
-<li>   id 171795: Refering to Objective-C methods now follows Apple's
+<li>   id 171795: Referring to Objective-C methods now follows Apple's
                   conventions. </li>
 <li>   id 171878: When JAVADOC_AUTOBRIEF = YES and there was no blank line 
                   after a page command, the first sentence did not appear in
                   the documentation.</li>
-<li>   id 171923: Doxygen failed to match arguments for a function documentated
+<li>   id 171923: Doxygen failed to match arguments for a function documented
                   out-of-line with @fn and using @relatesalso.</li>
 <li>   id 172118: Doxywizard now shows the version of doxygen it is for.</li>
 <li>   id 172133: Doxygen did not longer ignore preceding C++ comments inside a
@@ -5591,7 +5839,7 @@ make sure you add the following:
 <li>   id 172329: The index of the CHM did not always link to groups correctly.</li>
 <li>   id 172456: Fixed case where doxygen had problems differentiating const 
                   and non-const member functions.</li>
-<li>   id 172494: @code blocks were not poperly ignored by the preprocessor 
+<li>   id 172494: @code blocks were not properly ignored by the preprocessor 
                   in some cases.</li>
 <li>   id 172622: Fixed parse problem for Objective-C method implementations 
                   whole declaration part ended with a semicolon.</li>
@@ -5749,7 +5997,7 @@ make sure you add the following:
                an anonymous namespace.</li>
 <li>id 169549: Previous fixes introduced flattening of the class hierarchy.</li>
 <li>id 169640: File suffix check for the D language was broken.</li>
-<li>id 169641: D contructors and destructors were not detected.</li>
+<li>id 169641: D constructors and destructors were not detected.</li>
 <li>is 169657: Fixed the way import is treated in D to prevent recursive
                lockup.</li>
 <li>id 169784: Objective-C methods with a variable number of arguments were
@@ -5876,7 +6124,7 @@ make sure you add the following:
 <li>   id 155272: Image filenames in RTF output were not quoted causing problem
                   with custom images whose name contained spaces.</li>
 <li>   id 155322: Fixed parse problem for php code containing '#'.  </li>
-<li>   id 155224: Java interfaces did't resolve across packages w/o FQN.</li>
+<li>   id 155224: Java interfaces didn't resolve across packages w/o FQN.</li>
 <li>   id 156411: Return type of a function was not hyperlinked in some cases 
                   (typical with nested namespaces or Java packages).</li>
 <li>   id 156445: function seen first in header and doc'ed in 
@@ -5961,7 +6209,7 @@ make sure you add the following:
 \htmlonly
 </p>
 <h1>Doxygen Release 1.3.9.1</h1>
-<h3>Bug fixes</h3>(ids refer to the old buzilla issue, just use it in the search box of the <a href="https://github.com/doxygen/doxygen/issues">issue tracker</a>)<br/>
+<h3>Bug fixes</h3>(ids refer to the old bugzilla issue, just use it in the search box of the <a href="https://github.com/doxygen/doxygen/issues">issue tracker</a>)<br/>
 <ul>
 <li>   Due to an error in the packaging script, an old version of doxywizard 
        was bundled with the Mac OS X version of doxygen.</li>
@@ -6124,7 +6372,7 @@ make sure you add the following:
 <li>   Included patch that removes some cosmetic annoyances in the man page 
        output (thanks to Chris Croughton).</li>
 <li>   Added internationalization support for Afrikaans and
-       Lithanian.  Included language updates for Dutch, 
+       Lithuanian.  Included language updates for Dutch, 
        Czech, Italian, Brazilian, Croatian, Japanese, Norwegian and
        Russian.</li>
 </ul>
@@ -6141,7 +6389,7 @@ make sure you add the following:
 <li>   id 138394: C style comments placed on the same line after a macro 
        definition appeared as part of the macro's value.</li>
 <li>   id 138429: Fixed language setting for HTML output when using 
-       traditional chinese.</li>
+       traditional Chinese.</li>
 <li>   id 140259: Using @dotfile in a comment block could cause broken @refs
        to sections defined after the @dotfile command.</li>
 <li>   id 141915: Fixed a couple of problems with the RTF output.</li>
@@ -6304,7 +6552,7 @@ make sure you add the following:
 <li>   Examples (documented via \example) are now included in the XML output.</li>
 <li>   New option SORT_BRIEF_DOCS which when enabled will list the
        declaration section of the documentation (with the brief descriptions)
-       in alpabetical order, instead of declaration order (thanks to 
+       in alphabetical order, instead of declaration order (thanks to 
        Akos Kiss for the patch).</li>
 <li>   Included patch for Hungarian translation (thanks to Akos Kiss)
        and for the Serbian language. Added support for mixed Korean/english 
@@ -6359,17 +6607,17 @@ make sure you add the following:
 <h3>New features</h3>
 <ul>
 <li>   Added support for parsing K&amp;R style function prototypes. 
-       Please try it on your favourite legacy C project and report any 
+       Please try it on your favorite legacy C project and report any 
        problems.</li>
 <li>   Included languages updates for Traditional Chinese, 
-       Danish, German, Korian translation.</li>
+       Danish, German, Korean translation.</li>
 <li>   id 120464: doxygen's XML output does now assign a prot="..." 
        attribute for nested classes (thanks to Paul Ross for the patch).</li>
 <li>   Added new configuration switch XML_PROGRAMLISTING to enable/disable 
        generating source code listings as part of the XML output (thanks to
        Paul Ross for the patch).  </li>
 <li>   Added new config option ABBREVIATE_BRIEF which makes the
-       abbration process of brief descriptions configurable and language
+       aberration process of brief descriptions configurable and language
        independent (thanks to Jake Colman for the patch).</li>
 <li>   The alphabetical class list now comes with a quick index
        (thanks to Marcin Zukowski for the patch).</li>
@@ -6391,7 +6639,7 @@ make sure you add the following:
        was produced.</li>
 <li>   id 123206: Fixed problem in qtools when opening files in text mode.</li>
 <li>   id 123322: The search page did not honor DISABLE_INDEX.</li>
-<li>   id 123420: Functions with a brief description caused bugus &lt;/em&gt; tags 
+<li>   id 123420: Functions with a brief description caused bogus &lt;/em&gt; tags 
                   in the HTML output.</li>
 <li>   id 124114: typo in the generated PHP search script could cause errors
        in the search result page.</li>
@@ -6431,7 +6679,7 @@ make sure you add the following:
 <li>   Fixed problem that HTML image maps ended up in the RTF output.</li>
 <li>   Fixed bug in code fragment parser that could cause memory corruption
        in certain cases.</li>
-<li>   Fixed problem matching definition and declation of functions, which
+<li>   Fixed problem matching definition and declaration of functions, which
        could cause bogus warnings for functions with the same name but in 
        different namespaces.</li>
 <li>   Using "/// @file" to document a file quickly was not possible, while
@@ -6674,7 +6922,7 @@ make sure you add the following:
 <li>   Links to groups imported via tag files were broken.</li>
 <li>   Fixed problem resolving class relations for nested classes within
        namespaces.</li>
-<li>   Static members can now be documentated in a separate file using \fn
+<li>   Static members can now be documented in a separate file using \fn
        as long as they have unique names. If the names are not unique the 
        documentation must be located in the same file (as was required before).</li>
 <li>   In arguments and return types of the form NA::A were not linked if NA 
@@ -6699,7 +6947,7 @@ make sure you add the following:
 <li>   Fixed problem handling omission of the optional arguments of 
        the \image command.</li>
 <li>   Enabling HIDE_IN_BODY_DOCS did not work properly if C++-style special
-       comments were used inside the body of a fucntion.</li>
+       comments were used inside the body of a function.</li>
 <li>   Fixed problem cross-referencing variables used as a
        guard (i.e. if (var) ...) </li>
 <li>   Setting ENUM_VALUES_PER_LINE to 0 caused a division by 0 error.</li>
@@ -6771,7 +7019,7 @@ make sure you add the following:
 <li>   Fixed preprocessor problem with parsing /*//*/</li>
 <li>   URL's in the docs using &lt;a href=""&gt; caused a nested link. </li>
 <li>   "using namespace A::B;" confused the code parser.</li>
-<li>   Interface keyword was not recognised in C# (thanks to Onorio Catenacci
+<li>   Interface keyword was not recognized in C# (thanks to Onorio Catenacci
        for the patch).</li>
 <li>   Line counting was incorrect when parsing multi-line formulas.</li>
 <li>   \section's in a \mainpage are now correctly numbered in the LaTeX
@@ -6824,7 +7072,7 @@ make sure you add the following:
        if they were documented.</li>
 <li>   The treeview page was not rendered with the right character set (it was
        always English).</li>
-<li>   Explicit template instantations appeared as a variable in the output.</li>
+<li>   Explicit template instances appeared as a variable in the output.</li>
 <li>   Java instance and static initializer blocks are now correctly parsed
        and can be documented.</li>
 <li>   Fixed bug in the LATEX_HIDE_INDICES option.</li>
@@ -6892,7 +7140,7 @@ make sure you add the following:
        was already suggested in the docs).</li>
 <li>   source code line in the XML output didn't escape special characters 
        like &amp; anymore.</li>
-<li>   Fixed small bug in german translation (thanks to Jens Seidel).</li>
+<li>   Fixed small bug in German translation (thanks to Jens Seidel).</li>
 <li>   e-mail addresses with multiple dots got truncated when linked.</li>
 <li>   Attributes of html commands with value "" where not properly parsed
        causing the image in the legend page not to appear.</li>
@@ -6926,7 +7174,7 @@ make sure you add the following:
 <li>   Fixed problem in code browser that prevented linking to global 
        variables defined in other files.</li>
 <li>   When putting a "using namespace X" in a header file doxygen did not
-       recognise this in files that included the header file.</li>
+       recognize this in files that included the header file.</li>
 <li>   Fixed bug in parsing sections without title.</li>
 <li>   doxytag did not include anchor in the search index. Thanks to 
        Joerg Schlichenmaier for the fix.</li>
@@ -6973,7 +7221,7 @@ make sure you add the following:
 <li>   RCS/CVS tags did not appear in the output.</li>
 <li>   @note section result in section with type "bug" in the XML output.</li>
 <li>   Dot graphs were truncated too quickly in some cases.</li>
-<li>   Files with a .php4 extension are now recognised as PHP files.</li>
+<li>   Files with a .php4 extension are now recognized as PHP files.</li>
 <li>   Source browser could get out of sync causing wrong cross references.</li>
 <li>   Text after @} could end up in another documentation block.</li>
 <li>   Putting a style command such as \c or \b at the end of a line, before
@@ -7015,7 +7263,7 @@ make sure you add the following:
 <li>   Included language updates for French, Czech, and Russian.</li>
 <li>   Included a number of enhancements to the xml parser (thanks to 
        a patch by Tree).</li>
-<li>   Locally documentated parameters now appear in the XML output
+<li>   Locally documented parameters now appear in the XML output
        (thanks to Cormac Twomey for the patch). </li>
 <li>   The preprocessor now inserts line control commands where appropriate.</li>
 </ul>
@@ -7023,7 +7271,7 @@ make sure you add the following:
 <ul>
 <li>   Aliased \if .. \endif commands around a \brief section were not handled
        properly.</li>
-<li>   Warnings for undocumentation members were not generated anymore
+<li>   Warnings for undocumented members were not generated anymore
        in certain cases.</li>
 <li>   A member of a group linked with \ref showed the group's title 
        as link text instead of the member's name.</li>
@@ -7106,7 +7354,7 @@ make sure you add the following:
        <li> Undocumented private friend classes no longer cause warnings</li>
        <li> Undocumented private classes no longer cause warnings</li>
        <li> Undocumented members are now hidden if they are 
-            default constuctors, destructors or reimplemented.</li>
+            default constructors, destructors or reimplemented.</li>
        </ul></li>
 <li>   Pages introduced via \page are now context aware. This means that
        if you put them inside a class or namespace, names do not have
@@ -7121,11 +7369,11 @@ make sure you add the following:
        that a list of all deprecated items is generated.
        Thanks to Angela Marshall for the patch.</li>
 <li>   Enum value documentation was added to the XML output.</li>
-<li>   Files ending with ".inc" are now recognised as PHP files
+<li>   Files ending with ".inc" are now recognized as PHP files
        (thanks to Marcus Ahlfors).</li>
 <li>   Included updated documentation for language translators 
        (thanks to Petr Prikryl).</li>
-<li>   Included language updates for Czech, Slovak, Brazillan, Croatian,
+<li>   Included language updates for Czech, Slovak, Brazilian, Croatian,
        Portuguese, Russian, Polish, Japanese and Serbian. 
        Include language support for Catalan (thanks to Albert Mora)</li>
 <li>   Included .dsp update by Simon Goodwin (already needs to be updated 
@@ -7213,12 +7461,12 @@ make sure you add the following:
        of some item and paste it in another documentation block.</li>
 <li>   i18n: Added support for the Serbian language (thanks to Dejan Milosavljevic).
        Included a new language option Japanese-en for combined Japanese 
-       and english.</li>
+       and English.</li>
 <li>   Included patch for dealing with variable argument macros in @param 
        (thanks to Alfred Heggestad).</li>
 <li>   Added new option MULTILINE_CPP_IS_BRIEF to make doxygen treat
        a multi-line brief comment block as a brief description. Set this to
-       YES to obtain the behaviour of version 1.2.15 and earlier. Default as
+       YES to obtain the behavior of version 1.2.15 and earlier. Default as
        of version 1.2.16 is to treat multi-line C++ comment block as a 
        detailed description.</li>
 <li>   New option CHM_FILE to set the .chm file (and path) to use for
@@ -7293,7 +7541,7 @@ make sure you add the following:
        </ul></li>
 <li>   operator|() caused invalid entries in the latex index.</li>
 <li>   Fixed bug parsing URLs with curly braces in documentation blocks.</li>
-<li>   Html help output now uses the correct language code if non english
+<li>   Html help output now uses the correct language code if non English
        language is selected.</li>
 <li>   Fixed bug in generate makefile for latex output (thanks to Petr 
        Prikryl)</li>
@@ -7301,7 +7549,7 @@ make sure you add the following:
        confused the parser.</li>
 <li>   Fixed problem handling function typedefs.</li>
 <li>   \endif appeared in output when used via ALIASES in a brief description.</li>
-<li>   Included heuristic to distiguish between a variable definition 
+<li>   Included heuristic to distinguish between a variable definition 
        with initialization via a constructor and a function prototype 
        (e.g. "Test var(initVal);", v.s. "Test func(SomeType);").</li>
 <li>   Fixed lock-up problem when to @brief were put after each other in a
@@ -7368,10 +7616,10 @@ make sure you add the following:
        Please report any problems that remain.</li>
 <li>   Alias commands put in separate parameter documentation blocks 
        were not resolved.</li>
-<li>   The documentation for arguments, documented with a seperate 
+<li>   The documentation for arguments, documented with a separate 
        documentation block, was not consistently shown in source and header 
        files, depending on the order of the input files. </li>
-<li>   The characters '(', ')', '$', ''', and ';' were not recognised 
+<li>   The characters '(', ')', '$', ''', and ';' were not recognized 
        as part of an URL.</li>
 <li>   Grouped enum values could not share the same documentation block
        even when DISTRIBUTE_GROUP_DOC is YES. </li>
@@ -7392,7 +7640,7 @@ make sure you add the following:
        classes, imported via using declarations, as their parameter type.</li>
 <li>   Fixed bug in conditional section handling for cases like:
        @if guard text @else more text @endif</li>
-<li>   The html help files did not honour the HTML_FILE_EXTENSION settings.</li>
+<li>   The html help files did not honor the HTML_FILE_EXTENSION settings.</li>
 <li>   Removed bogus warning when using @param for function-type 
        parameters.</li>
 <li>   Include statements in the source browser output now link to the 
@@ -7465,7 +7713,7 @@ make sure you add the following:
        with full access to documentation blocks. 
        Made inheritance/collaboration diagrams accessible via the
        XML parser API (see addon/doxmlparser/include/doxmlintf.h).
-       Reorganised the internals of the XML parser so the API does
+       Reorganized the internals of the XML parser so the API does
        not require destructors. Made the parser more portable (it should
        compile with gcc and M$ visual C++ now).</li>
 </ul>
@@ -7488,7 +7736,7 @@ make sure you add the following:
 <li>   In some cases the tree view showed leaf elements as non-leafs. </li>
 <li>   Fixed a number of cases where illegal characters could end up in 
        the XML output.</li>
-<li>   If a function in a base class was (re)implemented by serveral classes
+<li>   If a function in a base class was (re)implemented by several classes
        only one of them appeared in the "(re)implemented in" list. </li>
 <li>   graph_legend.gif was hardcoded in translator_*.h files. 
        Note to translators: this has affected all translator files, so please
@@ -7555,7 +7803,7 @@ make sure you add the following:
             this tag switches off the language filter...
        */
        </pre>
-       Which of the language specific fragments is outputed depends
+       Which of the language specific fragments is outputted depends
        on the setting of OUTPUT_LANGUAGE (Thanks to Milan Rusek for the patch).</li>
 <li>   Added build support for Cygwin (thanks to Ryunosuke Sato).        </li>
 <li>   Added new option HTML_FILE_EXTENSION to allow different file extension
@@ -7590,7 +7838,7 @@ make sure you add the following:
 <li>   Undocumented classes exposed when setting EXTRACT_ALL to YES, could
        result in broken links in the class hierarchy.</li>
 <li>   Exception specifications in Java were not parsed properly.</li>
-<li>   If INLINE_INHERITED_MEMB was YES, pure vitual members of base classes
+<li>   If INLINE_INHERITED_MEMB was YES, pure virtual members of base classes
        reachable via multiple paths appeared more than once in the 
        documentation.</li>
 <li>   Removed potential recursive loop when computing reimplements relations
@@ -7851,7 +8099,7 @@ make sure you add the following:
 <li>   Fixed a number of XML output bugs (thanks to Christian Hammond).</li>
 <li>   Fixed bug parsing character literals.</li>
 <li>   Fixed bug in RTF output (bracket mismatch).</li>
-<li>   Inializer of the last enum value of an enum did not always appear.</li>
+<li>   Initializer of the last enum value of an enum did not always appear.</li>
 <li>   Dots were removed from return types in Java.</li>
 <li>   In some cases a broken "More..." link was generated after 
        a brief class description.</li>
@@ -7960,10 +8208,10 @@ make sure you add the following:
 <ul>
 <li>   Friend class declarations are now treated as normal members.</li>
 <li>   Completely rewrote the way templates are handled. 
-       Doxygen now (internally) computes all template instances it encounters. 
+       Doxygen now (internally) computes all template instantiations it encounters. 
        This has the following advantages:
        <ul>
-       <li>Template instances are now shown in the hierarchical index
+       <li>Template instantiations are now shown in the hierarchical index
            and in all class diagrams in a uniform way.</li>
        <li>The list of all members is now correct for classes deriving
            from a template.</li>
@@ -7981,7 +8229,7 @@ make sure you add the following:
 <li>   Added GNU install tool auto detection to the configure script.</li>
 <li>   Included update for French translation (thanks to Xavier Outhier)
        Olexij Tkatchenko has added support for the Ukrainian language.
-       Included update for Portuguese and Brazillian.</li>
+       Included update for Portuguese and Brazilian.</li>
 <li>   Added --docdir option to the configure script.</li>
 <li>   Using the non-commercial version of Qt for windows, it is now
        possible to build doxywizard for windows.</li>
@@ -7996,7 +8244,7 @@ make sure you add the following:
 <li>   Removed bogus warnings when parsing tag files.</li>
 <li>   The detailed description in a @name block can now be more than 
        plain text.</li>
-<li>   Included fix for the tree view script for the mozilla browser
+<li>   Included fix for the tree view script for the Mozilla browser
        (thanks to Alec Panovici).</li>
 <li>   Grouping members with the same signature but with a different scopes
        is now possible.</li>
@@ -8031,7 +8279,7 @@ make sure you add the following:
        list of all members, while they were accessible from the derived class.</li>
 <li>   Reworked part of the template handling. Doxygen should now be
        capable of handling nested template classes correctly. Please test
-       this if you are using these contructs. Thanks to Christoph Koegl
+       this if you are using these constructs. Thanks to Christoph Koegl
        for providing some difficult test cases.</li>
 <li>   Fixed parse problem when parsing &lt;&lt; as part of the first 
        argument of a typedef.</li>
@@ -8083,7 +8331,7 @@ make sure you add the following:
 <h3>New features</h3>
 <ul>
 <li>   The dot generated inheritance and collaboration graphs for classes
-       should now show the proper template instantation for the derived/used
+       should now show the proper template instantiation for the derived/used
        classes. For instance it should show that class S uses class V 
        (indirectly) in the following example:
        <pre>
@@ -8122,7 +8370,7 @@ make sure you add the following:
 
        \defgroup must be used exactly once for a group, so you should
        provide a title. Without the title you will get a warning and
-       doxygen will use the name as title (this is the old behaviour).
+       doxygen will use the name as title (this is the old behavior).
        <pre>
        /** \addtogroup name */
        </pre> 
@@ -8171,7 +8419,7 @@ make sure you add the following:
 <h3>Bug fixes</h3>
 <ul>
 <li>   Fixed a bug in the LaTeX output generation (empty lists).</li>
-<li>   Doxygen can now distiguishing f(const A) from f(const B)
+<li>   Doxygen can now distinguishing f(const A) from f(const B)
        even though they match from a syntactical point of view.</li>
 <li>   A template base class that is actually an inherited template 
        argument of the derived class is no longer shown in the output 
@@ -8183,7 +8431,7 @@ make sure you add the following:
        the documentation (thanks to John Harris for reporting this).</li>
 <li>   Applied a number of patches sent by Jens Seidel.</li>
 <li>   Fixed compiler limit problem on Windows (thanks to Trevor Robinson).</li>
-<li>   Add -dBATCH in system calls to ghostscipt (needed for formulas) 
+<li>   Add -dBATCH in system calls to ghostscript (needed for formulas) 
        to avoid a command prompt for newer versions of ghostscript 
        (thanks to Marvin Wolfthal).</li>
 <li>   In some situations doxygen wanted to write a files containing a \n.</li>
@@ -8260,7 +8508,7 @@ make sure you add the following:
 <li>   Setting OPTIMIZE_OUTPUT_FOR_C still produced some C++-ish 
        sentences for the list of all struct/union fields.</li>
 <li>   Undocumented friend functions were listed as friend classes.</li>
-<li>   A CORBA IDL union with a switch was not always recognised correctly.  </li>
+<li>   A CORBA IDL union with a switch was not always recognized correctly.  </li>
 <li>   doxygen did not handle try-function-blocks with multiple catch clauses
        properly.</li>
 <li>   \bug and co. were not working for static members.</li>
@@ -8315,8 +8563,8 @@ make sure you add the following:
        <ul>
        <li> the addin no longer requires administrator privileges to work 
          (thanks to Michael Beck)</li>
-       <li> the existance of files is now checked (thanks to Pekka Pessi).</li>
-       <li> .odl and .inl files are recognised (thanks to Pekka Pessi).</li>
+       <li> the existence of files is now checked (thanks to Pekka Pessi).</li>
+       <li> .odl and .inl files are recognized (thanks to Pekka Pessi).</li>
        </ul></li>
 </ul>
 
@@ -8346,7 +8594,7 @@ make sure you add the following:
        if EXTRACT_PRIVATE is set to YES, instead of just the non-inherited
        private members.</li>
 <li>   Fixed autolink problem for grouped members.</li>
-<li>   Mutliple static global functions with the same name (but in different
+<li>   Multiple static global functions with the same name (but in different
        files), which were forward declared, could make doxygen put 
        the wrong documentation block at the wrong global function.</li>
 <li>   Support for Norwegian was not enabled.</li>
@@ -8373,7 +8621,7 @@ make sure you add the following:
 <li>   Putting &lt;a href="..."&gt;&lt;img src="..."&gt;&lt;/a&gt; in the 
        docs will now work as expected for HTML.</li>
 <li>   Fixed problems with &gt;pre&gt;...&gt;/pre&gt; block in LaTeX.</li>
-<li>   Putting &amp;ccedil; in the docs now preduces a c-cedille.</li>
+<li>   Putting &amp;ccedil; in the docs now produces a c-cedille.</li>
 </ul>
 
 
@@ -8425,7 +8673,7 @@ make sure you add the following:
 <h3>Bug fixes</h3>
 <ul>
 <li>   Fixed 0-pointer bug that could crash doxygen in some cases.</li>
-<li>   Starting a list in a brief JavaDoc-style description splitted
+<li>   Starting a list in a brief JavaDoc-style description split
        the list into two invalid parts if a list item ended with a dot.</li>
 <li>   Fixed a problem with linking to grouped class members.</li>
 <li>   Indenting of code fragment in LaTeX output was not always correct.
@@ -8512,7 +8760,7 @@ make sure you add the following:
 <li>   \ingroup can now be put in a one line comments (thanks to Patrick Ohly)</li>
 <li>   \ingroup in a comment block before a comma separated list of  
        variables is now applied to all variables (as is the documentation 
-       itself). (thanke to Patrick Ohly for the patch)</li>
+       itself). (thanks to Patrick Ohly for the patch)</li>
 <li>   @{ .. @} blocks can now be used for normal groups as well
        (thanks to Trevor Robinson for the patch). Here is an example:
        <pre>
@@ -8618,7 +8866,7 @@ make sure you add the following:
 <ul>
 <li>   Support for the Slovene language (thanks to Matjaz Ostroversnik)</li>
 <li>   Bit fields for struct members are now shown in the documentation.</li>
-<li>   Enabled "favourites" and "Full text-search" for the generated
+<li>   Enabled "favorites" and "Full text-search" for the generated
        HTML Help browser files. </li>
 <li>   Added support for M$-IDL properties. The "methods:" section
        now also works.</li>
@@ -8673,9 +8921,9 @@ make sure you add the following:
        now always pointing to the correct file (thanks to Bill Soudan
        for the patch).</li>
 <li>   Fixed HTML bug in non-indexed namespace member lists. </li>
-<li>   Using `:' inside ID's caused problems for some
-       XML parsers. I'm now using "__" instead. Also removed @ from appearing
-       in the output when annonymous compounds were used.</li>
+<li>   Using ':' inside ID's caused problems for some
+       XML parsers, I'm now using "__" instead. Also removed @ from appearing
+       in the output when anonymous compounds were used.</li>
 <li>   Fixed output bug that is caused by nesting paragraph commands
        inside autolists.</li>
 <li>   Doxygen no longer generates source files for input files that
@@ -8726,7 +8974,7 @@ make sure you add the following:
 <li>   Added support for namespace aliases.</li>
 <li>   Added RTF patch from Alexander Bartolich. Here is his description of
        the changes:
-       "The following patch of rtgen.cpp allows to read *complete* style 
+       "The following patch of rtfgen.cpp allows to read *complete* style 
         definitions from rtfstyle. This includes \sbasedon, \snext, \additive 
         and actual style names.
 
@@ -8753,7 +9001,7 @@ make sure you add the following:
        and <code>a[2]-&gt;func()</code>.</li>
 <li>   \em %className did not remove the %</li>
 <li>   In some cases namespace members ended up multiple times in the
-       documentatation.</li>
+       documentation.</li>
 <li>   Fixed a bug in the auto list generation.</li>
 <li>   \latexonly inside brief description did not work properly.</li>
 <li>   "Referenced By" list did not include constructors with 
@@ -8780,7 +9028,7 @@ make sure you add the following:
        item indicating where the todo item was found. The todo list (and
        all todo items) can be disabled by setting GENERATE_TODOLIST to NO.</li>
 <li>   &lt;pre&gt; ... &lt;/pre&gt; blocks now behave as in plain HTML instead of
-       \code ... \endcode blocks. This also works for LaTeX ofcourse. 
+       \code ... \endcode blocks. This also works for LaTeX of course. 
        These blocks differ from \verbatim ... \endverbatim blocks in that 
        commands can be used inside these blocks.</li>
 </ul>
@@ -8819,7 +9067,7 @@ make sure you add the following:
        </pre>
        Credits go to Joerg Baumann.</li>
 <li>   Included French and Czech language updates from Mathieu Despriée and
-       Petr Prikryl. Also included a language update for german from 
+       Petr Prikryl. Also included a language update for German from 
        Raimund Klein.</li>
 <li>   Doxygen will now do give proper warnings for formulas that do not 
        end properly.</li>
@@ -8891,7 +9139,7 @@ make sure you add the following:
        graphicx package instead of epsfig to simplify the use of pdflatex 
        (thanks to Pier Giorgio for showing me how that works).</li>
 <li>   Reimplemented the <code>system()</code> call for Unix, so doxygen becomes
-       interruptable when calling external tools such as dot.</li>
+       interruptible when calling external tools such as dot.</li>
 <li>   Changed the way <code>-w</code> works. It can now also be used to generate
        template header and footers.</li>
 </ul>
@@ -8927,7 +9175,7 @@ make sure you add the following:
        set the file patterns for the include files (if left empty the 
        <code>FILE_PATTERNS</code> will be used, which was also the old 
        behaviour). </li>
-<li>   Added a couple of commands for kdoc compatability: <code>@p</code>, 
+<li>   Added a couple of commands for kdoc compatibility: <code>@p</code>, 
        <code>@li</code>, <code>@em</code>.
        Also made @ref a bit less strict.</li>
 <li>   Portuguese translation by Rui Lopes.  </li>
@@ -8959,12 +9207,12 @@ make sure you add the following:
 <li>   Global functions within anonymous namespace scopes did appear
        in the documentation with the anonymous scope marker used internally
        by doxygen.</li>
-<li>   "namespace{}",so without space was not recognised as a namespace.</li>
+<li>   "namespace{}",so without space was not recognized as a namespace.</li>
 <li>   If the search engine was used then running installdox on the generated
        html resulted in bogus links to the search engine.</li>
 <li>   Fixed some compiler warning on Solaris.</li>
 <li>   Changed grey by grey50 in dot.cpp to avoid PDF conversion problems.</li>
-<li>   A &lt;/pre&gt; that was not preceeded by a whitespace was ignored </li>
+<li>   A &lt;/pre&gt; that was not preceded by a whitespace was ignored </li>
 <li>   The methods operator&lt;() and operator&lt;&lt;() were not 
        automatically linked anymore.</li>
 <li>   Some special characters in LaTeX were eating up the blanks that 
@@ -9036,7 +9284,7 @@ make sure you add the following:
        which files #include (i.e. depend on) a given file. This graph is 
        enabled by setting HAVE_DOT and INCLUDED_BY_GRAPH to YES.</li>
 <li>   added new configuration option EXTRACT_STATIC that can be used
-       to enable/disable the extraction of static file members. The behaviour
+       to enable/disable the extraction of static file members. The behavior
        of this option used to be linked with EXTRACT_PRIVATE.</li>
 <li>   Added two new configuration options MAX_DOT_GRAPH_WIDTH and 
        MAX_DOT_GRAPH_HEIGHT that let the user configure how big the
@@ -9095,7 +9343,7 @@ make sure you add the following:
 </ul>
 <h3>Bug fixes</h3>
 <ul>
-<li>   the warning message in case of ambigous file matches was containing
+<li>   the warning message in case of ambiguous file matches was containing
        a bogus <code>%s</code>, which could even crash doxygen.</li>
 <li>   An autolist followed by a \retval, \param, or \exception did 
        produced invalid output, resulting in a compile error in LaTeX. </li>
@@ -9108,7 +9356,7 @@ make sure you add the following:
 <li>   The hierarchy shown in the "Contents" part of the html help
        browser did not properly show the hierarchy when it contained
        undocumented classes. </li>
-<li>   explict compound specifiers in the return type could lead to 
+<li>   explicit compound specifiers in the return type could lead to 
        parse problems. Example:
        <pre>
        enum SomeEnumType_e Func()
@@ -9123,8 +9371,8 @@ make sure you add the following:
        and links to the correct reimplemented member are generated.</li>
 <li>   \ingroup did not work when grouping enums</li>
 <li>   members of a module were not cross-referenced with the sources.</li>
-<li>   Function pointers like <code>void ( *func )()</code> where not c
-       orrectly parsed because of the extra spacing between 
+<li>   Function pointers like <code>void ( *func )()</code> where not 
+       correctly parsed because of the extra spacing between 
        the `(' and the `*'. </li>
 <li>   The const in void <code>func(int * const val /*&lt; a value. */);</code>
        was named part of the name, instead of the type.</li>
@@ -9384,10 +9632,10 @@ make sure you add the following:
          template &lt;class T&gt; class S&lt;C&lt;T&gt; &gt; : public SB&lt;C&lt;T&gt; &gt; {};
        </pre> </li>
 <li>   #includes in code fragments where not hyperlinked. Operator
-       methods were also not correctly recognised.</li>
+       methods were also not correctly recognized.</li>
 <li>   C/C++ comments inside initializers where not handled properly.</li>
 <li>   If the type of an argument of a member definition was prefixed 
-       with a (redudant) scope name of an indirect base class, 
+       with a (redundant) scope name of an indirect base class, 
        then it was not matched against the member declaration if that
        omitted the scope.</li>
 <li>   \name did not work within //! comments</li>
@@ -9413,7 +9661,7 @@ make sure you add the following:
        case file names with space were used.</li>
 <li>   back-references from source-lines to documentation only worked for
        those members of a member group that were explicitly documented.</li>
-<li>   doxygen did not distriguish between func(int a) and func(int a[])
+<li>   doxygen did not distinguish between func(int a) and func(int a[])
        which could cause documentation to end up at the wrong member
        in case over overloading. </li>
 </ul>
@@ -9497,7 +9745,7 @@ make sure you add the following:
 <li>   Since 1.1.2, environment variable expansion in the config 
        file always resulted in a single string for each expanded variable
        (just as if quotes were put around the environment variable).
-       The old behaviour is restored again.</li>
+       The old behavior is restored again.</li>
 <li>   removed redundant spaces in the man page output and fixed the
        tab alignment in code fragments.</li>
 <li>   <code>typedef ( bla::*proc)();</code> was not properly parsed because of the
@@ -9519,7 +9767,7 @@ make sure you add the following:
        dot graphs. The cause was likely to be multiple frees of the same 
        pointer (but I have not been able to reproduce the crash myself). 
        I've now reimplemented the deletion routine of the dot graph
-       respresentation, which hopefully fixes this problem.</li>
+       representation, which hopefully fixes this problem.</li>
 <li>   Elements of the configuration options in lists, which used quotes 
        were broken up into smaller pieces anyway. This most notably broke
        PREDEFINED in some cases that worked before.</li>
@@ -9548,7 +9796,7 @@ make sure you add the following:
        of the LaTeX output (doxygen.sty a.o.) was not generated 
        (Thanks to Markus Lepper for reporting this).</li>
 <li>   Doxygen can now match arguments containing an explicit namespace
-       qualifier against arguments containing an implicit qualitifier 
+       qualifier against arguments containing an implicit qualifier 
        (i.e. imported via a using directive). 
        An example (thanks to Karl Stroetmann):
        <pre>
@@ -9614,7 +9862,7 @@ make sure you add the following:
        <p>
        <b>Usage:</b> A group is defined by a <code>//@{ .. //@}</code> block 
        (or <code>/*@{*/../*@}*/</code> if 
-       you're addited to C style comments :-) Nesting of groups is not 
+       you're addicted to C style comments :-) Nesting of groups is not 
        allowed. Before the opening marker of a block a separate comment 
        block should be placed. This block should contain the @name 
        (or \name) command to specify the header of the group.
@@ -9752,7 +10000,7 @@ make sure you add the following:
 <li>   Fixed a bug in structure of the graphical class hierarchy
        (thanks to Paul Bohme for pointing me at this bug)</li>
 <li>   Non-function members can now also be documented if they
-       are inside annonymous namespaces, which themselves are nested in 
+       are inside anonymous namespaces, which themselves are nested in 
        named namespaces.</li>
 <li>   #defines can now grouped with \defgroup and \ingroup as well.</li>
 <li>   fixed a bug in the latex output of groups (thanks to Gregory Kurz
@@ -9924,7 +10172,7 @@ make sure you add the following:
        /*! let's go to the bar */
        class foo::bar { };
        </pre></li>
-<li>   Members inside annonymous namespaces nested inside named namespaces 
+<li>   Members inside anonymous namespaces nested inside named namespaces 
        were not properly handled. </li>
 <li>   When documenting template specializations with the \class command,
        the second argument was not interpreted correctly.</li>
@@ -10084,7 +10332,7 @@ make sure you add the following:
        </pre></li>
 <li>   Three new section commands <code>\pre</code>, <code>\post</code> and 
        <code>\invariant</code> are added to describe
-       preconditions, postcondictions and invariants respectively.</li>
+       preconditions, postconditions and invariants respectively.</li>
 <li>   Variable/enum initializers and define definitions are 
        now included in documentation (unless the initializer/definition 
        is more than 30 lines long)</li>
@@ -10108,7 +10356,7 @@ make sure you add the following:
 <li>   Autolinks to #defines looked like function macro even if they weren't.</li>
 <li>   Members that were hidden deep in an inheritance tree, got multiple
        scope prefixes in the "all members list", while a scope prefix to
-       the member in the base class was enough to use it unambiguishly.</li>
+       the member in the base class was enough to use it unambiguously.</li>
 <li>   <code>\latexonly ... \endlatexonly</code> in the main page produced 
        erroneous text in refman.tex</li>
 <li>   The keywords in header and footer were only evaluated once.</li>
index 48991fb..9bd3f66 100644 (file)
@@ -32,7 +32,7 @@ Each argument has a certain range:
     Paragraphs are delimited by a blank line or by a section indicator. Note that 
     {curly} braces are also used for command options, here the braces are mandatory
     and  just 'normal' characters. The starting curly brace has to directly follow
-    the command, so without whitspace.
+    the command, so without whitespace.
 </ul>
 If in addition to the above argument specifiers [square] brackets are used the argument
 is optional, unless they are placed between quotes in that case they are a mandatory
@@ -349,7 +349,7 @@ Structural indicators
   \addindex \\showrefby
   When this command is put in a comment block of a function, method or variable,
   then doxygen will generate an overview for that function, method, variable of
-  the, documented, funcions and methods that call / use it.
+  the, documented, functions and methods that call / use it.
   The overview will be generated regardless of the value of
   \ref cfg_referenced_by_relation "REFERENCED_BY_RELATION".
   \note The completeness (and correctness) of the overview depends on the
@@ -1411,6 +1411,13 @@ contains \c TEST, or \c DEV
   then the \c \\details command is not needed.
 
 <hr>
+\section cmdnoop \\noop ( text to be ignored )
+
+  \addindex \\noop
+  All the text, including the command, till the end of the line is ignored.
+  The command will most commonly be used in combination with \ref cfg_aliases "ALIASES"
+  to ignore not supported commands that are present for e.g. other processing tools.
+<hr>
 \section cmdelse \\else
 
   \addindex \\else
@@ -2270,8 +2277,8 @@ Commands for displaying examples
   The `option` `lineno` can be used to enable line numbers for the included code if desired.
   The `option` `doc` can be used to treat the file as documentation rather than code.
 
-  \note Some that when using the `{doc}` option,
-       commands like \ref cmdcond "\\cond" and \ref cmdif "\\if" don't work with
+  \note When using the `{doc}` option,
+       some commands like \ref cmdcond "\\cond" and \ref cmdif "\\if" don't work with
        this command due to the moment of parsing.
 
   \note The included documentation should not have comment signs in it as they will appear
@@ -2402,8 +2409,8 @@ Commands for displaying examples
  The `option` `lineno` can be used to enable line numbers for the included code if desired.
  The `option` `doc` can be used to treat the file as documentation rather than code.
 
- \note Some that when using the `{doc}` option,
-       commands like \ref cmdcond "\\cond" and \ref cmdif "\\if" don't work with
+ \note When using the `{doc}` option,
+       some commands like \ref cmdcond "\\cond" and \ref cmdif "\\if" don't work with
        this command due to the moment of parsing.
 
  \note The included documentation should not have comment signs in it as they will appear
@@ -2592,7 +2599,7 @@ Commands for visual enhancements
   a Python file for instance, the syntax highlight will be done according
   to the Python syntax. 
 
-  If it unclear from the context which language is meant (for instance the
+  If it is unclear from the context which language is meant (for instance the
   comment is in a <code>.txt</code> or <code>.markdown</code> file) then you can also explicitly
   indicate the language, by putting the file extension typically
   that doxygen associated with the language in curly brackets after the
@@ -3191,7 +3198,7 @@ class Receiver
   \anchor image_sizeindicator \par Size indication
   The \c sizeindication can specify the width or height to be used (or a combination).
   The size specifier in \LaTeX (for example `10cm` or
-  `4in` or a symbolic width like `\\textwidth`).
+  `4in` or a symbolic width like `\textwidth`).
 
   Currently only the option `inline` is supported. In case the option `inline` is
   specified the image is placed "in the line", when a caption s present it is shown 
@@ -3214,8 +3221,10 @@ class Receiver
 \endverbatim
 
   \warning The image format for HTML is limited to what your
-           browser supports. For \LaTeX, the image format
-           must be Encapsulated PostScript (eps).
+           browser supports.<br>For \LaTeX, the image format
+           must be supported by the \LaTeX `\includegraphics` command i.e.
+           Encapsulated PostScript (eps), Portable network graphics (png),
+           Joint photographic experts group (jpg / jpeg).
            <br><br>
            Doxygen does not check if the image is in the correct format.
            So \e you have to make sure this is the case!
index 9d14f6e..8e99669 100644 (file)
@@ -513,6 +513,10 @@ Here is an example VHDL file with doxygen comments:
  for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
  \endlatexonly
 
+As of VHDL 2008 it is also possible to use `/&zwj;*` style comments.
+Doxygen will handle `/&zwj;* ... *&zwj;/`as plain comments and `/&zwj;*! ... *&zwj;/`
+style comments as special comments to be parsed by doxygen.
+
 To get proper looking output you need to set
 \ref cfg_optimize_output_vhdl "OPTIMIZE_OUTPUT_VHDL" to \c YES in the
 configuration file. This will also affect a number of other settings. When they
index a9c6b38..0b02cb2 100644 (file)
@@ -10,8 +10,6 @@ You can use doxygen in a number of ways:
 1) Use doxygen to generate a template configuration file:
 .IP
 doxygen [-s] \fB\-g\fR [configName]
-.IP
-If - is used for configName doxygen will write to standard output.
 .TP 
 2) Use doxygen to update an old configuration file:
 .IP
@@ -20,35 +18,45 @@ doxygen [-s] \fB\-u\fR [configName]
 3) Use doxygen to generate documentation using an existing configuration file:
 .IP
 doxygen [configName]
-.IP
-If - is used for configName doxygen will read from standard input.
 .TP
 4) Use doxygen to generate a template file controlling the layout of the generated documentation:
 .IP
-doxygen -l [layoutFileName.xml]
+doxygen -l [layoutFileName]
+.IP
+In case layoutFileName is omitted layoutFileName.xml will be used as filename.
+If - is used for layoutFileName doxygen will write to standard output.
 .TP
 5) Use doxygen to generate a template style sheet file for RTF, HTML or Latex.
-.TP
+.IP
 RTF:
 doxygen \fB\-w\fR rtf styleSheetFile
-.TP
+.IP
 HTML:
 doxygen \fB\-w\fR html headerFile footerFile styleSheetFile [configFile]
-.TP
+.IP
 LaTeX: doxygen \fB\-w\fR latex headerFile footerFile styleSheetFile [configFile]
 .TP
 6) Use doxygen to generate an rtf extensions file
-.TP
+.IP
 RTF:
 doxygen \fB\-e\fR rtf extensionsFile
+.IP
+If - is used for extensionsFile doxygen will write to standard output.
 .TP
 7) Use doxygen to compare the used configuration file with the template configuration file
-.TP
+.IP
 doxygen \fB\-x\fR [configFile]
+.TP
+8) Use doxygen to show a list of built-in emojis.
+.IP
+doxygen \fB\-f\fR emoji outputFileName
+.IP
+If - is used for outputFileName doxygen will write to standard output.
 .PP
 If \fB\-s\fR is specified the comments in the config file will be omitted.
 If configName is omitted `Doxyfile' will be used as a default.
+If - is used for configFile doxygen will write / read the configuration to /from standard output / input.
 .SH AUTHOR
-Doxygen version @VERSION@, Copyright Dimitri van Heesch 1997-2015
+Doxygen version @VERSION@, Copyright Dimitri van Heesch 1997-2019
 .SH SEE ALSO
 doxywizard(1).
index 8ff3c66..e350013 100644 (file)
 \usepackage{doxygen}
 \usepackage{manual}
 %%
+%gave problems when in doxygen.sty
+\makeatletter
+\newcommand\hrulefilll{\leavevmode\leaders\hrule\hskip 0pt plus 1filll\kern\z@}
+\makeatother
+%%
 % unfortunately constructs like: 
 %   \renewcommand{\doxysection}[1]{\doxysubsection{##1}}
 % using values from book.cls (see also doxygen.sty) and redefining sections to correct level.
index 4c861fe..0175780 100644 (file)
@@ -108,7 +108,7 @@ By means of the doxygen configuration parameter
 For convenience a zip with the result of running the script can also be downloaded from 
 http://www.doxygen.nl/dl/github_emojis.zip
 
-For a overview of the supported emoji one can issue the comand:<br>
+For an overview of the supported emoji one can issue the command:<br>
 `doxygen -f emoji <outputFileName>`
 
 \htmlonly
index ead7ea8..e139408 100644 (file)
@@ -77,7 +77,7 @@ 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 
-URL (without the `?test` part) to the `SEARCHENGINE_URL` tag in
+URL (without the `?test` part) to the \ref cfg_searchengine_url "SEARCHENGINE_URL" tag in
 doxygen's configuration file:
 
     SEARCHENGINE_URL = http://yoursite.com/path/to/cgi/doxysearch.cgi
@@ -135,7 +135,8 @@ and then copy the resulting `doxysearch.db` to the directory where also
 
 The `searchdata.xml` file doesn't contain any absolute paths or links, 
 so how can the search results from multiple projects be linked back to the right documentation set?
-This is where the `EXTERNAL_SEARCH_ID` and `EXTRA_SEARCH_MAPPINGS` options come into play.
+This is where the \ref cfg_external_search_id "EXTERNAL_SEARCH_ID" and
+\ref cfg_extra_search_mappings "EXTRA_SEARCH_MAPPINGS" options come into play.
 
 To be able to identify the different projects, one needs to
 set a unique ID using \ref cfg_external_search_id "EXTERNAL_SEARCH_ID"
@@ -168,8 +169,8 @@ and the search results will link to the right documentation set.
 
 When you modify the source code, you should re-run doxygen to get up to date
 documentation again. When using external searching you also need to update the
-search index by re-running `doxyindexer`. You could wrap the call to doxygen
-and doxyindexer together in a script to make this process easier.
+search index by re-running `doxyindexer`. You could wrap the call to `doxygen`
+and `doxyindexer` together in a script to make this process easier.
 
 \section extsearch_api Programming interface
 
index 0ba9450..8a3aee8 100644 (file)
@@ -216,7 +216,7 @@ If you don't mind spending some time on it, there are several options:
 - If the grammar of X is somewhat different than you can write an input
   filter that translates X into something similar enough to C/C++ for
   doxygen to understand (this approach is taken for VB, Object Pascal, and
-  Javascript, see http://www.doxygen.org/download.html#helpers).
+  JavaScript, see http://www.doxygen.org/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 
   \c src/scanner.l (and also by \c src/tagreader.cpp while reading tag files).
index 8b19898..65fc343 100644 (file)
@@ -69,7 +69,7 @@
     generated automatically.
 <li>Includes a fast, rank based search engine to search for strings or words 
     in the class and member documentation (PHP based).
-<li>Includes an Javascript based live search feature to search for symbols
+<li>Includes an JavaScript based live search feature to search for symbols
     as you type (for small to medium sized projects).
 <li>You can type normal HTML tags in your documentation. Doxygen will convert
     them to their equivalent \LaTeX, RTF, and man-page 
index 520f089..88a8725 100644 (file)
@@ -100,9 +100,27 @@ the section should contain valid command for the specific environment.
 
 \warning Currently, doxygen is not very fault tolerant in recovering 
 from typos in formulas. It may be necessary to remove the
-files <code>formula.repository</code> that are written to the html and rtf directories to 
+files <code>formula.repository</code> that are written to the html, rtf etc. directories to 
 get rid of an incorrect formula as well as the <code>form_*</code> files.
 
+To have the possibility to define your own \LaTeX commands, for e.g. formula building blocks
+or consistent writing of certain words, the configuration option \ref cfg_formula_macrofile "FORMULA_MACROFILE"
+can be used. to supply a file with \LaTeX commands.
+This file can contain \LaTeX `\newcommand` and \`renewcommand` commands and they are included
+formulas (image version and MathJax version) as well as in the generated \LaTeX output (for PDF generation).<br>
+The `\newcommand` (and `\renewcommand`) are restricted to a version without optional
+parameters so only the following types are supported:
+```
+\newcommand{\cmd}{replacement}
+    and
+\newcommand{\cmd}[nr]{replacement}
+```
+e.g.
+```
+\newcommand{\E}{\mathrm{E}}
+\newcommand{\ccSum}[3]{\sum_{#1}^{#2}{#3}}
+```
+
 \htmlonly
 Go to the <a href="tables.html">next</a> section or return to the
  <a href="index.html">index</a>.
index 12347ab..edc14d9 100644 (file)
@@ -25,6 +25,8 @@ of a HTML tag are passed on to the HTML output only
 <ul>
 <li><tt>\<A HREF="..."\></tt> Starts a hyperlink 
                        (if supported by the output format). 
+<li><tt>\<A ID="..."\></tt> Starts a named anchor 
+                       (if supported by the output format).
 <li><tt>\<A NAME="..."\></tt> Starts a named anchor 
                        (if supported by the output format).
 <li><tt>\</A\></tt>    Ends a link or anchor 
@@ -87,6 +89,8 @@ of a HTML tag are passed on to the HTML output only
 <li><tt>\</SMALL\></tt> Ends a <tt>\<SMALL\></tt> section.
 <li><tt>\<SPAN></tt>   Starts an inline text fragment with a specific style (HTML only)
 <li><tt>\</SPAN></tt>  Ends an inline text fragment with a specific style (HTML only)
+<li><tt>\<S\></tt>     Starts a section of strike through text.
+<li><tt>\</S\></tt>    Ends a section of strike through text.
 <li><tt>\<STRIKE\></tt> Starts a section of strike through text.
 <li><tt>\</STRIKE\></tt> Ends a section of strike through text.
 <li><tt>\<STRONG\></tt> Starts a section of bold text.
@@ -302,7 +306,7 @@ The list of entities with their descriptions has been taken from <a href="http:/
 <li><tt>\&notin;</tt>`&nbsp;&nbsp;&nbsp;`                 not an element of: &notin;
 <li><tt>\&ni;</tt>`&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`  contains as member: &ni;
 <li><tt>\&prod;</tt>`&nbsp;&nbsp;&nbsp;&nbsp;`            n-ary product = product sign: &prod;
-<li><tt>\&sum;</tt>`&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`       n-ary sumation: &sum;
+<li><tt>\&sum;</tt>`&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`       n-ary summation: &sum;
 <li><tt>\&minus;</tt>`&nbsp;&nbsp;&nbsp;`                 minus sign: &minus;
 <li><tt>\&lowast;</tt>`&nbsp;&nbsp;`                      asterisk operator: &lowast;
 <li><tt>\&radic;</tt>`&nbsp;&nbsp;&nbsp;`                 square root = radical sign: &radic;
index 9afe624..2148add 100644 (file)
@@ -71,6 +71,7 @@ The first part forms a user manual:
 <li>Section \ref markdown show the Markdown formatting supported by doxygen.
 <li>Section \ref lists shows how to create lists.
 <li>Section \ref grouping shows how to group things together. 
+<li>Section \ref tables shows how to insert tables in the documentation.
 <li>Section \ref formulas shows how to insert formulas in the documentation.
 <li>Section \ref diagrams describes the diagrams and graphs that doxygen can generate.
 <li>Section \ref preprocessing explains how doxygen deals with macro definitions.
@@ -120,7 +121,7 @@ The third part provides information for developers:
 \addindex license
 \addindex GPL
 
-Copyright &copy; 1997-2016 by 
+Copyright &copy; 1997-2019 by 
 <a href="mailto:doxygen@gmail.com">Dimitri van Heesch</a>.<p>
 
 Permission to use, copy, modify, and distribute this software and its
index 5edbaf9..883e831 100644 (file)
@@ -193,10 +193,12 @@ code spans appear inline in a paragraph. An example:
 
     Use the `printf()` function.
 
-To show a literal backtick inside a code span use double backticks, i.e.
+To show a literal backtick or single quote inside a code span use double backticks, i.e.
 
     To assign the output of command `ls` to `var` use ``var=`ls```.
 
+    To assign the text 'text' to `var` use ``var='text'``.
+
 See section \ref mddox_code_spans for more info how doxygen handles
 code spans slightly different than standard Markdown.
 
@@ -606,6 +608,9 @@ In other words; a single quote cancels the special treatment of a code span
 wrapped in a pair of backtick characters. This extra restriction was
 added for backward compatibility reasons.
 
+In case you want to have single quotes inside a code span, don't use 
+one backtick but two backticks around the code span.
+
 \subsection mddox_lists Lists Extensions
 
 With Markdown two lists separated by an empty line are joined together into
index a49b889..4df83ff 100644 (file)
@@ -264,7 +264,7 @@ preprocessing has been done (Hint: set <code>QUIET = YES</code> and
 <code>WARNINGS = NO</code> in the configuration file to disable any other 
 output).
 
-Note preprocessing is not done for all languages. Preprocesing is enabled for files
+Note preprocessing is not done for all languages. Preprocessing is enabled for files
 that use the "C" scanner (with the exception of 'java', 'd' and 'php'), Fortran files
 (only in case the extension contains at least one upper case character) and vhdl files.
 
index 1716729..880c3f4 100644 (file)
@@ -30,7 +30,7 @@ has its own advantages and disadvantages:
 
 <h2>1. Client side searching</h2>
    The easiest way to enable searching is to enable the built-in client
-   side search engine. This engine is implemented using Javascript and DHTML
+   side search engine. This engine is implemented using JavaScript and DHTML
    only and runs entirely on the clients browser. So no additional tooling is
    required to make it work. 
  
index f9ae9a2..045f66c 100644 (file)
@@ -128,6 +128,7 @@ Extension | Language | Extension | Language     | Extension | Language
 .hpp      |C / C++   | | | | |
 .h++      |C / C++   | | | | |
 .mm       |C / C++   | | | | |
+.txt      |C / C++   | | | | |
 
 Any other extension is not parsed unless it is added to
 \ref cfg_file_patterns "FILE_PATTERNS" and the appropriate
@@ -186,7 +187,7 @@ IE8, IE9, and Opera to test the generated output).
 
 Some of the features the HTML section (such as 
 \ref cfg_generate_treeview "GENERATE_TREEVIEW" or the search engine) 
-require a browser that supports Dynamic HTML and Javascript enabled. 
+require a browser that supports Dynamic HTML and JavaScript enabled. 
 
 \subsection latex_out LaTeX output
 \addindex LaTeX
index 5dc166d..6c78696 100644 (file)
@@ -28,6 +28,8 @@ For more complex tables the HTML syntax can be used. Doxygen
 will process such tables and translate them to the various output formats
 (at least for the formats that do support tables such as HTML and \LaTeX).
 
+Note a table should at least contain 1 row (`<tr>`) and in case a `<caption>` is used the `<caption>` should precede the first row.
+
 Here is an example of a complex table:
 
 \verbatim
index ed001bb..c04a367 100644 (file)
@@ -141,8 +141,8 @@ class Transl:
         self.baseClassId = None\r
         self.readableStatus = None   # 'up-to-date', '1.2.3', '1.3', etc.\r
         self.status = None           # '', '1.2.03', '1.3.00', etc.\r
-        self.lang = None             # like 'Brasilian'\r
-        self.langReadable = None     # like 'Brasilian Portuguese'\r
+        self.lang = None             # like 'Brazilian'\r
+        self.langReadable = None     # like 'Brazilian Portuguese'\r
         self.note = None             # like 'should be cleaned up'\r
         self.prototypeDic = {}       # uniPrototype -> prototype\r
         self.translateMeText = 'translate me!'\r
index 9ed48fb..e790684 100644 (file)
@@ -27,9 +27,9 @@ template<class T,int i> Test<T,i>::Test() {}
 /*! The copy constructor */
 template<class T,int i> Test<T,i>::Test(const Test &t) {}
 
-/*! The constructor of the partial specilization */
+/*! The constructor of the partial specialization */
 template<class T> Test<T *>::Test() {}
 
-/*! The constructor of the specilization */
+/*! The constructor of the specialization */
 template<> Test<void *,200>::Test() {}
 
index 6e28587..e281abe 100644 (file)
@@ -435,7 +435,7 @@ static unsigned HuffmanTree_make2DTree(HuffmanTree* tree)
 
   if(!uivector_resize(&tree->tree2d, tree->numcodes * 2)) return 9901; /*if failed return not enough memory error*/
   /*convert tree1d[] to tree2d[][]. In the 2D array, a value of 32767 means uninited, a value >= numcodes is an address to another bit, a value < numcodes is a code. The 2 rows are the 2 possible bit values (0 or 1), there are as many columns as codes - 1
-  a good huffmann tree has N * 2 - 1 nodes, of which N - 1 are internal nodes. Here, the internal nodes are stored (what their 0 and 1 option point to). There is only memory for such good tree currently, if there are more nodes (due to too long length codes), error 55 will happen*/
+  a good huffman tree has N * 2 - 1 nodes, of which N - 1 are internal nodes. Here, the internal nodes are stored (what their 0 and 1 option point to). There is only memory for such good tree currently, if there are more nodes (due to too long length codes), error 55 will happen*/
   for(n = 0;  n < tree->numcodes * 2; n++) tree->tree2d.data[n] = 32767; /*32767 here means the tree2d isn't filled there yet*/
 
   for(n = 0; n < tree->numcodes; n++) /*the codes*/
@@ -1509,7 +1509,7 @@ static unsigned getNumColorChannels(unsigned colorType)
     case 4: return 2; /*grey + alpha*/
     case 6: return 4; /*RGBA*/
   }
-  return 0; /*unexisting color type*/
+  return 0; /*nonexistent color type*/
 }
 
 static unsigned getBpp(unsigned colorType, unsigned bitDepth)
@@ -2023,7 +2023,7 @@ static void filterScanline(unsigned char* out, const unsigned char* scanline, co
         for(i = bytewidth; i <    length; i++) out[i] = (unsigned char)(scanline[i] - paethPredictor(scanline[i - bytewidth], 0, 0));
       }
       break;
-  default: return; /*unexisting filter type given*/
+  default: return; /*nonexistent filter type given*/
   }
 }
 
@@ -2341,10 +2341,10 @@ void LodePNG_encode(LodePNG_Encoder* encoder, unsigned char** out, size_t* outsi
   }
 
   if(encoder->settings.zlibsettings.windowSize > 32768) { encoder->error = 60; return; } /*error: windowsize larger than allowed*/
-  if(encoder->settings.zlibsettings.btype > 2) { encoder->error = 61; return; } /*error: unexisting btype*/
-  if(encoder->infoPng.interlaceMethod > 1) { encoder->error = 71; return; } /*error: unexisting interlace mode*/
-  if((encoder->error = checkColorValidity(info.color.colorType, info.color.bitDepth))) return; /*error: unexisting color type given*/
-  if((encoder->error = checkColorValidity(encoder->infoRaw.color.colorType, encoder->infoRaw.color.bitDepth))) return; /*error: unexisting color type given*/
+  if(encoder->settings.zlibsettings.btype > 2) { encoder->error = 61; return; } /*error: nonexistent btype*/
+  if(encoder->infoPng.interlaceMethod > 1) { encoder->error = 71; return; } /*error: nonexistent interlace mode*/
+  if((encoder->error = checkColorValidity(info.color.colorType, info.color.bitDepth))) return; /*error: nonexistent color type given*/
+  if((encoder->error = checkColorValidity(encoder->infoRaw.color.colorType, encoder->infoRaw.color.bitDepth))) return; /*error: nonexistent color type given*/
 
   if(!LodePNG_InfoColor_equal(&encoder->infoRaw.color, &info.color))
   {
index 3d67ed3..079fcfc 100644 (file)
@@ -4,6 +4,18 @@ include_directories(
     ${GENERATED_SRC}
 )
 
+set(LEX_FILES mscgen_lexer) 
+foreach(lex_file ${LEX_FILES})
+    add_custom_command(
+        COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/scan_states.py ${CMAKE_SOURCE_DIR}/libmscgen/${lex_file}.l > ${GENERATED_SRC}/${lex_file}.l.h
+        DEPENDS ${CMAKE_SOURCE_DIR}/src/scan_states.py ${CMAKE_SOURCE_DIR}/libmscgen/${lex_file}.l
+        OUTPUT  ${GENERATED_SRC}/${lex_file}.l.h
+    )
+    set_source_files_properties(${GENERATED_SRC}/${lex_file}.l.h PROPERTIES GENERATED 1)
+
+    FLEX_TARGET(${lex_file}        ${lex_file}.l        ${GENERATED_SRC}/${lex_file}.cpp        COMPILE_FLAGS "${LEX_FLAGS}")
+endforeach()
+
 add_library(mscgen
 gd.c
 gd_security.c
@@ -19,6 +31,7 @@ mscgen_ps_out.c
 mscgen_null_out.c
 ${GENERATED_SRC}/mscgen_language.cpp
 ${GENERATED_SRC}/mscgen_lexer.cpp
+${GENERATED_SRC}/mscgen_lexer.l.h
 mscgen_api.c
 mscgen_msc.c
 mscgen_safe.c
@@ -28,10 +41,6 @@ mscgen_utf8.c
 )
 
 
-FLEX_TARGET(mscgen_lexer
-            mscgen_lexer.l
-            ${GENERATED_SRC}/mscgen_lexer.cpp
-            COMPILE_FLAGS "${LEX_FLAGS}")
 BISON_TARGET(mscgen_language
              mscgen_language.y
              ${GENERATED_SRC}/mscgen_language.cpp
index 7f0a258..7e8b241 100644 (file)
@@ -501,7 +501,7 @@ BGD_DECLARE(int) gdImageColorClosestAlpha (gdImagePtr im, int r, int g, int b, i
 #define RETURN_HWB(h, w, b) {HWB->H = h; HWB->W = w; HWB->B = b; return HWB;}
 #define RETURN_RGB(r, g, b) {RGB->R = r; RGB->G = g; RGB->B = b; return RGB;}
 #define HWB_UNDEFINED -1
-#define SETUP_RGB(s, r, g, b) {s.R = r/255.0; s.G = g/255.0; s.B = b/255.0;}
+#define SETUP_RGB(s, r, g, b) {s.R = r/255.0f; s.G = g/255.0f; s.B = b/255.0f;}
 
 #define MIN(a,b) ((a)<(b)?(a):(b))
 #define MIN3(a,b,c) ((a)<(b)?(MIN(a,c)):(MIN(b,c)))
@@ -567,7 +567,7 @@ HWB_Diff (int r1, int g1, int b1, int r2, int g2, int b2)
        if ((HWB1.H == HWB_UNDEFINED) || (HWB2.H == HWB_UNDEFINED)) {
                diff = 0;                       /* Undefined hues always match... */
        } else {
-               diff = fabs (HWB1.H - HWB2.H);
+               diff = fabsf(HWB1.H - HWB2.H);
                if (diff > 3) {
                        diff = 6 - diff;        /* Remember, it's a colour circle */
                }
@@ -1191,7 +1191,7 @@ clip_1d (int *x0, int *y0, int *x1, int *y1, int mindim, int maxdim)
                *x0 = mindim;
                /* now, perhaps, adjust the far end of the line as well */
                if (*x1 > maxdim) {
-                       *y1 += m * (maxdim - *x1);
+                       *y1 += (int)(m * (maxdim - *x1));
                        *x1 = maxdim;
                }
                return 1;
@@ -1594,7 +1594,7 @@ BGD_DECLARE(void) gdImageLine (gdImagePtr im, int x1, int y1, int x2, int y2, in
                          TBB: but watch out for /0! */
                double ac = cos (atan2 (dy, dx));
                if (ac != 0) {
-                       wid = thick / ac;
+                       wid = (int)(thick / ac);
                } else {
                        wid = 1;
                }
@@ -1654,7 +1654,7 @@ BGD_DECLARE(void) gdImageLine (gdImagePtr im, int x1, int y1, int x2, int y2, in
                   TBB: but watch out for /0! */
                double as = sin (atan2 (dy, dx));
                if (as != 0) {
-                       wid = thick / as;
+                       wid = (int)(thick / as);
                } else {
                        wid = 1;
                }
@@ -1734,7 +1734,7 @@ BGD_DECLARE(void) gdImageDashedLine (gdImagePtr im, int x1, int y1, int x2, int
                   TBB: but watch out for /0! */
                double as = sin (atan2 (dy, dx));
                if (as != 0) {
-                       wid = thick / as;
+                       wid = (int)(thick / as);
                } else {
                        wid = 1;
                }
@@ -1783,7 +1783,7 @@ BGD_DECLARE(void) gdImageDashedLine (gdImagePtr im, int x1, int y1, int x2, int
                   TBB: but watch out for /0! */
                double as = sin (atan2 (dy, dx));
                if (as != 0) {
-                       wid = thick / as;
+                       wid = (int)(thick / as);
                } else {
                        wid = 1;
                }
@@ -2273,7 +2273,7 @@ BGD_DECLARE(void) gdImageFillToBorder (gdImagePtr im, int x, int y, int border,
        /* Seek left */
        int leftLimit, rightLimit;
        int i;
-       int restoreAlphaBleding;
+       int restoreAlphaBlending;
 
        if (border < 0 || color < 0) {
                /* Refuse to fill to a non-solid border */
@@ -2288,7 +2288,7 @@ BGD_DECLARE(void) gdImageFillToBorder (gdImagePtr im, int x, int y, int border,
 
        leftLimit = (-1);
 
-       restoreAlphaBleding = im->alphaBlendingFlag;
+       restoreAlphaBlending = im->alphaBlendingFlag;
        im->alphaBlendingFlag = 0;
 
        if (x >= im->sx) {
@@ -2310,7 +2310,7 @@ BGD_DECLARE(void) gdImageFillToBorder (gdImagePtr im, int x, int y, int border,
                leftLimit = i;
        }
        if (leftLimit == (-1)) {
-               im->alphaBlendingFlag = restoreAlphaBleding;
+               im->alphaBlendingFlag = restoreAlphaBlending;
                return;
        }
        /* Seek right */
@@ -2354,7 +2354,7 @@ BGD_DECLARE(void) gdImageFillToBorder (gdImagePtr im, int x, int y, int border,
                        }
                }
        }
-       im->alphaBlendingFlag = restoreAlphaBleding;
+       im->alphaBlendingFlag = restoreAlphaBlending;
 }
 
 /*
@@ -3071,12 +3071,12 @@ BGD_DECLARE(void) gdImageCopyMerge (gdImagePtr dst, gdImagePtr src, int dstX, in
                        } else {
                                dc = gdImageGetPixel (dst, tox, toy);
 
-                               ncR = gdImageRed (src, c) * (pct / 100.0)
-                                     + gdImageRed (dst, dc) * ((100 - pct) / 100.0);
-                               ncG = gdImageGreen (src, c) * (pct / 100.0)
-                                     + gdImageGreen (dst, dc) * ((100 - pct) / 100.0);
-                               ncB = gdImageBlue (src, c) * (pct / 100.0)
-                                     + gdImageBlue (dst, dc) * ((100 - pct) / 100.0);
+                               ncR = (int)(gdImageRed (src, c) * (pct / 100.0)
+                                     + gdImageRed (dst, dc) * ((100 - pct) / 100.0));
+                               ncG = (int)(gdImageGreen (src, c) * (pct / 100.0)
+                                     + gdImageGreen (dst, dc) * ((100 - pct) / 100.0));
+                               ncB = (int)(gdImageBlue (src, c) * (pct / 100.0)
+                                     + gdImageBlue (dst, dc) * ((100 - pct) / 100.0));
 
                                /* Find a reasonable color */
                                nc = gdImageColorResolve (dst, ncR, ncG, ncB);
@@ -3144,15 +3144,15 @@ BGD_DECLARE(void) gdImageCopyMergeGray (gdImagePtr dst, gdImagePtr src, int dstX
                                nc = c;
                        } else {
                                dc = gdImageGetPixel (dst, tox, toy);
-                               g = 0.29900 * gdImageRed(dst, dc)
-                                   + 0.58700 * gdImageGreen(dst, dc) + 0.11400 * gdImageBlue(dst, dc);
+                               g = 0.29900f * gdImageRed(dst, dc)
+                                   + 0.58700f * gdImageGreen(dst, dc) + 0.11400f * gdImageBlue(dst, dc);
 
-                               ncR = gdImageRed (src, c) * (pct / 100.0)
-                                     + g * ((100 - pct) / 100.0);
-                               ncG = gdImageGreen (src, c) * (pct / 100.0)
-                                     + g * ((100 - pct) / 100.0);
-                               ncB = gdImageBlue (src, c) * (pct / 100.0)
-                                     + g * ((100 - pct) / 100.0);
+                               ncR = (int)(gdImageRed (src, c) * (pct / 100.0)
+                                     + g * ((100 - pct) / 100.0));
+                               ncG = (int)(gdImageGreen (src, c) * (pct / 100.0)
+                                     + g * ((100 - pct) / 100.0));
+                               ncB = (int)(gdImageBlue (src, c) * (pct / 100.0)
+                                     + g * ((100 - pct) / 100.0));
 
                                /* First look for an exact match */
                                nc = gdImageColorExact (dst, ncR, ncG, ncB);
@@ -3378,14 +3378,14 @@ BGD_DECLARE(void) gdImageCopyRotated (gdImagePtr dst,
                for (dx = dstX - radius; (dx <= dstX + radius); dx++) {
                        double sxd = (dx - dstX) * aCos - (dy - dstY) * aSin;
                        double syd = (dy - dstY) * aCos + (dx - dstX) * aSin;
-                       int sx = sxd + scX;
-                       int sy = syd + scY;
+                       int sx = (int)(sxd + scX);
+                       int sy = (int)(syd + scY);
                        if ((sx >= srcX) && (sx < srcX + srcWidth) &&
                                (sy >= srcY) && (sy < srcY + srcHeight)) {
                                int c = gdImageGetPixel (src, sx, sy);
                                /* 2.0.34: transparency wins */
                                if (c == src->transparent) {
-                                       gdImageSetPixel (dst, dx, dy, dst->transparent);
+                                       gdImageSetPixel (dst, (int)dx, (int)dy, dst->transparent);
                                } else if (!src->trueColor) {
                                        /* Use a table to avoid an expensive
                                           lookup on every single pixel */
@@ -3399,10 +3399,10 @@ BGD_DECLARE(void) gdImageCopyRotated (gdImagePtr dst,
                                                                                    gdImageAlpha (src,
                                                                                            c));
                                        }
-                                       gdImageSetPixel (dst, dx, dy, cmap[c]);
+                                       gdImageSetPixel (dst, (int)dx, (int)dy, cmap[c]);
                                } else {
                                        gdImageSetPixel (dst,
-                                                        dx, dy,
+                                                        (int)dx, (int)dy,
                                                         gdImageColorResolveAlpha (dst,
                                                                 gdImageRed (src,
                                                                             c),
@@ -3469,16 +3469,16 @@ BGD_DECLARE(void) gdImageCopyResampled (gdImagePtr dst,
                for (x = dstX; (x < dstX + dstW); x++) {
                        float sy1, sy2, sx1, sx2;
                        float sx, sy;
-                       float spixels = 0.0;
-                       float red = 0.0, green = 0.0, blue = 0.0, alpha = 0.0;
-                       float alpha_factor, alpha_sum = 0.0, contrib_sum = 0.0;
+                       float spixels = 0.0f;
+                       float red = 0.0f, green = 0.0f, blue = 0.0f, alpha = 0.0f;
+                       float alpha_factor, alpha_sum = 0.0f, contrib_sum = 0.0f;
                        sy1 = ((float)(y - dstY)) * (float)srcH / (float)dstH;
                        sy2 = ((float)(y + 1 - dstY)) * (float) srcH / (float) dstH;
                        sy = sy1;
                        do {
                                float yportion;
                                if (floorf(sy) == floorf(sy1)) {
-                                       yportion = 1.0 - (sy - floorf(sy));
+                                       yportion = 1.0f - (sy - floorf(sy));
                                        if (yportion > sy2 - sy1) {
                                                yportion = sy2 - sy1;
                                        }
@@ -3486,7 +3486,7 @@ BGD_DECLARE(void) gdImageCopyResampled (gdImagePtr dst,
                                } else if (sy == floorf(sy2)) {
                                        yportion = sy2 - floorf(sy2);
                                } else {
-                                       yportion = 1.0;
+                                       yportion = 1.0f;
                                }
                                sx1 = ((float)(x - dstX)) * (float) srcW / dstW;
                                sx2 = ((float)(x + 1 - dstX)) * (float) srcW / dstW;
@@ -3496,7 +3496,7 @@ BGD_DECLARE(void) gdImageCopyResampled (gdImagePtr dst,
                                        float pcontribution;
                                        int p;
                                        if (floorf(sx) == floorf(sx1)) {
-                                               xportion = 1.0 - (sx - floorf(sx));
+                                               xportion = 1.0f - (sx - floorf(sx));
                                                if (xportion > sx2 - sx1) {
                                                        xportion = sx2 - sx1;
                                                }
@@ -3504,7 +3504,7 @@ BGD_DECLARE(void) gdImageCopyResampled (gdImagePtr dst,
                                        } else if (sx == floorf(sx2)) {
                                                xportion = sx2 - floorf(sx2);
                                        } else {
-                                               xportion = 1.0;
+                                               xportion = 1.0f;
                                        }
                                        pcontribution = xportion * yportion;
                                        p = gdImageGetTrueColorPixel(src, (int) sx + srcX, (int) sy + srcY);
@@ -3517,14 +3517,14 @@ BGD_DECLARE(void) gdImageCopyResampled (gdImagePtr dst,
                                        alpha_sum += alpha_factor;
                                        contrib_sum += pcontribution;
                                        spixels += xportion * yportion;
-                                       sx += 1.0;
+                                       sx += 1.0f;
                                }
                                while (sx < sx2);
                                sy += 1.0f;
                        }
                        while (sy < sy2);
 
-                       if (spixels != 0.0) {
+                       if (spixels != 0.0f) {
                                red /= spixels;
                                green /= spixels;
                                blue /= spixels;
@@ -3539,14 +3539,14 @@ BGD_DECLARE(void) gdImageCopyResampled (gdImagePtr dst,
                                blue /= alpha_sum;
                        }
                        /* Clamping to allow for rounding errors above */
-                       if (red > 255.0) {
-                               red = 255.0;
+                       if (red > 255.0f) {
+                               red = 255.0f;
                        }
-                       if (green > 255.0) {
-                               green = 255.0;
+                       if (green > 255.0f) {
+                               green = 255.0f;
                        }
                        if (blue > 255.0f) {
-                               blue = 255.0;
+                               blue = 255.0f;
                        }
                        if (alpha > gdAlphaMax) {
                                alpha = gdAlphaMax;
@@ -4373,7 +4373,7 @@ static void gdImageAALine (gdImagePtr im, int x1, int y1, int x2, int y2, int co
                 * This isn't a problem as computed dy/dx values came from ints above. */
                ag = fabs(abs((int)dy) < abs((int)dx) ? cos(atan2(dy, dx)) : sin(atan2(dy, dx)));
                if (ag != 0) {
-                       wid = thick / ag;
+                       wid = (int)(thick / ag);
                } else {
                        wid = 1;
                }
index d6bbebd..67da1b7 100644 (file)
@@ -101,7 +101,7 @@ extern "C" {
    pixels are represented by integers, which
    must be 32 bits wide or more.
 
-   True colors are repsented as follows:
+   True colors are represented as follows:
    
    ARGB
        
@@ -268,7 +268,7 @@ enum gdPaletteQuantizationMethod {
  *  GD_GENERALIZED_CUBIC - Generalized cubic
  *  GD_HERMITE                  - Hermite
  *  GD_HAMMING                  - Hamming
- *  GD_HANNING                  - Hannig
+ *  GD_HANNING                  - Hanning
  *  GD_MITCHELL                         - Mitchell
  *  GD_NEAREST_NEIGHBOUR - Nearest neighbour interpolation
  *  GD_POWER                    - Power
@@ -333,7 +333,7 @@ typedef double (* interpolation_method )(double);
      <Accessor Macros>
 
    (Previous versions of this library encouraged directly manipulating
-   the contents ofthe struct but we are attempting to move away from
+   the contents of the struct but we are attempting to move away from
    this practice so the fields are no longer documented here.  If you
    need to poke at the internals of this struct, feel free to look at
    *gd.h*.)
@@ -1499,7 +1499,7 @@ BGD_DECLARE(void) gdImageFlipHorizontal(gdImagePtr im);
 BGD_DECLARE(void) gdImageFlipVertical(gdImagePtr im);
 BGD_DECLARE(void) gdImageFlipBoth(gdImagePtr im);
 
-#define GD_FLIP_HORINZONTAL 1
+#define GD_FLIP_HORIZONTAL 1
 #define GD_FLIP_VERTICAL 2
 #define GD_FLIP_BOTH 3
 
@@ -1572,7 +1572,7 @@ BGD_DECLARE(int) gdTransformAffineBoundingBox(gdRectPtr src, const double affine
  *
  * Constants:
  *   GD_CMP_IMAGE       - Actual image IS different
- *   GD_CMP_NUM_COLORS  - Number of colors in pallette differ
+ *   GD_CMP_NUM_COLORS  - Number of colors in palette differ
  *   GD_CMP_COLOR       - Image colors differ
  *   GD_CMP_SIZE_X      - Image width differs
  *   GD_CMP_SIZE_Y      - Image heights differ
index 2e7264b..c9d7f2e 100644 (file)
@@ -58,7 +58,7 @@ uchar_clamp(double clr, unsigned char max) {
                result = (clr < 0) ? 0 : max;
        }/* if */
 
-       return result;
+       return (unsigned char)result;
 }/* uchar_clamp*/
 
 
index b2e11a3..84b0f36 100644 (file)
@@ -253,7 +253,7 @@ ADraw;
  * image functions to be executed.
  *
  * \param[in] w                The width of the output image.
- * \param[in] h                The height of the ouput image.
+ * \param[in] h                The height of the output image.
  * \param[in] file             The file to which the image should be written.
  * \param[in] fontName         The name of the font to use for rendering.
  * \param[in] type             The output type to generate.
index 6f79ca4..1912fe1 100644 (file)
@@ -29,7 +29,7 @@
  * Preprocessor Macros
  ***************************************************************************/
 
-/* Define macro to supress unused parameter warnings */
+/* Define macro to suppress unused parameter warnings */
 #ifndef UNUSED
 # ifdef __GNUC__
 #  define UNUSED __attribute__((unused))
index 0f6052a..b28d653 100644 (file)
@@ -67,7 +67,7 @@ typedef struct GlobalOptionsTag
     /** Size of 'corner' added to note boxes. */
     unsigned int noteCorner;
 
-    /** Anguluar box slope in pixels. */
+    /** Angular box slope in pixels. */
     unsigned int aboxSlope;
 
     /** If TRUE, wrap arc text as well as box contents. */
@@ -662,7 +662,7 @@ static char *getLine(const char        *string,
  * \param  x           The x position at which the entity text should be centered.
  * \param  y           The y position where the text should be placed.
  * \param  entLabel    The label to render, which maybe \a NULL in which case
- *                       no ouput is produced.
+ *                       no output is produced.
  * \param  entUrl      The URL for rendering the label as a hyperlink.  This
  *                       maybe \a NULL if not required.
  * \param  entId       The text identifier for the arc.
@@ -704,7 +704,7 @@ static void entityText(Context          *ctx,
             /* Check if a URL is associated */
             if(entUrl)
             {
-                /* If no explict colour has been set, make URLS blue */
+                /* If no explicit colour has been set, make URLS blue */
                 ctx->drw.setPen(&ctx->drw, ADRAW_COL_BLUE);
 
                 /* Image map output */
@@ -1062,7 +1062,7 @@ static void arcBox(Context           *ctx,
  * \param arcIdUrl       The URL for rendering the test identifier as a hyperlink.
  *                        This maybe \a NULL if not required.
  * \param arcTextColour  Colour for the arc text, or NULL to use default.
- * \param arcTextColour  Colour for the arc text backgroun, or NULL to use default.
+ * \param arcTextColour  Colour for the arc text background, or NULL to use default.
  * \param arcType        The type of arc, used to control output semantics.
  */
 static void arcText(Context           *ctx,
@@ -1329,7 +1329,7 @@ static void arcLine(Context          *ctx,
 
             /* Get co-ordinates of the arc end-point */
             ADrawComputeArcPoint(sx, y - 1, ctx->opts.entitySpacing - 8,
-                                 ctx->opts.loopArcHeight, 180 - 45,
+                                 ctx->opts.loopArcHeight, 180.0f - 45.0f,
                                  &px, &py);
 
             /* Draw a cross */
@@ -1393,7 +1393,7 @@ static void arcLine(Context          *ctx,
 
             /* Get co-ordinates of the arc end-point */
             ADrawComputeArcPoint(sx, y - 1, ctx->opts.entitySpacing - 8,
-                                 ctx->opts.loopArcHeight, 45,
+                                 ctx->opts.loopArcHeight, 45.0f,
                                  &px, &py);
 
             /* Draw a cross */
@@ -1431,7 +1431,7 @@ static void arcLine(Context          *ctx,
  */
 static Boolean checkMsc(Msc m)
 {
-    /* Check all arc entites are known */
+    /* Check all arc entities are known */
     MscResetArcIterator(m);
     do
     {
@@ -1710,7 +1710,7 @@ int mscgen_generate(const char *inputFile,
         assert(startCol != -1);
         assert(endCol != -1 || isBroadcastArc(MscGetCurrentArcDest(m)));
 
-        /* Check for entity colouring if not set explicity on the arc */
+        /* Check for entity colouring if not set explicitly on the arc */
         if (arcTextColour == NULL)
         {
           arcTextColour = MscGetEntAttrib(m, startCol, MSC_ATTR_ARC_TEXT_COLOUR);
index 263431e..8d8198c 100644 (file)
@@ -119,7 +119,7 @@ static int getGdoPen(struct ADrawTag *ctx)
 
 
 /** Given a colour value, convert to a gd colour reference.
- * This searches the current pallette of colours for the passed colour and
+ * This searches the current palette of colours for the passed colour and
  * returns an existing reference if possible.  Otherwise a new colour reference
  * is allocated and returned.
  */
index 29d6aea..52f5e05 100644 (file)
@@ -41,7 +41,7 @@ static Boolean        lex_utf8 = FALSE;
 /* Local function prototypes */
 static void newline(const char *text, unsigned int n);
 static char *trimQstring(char *s);
-
+static const char *stateToString(int state);
 %}
 
 /* Not used, so prevent compiler warning */
@@ -49,7 +49,8 @@ static char *trimQstring(char *s);
 %option noinput
 %option noyywrap
 
-%x IN_COMMENT BODY
+%x IN_COMMENT
+%x BODY
 %%
 
 <INITIAL>{
@@ -141,7 +142,7 @@ NOTE|note                             yylval.arctype = MSC_ARC_NOTE;     return
 %%
 
 /* Handle a new line of input.
- *  This counts the line number and duplicates the string incase we need
+ *  This counts the line number and duplicates the string in case we need
  *  it for error reporting.  The line is then returned back for parsing
  *  without the newline characters prefixed.
  */
@@ -233,4 +234,5 @@ Boolean lex_getutf8(void)
     return lex_utf8;
 }
 
+#include "mscgen_lexer.l.h"
 /* END OF FILE */
index 0a17395..a18e261 100644 (file)
@@ -91,7 +91,7 @@ struct MscTag
  * Local Functions
  ***************************************************************************/
 
-/** Find come attrbute in an attribute list.
+/** Find come attribute in an attribute list.
  *
  * \param[in] attr  Head of the linked list to search.
  * \param[in] a     The attribute type to find.
index 2c75131..1299bf9 100644 (file)
@@ -205,7 +205,7 @@ Boolean      MscGetOptAsBoolean(struct MscTag *m, MscOptType type, Boolean *cons
  *
  * \param  m      The MSC to analyse.
  * \param  label  The label to find.
- * \retval -1     If the label was not found, otherwise the columnn index.
+ * \retval -1     If the label was not found, otherwise the column index.
  */
 int           MscGetEntityIndex(struct MscTag *m, const char *label);
 
@@ -217,7 +217,7 @@ int           MscGetEntityIndex(struct MscTag *m, const char *label);
  * @{
  */
 
-/** Reset the entity interator.
+/** Reset the entity iterator.
  * This moves the pointer to the current entity to the head of the list.
  */
 void          MscResetEntityIterator(Msc m);
@@ -249,7 +249,7 @@ const char   *MscGetEntAttrib(Msc m, unsigned int entIdx, MscAttribType a);
  * @{
  */
 
-/** Reset the arc interator.
+/** Reset the arc iterator.
  * This moves the pointer to the current arc to the head of the list.
  */
 void          MscResetArcIterator   (Msc m);
index 2126d44..5d448f8 100644 (file)
@@ -61,7 +61,7 @@ void Usage(void)
 "              to write output directly to stdout.\n"
 #ifdef USE_FREETYPE
 " -F <font>   Use specified font for PNG output.  This must be a font specifier\n"
-"              compatbile with fontconfig (see 'fc-list'), and overrides the\n"
+"              compatible with fontconfig (see 'fc-list'), and overrides the\n"
 "              MSCGEN_FONT environment variable if also set.\n"
 #endif
 " -p          Print parsed msc output (for parser debug).\n"
index 9614c47..4821164 100644 (file)
@@ -27,7 +27,7 @@
 #include "mscgen_utf8.h"\r
 \r
 /**************************************************************************\r
- * Manfest Constants\r
+ * Manifest Constants\r
  **************************************************************************/\r
 \r
 /**************************************************************************\r
@@ -95,7 +95,7 @@ Boolean Utf8Decode(const char *s, unsigned int *r, unsigned int *bytes)
             }\r
         }\r
 \r
-        /* Success if no NULL was encoutered */\r
+        /* Success if no NULL was encountered */\r
         return t == *bytes;\r
     }\r
 }\r
index e1f13d6..39d4f7a 100644 (file)
 #include "qgcache.h"
 #endif // QT_H
 
-#define USE_ASCII_STRING
-
-#ifndef USE_ASCII_STRING
-
-template<class type> class Q_EXPORT QCache : public QGCache
-{
-public:
-    QCache( const QCache<type> &c ) : QGCache(c) {}
-    QCache( int maxCost=100, int size=17, bool caseSensitive=TRUE )
-       : QGCache( maxCost, size, StringKey, caseSensitive, FALSE ) {}
-   ~QCache()                           { clear(); }
-    QCache<type> &operator=( const QCache<type> &c )
-                       { return (QCache<type>&)QGCache::operator=(c); }
-    int          maxCost()   const             { return QGCache::maxCost(); }
-    int          totalCost() const             { return QGCache::totalCost(); }
-    void  setMaxCost( int m )          { QGCache::setMaxCost(m); }
-    uint  count()     const            { return QGCache::count(); }
-    uint  size()      const            { return QGCache::size(); }
-    bool  isEmpty()   const            { return QGCache::count() == 0; }
-    void  clear()                      { QGCache::clear(); }
-    bool  insert( const QString &k, const type *d, int c=1, int p=0 )
-                       { return QGCache::insert_string(k,(Item)d,c,p);}
-    bool  remove( const QString &k )
-                       { return QGCache::remove_string(k); }
-    type *take( const QString &k )
-                       { return (type *)QGCache::take_string(k); }
-    type *find( const QString &k, bool ref=TRUE ) const
-                       { return (type *)QGCache::find_string(k,ref);}
-    type *operator[]( const QString &k ) const
-                       { return (type *)QGCache::find_string(k);}
-    void  statistics() const         { QGCache::statistics(); }
-    int   hits() const                { return QGCache::hits(); }
-    int   misses() const              { return QGCache::misses(); }
-private:
-    void  deleteItem( Item d )       { if ( del_item ) delete (type *)d; }
-};
-
-#else
-
-
 template<class type> class Q_EXPORT QCache : public QGCache
 {
 public:
@@ -116,9 +76,6 @@ private:
 };
 
 
-#endif
-
-
 
 template<class type> class Q_EXPORT QCacheIterator : public QGCacheIterator
 {
@@ -136,11 +93,7 @@ public:
     type *toLast()           { return (type *)QGCacheIterator::toLast(); }
     operator type *() const   { return (type *)QGCacheIterator::get(); }
     type *current()   const   { return (type *)QGCacheIterator::get(); }
-#ifndef USE_ASCII_STRING
-    QString currentKey() const{ return QGCacheIterator::getKeyString(); }
-#else
     const char *currentKey() const{ return QGCacheIterator::getKeyAscii(); }
-#endif
     type *operator()()       { return (type *)QGCacheIterator::operator()();}
     type *operator++()       { return (type *)QGCacheIterator::operator++(); }
     type *operator+=(uint j)  { return (type *)QGCacheIterator::operator+=(j);}
index 6a14d66..64417e3 100644 (file)
@@ -17,6 +17,7 @@
 #include "qgstring.h"
 
 #include <qstring.h>
+#include <limits.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <stdarg.h>
@@ -88,8 +89,9 @@ int QCString::find( const QCString &str, int index, bool cs ) const
 
 int QCString::find( const QRegExp &rx, int index ) const
 {
-  QString d = QString::fromLatin1( data() );
-  return d.find( rx, index );
+  if ( index < 0 )
+    index += length();
+  return rx.match( data(), index );
 }
 
 int QCString::findRev( char c, int index, bool cs) const
@@ -146,8 +148,16 @@ int QCString::findRev( const char *str, int index, bool cs) const
 
 int QCString::findRev( const QRegExp &rx, int index ) const
 {
-  QString d = QString::fromLatin1( data() );
-  return d.findRev( rx, index );
+  if ( index < 0 )                     // neg index ==> start from end
+    index += length();
+  if ( (uint)index > length() )                // bad index
+    return -1;
+  while( index >= 0 ) {
+    if ( rx.match( data(), index ) == index )
+      return index;
+    index--;
+  }
+  return -1;
 }
 
 int QCString::contains( char c, bool cs ) const
@@ -194,8 +204,26 @@ int QCString::contains( const char *str, bool cs ) const
 
 int QCString::contains( const QRegExp &rx ) const
 {
-  QString d = QString::fromLatin1( data() );
-  return d.contains( rx );
+  if ( isEmpty() )
+    return rx.match( data() ) < 0 ? 0 : 1;
+  int count = 0;
+  int index = -1;
+  int len = length();
+  while ( index < len-1 ) {                    // count overlapping matches
+    index = rx.match( data(), index+1 );
+    if ( index < 0 )
+      break;
+    count++;
+  }
+  return count;
+}
+
+bool QCString::startsWith( const char *s ) const
+{
+  const char *p = data();
+  if (p==0 || s==0) return s==0;
+  while (*p!=0 && *p==*s) p++,s++;
+  return *s==0;
 }
 
 bool QCString::stripPrefix(const char *prefix)
@@ -417,53 +445,204 @@ QCString &QCString::replace( uint index, uint len, const char *s)
 
 QCString &QCString::replace( const QRegExp &rx, const char *str )
 {
-  QString d = QString::fromLatin1( data() );
-  QString r = QString::fromLatin1( str );
-  d.replace( rx, r );
-  operator=( d.ascii() );
+  if ( isEmpty() )
+    return *this;
+  int index = 0;
+  int slen  = qstrlen(str);
+  int len;
+  while ( index < (int)length() ) {
+    index = rx.match( data(), index, &len, FALSE );
+    if ( index >= 0 ) {
+      replace( index, len, str );
+      index += slen;
+      if ( !len )
+        break; // Avoid infinite loop on 0-length matches, e.g. [a-z]*
+    }
+    else
+      break;
+  }
   return *this;
 }
 
-short QCString::toShort(bool *ok) const
+static bool ok_in_base( char c, int base )
 {
-  QString s(data());
-  return s.toShort(ok);
+    if ( base <= 10 )
+       return c>='0' && c<='9' && (c-'0') < base;
+    else
+       return (c>='0' && c<='9') ||
+               (c >= 'a' && c < char('a'+base-10)) ||
+               (c >= 'A' && c < char('A'+base-10));
 }
 
-ushort QCString::toUShort(bool *ok) const
+short QCString::toShort(bool *ok, int base) const
 {
-  QString s(data());
-  return s.toUShort(ok);
+  long v = toLong( ok, base );
+  if ( ok && *ok && (v < -32768 || v > 32767) ) {
+    *ok = FALSE;
+    v = 0;
+  }
+  return (short)v;
 }
 
-int QCString::toInt(bool *ok) const
+ushort QCString::toUShort(bool *ok,int base) const
 {
-  QString s(data());
-  return s.toInt(ok);
+  ulong v = toULong( ok, base );
+  if ( ok && *ok && (v > 65535) ) {
+    *ok = FALSE;
+    v = 0;
+  }
+  return (ushort)v;
 }
 
-uint QCString::toUInt(bool *ok) const
+int QCString::toInt(bool *ok, int base) const
 {
-  QString s(data());
-  return s.toUInt(ok);
+  return (int)toLong( ok, base );
 }
 
-long QCString::toLong(bool *ok) const
+uint QCString::toUInt(bool *ok,int base) const
 {
-  QString s(data());
-  return s.toLong(ok);
+  return (uint)toULong( ok, base );
 }
 
-ulong QCString::toULong(bool *ok) const
+
+long QCString::toLong(bool *ok,int base) const
 {
-  QString s(data());
-  return s.toULong(ok);
+  const char *p = data();
+  long val=0;
+  int l = length();
+  const long max_mult = INT_MAX / base;
+  bool is_ok = FALSE;
+  int neg = 0;
+  if ( !p )
+    goto bye;
+  while ( l && isspace(*p) )                   // skip leading space
+    l--,p++;
+  if ( l && *p == '-' ) {
+    l--;
+    p++;
+    neg = 1;
+  } else if ( *p == '+' ) {
+    l--;
+    p++;
+  }
+
+  // NOTE: toULong() code is similar
+  if ( !l || !ok_in_base(*p,base) )
+    goto bye;
+  while ( l && ok_in_base(*p,base) ) {
+    l--;
+    int dv;
+    if ( *p>='0' && *p<='9' ) {
+      dv = *p-'0';
+    } else {
+      if ( *p >= 'a' && *p <= 'z' )
+        dv = *p - 'a' + 10;
+      else
+        dv = *p - 'A' + 10;
+    }
+    if ( val > max_mult || (val == max_mult && dv > (INT_MAX%base)+neg) )
+      goto bye;
+    val = base*val + dv;
+    p++;
+  }
+  if ( neg )
+    val = -val;
+  while ( l && isspace(*p) )                   // skip trailing space
+    l--,p++;
+  if ( !l )
+    is_ok = TRUE;
+bye:
+  if ( ok )
+    *ok = is_ok;
+  return is_ok ? val : 0;
+}
+
+ulong QCString::toULong(bool *ok,int base) const
+{
+  const char *p = data();
+  ulong val=0;
+  int l = length();
+  const ulong max_mult = 429496729;            // UINT_MAX/10, rounded down
+  bool is_ok = FALSE;
+  if ( !p )
+    goto bye;
+  while ( l && isspace(*p) )                   // skip leading space
+    l--,p++;
+  if ( *p == '+' )
+    l--,p++;
+
+  // NOTE: toLong() code is similar
+  if ( !l || !ok_in_base(*p,base) )
+    goto bye;
+  while ( l && ok_in_base(*p,base) ) {
+    l--;
+    uint dv;
+    if ( *p>='0' && *p<='9' ) {
+      dv = *p-'0';
+    } else {
+      if ( *p >= 'a' && *p <= 'z' )
+        dv = *p - 'a' + 10;
+      else
+        dv = *p - 'A' + 10;
+    }
+    if ( val > max_mult || (val == max_mult && dv > (UINT_MAX%base)) )
+      goto bye;
+    val = base*val + dv;
+    p++;
+  }
+
+  while ( l && isspace(*p) )                   // skip trailing space
+    l--,p++;
+  if ( !l )
+    is_ok = TRUE;
+bye:
+  if ( ok )
+    *ok = is_ok;
+  return is_ok ? val : 0;
 }
 
-uint64 QCString::toUInt64(bool *ok) const
+uint64 QCString::toUInt64(bool *ok,int base) const
 {
-  QString s(data());
-  return s.toUInt64(ok);
+  const char *p = data();
+  uint64 val=0;
+  int l = length();
+  const uint64 max_mult = 1844674407370955161ULL;  // ULLONG_MAX/10, rounded down
+  bool is_ok = FALSE;
+  if ( !p )
+    goto bye;
+  while ( l && isspace(*p) )                      // skip leading space
+    l--,p++;
+  if ( *p == '+' )
+    l--,p++;
+
+  // NOTE: toULong() code is similar
+  if ( !l || !ok_in_base(*p,base) )
+    goto bye;
+  while ( l && ok_in_base(*p,base) ) {
+    l--;
+    uint dv;
+    if ( *p>='0' && *p<='9' ) {
+      dv = *p-'0';
+    } else {
+      if ( *p >= 'a' && *p <= 'z' )
+        dv = *p - 'a' + 10;
+      else
+        dv = *p - 'A' + 10;
+    }
+    if ( val > max_mult || (val == max_mult && dv > (ULLONG_MAX%base)) )
+      goto bye;
+    val = base*val + dv;
+    p++;
+  }
+
+  while ( l && isspace(*p) )                   // skip trailing space
+    l--,p++;
+  if ( !l )
+    is_ok = TRUE;
+bye:
+  if ( ok )
+    *ok = is_ok;
+  return is_ok ? val : 0;
 }
 
 QCString &QCString::setNum(short n)
index abf30b3..c2a5dc3 100644 (file)
@@ -282,19 +282,20 @@ public:
     QCString &remove( uint index, uint len );
     QCString &replace( uint index, uint len, const char *s);
     QCString &replace( const QRegExp &rx, const char *str );
-    short toShort( bool *ok=0 ) const;
-    ushort toUShort( bool *ok=0 ) const;
-    int        toInt( bool *ok=0 ) const;
-    uint toUInt( bool *ok=0 ) const;
-    long toLong( bool *ok=0 ) const;
-    ulong toULong( bool *ok=0 )        const;
-    uint64 toUInt64( bool *ok=0 ) const;
+    short toShort( bool *ok=0, int base=10 ) const;
+    ushort toUShort( bool *ok=0, int base=10 ) const;
+    int        toInt( bool *ok=0, int base=10 ) const;
+    uint toUInt( bool *ok=0, int base=10 ) const;
+    long toLong( bool *ok=0, int base=10 ) const;
+    ulong toULong( bool *ok=0, int base=10 )   const;
+    uint64 toUInt64( bool *ok=0, int base=10 ) const;
     QCString &setNum(short n);
     QCString &setNum(ushort n);
     QCString &setNum(int n);
     QCString &setNum(uint n);
     QCString &setNum(long n);
     QCString &setNum(ulong n);
+    bool startsWith( const char *s ) const;
 
     /** Converts the string to a plain C string */
     operator const char *() const
@@ -328,7 +329,7 @@ public:
       return m_rep.at(i);
     }
 
-    /** Indexing operator. Equavalent to at(). */
+    /** Indexing operator. Equivalent to at(). */
     char &operator[]( int i ) const
     {
       return m_rep.at((uint)i);
index 5725971..4bb231d 100644 (file)
@@ -157,11 +157,11 @@ QCStringList QCStringList::grep( const QRegExp &expr ) const
 QCString QCStringList::join( const QCString &sep ) const
 {
     QCString res;
-    bool alredy = FALSE;
+    bool already = FALSE;
     for ( QCStringList::ConstIterator it = begin(); it != end(); ++it ) {
-       if ( alredy )
+       if ( already )
            res += sep;
-       alredy = TRUE;
+       already = TRUE;
        res += *it;
     }
 
index 88569f8..8f1cab2 100644 (file)
@@ -279,7 +279,7 @@ int QDate::daysInYear() const
   \sa toString(), dayName()
 */
 
-QString QDate::monthName( int month ) const
+QCString QDate::monthName( int month ) const
 {
 #if defined(CHECK_RANGE)
     if ( month < 1 || month > 12 ) {
@@ -287,8 +287,7 @@ QString QDate::monthName( int month ) const
        month = 1;
     }
 #endif
-    // ### Remove the fromLatin1 during localization
-    return QString::fromLatin1(monthNames[month-1]);
+    return monthNames[month-1];
 }
 
 /*!
@@ -299,7 +298,7 @@ QString QDate::monthName( int month ) const
   \sa toString(), monthName()
 */
 
-QString QDate::dayName( int weekday ) const
+QCString QDate::dayName( int weekday ) const
 {
 #if defined(CHECK_RANGE)
     if ( weekday < 1 || weekday > 7 ) {
@@ -307,8 +306,7 @@ QString QDate::dayName( int weekday ) const
        weekday = 1;
     }
 #endif
-    // ### Remove the fromLatin1 during localization
-    return QString::fromLatin1(weekdayNames[weekday-1]);
+    return weekdayNames[weekday-1];
 }
 
 
@@ -321,14 +319,14 @@ QString QDate::dayName( int weekday ) const
   \sa dayName(), monthName()
 */
 
-QString QDate::toString() const
+QCString QDate::toString() const
 {
     int y, m, d;
     jul2greg( jd, y, m, d );
-    QString buf = dayName(dayOfWeek());
+    QCString buf = dayName(dayOfWeek());
     buf += ' ';
     buf += monthName(m);
-    QString t;
+    QCString t;
     t.sprintf( " %d %d", d, y);
     buf += t;
     return buf;
@@ -684,9 +682,9 @@ int QTime::msec() const
   before midnight would be "23:59:59".
 */
 
-QString QTime::toString() const
+QCString QTime::toString() const
 {
-    QString buf;
+    QCString buf;
     buf.sprintf( "%.2d:%.2d:%.2d", hour(), minute(), second() );
     return buf;
 }
@@ -1190,17 +1188,17 @@ void QDateTime::setTimeUtc_t( uint secsSince1Jan1970UTC )
 
 */
 
-QString QDateTime::toString() const
+QCString QDateTime::toString() const
 {
-    QString buf = d.dayName(d.dayOfWeek());
+    QCString buf = d.dayName(d.dayOfWeek());
     buf += ' ';
     buf += d.monthName(d.month());
     buf += ' ';
-    buf += QString().setNum(d.day());
+    buf += QCString().setNum(d.day());
     buf += ' ';
     buf += t.toString();
     buf += ' ';
-    buf += QString().setNum(d.year());
+    buf += QCString().setNum(d.year());
     return buf;
 }
 
index 010ae73..63007f3 100644 (file)
@@ -39,7 +39,7 @@
 #define QDATETIME_H
 
 #ifndef QT_H
-#include "qstring.h"
+#include "qcstring.h"
 #endif // QT_H
 
 
@@ -65,10 +65,10 @@ public:
     int           daysInMonth() const;                 // 28..31
     int           daysInYear()  const;                 // 365 or 366
 
-    virtual QString monthName( int month ) const;
-    virtual QString dayName( int weekday ) const;
+    virtual QCString monthName( int month ) const;
+    virtual QCString dayName( int weekday ) const;
 
-    QString toString()  const;
+    QCString toString()         const;
 
     bool   setYMD( int y, int m, int d );
 
@@ -119,7 +119,7 @@ public:
     int           second()      const;                 // 0..59
     int           msec()        const;                 // 0..999
 
-    QString toString()  const;
+    QCString toString()         const;
 
     bool   setHMS( int h, int m, int s, int ms=0 );
 
@@ -175,7 +175,7 @@ public:
     void   setTime_t( uint secsSince1Jan1970UTC );
     void   setTimeUtc_t( uint secsSince1Jan1970UTC );
 
-    QString toString() const;
+    QCString toString()        const;
 
     QDateTime addDays( int days )      const;
     QDateTime addSecs( int secs )      const;
index a414d3f..bf1ea01 100644 (file)
 
   Setting \e caseSensitive to TRUE will treat "abc" and "Abc" as different
   keys.  Setting it to FALSE will make the dictionary ignore case.
-  Case insensitive comparison includes the whole Unicode alphabeth.
+  Case insensitive comparison includes the whole Unicode alphabet.
 */
 
 /*!
index efc5bd0..12db365 100644 (file)
 #include "qgdict.h"
 #endif // QT_H
 
-#define USE_ASCII_STRING
-
-#ifdef USE_ASCII_STRING
-
 #define QAsciiDict QDict
 #define QAsciiDictIterator QDictIterator
 #include "qasciidict.h"
 
-#else
-
-template<class type> class Q_EXPORT QDict : private QGDict
-{
-public:
-    QDict(int size=17, bool caseSensitive=TRUE)
-       : QGDict(size,StringKey,caseSensitive,FALSE) {}
-    QDict( const QDict<type> &d ) : QGDict(d) {}
-   ~QDict()                            { clear(); }
-    QDict<type> &operator=(const QDict<type> &d)
-                       { return (QDict<type>&)QGDict::operator=(d); }
-
-    // capacity
-    uint  count()   const              { return QGDict::count(); }
-    uint  size()    const              { return QGDict::size(); }
-    bool  isEmpty() const              { return QGDict::count() == 0; }
-
-    // modifiers
-    void  insert( const QString &k, const type *d )
-                                       { QGDict::look_string(k,(Item)d,1); }
-    void  replace( const QString &k, const type *d )
-                                       { QGDict::look_string(k,(Item)d,2); }
-    bool  remove( const QString &k )   { return QGDict::remove_string(k); }
-    type *take( const QString &k )     { return (type *)QGDict::take_string(k); }
-    void  clear()                      { QGDict::clear(); }
-    void  resize( uint n )             { QGDict::resize(n); }
-
-    // search
-    type *find( const QString &k ) const
-               { return (type *)((QGDict*)this)->QGDict::look_string(k,0,0); }
-    type *operator[]( const QString &k ) const
-               { return (type *)((QGDict*)this)->QGDict::look_string(k,0,0); }
-
-    // operations
-    void  statistics() const           { QGDict::statistics(); }
-private:
-    void  deleteItem( Item d );
-
-    // new to be reimplemented methods
-    virtual int compareValues(const type *t1,const type *t2) const
-    { return const_cast<QDict<type>*>(this)->QGDict::compareItems((QCollection::Item)t1,(QCollection::Item)t2); }
-
-    // reimplemented methods
-    virtual int compareItems(QCollection::Item i1,QCollection::Item i2)
-    { return compareValues((const type*)i1,(const type*)i2); }
-};
-
-#if defined(Q_DELETING_VOID_UNDEFINED)
-template<> inline void QDict<void>::deleteItem( Item )
-{
-}
-#endif
-
-template<class type> inline void QDict<type>::deleteItem( QCollection::Item d )
-{
-    if ( del_item ) delete (type *)d;
-}
-
-
-template<class type> class Q_EXPORT QDictIterator : public QGDictIterator
-{
-public:
-    QDictIterator(const QDict<type> &d) :QGDictIterator((QGDict &)d) {}
-   ~QDictIterator()          {}
-    uint  count()   const     { return dict->count(); }
-    bool  isEmpty() const     { return dict->count() == 0; }
-    type *toFirst()          { return (type *)QGDictIterator::toFirst(); }
-    operator type *() const   { return (type *)QGDictIterator::get(); }
-    type   *current() const   { return (type *)QGDictIterator::get(); }
-    QString currentKey() const{ return QGDictIterator::getKeyString(); }
-    type *operator()()       { return (type *)QGDictIterator::operator()(); }
-    type *operator++()       { return (type *)QGDictIterator::operator++(); }
-    type *operator+=(uint j)  { return (type *)QGDictIterator::operator+=(j);}
-};
-
-#endif // USE_ASCII_STRING
-
 #endif // QDICT_H
index 03150fe..230823c 100644 (file)
@@ -190,21 +190,21 @@ public:
     QCDict( uint size, uint kt, bool caseSensitive, bool copyKeys )
        : QGDict( size, (KeyType)kt, caseSensitive, copyKeys ) {}
 
-    QCacheItem *find_string(const QString &key) const
+    QCacheItem *find_string(const QCString &key) const
        { return (QCacheItem*)((QCDict*)this)->look_string(key, 0, 0); }
     QCacheItem *find_ascii(const char *key) const
        { return (QCacheItem*)((QCDict*)this)->look_ascii(key, 0, 0); }
     QCacheItem *find_int(long key) const
        { return (QCacheItem*)((QCDict*)this)->look_int(key, 0, 0); }
 
-    QCacheItem *take_string(const QString &key)
+    QCacheItem *take_string(const QCString &key)
        { return (QCacheItem*)QGDict::take_string(key); }
     QCacheItem *take_ascii(const char *key)
        { return (QCacheItem*)QGDict::take_ascii(key); }
     QCacheItem *take_int(long key)
        { return (QCacheItem*)QGDict::take_int(key); }
 
-    bool  insert_string( const QString &key, const QCacheItem *ci )
+    bool  insert_string( const QCString &key, const QCacheItem *ci )
        { return QGDict::look_string(key,(Item)ci,1)!=0;}
     bool  insert_ascii( const char *key, const QCacheItem *ci )
        { return QGDict::look_ascii(key,(Item)ci,1)!=0;}
@@ -212,7 +212,7 @@ public:
        { return QGDict::look_int(key,(Item)ci,1)!=0;}
 
     bool  remove_string( QCacheItem *item )
-       { return QGDict::remove_string(*((QString*)(item->key)),item); }
+       { return QGDict::remove_string(*((QCString*)(item->key)),item); }
     bool  remove_ascii( QCacheItem *item )
        { return QGDict::remove_ascii((const char *)item->key,item); }
     bool  remove_int( QCacheItem *item )
@@ -345,7 +345,7 @@ void QGCache::setMaxCost( int maxCost )
   invalid.
 */
 
-bool QGCache::insert_string( const QString &key, QCollection::Item data,
+bool QGCache::insert_string( const QCString &key, QCollection::Item data,
                             int cost, int priority)
 {
     if ( tCost + cost > mCost ) {
@@ -365,7 +365,7 @@ bool QGCache::insert_string( const QString &key, QCollection::Item data,
        priority = -32768;
     else if ( priority > 32767 )
        priority = 32677;
-    QCacheItem *ci = new QCacheItem( new QString(key), newItem(data),
+    QCacheItem *ci = new QCacheItem( new QCString(key), newItem(data),
                                     cost, (short)priority );
     CHECK_PTR( ci );
     lruList->insert( 0, ci );
@@ -417,7 +417,7 @@ bool QGCache::insert_other( const char *key, QCollection::Item data,
   Removes an item from the cache.
 */
 
-bool QGCache::remove_string( const QString &key )
+bool QGCache::remove_string( const QCString &key )
 {
     Item d = take_string( key );
     if ( d )
@@ -442,7 +442,7 @@ bool QGCache::remove_other( const char *key )
   Takes an item out of the cache (no delete).
 */
 
-QCollection::Item QGCache::take_string( const QString &key )
+QCollection::Item QGCache::take_string( const QCString &key )
 {
     QCacheItem *ci = dict->take_string( key ); // take from dict
     Item d;
@@ -450,7 +450,7 @@ QCollection::Item QGCache::take_string( const QString &key )
        d = ci->data;
        tCost -= ci->cost;
        lruList->take( ci );                    // take from list
-       delete (QString*)ci->key;
+       delete (QCString*)ci->key;
        delete ci;
     } else {
        d = 0;
@@ -497,7 +497,7 @@ void QGCache::clear()
        switch ( keytype ) {
            case StringKey:
                dict->remove_string( ci );
-               delete (QString*)ci->key;
+               delete (QCString*)ci->key;
                break;
            case AsciiKey:
                dict->remove_ascii( ci );
@@ -522,7 +522,7 @@ void QGCache::clear()
   Finds an item in the cache.
 */
 
-QCollection::Item QGCache::find_string( const QString &key, bool ref ) const
+QCollection::Item QGCache::find_string( const QCString &key, bool ref ) const
 {
     QCacheItem *ci = dict->find_string( key );
 #if defined(DEBUG)
@@ -599,7 +599,7 @@ bool QGCache::makeRoomFor( int cost, int priority )
        switch ( keytype ) {
            case StringKey:
                dict->remove_string( ci );
-               delete (QString*)ci->key;
+               delete (QCString*)ci->key;
                break;
            case AsciiKey:
                dict->remove_ascii( ci );
@@ -628,9 +628,9 @@ bool QGCache::makeRoomFor( int cost, int priority )
 void QGCache::statistics() const
 {
 #if defined(DEBUG)
-    QString line;
+    QCString line;
     line.fill( '*', 80 );
-    qDebug( "%s",line.ascii() );
+    qDebug( "%s",line.data() );
     qDebug( "CACHE STATISTICS:" );
     qDebug( "cache contains %d item%s, with a total cost of %d",
           count(), count() != 1 ? "s" : "", tCost );
@@ -651,7 +651,7 @@ void QGCache::statistics() const
           lruList->dumps != 1 ? "have" : "has", lruList->dumpCosts );
     qDebug( "Statistics from internal dictionary class:" );
     dict->statistics();
-    qDebug( "%s",line.ascii() );
+    qDebug( "%s",line.data() );
 #endif
 }
 
@@ -794,10 +794,10 @@ QCollection::Item QGCacheIterator::get() const
   Returns the key of the current item.
 */
 
-QString QGCacheIterator::getKeyString() const
+QCString QGCacheIterator::getKeyString() const
 {
     QCacheItem *item = it->current();
-    return item ? *((QString*)item->key) : QString::null;
+    return item ? *((QCString*)item->key) : QCString();
 }
 
 /*!
index a71f6d3..5d8a243 100644 (file)
@@ -70,16 +70,16 @@ protected:
     void    setMaxCost( int maxCost );
     void    clear();
 
-    bool    insert_string( const QString &key, QCollection::Item,
+    bool    insert_string( const QCString &key, QCollection::Item,
                           int cost, int priority );
     bool    insert_other( const char *key, QCollection::Item,
                          int cost, int priority );
-    bool    remove_string( const QString &key );
+    bool    remove_string( const QCString &key );
     bool    remove_other( const char *key );
-    QCollection::Item take_string( const QString &key );
+    QCollection::Item take_string( const QCString &key );
     QCollection::Item take_other( const char *key );
 
-    QCollection::Item find_string( const QString &key, bool ref=TRUE ) const;
+    QCollection::Item find_string( const QCString &key, bool ref=TRUE ) const;
     QCollection::Item find_other( const char *key, bool ref=TRUE ) const;
 
     void    statistics() const;
@@ -112,7 +112,7 @@ protected:
     QCollection::Item toLast();
 
     QCollection::Item get() const;
-    QString          getKeyString() const;
+    QCString         getKeyString() const;
     const char       *getKeyAscii()  const;
     intptr_t         getKeyInt()    const;
 
index ab3fea9..a3db8de 100644 (file)
@@ -83,36 +83,9 @@ public:
   Returns the hash key for \e key, when key is a string.
 */
 
-int QGDict::hashKeyString( const QString &key )
+int QGDict::hashKeyString( const QCString &key )
 {
-#if defined(CHECK_NULL)
-    if ( key.isNull() ) 
-       qWarning( "QGDict::hashStringKey: Invalid null key" ); 
-#endif
-    int i;
-    uint h=0;
-    uint g;
-    int len = key.length();
-    const QChar *p = key.unicode();
-    if ( cases ) {                             // case sensitive
-       for ( i=0; i<len; i++ ) {
-           h = (h<<4) + p[i].cell();
-           if ( (g = h & 0xf0000000) )
-               h ^= g >> 24;
-           h &= ~g;
-       }
-    } else {                                   // case insensitive
-       for ( i=0; i<len; i++ ) {
-           h = (h<<4) + p[i].lower().cell();
-           if ( (g = h & 0xf0000000) )
-               h ^= g >> 24;
-           h &= ~g;
-       }
-    }
-    int index = h;
-    if ( index < 0 )                           // adjust index to table size
-       index = -index;
-    return index;
+    return hashKeyAscii(key.data());
 }
 
 /*!
@@ -337,7 +310,7 @@ QGDict &QGDict::operator=( const QGDict &dict )
 */
 
 
-/*! \fn QString QGDictIterator::getKeyString() const
+/*! \fn QCString QGDictIterator::getKeyString() const
 
   \internal
 */
@@ -379,21 +352,21 @@ QGDict &QGDict::operator=( const QGDict &dict )
   The do-it-all function; op is one of op_find, op_insert, op_replace
 */
 
-QCollection::Item QGDict::look_string( const QString &key, QCollection::Item d, int op )
+QCollection::Item QGDict::look_string( const QCString &key, QCollection::Item d, int op )
 {
-    QStringBucket *n;
+    QCStringBucket *n;
     int        index = hashKeyString(key) % vlen;
     if ( op == op_find ) {                     // find
        if ( cases ) {
-           for ( n=(QStringBucket*)vec[index]; n;
-                 n=(QStringBucket*)n->getNext() ) {
+           for ( n=(QCStringBucket*)vec[index]; n;
+                 n=(QCStringBucket*)n->getNext() ) {
                if ( key == n->getKey() )
                    return n->getData();        // item found
            }
        } else {
-           QString k = key.lower();
-           for ( n=(QStringBucket*)vec[index]; n;
-                 n=(QStringBucket*)n->getNext() ) {
+           QCString k = key.lower();
+           for ( n=(QCStringBucket*)vec[index]; n;
+                 n=(QCStringBucket*)n->getNext() ) {
                if ( k == n->getKey().lower() )
                    return n->getData();        // item found
            }
@@ -405,7 +378,7 @@ QCollection::Item QGDict::look_string( const QString &key, QCollection::Item d,
            remove_string( key );
     }
     // op_insert or op_replace
-    n = new QStringBucket(key,newItem(d),vec[index]);
+    n = new QCStringBucket(key,newItem(d),vec[index]);
     CHECK_PTR( n );
 #if defined(CHECK_NULL)
     if ( n->getData() == 0 )
@@ -542,10 +515,10 @@ void QGDict::resize( uint newsize )
        switch ( keytype ) {
            case StringKey:
                {
-                   QStringBucket *n=(QStringBucket *)old_vec[index];
+                   QCStringBucket *n=(QCStringBucket *)old_vec[index];
                    while ( n ) {
                        look_string( n->getKey(), n->getData(), op_insert );
-                       QStringBucket *t=(QStringBucket *)n->getNext();
+                       QCStringBucket *t=(QCStringBucket *)n->getNext();
                        delete n;
                        n = t;
                    }
@@ -624,16 +597,16 @@ void QGDict::unlink_common( int index, QBaseBucket *node, QBaseBucket *prev )
     numItems--;
 }
 
-QStringBucket *QGDict::unlink_string( const QString &key, QCollection::Item d )
+QCStringBucket *QGDict::unlink_string( const QCString &key, QCollection::Item d )
 {
     if ( numItems == 0 )                       // nothing in dictionary
        return 0;
-    QStringBucket *n;
-    QStringBucket *prev = 0;
+    QCStringBucket *n;
+    QCStringBucket *prev = 0;
     int index = hashKeyString(key) % vlen;
     if ( cases ) {
-       for ( n=(QStringBucket*)vec[index]; n;
-             n=(QStringBucket*)n->getNext() ) {
+       for ( n=(QCStringBucket*)vec[index]; n;
+             n=(QCStringBucket*)n->getNext() ) {
            bool found = (key == n->getKey());
            if ( found && d )
                found = (n->getData() == d);
@@ -644,9 +617,9 @@ QStringBucket *QGDict::unlink_string( const QString &key, QCollection::Item d )
            prev = n;
        }
     } else {
-       QString k = key.lower();
-       for ( n=(QStringBucket*)vec[index]; n;
-             n=(QStringBucket*)n->getNext() ) {
+       QCString k = key.lower();
+       for ( n=(QCStringBucket*)vec[index]; n;
+             n=(QCStringBucket*)n->getNext() ) {
            bool found = (k == n->getKey().lower());
            if ( found && d )
                found = (n->getData() == d);
@@ -729,9 +702,9 @@ QPtrBucket *QGDict::unlink_ptr( void *key, QCollection::Item d )
   item when several items have the same key).
 */
 
-bool QGDict::remove_string( const QString &key, QCollection::Item item )
+bool QGDict::remove_string( const QCString &key, QCollection::Item item )
 {
-    QStringBucket *n = unlink_string( key, item );
+    QCStringBucket *n = unlink_string( key, item );
     if ( n ) {
        deleteItem( n->getData() );
        delete n;
@@ -785,9 +758,9 @@ bool QGDict::remove_ptr( void *key, QCollection::Item item )
 
 /*!  \internal */
 
-QCollection::Item QGDict::take_string( const QString &key )
+QCollection::Item QGDict::take_string( const QCString &key )
 {
-    QStringBucket *n = unlink_string( key );
+    QCStringBucket *n = unlink_string( key );
     Item d;
     if ( n ) {
        d = n->getData();
@@ -864,9 +837,9 @@ void QGDict::clear()
            switch ( keytype ) {
                case StringKey:
                    {
-                       QStringBucket *n=(QStringBucket *)vec[j];
+                       QCStringBucket *n=(QCStringBucket *)vec[j];
                        while ( n ) {
-                           QStringBucket *next = (QStringBucket*)n->getNext();
+                           QCStringBucket *next = (QCStringBucket*)n->getNext();
                            deleteItem( n->getData() );
                            delete n;
                            n = next;
@@ -930,14 +903,14 @@ void QGDict::clear()
 void QGDict::statistics() const
 {
 #if defined(DEBUG)
-    QString line;
+    QCString line;
     line.fill( '-', 60 );
     double real, ideal;
-    qDebug( "%s",line.ascii() );
+    qDebug( "%s",line.data() );
     qDebug( "DICTIONARY STATISTICS:" );
     if ( count() == 0 ) {
        qDebug( "Empty!" );
-       qDebug( "%s", line.ascii() );
+       qDebug( "%s", line.data() );
        return;
     }
     real = 0.0;
@@ -966,7 +939,7 @@ void QGDict::statistics() const
     qDebug( "Real dist  = %g", real );
     qDebug( "Rand dist  = %g", ideal );
     qDebug( "Real/Rand  = %g", real/ideal );
-    qDebug( "%s",line.ascii() );
+    qDebug( "%s",line.data() );
 #endif // DEBUG
 }
 
@@ -1004,7 +977,7 @@ QDataStream &QGDict::read( QDataStream &s )
        switch ( keytype ) {
            case StringKey:
                {
-                   QString k;
+                   QCString k;
                    s >> k;
                    read( s, d );
                    look_string( k, d, op_insert );
@@ -1060,7 +1033,7 @@ QDataStream& QGDict::write( QDataStream &s ) const
        while ( n ) {                           // write all buckets
            switch ( keytype ) {
                case StringKey:
-                   s << ((QStringBucket*)n)->getKey();
+                   s << ((QCStringBucket*)n)->getKey();
                    break;
                case AsciiKey:
                    s << ((QAsciiBucket*)n)->getKey();
index a5c8aa0..cf023fd 100644 (file)
@@ -40,7 +40,7 @@
 
 #ifndef QT_H
 #include "qcollection.h"
-#include "qstring.h"
+#include "qcstring.h"
 #endif // QT_H
 
 class QGDictIterator;
@@ -60,14 +60,14 @@ protected:
     QBaseBucket                *next;
 };
 
-class QStringBucket : public QBaseBucket
+class QCStringBucket : public QBaseBucket
 {
 public:
-    QStringBucket( const QString &k, QCollection::Item d, QBaseBucket *n )
+    QCStringBucket( const QCString &k, QCollection::Item d, QBaseBucket *n )
        : QBaseBucket(d,n), key(k)              {}
-    const QString  &getKey() const             { return key; }
+    const QCString  &getKey() const            { return key; }
 private:
-    QString        key;
+    QCString       key;
 };
 
 class QAsciiBucket : public QBaseBucket
@@ -106,7 +106,7 @@ class Q_EXPORT QGDict : public QCollection  // generic dictionary class
 public:
     uint       count() const   { return numItems; }
     uint       size()  const   { return vlen; }
-    QCollection::Item look_string( const QString& key, QCollection::Item,
+    QCollection::Item look_string( const QCString& key, QCollection::Item,
                                   int );
     QCollection::Item look_ascii( const char *key, QCollection::Item, int );
     QCollection::Item look_int( long key, QCollection::Item, int );
@@ -124,11 +124,11 @@ protected:
 
     QGDict     &operator=( const QGDict & );
 
-    bool       remove_string( const QString &key, QCollection::Item item=0 );
+    bool       remove_string( const QCString &key, QCollection::Item item=0 );
     bool       remove_ascii( const char *key, QCollection::Item item=0 );
     bool       remove_int( long key, QCollection::Item item=0 );
     bool       remove_ptr( void *key, QCollection::Item item=0 );
-    QCollection::Item take_string( const QString &key );
+    QCollection::Item take_string( const QCString &key );
     QCollection::Item take_ascii( const char *key );
     QCollection::Item take_int( long key );
     QCollection::Item take_ptr( void *key );
@@ -136,7 +136,7 @@ protected:
     void       clear();
     void       resize( uint );
 
-    int                hashKeyString( const QString & );
+    int                hashKeyString( const QCString & );
     int                hashKeyAscii( const char * );
 
     void       statistics() const;
@@ -154,7 +154,7 @@ private:
     uint       copyk   : 1;
     QGDItList  *iterators;
     void          unlink_common( int, QBaseBucket *, QBaseBucket * );
-    QStringBucket *unlink_string( const QString &,
+    QCStringBucket *unlink_string( const QCString &,
                                  QCollection::Item item = 0 );
     QAsciiBucket  *unlink_ascii( const char *, QCollection::Item item = 0 );
     QIntBucket    *unlink_int( long, QCollection::Item item = 0 );
@@ -176,7 +176,7 @@ public:
     QCollection::Item toFirst();
 
     QCollection::Item get()         const;
-    QString          getKeyString() const;
+    QCString         getKeyString() const;
     const char      *getKeyAscii()  const;
     intptr_t         getKeyInt()    const;
     void            *getKeyPtr()    const;
@@ -198,9 +198,9 @@ inline QCollection::Item QGDictIterator::get() const
     return curNode ? curNode->getData() : 0;
 }
 
-inline QString QGDictIterator::getKeyString() const
+inline QCString QGDictIterator::getKeyString() const
 {
-    return curNode ? ((QStringBucket*)curNode)->getKey() : QString::null;
+    return curNode ? ((QCStringBucket*)curNode)->getKey() : QCString();
 }
 
 inline const char *QGDictIterator::getKeyAscii() const
index 50f5202..444cb3b 100644 (file)
@@ -73,7 +73,7 @@ static bool si_bigEndian;
   or to FALSE if this is a little-endian machine.
 
   This function calls qFatal() with a message if the computer is truly weird
-  (i.e. different endianness for 16 bit and 32 bit integers).
+  (i.e. different endianess for 16 bit and 32 bit integers).
 */
 
 bool qSysInfo( int *wordSize, bool *bigEndian )
index 8512f41..d37bdf2 100644 (file)
 //
 
 
-// Should be sorted most-authorative to least-authorative
+// Should be sorted most-authoritative to least-authoritative
 
 #if defined(__SC__)
 #define _CC_SYM_
@@ -400,7 +400,7 @@ inline int qRound( double d )
 
 
 //
-// Size-dependent types (architechture-dependent byte order)
+// Size-dependent types (architecture-dependent byte order)
 //
 
 // QT_CLEAN_NAMESPACE is not defined by default; it would break too
index 59cc971..4f97e35 100644 (file)
 
 /*!
   \fn type *QListIterator::operator*()
-  Asterix operator. Returns a pointer to the current iterator item.
+  Asterisk operator. Returns a pointer to the current iterator item.
   Same as current().
 */
 
index 0e2b14a..3d57839 100644 (file)
@@ -11538,7 +11538,7 @@ static inline bool format(QChar::Decomposition tag, QString & str,
   Applies possible ligatures to a QString, useful when composition-rich
   text requires rendering with glyph-poor fonts, but also
   makes compositions such as QChar(0x0041) ('A') and QChar(0x0308)
-  (Unicode accent diaresis) giving QChar(0x00c4) (German A Umlaut).
+  (Unicode accent diaeresis) giving QChar(0x00c4) (German A Umlaut).
 */
 void QString::compose()
 {
@@ -15300,7 +15300,7 @@ const void* qt_winTchar(const QString& str_in, bool addnul)
     if ( addnul )
        buf[str.length()] = 0;
 #else
-    // Same endianness of TCHAR
+    // Same endianess of TCHAR
     if ( addnul ) {
        EXTEND
        memcpy(buf,uc,sizeof(TCHAR)*str.length());
@@ -15344,7 +15344,7 @@ QString qt_winQString(void* tc)
        r += QChar(((TCHAR*)tc)[i]&0xff,((TCHAR*)tc)[i]>>8);
     return r;
 #else
-    // Same endianness of TCHAR
+    // Same endianess of TCHAR
     return QString((QChar*)tc,len);
 #endif
 #undef EXTEND
index 7696340..aa7ac16 100644 (file)
@@ -269,11 +269,11 @@ QStringList QStringList::grep( const QRegExp &expr ) const
 QString QStringList::join( const QString &sep ) const
 {
     QString res;
-    bool alredy = FALSE;
+    bool already = FALSE;
     for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) {
-       if ( alredy )
+       if ( already )
            res += sep;
-       alredy = TRUE;
+       already = TRUE;
        res += *it;
     }
 
index 842a72d..8ce266d 100644 (file)
@@ -280,7 +280,7 @@ int QTextCodec::heuristicNameMatch(const char* hint) const
 }
 
 
-// returns a string cotnaining the letters and numbers from input,
+// returns a string containing the letters and numbers from input,
 // with a space separating run of a character class.  e.g. "iso8859-1"
 // becomes "iso 8859 1"
 static QString lettersAndNumbers( const char * input )
index e83b177..8ce89bd 100644 (file)
@@ -38,7 +38,7 @@
 
 \title Qt Template library
 
-Thq Qt Template Library is a set of templates within Qt dealing with
+The Qt Template Library is a set of templates within Qt dealing with
 containers of objects.  It provides a list of objects, a stack of
 objects, a map (or dictionary) from one type to another, and
 associated iterators and algorithms.
index f7a0dde..9f34c8e 100644 (file)
 
 /*!
   \fn T& QValueListIterator::operator*()
-  Asterix operator. Returns a reference to the current iterator item.
+  Asterisk operator. Returns a reference to the current iterator item.
 */
 
 /*!
   \fn const T& QValueListIterator::operator*() const
-  Asterix operator. Returns a reference to the current iterator item.
+  Asterisk operator. Returns a reference to the current iterator item.
 */
 
 /*!
 
 /*!
   \fn const T& QValueListConstIterator::operator*() const
-  Asterix operator. Returns a reference to the current iterator item.
+  Asterisk operator. Returns a reference to the current iterator item.
 */
 
 /*!
index 4138a28..b7a68fc 100644 (file)
@@ -778,7 +778,7 @@ void QXmlInputSource::setData( const QString& dat )
 }
 
 /*!
-  Read the XML file from the byte array; try to recoginize the encoding.
+  Read the XML file from the byte array; try to recognize the encoding.
 */
 // ### The input source should not do the encoding detection!
 void QXmlInputSource::readInput( QByteArray& rawData )
@@ -1895,7 +1895,7 @@ private:
   <a href="xml-sax.html#quickStart">Quick start</a>.
 */
 
-//guaranteed not to be a characater
+//guaranteed not to be a character
 const QChar QXmlSimpleReader::QEOF = QChar((ushort)0xffff);
 
 /*!
@@ -2609,7 +2609,7 @@ bool QXmlSimpleReader::parseElementAttribute( QString &prefix, QString &uri, QSt
                }
            }
        } else {
-           // no namespace delcaration
+           // no namespace declaration
            d->namespaceSupport.processName( name(), TRUE, uri, lname );
            d->attList.qnameList.append( name() );
            d->attList.uriList.append( uri );
@@ -3036,7 +3036,7 @@ parseError:
   Precondition: the beginning '<' of the PI is already read and the head stand
   on the '?' of '<?'.
 
-  If this funktion was successful, the head-position is on the first
+  If this function was successful, the head-position is on the first
   character after the PI.
 */
 bool QXmlSimpleReader::parsePI( bool xmldecl )
@@ -3258,7 +3258,7 @@ parseError:
   Precondition: the beginning '<!' of the doctype is already read the head
   stands on the 'D' of '<!DOCTYPE'.
 
-  If this funktion was successful, the head-position is on the first
+  If this function was successful, the head-position is on the first
   character after the document type definition.
 */
 bool QXmlSimpleReader::parseDoctype()
@@ -3915,7 +3915,7 @@ bool QXmlSimpleReader::parseAttlistDecl()
        { -1,      Done,    Attdef,  Attdef,   Attdef,  Attdef,  Attdef,  Attdef  }, // Ws1
        { Ws2,     -1,      -1,      -1,       -1,      -1,      -1,      -1      }, // Attdef
        { -1,      Atttype, Atttype, Atttype,  Atttype, Atttype, Atttype, Atttype }, // Ws2
-       { Ws3,     -1,      -1,      -1,       -1,      -1,      -1,      -1      }, // Attype
+       { Ws3,     -1,      -1,      -1,       -1,      -1,      -1,      -1      }, // Atttype
        { -1,      Attval,  DDecH,   Attval,   Attval,  Attval,  Attval,  Attval  }, // Ws3
        { -1,      -1,      -1,      -1,       DefImp,  DefFix,  DefReq,  -1      }, // DDecH
        { Ws4,     Ws4,     -1,      -1,       -1,      -1,      -1,      -1      }, // DefReq
@@ -5175,11 +5175,11 @@ bool QXmlSimpleReader::parseEntityValue()
     const signed char Init             = 0;
     const signed char Dq               = 1; // EntityValue is double quoted
     const signed char DqC              = 2; // signed character
-    const signed char DqPER            = 3; // PERefence
+    const signed char DqPER            = 3; // PEReference
     const signed char DqRef            = 4; // Reference
     const signed char Sq               = 5; // EntityValue is double quoted
     const signed char SqC              = 6; // signed character
-    const signed char SqPER            = 7; // PERefence
+    const signed char SqPER            = 7; // PEReference
     const signed char SqRef            = 8; // Reference
     const signed char Done             = 9;
 
@@ -5291,7 +5291,7 @@ parseError:
   Precondition: the beginning '<!' of the comment is already read and the head
   stands on the first '-' of '<!--'.
 
-  If this funktion was successful, the head-position is on the first
+  If this function was successful, the head-position is on the first
   character after the comment.
 */
 bool QXmlSimpleReader::parseComment()
index 7233052..23460d0 100644 (file)
@@ -100,25 +100,39 @@ add_custom_command(
 )
 set_source_files_properties(${GENERATED_SRC}/layout_default.xml.h PROPERTIES GENERATED 1)
 
-# Targets for flex/bison   generated files
-FLEX_TARGET(scanner        scanner.l        ${GENERATED_SRC}/scanner.cpp        COMPILE_FLAGS "${LEX_FLAGS}")
-FLEX_TARGET(code           code.l           ${GENERATED_SRC}/code.cpp           COMPILE_FLAGS "${LEX_FLAGS}")
-FLEX_TARGET(pyscanner      pyscanner.l      ${GENERATED_SRC}/pyscanner.cpp      COMPILE_FLAGS "${LEX_FLAGS}")
-FLEX_TARGET(pycode         pycode.l         ${GENERATED_SRC}/pycode.cpp         COMPILE_FLAGS "${LEX_FLAGS}")
-FLEX_TARGET(fortranscanner fortranscanner.l ${GENERATED_SRC}/fortranscanner.cpp COMPILE_FLAGS "${LEX_FLAGS}")
-FLEX_TARGET(fortrancode    fortrancode.l    ${GENERATED_SRC}/fortrancode.cpp    COMPILE_FLAGS "${LEX_FLAGS}")
-FLEX_TARGET(vhdlcode       vhdlcode.l       ${GENERATED_SRC}/vhdlcode.cpp       COMPILE_FLAGS "${LEX_FLAGS}")
-FLEX_TARGET(tclscanner     tclscanner.l     ${GENERATED_SRC}/tclscanner.cpp     COMPILE_FLAGS "${LEX_FLAGS}")
-FLEX_TARGET(pre            pre.l            ${GENERATED_SRC}/pre.cpp            COMPILE_FLAGS "${LEX_FLAGS}")
-FLEX_TARGET(declinfo       declinfo.l       ${GENERATED_SRC}/declinfo.cpp       COMPILE_FLAGS "${LEX_FLAGS}")
-FLEX_TARGET(defargs        defargs.l        ${GENERATED_SRC}/defargs.cpp        COMPILE_FLAGS "${LEX_FLAGS}")
-FLEX_TARGET(doctokenizer   doctokenizer.l   ${GENERATED_SRC}/doctokenizer.cpp   COMPILE_FLAGS "${LEX_FLAGS}")
-FLEX_TARGET(commentcnv     commentcnv.l     ${GENERATED_SRC}/commentcnv.cpp     COMPILE_FLAGS "${LEX_FLAGS}")
-FLEX_TARGET(commentscan    commentscan.l    ${GENERATED_SRC}/commentscan.cpp    COMPILE_FLAGS "${LEX_FLAGS}")
-FLEX_TARGET(constexp       constexp.l       ${GENERATED_SRC}/constexp.cpp       COMPILE_FLAGS "${LEX_FLAGS}")
-FLEX_TARGET(xmlcode        xmlcode.l        ${GENERATED_SRC}/xmlcode.cpp        COMPILE_FLAGS "${LEX_FLAGS}")
-FLEX_TARGET(sqlcode        sqlcode.l        ${GENERATED_SRC}/sqlcode.cpp        COMPILE_FLAGS "${LEX_FLAGS}")
-FLEX_TARGET(configimpl     configimpl.l     ${GENERATED_SRC}/configimpl.cpp     COMPILE_FLAGS "${LEX_FLAGS}")
+set(LEX_FILES scanner 
+    code
+    pyscanner
+    pycode
+    fortranscanner
+    fortrancode
+    vhdlcode
+    tclscanner
+    pre
+    declinfo
+    defargs
+    doctokenizer
+    commentcnv
+    commentscan
+    constexp
+    xmlcode
+    sqlcode
+    configimpl)
+
+# unfortunately ${LEX_FILES_H} and ${LEX_FILES_CPP} don't work in older versions of CMake (like 3.6.2) for add_library
+foreach(lex_file ${LEX_FILES})
+    set(LEX_FILES_H ${LEX_FILES_H} " " ${GENERATED_SRC}/${lex_file}.l.h CACHE INTERNAL "Stores generated files")
+    set(LEX_FILES_CPP ${LEX_FILES_CPP} " " ${GENERATED_SRC}/${lex_file}.cpp CACHE INTERNAL "Stores generated files")
+    add_custom_command(
+        COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/scan_states.py ${CMAKE_SOURCE_DIR}/src/${lex_file}.l > ${GENERATED_SRC}/${lex_file}.l.h
+        DEPENDS ${CMAKE_SOURCE_DIR}/src/scan_states.py ${CMAKE_SOURCE_DIR}/src/${lex_file}.l
+        OUTPUT  ${GENERATED_SRC}/${lex_file}.l.h
+    )
+    set_source_files_properties(${GENERATED_SRC}/${lex_file}.l.h PROPERTIES GENERATED 1)
+
+    FLEX_TARGET(${lex_file}        ${lex_file}.l        ${GENERATED_SRC}/${lex_file}.cpp        COMPILE_FLAGS "${LEX_FLAGS}")
+endforeach()
+
 
 BISON_TARGET(constexp      constexp.y       ${GENERATED_SRC}/ce_parse.cpp       COMPILE_FLAGS "${YACC_FLAGS}")
 
@@ -126,6 +140,7 @@ add_library(doxycfg STATIC
     ${GENERATED_SRC}/lang_cfg.h
     ${GENERATED_SRC}/configvalues.h
     ${GENERATED_SRC}/configimpl.cpp
+    ${GENERATED_SRC}/configimpl.l.h
     ${GENERATED_SRC}/configoptions.cpp
     ${GENERATED_SRC}/configvalues.cpp
     portable.cpp
@@ -140,32 +155,51 @@ add_library(_doxygen STATIC
     ${GENERATED_SRC}/ce_parse.h
     ${GENERATED_SRC}/configvalues.h
     ${GENERATED_SRC}/resources.cpp
-    # generated by flex/bison
-    ${GENERATED_SRC}/scanner.cpp
+    # generated for/by flex/bison
+    #${LEX_FILES_H} #unfortunately doesn't work in older versions of CMake (like 3.6.2)
+    #${LEX_FILES_CPP} #unfortunately doesn't work in older versions of CMake (like 3.6.2)
+    ${GENERATED_SRC}/code.l.h
+    ${GENERATED_SRC}/commentcnv.l.h
+    ${GENERATED_SRC}/commentscan.l.h
+    ${GENERATED_SRC}/configimpl.l.h
+    ${GENERATED_SRC}/constexp.l.h
+    ${GENERATED_SRC}/declinfo.l.h
+    ${GENERATED_SRC}/defargs.l.h
+    ${GENERATED_SRC}/doctokenizer.l.h
+    ${GENERATED_SRC}/fortrancode.l.h
+    ${GENERATED_SRC}/fortranscanner.l.h
+    ${GENERATED_SRC}/pre.l.h
+    ${GENERATED_SRC}/pycode.l.h
+    ${GENERATED_SRC}/pyscanner.l.h
+    ${GENERATED_SRC}/scanner.l.h
+    ${GENERATED_SRC}/sqlcode.l.h
+    ${GENERATED_SRC}/tclscanner.l.h
+    ${GENERATED_SRC}/vhdlcode.l.h
+    ${GENERATED_SRC}/xmlcode.l.h
     ${GENERATED_SRC}/code.cpp
-    ${GENERATED_SRC}/pyscanner.cpp
-    ${GENERATED_SRC}/pycode.cpp
-    ${GENERATED_SRC}/fortranscanner.cpp
-    ${GENERATED_SRC}/fortrancode.cpp
-    ${GENERATED_SRC}/vhdlcode.cpp
-    ${GENERATED_SRC}/tclscanner.cpp
-    ${GENERATED_SRC}/pre.cpp
-    ${GENERATED_SRC}/declinfo.cpp
-    ${GENERATED_SRC}/defargs.cpp
-    ${GENERATED_SRC}/doctokenizer.cpp
     ${GENERATED_SRC}/commentcnv.cpp
     ${GENERATED_SRC}/commentscan.cpp
+    ${GENERATED_SRC}/configimpl.cpp
     ${GENERATED_SRC}/constexp.cpp
-    ${GENERATED_SRC}/xmlcode.cpp
+    ${GENERATED_SRC}/declinfo.cpp
+    ${GENERATED_SRC}/defargs.cpp
+    ${GENERATED_SRC}/doctokenizer.cpp
+    ${GENERATED_SRC}/fortrancode.cpp
+    ${GENERATED_SRC}/fortranscanner.cpp
+    ${GENERATED_SRC}/pre.cpp
+    ${GENERATED_SRC}/pycode.cpp
+    ${GENERATED_SRC}/pyscanner.cpp
+    ${GENERATED_SRC}/scanner.cpp
     ${GENERATED_SRC}/sqlcode.cpp
+    ${GENERATED_SRC}/tclscanner.cpp
+    ${GENERATED_SRC}/vhdlcode.cpp
+    ${GENERATED_SRC}/xmlcode.cpp
     #
     ${GENERATED_SRC}/ce_parse.cpp
     #
-    plantuml.cpp
     arguments.cpp
     cite.cpp
     clangparser.cpp
-    fileparser.cpp
     classdef.cpp
     classlist.cpp
     cmdmapper.cpp
@@ -176,27 +210,33 @@ add_library(_doxygen STATIC
     defgen.cpp
     define.cpp
     definition.cpp
+    dia.cpp
     diagram.cpp
     dirdef.cpp
+    docbookgen.cpp
+    docbookvisitor.cpp
+    docgroup.cpp
     docparser.cpp
     docsets.cpp
     dot.cpp
-       dotcallgraph.cpp
-       dotclassgraph.cpp
-       dotdirdeps.cpp
-       dotfilepatcher.cpp
+    dotcallgraph.cpp
+    dotclassgraph.cpp
+    dotdirdeps.cpp
+    dotfilepatcher.cpp
     dotgfxhierarchytable.cpp
     dotgraph.cpp
-       dotgroupcollaboration.cpp
-       dotincldepgraph.cpp
+    dotgroupcollaboration.cpp
+    dotincldepgraph.cpp
+    dotlegendgraph.cpp
     dotnode.cpp
-       dotrunner.cpp
+    dotrunner.cpp
     doxygen.cpp
     eclipsehelp.cpp
     emoji.cpp
     entry.cpp
     filedef.cpp
     filename.cpp
+    fileparser.cpp
     formula.cpp
     ftextstream.cpp
     ftvhelp.cpp
@@ -204,7 +244,6 @@ add_library(_doxygen STATIC
     htags.cpp
     htmldocvisitor.cpp
     htmlentity.cpp
-    resourcemgr.cpp
     htmlgen.cpp
     htmlhelp.cpp
     image.cpp
@@ -215,7 +254,6 @@ add_library(_doxygen STATIC
     layout.cpp
     mandocvisitor.cpp
     mangen.cpp
-    sqlite3gen.cpp
     markdown.cpp
     memberdef.cpp
     membergroup.cpp
@@ -223,20 +261,23 @@ add_library(_doxygen STATIC
     membername.cpp
     message.cpp
     msc.cpp
-    dia.cpp
     namespacedef.cpp
     objcache.cpp
     outputgen.cpp
     outputlist.cpp
     pagedef.cpp
     perlmodgen.cpp
+    plantuml.cpp
     qhp.cpp
     qhpxmlwriter.cpp
     reflist.cpp
+    resourcemgr.cpp
     rtfdocvisitor.cpp
     rtfgen.cpp
     rtfstyle.cpp
     searchindex.cpp
+    sqlite3gen.cpp
+    stlsupport.cpp
     tagreader.cpp
     template.cpp
     textdocvisitor.cpp
@@ -246,11 +287,12 @@ add_library(_doxygen STATIC
     vhdljjparser.cpp
     xmldocvisitor.cpp
     xmlgen.cpp
-    docbookvisitor.cpp
-    docbookgen.cpp
-    docgroup.cpp
 )
 
+##foreach(lex_file ${LEX_FILES})
+##add_library(_doxygen STATIC ${GENERATED_SRC}/${lex_file}.l.h)
+##endforeach()
+
 add_executable(doxygen main.cpp)
 
 if (use_libclang)
index 6d3e13b..69636f5 100644 (file)
@@ -1,39 +1,25 @@
+/*****************************************************************************
+ * Copyright (C) 1997-2019 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby 
+ * granted. No representations are made about the suitability of this software 
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ * Documents produced by Doxygen are derivative works derived from the
+ * input used in their production; they are not affected by this license.
+ */
+
+#include <algorithm>
+
 #include "arguments.h"
-#include <assert.h>
 
 /*! the argument list is documented if one of its
- *  arguments is documented 
+ *  arguments is documented
  */
 bool ArgumentList::hasDocumentation() const
 {
-  bool hasDocs=FALSE;
-  ArgumentListIterator ali(*this);
-  Argument *a;
-  for (ali.toFirst();!hasDocs && (a=ali.current());++ali)
-  {
-    hasDocs = a->hasDocumentation(); 
-  }
-  return hasDocs;
-}
-
-ArgumentList *ArgumentList::deepCopy() const
-{
-  ArgumentList *argList = new ArgumentList;
-  argList->setAutoDelete(TRUE);
-
-  QListIterator<Argument> ali(*this);
-  Argument *a;
-  for (;(a=ali.current());++ali)
-  {
-    argList->append(new Argument(*a));
-  }
-  argList->constSpecifier     = constSpecifier;
-  argList->volatileSpecifier  = volatileSpecifier;
-  argList->pureSpecifier      = pureSpecifier;
-  argList->trailingReturnType = trailingReturnType;
-  argList->isDeleted          = isDeleted;
-  argList->refQualifier       = refQualifier;
-
-  return argList;
+  return std::any_of(begin(),end(),[](const Argument &a){ return a.hasDocumentation(); });
 }
 
index 7ef9642..3464def 100644 (file)
 #ifndef ARGUMENTS_H
 #define ARGUMENTS_H
 
-#include <qlist.h>
+#include <vector>
 #include <qcstring.h>
 
-class StorageIntf;
-
 /*! \brief This class contains the information about the argument of a
  *         function or template
  *
  */
 struct Argument
 {
-  /*! Construct a new argument. */
-  Argument() {}
-  /*! Copy an argument (does a deep copy of all strings). */
-  Argument(const Argument &a)
-  {
-    attrib=a.attrib;
-    type=a.type;
-    name=a.name;
-    array=a.array;
-    defval=a.defval;
-    docs=a.docs;
-    typeConstraint=a.typeConstraint;
-  }
-  /*! Assignment of an argument (does a deep copy of all strings). */
-  Argument &operator=(const Argument &a)
-  {
-    if (this!=&a)
-    {
-      attrib=a.attrib;
-      type=a.type;
-      name=a.name;
-      array=a.array;
-      defval=a.defval;
-      docs=a.docs;
-      typeConstraint=a.typeConstraint;
-    }
-    return *this;
-  }
   /*! return TRUE if this argument is documentation and the argument has a
    *  non empty name.
    */
@@ -86,37 +56,42 @@ enum RefQualifierType
  *  put after the argument list, such as whether the member is const, 
  *  volatile or pure virtual.
  */
-class ArgumentList : public QList<Argument> 
+class ArgumentList : public std::vector<Argument>
 {
   public:
-    /*! Creates an empty argument list */
-    ArgumentList() : QList<Argument>(), 
-                     constSpecifier(FALSE),
-                     volatileSpecifier(FALSE),
-                     pureSpecifier(FALSE),
-                     isDeleted(FALSE),
-                     refQualifier(RefQualifierNone)
-                     { setAutoDelete(TRUE); }
-    /*! Destroys the argument list */
-   ~ArgumentList() {}
-    /*! Makes a deep copy of this object */
-    ArgumentList *deepCopy() const;
     /*! Does any argument of this list have documentation? */
     bool hasDocumentation() const;
-    /*! Does the member modify the state of the class? default: FALSE. */
-    bool constSpecifier;
-    /*! Is the member volatile? default: FALSE. */
-    bool volatileSpecifier;
-    /*! Is this a pure virtual member? default: FALSE */
-    bool pureSpecifier;
+    /*! Does this list have zero or more parameters */
+    bool hasParameters() const
+    {
+      return !empty() || noParameters;
+    }
+    void reset()
+    {
+      clear();
+      constSpecifier = FALSE;
+      volatileSpecifier = FALSE;
+      pureSpecifier = FALSE;
+      trailingReturnType.resize(0);
+      isDeleted = FALSE;
+      refQualifier = RefQualifierNone;
+      noParameters = FALSE;
+    }
+
+    /*! Does the member modify the state of the class? */
+    bool constSpecifier = FALSE;
+    /*! Is the member volatile? */
+    bool volatileSpecifier = FALSE;
+    /*! Is this a pure virtual member? */
+    bool pureSpecifier = FALSE;
     /*! C++11 style Trailing return type? */
     QCString trailingReturnType;
     /*! method with =delete */
-    bool isDeleted;
+    bool isDeleted = FALSE;
     /*! C++11 ref qualifier */
-    RefQualifierType refQualifier;
+    RefQualifierType refQualifier = RefQualifierNone;
+    /*! is it an explicit empty list */
+    bool noParameters = FALSE;
 };
 
-typedef QListIterator<Argument> ArgumentListIterator;
-
 #endif
index fd7b0e4..797881f 100644 (file)
@@ -79,7 +79,7 @@ void CiteDict::writeLatexBibliography(FTextStream &t)
       {
         if (i) t << ",";
         i++;
-        t << bibTmpFile << QString().setNum(i);
+        t << bibTmpFile << QCString().setNum(i);
       }
     }
     bibdata = citeDataList.next();
@@ -151,7 +151,7 @@ void CiteDict::generatePage() const
           p=s+1;
 
          int i;
-          if ((i = line.find("crossref")) != -1) /* assumption crosreference is on one line and the only item */
+          if ((i = line.find("crossref")) != -1) /* assumption crosreference is on one line and the only item */
           {
             int j=line.find("{",i);
             int k=line.find("}",i);
@@ -235,14 +235,14 @@ void CiteDict::generatePage() const
   // 5. run bib2xhtml perl script on the generated file which will insert the
   //    bibliography in citelist.doc
   int exitCode;
-  portable_sysTimerStop();
-  if ((exitCode=portable_system("perl","\""+bib2xhtmlFile+"\" "+bibOutputFiles+" \""+
+  Portable::sysTimerStop();
+  if ((exitCode=Portable::system("perl","\""+bib2xhtmlFile+"\" "+bibOutputFiles+" \""+
                          citeListFile+"\"")) != 0)
   {
     err("Problems running bibtex. Verify that the command 'perl --version' works from the command line. Exit code: %d\n",
         exitCode);
   }
-  portable_sysTimerStop();
+  Portable::sysTimerStop();
 
   QDir::setCurrent(oldDir);
 
@@ -296,7 +296,7 @@ void CiteDict::generatePage() const
 
   // 7. add it as a page
   addRelatedPage(CiteConsts::fileName,
-       theTranslator->trCiteReferences(),doc,0,CiteConsts::fileName,1,0,0,0);
+       theTranslator->trCiteReferences(),doc,CiteConsts::fileName,1);
 
   // 8. for latex we just copy the bib files to the output and let 
   //    latex do this work.
index 271b99f..f6020dd 100644 (file)
@@ -87,7 +87,7 @@ static QCString detab(const QCString &s)
           while (stop--) out.addChar(' '); 
         }
         break;
-      case '\n': // reset colomn counter
+      case '\n': // reset column counter
         out.addChar(c);
         col=0;
         break;
index 856ab05..61ae528 100644 (file)
@@ -87,7 +87,7 @@ class ClassDefImpl : public DefinitionImpl, public ClassDef
     virtual bool isLinkable() const;
     virtual bool isVisibleInHierarchy() const;
     virtual bool visibleInParentsDeclList() const;
-    virtual ArgumentList *templateArguments() const;
+    virtual const ArgumentList &templateArguments() const;
     virtual NamespaceDef *getNamespaceDef() const;
     virtual FileDef      *getFileDef() const;
     virtual MemberDef    *getMemberByName(const QCString &) const;
@@ -104,9 +104,9 @@ class ClassDefImpl : public DefinitionImpl, public ClassDef
     virtual ConstraintClassDict *templateTypeConstraints() const;
     virtual bool isTemplateArgument() const;
     virtual Definition *findInnerCompound(const char *name) const;
-    virtual void getTemplateParameterLists(QList<ArgumentList> &lists) const;
+    virtual std::vector<ArgumentList> getTemplateParameterLists() const;
     virtual QCString qualifiedNameWithTemplateParameters(
-        QList<ArgumentList> *actualParams=0,int *actualParamIndex=0) const;
+        const std::vector<ArgumentList> *actualParams=0,int *actualParamIndex=0) const;
     virtual bool isAbstract() const;
     virtual bool isObjectiveC() const;
     virtual bool isFortran() const;
@@ -133,12 +133,11 @@ class ClassDefImpl : public DefinitionImpl, public ClassDef
     virtual MemberDef *isSmartPointer() const;
     virtual bool isJavaEnum() const;
     virtual bool isGeneric() const;
-    virtual bool isAnonymous() const;
     virtual const ClassSDict *innerClasses() const;
     virtual QCString title() const;
     virtual QCString generatedFromFiles() const;
     virtual const FileList &usedFiles() const;
-    virtual const ArgumentList *typeConstraints() const;
+    virtual const ArgumentList &typeConstraints() const;
     virtual const ExampleSDict *exampleList() const;
     virtual bool hasExamples() const;
     virtual QCString getMemberListFileName() const;
@@ -167,10 +166,10 @@ class ClassDefImpl : public DefinitionImpl, public ClassDef
     virtual void setCompoundType(CompoundType t);
     virtual void setClassName(const char *name);
     virtual void setClassSpecifier(uint64 spec);
-    virtual void setTemplateArguments(ArgumentList *al);
+    virtual void setTemplateArguments(const ArgumentList &al);
     virtual void setTemplateBaseClassNames(QDict<int> *templateNames);
     virtual void setTemplateMaster(const ClassDef *tm);
-    virtual void setTypeConstraints(ArgumentList *al);
+    virtual void setTypeConstraints(const ArgumentList &al);
     virtual void addMembersToTemplateInstance(const ClassDef *cd,const char *templSpec);
     virtual void makeTemplateArgument(bool b=TRUE);
     virtual void setCategoryOf(ClassDef *cd);
@@ -265,7 +264,7 @@ class ClassDefImpl : public DefinitionImpl, public ClassDef
 
     // PIMPL idiom
     class IMPL;
-    IMPL *m_impl;
+    IMPL *m_impl = 0;
 };
 
 ClassDef *createClassDef(
@@ -332,7 +331,7 @@ class ClassDefAliasImpl : public DefinitionAliasImpl, public ClassDef
     { return getCdAlias()->isVisibleInHierarchy(); }
     virtual bool visibleInParentsDeclList() const
     { return getCdAlias()->visibleInParentsDeclList(); }
-    virtual ArgumentList *templateArguments() const
+    virtual const ArgumentList &templateArguments() const
     { return getCdAlias()->templateArguments(); }
     virtual NamespaceDef *getNamespaceDef() const
     { return getCdAlias()->getNamespaceDef(); }
@@ -366,10 +365,10 @@ class ClassDefAliasImpl : public DefinitionAliasImpl, public ClassDef
     { return getCdAlias()->isTemplateArgument(); }
     virtual Definition *findInnerCompound(const char *name) const
     { return getCdAlias()->findInnerCompound(name); }
-    virtual void getTemplateParameterLists(QList<ArgumentList> &lists) const
-    { return getCdAlias()->getTemplateParameterLists(lists); }
+    virtual std::vector<ArgumentList> getTemplateParameterLists() const
+    { return getCdAlias()->getTemplateParameterLists(); }
     virtual QCString qualifiedNameWithTemplateParameters(
-        QList<ArgumentList> *actualParams=0,int *actualParamIndex=0) const
+        const std::vector<ArgumentList> *actualParams=0,int *actualParamIndex=0) const
     { return getCdAlias()->qualifiedNameWithTemplateParameters(actualParams,actualParamIndex); }
     virtual bool isAbstract() const
     { return getCdAlias()->isAbstract(); }
@@ -423,8 +422,6 @@ class ClassDefAliasImpl : public DefinitionAliasImpl, public ClassDef
     { return getCdAlias()->isJavaEnum(); }
     virtual bool isGeneric() const
     { return getCdAlias()->isGeneric(); }
-    virtual bool isAnonymous() const
-    { return getCdAlias()->isAnonymous(); }
     virtual const ClassSDict *innerClasses() const
     { return getCdAlias()->innerClasses(); }
     virtual QCString title() const
@@ -433,7 +430,7 @@ class ClassDefAliasImpl : public DefinitionAliasImpl, public ClassDef
     { return getCdAlias()->generatedFromFiles(); }
     virtual const FileList &usedFiles() const
     { return getCdAlias()->usedFiles(); }
-    virtual const ArgumentList *typeConstraints() const
+    virtual const ArgumentList &typeConstraints() const
     { return getCdAlias()->typeConstraints(); }
     virtual const ExampleSDict *exampleList() const
     { return getCdAlias()->exampleList(); }
@@ -470,10 +467,10 @@ class ClassDefAliasImpl : public DefinitionAliasImpl, public ClassDef
     virtual void setCompoundType(CompoundType t) {}
     virtual void setClassName(const char *name) {}
     virtual void setClassSpecifier(uint64 spec) {}
-    virtual void setTemplateArguments(ArgumentList *al) {}
+    virtual void setTemplateArguments(const ArgumentList &al) {}
     virtual void setTemplateBaseClassNames(QDict<int> *templateNames) {}
     virtual void setTemplateMaster(const ClassDef *tm) {}
-    virtual void setTypeConstraints(ArgumentList *al) {}
+    virtual void setTypeConstraints(const ArgumentList &al) {}
     virtual void addMembersToTemplateInstance(const ClassDef *cd,const char *templSpec) {}
     virtual void makeTemplateArgument(bool b=TRUE) {}
     virtual void setCategoryOf(ClassDef *cd) {}
@@ -525,7 +522,7 @@ class ClassDefAliasImpl : public DefinitionAliasImpl, public ClassDef
                  QPtrDict<void> *visitedClasses=0) const {}
 
   private:
-    mutable bool m_visited;
+    mutable bool m_visited = false;
 };
 
 
@@ -563,39 +560,39 @@ class ClassDefImpl::IMPL
     /*! Include information about the header file should be included
      *  in the documentation. 0 by default, set by setIncludeFile().
      */
-    IncludeInfo *incInfo;
+    IncludeInfo *incInfo = 0;
 
     /*! List of base class (or super-classes) from which this class derives
      *  directly.
      */
-    BaseClassList *inherits;
+    BaseClassList *inherits = 0;
 
     /*! List of sub-classes that directly derive from this class
      */
-    BaseClassList *inheritedBy;
+    BaseClassList *inheritedBy = 0;
 
     /*! Namespace this class is part of
      *  (this is the inner most namespace in case of nested namespaces)
      */
-    NamespaceDef  *nspace;
+    NamespaceDef  *nspace = 0;
 
     /*! File this class is defined in */
-    FileDef *fileDef;
+    FileDef *fileDef = 0;
 
     /*! List of all members (including inherited members) */
-    MemberNameInfoSDict *allMemberNameInfoSDict;
+    MemberNameInfoSDict *allMemberNameInfoSDict = 0;
 
     /*! Template arguments of this class */
-    ArgumentList *tempArgs;
+    ArgumentList tempArgs;
 
     /*! Type constraints for template parameters */
-    ArgumentList *typeConstraints;
+    ArgumentList typeConstraints;
 
     /*! Files that were used for generating the class documentation. */
     FileList files;
 
     /*! Examples that use this class */
-    ExampleSDict *exampleSDict;
+    ExampleSDict *exampleSDict = 0;
 
     /*! Holds the kind of "class" this is. */
     ClassDef::CompoundType compType;
@@ -609,30 +606,30 @@ class ClassDefImpl::IMPL
     /*! The inner classes contained in this class. Will be 0 if there are
      *  no inner classes.
      */
-    ClassSDict *innerClasses;
+    ClassSDict *innerClasses = 0;
 
     /* classes for the collaboration diagram */
-    UsesClassDict *usesImplClassDict;
-    UsesClassDict *usedByImplClassDict;
-    UsesClassDict *usesIntfClassDict;
+    UsesClassDict *usesImplClassDict = 0;
+    UsesClassDict *usedByImplClassDict = 0;
+    UsesClassDict *usesIntfClassDict = 0;
 
-    ConstraintClassDict *constraintClassDict;
+    ConstraintClassDict *constraintClassDict = 0;
 
     /*! Template instances that exists of this class, the key in the
      *  dictionary is the template argument list.
      */
-    mutable QDict<ClassDef> *templateInstances;
+    mutable QDict<ClassDef> *templateInstances = 0;
 
     /*! Template instances that exists of this class, as defined by variables.
      *  We do NOT want to document these individually. The key in the
      *  dictionary is the template argument list.
      */
-    mutable QDict<ClassDef> *variableInstances;
+    mutable QDict<ClassDef> *variableInstances = 0;
 
-    QDict<int> *templBaseClassNames;
+    QDict<int> *templBaseClassNames = 0;
 
     /*! The class this class is an instance of. */
-    const ClassDef *templateMaster;
+    const ClassDef *templateMaster = 0;
 
     /*! local class name which could be a typedef'ed alias name. */
     QCString className;
@@ -640,56 +637,54 @@ class ClassDefImpl::IMPL
     /*! If this class is a Objective-C category, then this points to the
      *  class which is extended.
      */
-    ClassDef *categoryOf;
+    ClassDef *categoryOf = 0;
 
     QList<MemberList> memberLists;
 
     /* user defined member groups */
-    MemberGroupSDict *memberGroupSDict;
+    MemberGroupSDict *memberGroupSDict = 0;
 
     /*! Is this an abstract class? */
-    bool isAbstract;
+    bool isAbstract = false;
 
     /*! Is the class part of an unnamed namespace? */
-    bool isStatic;
+    bool isStatic = false;
 
     /*! TRUE if classes members are merged with those of the base classes. */
-    bool membersMerged;
+    bool membersMerged = false;
 
     /*! TRUE if the class is defined in a source file rather than a header file. */
-    bool isLocal;
+    bool isLocal = false;
 
-    bool isTemplArg;
+    bool isTemplArg = false;
 
     /*! Does this class group its user-grouped members
      *  as a sub-section of the normal (public/protected/..)
      *  groups?
      */
-    bool subGrouping;
+    bool subGrouping = false;
 
     /** Reason of existence is a "use" relation */
-    bool usedOnly;
+    bool usedOnly = false;
 
     /** List of titles to use for the summary */
     SDict<QCString> vhdlSummaryTitles;
 
     /** Is this a simple (non-nested) C structure? */
-    bool isSimple;
+    bool isSimple = false;
 
     /** Does this class overloaded the -> operator? */
-    MemberDef *arrowOperator;
+    MemberDef *arrowOperator = 0;
 
-    ClassList *taggedInnerClasses;
-    ClassDef *tagLessRef;
+    ClassList *taggedInnerClasses = 0;
+    ClassDef *tagLessRef = 0;
 
     /** Does this class represent a Java style enum? */
-    bool isJavaEnum;
-
-    bool isGeneric;
+    bool isJavaEnum = false;
 
-    bool isAnonymous;
+    bool isGeneric = false;
 
-    uint64 spec;
+    uint64 spec = 0;
 
     QCString metaData;
 };
@@ -710,8 +705,6 @@ void ClassDefImpl::IMPL::init(const char *defFileName, const char *name,
   inheritedBy = 0;
   allMemberNameInfoSDict = 0;
   incInfo=0;
-  tempArgs=0;
-  typeConstraints=0;
   prot=Public;
   nspace=0;
   fileDef=0;
@@ -753,7 +746,6 @@ void ClassDefImpl::IMPL::init(const char *defFileName, const char *name,
     isLocal=FALSE;
   }
   isGeneric = (lang==SrcLangExt_CSharp || lang==SrcLangExt_Java) && QCString(name).find('<')!=-1;
-  isAnonymous = QCString(name).find('@')!=-1;
 }
 
 ClassDefImpl::IMPL::IMPL() : vhdlSummaryTitles(17)
@@ -777,8 +769,6 @@ ClassDefImpl::IMPL::~IMPL()
   delete templateInstances;
   delete variableInstances;
   delete templBaseClassNames;
-  delete tempArgs;
-  delete typeConstraints;
   delete taggedInnerClasses;
 }
 
@@ -839,6 +829,10 @@ QCString ClassDefImpl::displayName(bool includeScope) const
       n=className();
     }
   }
+  if (isAnonymous())
+  {
+    n = removeAnonymousScopes(n);
+  }
   QCString sep=getLanguageSpecificSeparator(lang);
   if (sep!="::")
   {
@@ -853,14 +847,7 @@ QCString ClassDefImpl::displayName(bool includeScope) const
   //  n = n.left(n.length()-2);
   //}
   //printf("ClassDefImpl::displayName()=%s\n",n.data());
-  if (n.find('@')!=-1)
-  {
-    return removeAnonymousScopes(n);
-  }
-  else
-  {
-    return n;
-  }
+  return n;
 }
 
 // inserts a base/super class in the inheritance list
@@ -1276,14 +1263,14 @@ void ClassDefImpl::distributeMemberGroupDocumentation()
 
 void ClassDefImpl::findSectionsInDocumentation()
 {
-  docFindSections(documentation(),this,0,docFile());
+  docFindSections(documentation(),this,docFile());
   if (m_impl->memberGroupSDict)
   {
     MemberGroupSDict::Iterator mgli(*m_impl->memberGroupSDict);
     MemberGroup *mg;
     for (;(mg=mgli.current());++mgli)
     {
-      mg->findSectionsInDocumentation();
+      mg->findSectionsInDocumentation(this);
     }
   }
   QListIterator<MemberList> mli(m_impl->memberLists);
@@ -1292,7 +1279,7 @@ void ClassDefImpl::findSectionsInDocumentation()
   {
     if ((ml->listType()&MemberListType_detailedLists)==0)
     {
-      ml->findSectionsInDocumentation();
+      ml->findSectionsInDocumentation(this);
     }
   }
 }
@@ -1376,7 +1363,7 @@ void ClassDefImpl::setIncludeFile(FileDef *fd,
 //}
 
 static void searchTemplateSpecs(/*in*/  const Definition *d,
-                                /*out*/ QList<ArgumentList> &result,
+                                /*out*/ std::vector<ArgumentList> &result,
                                 /*out*/ QCString &name,
                                 /*in*/  SrcLangExt lang)
 {
@@ -1395,9 +1382,9 @@ static void searchTemplateSpecs(/*in*/  const Definition *d,
     }
     name+=clName;
     bool isSpecialization = d->localName().find('<')!=-1;
-    if (cd->templateArguments())
+    if (!cd->templateArguments().empty())
     {
-      result.append(cd->templateArguments());
+      result.push_back(cd->templateArguments());
       if (!isSpecialization)
       {
         name+=tempArgListToString(cd->templateArguments(),lang);
@@ -1413,35 +1400,32 @@ static void searchTemplateSpecs(/*in*/  const Definition *d,
 static void writeTemplateSpec(OutputList &ol,const Definition *d,
             const QCString &type,SrcLangExt lang)
 {
-  QList<ArgumentList> specs;
+  std::vector<ArgumentList> specs;
   QCString name;
   searchTemplateSpecs(d,specs,name,lang);
-  if (specs.count()>0) // class has template scope specifiers
+  if (!specs.empty()) // class has template scope specifiers
   {
     ol.startSubsubsection();
-    QListIterator<ArgumentList> spi(specs);
-    ArgumentList *al;
-    for (spi.toFirst();(al=spi.current());++spi)
+    for (const ArgumentList &al : specs)
     {
       ol.docify("template<");
-      QListIterator<Argument> ali(*al);
-      Argument *a;
-      while ((a=ali.current()))
+      auto it = al.begin();
+      while (it!=al.end())
       {
-        ol.docify(a->type);
-        if (!a->name.isEmpty())
+        Argument a = *it;
+        ol.docify(a.type);
+        if (!a.name.isEmpty())
         {
           ol.docify(" ");
-          ol.docify(a->name);
+          ol.docify(a.name);
         }
-        if (a->defval.length()!=0)
+        if (a.defval.length()!=0)
         {
           ol.docify(" = ");
-          ol.docify(a->defval);
+          ol.docify(a.defval);
         }
-        ++ali;
-        a=ali.current();
-        if (a) ol.docify(", ");
+        ++it;
+        if (it!=al.end()) ol.docify(", ");
       }
       ol.docify(">");
       ol.lineBreak();
@@ -1722,7 +1706,8 @@ void ClassDefImpl::writeInheritanceGraph(OutputList &ol) const
     DotClassGraph inheritanceGraph(this,Inheritance);
     if (inheritanceGraph.isTooBig())
     {
-       warn_uncond("Inheritance graph for '%s' not generated, too many nodes. Consider increasing DOT_GRAPH_MAX_NODES.\n",name().data());
+       warn_uncond("Inheritance graph for '%s' not generated, too many nodes (%d), threshold is %d. Consider increasing DOT_GRAPH_MAX_NODES.\n",
+           name().data(), inheritanceGraph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
     }
     else if (!inheritanceGraph.isTrivial())
     {
@@ -1890,7 +1875,7 @@ void ClassDefImpl::writeIncludeFilesForSlice(OutputList &ol) const
         QFileInfo info(s);
         if (info.exists())
         {
-          QString prefix = info.absFilePath();
+          QCString prefix = info.absFilePath().utf8();
           if (prefix.at(prefix.length() - 1) != '/')
           {
             prefix += '/';
@@ -2268,14 +2253,9 @@ void ClassDefImpl::writeTagFile(FTextStream &tagFile)
   {
     tagFile << "    <clangid>" << convertToXML(idStr) << "</clangid>" << endl;
   }
-  if (m_impl->tempArgs)
+  for (const Argument &a : m_impl->tempArgs)
   {
-    ArgumentListIterator ali(*m_impl->tempArgs);
-    Argument *a;
-    for (;(a=ali.current());++ali)
-    {
-      tagFile << "    <templarg>" << convertToXML(a->name) << "</templarg>" << endl;
-    }
+    tagFile << "    <templarg>" << convertToXML(a.name) << "</templarg>" << endl;
   }
   if (m_impl->inherits)
   {
@@ -2816,7 +2796,7 @@ QCString ClassDefImpl::title() const
   {
     pageTitle = theTranslator->trCompoundReferenceFortran(displayName(),
               m_impl->compType,
-              m_impl->tempArgs != 0);
+              !m_impl->tempArgs.empty());
   }
   else if (lang==SrcLangExt_Slice)
   {
@@ -2850,7 +2830,7 @@ QCString ClassDefImpl::title() const
     {
       pageTitle = theTranslator->trCompoundReference(displayName(),
                 m_impl->compType == Interface && getLanguage()==SrcLangExt_ObjC ? Class : m_impl->compType,
-                m_impl->tempArgs != 0);
+                !m_impl->tempArgs.empty());
     }
   }
   return pageTitle;
@@ -3089,7 +3069,7 @@ void ClassDefImpl::writeMemberList(OutputList &ol) const
       //printf("%s: Member %s of class %s md->protection()=%d mi->prot=%d prot=%d inherited=%d\n",
       //    name().data(),md->name().data(),cd->name().data(),md->protection(),mi->prot,prot,mi->inherited);
 
-      if (cd && !md->name().isEmpty() && md->name()[0]!='@')
+      if (cd && !md->name().isEmpty() && !md->isAnonymous())
       {
         bool memberWritten=FALSE;
         if (cd->isLinkable() && md->isLinkable())
@@ -3327,7 +3307,7 @@ bool ClassDefImpl::hasExamples() const
 
 void ClassDefImpl::addTypeConstraint(const QCString &typeConstraint,const QCString &type)
 {
-  //printf("addTypeContraint(%s,%s)\n",type.data(),typeConstraint.data());
+  //printf("addTypeConstraint(%s,%s)\n",type.data(),typeConstraint.data());
   static bool hideUndocRelation = Config_getBool(HIDE_UNDOC_RELATIONS);
   if (typeConstraint.isEmpty() || type.isEmpty()) return;
   ClassDef *cd = const_cast<ClassDef*>(getResolvedClass(this,getFileDef(),typeConstraint));
@@ -3362,55 +3342,33 @@ void ClassDefImpl::addTypeConstraint(const QCString &typeConstraint,const QCStri
 // Java Type Constrains: A<T extends C & I>
 void ClassDefImpl::addTypeConstraints()
 {
-  if (m_impl->tempArgs)
+  for (const Argument &a : m_impl->tempArgs)
   {
-    ArgumentListIterator ali(*m_impl->tempArgs);
-    Argument *a;
-    for (;(a=ali.current());++ali)
+    if (!a.typeConstraint.isEmpty())
     {
-      if (!a->typeConstraint.isEmpty())
+      QCString typeConstraint;
+      int i=0,p=0;
+      while ((i=a.typeConstraint.find('&',p))!=-1) // typeConstraint="A &I" for C<T extends A & I>
       {
-        QCString typeConstraint;
-        int i=0,p=0;
-        while ((i=a->typeConstraint.find('&',p))!=-1) // typeConstraint="A &I" for C<T extends A & I>
-        {
-          typeConstraint = a->typeConstraint.mid(p,i-p).stripWhiteSpace();
-          addTypeConstraint(typeConstraint,a->type);
-          p=i+1;
-        }
-        typeConstraint = a->typeConstraint.right(a->typeConstraint.length()-p).stripWhiteSpace();
-        addTypeConstraint(typeConstraint,a->type);
+        typeConstraint = a.typeConstraint.mid(p,i-p).stripWhiteSpace();
+        addTypeConstraint(typeConstraint,a.type);
+        p=i+1;
       }
+      typeConstraint = a.typeConstraint.right(a.typeConstraint.length()-p).stripWhiteSpace();
+      addTypeConstraint(typeConstraint,a.type);
     }
   }
 }
 
 // C# Type Constraints: D<T> where T : C, I
-void ClassDefImpl::setTypeConstraints(ArgumentList *al)
+void ClassDefImpl::setTypeConstraints(const ArgumentList &al)
 {
-  if (al==0) return;
-  if (!m_impl->typeConstraints) delete m_impl->typeConstraints;
-  m_impl->typeConstraints = new ArgumentList;
-  ArgumentListIterator ali(*al);
-  Argument *a;
-  for (;(a=ali.current());++ali)
-  {
-    m_impl->typeConstraints->append(new Argument(*a));
-  }
+  m_impl->typeConstraints = al;
 }
 
-void ClassDefImpl::setTemplateArguments(ArgumentList *al)
+void ClassDefImpl::setTemplateArguments(const ArgumentList &al)
 {
-  if (al==0) return;
-  if (m_impl->tempArgs) delete m_impl->tempArgs; // delete old list if needed
-  //printf("setting template args '%s' for '%s'\n",tempArgListToString(al,getLanguage()).data(),name().data());
-  m_impl->tempArgs=new ArgumentList;
-  ArgumentListIterator ali(*al);
-  Argument *a;
-  for (;(a=ali.current());++ali)
-  {
-    m_impl->tempArgs->append(new Argument(*a));
-  }
+  m_impl->tempArgs = al;
 }
 
 /*! Returns \c TRUE iff this class or a class inheriting from this class
@@ -3689,7 +3647,7 @@ void ClassDefImpl::mergeMembers()
             {
               MemberDef *srcMd = srcMi->memberDef;
               bool found=FALSE;
-              bool ambigue=FALSE;
+              bool ambiguous=FALSE;
               bool hidden=FALSE;
               MemberNameInfoIterator dstMnii(*dstMni);
               MemberInfo *dstMi;
@@ -3704,8 +3662,8 @@ void ClassDefImpl::mergeMembers()
                   if (srcCd==dstCd || dstCd->isBaseClass(srcCd,TRUE))
                     // member is in the same or a base class
                   {
-                    const ArgumentList *srcAl = srcMd->argumentList();
-                    const ArgumentList *dstAl = dstMd->argumentList();
+                    ArgumentList &srcAl = srcMd->argumentList();
+                    ArgumentList &dstAl = dstMd->argumentList();
                     found=matchArguments2(
                         srcMd->getOuterScope(),srcMd->getFileDef(),srcAl,
                         dstMd->getOuterScope(),dstMd->getFileDef(),dstAl,
@@ -3728,7 +3686,7 @@ void ClassDefImpl::mergeMembers()
                     QCString scope=dstMi->scopePath.left(dstMi->scopePath.find(sep)+sepLen);
                     if (scope!=dstMi->ambiguityResolutionScope.left(scope.length()))
                       dstMi->ambiguityResolutionScope.prepend(scope);
-                    ambigue=TRUE;
+                    ambiguous=TRUE;
                   }
                 }
                 else // same members
@@ -3757,12 +3715,12 @@ void ClassDefImpl::mergeMembers()
                     {
                       dstMi->ambiguityResolutionScope.prepend(scope);
                     }
-                    ambigue=TRUE;
+                    ambiguous=TRUE;
                   }
                 }
               }
-              //printf("member %s::%s hidden %d ambigue %d srcMi->ambigClass=%p\n",
-              //    srcCd->name().data(),srcMd->name().data(),hidden,ambigue,srcMi->ambigClass);
+              //printf("member %s::%s hidden %d ambiguous %d srcMi->ambigClass=%p\n",
+              //    srcCd->name().data(),srcMd->name().data(),hidden,ambiguous,srcMi->ambigClass);
 
               // TODO: fix the case where a member is hidden by inheritance
               //       of a member with the same name but with another prototype,
@@ -3791,7 +3749,7 @@ void ClassDefImpl::mergeMembers()
 
                 MemberInfo *newMi = new MemberInfo(srcMd,prot,virt,TRUE);
                 newMi->scopePath=bClass->name()+sep+srcMi->scopePath;
-                if (ambigue)
+                if (ambiguous)
                 {
                   //printf("$$ New member %s %s add scope %s::\n",
                   //     srcMi->ambiguityResolutionScope.data(),
@@ -4099,203 +4057,6 @@ void ClassDefImpl::addUsedByClass(ClassDef *cd,const char *accessName,
 }
 
 
-#if 0
-/*! Builds up a dictionary of all classes that are used by the state of this
- *  class (the "implementation").
- *  Must be called before mergeMembers() is called!
- */
-
-void ClassDefImpl::determineImplUsageRelation()
-{
-  MemberNameInfoSDict::Iterator mnili(*m_impl->allMemberNameInfoSDict);
-  MemberNameInfo *mni;
-  for (;(mni=mnili.current());++mnili)
-  {
-    MemberNameInfoIterator mnii(*mni);
-    MemberInfo *mi;
-    for (mnii.toFirst();(mi=mnii.current());++mnii)
-    {
-      MemberDef *md=mi->memberDef;
-      if (md->isVariable()) // for each member variable in this class
-      {
-        QCString type=removeRedundantWhiteSpace(md->typeString());
-        //printf("in class %s found var type='%s' name='%s'\n",
-        //            name().data(),type.data(),md->name().data());
-        int pos=0;
-        QCString usedClassName;
-        QCString templSpec;
-        bool found=FALSE;
-        while (extractClassNameFromType(type,pos,usedClassName,templSpec)!=-1 && !found)
-        {
-          //printf("usedClassName='%s' templSpec=%s\n",usedClassName.data(),templSpec.data());
-          // check if usedClassName is a template argument of its class
-          ClassDef *cd=md->getClassDef();
-          if (cd && cd->templateArguments())
-          {
-            ArgumentListIterator ali(*cd->templateArguments());
-            Argument *arg;
-            int count=0;
-            for (ali.toFirst();(arg=ali.current());++ali,++count)
-            {
-              if (arg->name==usedClassName) // type is a template argument
-              {
-                found=TRUE;
-                if (m_impl->usesImplClassDict==0) m_impl->usesImplClassDict = new UsesClassDict(257);
-                cd = new ClassDef(cd->getDefFileName(),cd->getDefLine(),
-                    usedClassName,ClassDef::Class);
-                cd->setIsTemplateBaseClass(count);
-                UsesClassDef *ucd = new UsesClassDef(cd);
-                m_impl->usesImplClassDict->insert(cd->name(),ucd);
-                ucd->templSpecifiers = templSpec;
-                ucd->addAccessor(md->name());
-                Doxygen::hiddenClasses.append(cd);
-                //printf("Adding used template argument %s to class %s\n",
-                //    cd->name().data(),name().data());
-                //printf("Adding accessor %s to class %s\n",
-                //    md->name().data(),ucd->classDef->name().data());
-              }
-            }
-          }
-
-          if (!found)
-          {
-            cd=0;
-            if (getNamespaceDef()!=0)
-            {
-              cd=getResolvedClass(getNamespaceDef()->name()+"::"+usedClassName,0,&templSpec);
-            }
-            if (cd==0) cd=getResolvedClass(name()+"::"+usedClassName,0,&templSpec);
-            if (cd==0) cd=getResolvedClass(usedClassName,0,&templSpec); // TODO: also try in-between scopes!
-            //printf("Search for class %s result=%p\n",usedClassName.data(),cd);
-            if (cd) // class exists
-            {
-              found=TRUE;
-              if (m_impl->usesImplClassDict==0)
-              {
-                m_impl->usesImplClassDict = new UsesClassDict(257);
-                m_impl->usesImplClassDict->setAutoDelete(TRUE);
-              }
-              UsesClassDef *ucd=m_impl->usesImplClassDict->find(cd->name());
-              if (ucd==0 || ucd->templSpecifiers!=templSpec)
-              {
-                ucd = new UsesClassDef(cd);
-                m_impl->usesImplClassDict->insert(cd->name(),ucd);
-                ucd->templSpecifiers = templSpec;
-                //printf("Adding used class %s to class %s\n",
-                //    cd->name().data(),name().data());
-              }
-              ucd->addAccessor(md->name());
-              //printf("Adding accessor %s to class %s\n",
-              //    md->name().data(),ucd->classDef->name().data());
-            }
-          }
-        }
-      }
-    }
-  }
-#ifdef DUMP
-  if (m_impl->usesClassDict)
-  {
-    msg("Class %s uses the following classes:\n",name().data());
-    UsesClassDictIterator ucdi(*m_impl->usesClassDict);
-    UsesClassDef *ucd;
-    for (;(ucd=ucdi.current());++ucdi)
-    {
-      msg("  %s via ",ucd->classDef->name().data());
-      QDictIterator<void> dvi(*ucd->accessors);
-      const char *s;
-      for (;(s=dvi.currentKey());++dvi)
-      {
-        msg("%s ",s);
-      }
-      msg("\n");
-    }
-  }
-#endif
-}
-
-//----------------------------------------------------------------------------
-
-// I have disabled this code because the graphs it renders quickly become
-// too large to be of practical use.
-
-void ClassDefImpl::addUsedInterfaceClasses(MemberDef *md,const char *typeStr)
-{
-  QCString type = typeStr;
-  static const QRegExp re("[a-z_A-Z][a-z_A-Z0-9:]*");
-  int p=0,i,l;
-  while ((i=re.match(type,p,&l))!=-1) // for each class name in the type
-  {
-    ClassDef *cd=getClass(name()+"::"+type.mid(i,l));
-    if (cd==0) cd=getClass(type.mid(i,l)); // TODO: also try in-between scopes!
-    if (cd && cd!=this && !isBaseClass(cd))
-    {
-      if (m_impl->usesIntfClassDict==0)
-      {
-        m_impl->usesIntfClassDict = new UsesClassDict(257);
-      }
-      UsesClassDef *ucd=m_impl->usesIntfClassDict->find(cd->name());
-      if (ucd==0)
-      {
-        ucd = new UsesClassDef(cd);
-        m_impl->usesIntfClassDict->insert(cd->name(),ucd);
-        //printf("in class '%s' adding used intf class '%s'\n",
-        //  name().data(),cd->name().data());
-      }
-      ucd->addAccessor(md->name());
-      //printf("in class '%s' adding accessor '%s' to class '%s'\n",
-      //    name().data(),md->name().data(),ucd->classDef->name().data());
-    }
-    p=i+l;
-  }
-}
-
-void ClassDefImpl::determineIntfUsageRelation()
-{
-  MemberNameInfoSDict::Iterator mnili(*m_impl->allMemberNameInfoList);
-  MemberNameInfo *mni;
-  for (;(mni=mnili.current());++mnili)
-  {
-    MemberNameInfoIterator mnii(*mni);
-    MemberInfo *mi;
-    for (mnii.toFirst();(mi=mnii.current());++mnii)
-    {
-      MemberDef *md=mi->memberDef;
-
-      // compute the protection level for this member
-      Protection protect=md->protection();
-      if (mi->prot==Protected) // inherited protection
-      {
-        if (protect==Public) protect=Protected;
-        else if (protect==Protected) protect=Private;
-      }
-
-      if (!md->name().isEmpty() && md->name()[0]!='@' &&
-          (mi->prot!=Private && protect!=Private)
-         )
-      {
-        // add classes found in the return type
-        addUsedInterfaceClasses(md,md->typeString());
-        ArgumentList *al = md->argumentList();
-        if (al) // member has arguments
-        {
-          // add classes found in the types of the argument list
-          ArgumentListIterator ali(*al);
-          Argument *a;
-          for (;(a=ali.current());++ali)
-          {
-            if (!a->type.isEmpty() && a->type.at(0)!='@')
-            {
-              addUsedInterfaceClasses(md,a->type);
-            }
-          }
-        }
-      }
-    }
-  }
-}
-#endif
-
 QCString ClassDefImpl::compoundTypeString() const
 {
   if (getLanguage()==SrcLangExt_Fortran)
@@ -4431,46 +4192,6 @@ Definition *ClassDefImpl::findInnerCompound(const char *name) const
   return result;
 }
 
-//void ClassDefImpl::initTemplateMapping()
-//{
-//  m_impl->templateMapping->clear();
-//  ArgumentList *al = templateArguments();
-//  if (al)
-//  {
-//    ArgumentListIterator ali(*al);
-//    Argument *arg;
-//    for (ali.toFirst();(arg=ali.current());++ali)
-//    {
-//      setTemplateArgumentMapping(arg->name,arg->defval);
-//    }
-//  }
-//}
-//void ClassDefImpl::setTemplateArgumentMapping(const char *formal,const char *actual)
-//{
-//  //printf("ClassDefImpl::setTemplateArgumentMapping(%s,%s)\n",formal,actual);
-//  if (m_impl->templateMapping && formal)
-//  {
-//    if (m_impl->templateMapping->find(formal))
-//    {
-//      m_impl->templateMapping->remove(formal);
-//    }
-//    m_impl->templateMapping->insert(formal,new QCString(actual));
-//  }
-//}
-//
-//QCString ClassDefImpl::getTemplateArgumentMapping(const char *formal) const
-//{
-//  if (m_impl->templateMapping && formal)
-//  {
-//    QCString *s = m_impl->templateMapping->find(formal);
-//    if (s)
-//    {
-//      return *s;
-//    }
-//  }
-//  return "";
-//}
-
 ClassDef *ClassDefImpl::insertTemplateInstance(const QCString &fileName,
     int startLine, int startColumn, const QCString &templSpec,bool &freshInstance) const
 {
@@ -4552,12 +4273,11 @@ void ClassDefImpl::addMembersToTemplateInstance(const ClassDef *cd,const char *t
     MemberInfo *mi;
     for (mnii.toFirst();(mi=mnii.current());++mnii)
     {
-      ArgumentList *actualArguments = new ArgumentList;
-      stringToArgumentList(templSpec,actualArguments);
+      ArgumentList actualArguments;
+      stringToArgumentList(getLanguage(),templSpec,actualArguments);
       MemberDef *md = mi->memberDef;
       MemberDef *imd = md->createTemplateInstanceMember(
                           cd->templateArguments(),actualArguments);
-      delete actualArguments;
       //printf("%s->setMemberClass(%p)\n",imd->name().data(),this);
       imd->setMemberClass(this);
       imd->setTemplateMaster(md);
@@ -4607,25 +4327,24 @@ bool ClassDefImpl::isReference() const
   }
 }
 
-void ClassDefImpl::getTemplateParameterLists(QList<ArgumentList> &lists) const
+std::vector<ArgumentList> ClassDefImpl::getTemplateParameterLists() const
 {
+  std::vector<ArgumentList> result;
   Definition *d=getOuterScope();
-  if (d)
+  while (d && d->definitionType()==Definition::TypeClass)
   {
-    if (d->definitionType()==Definition::TypeClass)
-    {
-      ClassDef *cd=dynamic_cast<ClassDef *>(d);
-      cd->getTemplateParameterLists(lists);
-    }
+    result.insert(result.begin(),dynamic_cast<ClassDef*>(d)->templateArguments());
+    d = d->getOuterScope();
   }
-  if (templateArguments())
+  if (!templateArguments().empty())
   {
-    lists.append(templateArguments());
+    result.push_back(templateArguments());
   }
+  return result;
 }
 
 QCString ClassDefImpl::qualifiedNameWithTemplateParameters(
-    QList<ArgumentList> *actualParams,int *actualParamIndex) const
+    const std::vector<ArgumentList> *actualParams,int *actualParamIndex) const
 {
   //static bool optimizeOutputJava = Config_getBool(OPTIMIZE_OUTPUT_JAVA);
   static bool hideScopeNames = Config_getBool(HIDE_SCOPE_NAMES);
@@ -4659,12 +4378,11 @@ QCString ClassDefImpl::qualifiedNameWithTemplateParameters(
   //}
   //printf("m_impl->lang=%d clName=%s isSpecialization=%d\n",getLanguage(),clName.data(),isSpecialization);
   scName+=clName;
-  ArgumentList *al=0;
-  if (templateArguments())
+  if (!templateArguments().empty())
   {
-    if (actualParams && *actualParamIndex<(int)actualParams->count())
+    if (actualParams && *actualParamIndex<(int)actualParams->size())
     {
-      al = actualParams->at(*actualParamIndex);
+      const ArgumentList &al = actualParams->at(*actualParamIndex);
       if (!isSpecialization)
       {
         scName+=tempArgListToString(al,lang);
@@ -4706,7 +4424,7 @@ void ClassDefImpl::addListReferences()
   if (!isLinkableInProject()) return;
   //printf("ClassDef(%s)::addListReferences()\n",name().data());
   {
-    QList<ListItemInfo> *xrefItems = xrefListItems();
+    const std::vector<ListItemInfo> &xrefItems = xrefListItems();
     addRefItem(xrefItems,
              qualifiedName(),
              lang==SrcLangExt_Fortran ? theTranslator->trType(TRUE,TRUE)
@@ -4813,7 +4531,7 @@ void ClassDefImpl::addMemberToList(MemberListType lt,MemberDef *md,bool isBrief)
   ml->append(md);
 
   // for members in the declaration lists we set the section, needed for member grouping
-  if ((ml->listType()&MemberListType_detailedLists)==0) md->setSectionList(this,ml);
+  if ((ml->listType()&MemberListType_detailedLists)==0) md->setSectionList(ml);
 }
 
 void ClassDefImpl::sortMemberLists()
@@ -5007,7 +4725,7 @@ int ClassDefImpl::countAdditionalInheritedMembers() const
       }
     }
   }
-  //printf("countAdditonalInheritedMembers()=%d\n",totalCount);
+  //printf("countAdditionalInheritedMembers()=%d\n",totalCount);
   return totalCount;
 }
 
@@ -5238,7 +4956,7 @@ Protection ClassDefImpl::protection() const
   return m_impl->prot;
 }
 
-ArgumentList *ClassDefImpl::templateArguments() const
+const ArgumentList &ClassDefImpl::templateArguments() const
 {
   return m_impl->tempArgs;
 }
@@ -5265,7 +4983,7 @@ const ClassDef *ClassDefImpl::templateMaster() const
 
 bool ClassDefImpl::isTemplate() const
 {
-  return m_impl->tempArgs!=0;
+  return !m_impl->tempArgs.empty();
 }
 
 IncludeInfo *ClassDefImpl::includeInfo() const
@@ -5551,7 +5269,7 @@ const FileList &ClassDefImpl::usedFiles() const
   return m_impl->files;
 }
 
-const ArgumentList *ClassDefImpl::typeConstraints() const
+const ArgumentList &ClassDefImpl::typeConstraints() const
 {
   return m_impl->typeConstraints;
 }
@@ -5573,7 +5291,6 @@ bool ClassDefImpl::isSliceLocal() const
 
 void ClassDefImpl::setName(const char *name)
 {
-  m_impl->isAnonymous = QCString(name).find('@')!=-1;
   DefinitionImpl::setName(name);
 }
 
@@ -5582,11 +5299,6 @@ void ClassDefImpl::setMetaData(const char *md)
   m_impl->metaData = md;
 }
 
-bool ClassDefImpl::isAnonymous() const
-{
-  return m_impl->isAnonymous;
-}
-
 QCString ClassDefImpl::collaborationGraphFileName() const
 {
   return m_impl->collabFileName;
index a442ace..3158c50 100644 (file)
@@ -18,6 +18,8 @@
 #ifndef CLASSDEF_H
 #define CLASSDEF_H
 
+#include <vector>
+
 #include <qlist.h>
 #include <qdict.h>
 #include <qptrdict.h>
@@ -72,7 +74,6 @@ class ClassDef : virtual public Definition
 
     virtual ~ClassDef() {}
 
-    virtual ClassDef *resolveAlias() = 0;
 
     //-----------------------------------------------------------------------------------
     // --- getters 
@@ -155,10 +156,9 @@ class ClassDef : virtual public Definition
     /** show this class in the declaration section of its parent? */
     virtual bool visibleInParentsDeclList() const = 0;
 
-    /** Returns the template arguments of this class 
-     *  Will return 0 if not applicable.
+    /** Returns the template arguments of this class
      */
-    virtual ArgumentList *templateArguments() const = 0;
+    virtual const ArgumentList &templateArguments() const = 0;
 
     /** Returns the namespace this compound is in, or 0 if it has a global
      *  scope.
@@ -229,10 +229,10 @@ class ClassDef : virtual public Definition
      *  will return a list with one ArgumentList containing one argument
      *  with type="class" and name="T".
      */
-    virtual void getTemplateParameterLists(QList<ArgumentList> &lists) const = 0;
+    virtual std::vector<ArgumentList> getTemplateParameterLists() const = 0;
 
     virtual QCString qualifiedNameWithTemplateParameters(
-        QList<ArgumentList> *actualParams=0,int *actualParamIndex=0) const = 0;
+        const std::vector<ArgumentList> *actualParams=0,int *actualParamIndex=0) const = 0;
 
     /** Returns TRUE if there is at least one pure virtual member in this
      *  class.
@@ -302,14 +302,13 @@ class ClassDef : virtual public Definition
     virtual bool isJavaEnum() const = 0;
 
     virtual bool isGeneric() const = 0;
-    virtual bool isAnonymous() const = 0;
     virtual const ClassSDict *innerClasses() const = 0;
     virtual QCString title() const = 0;
 
     virtual QCString generatedFromFiles() const = 0;
     virtual const FileList &usedFiles() const = 0;
 
-    virtual const ArgumentList *typeConstraints() const = 0;
+    virtual const ArgumentList &typeConstraints() const = 0;
     virtual const ExampleSDict *exampleList() const = 0;
     virtual bool hasExamples() const = 0;
     virtual QCString getMemberListFileName() const = 0;
@@ -332,10 +331,10 @@ class ClassDef : virtual public Definition
     virtual void setCompoundType(CompoundType t) = 0;
     virtual void setClassName(const char *name) = 0;
     virtual void setClassSpecifier(uint64 spec) = 0;
-    virtual void setTemplateArguments(ArgumentList *al) = 0;
+    virtual void setTemplateArguments(const ArgumentList &al) = 0;
     virtual void setTemplateBaseClassNames(QDict<int> *templateNames) = 0;
     virtual void setTemplateMaster(const ClassDef *tm) = 0;
-    virtual void setTypeConstraints(ArgumentList *al) = 0;
+    virtual void setTypeConstraints(const ArgumentList &al) = 0;
     virtual void setCategoryOf(ClassDef *cd) = 0;
     virtual void setUsedOnly(bool b) = 0;
     virtual void setTagLessReference(ClassDef *cd) = 0;
index 93ae8aa..f06f744 100644 (file)
@@ -72,7 +72,7 @@ bool ClassSDict::declVisible(const ClassDef::CompoundType *filter) const
     ClassDef *cd=0;
     for (sdi.toFirst();(cd=sdi.current());++sdi)
     {
-      if (cd->name().find('@')==-1 &&
+      if (!cd->isAnonymous() &&
           (filter==0 || *filter==cd->compoundType())
          )
       {
@@ -103,7 +103,7 @@ void ClassSDict::writeDeclaration(OutputList &ol,const ClassDef::CompoundType *f
     for (sdi.toFirst();(cd=sdi.current());++sdi)
     {
       //printf("  ClassSDict::writeDeclaration for %s\n",cd->name().data());
-      if (cd->name().find('@')==-1 &&
+      if (!cd->isAnonymous() &&
           !cd->isExtension() &&
           (cd->protection()!=Private || extractPrivate) &&
           (filter==0 || *filter==cd->compoundType())
@@ -137,7 +137,7 @@ void ClassSDict::writeDocumentation(OutputList &ol,const Definition * container)
       //  cd->name().data(),cd->getOuterScope(),cd->isLinkableInProject(),cd->isEmbeddedInOuterScope(),
       //  container,cd->partOfGroups() ? cd->partOfGroups()->count() : 0);
 
-      if (cd->name().find('@')==-1 &&
+      if (!cd->isAnonymous() &&
           cd->isLinkableInProject() &&
           cd->isEmbeddedInOuterScope() &&
           !cd->isAlias() &&
@@ -167,8 +167,8 @@ void GenericsSDict::insert(const QCString &key,ClassDef *cd)
   int i=key.find('<');
   if (i==-1) return;
   ArgumentList argList;
-  stringToArgumentList(key.mid(i),&argList);
-  int c = argList.count();
+  stringToArgumentList(SrcLangExt_CSharp, key.mid(i),argList);
+  int c = argList.size();
   if (c==0) return;
   GenericsCollection *collection = m_dict.find(key.left(i));
   if (collection==0) // new name
@@ -200,8 +200,8 @@ ClassDef *GenericsSDict::find(const QCString &key)
     if (collection)
     {
       ArgumentList argList;
-      stringToArgumentList(key.mid(i),&argList);
-      int c = argList.count();
+      stringToArgumentList(SrcLangExt_CSharp,key.mid(i),argList);
+      int c = argList.size();
       return collection->find(c);
     }
   }
index b4d35d4..e62aa4f 100644 (file)
@@ -55,7 +55,7 @@ CommandMap cmdMap[] =
   { "endverbatim",   CMD_ENDVERBATIM },
   { "endxmlonly",    CMD_ENDXMLONLY },
   { "exception",     CMD_EXCEPTION },
-  { "form",          CMD_FORMULA },
+  { "_form",         CMD_FORMULA },
   { "htmlinclude",   CMD_HTMLINCLUDE },
   { "htmlonly",      CMD_HTMLONLY },
   { "image",         CMD_IMAGE },
@@ -196,6 +196,7 @@ CommandMap htmlTagMap[] =
   { "div",        HTML_DIV },
   { "blockquote", HTML_BLOCKQUOTE },
   { "strike",     HTML_STRIKE },
+  { "s",          HTML_S },
   { "u",          HTML_UNDERLINE },
   { "ins",        HTML_INS },
   { "del",        HTML_DEL },
@@ -239,14 +240,14 @@ int Mapper::map(const char *n)
   return !name.isEmpty() && (result=m_map.find(name)) ? *result: 0;
 }
 
-QString Mapper::find(const int n)
+QCString Mapper::find(const int n)
 {
   QDictIterator<int> mapIterator(m_map);
   for (int *curVal = mapIterator.toFirst();(curVal = mapIterator.current());++mapIterator)
   {
     if (*curVal == n || (*curVal == (n | SIMPLESECT_BIT))) return mapIterator.currentKey();
   }
-  return NULL;
+  return QCString();
 }
 
 Mapper::Mapper(const CommandMap *cm,bool caseSensitive) : m_map(89), m_cs(caseSensitive)
index d670cd4..246be9d 100644 (file)
@@ -181,6 +181,7 @@ enum HtmlTagType
   HTML_UNDERLINE = 35,
   HTML_INS       = 36,
   HTML_DEL       = 37,
+  HTML_S         = 38,
 
   XML_CmdMask    = 0x100,
 
@@ -214,7 +215,7 @@ class Mapper
 {
   public:
     int map(const char *n);
-    QString find(const int n);
+    QCString find(const int n);
     Mapper(const CommandMap *cm,bool caseSensitive);
   private:
     QDict<int> m_map;
index da6b80e..42265ad 100644 (file)
 #ifndef CODE_H
 #define CODE_H
 
-#include "types.h"
+#include "parserintf.h"
 
-class CodeOutputInterface;
 class FileDef;
 class MemberDef;
 class QCString;
 class Definition;
 
-void parseCCode(CodeOutputInterface &,const char *,const QCString &, 
-            SrcLangExt lang, bool isExample, const char *exName,FileDef *fd,
-            int startLine,int endLine,bool inlineFragment,
-            const MemberDef *memberDef,bool showLineNumbers,const Definition *searchCtx,
-            bool collectXRefs);
-void resetCCodeParserState();
-void codeFreeScanner();
+class CCodeParser : public CodeParserInterface
+{
+  public:
+    CCodeParser();
+    virtual ~CCodeParser();
+    void parseCode(CodeOutputInterface &codeOutIntf,
+                   const char *scopeName,
+                   const QCString &input,
+                   SrcLangExt lang,
+                   bool isExampleBlock,
+                   const char *exampleName=0,
+                   FileDef *fileDef=0,
+                   int startLine=-1,
+                   int endLine=-1,
+                   bool inlineFragment=FALSE,
+                   const MemberDef *memberDef=0,
+                   bool showLineNumbers=TRUE,
+                   const Definition *searchCtx=0,
+                   bool collectXRefs=TRUE
+                  );
+    void resetCodeParserState();
+  private:
+    struct Private;
+    std::unique_ptr<Private> p;
+};
 
 #endif
index d66ccc8..fb609e5 100644 (file)
@@ -16,6 +16,8 @@
  */
 %option never-interactive
 %option prefix="codeYY"
+%option reentrant
+%option extra-type="struct codeYY_state *"
 
 %{
 
@@ -28,6 +30,7 @@
 #include <qregexp.h>
 #include <qdir.h>
 
+#include "code.h"
 #include "entry.h"
 #include "doxygen.h"
 #include "message.h"
  *     statics
  */
   
-static CodeOutputInterface * g_code;
-
-static ClassSDict    *g_codeClassSDict = 0;
-static QCString      g_curClassName;
-static QStrList      g_curClassBases;
-
-static QCString      g_parmType;
-static QCString      g_parmName;
-
-static const char *  g_inputString;     //!< the code fragment as text
-static int          g_inputPosition;   //!< read offset during parsing 
-static int           g_inputLines;      //!< number of line in the code fragment
-static int          g_yyLineNr;        //!< current line number
-static int          g_yyColNr;         //!< current column number
-static bool          g_needsTermination;
-
-static bool          g_exampleBlock;
-static QCString      g_exampleName;
-static QCString      g_exampleFile;
-
-static bool          g_insideTemplate = FALSE;
-static QCString      g_type;
-static QCString      g_name;
-static QCString      g_args;
-static QCString      g_classScope;
-static QCString      g_realScope;
-static QStack<int>   g_scopeStack;      //!< 1 if bracket starts a scope, 
-                                        //   2 for internal blocks 
-static int           g_anchorCount;
-static FileDef *     g_sourceFileDef;
-static bool          g_lineNumbers;
-static Definition *  g_currentDefinition;
-static MemberDef *   g_currentMemberDef;
-static bool          g_includeCodeFragment;
-static const char *  g_currentFontClass;
-static bool          g_searchingForBody;
-static bool          g_insideBody;
-static int           g_bodyCurlyCount;
-static QCString      g_saveName;
-static QCString      g_saveType;
-static QCString      g_delimiter;
-
-static int          g_bracketCount = 0;
-static int          g_curlyCount   = 0;
-static int          g_sharpCount   = 0;
-static bool          g_inFunctionTryBlock = FALSE;
-static bool          g_inForEachExpression = FALSE;
-
-static int           g_lastTemplCastContext;
-static int          g_lastSpecialCContext;
-static int           g_lastStringContext;
-static int           g_lastSkipCppContext;
-static int           g_lastVerbStringContext;
-static int           g_lastObjCCallContext;
-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;
-static bool          g_insidePHP;
-static bool          g_insideProtocolList;
-static bool          g_insideSlice;
-
-static bool          g_lexInit = FALSE;
-
-static QStack<int>   g_classScopeLengthStack;
-
-static int           g_prefixed_with_this_keyword = FALSE;
-static const Definition *g_searchCtx;
-static bool          g_collectXRefs;
-
 // context for an Objective-C method call
 struct ObjCCallCtx
 {
@@ -147,29 +76,6 @@ struct ObjCCallCtx
   int braceCount;
 };
 
-// globals for objective-C method calls 
-static ObjCCallCtx *g_currentCtx=0;
-static int g_currentCtxId=0;
-static int g_currentNameId=0;
-static int g_currentObjId=0;
-static int g_currentWordId=0;
-static int g_currentCommentId=0;
-static QStack<ObjCCallCtx> g_contextStack;
-static QIntDict<ObjCCallCtx> g_contextDict;
-static QIntDict<QCString> g_nameDict;
-static QIntDict<QCString> g_objectDict;
-static QIntDict<QCString> g_wordDict;
-static QIntDict<QCString> g_commentDict;
-static int g_braceCount=0;
-  
-static void saveObjCContext();
-static void restoreObjCContext();
-
-static QCString g_forceTagReference;
-
-
-//-------------------------------------------------------------------
-
 /*! Represents a stack of variable to class mappings as found in the
  *  code. Each scope is enclosed in pushScope() and popScope() calls.
  *  Variables are added by calling addVariables() and one can search
@@ -225,7 +131,7 @@ class VariableContext
       m_scopes.clear();
     }
 
-    void addVariable(const QCString &type,const QCString &name);
+    void addVariable(yyscan_t yyscanner,const QCString &type,const QCString &name);
     ClassDef *findVariable(const QCString &name);
 
     int count() const { return m_scopes.count(); }
@@ -235,102 +141,6 @@ class VariableContext
     QList<Scope> m_scopes;
 };
 
-void VariableContext::addVariable(const QCString &type,const QCString &name)
-{
-  //printf("VariableContext::addVariable(%s,%s)\n",type.data(),name.data());
-  QCString ltype = type.simplifyWhiteSpace();
-  QCString lname = name.simplifyWhiteSpace();
-  if (ltype.left(7)=="struct ") 
-  {
-    ltype = ltype.right(ltype.length()-7);
-  }
-  else if (ltype.left(6)=="union ")
-  {
-    ltype = ltype.right(ltype.length()-6);
-  }
-  if (ltype.isEmpty() || lname.isEmpty()) return;
-  DBG_CTX((stderr,"** addVariable trying: type='%s' name='%s' g_currentDefinition=%s\n",
-       ltype.data(),lname.data(),g_currentDefinition?g_currentDefinition->name().data():"<none>"));
-  Scope *scope = m_scopes.count()==0 ? &m_globalScope : m_scopes.getLast();
-  const ClassDef *varType;
-  int i=0;
-  if (
-      (varType=g_codeClassSDict->find(ltype)) ||  // look for class definitions inside the code block
-      (varType=getResolvedClass(g_currentDefinition,g_sourceFileDef,ltype)) // look for global class definitions
-     ) 
-  {
-    DBG_CTX((stderr,"** addVariable type='%s' name='%s'\n",ltype.data(),lname.data()));
-    scope->append(lname,varType); // add it to a list
-  }
-  else if ((i=ltype.find('<'))!=-1)
-  {
-    // probably a template class
-    QCString typeName(ltype.left(i));
-    ClassDef* newDef = 0;
-    QCString templateArgs(ltype.right(ltype.length() - i));
-    if ( !typeName.isEmpty() &&
-         ( // look for class definitions inside the code block
-          (varType=g_codeClassSDict->find(typeName)) ||
-           // otherwise look for global class definitions
-           (varType=getResolvedClass(g_currentDefinition,g_sourceFileDef,typeName,0,0,TRUE,TRUE))
-        ) && // and it must be a template
-         varType->templateArguments())
-    {
-      newDef = varType->getVariableInstance( templateArgs );
-    }
-    if (newDef)
-    {
-      DBG_CTX((stderr,"** addVariable type='%s' templ='%s' name='%s'\n",typeName.data(),templateArgs.data(),lname.data()));
-      scope->append(lname, newDef);
-    }
-    else
-    {
-      // Doesn't seem to be a template. Try just the base name.
-      addVariable(typeName,name);
-    }
-  }
-  else 
-  {
-    if (m_scopes.count()>0) // for local variables add a dummy entry so the name 
-                            // is hidden to avoid false links to global variables with the same name
-                            // TODO: make this work for namespaces as well!
-    {
-      DBG_CTX((stderr,"** addVariable: dummy context for '%s'\n",lname.data()));
-      scope->append(lname,dummyContext);
-    }
-    else
-    {
-      DBG_CTX((stderr,"** addVariable: not adding variable!\n"));
-    }
-  }
-}
-
-ClassDef *VariableContext::findVariable(const QCString &name)
-{
-  if (name.isEmpty()) return 0;
-  ClassDef *result = 0;
-  QListIterator<Scope> sli(m_scopes);
-  Scope *scope;
-  QCString key = name;
-  // search from inner to outer scope
-  for (sli.toLast();(scope=sli.current());--sli)
-  {
-    result = scope->find(key);
-    if (result)
-    {
-      DBG_CTX((stderr,"** findVariable(%s)=%p\n",name.data(),result));
-      return result;
-    }
-  }
-  // nothing found -> also try the global scope
-  result=m_globalScope.find(name);
-  DBG_CTX((stderr,"** findVariable(%s)=%p\n",name.data(),result));
-  return result;
-}
-
-static VariableContext g_theVarContext;
-const ClassDef *VariableContext::dummyContext = (ClassDef*)0x8;
-
 //-------------------------------------------------------------------
 
 class CallContext
@@ -398,2476 +208,1221 @@ class CallContext
     QList<Ctx> m_defList;
 };
 
-static CallContext g_theCallContext;
-
-//-------------------------------------------------------------------
 
-/*! add class/namespace name s to the scope */
-static void pushScope(const char *s)
+struct codeYY_state
 {
-  g_classScopeLengthStack.push(new int(g_classScope.length()));
-  if (g_classScope.isEmpty() || leftScopeMatch(s,g_classScope))
-  {
-    g_classScope = s;
-  }
-  else
-  {
-    g_classScope += "::";
-    g_classScope += s;
-  }
-  //printf("pushScope(%s) result: '%s'\n",s,g_classScope.data());
-}
+  CodeOutputInterface * code = 0;
+
+  ClassSDict    *codeClassSDict = 0;
+  QCString      curClassName;
+  QStrList      curClassBases;
+
+  QCString      parmType;
+  QCString      parmName;
+
+  const char *  inputString = 0;     //!< the code fragment as text
+  int          inputPosition = 0;   //!< read offset during parsing 
+  int           inputLines = 0;      //!< number of line in the code fragment
+  int          yyLineNr = 0;        //!< current line number
+  int          yyColNr = 0;         //!< current column number
+  bool          needsTermination = FALSE;
+
+  bool          exampleBlock = FALSE;
+  QCString      exampleName;
+  QCString      exampleFile;
+
+  bool          insideTemplate = FALSE;
+  QCString      type;
+  QCString      name;
+  QCString      args;
+  QCString      classScope;
+  QCString      realScope;
+  QStack<int>   scopeStack;      //!< 1 if bracket starts a scope, 
+                                 //   2 for internal blocks 
+  int           anchorCount = 0;
+  FileDef *     sourceFileDef = 0;
+  bool          lineNumbers = FALSE;
+  Definition *  currentDefinition = 0;
+  MemberDef *   currentMemberDef = 0;
+  bool          includeCodeFragment = FALSE;
+  const char *  currentFontClass = 0;
+  bool          searchingForBody = FALSE;
+  bool          insideBody = FALSE;
+  int           bodyCurlyCount = 0;
+  QCString      saveName;
+  QCString      saveType;
+  QCString      delimiter;
+
+  int          bracketCount = 0;
+  int          curlyCount   = 0;
+  int          sharpCount   = 0;
+  bool          inFunctionTryBlock = FALSE;
+  bool          inForEachExpression = FALSE;
+
+  int           lastTemplCastContext = 0;
+  int          lastSpecialCContext = 0;
+  int           lastStringContext = 0;
+  int           lastSkipCppContext = 0;
+  int           lastVerbStringContext = 0;
+  int           lastObjCCallContext = 0;
+  int           memCallContext = 0;
+  int          lastCContext = 0;
+  int           skipInlineInitContext = 0;
+
+  SrcLangExt    lang = SrcLangExt_Unknown;
+  bool          insideObjC = FALSE;
+  bool          insideProtocolList = FALSE;
+
+  bool          lexInit = FALSE;
+
+  QStack<int>   classScopeLengthStack;
+
+  int           prefixed_with_this_keyword = FALSE;
+  const Definition *searchCtx = 0;
+  bool          collectXRefs = FALSE;
+
+  ObjCCallCtx * currentCtx=0;
+  int           currentCtxId=0;
+  int           currentNameId=0;
+  int           currentObjId=0;
+  int           currentWordId=0;
+  int           currentCommentId=0;
+  QStack<ObjCCallCtx>   contextStack;
+  QIntDict<ObjCCallCtx> contextDict;
+  QIntDict<QCString>    nameDict;
+  QIntDict<QCString>    objectDict;
+  QIntDict<QCString>    wordDict;
+  QIntDict<QCString>    commentDict;
+  int           braceCount=0;
+
+  QCString        forceTagReference;
+  VariableContext theVarContext;
+  CallContext     theCallContext;
+};
 
-/*! remove the top class/namespace name from the scope */
-static void popScope()
-{
-  if (!g_classScopeLengthStack.isEmpty())
-  {
-    int *pLength = g_classScopeLengthStack.pop();
-    g_classScope.truncate(*pLength);
-    delete pLength;
-  }
-  else
-  {
-    //err("Too many end of scopes found!\n");
-  }
-  //printf("popScope() result: '%s'\n",g_classScope.data());
-}
+static bool isCastKeyword(const QCString &s);
 
-static void setCurrentDoc(const QCString &anchor)
-{
-  if (Doxygen::searchIndex)
-  {
-    if (g_searchCtx)
-    {
-      g_code->setCurrentDoc(g_searchCtx,g_searchCtx->anchor(),FALSE);
-    }
-    else
-    {
-      g_code->setCurrentDoc(g_sourceFileDef,anchor,TRUE);
-    }
-  }
-}
+//-------------------------------------------------------------------
 
-static void addToSearchIndex(const char *text)
-{
-  if (Doxygen::searchIndex)
-  {
-    g_code->addWord(text,FALSE);
-  }
-}
+static void saveObjCContext(yyscan_t yyscanner);
+static void restoreObjCContext(yyscan_t yyscanner);
+static const char *stateToString(yyscan_t yyscanner,int state);
+static void addUsingDirective(yyscan_t yyscanner,const char *name);
+static void pushScope(yyscan_t yyscanner,const char *s);
+static void popScope(yyscan_t yyscanner);
+static void setCurrentDoc(yyscan_t yyscanner,const QCString &anchor);
+static void addToSearchIndex(yyscan_t yyscanner,const char *text);
+static void setClassScope(yyscan_t yyscanner,const QCString &name);
+static void startCodeLine(yyscan_t yyscanner);
+static void endCodeLine(yyscan_t yyscanner);
+static void nextCodeLine(yyscan_t yyscanner);
+static void startFontClass(yyscan_t yyscanner,const char *s);
+static void endFontClass(yyscan_t yyscanner);
+static void codifyLines(yyscan_t yyscanner,const char *text);
+static void writeMultiLineCodeLink(yyscan_t yyscanner,CodeOutputInterface &ol,
+                                   const Definition *d,
+                                   const char *text);
+static void addType(yyscan_t yyscanner);
+static void addParmType(yyscan_t yyscanner);
+static void addUsingDirective(yyscan_t yyscanner,const char *name);
+static void setParameterList(yyscan_t yyscanner,const MemberDef *md);
+static const ClassDef *stripClassName(yyscan_t yyscanner,const char *s,Definition *d);
+static MemberDef *setCallContextForVar(yyscan_t yyscanner,const QCString &name);
+static void updateCallContextForSmartPointer(yyscan_t yyscanner);
+static bool getLinkInScope(yyscan_t yyscanner,const QCString &c,  // scope
+                           const QCString &m,  // member
+                          const char *memberText, // exact text
+                          CodeOutputInterface &ol,
+                          const char *text,
+                          bool varOnly=FALSE
+                         );
+static bool getLink(yyscan_t yyscanner,const char *className,
+                    const char *memberName,
+                   CodeOutputInterface &ol,
+                   const char *text=0,
+                   bool varOnly=FALSE);
+static void generateClassOrGlobalLink(yyscan_t yyscanner,CodeOutputInterface &ol,const char *clName,
+                                      bool typeOnly=FALSE,bool varOnly=FALSE);
+static bool generateClassMemberLink(yyscan_t yyscanner,CodeOutputInterface &ol,MemberDef *xmd,const char *memName);
+static bool generateClassMemberLink(yyscan_t yyscanner,CodeOutputInterface &ol,const Definition *def,const char *memName);
+static void generateMemberLink(yyscan_t yyscanner,CodeOutputInterface &ol,const QCString &varName,
+            const char *memName);
+static void generatePHPVariableLink(yyscan_t yyscanner,CodeOutputInterface &ol,const char *varName);
+static void generateFunctionLink(yyscan_t yyscanner,CodeOutputInterface &ol,const char *funcName);
+static int countLines(yyscan_t yyscanner);
+static void writeObjCMethodCall(yyscan_t yyscanner,ObjCCallCtx *ctx);
+static QCString escapeName(yyscan_t yyscanner,const char *s);
+static QCString escapeObject(yyscan_t yyscanner,const char *s);
+static QCString escapeWord(yyscan_t yyscanner,const char *s);
+static QCString escapeComment(yyscan_t yyscanner,const char *s);
+static bool skipLanguageSpecificKeyword(yyscan_t yyscanner,const QCString &kw);
+static int yyread(yyscan_t yyscanner,char *buf,int max_size);
 
-static void setClassScope(const QCString &name)
-{
-  //printf("setClassScope(%s)\n",name.data());
-  QCString n=name;
-  n=n.simplifyWhiteSpace();
-  int ts=n.find('<'); // start of template
-  int te=n.findRev('>'); // end of template
-  //printf("ts=%d te=%d\n",ts,te);
-  if (ts!=-1 && te!=-1 && te>ts)
-  {
-    // remove template from scope
-    n=n.left(ts)+n.right(n.length()-te-1);
-  }
-  while (!g_classScopeLengthStack.isEmpty())
-  {
-    popScope();
-  }
-  g_classScope.resize(0);
-  int i;
-  while ((i=n.find("::"))!=-1)
-  {
-    pushScope(n.left(i));
-    n = n.mid(i+2);
-  }
-  pushScope(n);
-  //printf("--->New class scope '%s'\n",g_classScope.data());
-}
 
-/*! start a new line of code, inserting a line number if g_sourceFileDef
- * is TRUE. If a definition starts at the current line, then the line
- * number is linked to the documentation of that definition.
+/* -----------------------------------------------------------------
  */
-static void startCodeLine()
-{
-  //if (g_currentFontClass) { g_code->endFontClass(); }
-  if (g_sourceFileDef && g_lineNumbers)
-  {
-    //QCString lineNumber,lineAnchor;
-    //lineNumber.sprintf("%05d",g_yyLineNr);
-    //lineAnchor.sprintf("l%05d",g_yyLineNr);
-   
-    Definition *d   = g_sourceFileDef->getSourceDefinition(g_yyLineNr);
-    //printf("%s:startCodeLine(%d)=%p\n",g_sourceFileDef->name().data(),g_yyLineNr,d);
-    if (!g_includeCodeFragment && d)
-    {
-      g_currentDefinition = d;
-      g_currentMemberDef = g_sourceFileDef->getSourceMember(g_yyLineNr);
-      g_insideBody = FALSE;
-      g_searchingForBody = TRUE;
-      g_realScope = d->name();
-      //g_classScope = "";
-      g_type.resize(0);
-      g_name.resize(0);
-      g_args.resize(0);
-      g_parmType.resize(0);
-      g_parmName.resize(0);
-      //printf("Real scope: '%s'\n",g_realScope.data());
-      g_bodyCurlyCount = 0;
-      QCString lineAnchor;
-      lineAnchor.sprintf("l%05d",g_yyLineNr);
-      if (g_currentMemberDef)
-      {
-        g_code->writeLineNumber(g_currentMemberDef->getReference(),
-                               g_currentMemberDef->getOutputFileBase(),
-                               g_currentMemberDef->anchor(),g_yyLineNr);
-        setCurrentDoc(lineAnchor);
-      }
-      else if (d->isLinkableInProject())
-      {
-        g_code->writeLineNumber(d->getReference(),
-                               d->getOutputFileBase(),
-                               0,g_yyLineNr);
-        setCurrentDoc(lineAnchor);
-      }
-    }
-    else
-    {
-      g_code->writeLineNumber(0,0,0,g_yyLineNr);
-    }
-  }
-  DBG_CTX((stderr,"startCodeLine(%d)\n",g_yyLineNr));
-  g_code->startCodeLine(g_sourceFileDef && g_lineNumbers); 
-  if (g_currentFontClass)
-  {
-    g_code->startFontClass(g_currentFontClass);
-  }
-}
-
+#undef YY_INPUT
+#define        YY_INPUT(buf,result,max_size) result=yyread(yyscanner,buf,max_size);
 
-static void endFontClass();
-static void startFontClass(const char *s);
 
-static void endCodeLine()
-{
-  DBG_CTX((stderr,"endCodeLine(%d)\n",g_yyLineNr));
-  endFontClass();
-  g_code->endCodeLine();
-}
+%}
 
-static void nextCodeLine()
-{
-  const char * fc = g_currentFontClass;
-  endCodeLine();
-  if (g_yyLineNr<g_inputLines) 
-  {
-    g_currentFontClass = fc;
-    startCodeLine();
-  }
-}
+B       [ \t]
+BN      [ \t\n\r]
+ID     "$"?[a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]*
+SEP     ("::"|"\\")
+SCOPENAME ({SEP}{BN}*)?({ID}{BN}*{SEP}{BN}*)*("~"{BN}*)?{ID}
+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"|"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"|"byte"|"char"|"double"|"float"|"int"|"long"|"object"|"short"|"signed"|"unsigned"|"void"|"wchar_t"|"size_t"|"boolean"|"id"|"SEL"|"string"|"nullptr")
+TYPEKWSL ("LocalObject"|"Object"|"Value")
+CASTKW ("const_cast"|"dynamic_cast"|"reinterpret_cast"|"static_cast")
+CHARLIT   (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^' \\\n]{1,4}"'"))
+ARITHOP "+"|"-"|"/"|"*"|"%"|"--"|"++"
+ASSIGNOP "="|"*="|"/="|"%="|"+="|"-="|"<<="|">>="|"&="|"^="|"|="
+LOGICOP "=="|"!="|">"|"<"|">="|"<="|"&&"|"||"|"!"
+BITOP   "&"|"|"|"^"|"<<"|">>"|"~"
+OPERATOR {ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}
+RAWBEGIN  (u|U|L|u8)?R\"[^ \t\(\)\\]{0,16}"("
+RAWEND    ")"[^ \t\(\)\\]{0,16}\"
 
-/*! write a code fragment 'text' that may span multiple lines, inserting
- * line numbers for each line.
- */
-static void codifyLines(const char *text)
-{
-  //printf("codifyLines(%d,\"%s\")\n",g_yyLineNr,text);
-  const char *p=text,*sp=p;
-  char c;
-  bool done=FALSE;
-  while (!done)
-  {
-    sp=p;
-    while ((c=*p++) && c!='\n') { g_yyColNr++; }
-    if (c=='\n')
-    {
-      g_yyLineNr++;
-      g_yyColNr=1;
-      //*(p-1)='\0';
-      int l = (int)(p-sp-1);
-      char *tmp = (char*)malloc(l+1);
-      memcpy(tmp,sp,l);
-      tmp[l]='\0';
-      g_code->codify(tmp);
-      free(tmp);
-      nextCodeLine();
-    }
-    else
-    {
-      g_code->codify(sp);
-      done=TRUE;
-    }
-  }
-}
+%option noyywrap
 
-/*! writes a link to a fragment \a text that may span multiple lines, inserting
- * line numbers for each line. If \a text contains newlines, the link will be 
- * split into multiple links with the same destination, one for each line.
- */
-static void writeMultiLineCodeLink(CodeOutputInterface &ol,
-                                   const Definition *d,
-                                   const char *text)
-{
-  static bool sourceTooltips = Config_getBool(SOURCE_TOOLTIPS);
-  TooltipManager::instance()->addTooltip(d);
-  QCString ref  = d->getReference();
-  QCString file = d->getOutputFileBase();
-  QCString anchor = d->anchor();
-  QCString tooltip; 
-  if (!sourceTooltips) // fall back to simple "title" tooltips
-  {
-    tooltip = d->briefDescriptionAsTooltip();
-  }
-  bool done=FALSE;
-  char *p=(char *)text;
-  while (!done)
-  {
-    char *sp=p;
-    char c;
-    while ((c=*p++) && c!='\n') { }
-    if (c=='\n')
-    {
-      g_yyLineNr++;
-      *(p-1)='\0';
-      //printf("writeCodeLink(%s,%s,%s,%s)\n",ref,file,anchor,sp);
-      ol.writeCodeLink(ref,file,anchor,sp,tooltip);
-      nextCodeLine();
-    }
-    else
-    {
-      //printf("writeCodeLink(%s,%s,%s,%s)\n",ref,file,anchor,sp);
-      ol.writeCodeLink(ref,file,anchor,sp,tooltip);
-      done=TRUE;
-    }
-  }
-}
+%x      SkipString
+%x      SkipStringS
+%x      SkipVerbString
+%x     SkipCPP
+%x     SkipComment
+%x     SkipCxxComment
+%x     RemoveSpecialCComment
+%x     StripSpecialCComment
+%x     Body
+%x      FuncCall
+%x      MemberCall
+%x      MemberCall2
+%x      SkipInits
+%x      ClassName
+%x      AlignAs
+%x      AlignAsEnd
+%x      PackageName
+%x      ClassVar
+%x     CppCliTypeModifierFollowup
+%x      Bases
+%x      SkipSharp
+%x      ReadInclude
+%x      TemplDecl
+%x      TemplCast
+%x     CallEnd
+%x      ObjCMethod
+%x     ObjCParams
+%x     ObjCParamType
+%x      ObjCCall
+%x      ObjCMName
+%x      ObjCSkipStr
+%x      ObjCCallComment
+%x      OldStyleArgs
+%x     UsingName
+%x      RawString
+%x      InlineInit
 
-static void addType()
-{
-  if (g_name=="const") { g_name.resize(0); return; }
-  if (!g_type.isEmpty()) g_type += ' ' ;
-  g_type += g_name ;
-  g_name.resize(0) ;
-  if (!g_type.isEmpty()) g_type += ' ' ;
-  g_type += g_args ;
-  g_args.resize(0) ;
-}
+%%
 
-static void addParmType()
-{
-  if (g_parmName=="const") { g_parmName.resize(0); return; }
-  if (!g_parmType.isEmpty()) g_parmType += ' ' ;
-  g_parmType += g_parmName ;
-  g_parmName.resize(0) ;
-}
+<*>\x0d
+<Body>^([ \t]*"#"[ \t]*("include"|"import")[ \t]*)("<"|"\"") {
+                                         startFontClass(yyscanner,"preprocessor");
+                                         yyextra->code->codify(yytext);
+                                         BEGIN( ReadInclude ); 
+                                       }
+<Body>("@interface"|"@implementation"|"@protocol")[ \t\n]+ { 
+                                          yyextra->insideObjC=TRUE;
+                                         startFontClass(yyscanner,"keyword");
+                                         codifyLines(yyscanner,yytext);
+                                         endFontClass(yyscanner);
+                                         if (!yyextra->insideTemplate) 
+                                           BEGIN( ClassName ); 
+                                       }
+<Body>(("public"|"private"){B}+)?("ref"|"value"|"interface"|"enum"){B}+("class"|"struct") {
+                                         if (yyextra->insideTemplate) REJECT;
+                                         startFontClass(yyscanner,"keyword");
+                                         codifyLines(yyscanner,yytext);
+                                         endFontClass(yyscanner);
+                                         BEGIN( ClassName ); 
+                                       }
+<Body>"property"|"event"/{BN}*                 { 
+                                         if (yyextra->insideTemplate) REJECT;
+                                         startFontClass(yyscanner,"keyword");
+                                         codifyLines(yyscanner,yytext);
+                                         endFontClass(yyscanner);
+                                       }
+<Body>(KEYWORD_CPPCLI_DATATYPE|("partial"{B}+)?"class"|"struct"|"union"|"namespace"|"interface"){B}+ { 
+                                         startFontClass(yyscanner,"keyword");
+                                         codifyLines(yyscanner,yytext);
+                                         endFontClass(yyscanner);
+                                         if (!yyextra->insideTemplate) 
+                                           BEGIN( ClassName ); 
+                                       }
+<Body>("package")[ \t\n]+              { 
+                                         startFontClass(yyscanner,"keyword");
+                                         codifyLines(yyscanner,yytext);
+                                         endFontClass(yyscanner);
+                                         BEGIN( PackageName ); 
+                                       }
+<ClassVar>\n                           {
+                                         if (!yyextra->insideObjC) REJECT;
+                                         codifyLines(yyscanner,yytext);
+                                         BEGIN(Body);
+                                       }
+<Body,ClassVar,Bases>"-"|"+"           {
+                                         if (!yyextra->insideObjC || yyextra->insideBody)
+                                         { 
+                                           yyextra->code->codify(yytext);
+                                         }
+                                         else // Start of Objective-C method
+                                         {
+                                           //printf("Method!\n");
+                                           yyextra->code->codify(yytext);
+                                           BEGIN(ObjCMethod);
+                                         }
+                                       }
+<ObjCMethod>":"                                {
+                                         yyextra->code->codify(yytext);
+                                         BEGIN(ObjCParams);
+                                       }
+<ObjCParams>"("                                {
+                                         yyextra->code->codify(yytext);
+                                         BEGIN(ObjCParamType);
+                                       }
+<ObjCParams,ObjCMethod>";"|"{"         {
+                                         yyextra->code->codify(yytext);
+                                         if (*yytext=='{')
+                                         {
+                                           if (yyextra->searchingForBody)
+                                           {
+                                             yyextra->searchingForBody=FALSE;
+                                             yyextra->insideBody=TRUE;
+                                           }
+                                           if (yyextra->insideBody) yyextra->bodyCurlyCount++;
+                                           if (!yyextra->curClassName.isEmpty()) // valid class name
+                                           {
+                                             pushScope(yyscanner,yyextra->curClassName);
+                                              DBG_CTX((stderr,"** scope stack push SCOPEBLOCK\n"));
+                                             yyextra->scopeStack.push(SCOPEBLOCK);
+                                           }
+                                         }
+                                          yyextra->type.resize(0);
+                                          yyextra->name.resize(0);
+                                         BEGIN(Body);
+                                       }
+<ObjCParams>{ID}{B}*":"                        {
+                                         yyextra->code->codify(yytext);
+                                       }
+<ObjCParamType>{TYPEKW}                {
+                                         startFontClass(yyscanner,"keywordtype");
+                                         yyextra->code->codify(yytext);
+                                         endFontClass(yyscanner);
+                                         yyextra->parmType=yytext;
+                                       }
+<ObjCParamType>{ID}                    {
+                                         generateClassOrGlobalLink(yyscanner,*yyextra->code,yytext);
+                                         yyextra->parmType=yytext;
+                                       }
+<ObjCParamType>")"                     {
+                                         yyextra->code->codify(yytext);
+                                         BEGIN(ObjCParams);
+                                       }
+<ObjCParams>{ID}                       {
+                                         yyextra->code->codify(yytext);
+                                         yyextra->parmName=yytext;
+                                         yyextra->theVarContext.addVariable(yyscanner,yyextra->parmType,yyextra->parmName);
+                                         yyextra->parmType.resize(0);yyextra->parmName.resize(0);
+                                       }
+<ObjCMethod,ObjCParams,ObjCParamType>{ID} {
+                                         generateClassOrGlobalLink(yyscanner,*yyextra->code,yytext);
+                                       }
+<ObjCMethod,ObjCParams,ObjCParamType>. {
+                                         yyextra->code->codify(yytext);
+                                       }
+<ObjCMethod,ObjCParams,ObjCParamType>\n        {
+                                         codifyLines(yyscanner,yytext);
+                                       }
+<ReadInclude>[^\n\"\>]+/(">"|"\"")     {
+                                         //FileInfo *f;
+                                         bool ambig;
+                                         bool found=FALSE;
+                                         //QCString absPath = yytext;
+                                         //if (yyextra->sourceFileDef && QDir::isRelativePath(absPath))
+                                         //{
+                                         //  absPath = QDir::cleanDirPath(yyextra->sourceFileDef->getPath()+"/"+absPath);
+                                         //}
 
-static void addUsingDirective(const char *name)
-{
-  if (g_sourceFileDef && name)
-  {
-    NamespaceDef *nd = Doxygen::namespaceSDict->find(name);
-    if (nd)
-    {
-      g_sourceFileDef->addUsingDirective(nd);
-    }
-  }
-}
+                                          FileDef *fd=findFileDef(Doxygen::inputNameDict,yytext,ambig);
+                                         //printf("looking for include %s -> %s fd=%p\n",yytext,absPath.data(),fd);
+                                         if (fd && fd->isLinkable())
+                                         {
+                                           if (ambig) // multiple input files match the name
+                                           {
+                                             //printf("===== yes %s is ambiguous\n",yytext);
+                                             QCString name = QDir::cleanDirPath(yytext).utf8();
+                                             if (!name.isEmpty() && yyextra->sourceFileDef)
+                                             {
+                                               FileName *fn = Doxygen::inputNameDict->find(name);
+                                               if (fn)
+                                               {
+                                                 FileNameIterator fni(*fn);
+                                                 // for each include name
+                                                 for (fni.toFirst();!found && (fd=fni.current());++fni)
+                                                 {
+                                                   // see if this source file actually includes the file
+                                                   found = yyextra->sourceFileDef->isIncluded(fd->absFilePath());
+                                                   //printf("      include file %s found=%d\n",fd->absFilePath().data(),found);
+                                                 }
+                                               }
+                                             }
+                                           }
+                                           else // not ambiguous
+                                           {
+                                             found = TRUE;
+                                           }
+                                         }
+                                         //printf("      include file %s found=%d\n",fd ? fd->absFilePath().data() : "<none>",found);
+                                         if (found)
+                                         {
+                                           writeMultiLineCodeLink(yyscanner,*yyextra->code,fd,yytext);
+                                         }
+                                         else
+                                         {
+                                           yyextra->code->codify(yytext);
+                                         }
+                                         char c=yyinput(yyscanner);
+                                         QCString text;
+                                         text+=c;
+                                         yyextra->code->codify(text);
+                                         endFontClass(yyscanner);
+                                         BEGIN( Body );
+                                       }
+<Body,Bases>^[ \t]*"#"                 { 
+                                         startFontClass(yyscanner,"preprocessor");
+                                         yyextra->lastSkipCppContext = YY_START;
+                                         yyextra->code->codify(yytext);
+                                         BEGIN( SkipCPP ) ; 
+                                       }
+<SkipCPP>.                             { 
+                                         yyextra->code->codify(yytext);
+                                       }
+<SkipCPP>[^\n\/\\]+                    {
+                                         yyextra->code->codify(yytext);
+                                       }
+<SkipCPP>\\[\r]?\n                     { 
+                                         codifyLines(yyscanner,yytext);
+                                       }
+<SkipCPP>"//"                          { 
+                                         yyextra->code->codify(yytext);
+                                       }
+<Body,FuncCall>"{"                     { 
+                                          yyextra->theVarContext.pushScope();
 
-static void setParameterList(const MemberDef *md)
-{
-  g_classScope = md->getClassDef() ? md->getClassDef()->name().data() : "";
-  const ArgumentList *al = md->argumentList();
-  if (al==0) return;
-  ArgumentListIterator it(*al);
-  const Argument *a;
-  for (;(a=it.current());++it)
-  {
-    g_parmName = a->name.copy();
-    g_parmType = a->type.copy();
-    int i = g_parmType.find('*');
-    if (i!=-1) g_parmType = g_parmType.left(i);
-    i = g_parmType.find('&');
-    if (i!=-1) g_parmType = g_parmType.left(i);
-    g_parmType.stripPrefix("const ");
-    g_parmType=g_parmType.stripWhiteSpace();
-    g_theVarContext.addVariable(g_parmType,g_parmName);
-  }
-}
+                                          DBG_CTX((stderr,"** scope stack push INNERBLOCK\n"));
+                                         yyextra->scopeStack.push(INNERBLOCK);
 
-static const ClassDef *stripClassName(const char *s,Definition *d=g_currentDefinition)
-{
-  int pos=0;
-  QCString type = s;
-  QCString className;
-  QCString templSpec;
-  while (extractClassNameFromType(type,pos,className,templSpec)!=-1)
-  {
-    QCString clName=className+templSpec;
-    const ClassDef *cd=0;
-    if (!g_classScope.isEmpty())
-    {
-      cd=getResolvedClass(d,g_sourceFileDef,g_classScope+"::"+clName);
-    }
-    if (cd==0)
-    {
-      cd=getResolvedClass(d,g_sourceFileDef,clName);
-    }
-    //printf("stripClass trying '%s' = %p\n",clName.data(),cd);
-    if (cd)
-    {
-      return cd;
-    }
-  }
+                                         if (yyextra->searchingForBody)
+                                         {
+                                           yyextra->searchingForBody=FALSE;
+                                           yyextra->insideBody=TRUE;
+                                         }
+                                         yyextra->code->codify(yytext);
+                                         if (yyextra->insideBody) 
+                                         {
+                                           yyextra->bodyCurlyCount++;
+                                         }
+                                         yyextra->type.resize(0); 
+                                         yyextra->name.resize(0);
+                                         BEGIN( Body );
+                                       }
+<Body,FuncCall,MemberCall,MemberCall2>"}"  { 
+                                          yyextra->theVarContext.popScope();
+                                         yyextra->type.resize(0); 
+                                         yyextra->name.resize(0);
 
-  return 0;
-}
+                                         int *scope = yyextra->scopeStack.pop();
+                                          DBG_CTX((stderr,"** scope stack pop SCOPEBLOCK=%d\n",scope==SCOPEBLOCK));
+                                         if (scope==SCOPEBLOCK || scope==CLASSBLOCK) 
+                                         {
+                                           popScope(yyscanner);
+                                         }
 
-static MemberDef *setCallContextForVar(const QCString &name)
-{
-  if (name.isEmpty()) return 0;
-  DBG_CTX((stderr,"setCallContextForVar(%s) g_classScope=%s\n",name.data(),g_classScope.data()));
+                                         yyextra->code->codify(yytext);
 
-  int scopeEnd = name.findRev("::");
-  if (scopeEnd!=-1) // name with explicit scope
-  {
-    QCString scope   = name.left(scopeEnd);
-    QCString locName = name.right(name.length()-scopeEnd-2);
-    //printf("explicit scope: name=%s scope=%s\n",locName.data(),scope.data());
-    ClassDef *mcd = getClass(scope); 
-    if (mcd && !locName.isEmpty())
-    {
-      MemberDef *md=mcd->getMemberByName(locName);
-      if (md)
-      {
-        //printf("name=%s scope=%s\n",locName.data(),scope.data());
-        g_theCallContext.setScope(stripClassName(md->typeString(),md->getOuterScope()));
-        return md;
-      }
-    }
-    else // check namespace as well
-    {
-      const NamespaceDef *mnd = getResolvedNamespace(scope);
-      if (mnd && !locName.isEmpty())
-      {
-       MemberDef *md=mnd->getMemberByName(locName);
-       if (md)
-       {
-         //printf("name=%s scope=%s\n",locName.data(),scope.data());
-         g_theCallContext.setScope(stripClassName(md->typeString(),md->getOuterScope()));
-         return md;
-       }
-      }
-    }
-  }
-  
-  MemberName *mn;
-  ClassDef *mcd = g_theVarContext.findVariable(name);
-  if (mcd) // local variable
-  {
-    DBG_CTX((stderr,"local variable?\n"));
-    if (mcd!=VariableContext::dummyContext)
-    {
-      DBG_CTX((stderr,"local var '%s' mcd=%s\n",name.data(),mcd->name().data()));
-      g_theCallContext.setScope(mcd);
-    }
-  }
-  else
-  {
-    DBG_CTX((stderr,"class member? scope=%s\n",g_classScope.data()));
-    // look for a class member 
-    mcd = getClass(g_classScope);
-    if (mcd)
-    {
-      DBG_CTX((stderr,"Inside class %s\n",mcd->name().data()));
-      MemberDef *md=mcd->getMemberByName(name);
-      if (md) 
-      {
-        DBG_CTX((stderr,"Found member %s\n",md->name().data()));
-       if (g_scopeStack.top()!=CLASSBLOCK)
-       {
-          DBG_CTX((stderr,"class member '%s' mcd=%s\n",name.data(),mcd->name().data()));
-         g_theCallContext.setScope(stripClassName(md->typeString(),md->getOuterScope()));
-       }
-       return md;
-      }
-    }
-  }
-
-  // look for a global member
-  if ((mn=Doxygen::functionNameSDict->find(name)))
-  {
-    //printf("global var '%s'\n",name.data());
-    if (mn->count()==1) // global defined only once
-    {
-      MemberDef *md=mn->getFirst();
-      if (!md->isStatic() || md->getBodyDef()==g_sourceFileDef)
-      {
-        g_theCallContext.setScope(stripClassName(md->typeString(),md->getOuterScope()));
-        return md;
-      }
-      return 0;
-    }
-    else if (mn->count()>1) // global defined more than once
-    {
-      MemberNameIterator it(*mn);
-      MemberDef *md;
-      for (;(md=it.current());++it)
-      {
-       //printf("mn=%p md=%p md->getBodyDef()=%p g_sourceFileDef=%p\n",
-       //    mn,md,
-       //    md->getBodyDef(),g_sourceFileDef);
-
-       // in case there are multiple members we could link to, we 
-       // only link to members if defined in the same file or 
-       // defined as external.
-        if ((!md->isStatic() || md->getBodyDef()==g_sourceFileDef) &&
-           (g_forceTagReference.isEmpty() || g_forceTagReference==md->getReference())
-          )
-        {
-          g_theCallContext.setScope(stripClassName(md->typeString(),md->getOuterScope()));
-         //printf("returning member %s in source file %s\n",md->name().data(),g_sourceFileDef->name().data());
-          return md;
-        }
-      }
-      return 0;
-    }
-  }
-  return 0;
-}
-
-static void updateCallContextForSmartPointer()
-{
-  const Definition *d = g_theCallContext.getScope();
-  //printf("updateCallContextForSmartPointer() cd=%s\n",cd ? d->name().data() : "<none>");
-  MemberDef *md;
-  if (d && d->definitionType()==Definition::TypeClass && (md=(dynamic_cast<const ClassDef*>(d))->isSmartPointer()))
-  {
-    const ClassDef *ncd = stripClassName(md->typeString(),md->getOuterScope());
-    if (ncd)
-    {
-      g_theCallContext.setScope(ncd);
-      //printf("Found smart pointer call %s->%s!\n",cd->name().data(),ncd->name().data());
-    }
-  }
-}
+                                         DBG_CTX((stderr,"yyextra->bodyCurlyCount=%d\n",yyextra->bodyCurlyCount));
+                                         if (--yyextra->bodyCurlyCount<=0)
+                                         {
+                                           yyextra->insideBody=FALSE;
+                                           yyextra->currentMemberDef=0;
+                                           if (yyextra->currentDefinition) 
+                                             yyextra->currentDefinition=yyextra->currentDefinition->getOuterScope();
+                                         }
+                                         BEGIN(Body);
+                                       }
+<Body,ClassVar>"@end"                  { 
+                                         //printf("End of objc scope fd=%s\n",yyextra->sourceFileDef->name().data());
+                                          if (yyextra->sourceFileDef)
+                                         {
+                                           FileDef *fd=yyextra->sourceFileDef;
+                                            yyextra->insideObjC = fd->name().lower().right(2)==".m" || 
+                                                           fd->name().lower().right(3)==".mm"; 
+                                           //printf("insideObjC=%d\n",yyextra->insideObjC);
+                                         }
+                                         else
+                                         {
+                                           yyextra->insideObjC = FALSE;
+                                         }
+                                         if (yyextra->insideBody)
+                                         {
+                                            yyextra->theVarContext.popScope();
 
-static bool getLinkInScope(const QCString &c,  // scope
-                           const QCString &m,  // member
-                          const char *memberText, // exact text
-                          CodeOutputInterface &ol,
-                          const char *text,
-                          bool varOnly=FALSE
-                         )
-{
-  const MemberDef    *md = 0;
-  const ClassDef     *cd = 0;
-  const FileDef      *fd = 0;
-  const NamespaceDef *nd = 0;
-  const GroupDef     *gd = 0;
-  DBG_CTX((stderr,"getLinkInScope: trying '%s'::'%s' varOnly=%d\n",c.data(),m.data(),varOnly));
-  if (getDefs(c,m,"()",md,cd,fd,nd,gd,FALSE,g_sourceFileDef,FALSE,g_forceTagReference) && 
-      (!varOnly || md->isVariable()))
-  {
-    if (md->isLinkable())
-    {
-      //printf("found it %s!\n",md->qualifiedName().data());
-      if (g_exampleBlock)
-      {
-        QCString anchor;
-        anchor.sprintf("a%d",g_anchorCount);
-        //printf("addExampleFile(%s,%s,%s)\n",anchor.data(),g_exampleName.data(),
-        //                                  g_exampleFile.data());
-        if (const_cast<MemberDef*>(md)->addExample(anchor,g_exampleName,g_exampleFile))
-        {
-          ol.writeCodeAnchor(anchor);
-          g_anchorCount++;
-        }
-      }
+                                           int *scope = yyextra->scopeStack.pop();
+                                            DBG_CTX((stderr,"** scope stack pop SCOPEBLOCK=%d\n",scope==SCOPEBLOCK));
+                                           if (scope==SCOPEBLOCK || scope==CLASSBLOCK) 
+                                           {
+                                             popScope(yyscanner);
+                                           }
+                                           yyextra->insideBody=FALSE;
+                                         }
 
-      const Definition *d = md->getOuterScope()==Doxygen::globalScope ?
-                            md->resolveAlias()->getFileDef() : md->getOuterScope();
-      if (md->resolveAlias()->getGroupDef()) d = md->resolveAlias()->getGroupDef();
-      if (d && d->isLinkable())
-      {
-        g_theCallContext.setScope(stripClassName(md->typeString(),md->getOuterScope()));
-        //printf("g_currentDefinition=%p g_currentMemberDef=%p g_insideBody=%d\n",
-        //        g_currentDefinition,g_currentMemberDef,g_insideBody);
+                                         startFontClass(yyscanner,"keyword");
+                                         yyextra->code->codify(yytext);
+                                         endFontClass(yyscanner);
 
-        if (g_currentDefinition && g_currentMemberDef &&
-            md!=g_currentMemberDef && g_insideBody && g_collectXRefs)
-        {
-          addDocCrossReference(g_currentMemberDef,const_cast<MemberDef*>(md));
-        }
-        //printf("d->getReference()='%s' d->getOutputBase()='%s' name='%s' member name='%s'\n",d->getReference().data(),d->getOutputFileBase().data(),d->name().data(),md->name().data());
-
-        writeMultiLineCodeLink(ol,md, text ? text : memberText);
-        addToSearchIndex(text ? text : memberText);
-        return TRUE;
-      }
-    }
-    else // found member, but it is not linkable, so make sure content inside is not assigned
-         // to the previous member, see bug762760
-    {
-      DBG_CTX((stderr,"unlinkable member %s\n",md->name().data()));
-      g_currentMemberDef = 0;
-    }
-  }
-  return FALSE;
-}
-
-static bool getLink(const char *className,
-                    const char *memberName,
-                   CodeOutputInterface &ol,
-                   const char *text=0,
-                   bool varOnly=FALSE)
-{
-  //printf("getLink(%s,%s) g_curClassName=%s\n",className,memberName,g_curClassName.data());
-  QCString m=removeRedundantWhiteSpace(memberName);
-  QCString c=className;
-  if (!getLinkInScope(c,m,memberName,ol,text,varOnly))
-  {
-    if (!g_curClassName.isEmpty())
-    {
-      if (!c.isEmpty()) c.prepend("::");
-      c.prepend(g_curClassName);
-      return getLinkInScope(c,m,memberName,ol,text,varOnly);
-    }
-    return FALSE;
-  }
-  return TRUE;
-}
-
-static void generateClassOrGlobalLink(CodeOutputInterface &ol,const char *clName,
-                                      bool typeOnly=FALSE,bool varOnly=FALSE)
-{
-  int i=0;
-  if (*clName=='~') // correct for matching negated values i.s.o. destructors.
-  {
-    g_code->codify("~");
-    clName++;
-  }
-  QCString className=clName;
-  if (className.isEmpty()) return;
-  if (g_insideProtocolList) // for Obj-C
-  {
-    className+="-p";
-  }
-  if (g_insidePHP)
-  {
-    className = substitute(className,"\\","::"); // for PHP namespaces
-  }
-  else if (g_insideCS || g_insideJava)
-  {
-    className = substitute(className,".","::"); // for PHP namespaces
-  }
-  const ClassDef *cd=0,*lcd=0;
-  const MemberDef *md=0;
-  bool isLocal=FALSE;
-
-  //printf("generateClassOrGlobalLink(className=%s)\n",className.data());
-  if (!g_prefixed_with_this_keyword || (lcd=g_theVarContext.findVariable(className))==0) // not a local variable
-  {
-    Definition *d = g_currentDefinition;
-    //printf("d=%s g_sourceFileDef=%s\n",d?d->name().data():"<none>",g_sourceFileDef?g_sourceFileDef->name().data():"<none>");
-    cd = getResolvedClass(d,g_sourceFileDef,className,&md);
-    DBG_CTX((stderr,"non-local variable name=%s context=%d cd=%s md=%s!\n",
-    className.data(),g_theVarContext.count(),cd?cd->name().data():"<none>",
-        md?md->name().data():"<none>"));
-    if (cd==0 && md==0 && (i=className.find('<'))!=-1)
-    {
-      QCString bareName = className.left(i); //stripTemplateSpecifiersFromScope(className);
-      DBG_CTX((stderr,"bareName=%s\n",bareName.data()));
-      if (bareName!=className)
-      {
-       cd=getResolvedClass(d,g_sourceFileDef,bareName,&md); // try unspecialized version
-      }
-    }
-    const NamespaceDef *nd = getResolvedNamespace(className);
-    if (nd && nd->isLinkableInProject())
-    {
-      g_theCallContext.setScope(nd);
-      addToSearchIndex(className);
-      writeMultiLineCodeLink(*g_code,nd,clName);
-      return;
-    }
-    //printf("md=%s\n",md?md->name().data():"<none>");
-    DBG_CTX((stderr,"is found as a type cd=%s nd=%s\n",
-          cd?cd->name().data():"<null>",
-          nd?nd->name().data():"<null>"));
-    if (cd==0 && md==0) // also see if it is variable or enum or enum value
-    {
-      if (getLink(g_classScope,clName,ol,clName,varOnly))
-      {
-       return;
-      }
-    }
-  }
-  else
-  {
-    //printf("local variable!\n");
-    if (lcd!=VariableContext::dummyContext) 
-    {
-      //printf("non-dummy context lcd=%s!\n",lcd->name().data());
-      g_theCallContext.setScope(lcd);
-
-      // to following is needed for links to a global variable, but is
-      // no good for a link to a local variable that is also a global symbol.
-       
-      //if (getLink(g_classScope,clName,ol,clName))
-      //{
-       //return;
-      //}
-    }
-    isLocal=TRUE;
-    DBG_CTX((stderr,"is a local variable cd=%p!\n",cd));
-  }
-  g_prefixed_with_this_keyword = FALSE; // discard the "this" prefix for the next calls
-
-  if (cd && cd->isLinkable()) // is it a linkable class
-  {
-    DBG_CTX((stderr,"is linkable class %s\n",clName));
-    if (g_exampleBlock)
-    {
-      QCString anchor;
-      anchor.sprintf("_a%d",g_anchorCount);
-      //printf("addExampleClass(%s,%s,%s)\n",anchor.data(),g_exampleName.data(),
-      //                                   g_exampleFile.data());
-      if (const_cast<ClassDef*>(cd)->addExample(anchor,g_exampleName,g_exampleFile))
-      {
-       ol.writeCodeAnchor(anchor);
-       g_anchorCount++;
-      }
-    }
-    writeMultiLineCodeLink(ol,cd,clName);
-    addToSearchIndex(className);
-    g_theCallContext.setScope(cd);
-    if (md)
-    {
-      const Definition *d = md->getOuterScope()==Doxygen::globalScope ?
-                      md->getFileDef() : md->getOuterScope();
-      if (md->getGroupDef()) d = md->getGroupDef();
-      if (d && d->isLinkable() && md->isLinkable() && 
-          g_currentMemberDef && g_collectXRefs)
-      {
-        addDocCrossReference(g_currentMemberDef,const_cast<MemberDef*>(md));
-      }
-    }
-  }
-  else // not a class, maybe a global member
-  {
-    DBG_CTX((stderr,"class %s not linkable! cd=%p md=%p typeOnly=%d\n",clName,cd,md,typeOnly));
-    if (!isLocal && (md!=0 || (cd==0 && !typeOnly))) // not a class, see if it is a global enum/variable/typedef.
-    {
-      if (md==0) // not found as a typedef
-      {
-       md = setCallContextForVar(clName);
-       //printf("setCallContextForVar(%s) md=%p g_currentDefinition=%p\n",clName,md,g_currentDefinition);
-       if (md && g_currentDefinition)
-       {
-         DBG_CTX((stderr,"%s accessible from %s? %d md->getOuterScope=%s\n",
-             md->name().data(),g_currentDefinition->name().data(),
-             isAccessibleFrom(g_currentDefinition,g_sourceFileDef,md),
-             md->getOuterScope()->name().data()));
-       }
-            
-        if (md && g_currentDefinition && 
-           isAccessibleFrom(g_currentDefinition,g_sourceFileDef,md)==-1)
-       {
-         md=0; // variable not accessible
-       }
-      }
-      if (md && (!varOnly || md->isVariable()))
-      {
-        DBG_CTX((stderr,"is a global md=%p g_currentDefinition=%s linkable=%d\n",md,g_currentDefinition?g_currentDefinition->name().data():"<none>",md->isLinkable()));
-       if (md->isLinkable())
-       {
-         QCString text;
-         if (!g_forceTagReference.isEmpty()) // explicit reference to symbol in tag file
-         {
-           text=g_forceTagReference;
-           if (text.right(4)==".tag") // strip .tag if present
-           {
-             text=text.left(text.length()-4);
-           }
-           text+=getLanguageSpecificSeparator(md->getLanguage());
-           text+=clName;
-           const_cast<MemberDef*>(md)->setName(text);
-            const_cast<MemberDef*>(md)->setLocalName(text);
-         }
-         else // normal reference
-         {
-           text=clName;
-         }
-         writeMultiLineCodeLink(ol,md,text);
-          addToSearchIndex(clName);
-         if (g_currentMemberDef && g_collectXRefs)
-         {
-           addDocCrossReference(g_currentMemberDef,const_cast<MemberDef*>(md));
-         }
-         return;
-       }
-      }
-    }
-    
-    // nothing found, just write out the word
-    DBG_CTX((stderr,"not found!\n"));
-    codifyLines(clName);
-    addToSearchIndex(clName);
-  }
-}
-
-static bool generateClassMemberLink(CodeOutputInterface &ol,MemberDef *xmd,const char *memName)
-{
-  // extract class definition of the return type in order to resolve
-  // a->b()->c() like call chains
-
-  //printf("type='%s' args='%s' class=%s\n",
-  //  xmd->typeString(),xmd->argsString(),
-  //  xmd->getClassDef()->name().data());
-
-  if (g_exampleBlock)
-  {
-    QCString anchor;
-    anchor.sprintf("a%d",g_anchorCount);
-    //printf("addExampleFile(%s,%s,%s)\n",anchor.data(),g_exampleName.data(),
-    //                                  g_exampleFile.data());
-    if (xmd->addExample(anchor,g_exampleName,g_exampleFile))
-    {
-      ol.writeCodeAnchor(anchor);
-      g_anchorCount++;
-    }
-  }
-
-  const ClassDef *typeClass = stripClassName(removeAnonymousScopes(xmd->typeString()),xmd->getOuterScope());
-  DBG_CTX((stderr,"%s -> typeName=%p\n",xmd->typeString(),typeClass));
-  g_theCallContext.setScope(typeClass);
-
-  const Definition *xd = xmd->getOuterScope()==Doxygen::globalScope ?
-                   xmd->getFileDef() : xmd->getOuterScope();
-  if (xmd->getGroupDef()) xd = xmd->getGroupDef();
-  if (xd && xd->isLinkable())
-  {
-
-    //printf("g_currentDefiniton=%p g_currentMemberDef=%p xmd=%p g_insideBody=%d\n",g_currentDefinition,g_currentMemberDef,xmd,g_insideBody);
-
-    if (xmd->templateMaster()) xmd = xmd->templateMaster();
-
-    if (xmd->isLinkable())
-    {
-      // add usage reference
-      if (g_currentDefinition && g_currentMemberDef &&
-         /*xmd!=g_currentMemberDef &&*/ g_insideBody && g_collectXRefs)
-      {
-       addDocCrossReference(g_currentMemberDef,xmd);
-      }
-
-      // write the actual link
-      writeMultiLineCodeLink(ol,xmd,memName);
-      addToSearchIndex(memName);
-      return TRUE;
-    }
-  }
-
-  return FALSE;
-}
-
-static bool generateClassMemberLink(CodeOutputInterface &ol,const Definition *def,const char *memName)
-{
-  if (def && def->definitionType()==Definition::TypeClass)
-  {
-    const ClassDef *cd = dynamic_cast<const ClassDef*>(def);
-    MemberDef *xmd = cd->getMemberByName(memName);
-    //printf("generateClassMemberLink(class=%s,member=%s)=%p\n",def->name().data(),memName,xmd);
-    if (xmd)
-    {
-      return generateClassMemberLink(ol,xmd,memName);
-    }
-    else
-    {
-      Definition *innerDef = cd->findInnerCompound(memName);
-      if (innerDef)
-      {
-        g_theCallContext.setScope(innerDef);
-        addToSearchIndex(memName);
-        writeMultiLineCodeLink(*g_code,innerDef,memName);
-        return TRUE;
-      }
-    }
-  }
-  else if (def && def->definitionType()==Definition::TypeNamespace)
-  {
-    const NamespaceDef *nd = dynamic_cast<const NamespaceDef*>(def);
-    //printf("Looking for %s inside namespace %s\n",memName,nd->name().data());
-    Definition *innerDef = nd->findInnerCompound(memName);
-    if (innerDef)
-    {
-      g_theCallContext.setScope(innerDef);
-      addToSearchIndex(memName);
-      writeMultiLineCodeLink(*g_code,innerDef,memName);
-      return TRUE;
-    }
-  }
-  return FALSE;
-}
-
-static void generateMemberLink(CodeOutputInterface &ol,const QCString &varName,
-            char *memName)
-{
-  //printf("generateMemberLink(object=%s,mem=%s) classScope=%s\n",
-  //    varName.data(),memName,g_classScope.data());
-
-  if (varName.isEmpty()) return;
-
-  // look for the variable in the current context
-  const ClassDef *vcd = g_theVarContext.findVariable(varName);
-  if (vcd) 
-  {
-    if (vcd!=VariableContext::dummyContext)
-    {
-      //printf("Class found!\n");
-      if (getLink(vcd->name(),memName,ol)) 
-      {
-       //printf("Found result!\n");
-       return;
-      }
-      if (vcd->baseClasses())
-      {
-       BaseClassListIterator bcli(*vcd->baseClasses());
-       for ( ; bcli.current() ; ++bcli)
-       {
-         if (getLink(bcli.current()->classDef->name(),memName,ol)) 
-         {
-           //printf("Found result!\n");
-           return;
-         }
-       }
-      }
-    }
-  }
-  else // variable not in current context, maybe it is in a parent context
-  {
-    vcd = getResolvedClass(g_currentDefinition,g_sourceFileDef,g_classScope);
-    if (vcd && vcd->isLinkable())
-    {
-      //printf("Found class %s for variable '%s'\n",g_classScope.data(),varName.data());
-      MemberName *vmn=Doxygen::memberNameSDict->find(varName);
-      if (vmn==0)
-      {
-       int vi;
-       QCString vn=varName;
-       if ((vi=vn.findRev("::"))!=-1 || (vi=vn.findRev('.'))!=-1)  // explicit scope A::b(), probably static member
-       {
-         ClassDef *jcd = getClass(vn.left(vi));
-         vn=vn.right(vn.length()-vi-2);
-         vmn=Doxygen::memberNameSDict->find(vn);
-         //printf("Trying name '%s' scope=%s\n",vn.data(),scope.data());
-         if (vmn)
-         {
-           MemberNameIterator vmni(*vmn);
-           const MemberDef *vmd;
-           for (;(vmd=vmni.current());++vmni)
-           {
-             if (/*(vmd->isVariable() || vmd->isFunction()) && */
-                 vmd->getClassDef()==jcd)
-             {
-               //printf("Found variable type=%s\n",vmd->typeString());
-               const ClassDef *mcd=stripClassName(vmd->typeString(),vmd->getOuterScope());
-               if (mcd && mcd->isLinkable())
-               {
-                 if (generateClassMemberLink(ol,mcd,memName)) return;
-               }
-             }
-           }
-         }
-       }
-      }
-      if (vmn)
-      {
-       //printf("There is a variable with name '%s'\n",varName);
-       MemberNameIterator vmni(*vmn);
-       const MemberDef *vmd;
-       for (;(vmd=vmni.current());++vmni)
-       {
-         if (/*(vmd->isVariable() || vmd->isFunction()) && */
-             vmd->getClassDef()==vcd)
-         {
-           //printf("Found variable type=%s\n",vmd->typeString());
-           const ClassDef *mcd=stripClassName(vmd->typeString(),vmd->getOuterScope());
-           if (mcd && mcd->isLinkable())
-           {
-             if (generateClassMemberLink(ol,mcd,memName)) return;
-           }
-         }
-       }
-      }
-    }
-  }
-  // nothing found -> write result as is
-  codifyLines(memName);
-  addToSearchIndex(memName);
-  return;
-}
-
-static void generatePHPVariableLink(CodeOutputInterface &ol,const char *varName)
-{
-  QCString name = varName+7; // strip $this->
-  name.prepend("$");
-  //printf("generatePHPVariableLink(%s) name=%s scope=%s\n",varName,name.data(),g_classScope.data());
-  if (!getLink(g_classScope,name,ol,varName))
-  {
-    codifyLines(varName);
-  }
-}
-
-static void generateFunctionLink(CodeOutputInterface &ol,const char *funcName)
-{
-  //CodeClassDef *ccd=0;
-  ClassDef *ccd=0;
-  QCString locScope=g_classScope;
-  QString qq=removeRedundantWhiteSpace(funcName);
-  if (g_insidePHP && qq.startsWith("self::")) qq=qq.mid(4);
-  QCString locFunc(qq.data());
-  QCString funcScope;
-  QCString funcWithScope=locFunc;
-  QCString funcWithFullScope=locFunc;
-  QCString fullScope=locScope;
-  DBG_CTX((stdout,"*** locScope=%s locFunc=%s\n",locScope.data(),locFunc.data()));
-  int len=2;
-  int i=locFunc.findRev("::");
-  if (g_currentMemberDef && g_currentMemberDef->resolveAlias()->getClassDef() &&
-      funcName==g_currentMemberDef->localName() && 
-      g_currentMemberDef->getDefLine()==g_yyLineNr &&
-      generateClassMemberLink(ol,g_currentMemberDef,funcName)
-     )
-  {
-    // special case where funcName is the name of a method that is also
-    // defined on this line. In this case we can directly link to 
-    // g_currentMemberDef, which is not only faster, but
-    // in case of overloaded methods, this will make sure that we link to
-    // the correct method, and thereby get the correct reimplemented relations.
-    // See also bug 549022.
-    goto exit;
-  }
-  if (i==-1) i=locFunc.findRev("."),len=1;
-  if (i==-1) i=locFunc.findRev("\\"),len=1; // for PHP
-  if (i>0)
-  {
-    funcScope=locFunc.left(i);
-    locFunc=locFunc.right(locFunc.length()-i-len).stripWhiteSpace();
-    int ts=locScope.find('<'); // start of template
-    int te=locScope.findRev('>'); // end of template
-    //printf("ts=%d te=%d\n",ts,te);
-    if (ts!=-1 && te!=-1 && te>ts)
-    {
-      // remove template from scope
-      locScope=locScope.left(ts)+locScope.right(locScope.length()-te-1);
-    }
-    ts=funcScope.find('<'); // start of template
-    te=funcScope.findRev('>'); // end of template
-    //printf("ts=%d te=%d\n",ts,te);
-    if (ts!=-1 && te!=-1 && te>ts)
-    {
-      // remove template from scope
-      funcScope=funcScope.left(ts)+funcScope.right(funcScope.length()-te-1);
-    }
-    if (!funcScope.isEmpty())
-    {
-      funcWithScope = funcScope+"::"+locFunc;
-      if (!locScope.isEmpty())
-      {
-        fullScope=locScope+"::"+funcScope;
-      }
-    }
-    if (!locScope.isEmpty())
-    {
-      funcWithFullScope = locScope+"::"+funcWithScope;
-    }
-  }
-  if (!fullScope.isEmpty() && (ccd=g_codeClassSDict->find(fullScope)))
-  {
-    //printf("using classScope %s\n",g_classScope.data());
-    if (ccd->baseClasses())
-    {
-      BaseClassListIterator bcli(*ccd->baseClasses());
-      for ( ; bcli.current() ; ++bcli)
-      {
-       if (getLink(bcli.current()->classDef->name(),locFunc,ol,funcName)) 
-       {
-         goto exit;
-       }
-      }
-    }
-  }
-  if (!locScope.isEmpty() && fullScope!=locScope && (ccd=g_codeClassSDict->find(locScope)))
-  {
-    //printf("using classScope %s\n",g_classScope.data());
-    if (ccd->baseClasses())
-    {
-      BaseClassListIterator bcli(*ccd->baseClasses());
-      for ( ; bcli.current() ; ++bcli)
-      {
-       if (getLink(bcli.current()->classDef->name(),funcWithScope,ol,funcName)) 
-       {
-         goto exit;
-       }
-      }
-    }
-  }
-  if (!getLink(locScope,funcWithScope,ol,funcName))
-  {
-    generateClassOrGlobalLink(ol,funcName);
-  }
-exit:  
-  g_forceTagReference.resize(0);
-  return;
-}
-
-/*! counts the number of lines in the input */
-static int countLines()
-{
-  const char *p=g_inputString;
-  char c;
-  int count=1;
-  while ((c=*p)) 
-  { 
-    p++ ; 
-    if (c=='\n') count++;  
-  }
-  if (p>g_inputString && *(p-1)!='\n') 
-  { // last line does not end with a \n, so we add an extra
-    // line and explicitly terminate the line after parsing.
-    count++, 
-    g_needsTermination=TRUE; 
-  } 
-  return count;
-}
-
-static void endFontClass()
-{
-  if (g_currentFontClass)
-  {
-    g_code->endFontClass();
-    g_currentFontClass=0;
-  }
-}
-
-static void startFontClass(const char *s)
-{
-  endFontClass();
-  g_code->startFontClass(s);
-  g_currentFontClass=s;
-}
-
-//----------------------------------------------------------------------------
-
-// recursively writes a linkified Objective-C method call
-static void writeObjCMethodCall(ObjCCallCtx *ctx)
-{
-  if (ctx==0) return;
-  char c;
-  const char *p = ctx->format.data();
-  if (!ctx->methodName.isEmpty())
-  {
-    //printf("writeObjCMethodCall(%s) obj=%s method=%s\n",
-    //    ctx->format.data(),ctx->objectTypeOrName.data(),ctx->methodName.data());
-    if (!ctx->objectTypeOrName.isEmpty() && ctx->objectTypeOrName.at(0)!='$')
-    {
-      //printf("Looking for object=%s method=%s\n",ctx->objectTypeOrName.data(),
-      //       ctx->methodName.data());
-      ClassDef *cd = g_theVarContext.findVariable(ctx->objectTypeOrName);
-      if (cd==0) // not a local variable
-      {
-       if (ctx->objectTypeOrName=="self")
-       {
-         if (g_currentDefinition && 
-             g_currentDefinition->definitionType()==Definition::TypeClass)
-         {
-           ctx->objectType = dynamic_cast<ClassDef *>(g_currentDefinition);
-         }
-       }
-       else
-       {
-         ctx->objectType = getResolvedClass(
-             g_currentDefinition,
-             g_sourceFileDef,
-             ctx->objectTypeOrName,
-             &ctx->method);
-       }
-       //printf("  object is class? %p\n",ctx->objectType);
-       if (ctx->objectType) // found class
-       {
-         ctx->method = ctx->objectType->getMemberByName(ctx->methodName);
-         //printf("    yes->method=%s\n",ctx->method?ctx->method->name().data():"<none>");
-       }
-       else if (ctx->method==0) // search for class variable with the same name
-       {
-         //printf("    no\n");
-         //printf("g_currentDefinition=%p\n",g_currentDefinition);
-         if (g_currentDefinition && 
-             g_currentDefinition->definitionType()==Definition::TypeClass)
-         {
-           ctx->objectVar = (dynamic_cast<ClassDef *>(g_currentDefinition))->getMemberByName(ctx->objectTypeOrName);
-           //printf("      ctx->objectVar=%p\n",ctx->objectVar);
-           if (ctx->objectVar)
-           {
-             ctx->objectType = stripClassName(ctx->objectVar->typeString());
-             //printf("        ctx->objectType=%p\n",ctx->objectType);
-             if (ctx->objectType && !ctx->methodName.isEmpty())
-             {
-               ctx->method = ctx->objectType->getMemberByName(ctx->methodName);
-               //printf("          ctx->method=%p\n",ctx->method);
-             }
-           }
-         }
-       }
-      }
-      else // local variable
-      {
-       //printf("  object is local variable\n");
-       if (cd!=VariableContext::dummyContext && !ctx->methodName.isEmpty())
-       {
-         ctx->method = cd->getMemberByName(ctx->methodName);
-         //printf("   class=%p method=%p\n",cd,ctx->method);
-       }
-      }
-    }
-  }
-
-  //printf("[");
-  while ((c=*p++)) // for each character in ctx->format
-  {
-    if (c=='$')
-    {
-      char nc=*p++;
-      if (nc=='$') // escaped $
-      {
-       g_code->codify("$");
-      }
-      else // name fragment or reference to a nested call 
-      {
-       if (nc=='n') // name fragment
-       {
-          nc=*p++;
-         QCString refIdStr;
-         while (nc!=0 && isdigit(nc)) { refIdStr+=nc; nc=*p++; }
-         p--;
-         int refId=refIdStr.toInt();
-         QCString *pName = g_nameDict.find(refId);
-         if (pName)
-         {
-           if (ctx->method && ctx->method->isLinkable())
-           {
-              writeMultiLineCodeLink(*g_code,ctx->method,pName->data());
-             if (g_currentMemberDef && g_collectXRefs)
-             {
-               addDocCrossReference(g_currentMemberDef,const_cast<MemberDef*>(ctx->method));
-             }
-           }
-           else
-           {
-             codifyLines(pName->data());
-           }
-         }
-         else
-         {
-           //printf("Invalid name: id=%d\n",refId);
-         }
-       }
-       else if (nc=='o') // reference to potential object name
-       {
-          nc=*p++;
-         QCString refIdStr;
-         while (nc!=0 && isdigit(nc)) { refIdStr+=nc; nc=*p++; }
-         p--;
-         int refId=refIdStr.toInt();
-         QCString *pObject = g_objectDict.find(refId);
-         if (pObject)
-         {
-           if (*pObject=="self")
-           {
-             if (g_currentDefinition && 
-                 g_currentDefinition->definitionType()==Definition::TypeClass)
-             {
-               ctx->objectType = dynamic_cast<ClassDef *>(g_currentDefinition);
-               if (ctx->objectType->categoryOf()) 
-               {
-                 ctx->objectType = ctx->objectType->categoryOf();
-               }
-               if (ctx->objectType && !ctx->methodName.isEmpty())
-               {
-                 ctx->method = ctx->objectType->getMemberByName(ctx->methodName);
-               }
-             }
-             startFontClass("keyword");
-              codifyLines(pObject->data());
-             endFontClass();
-           }
-           else if (*pObject=="super")
-           {
-             if (g_currentDefinition &&
-                 g_currentDefinition->definitionType()==Definition::TypeClass)
-             {
-               ClassDef *cd = dynamic_cast<ClassDef *>(g_currentDefinition);
-               if (cd->categoryOf()) 
-               {
-                 cd = cd->categoryOf();
-               }
-               BaseClassList *bcd = cd->baseClasses();
-               if (bcd) // get direct base class (there should be only one)
-               {
-                 BaseClassListIterator bli(*bcd);
-                 BaseClassDef *bclass;
-                 for (bli.toFirst();(bclass=bli.current());++bli)
-                 {
-                   if (bclass->classDef->compoundType()!=ClassDef::Protocol)
-                   {
-                     ctx->objectType = bclass->classDef;
-                     if (ctx->objectType && !ctx->methodName.isEmpty())
-                     {
-                       ctx->method = ctx->objectType->getMemberByName(ctx->methodName);
-                     }
-                   }
-                 }
-               }
-             }
-             startFontClass("keyword");
-              codifyLines(pObject->data());
-             endFontClass();
-           }
-           else if (ctx->objectVar && ctx->objectVar->isLinkable()) // object is class variable
-           {
-             writeMultiLineCodeLink(*g_code,ctx->objectVar,pObject->data());
-             if (g_currentMemberDef && g_collectXRefs)
-             {
-               addDocCrossReference(g_currentMemberDef,const_cast<MemberDef*>(ctx->objectVar));
-             }
-           }
-           else if (ctx->objectType && 
-                    ctx->objectType!=VariableContext::dummyContext && 
-                    ctx->objectType->isLinkable()
-                   ) // object is class name
-           {
-             const ClassDef *cd = ctx->objectType;
-             writeMultiLineCodeLink(*g_code,cd,pObject->data());
-           }
-           else // object still needs to be resolved
-           {
-             const ClassDef *cd = getResolvedClass(g_currentDefinition, 
-                 g_sourceFileDef, *pObject);
-             if (cd && cd->isLinkable())
-             {
-               if (ctx->objectType==0) ctx->objectType=cd;
-               writeMultiLineCodeLink(*g_code,cd,pObject->data());
-             }
-             else
-             {
-               codifyLines(pObject->data());
-             }
-           }
-         }
-         else
-         {
-           //printf("Invalid object: id=%d\n",refId);
-         }
-       }
-       else if (nc=='c') // reference to nested call
-       {
-          nc=*p++;
-         QCString refIdStr;
-         while (nc!=0 && isdigit(nc)) { refIdStr+=nc; nc=*p++; }
-         p--;
-         int refId=refIdStr.toInt();
-         ObjCCallCtx *ictx = g_contextDict.find(refId);
-         if (ictx) // recurse into nested call
-         {
-           writeObjCMethodCall(ictx);
-           if (ictx->method) // link to nested call successfully
-           {
-             // get the ClassDef representing the method's return type
-             if (QCString(ictx->method->typeString())=="id")
-             {
-               // see if the method name is unique, if so we link to it
-               MemberName *mn=Doxygen::memberNameSDict->find(ctx->methodName);
-               //printf("mn->count=%d ictx->method=%s ctx->methodName=%s\n",
-               //    mn==0?-1:(int)mn->count(),
-               //    ictx->method->name().data(),
-               //    ctx->methodName.data());
-               if (mn && mn->count()==1) // member name unique
-               {
-                 ctx->method = mn->getFirst();
-               }
-             } 
-             else
-             {
-               ctx->objectType = stripClassName(ictx->method->typeString());
-               if (ctx->objectType && !ctx->methodName.isEmpty())
-               {
-                 ctx->method = ctx->objectType->getMemberByName(ctx->methodName);
-               }
-             }
-             //printf("  ***** method=%s -> object=%p\n",ictx->method->name().data(),ctx->objectType);
-           }
-         }
-         else
-         {
-           //printf("Invalid context: id=%d\n",refId);
-         }
-       }
-       else if (nc=='w') // some word
-       {
-          nc=*p++;
-         QCString refIdStr;
-         while (nc!=0 && isdigit(nc)) { refIdStr+=nc; nc=*p++; }
-         p--;
-         int refId=refIdStr.toInt();
-         QCString *pWord = g_wordDict.find(refId);
-         if (pWord)
-         {
-            codifyLines(pWord->data());
-         }
-       }
-        else if (nc=='d') // comment block
-        {
-          nc=*p++;
-         QCString refIdStr;
-         while (nc!=0 && isdigit(nc)) { refIdStr+=nc; nc=*p++; }
-         p--;
-         int refId=refIdStr.toInt();
-         QCString *pComment = g_commentDict.find(refId);
-          if (pComment)
-          {
-            startFontClass("comment");
-           codifyLines(pComment->data());
-           endFontClass();
-          }
-        }
-       else // illegal marker
-       {
-         ASSERT(!"invalid escape sequence");
-       }
-      }
-    }
-    else // normal non-marker character
-    {
-      char s[2];
-      s[0]=c;s[1]=0;
-      codifyLines(s);
-    }
-  }
-  //printf("%s %s]\n",ctx->objectTypeOrName.data(),ctx->methodName.data());
-  //printf("}=(type='%s',name='%s')",
-  //    ctx->objectTypeOrName.data(),
-  //    ctx->methodName.data());
-}
-
-// Replaces an Objective-C method name fragment s by a marker of the form
-// $n12, the number (12) can later be used as a key for obtaining the name 
-// fragment, from g_nameDict
-static QCString escapeName(const char *s)
-{
-  QCString result;
-  result.sprintf("$n%d",g_currentNameId);
-  g_nameDict.insert(g_currentNameId,new QCString(s));
-  g_currentNameId++;
-  return result;
-}
-
-static QCString escapeObject(const char *s)
-{
-  QCString result;
-  result.sprintf("$o%d",g_currentObjId);
-  g_objectDict.insert(g_currentObjId,new QCString(s));
-  g_currentObjId++;
-  return result;
-}
-
-static QCString escapeWord(const char *s)
-{
-  QCString result;
-  result.sprintf("$w%d",g_currentWordId);
-  g_wordDict.insert(g_currentWordId,new QCString(s));
-  g_currentWordId++;
-  return result;
-}
-
-static QCString escapeComment(const char *s)
-{
-  QCString result;
-  result.sprintf("$d%d",g_currentCommentId);
-  g_commentDict.insert(g_currentCommentId,new QCString(s));
-  g_currentCommentId++;
-  return result;
-}
-
-static bool skipLanguageSpecificKeyword(const QCString &kw)
-{
-  return g_insideCpp && (kw == "remove" || kw == "set" || kw == "get");
-}
-
-/* -----------------------------------------------------------------
- */
-#undef YY_INPUT
-#define        YY_INPUT(buf,result,max_size) result=yyread(buf,max_size);
-
-static int yyread(char *buf,int max_size)
-{
-    int c=0;
-    while( c < max_size && g_inputString[g_inputPosition] )
-    {
-       *buf = g_inputString[g_inputPosition++] ;
-       c++; buf++;
-    }
-    return c;
-}
-
-%}
-
-B       [ \t]
-BN      [ \t\n\r]
-ID     "$"?[a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]*
-SEP     ("::"|"\\")
-SCOPENAME ({SEP}{BN}*)?({ID}{BN}*{SEP}{BN}*)*("~"{BN}*)?{ID}
-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"|"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"|"byte"|"char"|"double"|"float"|"int"|"long"|"object"|"short"|"signed"|"unsigned"|"void"|"wchar_t"|"size_t"|"boolean"|"id"|"SEL"|"string"|"nullptr")
-TYPEKWSL ("LocalObject"|"Object"|"Value")
-CASTKW ("const_cast"|"dynamic_cast"|"reinterpret_cast"|"static_cast")
-CHARLIT   (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^' \\\n]{1,4}"'"))
-ARITHOP "+"|"-"|"/"|"*"|"%"|"--"|"++"
-ASSIGNOP "="|"*="|"/="|"%="|"+="|"-="|"<<="|">>="|"&="|"^="|"|="
-LOGICOP "=="|"!="|">"|"<"|">="|"<="|"&&"|"||"|"!"
-BITOP   "&"|"|"|"^"|"<<"|">>"|"~"
-OPERATOR {ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}
-RAWBEGIN  (u|U|L|u8)?R\"[^ \t\(\)\\]{0,16}"("
-RAWEND    ")"[^ \t\(\)\\]{0,16}\"
-
-%option noyywrap
-
-%x      SkipString
-%x      SkipStringS
-%x      SkipVerbString
-%x     SkipCPP
-%x     SkipComment
-%x     SkipCxxComment
-%x     RemoveSpecialCComment
-%x     StripSpecialCComment
-%x     Body
-%x      FuncCall
-%x      MemberCall
-%x      MemberCall2
-%x      SkipInits
-%x      ClassName
-%x      AlignAs
-%x      AlignAsEnd
-%x      PackageName
-%x      ClassVar
-%x     CppCliTypeModifierFollowup
-%x      Bases
-%x      SkipSharp
-%x      ReadInclude
-%x      TemplDecl
-%x      TemplCast
-%x     CallEnd
-%x      ObjCMethod
-%x     ObjCParams
-%x     ObjCParamType
-%x      ObjCCall
-%x      ObjCMName
-%x      ObjCSkipStr
-%x      ObjCCallComment
-%x      OldStyleArgs
-%x     UsingName
-%x      RawString
-%x      InlineInit
-
-%%
-
-<*>\x0d
-<Body>^([ \t]*"#"[ \t]*("include"|"import")[ \t]*)("<"|"\"") {
-                                         startFontClass("preprocessor");
-                                         g_code->codify(yytext);
-                                         BEGIN( ReadInclude ); 
-                                       }
-<Body>("@interface"|"@implementation"|"@protocol")[ \t\n]+ { 
-                                          g_insideObjC=TRUE;
-                                         startFontClass("keyword");
-                                         codifyLines(yytext);
-                                         endFontClass();
-                                         if (!g_insideTemplate) 
-                                           BEGIN( ClassName ); 
-                                       }
-<Body>(("public"|"private"){B}+)?("ref"|"value"|"interface"|"enum"){B}+("class"|"struct") {
-                                         if (g_insideTemplate) REJECT;
-                                         startFontClass("keyword");
-                                         codifyLines(yytext);
-                                         endFontClass();
-                                         BEGIN( ClassName ); 
-                                       }
-<Body>"property"|"event"/{BN}*                 { 
-                                         if (g_insideTemplate) REJECT;
-                                         startFontClass("keyword");
-                                         codifyLines(yytext);
-                                         endFontClass();
-                                       }
-<Body>(KEYWORD_CPPCLI_DATATYPE|("partial"{B}+)?"class"|"struct"|"union"|"namespace"|"interface"){B}+ { 
-                                         startFontClass("keyword");
-                                         codifyLines(yytext);
-                                         endFontClass();
-                                         if (!g_insideTemplate) 
-                                           BEGIN( ClassName ); 
-                                       }
-<Body>("package")[ \t\n]+              { 
-                                         startFontClass("keyword");
-                                         codifyLines(yytext);
-                                         endFontClass();
-                                         BEGIN( PackageName ); 
-                                       }
-<ClassVar>\n                           {
-                                         if (!g_insideObjC) REJECT;
-                                         codifyLines(yytext);
-                                         BEGIN(Body);
-                                       }
-<Body,ClassVar,Bases>"-"|"+"           {
-                                         if (!g_insideObjC || g_insideBody)
-                                         { 
-                                           g_code->codify(yytext);
-                                         }
-                                         else // Start of Objective-C method
-                                         {
-                                           //printf("Method!\n");
-                                           g_code->codify(yytext);
-                                           BEGIN(ObjCMethod);
-                                         }
-                                       }
-<ObjCMethod>":"                                {
-                                         g_code->codify(yytext);
-                                         BEGIN(ObjCParams);
-                                       }
-<ObjCParams>"("                                {
-                                         g_code->codify(yytext);
-                                         BEGIN(ObjCParamType);
-                                       }
-<ObjCParams,ObjCMethod>";"|"{"         {
-                                         g_code->codify(yytext);
-                                         if (*yytext=='{')
-                                         {
-                                           if (g_searchingForBody)
-                                           {
-                                             g_searchingForBody=FALSE;
-                                             g_insideBody=TRUE;
-                                           }
-                                           if (g_insideBody) g_bodyCurlyCount++;
-                                           if (!g_curClassName.isEmpty()) // valid class name
-                                           {
-                                             pushScope(g_curClassName);
-                                              DBG_CTX((stderr,"** scope stack push SCOPEBLOCK\n"));
-                                             g_scopeStack.push(SCOPEBLOCK);
-                                           }
-                                         }
-                                          g_type.resize(0);
-                                          g_name.resize(0);
-                                         BEGIN(Body);
-                                       }
-<ObjCParams>{ID}{B}*":"                        {
-                                         g_code->codify(yytext);
-                                       }
-<ObjCParamType>{TYPEKW}                {
-                                         startFontClass("keywordtype");
-                                         g_code->codify(yytext);
-                                         endFontClass();
-                                         g_parmType=yytext;
-                                       }
-<ObjCParamType>{ID}                    {
-                                         generateClassOrGlobalLink(*g_code,yytext);
-                                         g_parmType=yytext;
-                                       }
-<ObjCParamType>")"                     {
-                                         g_code->codify(yytext);
-                                         BEGIN(ObjCParams);
-                                       }
-<ObjCParams>{ID}                       {
-                                         g_code->codify(yytext);
-                                         g_parmName=yytext;
-                                         g_theVarContext.addVariable(g_parmType,g_parmName);
-                                         g_parmType.resize(0);g_parmName.resize(0);
-                                       }
-<ObjCMethod,ObjCParams,ObjCParamType>{ID} {
-                                         generateClassOrGlobalLink(*g_code,yytext);
-                                       }
-<ObjCMethod,ObjCParams,ObjCParamType>. {
-                                         g_code->codify(yytext);
-                                       }
-<ObjCMethod,ObjCParams,ObjCParamType>\n        {
-                                         codifyLines(yytext);
-                                       }
-<ReadInclude>[^\n\"\>]+/(">"|"\"")     {
-                                         //FileInfo *f;
-                                         bool ambig;
-                                         bool found=FALSE;
-                                         //QCString absPath = yytext;
-                                         //if (g_sourceFileDef && QDir::isRelativePath(absPath))
-                                         //{
-                                         //  absPath = QDir::cleanDirPath(g_sourceFileDef->getPath()+"/"+absPath);
-                                         //}
-
-                                          FileDef *fd=findFileDef(Doxygen::inputNameDict,yytext,ambig);
-                                         //printf("looking for include %s -> %s fd=%p\n",yytext,absPath.data(),fd);
-                                         if (fd && fd->isLinkable())
-                                         {
-                                           if (ambig) // multiple input files match the name
-                                           {
-                                             //printf("===== yes %s is ambiguous\n",yytext);
-                                             QCString name = QDir::cleanDirPath(yytext).utf8();
-                                             if (!name.isEmpty() && g_sourceFileDef)
-                                             {
-                                               FileName *fn = Doxygen::inputNameDict->find(name);
-                                               if (fn)
-                                               {
-                                                 FileNameIterator fni(*fn);
-                                                 // for each include name
-                                                 for (fni.toFirst();!found && (fd=fni.current());++fni)
-                                                 {
-                                                   // see if this source file actually includes the file
-                                                   found = g_sourceFileDef->isIncluded(fd->absFilePath());
-                                                   //printf("      include file %s found=%d\n",fd->absFilePath().data(),found);
-                                                 }
-                                               }
-                                             }
-                                           }
-                                           else // not ambiguous
-                                           {
-                                             found = TRUE;
-                                           }
-                                         }
-                                         //printf("      include file %s found=%d\n",fd ? fd->absFilePath().data() : "<none>",found);
-                                         if (found)
-                                         {
-                                           writeMultiLineCodeLink(*g_code,fd,yytext);
-                                         }
-                                         else
-                                         {
-                                           g_code->codify(yytext);
-                                         }
-                                         char c=yyinput();
-                                         QCString text;
-                                         text+=c;
-                                         g_code->codify(text);
-                                         endFontClass();
-                                         BEGIN( Body );
-                                       }
-<Body,Bases>^[ \t]*"#"                 { 
-                                         startFontClass("preprocessor");
-                                         g_lastSkipCppContext = YY_START;
-                                         g_code->codify(yytext);
-                                         BEGIN( SkipCPP ) ; 
-                                       }
-<SkipCPP>.                             { 
-                                         g_code->codify(yytext);
-                                       }
-<SkipCPP>[^\n\/\\]+                    {
-                                         g_code->codify(yytext);
-                                       }
-<SkipCPP>\\[\r]?\n                     { 
-                                         codifyLines(yytext);
-                                       }
-<SkipCPP>"//"                          { 
-                                         g_code->codify(yytext);
-                                       }
-<Body,FuncCall>"{"                     { 
-                                          g_theVarContext.pushScope();
-
-                                          DBG_CTX((stderr,"** scope stack push INNERBLOCK\n"));
-                                         g_scopeStack.push(INNERBLOCK);
-
-                                         if (g_searchingForBody)
-                                         {
-                                           g_searchingForBody=FALSE;
-                                           g_insideBody=TRUE;
-                                         }
-                                         g_code->codify(yytext);
-                                         if (g_insideBody) 
-                                         {
-                                           g_bodyCurlyCount++;
-                                         }
-                                         g_type.resize(0); 
-                                         g_name.resize(0);
-                                         BEGIN( Body );
-                                       }
-<Body,FuncCall,MemberCall,MemberCall2>"}"  { 
-                                          g_theVarContext.popScope();
-                                         g_type.resize(0); 
-                                         g_name.resize(0);
-
-                                         int *scope = g_scopeStack.pop();
-                                          DBG_CTX((stderr,"** scope stack pop SCOPEBLOCK=%d\n",scope==SCOPEBLOCK));
-                                         if (scope==SCOPEBLOCK || scope==CLASSBLOCK) 
-                                         {
-                                           popScope();
-                                         }
-
-                                         g_code->codify(yytext);
-
-                                         DBG_CTX((stderr,"g_bodyCurlyCount=%d\n",g_bodyCurlyCount));
-                                         if (--g_bodyCurlyCount<=0)
-                                         {
-                                           g_insideBody=FALSE;
-                                           g_currentMemberDef=0;
-                                           if (g_currentDefinition) 
-                                             g_currentDefinition=g_currentDefinition->getOuterScope();
-                                         }
-                                         BEGIN(Body);
-                                       }
-<Body,ClassVar>"@end"                  { 
-                                         //printf("End of objc scope fd=%s\n",g_sourceFileDef->name().data());
-                                          if (g_sourceFileDef)
-                                         {
-                                           FileDef *fd=g_sourceFileDef;
-                                            g_insideObjC = fd->name().lower().right(2)==".m" || 
-                                                           fd->name().lower().right(3)==".mm"; 
-                                           //printf("insideObjC=%d\n",g_insideObjC);
-                                         }
-                                         else
-                                         {
-                                           g_insideObjC = FALSE;
-                                         }
-                                         if (g_insideBody)
-                                         {
-                                            g_theVarContext.popScope();
-
-                                           int *scope = g_scopeStack.pop();
-                                            DBG_CTX((stderr,"** scope stack pop SCOPEBLOCK=%d\n",scope==SCOPEBLOCK));
-                                           if (scope==SCOPEBLOCK || scope==CLASSBLOCK) 
-                                           {
-                                             popScope();
-                                           }
-                                           g_insideBody=FALSE;
-                                         }
-
-                                         startFontClass("keyword");
-                                         g_code->codify(yytext);
-                                         endFontClass();
-
-                                         g_currentMemberDef=0;
-                                         if (g_currentDefinition) 
-                                           g_currentDefinition=g_currentDefinition->getOuterScope();
-                                         BEGIN(Body);
-                                       }
-<ClassName,ClassVar>";"                        { 
-                                         g_code->codify(yytext);
-                                         g_searchingForBody=FALSE; 
-                                         BEGIN( Body ); 
-                                       }
-<ClassName,ClassVar>[*&^%]+            {
-                                         g_type=g_curClassName.copy();
-                                         g_name.resize(0);
-                                         g_code->codify(yytext);
-                                         BEGIN( Body ); // variable of type struct *
-                                       }
-<ClassName>"__declspec"{B}*"("{B}*{ID}{B}*")"  {
-                                         startFontClass("keyword");
-                                         g_code->codify(yytext);
-                                         endFontClass();
-                                       }
-<ClassName>{ID}("."{ID})*              |
-<ClassName>{ID}("::"{ID})*             {
-                                          if(g_insideCS)
-                                            g_curClassName=substitute(yytext,".","::");
-                                          else
-                                            g_curClassName=yytext;
-                                         addType();
-                                          if (g_curClassName=="alignas")
-                                          {
-                                           startFontClass("keyword");
-                                           g_code->codify(yytext);
-                                            endFontClass();
-                                            BEGIN( AlignAs );
-                                          }
-                                          else
-                                          {
-                                           generateClassOrGlobalLink(*g_code,yytext);
-                                           BEGIN( ClassVar );
-                                          }
-                                       }
-<AlignAs>"("                            { 
-                                          g_bracketCount=1;
-                                         g_code->codify(yytext);
-                                          BEGIN( AlignAsEnd );
-                                        }
-<AlignAs>\n                             { g_yyLineNr++; 
-                                          codifyLines(yytext);
-                                        }
-<AlignAs>.                              { g_code->codify(yytext); }
-<AlignAsEnd>"("                         { g_code->codify(yytext);
-                                          g_bracketCount++; 
-                                        }
-<AlignAsEnd>")"                         { 
-                                          g_code->codify(yytext);
-                                          if (--g_bracketCount<=0)
-                                          {
-                                            BEGIN(ClassName);
-                                          }
-                                        }
-<AlignAsEnd>\n                          { g_yyLineNr++; 
-                                          codifyLines(yytext); 
-                                        }
-<AlignAsEnd>.                           { g_code->codify(yytext); }
-<ClassName>{ID}("\\"{ID})*             { // PHP namespace
-                                          g_curClassName=substitute(yytext,"\\","::");
-                                         g_scopeStack.push(CLASSBLOCK);
-                                         pushScope(g_curClassName);
-                                         addType();
-                                         generateClassOrGlobalLink(*g_code,yytext);
-                                         BEGIN( ClassVar );
-                                       }
-<ClassName>{ID}{B}*"("{ID}")"           { // Obj-C category
-                                          g_curClassName=removeRedundantWhiteSpace(yytext);
-                                         g_scopeStack.push(CLASSBLOCK);
-                                         pushScope(g_curClassName);
-                                         addType();
-                                         generateClassOrGlobalLink(*g_code,yytext);
-                                         BEGIN( ClassVar );
-                                        }
-<PackageName>{ID}("."{ID})*            {
-                                         g_curClassName=substitute(yytext,".","::");
-                                         //printf("found package: %s\n",g_curClassName.data());
-                                         addType();
-                                         codifyLines(yytext);
-                                       }
-<ClassVar>"="                          {
-                                         unput(*yytext);
-                                         BEGIN( Body );
-                                       }
-<ClassVar>("extends"|"implements")     { // Java, Slice
-                                         startFontClass("keyword");
-                                         codifyLines(yytext);
-                                         endFontClass();
-                                         g_curClassBases.clear();
-                                         BEGIN( Bases ); 
-                                       }
-<ClassVar>("sealed"|"abstract")/{BN}*(":"|"{") {
-                                         DBG_CTX((stderr,"***** C++/CLI modifier %s on g_curClassName=%s\n",yytext,g_curClassName.data()));
-                                         startFontClass("keyword");
-                                         codifyLines(yytext);
-                                         endFontClass();
-                                         BEGIN( CppCliTypeModifierFollowup ); 
-                                       }
-<ClassVar>{ID}                         {
-                                         g_type = g_curClassName.copy();
-                                         g_name = yytext;
-                                         if (g_insideBody)
-                                         {
-                                           g_theVarContext.addVariable(g_type,g_name);
-                                         }
-                                         generateClassOrGlobalLink(*g_code,yytext);
-                                       }
-<ClassName,ClassVar,CppCliTypeModifierFollowup>{B}*":"{B}*     {
-                                         codifyLines(yytext);
-                                         g_curClassBases.clear();
-                                         BEGIN( Bases ); 
-                                       }
-<PackageName>[ \t]*";"                 |
-<Bases>^{B}*/"@"{ID}                    | // Objective-C interface
-<Bases,ClassName,ClassVar,CppCliTypeModifierFollowup>{B}*"{"{B}* {
-                                          g_theVarContext.pushScope();
-                                         g_code->codify(yytext);
-                                         if (YY_START==ClassVar && g_curClassName.isEmpty())
-                                         {
-                                           g_curClassName = g_name.copy();
-                                         }
-                                         if (g_searchingForBody)
-                                         {
-                                           g_searchingForBody=FALSE;
-                                           g_insideBody=TRUE;
-                                         }
-                                         if (g_insideBody) g_bodyCurlyCount++;
-                                         if (!g_curClassName.isEmpty()) // valid class name
-                                         {
-                                            DBG_CTX((stderr,"** scope stack push CLASSBLOCK\n"));
-                                           g_scopeStack.push(CLASSBLOCK);
-                                           pushScope(g_curClassName);
-                                           DBG_CTX((stderr,"***** g_curClassName=%s\n",g_curClassName.data()));
-                                           if (getResolvedClass(g_currentDefinition,g_sourceFileDef,g_curClassName)==0)
-                                           {
-                                             DBG_CTX((stderr,"Adding new class %s\n",g_curClassName.data()));
-                                             ClassDef *ncd=createClassDef("<code>",1,1,
-                                                 g_curClassName,ClassDef::Class,0,0,FALSE);
-                                             g_codeClassSDict->append(g_curClassName,ncd);
-                                             // insert base classes.
-                                             char *s=g_curClassBases.first();
-                                             while (s)
-                                             {
-                                               const ClassDef *bcd=g_codeClassSDict->find(s);
-                                               if (bcd==0) bcd=getResolvedClass(g_currentDefinition,g_sourceFileDef,s);
-                                               if (bcd && bcd!=ncd)
-                                               {
-                                                 ncd->insertBaseClass(const_cast<ClassDef*>(bcd),s,Public,Normal);
-                                               }
-                                               s=g_curClassBases.next();
-                                             }
-                                           }
-                                           //printf("g_codeClassList.count()=%d\n",g_codeClassList.count());
-                                         }
-                                         else // not a class name -> assume inner block
-                                         {
-                                            DBG_CTX((stderr,"** scope stack push INNERBLOCK\n"));
-                                           g_scopeStack.push(INNERBLOCK);
-                                         }
-                                         g_curClassName.resize(0);
-                                         g_curClassBases.clear();
-                                         BEGIN( Body );
-                                       }
-<Bases>"virtual"|"public"|"protected"|"private"|"@public"|"@private"|"@protected" { 
-                                         startFontClass("keyword");
-                                         g_code->codify(yytext);
-                                         endFontClass();
-                                       }
-<Bases>{SEP}?({ID}{SEP})*{ID}           { 
-                                         DBG_CTX((stderr,"%s:addBase(%s)\n",g_curClassName.data(),yytext));
-                                         g_curClassBases.inSort(yytext); 
-                                         generateClassOrGlobalLink(*g_code,yytext);
-                                       }
-<Bases>"<"                              { 
-                                         g_code->codify(yytext);
-                                         if (!g_insideObjC)
-                                         {
-                                           g_sharpCount=1;
-                                           BEGIN ( SkipSharp );
-                                         }
-                                         else
-                                         {
-                                           g_insideProtocolList=TRUE;
-                                         }
-                                       }
-<Bases>">"                             {
-                                         g_code->codify(yytext);
-                                         g_insideProtocolList=FALSE;
-                                       }
-<SkipSharp>"<"                          {
-                                         g_code->codify(yytext);
-                                         ++g_sharpCount; 
-                                       }
-<SkipSharp>">"                          { 
-                                         g_code->codify(yytext);
-                                         if (--g_sharpCount<=0)
-                                         BEGIN ( Bases );
-                                       }
-<Bases>"("                              {
-                                          g_code->codify(yytext);
-                                          g_sharpCount=1;
-                                          BEGIN ( SkipSharp );
-                                        }
-<SkipSharp>"("                          {
-                                          g_code->codify(yytext);
-                                          ++g_sharpCount;
-                                        }
-<SkipSharp>")"                          {
-                                          g_code->codify(yytext);
-                                          if (--g_sharpCount<=0)
-                                            BEGIN ( Bases );
-                                        }
-      
-      
-<Bases>","                              { 
-                                         g_code->codify(yytext);
-                                       }
-                                       
+                                         yyextra->currentMemberDef=0;
+                                         if (yyextra->currentDefinition) 
+                                           yyextra->currentDefinition=yyextra->currentDefinition->getOuterScope();
+                                         BEGIN(Body);
+                                       }
+<ClassName,ClassVar>";"                        { 
+                                         yyextra->code->codify(yytext);
+                                         yyextra->searchingForBody=FALSE; 
+                                         BEGIN( Body ); 
+                                       }
+<ClassName,ClassVar>[*&^%]+            {
+                                         yyextra->type=yyextra->curClassName.copy();
+                                         yyextra->name.resize(0);
+                                         yyextra->code->codify(yytext);
+                                         BEGIN( Body ); // variable of type struct *
+                                       }
+<ClassName>"__declspec"{B}*"("{B}*{ID}{B}*")"  {
+                                         startFontClass(yyscanner,"keyword");
+                                         yyextra->code->codify(yytext);
+                                         endFontClass(yyscanner);
+                                       }
+<ClassName>{ID}("."{ID})*              |
+<ClassName>{ID}("::"{ID})*             {
+                                          if (yyextra->lang==SrcLangExt_CSharp)
+                                            yyextra->curClassName=substitute(yytext,".","::");
+                                          else
+                                            yyextra->curClassName=yytext;
+                                         addType(yyscanner);
+                                          if (yyextra->curClassName=="alignas")
+                                          {
+                                           startFontClass(yyscanner,"keyword");
+                                           yyextra->code->codify(yytext);
+                                            endFontClass(yyscanner);
+                                            BEGIN( AlignAs );
+                                          }
+                                          else
+                                          {
+                                           generateClassOrGlobalLink(yyscanner,*yyextra->code,yytext);
+                                           BEGIN( ClassVar );
+                                          }
+                                       }
+<AlignAs>"("                            { 
+                                          yyextra->bracketCount=1;
+                                         yyextra->code->codify(yytext);
+                                          BEGIN( AlignAsEnd );
+                                        }
+<AlignAs>\n                             { yyextra->yyLineNr++; 
+                                          codifyLines(yyscanner,yytext);
+                                        }
+<AlignAs>.                              { yyextra->code->codify(yytext); }
+<AlignAsEnd>"("                         { yyextra->code->codify(yytext);
+                                          yyextra->bracketCount++; 
+                                        }
+<AlignAsEnd>")"                         { 
+                                          yyextra->code->codify(yytext);
+                                          if (--yyextra->bracketCount<=0)
+                                          {
+                                            BEGIN(ClassName);
+                                          }
+                                        }
+<AlignAsEnd>\n                          { yyextra->yyLineNr++; 
+                                          codifyLines(yyscanner,yytext); 
+                                        }
+<AlignAsEnd>.                           { yyextra->code->codify(yytext); }
+<ClassName>{ID}("\\"{ID})*             { // PHP namespace
+                                          yyextra->curClassName=substitute(yytext,"\\","::");
+                                         yyextra->scopeStack.push(CLASSBLOCK);
+                                         pushScope(yyscanner,yyextra->curClassName);
+                                         addType(yyscanner);
+                                         generateClassOrGlobalLink(yyscanner,*yyextra->code,yytext);
+                                         BEGIN( ClassVar );
+                                       }
+<ClassName>{ID}{B}*"("{ID}")"           { // Obj-C category
+                                          yyextra->curClassName=removeRedundantWhiteSpace(yytext);
+                                         yyextra->scopeStack.push(CLASSBLOCK);
+                                         pushScope(yyscanner,yyextra->curClassName);
+                                         addType(yyscanner);
+                                         generateClassOrGlobalLink(yyscanner,*yyextra->code,yytext);
+                                         BEGIN( ClassVar );
+                                        }
+<PackageName>{ID}("."{ID})*            {
+                                         yyextra->curClassName=substitute(yytext,".","::");
+                                         //printf("found package: %s\n",yyextra->curClassName.data());
+                                         addType(yyscanner);
+                                         codifyLines(yyscanner,yytext);
+                                       }
+<ClassVar>"="                          {
+                                         unput(*yytext);
+                                         BEGIN( Body );
+                                       }
+<ClassVar>("extends"|"implements")     { // Java, Slice
+                                         startFontClass(yyscanner,"keyword");
+                                         codifyLines(yyscanner,yytext);
+                                         endFontClass(yyscanner);
+                                         yyextra->curClassBases.clear();
+                                         BEGIN( Bases ); 
+                                       }
+<ClassVar>("sealed"|"abstract")/{BN}*(":"|"{") {
+                                         DBG_CTX((stderr,"***** C++/CLI modifier %s on yyextra->curClassName=%s\n",yytext,yyextra->curClassName.data()));
+                                         startFontClass(yyscanner,"keyword");
+                                         codifyLines(yyscanner,yytext);
+                                         endFontClass(yyscanner);
+                                         BEGIN( CppCliTypeModifierFollowup ); 
+                                       }
+<ClassVar>{ID}                         {
+                                         yyextra->type = yyextra->curClassName.copy();
+                                         yyextra->name = yytext;
+                                         if (yyextra->insideBody)
+                                         {
+                                           yyextra->theVarContext.addVariable(yyscanner,yyextra->type,yyextra->name);
+                                         }
+                                         generateClassOrGlobalLink(yyscanner,*yyextra->code,yytext);
+                                       }
+<ClassName,ClassVar,CppCliTypeModifierFollowup>{B}*":"{B}*     {
+                                         codifyLines(yyscanner,yytext);
+                                         yyextra->curClassBases.clear();
+                                         BEGIN( Bases ); 
+                                       }
+<PackageName>[ \t]*";"                 |
+<Bases>^{B}*/"@"{ID}                    | // Objective-C interface
+<Bases,ClassName,ClassVar,CppCliTypeModifierFollowup>{B}*"{"{B}* {
+                                          yyextra->theVarContext.pushScope();
+                                         yyextra->code->codify(yytext);
+                                         if (YY_START==ClassVar && yyextra->curClassName.isEmpty())
+                                         {
+                                           yyextra->curClassName = yyextra->name.copy();
+                                         }
+                                         if (yyextra->searchingForBody)
+                                         {
+                                           yyextra->searchingForBody=FALSE;
+                                           yyextra->insideBody=TRUE;
+                                         }
+                                         if (yyextra->insideBody) yyextra->bodyCurlyCount++;
+                                         if (!yyextra->curClassName.isEmpty()) // valid class name
+                                         {
+                                            DBG_CTX((stderr,"** scope stack push CLASSBLOCK\n"));
+                                           yyextra->scopeStack.push(CLASSBLOCK);
+                                           pushScope(yyscanner,yyextra->curClassName);
+                                           DBG_CTX((stderr,"***** yyextra->curClassName=%s\n",yyextra->curClassName.data()));
+                                           if (getResolvedClass(yyextra->currentDefinition,yyextra->sourceFileDef,yyextra->curClassName)==0)
+                                           {
+                                             DBG_CTX((stderr,"Adding new class %s\n",yyextra->curClassName.data()));
+                                             ClassDef *ncd=createClassDef("<code>",1,1,
+                                                 yyextra->curClassName,ClassDef::Class,0,0,FALSE);
+                                             yyextra->codeClassSDict->append(yyextra->curClassName,ncd);
+                                             // insert base classes.
+                                             char *s=yyextra->curClassBases.first();
+                                             while (s)
+                                             {
+                                               const ClassDef *bcd=yyextra->codeClassSDict->find(s);
+                                               if (bcd==0) bcd=getResolvedClass(yyextra->currentDefinition,yyextra->sourceFileDef,s);
+                                               if (bcd && bcd!=ncd)
+                                               {
+                                                 ncd->insertBaseClass(const_cast<ClassDef*>(bcd),s,Public,Normal);
+                                               }
+                                               s=yyextra->curClassBases.next();
+                                             }
+                                           }
+                                           //printf("yyextra->codeClassList.count()=%d\n",yyextra->codeClassList.count());
+                                         }
+                                         else // not a class name -> assume inner block
+                                         {
+                                            DBG_CTX((stderr,"** scope stack push INNERBLOCK\n"));
+                                           yyextra->scopeStack.push(INNERBLOCK);
+                                         }
+                                         yyextra->curClassName.resize(0);
+                                         yyextra->curClassBases.clear();
+                                         BEGIN( Body );
+                                       }
+<Bases>"virtual"|"public"|"protected"|"private"|"@public"|"@private"|"@protected" { 
+                                         startFontClass(yyscanner,"keyword");
+                                         yyextra->code->codify(yytext);
+                                         endFontClass(yyscanner);
+                                       }
+<Bases>{SEP}?({ID}{SEP})*{ID}           { 
+                                         DBG_CTX((stderr,"%s:addBase(%s)\n",yyextra->curClassName.data(),yytext));
+                                         yyextra->curClassBases.inSort(yytext); 
+                                         generateClassOrGlobalLink(yyscanner,*yyextra->code,yytext);
+                                       }
+<Bases>"<"                              { 
+                                         yyextra->code->codify(yytext);
+                                         if (!yyextra->insideObjC)
+                                         {
+                                           yyextra->sharpCount=1;
+                                           BEGIN ( SkipSharp );
+                                         }
+                                         else
+                                         {
+                                           yyextra->insideProtocolList=TRUE;
+                                         }
+                                       }
+<Bases>">"                             {
+                                         yyextra->code->codify(yytext);
+                                         yyextra->insideProtocolList=FALSE;
+                                       }
+<SkipSharp>"<"                          {
+                                         yyextra->code->codify(yytext);
+                                         ++yyextra->sharpCount; 
+                                       }
+<SkipSharp>">"                          { 
+                                         yyextra->code->codify(yytext);
+                                         if (--yyextra->sharpCount<=0)
+                                         BEGIN ( Bases );
+                                       }
+<SkipSharp>"\""                         {
+                                         yyextra->code->codify(yytext);
+                                         yyextra->lastStringContext=YY_START;
+                                          BEGIN(SkipString);
+                                        }
+<SkipSharp>"\'"                         {
+                                         yyextra->code->codify(yytext);
+                                         yyextra->lastStringContext=YY_START;
+                                          BEGIN(SkipStringS);
+                                        }
+<Bases>"("                              {
+                                          yyextra->code->codify(yytext);
+                                          yyextra->sharpCount=1;
+                                          BEGIN ( SkipSharp );
+                                        }
+<SkipSharp>"("                          {
+                                          yyextra->code->codify(yytext);
+                                          ++yyextra->sharpCount;
+                                        }
+<SkipSharp>")"                          {
+                                          yyextra->code->codify(yytext);
+                                          if (--yyextra->sharpCount<=0)
+                                            BEGIN ( Bases );
+                                        }
+      
+      
+<Bases>","                              { 
+                                         yyextra->code->codify(yytext);
+                                       }
+                                       
 
 <Body>{SCOPEPREFIX}?"operator"{B}*"()"{B}*/"(" {
-                                         addType();
-                                         generateFunctionLink(*g_code,yytext);
-                                         g_bracketCount=0;
-                                         g_args.resize(0);
-                                         g_name+=yytext; 
+                                         addType(yyscanner);
+                                         generateFunctionLink(yyscanner,*yyextra->code,yytext);
+                                         yyextra->bracketCount=0;
+                                         yyextra->args.resize(0);
+                                         yyextra->name+=yytext; 
                                          BEGIN( FuncCall );
                                        }
 <Body>{SCOPEPREFIX}?"operator"/"("      {
-                                         addType();
-                                         generateFunctionLink(*g_code,yytext);
-                                         g_bracketCount=0;
-                                         g_args.resize(0);
-                                         g_name+=yytext; 
+                                         addType(yyscanner);
+                                         generateFunctionLink(yyscanner,*yyextra->code,yytext);
+                                         yyextra->bracketCount=0;
+                                         yyextra->args.resize(0);
+                                         yyextra->name+=yytext; 
                                          BEGIN( FuncCall );
                                         }
 <Body>{SCOPEPREFIX}?"operator"[^a-z_A-Z0-9\(\n]+/"(" {
-                                         addType();
-                                         generateFunctionLink(*g_code,yytext);
-                                         g_bracketCount=0;
-                                         g_args.resize(0);
-                                         g_name+=yytext; 
+                                         addType(yyscanner);
+                                         generateFunctionLink(yyscanner,*yyextra->code,yytext);
+                                         yyextra->bracketCount=0;
+                                         yyextra->args.resize(0);
+                                         yyextra->name+=yytext; 
                                          BEGIN( FuncCall );
                                        }
 <Body,TemplDecl>("template"|"generic")/([^a-zA-Z0-9])          {
-                                         startFontClass("keyword");
-                                         codifyLines(yytext);
-                                         endFontClass();
-                                         g_insideTemplate=TRUE;
-                                         g_sharpCount=0;
+                                         startFontClass(yyscanner,"keyword");
+                                         codifyLines(yyscanner,yytext);
+                                         endFontClass(yyscanner);
+                                         yyextra->insideTemplate=TRUE;
+                                         yyextra->sharpCount=0;
                                        }
 <Body>"using"{BN}+"namespace"{BN}+     {
-                                         startFontClass("keyword");
-                                         codifyLines(yytext);
-                                         endFontClass();
+                                         startFontClass(yyscanner,"keyword");
+                                         codifyLines(yyscanner,yytext);
+                                         endFontClass(yyscanner);
                                          BEGIN(UsingName);
                                        }
-<UsingName>{ID}("::"{ID})*             { addUsingDirective(yytext);
-                                         generateClassOrGlobalLink(*g_code,yytext);
+<UsingName>{ID}("::"{ID})*             { addUsingDirective(yyscanner,yytext);
+                                         generateClassOrGlobalLink(yyscanner,*yyextra->code,yytext);
                                           DBG_CTX((stderr,"** scope stack push CLASSBLOCK\n"));
-                                         g_scopeStack.push(CLASSBLOCK);
-                                         pushScope(yytext);
+                                         yyextra->scopeStack.push(CLASSBLOCK);
+                                         pushScope(yyscanner,yytext);
                                          BEGIN(Body);
                                         }
-<UsingName>\n                          { codifyLines(yytext); BEGIN(Body); }
-<UsingName>.                           { codifyLines(yytext); BEGIN(Body); }
-<Body,FuncCall>"$"?"this"("->"|".")    { g_code->codify(yytext); // this-> for C++, this. for C#
-                                         g_prefixed_with_this_keyword = TRUE;
+<UsingName>\n                          { codifyLines(yyscanner,yytext); BEGIN(Body); }
+<UsingName>.                           { codifyLines(yyscanner,yytext); BEGIN(Body); }
+<Body,FuncCall>"$"?"this"("->"|".")    { yyextra->code->codify(yytext); // this-> for C++, this. for C#
+                                         yyextra->prefixed_with_this_keyword = TRUE;
                                         }
 <Body>{KEYWORD}/([^a-z_A-Z0-9])        {
-                                          if (g_insideJava && qstrcmp("internal",yytext) ==0) REJECT;
-                                          if (skipLanguageSpecificKeyword(yytext)) REJECT;
-                                         startFontClass("keyword");
-                                         codifyLines(yytext);
+                                          if (yyextra->lang==SrcLangExt_Java && qstrcmp("internal",yytext) ==0) REJECT;
+                                          if (skipLanguageSpecificKeyword(yyscanner,yytext)) REJECT;
+                                         startFontClass(yyscanner,"keyword");
+                                         codifyLines(yyscanner,yytext);
                                          if (QCString(yytext)=="typedef")
                                          {
-                                           addType();
-                                           g_name+=yytext; 
+                                           addType(yyscanner);
+                                           yyextra->name+=yytext; 
                                          }
-                                         endFontClass();
+                                         endFontClass(yyscanner);
                                        }
 <Body>{KEYWORD}/{B}*                   {
-                                          if (skipLanguageSpecificKeyword(yytext)) REJECT;
-                                         startFontClass("keyword");
-                                         codifyLines(yytext);
-                                         endFontClass();
+                                          if (skipLanguageSpecificKeyword(yyscanner,yytext)) REJECT;
+                                         startFontClass(yyscanner,"keyword");
+                                         codifyLines(yyscanner,yytext);
+                                         endFontClass(yyscanner);
                                        }
 <Body>{KEYWORD}/{BN}*"("               {
-                                          if (skipLanguageSpecificKeyword(yytext)) REJECT;
-                                         startFontClass("keyword");
-                                         codifyLines(yytext);
-                                         endFontClass();
-                                         g_name.resize(0);g_type.resize(0);
+                                          if (skipLanguageSpecificKeyword(yyscanner,yytext)) REJECT;
+                                         startFontClass(yyscanner,"keyword");
+                                         codifyLines(yyscanner,yytext);
+                                         endFontClass(yyscanner);
+                                         yyextra->name.resize(0);yyextra->type.resize(0);
                                        }
 <FuncCall>"in"/{BN}*                   {
-                                         if (!g_inForEachExpression) REJECT;
-                                         startFontClass("keywordflow");
-                                         codifyLines(yytext);
-                                         endFontClass();
+                                         if (!yyextra->inForEachExpression) REJECT;
+                                         startFontClass(yyscanner,"keywordflow");
+                                         codifyLines(yyscanner,yytext);
+                                         endFontClass(yyscanner);
                                          // insert the variable in the parent scope, see bug 546158
-                                         g_theVarContext.popScope();
-                                         g_theVarContext.addVariable(g_parmType,g_parmName);
-                                         g_theVarContext.pushScope();
-                                         g_name.resize(0);g_type.resize(0);
+                                         yyextra->theVarContext.popScope();
+                                         yyextra->theVarContext.addVariable(yyscanner,yyextra->parmType,yyextra->parmName);
+                                         yyextra->theVarContext.pushScope();
+                                         yyextra->name.resize(0);yyextra->type.resize(0);
                                        }
 <Body>{FLOWKW}/{BN}*"("                        {
-                                         startFontClass("keywordflow");
-                                         codifyLines(yytext);
-                                         endFontClass();
-                                         g_name.resize(0);g_type.resize(0);
-                                         g_inForEachExpression = (qstrcmp(yytext,"for each")==0 || qstrcmp(yytext, "foreach")==0);
+                                         startFontClass(yyscanner,"keywordflow");
+                                         codifyLines(yyscanner,yytext);
+                                         endFontClass(yyscanner);
+                                         yyextra->name.resize(0);yyextra->type.resize(0);
+                                         yyextra->inForEachExpression = (qstrcmp(yytext,"for each")==0 || qstrcmp(yytext, "foreach")==0);
                                          BEGIN(FuncCall);
                                        }
 <Body>{FLOWCONDITION}/{BN}*"("          {
-                                          if (g_currentMemberDef && g_currentMemberDef->isFunction())
+                                          if (yyextra->currentMemberDef && yyextra->currentMemberDef->isFunction())
                                           {
-                                            g_currentMemberDef->incrementFlowKeyWordCount();
+                                            yyextra->currentMemberDef->incrementFlowKeyWordCount();
                                           }
-                                          startFontClass("keywordflow");
-                                          codifyLines(yytext);
-                                          endFontClass();
-                                          g_name.resize(0);g_type.resize(0);
-                                          g_inForEachExpression = (strcmp(yytext,"for each")==0 || strcmp(yytext, "foreach")==0);
+                                          startFontClass(yyscanner,"keywordflow");
+                                          codifyLines(yyscanner,yytext);
+                                          endFontClass(yyscanner);
+                                          yyextra->name.resize(0);yyextra->type.resize(0);
+                                          yyextra->inForEachExpression = (strcmp(yytext,"for each")==0 || strcmp(yytext, "foreach")==0);
                                           BEGIN(FuncCall);
                                         }
 <Body>{FLOWKW}/([^a-z_A-Z0-9])                 {
-                                         startFontClass("keywordflow");
-                                         codifyLines(yytext);
-                                         endFontClass();
-                                         if (g_inFunctionTryBlock && (qstrcmp(yytext,"catch")==0 || qstrcmp(yytext,"finally")==0))
+                                         startFontClass(yyscanner,"keywordflow");
+                                         codifyLines(yyscanner,yytext);
+                                         endFontClass(yyscanner);
+                                         if (yyextra->inFunctionTryBlock && (qstrcmp(yytext,"catch")==0 || qstrcmp(yytext,"finally")==0))
                                          {
-                                           g_inFunctionTryBlock=FALSE;
+                                           yyextra->inFunctionTryBlock=FALSE;
                                          }
                                        }
 <Body>{FLOWCONDITION}/([^a-z_A-Z0-9])  {
-                                          if (g_currentMemberDef && g_currentMemberDef->isFunction())
+                                          if (yyextra->currentMemberDef && yyextra->currentMemberDef->isFunction())
                                           {
-                                            g_currentMemberDef->incrementFlowKeyWordCount();
+                                            yyextra->currentMemberDef->incrementFlowKeyWordCount();
                                           }
-                                          startFontClass("keywordflow");
-                                          codifyLines(yytext);
-                                          endFontClass();
-                                          if (g_inFunctionTryBlock && (strcmp(yytext,"catch")==0 || strcmp(yytext,"finally")==0))
+                                          startFontClass(yyscanner,"keywordflow");
+                                          codifyLines(yyscanner,yytext);
+                                          endFontClass(yyscanner);
+                                          if (yyextra->inFunctionTryBlock && (strcmp(yytext,"catch")==0 || strcmp(yytext,"finally")==0))
                                           {
-                                            g_inFunctionTryBlock=FALSE;
+                                            yyextra->inFunctionTryBlock=FALSE;
                                           }
                                         }
 <Body>{FLOWKW}/{B}*                    {
-                                         startFontClass("keywordflow");
-                                         codifyLines(yytext);
-                                         endFontClass();
+                                         startFontClass(yyscanner,"keywordflow");
+                                         codifyLines(yyscanner,yytext);
+                                         endFontClass(yyscanner);
                                        }
 <Body>{FLOWCONDITION}/{B}*              {
-                                          if (g_currentMemberDef && g_currentMemberDef->isFunction())
+                                          if (yyextra->currentMemberDef && yyextra->currentMemberDef->isFunction())
                                           {
-                                            g_currentMemberDef->incrementFlowKeyWordCount();
+                                            yyextra->currentMemberDef->incrementFlowKeyWordCount();
                                           }
-                                          startFontClass("keywordflow");
-                                          codifyLines(yytext);
-                                          endFontClass();
+                                          startFontClass(yyscanner,"keywordflow");
+                                          codifyLines(yyscanner,yytext);
+                                          endFontClass(yyscanner);
                                         }
 <Body>"*"{B}*")"                        { // end of cast?
-                                         g_code->codify(yytext);
-                                         g_theCallContext.popScope(g_name, g_type);
-                                         g_bracketCount--;
-                                          g_parmType = g_name;
+                                         yyextra->code->codify(yytext);
+                                         yyextra->theCallContext.popScope(yyextra->name, yyextra->type);
+                                         yyextra->bracketCount--;
+                                          yyextra->parmType = yyextra->name;
                                          BEGIN(FuncCall);
                                         }
 <Body>[\\|\)\+\-\/\%\~\!]              {
-                                         g_code->codify(yytext);
-                                         g_name.resize(0);g_type.resize(0);
+                                         yyextra->code->codify(yytext);
+                                         yyextra->name.resize(0);yyextra->type.resize(0);
                                          if (*yytext==')')
                                          {
-                                           g_theCallContext.popScope(g_name, g_type);
-                                           g_bracketCount--;
+                                           yyextra->theCallContext.popScope(yyextra->name, yyextra->type);
+                                           yyextra->bracketCount--;
                                            BEGIN(FuncCall);
                                          }
                                        }
 <Body,TemplDecl,ObjCMethod>{TYPEKW}/{B}* {
-                                         startFontClass("keywordtype");
-                                         g_code->codify(yytext);
-                                         endFontClass();
-                                         addType();
-                                         g_name+=yytext; 
+                                         startFontClass(yyscanner,"keywordtype");
+                                         yyextra->code->codify(yytext);
+                                         endFontClass(yyscanner);
+                                         addType(yyscanner);
+                                         yyextra->name+=yytext; 
                                        }
 <Body,TemplDecl,ObjCMethod>{TYPEKWSL}/{B}* {
-                                          if (!g_insideSlice)
+                                          if (yyextra->lang!=SrcLangExt_Slice)
                                           {
                                             REJECT;
                                           }
                                           else
                                           {
-                                           startFontClass("keywordtype");
-                                           g_code->codify(yytext);
-                                           endFontClass();
-                                           addType();
-                                           g_name+=yytext; 
+                                           startFontClass(yyscanner,"keywordtype");
+                                           yyextra->code->codify(yytext);
+                                           endFontClass(yyscanner);
+                                           addType(yyscanner);
+                                           yyextra->name+=yytext; 
                                           }
                                        }
 <Body>"generic"/{B}*"<"[^\n\/\-\.\{\"\>]*">"{B}* {
-                                         startFontClass("keyword");
-                                         g_code->codify(yytext);
-                                         endFontClass();
-                                         g_sharpCount=0;
+                                         startFontClass(yyscanner,"keyword");
+                                         yyextra->code->codify(yytext);
+                                         endFontClass(yyscanner);
+                                         yyextra->sharpCount=0;
                                          BEGIN(TemplDecl);
                                        }
 <Body>"template"/{B}*"<"[^\n\/\-\.\{\"\>]*">"{B}* { // template<...>
-                                         startFontClass("keyword");
-                                         g_code->codify(yytext);
-                                         endFontClass();
-                                         g_sharpCount=0;
+                                         startFontClass(yyscanner,"keyword");
+                                         yyextra->code->codify(yytext);
+                                         endFontClass(yyscanner);
+                                         yyextra->sharpCount=0;
                                          BEGIN(TemplDecl);
                                         }
 <TemplDecl>"class"|"typename"          {
-                                         startFontClass("keyword");
-                                         codifyLines(yytext);
-                                         endFontClass();
+                                         startFontClass(yyscanner,"keyword");
+                                         codifyLines(yyscanner,yytext);
+                                         endFontClass(yyscanner);
                                        }
 <TemplDecl>"<"                         {
-                                          g_code->codify(yytext);
-                                          g_sharpCount++;
+                                          yyextra->code->codify(yytext);
+                                          yyextra->sharpCount++;
                                        }
 <TemplDecl>">"                         {
-                                          g_code->codify(yytext);
-                                          g_sharpCount--;
-                                         if (g_sharpCount<=0)
+                                          yyextra->code->codify(yytext);
+                                          yyextra->sharpCount--;
+                                         if (yyextra->sharpCount<=0)
                                          {
                                            BEGIN(Body);
                                          }
                                        }
 <TemplCast>">"                         {
-                                         startFontClass("keyword");
-                                         codifyLines(yytext);
-                                         endFontClass();
-                                         BEGIN( g_lastTemplCastContext );
+                                         startFontClass(yyscanner,"keyword");
+                                         codifyLines(yyscanner,yytext);
+                                         endFontClass(yyscanner);
+                                         BEGIN( yyextra->lastTemplCastContext );
                                        }
 <TemplCast>{ID}("::"{ID})*             {
-                                         generateClassOrGlobalLink(*g_code,yytext);
+                                         generateClassOrGlobalLink(yyscanner,*yyextra->code,yytext);
                                        }
 <TemplCast>("const"|"volatile"){B}*    {
-                                         startFontClass("keyword");
-                                         codifyLines(yytext);
-                                         endFontClass();
+                                         startFontClass(yyscanner,"keyword");
+                                         codifyLines(yyscanner,yytext);
+                                         endFontClass(yyscanner);
                                        }
 <TemplCast>[*^]*                       {
-                                         codifyLines(yytext);
+                                         codifyLines(yyscanner,yytext);
                                        }
-<Body,FuncCall>{CASTKW}"<"                { // static_cast<T>(
-                                         startFontClass("keyword");
-                                         codifyLines(yytext);
-                                         endFontClass();
-                                          g_lastTemplCastContext = YY_START;
+<Body,MemberCall2,FuncCall>{CASTKW}{B}*"<"  { // static_cast<T>(
+                                         startFontClass(yyscanner,"keyword");
+                                         codifyLines(yyscanner,yytext);
+                                         endFontClass(yyscanner);
+                                          yyextra->lastTemplCastContext = YY_START;
                                          BEGIN(TemplCast);
                                        }
 <Body>"$this->"{SCOPENAME}/{BN}*[;,)\]] { // PHP member variable
-                                         addType();
-                                         generatePHPVariableLink(*g_code,yytext);
-                                         g_name+=yytext+7; 
+                                         addType(yyscanner);
+                                         generatePHPVariableLink(yyscanner,*yyextra->code,yytext);
+                                         yyextra->name+=yytext+7; 
                                         }
 <Body,TemplCast>{SCOPENAME}{B}*"<"[^\n\/\-\.\{\"\>\(]*">"("::"{ID})*/{B}* { // A<T> *pt;
-                                         int i=QCString(yytext).find('<');
-                                         QCString kw = QCString(yytext).left(i).stripWhiteSpace();
-                                         if (kw.right(5)=="_cast" && YY_START==Body)
+                                         if (isCastKeyword(yytext) && YY_START==Body)
                                          {
                                            REJECT;
                                          }
-                                         addType();
-                                         generateClassOrGlobalLink(*g_code,yytext);
-                                         g_name+=yytext; 
+                                         addType(yyscanner);
+                                         generateClassOrGlobalLink(yyscanner,*yyextra->code,yytext);
+                                         yyextra->name+=yytext; 
                                        }
 <Body>{SCOPENAME}/{BN}*[:;,)\]]                { // "int var;" or "var, var2" or "debug(f) macro" , or int var : 5;
-                                         addType();
+                                         addType(yyscanner);
                                          // changed this to generateFunctionLink, see bug 624514
-                                         //generateClassOrGlobalLink(*g_code,yytext,FALSE,TRUE);
-                                         generateFunctionLink(*g_code,yytext);
-                                         g_name+=yytext; 
+                                         //generateClassOrGlobalLink(yyscanner,*yyextra->code,yytext,FALSE,TRUE);
+                                         generateFunctionLink(yyscanner,*yyextra->code,yytext);
+                                         yyextra->name+=yytext; 
                                        }
 <Body>{SCOPENAME}/{B}*                         { // p->func()
-                                         addType();
-                                         generateClassOrGlobalLink(*g_code,yytext);
-                                         g_name+=yytext; 
+                                         addType(yyscanner);
+                                         generateClassOrGlobalLink(yyscanner,*yyextra->code,yytext);
+                                         yyextra->name+=yytext; 
                                        }
 <Body>"("{B}*("*"{B}*)+{SCOPENAME}*{B}*")"/{B}*        {  // (*p)->func() but not "if (p) ..."
-                                         g_code->codify(yytext);
+                                         yyextra->code->codify(yytext);
                                          int s=0;while (s<(int)yyleng && !isId(yytext[s])) s++;
                                           int e=(int)yyleng-1;while (e>=0 && !isId(yytext[e])) e--;
                                          QCString varname = ((QCString)yytext).mid(s,e-s+1); 
-                                         addType();
-                                         g_name=varname; 
+                                         addType(yyscanner);
+                                         yyextra->name=varname; 
                                        }
 <Body>{SCOPETNAME}{B}*"<"[^\n\/\-\.\{\"\>]*">"/{BN}*"(" |
 <Body>{SCOPETNAME}/{BN}*"("            { // a() or c::a() or t<A,B>::a() or A\B\foo()
-                                         addType();
-                                         generateFunctionLink(*g_code,yytext);
-                                         g_bracketCount=0;
-                                         g_args.resize(0);
-                                         g_name+=yytext; 
+                                         if (isCastKeyword(yytext))
+                                         {
+                                           REJECT;
+                                         }
+                                         addType(yyscanner);
+                                         generateFunctionLink(yyscanner,*yyextra->code,yytext);
+                                         yyextra->bracketCount=0;
+                                         yyextra->args.resize(0);
+                                         yyextra->name+=yytext; 
                                          BEGIN( FuncCall );
                                        }
 <FuncCall,Body,MemberCall,MemberCall2,SkipInits,InlineInit>{RAWBEGIN}  {
                                           QCString text=yytext;
                                           int i=text.find('R');
-                                          g_code->codify(text.left(i+1));
-                                         startFontClass("stringliteral");
-                                         g_code->codify(yytext+i+1);
-                                         g_lastStringContext=YY_START;
-                                         g_inForEachExpression = FALSE;
-                                          g_delimiter = yytext+i+2;
-                                          g_delimiter=g_delimiter.left(g_delimiter.length()-1);
+                                          yyextra->code->codify(text.left(i+1));
+                                         startFontClass(yyscanner,"stringliteral");
+                                         yyextra->code->codify(yytext+i+1);
+                                         yyextra->lastStringContext=YY_START;
+                                         yyextra->inForEachExpression = FALSE;
+                                          yyextra->delimiter = yytext+i+2;
+                                          yyextra->delimiter=yyextra->delimiter.left(yyextra->delimiter.length()-1);
                                          BEGIN( RawString );
                                         }
 <FuncCall,Body,MemberCall,MemberCall2,SkipInits,InlineInit>\"  {
-                                         startFontClass("stringliteral");
-                                         g_code->codify(yytext);
-                                         g_lastStringContext=YY_START;
-                                         g_inForEachExpression = FALSE;
+                                         startFontClass(yyscanner,"stringliteral");
+                                         yyextra->code->codify(yytext);
+                                         yyextra->lastStringContext=YY_START;
+                                         yyextra->inForEachExpression = FALSE;
                                          BEGIN( SkipString );
                                        }
 <FuncCall,Body,MemberCall,MemberCall2,SkipInits,InlineInit>\'  {
-                                         startFontClass("stringliteral");
-                                         g_code->codify(yytext);
-                                         g_lastStringContext=YY_START;
-                                         g_inForEachExpression = FALSE;
+                                         startFontClass(yyscanner,"stringliteral");
+                                         yyextra->code->codify(yytext);
+                                         yyextra->lastStringContext=YY_START;
+                                         yyextra->inForEachExpression = FALSE;
                                          BEGIN( SkipStringS );
                                        }
 <SkipString>[^\"\\\r\n]*               { 
-                                         g_code->codify(yytext);
+                                         yyextra->code->codify(yytext);
                                        }
 <SkipStringS>[^\'\\\r\n]*              {
-                                         g_code->codify(yytext);
+                                         yyextra->code->codify(yytext);
                                        }
 <SkipString,SkipStringS>"//"|"/*"      {
-                                         g_code->codify(yytext);
+                                         yyextra->code->codify(yytext);
                                        }
 <SkipString>@?\"                       {
-                                         g_code->codify(yytext);
-                                         endFontClass();
-                                         BEGIN( g_lastStringContext );
+                                         yyextra->code->codify(yytext);
+                                         endFontClass(yyscanner);
+                                         BEGIN( yyextra->lastStringContext );
                                        }
 <SkipStringS>\'                                {
-                                         g_code->codify(yytext);
-                                         endFontClass();
-                                         BEGIN( g_lastStringContext );
+                                         yyextra->code->codify(yytext);
+                                         endFontClass(yyscanner);
+                                         BEGIN( yyextra->lastStringContext );
                                        }
 <SkipString,SkipStringS>\\.            {
-                                         g_code->codify(yytext);
+                                         yyextra->code->codify(yytext);
                                        }
 <RawString>{RAWEND}                     { 
-                                          g_code->codify(yytext);
+                                          yyextra->code->codify(yytext);
                                           QCString delimiter = yytext+1;
                                           delimiter=delimiter.left(delimiter.length()-1);
-                                          if (delimiter==g_delimiter)
+                                          if (delimiter==yyextra->delimiter)
                                           {
-                                           BEGIN( g_lastStringContext );
+                                           BEGIN( yyextra->lastStringContext );
                                           }
                                         }
-<RawString>[^)\n]+                      { g_code->codify(yytext); }
-<RawString>.                            { g_code->codify(yytext); }
-<RawString>\n                           { codifyLines(yytext); }
+<RawString>[^)\n]+                      { yyextra->code->codify(yytext); }
+<RawString>.                            { yyextra->code->codify(yytext); }
+<RawString>\n                           { codifyLines(yyscanner,yytext); }
 <SkipVerbString>[^"\n]+                        {
-                                         g_code->codify(yytext);
+                                         yyextra->code->codify(yytext);
                                        }
 <SkipVerbString>\"\"                   { // escaped quote
-                                         g_code->codify(yytext);
+                                         yyextra->code->codify(yytext);
                                        }
 <SkipVerbString>\"                     { // end of string
-                                         g_code->codify(yytext);
-                                         endFontClass();
-                                         BEGIN( g_lastVerbStringContext );
+                                         yyextra->code->codify(yytext);
+                                         endFontClass(yyscanner);
+                                         BEGIN( yyextra->lastVerbStringContext );
                                        }
 <SkipVerbString>.                      {
-                                         g_code->codify(yytext);
+                                         yyextra->code->codify(yytext);
                                        }
 <SkipVerbString>\n                     {
-                                         codifyLines(yytext);
+                                         codifyLines(yyscanner,yytext);
                                        }
 <Body>":"                              {
-                                         g_code->codify(yytext);
-                                         g_name.resize(0);g_type.resize(0);
+                                         yyextra->code->codify(yytext);
+                                         yyextra->name.resize(0);yyextra->type.resize(0);
                                        }
 <Body>"<"                              {
-                                         if (g_insideTemplate)
+                                         if (yyextra->insideTemplate)
                                          {
-                                           g_sharpCount++;
+                                           yyextra->sharpCount++;
                                          }
-                                         g_code->codify(yytext);
+                                         yyextra->code->codify(yytext);
                                        }
 <Body>">"                              {
-                                         if (g_insideTemplate)
+                                         if (yyextra->insideTemplate)
                                          {
-                                           if (--g_sharpCount<=0)
+                                           if (--yyextra->sharpCount<=0)
                                            {
-                                             g_insideTemplate=FALSE;
+                                             yyextra->insideTemplate=FALSE;
                                            }
                                          }
-                                         g_code->codify(yytext);
+                                         yyextra->code->codify(yytext);
                                        }
 <Body,MemberCall,MemberCall2,FuncCall>"'"((\\0[Xx0-9]+)|(\\.)|(.))"'"  {
-                                         startFontClass("charliteral"); 
-                                         g_code->codify(yytext);
-                                         endFontClass();
+                                         startFontClass(yyscanner,"charliteral"); 
+                                         yyextra->code->codify(yytext);
+                                         endFontClass(yyscanner);
                                        }
 <Body>"."|"->"                         { 
                                          if (yytext[0]=='-') // -> could be overloaded
                                          {
-                                           updateCallContextForSmartPointer();
+                                           updateCallContextForSmartPointer(yyscanner);
                                          }
-                                         g_code->codify(yytext);
-                                         g_memCallContext = YY_START;
+                                         yyextra->code->codify(yytext);
+                                         yyextra->memCallContext = YY_START;
                                          BEGIN( MemberCall ); 
                                        }
 <MemberCall>{SCOPETNAME}/{BN}*"("      {
-                                         if (g_theCallContext.getScope())
+                                         if (yyextra->theCallContext.getScope())
                                          {
-                                           if (!generateClassMemberLink(*g_code,g_theCallContext.getScope(),yytext))
+                                           if (!generateClassMemberLink(yyscanner,*yyextra->code,yyextra->theCallContext.getScope(),yytext))
                                            {
-                                             g_code->codify(yytext);
-                                             addToSearchIndex(yytext);
+                                             yyextra->code->codify(yytext);
+                                             addToSearchIndex(yyscanner,yytext);
                                            }
-                                           g_name.resize(0);
+                                           yyextra->name.resize(0);
                                          }
                                          else
                                          {
-                                           g_code->codify(yytext);
-                                           addToSearchIndex(yytext);
-                                           g_name.resize(0);
+                                           yyextra->code->codify(yytext);
+                                           addToSearchIndex(yyscanner,yytext);
+                                           yyextra->name.resize(0);
                                          }
-                                         g_type.resize(0);
-                                         g_bracketCount=0;
-                                         if (g_memCallContext==Body)
+                                         yyextra->type.resize(0);
+                                         if (yyextra->memCallContext==Body)
                                          {
                                            BEGIN(FuncCall);
                                          }
                                          else
                                          {
-                                           BEGIN(g_memCallContext);
+                                           BEGIN(yyextra->memCallContext);
                                          }
                                        }
 <MemberCall>{SCOPENAME}/{B}*           {
-                                         if (g_theCallContext.getScope())
+                                         if (yyextra->theCallContext.getScope())
                                          {
-                                           DBG_CTX((stderr,"g_theCallContext.getClass()=%p\n",g_theCallContext.getScope()));
-                                           if (!generateClassMemberLink(*g_code,g_theCallContext.getScope(),yytext))
+                                           DBG_CTX((stderr,"yyextra->theCallContext.getClass()=%p\n",yyextra->theCallContext.getScope()));
+                                           if (!generateClassMemberLink(yyscanner,*yyextra->code,yyextra->theCallContext.getScope(),yytext))
                                            {
-                                             g_code->codify(yytext);
-                                             addToSearchIndex(yytext);
+                                             yyextra->code->codify(yytext);
+                                             addToSearchIndex(yyscanner,yytext);
                                            }
-                                           g_name.resize(0);
+                                           yyextra->name.resize(0);
                                          }
                                          else
                                          {
                                            DBG_CTX((stderr,"no class context!\n"));
-                                           g_code->codify(yytext);
-                                           addToSearchIndex(yytext);
-                                           g_name.resize(0);
+                                           yyextra->code->codify(yytext);
+                                           addToSearchIndex(yyscanner,yytext);
+                                           yyextra->name.resize(0);
                                          }
-                                         g_type.resize(0);
-                                         BEGIN(g_memCallContext);
+                                         yyextra->type.resize(0);
+                                         BEGIN(yyextra->memCallContext);
                                        }
 <Body>[,=;\[]                          {
-                                         if (g_insideObjC && *yytext=='[')
+                                         if (yyextra->insideObjC && *yytext=='[')
                                          {
                                            //printf("Found start of ObjC call!\n");
                                            // start of a method call
-                                           g_contextDict.setAutoDelete(TRUE);
-                                           g_nameDict.setAutoDelete(TRUE);
-                                           g_objectDict.setAutoDelete(TRUE);
-                                           g_wordDict.setAutoDelete(TRUE);
-                                            g_commentDict.setAutoDelete(TRUE);
-                                           g_contextDict.clear();
-                                           g_nameDict.clear();
-                                           g_objectDict.clear();
-                                           g_wordDict.clear();
-                                            g_commentDict.clear();
-                                           g_currentCtxId  = 0;
-                                           g_currentNameId  = 0;
-                                           g_currentObjId  = 0;
-                                           g_currentCtx = 0;
-                                           g_braceCount = 0;
+                                           yyextra->contextDict.setAutoDelete(TRUE);
+                                           yyextra->nameDict.setAutoDelete(TRUE);
+                                           yyextra->objectDict.setAutoDelete(TRUE);
+                                           yyextra->wordDict.setAutoDelete(TRUE);
+                                            yyextra->commentDict.setAutoDelete(TRUE);
+                                           yyextra->contextDict.clear();
+                                           yyextra->nameDict.clear();
+                                           yyextra->objectDict.clear();
+                                           yyextra->wordDict.clear();
+                                            yyextra->commentDict.clear();
+                                           yyextra->currentCtxId  = 0;
+                                           yyextra->currentNameId  = 0;
+                                           yyextra->currentObjId  = 0;
+                                           yyextra->currentCtx = 0;
+                                           yyextra->braceCount = 0;
                                            unput('[');
                                            BEGIN(ObjCCall);
                                          }
                                          else
                                          {
-                                           g_code->codify(yytext);
-                                           g_saveName = g_name.copy();
-                                           g_saveType = g_type.copy();
-                                           if (*yytext!='[' && !g_type.isEmpty()) 
+                                           yyextra->code->codify(yytext);
+                                           yyextra->saveName = yyextra->name.copy();
+                                           yyextra->saveType = yyextra->type.copy();
+                                           if (*yytext!='[' && !yyextra->type.isEmpty()) 
                                            {
-                                             //printf("g_scopeStack.bottom()=%p\n",g_scopeStack.bottom());
-                                             //if (g_scopeStack.top()!=CLASSBLOCK) // commented out for bug731363
+                                             //printf("yyextra->scopeStack.bottom()=%p\n",yyextra->scopeStack.bottom());
+                                             //if (yyextra->scopeStack.top()!=CLASSBLOCK) // commented out for bug731363
                                              {
                                                //printf("AddVariable: '%s' '%s' context=%d\n",
-                                               //    g_type.data(),g_name.data(),g_theVarContext.count());
-                                               g_theVarContext.addVariable(g_type,g_name);
+                                               //    yyextra->type.data(),yyextra->name.data(),yyextra->theVarContext.count());
+                                               yyextra->theVarContext.addVariable(yyscanner,yyextra->type,yyextra->name);
                                              }
-                                             g_name.resize(0);
+                                             yyextra->name.resize(0);
                                            }
                                            if (*yytext==';' || *yytext=='=') 
                                            {
-                                             g_type.resize(0);
-                                             g_name.resize(0);
+                                             yyextra->type.resize(0);
+                                             yyextra->name.resize(0);
                                            }
                                            else if (*yytext=='[')
                                            {
-                                             g_theCallContext.pushScope(g_name, g_type);
+                                             yyextra->theCallContext.pushScope(yyextra->name, yyextra->type);
                                            }
-                                           g_args.resize(0);
-                                            g_parmType.resize(0);
-                                            g_parmName.resize(0);
+                                           yyextra->args.resize(0);
+                                            yyextra->parmType.resize(0);
+                                            yyextra->parmName.resize(0);
                                          }
                                        }
   /*
@@ -2875,212 +1430,216 @@ RAWEND    ")"[^ \t\(\)\\]{0,16}\"
                                          if (qstrcmp(yytext,"self")==0 || qstrcmp(yytext,"super")==0)
                                          {
                                            // TODO: get proper base class for "super"
-                                           g_theCallContext.setClass(getClass(g_curClassName));
-                                           startFontClass("keyword");
-                                           g_code->codify(yytext); 
-                                           endFontClass();
+                                           yyextra->theCallContext.setClass(getClass(yyextra->curClassName));
+                                           startFontClass(yyscanner,"keyword");
+                                           yyextra->code->codify(yytext); 
+                                           endFontClass(yyscanner);
                                          }
                                          else
                                          {
-                                           generateClassOrGlobalLink(*g_code,yytext);
+                                           generateClassOrGlobalLink(yyscanner,*yyextra->code,yytext);
                                          }
-                                         g_name.resize(0);
+                                         yyextra->name.resize(0);
                                          BEGIN(ObjCMemberCall2);
                                        }
 <ObjCMemberCall>"["                    {
-                                           g_code->codify(yytext);
-                                           g_theCallContext.pushScope(g_name, g_type);
+                                           yyextra->code->codify(yytext);
+                                           yyextra->theCallContext.pushScope(yyscanner,yyextra->name, yyextra->type);
                                        }
 <ObjCMemberCall2>{ID}":"?              {
-                                         g_name+=yytext;
-                                         if (g_theCallContext.getClass())
+                                         yyextra->name+=yytext;
+                                         if (yyextra->theCallContext.getClass())
                                          {
-                                           //printf("Calling method %s\n",g_name.data());
-                                           if (!generateClassMemberLink(*g_code,g_theCallContext.getClass(),g_name))
+                                           //printf("Calling method %s\n",yyextra->name.data());
+                                           if (!generateClassMemberLink(yyscanner,*yyextra->code,yyextra->theCallContext.getClass(),yyextra->name))
                                            {
-                                             g_code->codify(yytext);
-                                             addToSearchIndex(g_name);
+                                             yyextra->code->codify(yytext);
+                                             addToSearchIndex(yyscanner,yyextra->name);
                                            }
                                          }
                                          else
                                          {
-                                           g_code->codify(yytext);
-                                           addToSearchIndex(g_name);
+                                           yyextra->code->codify(yytext);
+                                           addToSearchIndex(yyscanner,yyextra->name);
                                          }
-                                         g_name.resize(0);
+                                         yyextra->name.resize(0);
                                          BEGIN(ObjCMemberCall3);
                                        }
 <ObjCMemberCall2,ObjCMemberCall3>"]"   {
-                                         g_theCallContext.popScope(g_name, g_type);
-                                         g_code->codify(yytext);
+                                         yyextra->theCallContext.popScope(yyextra->name, yyextra->type);
+                                         yyextra->code->codify(yytext);
                                          BEGIN(Body);
                                        }
   */
 <ObjCCall,ObjCMName>"["|"{"       {
-                                    saveObjCContext();
-                                   g_currentCtx->format+=*yytext;
+                                    saveObjCContext(yyscanner);
+                                   yyextra->currentCtx->format+=*yytext;
                                    BEGIN(ObjCCall);
                                    //printf("open\n");
                                   }
 <ObjCCall,ObjCMName>"]"|"}"       {
-                                   g_currentCtx->format+=*yytext;
-                                    restoreObjCContext();
+                                   yyextra->currentCtx->format+=*yytext;
+                                    restoreObjCContext(yyscanner);
                                    BEGIN(ObjCMName);
-                                   if (g_currentCtx==0)
+                                   if (yyextra->currentCtx==0)
                                    {
                                      // end of call
-                                     writeObjCMethodCall(g_contextDict.find(0));
+                                     writeObjCMethodCall(yyscanner,yyextra->contextDict.find(0));
                                      BEGIN(Body);
                                    }
                                    //printf("close\n");
                                   }
 <ObjCCall,ObjCMName>"//".*        {
-                                    g_currentCtx->format+=escapeComment(yytext);
+                                    yyextra->currentCtx->format+=escapeComment(yyscanner,yytext);
                                   }
 <ObjCCall,ObjCMName>"/*"          {
-                                    g_lastObjCCallContext = YY_START;
-                                    g_currentCtx->comment=yytext;
+                                    yyextra->lastObjCCallContext = YY_START;
+                                    yyextra->currentCtx->comment=yytext;
                                     BEGIN(ObjCCallComment);
                                   }
 <ObjCCallComment>"*/"            {
-                                    g_currentCtx->comment+=yytext;
-                                    g_currentCtx->format+=escapeComment(g_currentCtx->comment);
-                                   BEGIN(g_lastObjCCallContext);
+                                    yyextra->currentCtx->comment+=yytext;
+                                    yyextra->currentCtx->format+=escapeComment(yyscanner,yyextra->currentCtx->comment);
+                                   BEGIN(yyextra->lastObjCCallContext);
                                  }
-<ObjCCallComment>[^*\n]+          { g_currentCtx->comment+=yytext; }
-<ObjCCallComment>"//"|"/*"        { g_currentCtx->comment+=yytext; }
-<ObjCCallComment>\n               { g_currentCtx->comment+=*yytext; }
-<ObjCCallComment>.                { g_currentCtx->comment+=*yytext; }
+<ObjCCallComment>[^*\n]+          { yyextra->currentCtx->comment+=yytext; }
+<ObjCCallComment>"//"|"/*"        { yyextra->currentCtx->comment+=yytext; }
+<ObjCCallComment>\n               { yyextra->currentCtx->comment+=*yytext; }
+<ObjCCallComment>.                { yyextra->currentCtx->comment+=*yytext; }
 <ObjCCall>{ID}                   {
-                                    g_currentCtx->format+=escapeObject(yytext);
-                                   if (g_braceCount==0)
+                                    yyextra->currentCtx->format+=escapeObject(yyscanner,yytext);
+                                   if (yyextra->braceCount==0)
                                    {
-                                     g_currentCtx->objectTypeOrName=yytext;
-                                      //printf("new type=%s\n",g_currentCtx->objectTypeOrName.data());
+                                     yyextra->currentCtx->objectTypeOrName=yytext;
+                                      //printf("new type=%s\n",yyextra->currentCtx->objectTypeOrName.data());
                                      BEGIN(ObjCMName);
                                    }
                                  }
 <ObjCMName>{ID}/{BN}*"]"          { 
-                                    if (g_braceCount==0 && 
-                                       g_currentCtx->methodName.isEmpty())
+                                    if (yyextra->braceCount==0 && 
+                                       yyextra->currentCtx->methodName.isEmpty())
                                     {
-                                     g_currentCtx->methodName=yytext; 
-                                      g_currentCtx->format+=escapeName(yytext);
+                                     yyextra->currentCtx->methodName=yytext; 
+                                      yyextra->currentCtx->format+=escapeName(yyscanner,yytext);
                                    }
                                    else
                                    {
-                                      g_currentCtx->format+=escapeWord(yytext);
+                                      yyextra->currentCtx->format+=escapeWord(yyscanner,yytext);
                                    }
                                   }
 <ObjCMName>{ID}/{BN}*":"           { 
-                                     if (g_braceCount==0)
+                                     if (yyextra->braceCount==0)
                                      {
-                                      g_currentCtx->methodName+=yytext;
-                                       g_currentCtx->methodName+=":";
+                                      yyextra->currentCtx->methodName+=yytext;
+                                       yyextra->currentCtx->methodName+=":";
                                     }
-                                     g_currentCtx->format+=escapeName(yytext);
+                                     yyextra->currentCtx->format+=escapeName(yyscanner,yytext);
                                    }
-<ObjCSkipStr>[^\n\"$\\]*           { g_currentCtx->format+=yytext; }
-<ObjCSkipStr>\\.                  { g_currentCtx->format+=yytext; }
-<ObjCSkipStr>"\""                 { g_currentCtx->format+=yytext; 
-                                      BEGIN(g_lastStringContext); 
+<ObjCSkipStr>[^\n\"$\\]*           { yyextra->currentCtx->format+=yytext; }
+<ObjCSkipStr>\\.                  { yyextra->currentCtx->format+=yytext; }
+<ObjCSkipStr>"\""                 { yyextra->currentCtx->format+=yytext; 
+                                      BEGIN(yyextra->lastStringContext); 
                                    }
-<ObjCCall,ObjCMName>{CHARLIT}      { g_currentCtx->format+=yytext; }
-<ObjCCall,ObjCMName>"@"?"\""       { g_currentCtx->format+=yytext; 
-                                      g_lastStringContext=YY_START;
+<ObjCCall,ObjCMName>{CHARLIT}      { yyextra->currentCtx->format+=yytext; }
+<ObjCCall,ObjCMName>"@"?"\""       { yyextra->currentCtx->format+=yytext; 
+                                      yyextra->lastStringContext=YY_START;
                                       BEGIN(ObjCSkipStr); 
                                    }
-<ObjCCall,ObjCMName,ObjCSkipStr>"$" { g_currentCtx->format+="$$"; }
-<ObjCCall,ObjCMName>"("            { g_currentCtx->format+=*yytext; g_braceCount++; }
-<ObjCCall,ObjCMName>")"            { g_currentCtx->format+=*yytext; g_braceCount--; }
+<ObjCCall,ObjCMName,ObjCSkipStr>"$" { yyextra->currentCtx->format+="$$"; }
+<ObjCCall,ObjCMName>"("            { yyextra->currentCtx->format+=*yytext; yyextra->braceCount++; }
+<ObjCCall,ObjCMName>")"            { yyextra->currentCtx->format+=*yytext; yyextra->braceCount--; }
 <ObjCSkipStr>"@"/"\""             { // needed to prevent matching the global rule (for C#)
-                                     g_currentCtx->format+=yytext;
+                                     yyextra->currentCtx->format+=yytext;
                                    }
-<ObjCCall,ObjCMName,ObjCSkipStr>{ID} { g_currentCtx->format+=escapeWord(yytext); }
-<ObjCCall,ObjCMName,ObjCSkipStr>.  { g_currentCtx->format+=*yytext; }
-<ObjCCall,ObjCMName,ObjCSkipStr>\n { g_currentCtx->format+=*yytext; }
+<ObjCCall,ObjCMName,ObjCSkipStr>{ID} { yyextra->currentCtx->format+=escapeWord(yyscanner,yytext); }
+<ObjCCall,ObjCMName,ObjCSkipStr>.  { yyextra->currentCtx->format+=*yytext; }
+<ObjCCall,ObjCMName,ObjCSkipStr>\n { yyextra->currentCtx->format+=*yytext; }
 
 <Body>"]"                              {
-                                         g_theCallContext.popScope(g_name, g_type);
-                                         g_code->codify(yytext);
+                                         yyextra->theCallContext.popScope(yyextra->name, yyextra->type);
+                                         yyextra->code->codify(yytext);
                                          // TODO: nested arrays like: a[b[0]->func()]->func()
-                                         g_name = g_saveName.copy();
-                                         g_type = g_saveType.copy();
+                                         yyextra->name = yyextra->saveName.copy();
+                                         yyextra->type = yyextra->saveType.copy();
                                        }
 <Body>[0-9]+                           {
-                                         g_code->codify(yytext);
+                                         yyextra->code->codify(yytext);
                                        }
 <Body>[0-9]+[xX][0-9A-Fa-f]+           {
-                                         g_code->codify(yytext);
+                                         yyextra->code->codify(yytext);
                                        }
 <MemberCall2,FuncCall>{KEYWORD}/([^a-z_A-Z0-9]) {
-                                         //addParmType();
-                                         //g_parmName=yytext; 
-                                          if (skipLanguageSpecificKeyword(yytext)) REJECT;
-                                         startFontClass("keyword");
-                                         g_code->codify(yytext);
-                                         endFontClass();
+                                         //addParmType(yyscanner);
+                                         //yyextra->parmName=yytext; 
+                                          if (skipLanguageSpecificKeyword(yyscanner,yytext)) REJECT;
+                                         startFontClass(yyscanner,"keyword");
+                                         yyextra->code->codify(yytext);
+                                         endFontClass(yyscanner);
                                        }
 <MemberCall2,FuncCall,OldStyleArgs,TemplCast>{TYPEKW}/([^a-z_A-Z0-9]) {
-                                         addParmType();
-                                         g_parmName=yytext; 
-                                         startFontClass("keywordtype");
-                                         g_code->codify(yytext);
-                                         endFontClass();
+                                         addParmType(yyscanner);
+                                         yyextra->parmName=yytext; 
+                                         startFontClass(yyscanner,"keywordtype");
+                                         yyextra->code->codify(yytext);
+                                         endFontClass(yyscanner);
                                        }
 <MemberCall2,FuncCall,OldStyleArgs,TemplCast>{TYPEKWSL}/([^a-z_A-Z0-9]) {
-                                          if (!g_insideSlice)
+                                          if (yyextra->lang!=SrcLangExt_Slice)
                                           {
                                             REJECT;
                                           }
                                           else
                                           {
-                                           addParmType();
-                                           g_parmName=yytext; 
-                                           startFontClass("keywordtype");
-                                           g_code->codify(yytext);
-                                           endFontClass();
+                                           addParmType(yyscanner);
+                                           yyextra->parmName=yytext; 
+                                           startFontClass(yyscanner,"keywordtype");
+                                           yyextra->code->codify(yytext);
+                                           endFontClass(yyscanner);
                                           }
                                        }
 <MemberCall2,FuncCall>{FLOWKW}/([^a-z_A-Z0-9]) {
-                                         addParmType();
-                                         g_parmName=yytext; 
-                                         startFontClass("keywordflow");
-                                         g_code->codify(yytext);
-                                         endFontClass();
+                                         addParmType(yyscanner);
+                                         yyextra->parmName=yytext; 
+                                         startFontClass(yyscanner,"keywordflow");
+                                         yyextra->code->codify(yytext);
+                                         endFontClass(yyscanner);
                                        }
 <MemberCall2,FuncCall>{FLOWCONDITION}/([^a-z_A-Z0-9]) {
-                                          if (g_currentMemberDef && g_currentMemberDef->isFunction())
+                                          if (yyextra->currentMemberDef && yyextra->currentMemberDef->isFunction())
                                           {
-                                            g_currentMemberDef->incrementFlowKeyWordCount();
+                                            yyextra->currentMemberDef->incrementFlowKeyWordCount();
                                           }
-                                          addParmType();
-                                          g_parmName=yytext;
-                                          startFontClass("keywordflow");
-                                          g_code->codify(yytext);
-                                          endFontClass();
+                                          addParmType(yyscanner);
+                                          yyextra->parmName=yytext;
+                                          startFontClass(yyscanner,"keywordflow");
+                                          yyextra->code->codify(yytext);
+                                          endFontClass(yyscanner);
                                         }
 <MemberCall2,FuncCall>{ID}(({B}*"<"[^\n\[\](){}<>]*">")?({B}*"::"{B}*{ID})?)* {
-                                         addParmType();
-                                         g_parmName=yytext; 
-                                         generateClassOrGlobalLink(*g_code,yytext,!g_insideBody);
+                                         if (isCastKeyword(yytext))
+                                         {
+                                           REJECT;
+                                         }
+                                         addParmType(yyscanner);
+                                         yyextra->parmName=yytext; 
+                                         generateClassOrGlobalLink(yyscanner,*yyextra->code,yytext,!yyextra->insideBody);
                                        }
 <FuncCall>";"                          { // probably a cast, not a function call
-                                         g_code->codify(yytext);
-                                         g_inForEachExpression = FALSE;
+                                         yyextra->code->codify(yytext);
+                                         yyextra->inForEachExpression = FALSE;
                                          BEGIN( Body );
                                        }
 <MemberCall2,FuncCall>,                        {
-                                         g_code->codify(yytext);
-                                         g_theVarContext.addVariable(g_parmType,g_parmName);
-                                         g_parmType.resize(0);g_parmName.resize(0);
+                                         yyextra->code->codify(yytext);
+                                         yyextra->theVarContext.addVariable(yyscanner,yyextra->parmType,yyextra->parmName);
+                                         yyextra->parmType.resize(0);yyextra->parmName.resize(0);
                                        }
 <MemberCall2,FuncCall>"{"              {
-                                          if (g_bracketCount>0)
+                                          if (yyextra->bracketCount>0)
                                           {
-                                            g_code->codify(yytext);
-                                            g_skipInlineInitContext=YY_START;
-                                            g_curlyCount=0;
+                                            yyextra->code->codify(yytext);
+                                            yyextra->skipInlineInitContext=YY_START;
+                                            yyextra->curlyCount=0;
                                             BEGIN(InlineInit);
                                           }
                                           else
@@ -3088,30 +1647,30 @@ RAWEND    ")"[^ \t\(\)\\]{0,16}\"
                                             REJECT;
                                           }
                                         }
-<InlineInit>"{"                         { g_curlyCount++;
-                                          g_code->codify(yytext);
+<InlineInit>"{"                         { yyextra->curlyCount++;
+                                          yyextra->code->codify(yytext);
                                         }
 <InlineInit>"}"                         {
-                                          g_code->codify(yytext);
-                                          if (--g_curlyCount<=0)
+                                          yyextra->code->codify(yytext);
+                                          if (--yyextra->curlyCount<=0)
                                           {
-                                            BEGIN(g_skipInlineInitContext);
+                                            BEGIN(yyextra->skipInlineInitContext);
                                           }
                                         }
 <InlineInit>\n                          {
-                                          codifyLines(yytext);
+                                          codifyLines(yyscanner,yytext);
                                         }
 <InlineInit>.                           {
-                                          g_code->codify(yytext);
+                                          yyextra->code->codify(yytext);
                                         }
 <MemberCall2,FuncCall>"("              {
-                                         g_parmType.resize(0);g_parmName.resize(0);
-                                         g_code->codify(yytext);
-                                         g_bracketCount++; 
-                                         g_theCallContext.pushScope(g_name, g_type);
-                                         if (YY_START==FuncCall && !g_insideBody)
+                                         yyextra->parmType.resize(0);yyextra->parmName.resize(0);
+                                         yyextra->code->codify(yytext);
+                                         yyextra->bracketCount++; 
+                                         yyextra->theCallContext.pushScope(yyextra->name, yyextra->type);
+                                         if (YY_START==FuncCall && !yyextra->insideBody)
                                          {
-                                           g_theVarContext.pushScope();
+                                           yyextra->theVarContext.pushScope();
                                          }
                                        }
 <MemberCall2,FuncCall>{OPERATOR}        { // operator
@@ -3121,34 +1680,34 @@ RAWEND    ")"[^ \t\(\)\\]{0,16}\"
                                              qstrcmp(yytext,"%")) // typically a pointer or reference
                                          {
                                            // not a * or &, or C++/CLI's ^ or %
-                                           g_parmType.resize(0);g_parmName.resize(0);
+                                           yyextra->parmType.resize(0);yyextra->parmName.resize(0);
                                          }
-                                         g_code->codify(yytext);
+                                         yyextra->code->codify(yytext);
                                        }
 <MemberCall,MemberCall2,FuncCall>("*"{B}*)?")" { 
                                           if (yytext[0]==')') // no a pointer cast
                                           {
-                                            //printf("addVariable(%s,%s)\n",g_parmType.data(),g_parmName.data());
-                                            if (g_parmType.isEmpty())
+                                            //printf("addVariable(%s,%s)\n",yyextra->parmType.data(),yyextra->parmName.data());
+                                            if (yyextra->parmType.isEmpty())
                                             {
-                                              g_parmType=g_parmName;
-                                              g_parmName.resize(0);
+                                              yyextra->parmType=yyextra->parmName;
+                                              yyextra->parmName.resize(0);
                                             }
-                                           g_theVarContext.addVariable(g_parmType,g_parmName);
+                                           yyextra->theVarContext.addVariable(yyscanner,yyextra->parmType,yyextra->parmName);
                                           }
                                           else
                                           {
-                                            g_parmType = g_parmName;
-                                            g_parmName.resize(0);
-                                           g_theVarContext.addVariable(g_parmType,g_parmName);
+                                            yyextra->parmType = yyextra->parmName;
+                                            yyextra->parmName.resize(0);
+                                           yyextra->theVarContext.addVariable(yyscanner,yyextra->parmType,yyextra->parmName);
                                           }
-                                         g_theCallContext.popScope(g_name, g_type);
-                                         g_inForEachExpression = FALSE;
-                                         //g_theCallContext.setClass(0); // commented out, otherwise a()->b() does not work for b().
-                                         g_code->codify(yytext);
-                                         if (--g_bracketCount<=0) 
+                                         yyextra->theCallContext.popScope(yyextra->name, yyextra->type);
+                                         yyextra->inForEachExpression = FALSE;
+                                         //yyextra->theCallContext.setClass(0); // commented out, otherwise a()->b() does not work for b().
+                                         yyextra->code->codify(yytext);
+                                         if (--yyextra->bracketCount<=0) 
                                          {
-                                           if (g_name.isEmpty())
+                                           if (yyextra->name.isEmpty())
                                            {
                                              BEGIN( Body );
                                            }
@@ -3158,319 +1717,319 @@ RAWEND    ")"[^ \t\(\)\\]{0,16}\"
                                            }
                                          }
                                        }
-<CallEnd>[ \t\n]*                      { codifyLines(yytext); }
+<CallEnd>[ \t\n]*                      { codifyLines(yyscanner,yytext); }
   /*
 <MemberCall2,FuncCall>")"[ \t\n]*[;:]  {
   */
 <CallEnd>[;:]                          {
-                                         codifyLines(yytext);
-                                         g_bracketCount=0;
-                                         if (*yytext==';') g_searchingForBody=FALSE; 
-                                         if (!g_type.isEmpty())
+                                         codifyLines(yyscanner,yytext);
+                                         yyextra->bracketCount=0;
+                                         if (*yytext==';') yyextra->searchingForBody=FALSE; 
+                                         if (!yyextra->type.isEmpty())
                                          {
-                                           DBG_CTX((stderr,"add variable g_type=%s g_name=%s)\n",g_type.data(),g_name.data()));
-                                           g_theVarContext.addVariable(g_type,g_name);
+                                           DBG_CTX((stderr,"add variable yyextra->type=%s yyextra->name=%s)\n",yyextra->type.data(),yyextra->name.data()));
+                                           yyextra->theVarContext.addVariable(yyscanner,yyextra->type,yyextra->name);
                                          }
-                                         g_parmType.resize(0);g_parmName.resize(0);
-                                         g_theCallContext.setScope(0);
-                                         if (*yytext==';' || g_insideBody)
+                                         yyextra->parmType.resize(0);yyextra->parmName.resize(0);
+                                         yyextra->theCallContext.setScope(0);
+                                         if (*yytext==';' || yyextra->insideBody)
                                          {
-                                           if (!g_insideBody)
+                                           if (!yyextra->insideBody)
                                            {
-                                              g_theVarContext.popScope();
+                                              yyextra->theVarContext.popScope();
                                            }
-                                           g_name.resize(0);g_type.resize(0);
+                                           yyextra->name.resize(0);yyextra->type.resize(0);
                                            BEGIN( Body );
                                          }
                                          else
                                          {
-                                           g_bracketCount=0;
+                                           yyextra->bracketCount=0;
                                            BEGIN( SkipInits );
                                          }
                                        }
 <CallEnd>("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"sealed"|"override"))*/{BN}*(";"|"="|"throw"{BN}*"(") {
-                                         startFontClass("keyword");
-                                         codifyLines(yytext);
-                                         endFontClass();
+                                         startFontClass(yyscanner,"keyword");
+                                         codifyLines(yyscanner,yytext);
+                                         endFontClass(yyscanner);
                                        }
 <CallEnd,OldStyleArgs>("const"|"volatile"|"sealed"|"override")*({BN}+("const"|"volatile"|"sealed"|"override"))*{BN}*"{" {
-                                          if (g_insideBody)
+                                          if (yyextra->insideBody)
                                          {
-                                           g_theVarContext.pushScope();
+                                           yyextra->theVarContext.pushScope();
                                          }
-                                         g_theVarContext.addVariable(g_parmType,g_parmName);
-                                         //g_theCallContext.popScope(g_name, g_type);
-                                         g_parmType.resize(0);g_parmName.resize(0);
-                                         int index = g_name.findRev("::");
-                                         DBG_CTX((stderr,"g_name=%s\n",g_name.data()));
+                                         yyextra->theVarContext.addVariable(yyscanner,yyextra->parmType,yyextra->parmName);
+                                         //yyextra->theCallContext.popScope(yyextra->name, yyextra->type);
+                                         yyextra->parmType.resize(0);yyextra->parmName.resize(0);
+                                         int index = yyextra->name.findRev("::");
+                                         DBG_CTX((stderr,"yyextra->name=%s\n",yyextra->name.data()));
                                          if (index!=-1) 
                                          {
-                                           QCString scope = g_name.left(index);
-                                           if (!g_classScope.isEmpty()) scope.prepend(g_classScope+"::");
-                                           const ClassDef *cd=getResolvedClass(Doxygen::globalScope,g_sourceFileDef,scope);
+                                           QCString scope = yyextra->name.left(index);
+                                           if (!yyextra->classScope.isEmpty()) scope.prepend(yyextra->classScope+"::");
+                                           const ClassDef *cd=getResolvedClass(Doxygen::globalScope,yyextra->sourceFileDef,scope);
                                            if (cd)
                                            {
-                                             setClassScope(cd->name());
-                                             g_scopeStack.push(SCOPEBLOCK);
+                                             setClassScope(yyscanner,cd->name());
+                                             yyextra->scopeStack.push(SCOPEBLOCK);
                                               DBG_CTX((stderr,"** scope stack push SCOPEBLOCK\n"));
                                            }
                                            else 
                                            {
-                                             //setClassScope(g_realScope);
-                                             g_scopeStack.push(INNERBLOCK);
+                                             //setClassScope(yyscanner,yyextra->realScope);
+                                             yyextra->scopeStack.push(INNERBLOCK);
                                               DBG_CTX((stderr,"** scope stack push INNERBLOCK\n"));
                                            }
                                          }
                                          else
                                          {
                                             DBG_CTX((stderr,"** scope stack push INNERBLOCK\n"));
-                                           g_scopeStack.push(INNERBLOCK);
+                                           yyextra->scopeStack.push(INNERBLOCK);
                                          }
                                          yytext[yyleng-1]='\0';
                                          QCString cv(yytext);
                                          if (!cv.stripWhiteSpace().isEmpty())
                                          {
-                                           startFontClass("keyword");
-                                           codifyLines(yytext);
-                                           endFontClass();
+                                           startFontClass(yyscanner,"keyword");
+                                           codifyLines(yyscanner,yytext);
+                                           endFontClass(yyscanner);
                                          }
                                          else // just whitespace
                                          {
-                                           codifyLines(yytext);
+                                           codifyLines(yyscanner,yytext);
                                          }
-                                         g_code->codify("{");
-                                         if (g_searchingForBody)
+                                         yyextra->code->codify("{");
+                                         if (yyextra->searchingForBody)
                                          {
-                                           g_searchingForBody=FALSE;
-                                           g_insideBody=TRUE;
+                                           yyextra->searchingForBody=FALSE;
+                                           yyextra->insideBody=TRUE;
                                          }
-                                         if (g_insideBody) g_bodyCurlyCount++;
-                                         g_type.resize(0); g_name.resize(0);
+                                         if (yyextra->insideBody) yyextra->bodyCurlyCount++;
+                                         yyextra->type.resize(0); yyextra->name.resize(0);
                                          BEGIN( Body );
                                        }
 <CallEnd>"try"                         { // function-try-block
-                                         startFontClass("keyword");
-                                         g_code->codify(yytext);
-                                         endFontClass();
-                                         g_inFunctionTryBlock=TRUE;
+                                         startFontClass(yyscanner,"keyword");
+                                         yyextra->code->codify(yytext);
+                                         endFontClass(yyscanner);
+                                         yyextra->inFunctionTryBlock=TRUE;
                                         }
 <CallEnd>{ID}                          {
-                                         if (g_insideBody || !g_parmType.isEmpty()) 
+                                         if (yyextra->insideBody || !yyextra->parmType.isEmpty()) 
                                          {
                                            REJECT;
                                          }
                                          // could be K&R style definition
-                                         addParmType();
-                                         g_parmName=yytext; 
-                                         generateClassOrGlobalLink(*g_code,yytext,!g_insideBody);
+                                         addParmType(yyscanner);
+                                         yyextra->parmName=yytext; 
+                                         generateClassOrGlobalLink(yyscanner,*yyextra->code,yytext,!yyextra->insideBody);
                                          BEGIN(OldStyleArgs);
                                        }
 <OldStyleArgs>{ID}                     {
-                                         addParmType();
-                                         g_parmName=yytext; 
-                                         generateClassOrGlobalLink(*g_code,yytext,!g_insideBody);
+                                         addParmType(yyscanner);
+                                         yyextra->parmName=yytext; 
+                                         generateClassOrGlobalLink(yyscanner,*yyextra->code,yytext,!yyextra->insideBody);
                                        }
 <OldStyleArgs>[,;]                     {
-                                         g_code->codify(yytext);
-                                         g_theVarContext.addVariable(g_parmType,g_parmName);
-                                         if (*yytext==';') g_parmType.resize(0);
-                                         g_parmName.resize(0);
+                                         yyextra->code->codify(yytext);
+                                         yyextra->theVarContext.addVariable(yyscanner,yyextra->parmType,yyextra->parmName);
+                                         if (*yytext==';') yyextra->parmType.resize(0);
+                                         yyextra->parmName.resize(0);
                                        }
 <CallEnd,OldStyleArgs>"#"              {
-                                         startFontClass("preprocessor");
-                                         g_lastSkipCppContext = Body;
-                                         g_code->codify(yytext);
+                                         startFontClass(yyscanner,"preprocessor");
+                                         yyextra->lastSkipCppContext = Body;
+                                         yyextra->code->codify(yytext);
                                          BEGIN( SkipCPP );
                                        }
 <CallEnd>.                             {
                                          unput(*yytext);
-                                          if (!g_insideBody) 
+                                          if (!yyextra->insideBody) 
                                          {
-                                           g_theVarContext.popScope();
+                                           yyextra->theVarContext.popScope();
                                          }
-                                         g_name.resize(0);g_args.resize(0);
-                                         g_parmType.resize(0);g_parmName.resize(0);
+                                         yyextra->name.resize(0);yyextra->args.resize(0);
+                                         yyextra->parmType.resize(0);yyextra->parmName.resize(0);
                                          BEGIN( Body ); 
                                        }
 <SkipInits>";"                         {
-                                         g_code->codify(yytext);
-                                         g_type.resize(0); g_name.resize(0);
+                                         yyextra->code->codify(yytext);
+                                         yyextra->type.resize(0); yyextra->name.resize(0);
                                          BEGIN( Body );
                                        }
 <SkipInits>"{"                         { 
-                                         g_code->codify(yytext);
-                                         if (g_searchingForBody)
+                                         yyextra->code->codify(yytext);
+                                         if (yyextra->searchingForBody)
                                          {
-                                           g_searchingForBody=FALSE;
-                                           g_insideBody=TRUE;
+                                           yyextra->searchingForBody=FALSE;
+                                           yyextra->insideBody=TRUE;
                                          }
-                                         if (g_insideBody) g_bodyCurlyCount++;
-                                         if (g_name.find("::")!=-1) 
+                                         if (yyextra->insideBody) yyextra->bodyCurlyCount++;
+                                         if (yyextra->name.find("::")!=-1) 
                                          {
                                             DBG_CTX((stderr,"** scope stack push SCOPEBLOCK\n"));
-                                           g_scopeStack.push(SCOPEBLOCK);
-                                           setClassScope(g_realScope);
+                                           yyextra->scopeStack.push(SCOPEBLOCK);
+                                           setClassScope(yyscanner,yyextra->realScope);
                                          }
                                          else
                                          {
                                             DBG_CTX((stderr,"** scope stack push INNERBLOCK\n"));
-                                           g_scopeStack.push(INNERBLOCK);
+                                           yyextra->scopeStack.push(INNERBLOCK);
                                          }
-                                         g_type.resize(0); g_name.resize(0);
+                                         yyextra->type.resize(0); yyextra->name.resize(0);
                                          BEGIN( Body ); 
                                        }
 <SkipInits>{ID}                                {
-                                         generateClassOrGlobalLink(*g_code,yytext);
+                                         generateClassOrGlobalLink(yyscanner,*yyextra->code,yytext);
                                        }
 <FuncCall>{ID}/"("                     {
-                                         generateFunctionLink(*g_code,yytext);
+                                         generateFunctionLink(yyscanner,*yyextra->code,yytext);
                                        }
 <FuncCall>{ID}/("."|"->")               { 
-                                         g_name=yytext; 
-                                         generateClassOrGlobalLink(*g_code,yytext);
+                                         yyextra->name=yytext; 
+                                         generateClassOrGlobalLink(yyscanner,*yyextra->code,yytext);
                                          BEGIN( MemberCall2 ); 
                                        }
 <FuncCall,MemberCall2>("("{B}*("*"{B}*)+{ID}*{B}*")"{B}*)/("."|"->") { 
-                                         g_code->codify(yytext);
+                                         yyextra->code->codify(yytext);
                                          int s=0;while (!isId(yytext[s])) s++;
                                           int e=(int)yyleng-1;while (!isId(yytext[e])) e--;
-                                         g_name=((QCString)yytext).mid(s,e-s+1); 
+                                         yyextra->name=((QCString)yytext).mid(s,e-s+1); 
                                          BEGIN( MemberCall2 ); 
                                        }
 <MemberCall2>{ID}/([ \t\n]*"(")         { 
-                                         if (!g_args.isEmpty())
-                                           generateMemberLink(*g_code,g_args,yytext);
+                                         if (!yyextra->args.isEmpty())
+                                           generateMemberLink(yyscanner,*yyextra->code,yyextra->args,yytext);
                                          else
-                                           generateClassOrGlobalLink(*g_code,yytext);
-                                         g_args.resize(0);
+                                           generateClassOrGlobalLink(yyscanner,*yyextra->code,yytext);
+                                         yyextra->args.resize(0);
                                          BEGIN( FuncCall );
                                        }
 <MemberCall2>{ID}/([ \t\n]*("."|"->"))  {
-                                         //g_code->codify(yytext);
-                                         g_name=yytext; 
-                                         generateClassOrGlobalLink(*g_code,yytext);
+                                         //yyextra->code->codify(yytext);
+                                         yyextra->name=yytext; 
+                                         generateClassOrGlobalLink(yyscanner,*yyextra->code,yytext);
                                          BEGIN( MemberCall2 ); 
                                        }
 <MemberCall2>"->"|"."                  {
                                          if (yytext[0]=='-') // -> could be overloaded
                                          {
-                                           updateCallContextForSmartPointer();
+                                           updateCallContextForSmartPointer(yyscanner);
                                          }
-                                         g_code->codify(yytext);
-                                         g_memCallContext = YY_START;
+                                         yyextra->code->codify(yytext);
+                                         yyextra->memCallContext = YY_START;
                                          BEGIN( MemberCall ); 
                                        }
 <SkipComment>"/*"("!"?)"*/"            { 
-                                         g_code->codify(yytext);
-                                         endFontClass();
-                                         BEGIN( g_lastCContext ) ; 
+                                         yyextra->code->codify(yytext);
+                                         endFontClass(yyscanner);
+                                         BEGIN( yyextra->lastCContext ) ; 
                                        }
 <SkipComment>"//"|"/*"                 {
-                                         g_code->codify(yytext);
+                                         yyextra->code->codify(yytext);
                                        }
 <SkipComment>[^*/\n]+                  {
-                                         g_code->codify(yytext);
+                                         yyextra->code->codify(yytext);
                                        }
 <SkipComment>[ \t]*"*/"                        { 
-                                         g_code->codify(yytext);
-                                         endFontClass();
-                                         if (g_lastCContext==SkipCPP)
+                                         yyextra->code->codify(yytext);
+                                         endFontClass(yyscanner);
+                                         if (yyextra->lastCContext==SkipCPP)
                                           {
-                                            startFontClass("preprocessor");
+                                            startFontClass(yyscanner,"preprocessor");
                                           }
-                                         BEGIN( g_lastCContext ) ; 
+                                         BEGIN( yyextra->lastCContext ) ; 
                                        }
 <SkipCxxComment>[^\r\n]*"\\"[\r]?\n    { // line continuation
-                                         codifyLines(yytext);
+                                         codifyLines(yyscanner,yytext);
                                        }
 <SkipCxxComment>[^\r\n]+               { 
-                                         g_code->codify(yytext);
+                                         yyextra->code->codify(yytext);
                                        }
 <SkipCxxComment>\r                     
 <SkipCxxComment>\n                     {
                                          unput('\n');
-                                         endFontClass();
-                                         BEGIN( g_lastCContext ) ;
+                                         endFontClass(yyscanner);
+                                         BEGIN( yyextra->lastCContext ) ;
                                        }
 <SkipCxxComment>.                      {
-                                         g_code->codify(yytext);
+                                         yyextra->code->codify(yytext);
                                        }
 <RemoveSpecialCComment>"*/"{B}*\n({B}*\n)*({B}*(("//@"[{}])|("/*@"[{}]"*/")){B}*\n)?{B}*"/*"[*!]/[^/*] {
-                                         g_yyLineNr+=QCString(yytext).contains('\n');
+                                         yyextra->yyLineNr+=QCString(yytext).contains('\n');
                                        }
 <RemoveSpecialCComment>"*/"{B}*\n({B}*\n)*({B}*(("//@"[{}])|("/*@"[{}]"*/")){B}*\n)? {
-                                         g_yyLineNr+=QCString(yytext).contains('\n');
-                                         nextCodeLine();
-                                         if (g_lastSpecialCContext==SkipCxxComment)
+                                         yyextra->yyLineNr+=QCString(yytext).contains('\n');
+                                         nextCodeLine(yyscanner);
+                                         if (yyextra->lastSpecialCContext==SkipCxxComment)
                                          { // force end of C++ comment here
-                                           endFontClass();
-                                           BEGIN( g_lastCContext ) ;
+                                           endFontClass(yyscanner);
+                                           BEGIN( yyextra->lastCContext ) ;
                                          }
                                          else
                                          {
-                                           BEGIN(g_lastSpecialCContext);
+                                           BEGIN(yyextra->lastSpecialCContext);
                                          }
                                        }
 <RemoveSpecialCComment>"*/"            {
-                                         BEGIN(g_lastSpecialCContext);
+                                         BEGIN(yyextra->lastSpecialCContext);
                                        }
 <RemoveSpecialCComment>[^*\n]+
 <RemoveSpecialCComment>"//"|"/*"
-<RemoveSpecialCComment>\n  { g_yyLineNr++; }
+<RemoveSpecialCComment>\n  { yyextra->yyLineNr++; }
 <RemoveSpecialCComment>.
 <MemberCall>[^a-z_A-Z0-9(\n]           { 
-                                         g_code->codify(yytext);
-                                         g_type.resize(0);
-                                         g_name.resize(0);
-                                         BEGIN(g_memCallContext); 
+                                         yyextra->code->codify(yytext);
+                                         yyextra->type.resize(0);
+                                         yyextra->name.resize(0);
+                                         BEGIN(yyextra->memCallContext); 
                                        }
 <*>\n({B}*"//"[!/][^\n]*\n)+           { // remove special one-line comment
                                          if (YY_START==SkipCPP) REJECT;
                                          if (Config_getBool(STRIP_CODE_COMMENTS))
                                          {
-                                           g_yyLineNr+=((QCString)yytext).contains('\n');
-                                           nextCodeLine();
+                                           yyextra->yyLineNr+=((QCString)yytext).contains('\n');
+                                           nextCodeLine(yyscanner);
                                          }
                                          else
                                          {
-                                           startFontClass("comment");
-                                           codifyLines(yytext);
-                                           endFontClass();
+                                           startFontClass(yyscanner,"comment");
+                                           codifyLines(yyscanner,yytext);
+                                           endFontClass(yyscanner);
                                          }
                                          if (YY_START==SkipCxxComment)
                                          {
-                                           endFontClass();
-                                           BEGIN( g_lastCContext ) ;
+                                           endFontClass(yyscanner);
+                                           BEGIN( yyextra->lastCContext ) ;
                                          }
                                        }
 <SkipCPP>\n/.*\n                       { 
-                                         endFontClass();
-                                         codifyLines(yytext);
-                                         BEGIN( g_lastSkipCppContext ) ;
+                                         endFontClass(yyscanner);
+                                         codifyLines(yyscanner,yytext);
+                                         BEGIN( yyextra->lastSkipCppContext ) ;
                                        }
 <*>\n{B}*"//@"[{}].*\n                 { // remove one-line group marker
                                          if (Config_getBool(STRIP_CODE_COMMENTS))
                                          {
-                                           g_yyLineNr+=2;
-                                           nextCodeLine();
+                                           yyextra->yyLineNr+=2;
+                                           nextCodeLine(yyscanner);
                                          }
                                          else
                                          {
-                                           startFontClass("comment");
-                                           codifyLines(yytext);
-                                           endFontClass();
+                                           startFontClass(yyscanner,"comment");
+                                           codifyLines(yyscanner,yytext);
+                                           endFontClass(yyscanner);
                                          }
                                          if (YY_START==SkipCxxComment)
                                          {
-                                           endFontClass();
-                                           BEGIN( g_lastCContext ) ;
+                                           endFontClass(yyscanner);
+                                           BEGIN( yyextra->lastCContext ) ;
                                          }
                                        }
 <*>\n{B}*"/*@"[{}]                     { // remove one-line group marker
                                          if (Config_getBool(STRIP_CODE_COMMENTS))
                                          {
-                                           if (YY_START != RemoveSpecialCComment) g_lastSpecialCContext = YY_START;
-                                           g_yyLineNr++;
+                                           if (YY_START != RemoveSpecialCComment) yyextra->lastSpecialCContext = YY_START;
+                                           yyextra->yyLineNr++;
                                            BEGIN(RemoveSpecialCComment);
                                          }
                                          else
@@ -3478,30 +2037,30 @@ RAWEND    ")"[^ \t\(\)\\]{0,16}\"
                                            // check is to prevent getting stuck in skipping C++ comments
                                            if (YY_START != SkipComment && YY_START != SkipCxxComment)
                                            {
-                                             g_lastCContext = YY_START ;
+                                             yyextra->lastCContext = YY_START ;
                                            }
-                                           startFontClass("comment");
-                                           codifyLines(yytext);
+                                           startFontClass(yyscanner,"comment");
+                                           codifyLines(yyscanner,yytext);
                                            BEGIN(SkipComment);
                                          }
                                        }
 <*>^{B}*"//@"[{}].*\n                  { // remove one-line group marker
                                          if (Config_getBool(STRIP_CODE_COMMENTS))
                                          {
-                                           g_yyLineNr++;
-                                           nextCodeLine();
+                                           yyextra->yyLineNr++;
+                                           nextCodeLine(yyscanner);
                                          }
                                          else
                                          {
-                                           startFontClass("comment");
-                                           codifyLines(yytext);
-                                           endFontClass();
+                                           startFontClass(yyscanner,"comment");
+                                           codifyLines(yyscanner,yytext);
+                                           endFontClass(yyscanner);
                                          }
                                        }
 <*>^{B}*"/*@"[{}]                      { // remove multi-line group marker
                                          if (Config_getBool(STRIP_CODE_COMMENTS))
                                          {
-                                           if (YY_START != RemoveSpecialCComment) g_lastSpecialCContext = YY_START;
+                                           if (YY_START != RemoveSpecialCComment) yyextra->lastSpecialCContext = YY_START;
                                            BEGIN(RemoveSpecialCComment);
                                          }
                                          else
@@ -3509,24 +2068,24 @@ RAWEND    ")"[^ \t\(\)\\]{0,16}\"
                                            // check is to prevent getting stuck in skipping C++ comments
                                            if (YY_START != SkipComment && YY_START != SkipCxxComment)
                                            {
-                                             g_lastCContext = YY_START ;
+                                             yyextra->lastCContext = YY_START ;
                                            }
-                                           startFontClass("comment");
-                                           g_code->codify(yytext);
+                                           startFontClass(yyscanner,"comment");
+                                           yyextra->code->codify(yytext);
                                            BEGIN(SkipComment);
                                          }
                                        }
 <*>^{B}*"//"[!/][^\n]*\n               { // remove special one-line comment
                                          if (Config_getBool(STRIP_CODE_COMMENTS))
                                          {
-                                           g_yyLineNr++;
-                                           //nextCodeLine();
+                                           yyextra->yyLineNr++;
+                                           //nextCodeLine(yyscanner);
                                          }
                                          else
                                          {
-                                           startFontClass("comment");
-                                           codifyLines(yytext);
-                                           endFontClass();
+                                           startFontClass(yyscanner,"comment");
+                                           codifyLines(yyscanner,yytext);
+                                           endFontClass(yyscanner);
                                          }
                                        }
 <*>"//"[!/][^\n]*\n                    { // strip special one-line comment
@@ -3534,26 +2093,26 @@ RAWEND    ")"[^ \t\(\)\\]{0,16}\"
                                          if (Config_getBool(STRIP_CODE_COMMENTS))
                                          {
                                            char c[2]; c[0]='\n'; c[1]=0;
-                                           codifyLines(c);
+                                           codifyLines(yyscanner,c);
                                          }
                                          else
                                          {
-                                           startFontClass("comment");
-                                           codifyLines(yytext);
-                                           endFontClass();
+                                           startFontClass(yyscanner,"comment");
+                                           codifyLines(yyscanner,yytext);
+                                           endFontClass(yyscanner);
                                          }
                                        }
 <*>"/*[tag:"[^\]\n]*"]*/"{B}*          { // special pattern /*[tag:filename]*/ to force linking to a tag file
-                                         g_forceTagReference=yytext;
-                                         int s=g_forceTagReference.find(':');
-                                         int e=g_forceTagReference.findRev(']');
-                                         g_forceTagReference = g_forceTagReference.mid(s+1,e-s-1);
+                                         yyextra->forceTagReference=yytext;
+                                         int s=yyextra->forceTagReference.find(':');
+                                         int e=yyextra->forceTagReference.findRev(']');
+                                         yyextra->forceTagReference = yyextra->forceTagReference.mid(s+1,e-s-1);
                                        }
 <*>\n{B}*"/*"[!*]/[^/*]                {
                                          if (Config_getBool(STRIP_CODE_COMMENTS))
                                          {
-                                           if (YY_START != RemoveSpecialCComment) g_lastSpecialCContext = YY_START;
-                                           g_yyLineNr++;
+                                           if (YY_START != RemoveSpecialCComment) yyextra->lastSpecialCContext = YY_START;
+                                           yyextra->yyLineNr++;
                                            BEGIN(RemoveSpecialCComment);
                                          }
                                          else
@@ -3561,17 +2120,17 @@ RAWEND    ")"[^ \t\(\)\\]{0,16}\"
                                            // check is to prevent getting stuck in skipping C++ comments
                                            if (YY_START != SkipComment && YY_START != SkipCxxComment)
                                            {
-                                             g_lastCContext = YY_START ;
+                                             yyextra->lastCContext = YY_START ;
                                            }
-                                           startFontClass("comment");
-                                           codifyLines(yytext);
+                                           startFontClass(yyscanner,"comment");
+                                           codifyLines(yyscanner,yytext);
                                            BEGIN(SkipComment);
                                          }
                                        }
 <*>^{B}*"/**"[*]+/[^/]                 { // special C "banner" comment block at a new line
                                          if (Config_getBool(JAVADOC_BANNER) && Config_getBool(STRIP_CODE_COMMENTS))
                                          {
-                                           if (YY_START != RemoveSpecialCComment) g_lastSpecialCContext = YY_START;
+                                           if (YY_START != RemoveSpecialCComment) yyextra->lastSpecialCContext = YY_START;
                                            BEGIN(RemoveSpecialCComment);
                                          }
                                          else
@@ -3579,17 +2138,17 @@ RAWEND    ")"[^ \t\(\)\\]{0,16}\"
                                            // check is to prevent getting stuck in skipping C++ comments
                                            if (YY_START != SkipComment && YY_START != SkipCxxComment)
                                            {
-                                             g_lastCContext = YY_START ;
+                                             yyextra->lastCContext = YY_START ;
                                            }
-                                           startFontClass("comment");
-                                           g_code->codify(yytext);
+                                           startFontClass(yyscanner,"comment");
+                                           yyextra->code->codify(yytext);
                                            BEGIN(SkipComment);
                                          }
                                        }
 <*>^{B}*"/*"[!*]/[^/*]                 { // special C comment block at a new line
                                          if (Config_getBool(STRIP_CODE_COMMENTS))
                                          {
-                                           if (YY_START != RemoveSpecialCComment) g_lastSpecialCContext = YY_START;
+                                           if (YY_START != RemoveSpecialCComment) yyextra->lastSpecialCContext = YY_START;
                                            BEGIN(RemoveSpecialCComment);
                                          }
                                          else
@@ -3597,10 +2156,10 @@ RAWEND    ")"[^ \t\(\)\\]{0,16}\"
                                            // check is to prevent getting stuck in skipping C++ comments
                                            if (YY_START != SkipComment && YY_START != SkipCxxComment)
                                            {
-                                             g_lastCContext = YY_START ;
+                                             yyextra->lastCContext = YY_START ;
                                            }
-                                           startFontClass("comment");
-                                           g_code->codify(yytext);
+                                           startFontClass(yyscanner,"comment");
+                                           yyextra->code->codify(yytext);
                                            BEGIN(SkipComment);
                                          }
                                        }
@@ -3608,7 +2167,7 @@ RAWEND    ")"[^ \t\(\)\\]{0,16}\"
                                           if (YY_START==SkipString) REJECT;
                                          if (Config_getBool(STRIP_CODE_COMMENTS))
                                          {
-                                           if (YY_START != RemoveSpecialCComment) g_lastSpecialCContext = YY_START;
+                                           if (YY_START != RemoveSpecialCComment) yyextra->lastSpecialCContext = YY_START;
                                            BEGIN(RemoveSpecialCComment);
                                          }
                                          else
@@ -3616,10 +2175,10 @@ RAWEND    ")"[^ \t\(\)\\]{0,16}\"
                                            // check is to prevent getting stuck in skipping C++ comments
                                            if (YY_START != SkipComment && YY_START != SkipCxxComment)
                                            {
-                                             g_lastCContext = YY_START ;
+                                             yyextra->lastCContext = YY_START ;
                                            }
-                                           startFontClass("comment");
-                                           g_code->codify(yytext);
+                                           startFontClass(yyscanner,"comment");
+                                           yyextra->code->codify(yytext);
                                            BEGIN(SkipComment);
                                          }
                                        }
@@ -3627,134 +2186,1728 @@ RAWEND    ")"[^ \t\(\)\\]{0,16}\"
                                           if (YY_START==SkipString) REJECT;
                                           if (!Config_getBool(STRIP_CODE_COMMENTS))
                                          {
-                                           startFontClass("comment");
-                                           g_code->codify(yytext);
-                                           endFontClass();
+                                           startFontClass(yyscanner,"comment");
+                                           yyextra->code->codify(yytext);
+                                           endFontClass(yyscanner);
                                          }
                                        }
 <SkipComment>[^\*\n]+                   {
-                                          g_code->codify(yytext);
+                                          yyextra->code->codify(yytext);
                                         }
 <*>"/*"                                        { 
-                                         startFontClass("comment");
-                                         g_code->codify(yytext);
+                                         startFontClass(yyscanner,"comment");
+                                         yyextra->code->codify(yytext);
                                          // check is to prevent getting stuck in skipping C++ comments
                                          if (YY_START != SkipComment && YY_START != SkipCxxComment)
                                          {
-                                           g_lastCContext = YY_START ;
+                                           yyextra->lastCContext = YY_START ;
                                          }
                                          BEGIN( SkipComment ) ;
                                        }
 <*>@\"                                 { // C# verbatim string
-                                         startFontClass("stringliteral");
-                                         g_code->codify(yytext);
-                                         g_lastVerbStringContext=YY_START;
+                                         startFontClass(yyscanner,"stringliteral");
+                                         yyextra->code->codify(yytext);
+                                         yyextra->lastVerbStringContext=YY_START;
                                          BEGIN(SkipVerbString);
                                        }
 <*>"//"                                        { 
-                                         startFontClass("comment");
-                                         g_code->codify(yytext);
-                                         g_lastCContext = YY_START ;
+                                         startFontClass(yyscanner,"comment");
+                                         yyextra->code->codify(yytext);
+                                         yyextra->lastCContext = YY_START ;
                                          BEGIN( SkipCxxComment ) ;
                                        }
 <*>"("|"["                                     {
-                                         g_code->codify(yytext);
-                                         g_theCallContext.pushScope(g_name, g_type);
+                                         yyextra->code->codify(yytext);
+                                         yyextra->theCallContext.pushScope(yyextra->name, yyextra->type);
                                        }
 <*>")"|"]"                                     {
-                                         g_code->codify(yytext);
-                                         g_theCallContext.popScope(g_name, g_type);
+                                         yyextra->code->codify(yytext);
+                                         yyextra->theCallContext.popScope(yyextra->name, yyextra->type);
                                        }
 <*>\n                                  {
-                                         g_yyColNr++;
-                                         codifyLines(yytext); 
+                                         yyextra->yyColNr++;
+                                         codifyLines(yyscanner,yytext); 
                                        }
 <*>.                                   {
-                                         g_yyColNr++;
-                                         g_code->codify(yytext);
+                                         yyextra->yyColNr++;
+                                         yyextra->code->codify(yytext);
                                        }
   /*
 <*>([ \t\n]*"\n"){2,}                  { // combine multiple blank lines
                                          //QCString sepLine=yytext;
-                                         //g_code->codify("\n\n");
-                                         //g_yyLineNr+=sepLine.contains('\n'); 
+                                         //yyextra->code->codify("\n\n");
+                                         //yyextra->yyLineNr+=sepLine.contains('\n'); 
                                          //char sepLine[3]="\n\n";
-                                         codifyLines(yytext);
+                                         codifyLines(yyscanner,yytext);
                                        }
   */
 
-%%
+%%
+
+/*@ ----------------------------------------------------------------------------
+ */
+
+void VariableContext::addVariable(yyscan_t yyscanner,const QCString &type,const QCString &name)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  //printf("VariableContext::addVariable(%s,%s)\n",type.data(),name.data());
+  QCString ltype = type.simplifyWhiteSpace();
+  QCString lname = name.simplifyWhiteSpace();
+  if (ltype.left(7)=="struct ") 
+  {
+    ltype = ltype.right(ltype.length()-7);
+  }
+  else if (ltype.left(6)=="union ")
+  {
+    ltype = ltype.right(ltype.length()-6);
+  }
+  if (ltype.isEmpty() || lname.isEmpty()) return;
+  DBG_CTX((stderr,"** addVariable trying: type='%s' name='%s' g_currentDefinition=%s\n",
+       ltype.data(),lname.data(),g_currentDefinition?g_currentDefinition->name().data():"<none>"));
+  Scope *scope = m_scopes.count()==0 ? &m_globalScope : m_scopes.getLast();
+  const ClassDef *varType;
+  int i=0;
+  if (
+      (varType=yyextra->codeClassSDict->find(ltype)) ||  // look for class definitions inside the code block
+      (varType=getResolvedClass(yyextra->currentDefinition,yyextra->sourceFileDef,ltype)) // look for global class definitions
+     ) 
+  {
+    DBG_CTX((stderr,"** addVariable type='%s' name='%s'\n",ltype.data(),lname.data()));
+    scope->append(lname,varType); // add it to a list
+  }
+  else if ((i=ltype.find('<'))!=-1)
+  {
+    // probably a template class
+    QCString typeName(ltype.left(i));
+    ClassDef* newDef = 0;
+    QCString templateArgs(ltype.right(ltype.length() - i));
+    if ( !typeName.isEmpty() &&
+         ( // look for class definitions inside the code block
+          (varType=yyextra->codeClassSDict->find(typeName)) ||
+           // otherwise look for global class definitions
+           (varType=getResolvedClass(yyextra->currentDefinition,yyextra->sourceFileDef,typeName,0,0,TRUE,TRUE))
+        ) && // and it must be a template
+         !varType->templateArguments().empty())
+    {
+      newDef = varType->getVariableInstance( templateArgs );
+    }
+    if (newDef)
+    {
+      DBG_CTX((stderr,"** addVariable type='%s' templ='%s' name='%s'\n",typeName.data(),templateArgs.data(),lname.data()));
+      scope->append(lname, newDef);
+    }
+    else
+    {
+      // Doesn't seem to be a template. Try just the base name.
+      addVariable(yyscanner,typeName,name);
+    }
+  }
+  else 
+  {
+    if (m_scopes.count()>0) // for local variables add a dummy entry so the name 
+                            // is hidden to avoid false links to global variables with the same name
+                            // TODO: make this work for namespaces as well!
+    {
+      DBG_CTX((stderr,"** addVariable: dummy context for '%s'\n",lname.data()));
+      scope->append(lname,dummyContext);
+    }
+    else
+    {
+      DBG_CTX((stderr,"** addVariable: not adding variable!\n"));
+    }
+  }
+}
+
+ClassDef *VariableContext::findVariable(const QCString &name)
+{
+  if (name.isEmpty()) return 0;
+  ClassDef *result = 0;
+  QListIterator<Scope> sli(m_scopes);
+  Scope *scope;
+  QCString key = name;
+  // search from inner to outer scope
+  for (sli.toLast();(scope=sli.current());--sli)
+  {
+    result = scope->find(key);
+    if (result)
+    {
+      DBG_CTX((stderr,"** findVariable(%s)=%p\n",name.data(),result));
+      return result;
+    }
+  }
+  // nothing found -> also try the global scope
+  result=m_globalScope.find(name);
+  DBG_CTX((stderr,"** findVariable(%s)=%p\n",name.data(),result));
+  return result;
+}
+
+const ClassDef *VariableContext::dummyContext = (ClassDef*)0x8;
+
+//-------------------------------------------------------------------
+
+/*! add class/namespace name s to the scope */
+static void pushScope(yyscan_t yyscanner,const char *s)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  yyextra->classScopeLengthStack.push(new int(yyextra->classScope.length()));
+  if (yyextra->classScope.isEmpty() || leftScopeMatch(s,yyextra->classScope))
+  {
+    yyextra->classScope = s;
+  }
+  else
+  {
+    yyextra->classScope += "::";
+    yyextra->classScope += s;
+  }
+  //printf("pushScope(%s) result: '%s'\n",s,yyextra->classScope.data());
+}
+
+
+/*! remove the top class/namespace name from the scope */
+static void popScope(yyscan_t yyscanner)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  if (!yyextra->classScopeLengthStack.isEmpty())
+  {
+    int *pLength = yyextra->classScopeLengthStack.pop();
+    yyextra->classScope.truncate(*pLength);
+    delete pLength;
+  }
+  else
+  {
+    //err("Too many end of scopes found!\n");
+  }
+  //printf("popScope() result: '%s'\n",yyextra->classScope.data());
+}
+
+static void setCurrentDoc(yyscan_t yyscanner,const QCString &anchor)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  if (Doxygen::searchIndex)
+  {
+    if (yyextra->searchCtx)
+    {
+      yyextra->code->setCurrentDoc(yyextra->searchCtx,yyextra->searchCtx->anchor(),FALSE);
+    }
+    else
+    {
+      yyextra->code->setCurrentDoc(yyextra->sourceFileDef,anchor,TRUE);
+    }
+  }
+}
+
+static void addToSearchIndex(yyscan_t yyscanner,const char *text)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  if (Doxygen::searchIndex)
+  {
+    yyextra->code->addWord(text,FALSE);
+  }
+}
+
+static void setClassScope(yyscan_t yyscanner,const QCString &name)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  //printf("setClassScope(%s)\n",name.data());
+  QCString n=name;
+  n=n.simplifyWhiteSpace();
+  int ts=n.find('<'); // start of template
+  int te=n.findRev('>'); // end of template
+  //printf("ts=%d te=%d\n",ts,te);
+  if (ts!=-1 && te!=-1 && te>ts)
+  {
+    // remove template from scope
+    n=n.left(ts)+n.right(n.length()-te-1);
+  }
+  while (!yyextra->classScopeLengthStack.isEmpty())
+  {
+    popScope(yyscanner);
+  }
+  yyextra->classScope.resize(0);
+  int i;
+  while ((i=n.find("::"))!=-1)
+  {
+    pushScope(yyscanner,n.left(i));
+    n = n.mid(i+2);
+  }
+  pushScope(yyscanner,n);
+  //printf("--->New class scope '%s'\n",yyextra->classScope.data());
+}
+
+/*! start a new line of code, inserting a line number if yyextra->sourceFileDef
+ * is TRUE. If a definition starts at the current line, then the line
+ * number is linked to the documentation of that definition.
+ */
+static void startCodeLine(yyscan_t yyscanner)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  //if (yyextra->currentFontClass) { yyextra->code->endFontClass(yyscanner); }
+  if (yyextra->sourceFileDef && yyextra->lineNumbers)
+  {
+    //QCString lineNumber,lineAnchor;
+    //lineNumber.sprintf("%05d",yyextra->yyLineNr);
+    //lineAnchor.sprintf("l%05d",yyextra->yyLineNr);
+   
+    Definition *d   = yyextra->sourceFileDef->getSourceDefinition(yyextra->yyLineNr);
+    //printf("%s:startCodeLine(%d)=%p\n",yyextra->sourceFileDef->name().data(),yyextra->yyLineNr,d);
+    if (!yyextra->includeCodeFragment && d)
+    {
+      yyextra->currentDefinition = d;
+      yyextra->currentMemberDef = yyextra->sourceFileDef->getSourceMember(yyextra->yyLineNr);
+      yyextra->insideBody = FALSE;
+      yyextra->searchingForBody = TRUE;
+      yyextra->realScope = d->name();
+      //yyextra->classScope = "";
+      yyextra->type.resize(0);
+      yyextra->name.resize(0);
+      yyextra->args.resize(0);
+      yyextra->parmType.resize(0);
+      yyextra->parmName.resize(0);
+      //printf("Real scope: '%s'\n",yyextra->realScope.data());
+      yyextra->bodyCurlyCount = 0;
+      QCString lineAnchor;
+      lineAnchor.sprintf("l%05d",yyextra->yyLineNr);
+      if (yyextra->currentMemberDef)
+      {
+        yyextra->code->writeLineNumber(yyextra->currentMemberDef->getReference(),
+                               yyextra->currentMemberDef->getOutputFileBase(),
+                               yyextra->currentMemberDef->anchor(),yyextra->yyLineNr);
+        setCurrentDoc(yyscanner,lineAnchor);
+      }
+      else if (d->isLinkableInProject())
+      {
+        yyextra->code->writeLineNumber(d->getReference(),
+                               d->getOutputFileBase(),
+                               0,yyextra->yyLineNr);
+        setCurrentDoc(yyscanner,lineAnchor);
+      }
+    }
+    else
+    {
+      yyextra->code->writeLineNumber(0,0,0,yyextra->yyLineNr);
+    }
+  }
+  DBG_CTX((stderr,"startCodeLine(%d)\n",yyextra->yyLineNr));
+  yyextra->code->startCodeLine(yyextra->sourceFileDef && yyextra->lineNumbers); 
+  if (yyextra->currentFontClass)
+  {
+    yyextra->code->startFontClass(yyextra->currentFontClass);
+  }
+}
+
+
+
+static void endCodeLine(yyscan_t yyscanner)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  DBG_CTX((stderr,"endCodeLine(%d)\n",yyextra->yyLineNr));
+  endFontClass(yyscanner);
+  yyextra->code->endCodeLine();
+}
+
+static void nextCodeLine(yyscan_t yyscanner)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  const char * fc = yyextra->currentFontClass;
+  endCodeLine(yyscanner);
+  if (yyextra->yyLineNr<yyextra->inputLines) 
+  {
+    yyextra->currentFontClass = fc;
+    startCodeLine(yyscanner);
+  }
+}
+
+/*! write a code fragment 'text' that may span multiple lines, inserting
+ * line numbers for each line.
+ */
+static void codifyLines(yyscan_t yyscanner,const char *text)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  //printf("codifyLines(%d,\"%s\")\n",yyextra->yyLineNr,text);
+  const char *p=text,*sp=p;
+  char c;
+  bool done=FALSE;
+  while (!done)
+  {
+    sp=p;
+    while ((c=*p++) && c!='\n') { yyextra->yyColNr++; }
+    if (c=='\n')
+    {
+      yyextra->yyLineNr++;
+      yyextra->yyColNr=1;
+      //*(p-1)='\0';
+      int l = (int)(p-sp-1);
+      char *tmp = (char*)malloc(l+1);
+      memcpy(tmp,sp,l);
+      tmp[l]='\0';
+      yyextra->code->codify(tmp);
+      free(tmp);
+      nextCodeLine(yyscanner);
+    }
+    else
+    {
+      yyextra->code->codify(sp);
+      done=TRUE;
+    }
+  }
+}
+
+/*! writes a link to a fragment \a text that may span multiple lines, inserting
+ * line numbers for each line. If \a text contains newlines, the link will be 
+ * split into multiple links with the same destination, one for each line.
+ */
+static void writeMultiLineCodeLink(yyscan_t yyscanner,CodeOutputInterface &ol,
+                                   const Definition *d,
+                                   const char *text)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  static bool sourceTooltips = Config_getBool(SOURCE_TOOLTIPS);
+  TooltipManager::instance()->addTooltip(d);
+  QCString ref  = d->getReference();
+  QCString file = d->getOutputFileBase();
+  QCString anchor = d->anchor();
+  QCString tooltip; 
+  if (!sourceTooltips) // fall back to simple "title" tooltips
+  {
+    tooltip = d->briefDescriptionAsTooltip();
+  }
+  bool done=FALSE;
+  char *p=(char *)text;
+  while (!done)
+  {
+    char *sp=p;
+    char c;
+    while ((c=*p++) && c!='\n') { }
+    if (c=='\n')
+    {
+      yyextra->yyLineNr++;
+      *(p-1)='\0';
+      //printf("writeCodeLink(%s,%s,%s,%s)\n",ref,file,anchor,sp);
+      ol.writeCodeLink(ref,file,anchor,sp,tooltip);
+      nextCodeLine(yyscanner);
+    }
+    else
+    {
+      //printf("writeCodeLink(%s,%s,%s,%s)\n",ref,file,anchor,sp);
+      ol.writeCodeLink(ref,file,anchor,sp,tooltip);
+      done=TRUE;
+    }
+  }
+}
+
+static void addType(yyscan_t yyscanner)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  if (yyextra->name=="const") { yyextra->name.resize(0); return; }
+  if (!yyextra->type.isEmpty()) yyextra->type += ' ' ;
+  yyextra->type += yyextra->name ;
+  yyextra->name.resize(0) ;
+  if (!yyextra->type.isEmpty()) yyextra->type += ' ' ;
+  yyextra->type += yyextra->args ;
+  yyextra->args.resize(0) ;
+}
+
+static void addParmType(yyscan_t yyscanner)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  if (yyextra->parmName=="const") { yyextra->parmName.resize(0); return; }
+  if (!yyextra->parmType.isEmpty()) yyextra->parmType += ' ' ;
+  yyextra->parmType += yyextra->parmName ;
+  yyextra->parmName.resize(0) ;
+}
+
+static void addUsingDirective(yyscan_t yyscanner,const char *name)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  if (yyextra->sourceFileDef && name)
+  {
+    NamespaceDef *nd = Doxygen::namespaceSDict->find(name);
+    if (nd)
+    {
+      yyextra->sourceFileDef->addUsingDirective(nd);
+    }
+  }
+}
+
+static void setParameterList(yyscan_t yyscanner,const MemberDef *md)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  yyextra->classScope = md->getClassDef() ? md->getClassDef()->name().data() : "";
+  for (const Argument &a : md->argumentList())
+  {
+    yyextra->parmName = a.name;
+    yyextra->parmType = a.type;
+    int i = yyextra->parmType.find('*');
+    if (i!=-1) yyextra->parmType = yyextra->parmType.left(i);
+    i = yyextra->parmType.find('&');
+    if (i!=-1) yyextra->parmType = yyextra->parmType.left(i);
+    yyextra->parmType.stripPrefix("const ");
+    yyextra->parmType=yyextra->parmType.stripWhiteSpace();
+    yyextra->theVarContext.addVariable(yyscanner,yyextra->parmType,yyextra->parmName);
+  }
+}
+
+static const ClassDef *stripClassName(yyscan_t yyscanner,const char *s,Definition *d)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  int pos=0;
+  QCString type = s;
+  QCString className;
+  QCString templSpec;
+  while (extractClassNameFromType(type,pos,className,templSpec)!=-1)
+  {
+    QCString clName=className+templSpec;
+    const ClassDef *cd=0;
+    if (!yyextra->classScope.isEmpty())
+    {
+      cd=getResolvedClass(d,yyextra->sourceFileDef,yyextra->classScope+"::"+clName);
+    }
+    if (cd==0)
+    {
+      cd=getResolvedClass(d,yyextra->sourceFileDef,clName);
+    }
+    //printf("stripClass trying '%s' = %p\n",clName.data(),cd);
+    if (cd)
+    {
+      return cd;
+    }
+  }
+
+  return 0;
+}
+
+static MemberDef *setCallContextForVar(yyscan_t yyscanner,const QCString &name)
+{
+  if (name.isEmpty()) return 0;
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  DBG_CTX((stderr,"setCallContextForVar(%s) yyextra->classScope=%s\n",name.data(),yyextra->classScope.data()));
+
+  int scopeEnd = name.findRev("::");
+  if (scopeEnd!=-1) // name with explicit scope
+  {
+    QCString scope   = name.left(scopeEnd);
+    QCString locName = name.right(name.length()-scopeEnd-2);
+    //printf("explicit scope: name=%s scope=%s\n",locName.data(),scope.data());
+    ClassDef *mcd = getClass(scope); 
+    if (mcd && !locName.isEmpty())
+    {
+      MemberDef *md=mcd->getMemberByName(locName);
+      if (md)
+      {
+        //printf("name=%s scope=%s\n",locName.data(),scope.data());
+        yyextra->theCallContext.setScope(stripClassName(yyscanner,md->typeString(),md->getOuterScope()));
+        return md;
+      }
+    }
+    else // check namespace as well
+    {
+      const NamespaceDef *mnd = getResolvedNamespace(scope);
+      if (mnd && !locName.isEmpty())
+      {
+       MemberDef *md=mnd->getMemberByName(locName);
+       if (md)
+       {
+         //printf("name=%s scope=%s\n",locName.data(),scope.data());
+         yyextra->theCallContext.setScope(stripClassName(yyscanner,md->typeString(),md->getOuterScope()));
+         return md;
+       }
+      }
+    }
+  }
+  
+  MemberName *mn;
+  ClassDef *mcd = yyextra->theVarContext.findVariable(name);
+  if (mcd) // local variable
+  {
+    DBG_CTX((stderr,"local variable?\n"));
+    if (mcd!=VariableContext::dummyContext)
+    {
+      DBG_CTX((stderr,"local var '%s' mcd=%s\n",name.data(),mcd->name().data()));
+      yyextra->theCallContext.setScope(mcd);
+    }
+  }
+  else
+  {
+    DBG_CTX((stderr,"class member? scope=%s\n",yyextra->classScope.data()));
+    // look for a class member 
+    mcd = getClass(yyextra->classScope);
+    if (mcd)
+    {
+      DBG_CTX((stderr,"Inside class %s\n",mcd->name().data()));
+      MemberDef *md=mcd->getMemberByName(name);
+      if (md) 
+      {
+        DBG_CTX((stderr,"Found member %s\n",md->name().data()));
+       if (yyextra->scopeStack.top()!=CLASSBLOCK)
+       {
+          DBG_CTX((stderr,"class member '%s' mcd=%s\n",name.data(),mcd->name().data()));
+         yyextra->theCallContext.setScope(stripClassName(yyscanner,md->typeString(),md->getOuterScope()));
+       }
+       return md;
+      }
+    }
+  }
+
+  // look for a global member
+  if ((mn=Doxygen::functionNameSDict->find(name)))
+  {
+    //printf("global var '%s'\n",name.data());
+    if (mn->count()==1) // global defined only once
+    {
+      MemberDef *md=mn->getFirst();
+      if (!md->isStatic() || md->getBodyDef()==yyextra->sourceFileDef)
+      {
+        yyextra->theCallContext.setScope(stripClassName(yyscanner,md->typeString(),md->getOuterScope()));
+        return md;
+      }
+      return 0;
+    }
+    else if (mn->count()>1) // global defined more than once
+    {
+      MemberNameIterator it(*mn);
+      MemberDef *md;
+      for (;(md=it.current());++it)
+      {
+       //printf("mn=%p md=%p md->getBodyDef()=%p yyextra->sourceFileDef=%p\n",
+       //    mn,md,
+       //    md->getBodyDef(),yyextra->sourceFileDef);
+
+       // in case there are multiple members we could link to, we 
+       // only link to members if defined in the same file or 
+       // defined as external.
+        if ((!md->isStatic() || md->getBodyDef()==yyextra->sourceFileDef) &&
+           (yyextra->forceTagReference.isEmpty() || yyextra->forceTagReference==md->getReference())
+          )
+        {
+          yyextra->theCallContext.setScope(stripClassName(yyscanner,md->typeString(),md->getOuterScope()));
+         //printf("returning member %s in source file %s\n",md->name().data(),yyextra->sourceFileDef->name().data());
+          return md;
+        }
+      }
+      return 0;
+    }
+  }
+  return 0;
+}
+
+static void updateCallContextForSmartPointer(yyscan_t yyscanner)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  const Definition *d = yyextra->theCallContext.getScope();
+  //printf("updateCallContextForSmartPointer() cd=%s\n",cd ? d->name().data() : "<none>");
+  MemberDef *md;
+  if (d && d->definitionType()==Definition::TypeClass && (md=(dynamic_cast<const ClassDef*>(d))->isSmartPointer()))
+  {
+    const ClassDef *ncd = stripClassName(yyscanner,md->typeString(),md->getOuterScope());
+    if (ncd)
+    {
+      yyextra->theCallContext.setScope(ncd);
+      //printf("Found smart pointer call %s->%s!\n",cd->name().data(),ncd->name().data());
+    }
+  }
+}
+
+static bool getLinkInScope(yyscan_t yyscanner,
+                           const QCString &c,  // scope
+                           const QCString &m,  // member
+                          const char *memberText, // exact text
+                          CodeOutputInterface &ol,
+                          const char *text,
+                          bool varOnly
+                         )
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  const MemberDef    *md = 0;
+  const ClassDef     *cd = 0;
+  const FileDef      *fd = 0;
+  const NamespaceDef *nd = 0;
+  const GroupDef     *gd = 0;
+  DBG_CTX((stderr,"getLinkInScope: trying '%s'::'%s' varOnly=%d\n",c.data(),m.data(),varOnly));
+  if (getDefs(c,m,"()",md,cd,fd,nd,gd,FALSE,yyextra->sourceFileDef,FALSE,yyextra->forceTagReference) && 
+      (!varOnly || md->isVariable()))
+  {
+    if (md->isLinkable())
+    {
+      //printf("found it %s!\n",md->qualifiedName().data());
+      if (yyextra->exampleBlock)
+      {
+        QCString anchor;
+        anchor.sprintf("a%d",yyextra->anchorCount);
+        //printf("addExampleFile(%s,%s,%s)\n",anchor.data(),yyextra->exampleName.data(),
+        //                                  yyextra->exampleFile.data());
+        if (const_cast<MemberDef*>(md)->addExample(anchor,yyextra->exampleName,yyextra->exampleFile))
+        {
+          ol.writeCodeAnchor(anchor);
+          yyextra->anchorCount++;
+        }
+      }
+
+      const Definition *d = md->getOuterScope()==Doxygen::globalScope ?
+                            md->resolveAlias()->getFileDef() : md->getOuterScope();
+      if (md->resolveAlias()->getGroupDef()) d = md->resolveAlias()->getGroupDef();
+      if (d && d->isLinkable())
+      {
+        yyextra->theCallContext.setScope(stripClassName(yyscanner,md->typeString(),md->getOuterScope()));
+        //printf("yyextra->currentDefinition=%p yyextra->currentMemberDef=%p yyextra->insideBody=%d\n",
+        //        yyextra->currentDefinition,yyextra->currentMemberDef,yyextra->insideBody);
+
+        if (yyextra->currentDefinition && yyextra->currentMemberDef &&
+            md!=yyextra->currentMemberDef && yyextra->insideBody && yyextra->collectXRefs)
+        {
+          addDocCrossReference(yyextra->currentMemberDef,const_cast<MemberDef*>(md));
+        }
+        //printf("d->getReference()='%s' d->getOutputBase()='%s' name='%s' member name='%s'\n",d->getReference().data(),d->getOutputFileBase().data(),d->name().data(),md->name().data());
+
+        writeMultiLineCodeLink(yyscanner,ol,md, text ? text : memberText);
+        addToSearchIndex(yyscanner,text ? text : memberText);
+        return TRUE;
+      }
+    }
+    else // found member, but it is not linkable, so make sure content inside is not assigned
+         // to the previous member, see bug762760
+    {
+      DBG_CTX((stderr,"unlinkable member %s\n",md->name().data()));
+      yyextra->currentMemberDef = 0;
+    }
+  }
+  return FALSE;
+}
+
+static bool getLink(yyscan_t yyscanner,
+                    const char *className,
+                    const char *memberName,
+                   CodeOutputInterface &ol,
+                   const char *text,
+                   bool varOnly)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  //printf("getLink(%s,%s) yyextra->curClassName=%s\n",className,memberName,yyextra->curClassName.data());
+  QCString m=removeRedundantWhiteSpace(memberName);
+  QCString c=className;
+  if (!getLinkInScope(yyscanner,c,m,memberName,ol,text,varOnly))
+  {
+    if (!yyextra->curClassName.isEmpty())
+    {
+      if (!c.isEmpty()) c.prepend("::");
+      c.prepend(yyextra->curClassName);
+      return getLinkInScope(yyscanner,c,m,memberName,ol,text,varOnly);
+    }
+    return FALSE;
+  }
+  return TRUE;
+}
+
+static void generateClassOrGlobalLink(yyscan_t yyscanner,
+                                      CodeOutputInterface &ol,
+                                      const char *clName,
+                                      bool typeOnly,
+                                      bool varOnly)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  int i=0;
+  if (*clName=='~') // correct for matching negated values i.s.o. destructors.
+  {
+    yyextra->code->codify("~");
+    clName++;
+  }
+  QCString className=clName;
+  if (className.isEmpty()) return;
+  if (yyextra->insideProtocolList) // for Obj-C
+  {
+    className+="-p";
+  }
+  if (yyextra->lang==SrcLangExt_PHP)
+  {
+    className = substitute(className,"\\","::"); // for PHP namespaces
+  }
+  else if (yyextra->lang==SrcLangExt_CSharp || yyextra->lang==SrcLangExt_Java)
+  {
+    className = substitute(className,".","::"); // for PHP namespaces
+  }
+  const ClassDef *cd=0,*lcd=0;
+  const MemberDef *md=0;
+  bool isLocal=FALSE;
+
+  //printf("generateClassOrGlobalLink(className=%s)\n",className.data());
+  if (!yyextra->prefixed_with_this_keyword || (lcd=yyextra->theVarContext.findVariable(className))==0) // not a local variable
+  {
+    Definition *d = yyextra->currentDefinition;
+    //printf("d=%s yyextra->sourceFileDef=%s\n",d?d->name().data():"<none>",yyextra->sourceFileDef?yyextra->sourceFileDef->name().data():"<none>");
+    cd = getResolvedClass(d,yyextra->sourceFileDef,className,&md);
+    DBG_CTX((stderr,"non-local variable name=%s context=%d cd=%s md=%s!\n",
+    className.data(),yyextra->theVarContext.count(),cd?cd->name().data():"<none>",
+        md?md->name().data():"<none>"));
+    if (cd==0 && md==0 && (i=className.find('<'))!=-1)
+    {
+      QCString bareName = className.left(i); //stripTemplateSpecifiersFromScope(className);
+      DBG_CTX((stderr,"bareName=%s\n",bareName.data()));
+      if (bareName!=className)
+      {
+       cd=getResolvedClass(d,yyextra->sourceFileDef,bareName,&md); // try unspecialized version
+      }
+    }
+    const NamespaceDef *nd = getResolvedNamespace(className);
+    if (nd && nd->isLinkable())
+    {
+      yyextra->theCallContext.setScope(nd);
+      addToSearchIndex(yyscanner,className);
+      writeMultiLineCodeLink(yyscanner,*yyextra->code,nd,clName);
+      return;
+    }
+    //printf("md=%s\n",md?md->name().data():"<none>");
+    DBG_CTX((stderr,"is found as a type cd=%s nd=%s\n",
+          cd?cd->name().data():"<null>",
+          nd?nd->name().data():"<null>"));
+    if (cd==0 && md==0) // also see if it is variable or enum or enum value
+    {
+      if (getLink(yyscanner,yyextra->classScope,clName,ol,clName,varOnly))
+      {
+       return;
+      }
+    }
+  }
+  else
+  {
+    //printf("local variable!\n");
+    if (lcd!=VariableContext::dummyContext) 
+    {
+      //printf("non-dummy context lcd=%s!\n",lcd->name().data());
+      yyextra->theCallContext.setScope(lcd);
+
+      // to following is needed for links to a global variable, but is
+      // no good for a link to a local variable that is also a global symbol.
+       
+      //if (getLink(yyscanner,yyextra->classScope,clName,ol,clName))
+      //{
+       //return;
+      //}
+    }
+    isLocal=TRUE;
+    DBG_CTX((stderr,"is a local variable cd=%p!\n",cd));
+  }
+  yyextra->prefixed_with_this_keyword = FALSE; // discard the "this" prefix for the next calls
+
+  if (cd && cd->isLinkable()) // is it a linkable class
+  {
+    DBG_CTX((stderr,"is linkable class %s\n",clName));
+    if (yyextra->exampleBlock)
+    {
+      QCString anchor;
+      anchor.sprintf("_a%d",yyextra->anchorCount);
+      //printf("addExampleClass(%s,%s,%s)\n",anchor.data(),yyextra->exampleName.data(),
+      //                                   yyextra->exampleFile.data());
+      if (const_cast<ClassDef*>(cd)->addExample(anchor,yyextra->exampleName,yyextra->exampleFile))
+      {
+       ol.writeCodeAnchor(anchor);
+       yyextra->anchorCount++;
+      }
+    }
+    writeMultiLineCodeLink(yyscanner,ol,cd,clName);
+    addToSearchIndex(yyscanner,className);
+    yyextra->theCallContext.setScope(cd);
+    if (md)
+    {
+      const Definition *d = md->getOuterScope()==Doxygen::globalScope ?
+                      md->getFileDef() : md->getOuterScope();
+      if (md->getGroupDef()) d = md->getGroupDef();
+      if (d && d->isLinkable() && md->isLinkable() && 
+          yyextra->currentMemberDef && yyextra->collectXRefs)
+      {
+        addDocCrossReference(yyextra->currentMemberDef,const_cast<MemberDef*>(md));
+      }
+    }
+  }
+  else // not a class, maybe a global member
+  {
+    DBG_CTX((stderr,"class %s not linkable! cd=%p md=%p typeOnly=%d\n",clName,cd,md,typeOnly));
+    if (!isLocal && (md!=0 || (cd==0 && !typeOnly))) // not a class, see if it is a global enum/variable/typedef.
+    {
+      if (md==0) // not found as a typedef
+      {
+       md = setCallContextForVar(yyscanner,clName);
+       //printf("setCallContextForVar(%s) md=%p yyextra->currentDefinition=%p\n",clName,md,yyextra->currentDefinition);
+       if (md && yyextra->currentDefinition)
+       {
+         DBG_CTX((stderr,"%s accessible from %s? %d md->getOuterScope=%s\n",
+             md->name().data(),yyextra->currentDefinition->name().data(),
+             isAccessibleFrom(yyextra->currentDefinition,yyextra->sourceFileDef,md),
+             md->getOuterScope()->name().data()));
+       }
+            
+        if (md && yyextra->currentDefinition && 
+           isAccessibleFrom(yyextra->currentDefinition,yyextra->sourceFileDef,md)==-1)
+       {
+         md=0; // variable not accessible
+       }
+      }
+      if (md && (!varOnly || md->isVariable()))
+      {
+        DBG_CTX((stderr,"is a global md=%p yyextra->currentDefinition=%s linkable=%d\n",md,yyextra->currentDefinition?yyextra->currentDefinition->name().data():"<none>",md->isLinkable()));
+       if (md->isLinkable())
+       {
+         QCString text;
+         if (!yyextra->forceTagReference.isEmpty()) // explicit reference to symbol in tag file
+         {
+           text=yyextra->forceTagReference;
+           if (text.right(4)==".tag") // strip .tag if present
+           {
+             text=text.left(text.length()-4);
+           }
+           text+=getLanguageSpecificSeparator(md->getLanguage());
+           text+=clName;
+           const_cast<MemberDef*>(md)->setName(text);
+            const_cast<MemberDef*>(md)->setLocalName(text);
+         }
+         else // normal reference
+         {
+           text=clName;
+         }
+         writeMultiLineCodeLink(yyscanner,ol,md,text);
+          addToSearchIndex(yyscanner,clName);
+         if (yyextra->currentMemberDef && yyextra->collectXRefs)
+         {
+           addDocCrossReference(yyextra->currentMemberDef,const_cast<MemberDef*>(md));
+         }
+         return;
+       }
+      }
+    }
+    
+    // nothing found, just write out the word
+    DBG_CTX((stderr,"not found!\n"));
+    codifyLines(yyscanner,clName);
+    addToSearchIndex(yyscanner,clName);
+  }
+}
+
+static bool generateClassMemberLink(yyscan_t yyscanner,
+                                    CodeOutputInterface &ol,
+                                    MemberDef *xmd,
+                                    const char *memName)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  // extract class definition of the return type in order to resolve
+  // a->b()->c() like call chains
+
+  //printf("type='%s' args='%s' class=%s\n",
+  //  xmd->typeString(),xmd->argsString(),
+  //  xmd->getClassDef()->name().data());
+
+  if (yyextra->exampleBlock)
+  {
+    QCString anchor;
+    anchor.sprintf("a%d",yyextra->anchorCount);
+    //printf("addExampleFile(%s,%s,%s)\n",anchor.data(),yyextra->exampleName.data(),
+    //                                  yyextra->exampleFile.data());
+    if (xmd->addExample(anchor,yyextra->exampleName,yyextra->exampleFile))
+    {
+      ol.writeCodeAnchor(anchor);
+      yyextra->anchorCount++;
+    }
+  }
+
+  const ClassDef *typeClass = stripClassName(yyscanner,removeAnonymousScopes(xmd->typeString()),xmd->getOuterScope());
+  DBG_CTX((stderr,"%s -> typeName=%p\n",xmd->typeString(),typeClass));
+  yyextra->theCallContext.setScope(typeClass);
+
+  const Definition *xd = xmd->getOuterScope()==Doxygen::globalScope ?
+                   xmd->getFileDef() : xmd->getOuterScope();
+  if (xmd->getGroupDef()) xd = xmd->getGroupDef();
+  if (xd && xd->isLinkable())
+  {
+
+    //printf("yyextra->currentDefinition=%p yyextra->currentMemberDef=%p xmd=%p yyextra->insideBody=%d\n",yyextra->currentDefinition,yyextra->currentMemberDef,xmd,yyextra->insideBody);
+
+    if (xmd->templateMaster()) xmd = xmd->templateMaster();
+
+    if (xmd->isLinkable())
+    {
+      // add usage reference
+      if (yyextra->currentDefinition && yyextra->currentMemberDef &&
+         /*xmd!=yyextra->currentMemberDef &&*/ yyextra->insideBody && yyextra->collectXRefs)
+      {
+       addDocCrossReference(yyextra->currentMemberDef,xmd);
+      }
+
+      // write the actual link
+      writeMultiLineCodeLink(yyscanner,ol,xmd,memName);
+      addToSearchIndex(yyscanner,memName);
+      return TRUE;
+    }
+  }
+
+  return FALSE;
+}
+
+static bool generateClassMemberLink(yyscan_t yyscanner,
+                                    CodeOutputInterface &ol,
+                                    const Definition *def,
+                                    const char *memName)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  if (def && def->definitionType()==Definition::TypeClass)
+  {
+    const ClassDef *cd = dynamic_cast<const ClassDef*>(def);
+    MemberDef *xmd = cd->getMemberByName(memName);
+    //printf("generateClassMemberLink(class=%s,member=%s)=%p\n",def->name().data(),memName,xmd);
+    if (xmd)
+    {
+      return generateClassMemberLink(yyscanner,ol,xmd,memName);
+    }
+    else
+    {
+      Definition *innerDef = cd->findInnerCompound(memName);
+      if (innerDef)
+      {
+        yyextra->theCallContext.setScope(innerDef);
+        addToSearchIndex(yyscanner,memName);
+        writeMultiLineCodeLink(yyscanner,*yyextra->code,innerDef,memName);
+        return TRUE;
+      }
+    }
+  }
+  else if (def && def->definitionType()==Definition::TypeNamespace)
+  {
+    const NamespaceDef *nd = dynamic_cast<const NamespaceDef*>(def);
+    //printf("Looking for %s inside namespace %s\n",memName,nd->name().data());
+    Definition *innerDef = nd->findInnerCompound(memName);
+    if (innerDef)
+    {
+      yyextra->theCallContext.setScope(innerDef);
+      addToSearchIndex(yyscanner,memName);
+      writeMultiLineCodeLink(yyscanner,*yyextra->code,innerDef,memName);
+      return TRUE;
+    }
+  }
+  return FALSE;
+}
+
+static void generateMemberLink(yyscan_t yyscanner,
+                               CodeOutputInterface &ol,
+                               const QCString &varName,
+                               const char *memName)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  //printf("generateMemberLink(object=%s,mem=%s) classScope=%s\n",
+  //    varName.data(),memName,yyextra->classScope.data());
+
+  if (varName.isEmpty()) return;
+
+  // look for the variable in the current context
+  const ClassDef *vcd = yyextra->theVarContext.findVariable(varName);
+  if (vcd) 
+  {
+    if (vcd!=VariableContext::dummyContext)
+    {
+      //printf("Class found!\n");
+      if (getLink(yyscanner,vcd->name(),memName,ol)) 
+      {
+       //printf("Found result!\n");
+       return;
+      }
+      if (vcd->baseClasses())
+      {
+       BaseClassListIterator bcli(*vcd->baseClasses());
+       for ( ; bcli.current() ; ++bcli)
+       {
+         if (getLink(yyscanner,bcli.current()->classDef->name(),memName,ol)) 
+         {
+           //printf("Found result!\n");
+           return;
+         }
+       }
+      }
+    }
+  }
+  else // variable not in current context, maybe it is in a parent context
+  {
+    vcd = getResolvedClass(yyextra->currentDefinition,yyextra->sourceFileDef,yyextra->classScope);
+    if (vcd && vcd->isLinkable())
+    {
+      //printf("Found class %s for variable '%s'\n",yyextra->classScope.data(),varName.data());
+      MemberName *vmn=Doxygen::memberNameSDict->find(varName);
+      if (vmn==0)
+      {
+       int vi;
+       QCString vn=varName;
+       if ((vi=vn.findRev("::"))!=-1 || (vi=vn.findRev('.'))!=-1)  // explicit scope A::b(), probably static member
+       {
+         ClassDef *jcd = getClass(vn.left(vi));
+         vn=vn.right(vn.length()-vi-2);
+         vmn=Doxygen::memberNameSDict->find(vn);
+         //printf("Trying name '%s' scope=%s\n",vn.data(),scope.data());
+         if (vmn)
+         {
+           MemberNameIterator vmni(*vmn);
+           const MemberDef *vmd;
+           for (;(vmd=vmni.current());++vmni)
+           {
+             if (/*(vmd->isVariable() || vmd->isFunction()) && */
+                 vmd->getClassDef()==jcd)
+             {
+               //printf("Found variable type=%s\n",vmd->typeString());
+               const ClassDef *mcd=stripClassName(yyscanner,vmd->typeString(),vmd->getOuterScope());
+               if (mcd && mcd->isLinkable())
+               {
+                 if (generateClassMemberLink(yyscanner,ol,mcd,memName)) return;
+               }
+             }
+           }
+         }
+       }
+      }
+      if (vmn)
+      {
+       //printf("There is a variable with name '%s'\n",varName);
+       MemberNameIterator vmni(*vmn);
+       const MemberDef *vmd;
+       for (;(vmd=vmni.current());++vmni)
+       {
+         if (/*(vmd->isVariable() || vmd->isFunction()) && */
+             vmd->getClassDef()==vcd)
+         {
+           //printf("Found variable type=%s\n",vmd->typeString());
+           const ClassDef *mcd=stripClassName(yyscanner,vmd->typeString(),vmd->getOuterScope());
+           if (mcd && mcd->isLinkable())
+           {
+             if (generateClassMemberLink(yyscanner,ol,mcd,memName)) return;
+           }
+         }
+       }
+      }
+    }
+  }
+  // nothing found -> write result as is
+  codifyLines(yyscanner,memName);
+  addToSearchIndex(yyscanner,memName);
+  return;
+}
+
+static void generatePHPVariableLink(yyscan_t yyscanner,CodeOutputInterface &ol,const char *varName)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  QCString name = varName+7; // strip $this->
+  name.prepend("$");
+  //printf("generatePHPVariableLink(%s) name=%s scope=%s\n",varName,name.data(),yyextra->classScope.data());
+  if (!getLink(yyscanner,yyextra->classScope,name,ol,varName))
+  {
+    codifyLines(yyscanner,varName);
+  }
+}
+
+static void generateFunctionLink(yyscan_t yyscanner,CodeOutputInterface &ol,const char *funcName)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  //CodeClassDef *ccd=0;
+  ClassDef *ccd=0;
+  QCString locScope=yyextra->classScope;
+  QCString locFunc=removeRedundantWhiteSpace(funcName);
+  if (yyextra->lang==SrcLangExt_PHP && locFunc.startsWith("self::")) locFunc=locFunc.mid(4);
+  QCString funcScope;
+  QCString funcWithScope=locFunc;
+  QCString funcWithFullScope=locFunc;
+  QCString fullScope=locScope;
+  DBG_CTX((stdout,"*** locScope=%s locFunc=%s\n",locScope.data(),locFunc.data()));
+  int len=2;
+  int i=locFunc.findRev("::");
+  if (yyextra->currentMemberDef && yyextra->currentMemberDef->resolveAlias()->getClassDef() &&
+      funcName==yyextra->currentMemberDef->localName() && 
+      yyextra->currentMemberDef->getDefLine()==yyextra->yyLineNr &&
+      generateClassMemberLink(yyscanner,ol,yyextra->currentMemberDef,funcName)
+     )
+  {
+    // special case where funcName is the name of a method that is also
+    // defined on this line. In this case we can directly link to 
+    // yyextra->currentMemberDef, which is not only faster, but
+    // in case of overloaded methods, this will make sure that we link to
+    // the correct method, and thereby get the correct reimplemented relations.
+    // See also bug 549022.
+    goto exit;
+  }
+  if (i==-1) i=locFunc.findRev("."),len=1;
+  if (i==-1) i=locFunc.findRev("\\"),len=1; // for PHP
+  if (i>0)
+  {
+    funcScope=locFunc.left(i);
+    locFunc=locFunc.right(locFunc.length()-i-len).stripWhiteSpace();
+    int ts=locScope.find('<'); // start of template
+    int te=locScope.findRev('>'); // end of template
+    //printf("ts=%d te=%d\n",ts,te);
+    if (ts!=-1 && te!=-1 && te>ts)
+    {
+      // remove template from scope
+      locScope=locScope.left(ts)+locScope.right(locScope.length()-te-1);
+    }
+    ts=funcScope.find('<'); // start of template
+    te=funcScope.findRev('>'); // end of template
+    //printf("ts=%d te=%d\n",ts,te);
+    if (ts!=-1 && te!=-1 && te>ts)
+    {
+      // remove template from scope
+      funcScope=funcScope.left(ts)+funcScope.right(funcScope.length()-te-1);
+    }
+    if (!funcScope.isEmpty())
+    {
+      funcWithScope = funcScope+"::"+locFunc;
+      if (!locScope.isEmpty())
+      {
+        fullScope=locScope+"::"+funcScope;
+      }
+    }
+    if (!locScope.isEmpty())
+    {
+      funcWithFullScope = locScope+"::"+funcWithScope;
+    }
+  }
+  if (!fullScope.isEmpty() && (ccd=yyextra->codeClassSDict->find(fullScope)))
+  {
+    //printf("using classScope %s\n",yyextra->classScope.data());
+    if (ccd->baseClasses())
+    {
+      BaseClassListIterator bcli(*ccd->baseClasses());
+      for ( ; bcli.current() ; ++bcli)
+      {
+       if (getLink(yyscanner,bcli.current()->classDef->name(),locFunc,ol,funcName)) 
+       {
+         goto exit;
+       }
+      }
+    }
+  }
+  if (!locScope.isEmpty() && fullScope!=locScope && (ccd=yyextra->codeClassSDict->find(locScope)))
+  {
+    //printf("using classScope %s\n",yyextra->classScope.data());
+    if (ccd->baseClasses())
+    {
+      BaseClassListIterator bcli(*ccd->baseClasses());
+      for ( ; bcli.current() ; ++bcli)
+      {
+       if (getLink(yyscanner,bcli.current()->classDef->name(),funcWithScope,ol,funcName)) 
+       {
+         goto exit;
+       }
+      }
+    }
+  }
+  if (!getLink(yyscanner,locScope,funcWithScope,ol,funcName))
+  {
+    generateClassOrGlobalLink(yyscanner,ol,funcName);
+  }
+exit:  
+  yyextra->forceTagReference.resize(0);
+  return;
+}
+
+/*! counts the number of lines in the input */
+static int countLines(yyscan_t yyscanner)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  const char *p=yyextra->inputString;
+  char c;
+  int count=1;
+  while ((c=*p)) 
+  { 
+    p++ ; 
+    if (c=='\n') count++;  
+  }
+  if (p>yyextra->inputString && *(p-1)!='\n') 
+  { // last line does not end with a \n, so we add an extra
+    // line and explicitly terminate the line after parsing.
+    count++, 
+    yyextra->needsTermination=TRUE; 
+  } 
+  return count;
+}
+
+static void endFontClass(yyscan_t yyscanner)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  if (yyextra->currentFontClass)
+  {
+    yyextra->code->endFontClass();
+    yyextra->currentFontClass=0;
+  }
+}
+
+static void startFontClass(yyscan_t yyscanner,const char *s)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  endFontClass(yyscanner);
+  yyextra->code->startFontClass(s);
+  yyextra->currentFontClass=s;
+}
+
+//----------------------------------------------------------------------------
+
+// recursively writes a linkified Objective-C method call
+static void writeObjCMethodCall(yyscan_t yyscanner,ObjCCallCtx *ctx)
+{
+  if (ctx==0) return;
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  char c;
+  const char *p = ctx->format.data();
+  if (!ctx->methodName.isEmpty())
+  {
+    //printf("writeObjCMethodCall(%s) obj=%s method=%s\n",
+    //    ctx->format.data(),ctx->objectTypeOrName.data(),ctx->methodName.data());
+    if (!ctx->objectTypeOrName.isEmpty() && ctx->objectTypeOrName.at(0)!='$')
+    {
+      //printf("Looking for object=%s method=%s\n",ctx->objectTypeOrName.data(),
+      //       ctx->methodName.data());
+      ClassDef *cd = yyextra->theVarContext.findVariable(ctx->objectTypeOrName);
+      if (cd==0) // not a local variable
+      {
+       if (ctx->objectTypeOrName=="self")
+       {
+         if (yyextra->currentDefinition && 
+             yyextra->currentDefinition->definitionType()==Definition::TypeClass)
+         {
+           ctx->objectType = dynamic_cast<ClassDef *>(yyextra->currentDefinition);
+         }
+       }
+       else
+       {
+         ctx->objectType = getResolvedClass(
+             yyextra->currentDefinition,
+             yyextra->sourceFileDef,
+             ctx->objectTypeOrName,
+             &ctx->method);
+       }
+       //printf("  object is class? %p\n",ctx->objectType);
+       if (ctx->objectType) // found class
+       {
+         ctx->method = ctx->objectType->getMemberByName(ctx->methodName);
+         //printf("    yes->method=%s\n",ctx->method?ctx->method->name().data():"<none>");
+       }
+       else if (ctx->method==0) // search for class variable with the same name
+       {
+         //printf("    no\n");
+         //printf("yyextra->currentDefinition=%p\n",yyextra->currentDefinition);
+         if (yyextra->currentDefinition && 
+             yyextra->currentDefinition->definitionType()==Definition::TypeClass)
+         {
+           ctx->objectVar = (dynamic_cast<ClassDef *>(yyextra->currentDefinition))->getMemberByName(ctx->objectTypeOrName);
+           //printf("      ctx->objectVar=%p\n",ctx->objectVar);
+           if (ctx->objectVar)
+           {
+             ctx->objectType = stripClassName(yyscanner,ctx->objectVar->typeString(),yyextra->currentDefinition);
+             //printf("        ctx->objectType=%p\n",ctx->objectType);
+             if (ctx->objectType && !ctx->methodName.isEmpty())
+             {
+               ctx->method = ctx->objectType->getMemberByName(ctx->methodName);
+               //printf("          ctx->method=%p\n",ctx->method);
+             }
+           }
+         }
+       }
+      }
+      else // local variable
+      {
+       //printf("  object is local variable\n");
+       if (cd!=VariableContext::dummyContext && !ctx->methodName.isEmpty())
+       {
+         ctx->method = cd->getMemberByName(ctx->methodName);
+         //printf("   class=%p method=%p\n",cd,ctx->method);
+       }
+      }
+    }
+  }
+
+  //printf("[");
+  while ((c=*p++)) // for each character in ctx->format
+  {
+    if (c=='$')
+    {
+      char nc=*p++;
+      if (nc=='$') // escaped $
+      {
+       yyextra->code->codify("$");
+      }
+      else // name fragment or reference to a nested call 
+      {
+       if (nc=='n') // name fragment
+       {
+          nc=*p++;
+         QCString refIdStr;
+         while (nc!=0 && isdigit(nc)) { refIdStr+=nc; nc=*p++; }
+         p--;
+         int refId=refIdStr.toInt();
+         QCString *pName = yyextra->nameDict.find(refId);
+         if (pName)
+         {
+           if (ctx->method && ctx->method->isLinkable())
+           {
+              writeMultiLineCodeLink(yyscanner,*yyextra->code,ctx->method,pName->data());
+             if (yyextra->currentMemberDef && yyextra->collectXRefs)
+             {
+               addDocCrossReference(yyextra->currentMemberDef,const_cast<MemberDef*>(ctx->method));
+             }
+           }
+           else
+           {
+             codifyLines(yyscanner,pName->data());
+           }
+         }
+         else
+         {
+           //printf("Invalid name: id=%d\n",refId);
+         }
+       }
+       else if (nc=='o') // reference to potential object name
+       {
+          nc=*p++;
+         QCString refIdStr;
+         while (nc!=0 && isdigit(nc)) { refIdStr+=nc; nc=*p++; }
+         p--;
+         int refId=refIdStr.toInt();
+         QCString *pObject = yyextra->objectDict.find(refId);
+         if (pObject)
+         {
+           if (*pObject=="self")
+           {
+             if (yyextra->currentDefinition && 
+                 yyextra->currentDefinition->definitionType()==Definition::TypeClass)
+             {
+               ctx->objectType = dynamic_cast<ClassDef *>(yyextra->currentDefinition);
+               if (ctx->objectType->categoryOf()) 
+               {
+                 ctx->objectType = ctx->objectType->categoryOf();
+               }
+               if (ctx->objectType && !ctx->methodName.isEmpty())
+               {
+                 ctx->method = ctx->objectType->getMemberByName(ctx->methodName);
+               }
+             }
+             startFontClass(yyscanner,"keyword");
+              codifyLines(yyscanner,pObject->data());
+             endFontClass(yyscanner);
+           }
+           else if (*pObject=="super")
+           {
+             if (yyextra->currentDefinition &&
+                 yyextra->currentDefinition->definitionType()==Definition::TypeClass)
+             {
+               ClassDef *cd = dynamic_cast<ClassDef *>(yyextra->currentDefinition);
+               if (cd->categoryOf()) 
+               {
+                 cd = cd->categoryOf();
+               }
+               BaseClassList *bcd = cd->baseClasses();
+               if (bcd) // get direct base class (there should be only one)
+               {
+                 BaseClassListIterator bli(*bcd);
+                 BaseClassDef *bclass;
+                 for (bli.toFirst();(bclass=bli.current());++bli)
+                 {
+                   if (bclass->classDef->compoundType()!=ClassDef::Protocol)
+                   {
+                     ctx->objectType = bclass->classDef;
+                     if (ctx->objectType && !ctx->methodName.isEmpty())
+                     {
+                       ctx->method = ctx->objectType->getMemberByName(ctx->methodName);
+                     }
+                   }
+                 }
+               }
+             }
+             startFontClass(yyscanner,"keyword");
+              codifyLines(yyscanner,pObject->data());
+             endFontClass(yyscanner);
+           }
+           else if (ctx->objectVar && ctx->objectVar->isLinkable()) // object is class variable
+           {
+             writeMultiLineCodeLink(yyscanner,*yyextra->code,ctx->objectVar,pObject->data());
+             if (yyextra->currentMemberDef && yyextra->collectXRefs)
+             {
+               addDocCrossReference(yyextra->currentMemberDef,const_cast<MemberDef*>(ctx->objectVar));
+             }
+           }
+           else if (ctx->objectType && 
+                    ctx->objectType!=VariableContext::dummyContext && 
+                    ctx->objectType->isLinkable()
+                   ) // object is class name
+           {
+             const ClassDef *cd = ctx->objectType;
+             writeMultiLineCodeLink(yyscanner,*yyextra->code,cd,pObject->data());
+           }
+           else // object still needs to be resolved
+           {
+             const ClassDef *cd = getResolvedClass(yyextra->currentDefinition, 
+                 yyextra->sourceFileDef, *pObject);
+             if (cd && cd->isLinkable())
+             {
+               if (ctx->objectType==0) ctx->objectType=cd;
+               writeMultiLineCodeLink(yyscanner,*yyextra->code,cd,pObject->data());
+             }
+             else
+             {
+               codifyLines(yyscanner,pObject->data());
+             }
+           }
+         }
+         else
+         {
+           //printf("Invalid object: id=%d\n",refId);
+         }
+       }
+       else if (nc=='c') // reference to nested call
+       {
+          nc=*p++;
+         QCString refIdStr;
+         while (nc!=0 && isdigit(nc)) { refIdStr+=nc; nc=*p++; }
+         p--;
+         int refId=refIdStr.toInt();
+         ObjCCallCtx *ictx = yyextra->contextDict.find(refId);
+         if (ictx) // recurse into nested call
+         {
+           writeObjCMethodCall(yyscanner,ictx);
+           if (ictx->method) // link to nested call successfully
+           {
+             // get the ClassDef representing the method's return type
+             if (QCString(ictx->method->typeString())=="id")
+             {
+               // see if the method name is unique, if so we link to it
+               MemberName *mn=Doxygen::memberNameSDict->find(ctx->methodName);
+               //printf("mn->count=%d ictx->method=%s ctx->methodName=%s\n",
+               //    mn==0?-1:(int)mn->count(),
+               //    ictx->method->name().data(),
+               //    ctx->methodName.data());
+               if (mn && mn->count()==1) // member name unique
+               {
+                 ctx->method = mn->getFirst();
+               }
+             } 
+             else
+             {
+               ctx->objectType = stripClassName(yyscanner,ictx->method->typeString(),yyextra->currentDefinition);
+               if (ctx->objectType && !ctx->methodName.isEmpty())
+               {
+                 ctx->method = ctx->objectType->getMemberByName(ctx->methodName);
+               }
+             }
+             //printf("  ***** method=%s -> object=%p\n",ictx->method->name().data(),ctx->objectType);
+           }
+         }
+         else
+         {
+           //printf("Invalid context: id=%d\n",refId);
+         }
+       }
+       else if (nc=='w') // some word
+       {
+          nc=*p++;
+         QCString refIdStr;
+         while (nc!=0 && isdigit(nc)) { refIdStr+=nc; nc=*p++; }
+         p--;
+         int refId=refIdStr.toInt();
+         QCString *pWord = yyextra->wordDict.find(refId);
+         if (pWord)
+         {
+            codifyLines(yyscanner,pWord->data());
+         }
+       }
+        else if (nc=='d') // comment block
+        {
+          nc=*p++;
+         QCString refIdStr;
+         while (nc!=0 && isdigit(nc)) { refIdStr+=nc; nc=*p++; }
+         p--;
+         int refId=refIdStr.toInt();
+         QCString *pComment = yyextra->commentDict.find(refId);
+          if (pComment)
+          {
+            startFontClass(yyscanner,"comment");
+           codifyLines(yyscanner,pComment->data());
+           endFontClass(yyscanner);
+          }
+        }
+       else // illegal marker
+       {
+         ASSERT(!"invalid escape sequence");
+       }
+      }
+    }
+    else // normal non-marker character
+    {
+      char s[2];
+      s[0]=c;s[1]=0;
+      codifyLines(yyscanner,s);
+    }
+  }
+  //printf("%s %s]\n",ctx->objectTypeOrName.data(),ctx->methodName.data());
+  //printf("}=(type='%s',name='%s')",
+  //    ctx->objectTypeOrName.data(),
+  //    ctx->methodName.data());
+}
 
-/*@ ----------------------------------------------------------------------------
- */
+// Replaces an Objective-C method name fragment s by a marker of the form
+// $n12, the number (12) can later be used as a key for obtaining the name 
+// fragment, from yyextra->nameDict
+static QCString escapeName(yyscan_t yyscanner,const char *s)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  QCString result;
+  result.sprintf("$n%d",yyextra->currentNameId);
+  yyextra->nameDict.insert(yyextra->currentNameId,new QCString(s));
+  yyextra->currentNameId++;
+  return result;
+}
+
+static QCString escapeObject(yyscan_t yyscanner,const char *s)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  QCString result;
+  result.sprintf("$o%d",yyextra->currentObjId);
+  yyextra->objectDict.insert(yyextra->currentObjId,new QCString(s));
+  yyextra->currentObjId++;
+  return result;
+}
+
+static QCString escapeWord(yyscan_t yyscanner,const char *s)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  QCString result;
+  result.sprintf("$w%d",yyextra->currentWordId);
+  yyextra->wordDict.insert(yyextra->currentWordId,new QCString(s));
+  yyextra->currentWordId++;
+  return result;
+}
+
+static QCString escapeComment(yyscan_t yyscanner,const char *s)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  QCString result;
+  result.sprintf("$d%d",yyextra->currentCommentId);
+  yyextra->commentDict.insert(yyextra->currentCommentId,new QCString(s));
+  yyextra->currentCommentId++;
+  return result;
+}
+
+static bool skipLanguageSpecificKeyword(yyscan_t yyscanner,const QCString &kw)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  return yyextra->lang==SrcLangExt_Cpp && (kw == "remove" || kw == "set" || kw == "get");
+}
+
+static bool isCastKeyword(const QCString &s)
+{
+  int i=s.find('<');
+  if (i==-1) return FALSE;
+  QCString kw = s.left(i).stripWhiteSpace();
+  return kw=="const_cast" || kw=="static_cast" || kw=="dynamic_cast" || kw=="reinterpret_cast";
+}
+
+static int yyread(yyscan_t yyscanner,char *buf,int max_size)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  int inputPosition = yyextra->inputPosition;
+  const char *s = yyextra->inputString + yyextra->inputPosition;
+  int c=0;
+  while( c < max_size && *s )
+  {
+    *buf++ = *s++;
+    c++;
+  }
+  yyextra->inputPosition += c;
+  return c;
+}
 
-static void saveObjCContext()
+
+static void saveObjCContext(yyscan_t yyscanner)
 {
-  if (g_currentCtx)
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  if (yyextra->currentCtx)
   {
-    g_currentCtx->format+=QCString().sprintf("$c%d",g_currentCtxId);
-    if (g_braceCount==0 && YY_START==ObjCCall)
+    yyextra->currentCtx->format+=QCString().sprintf("$c%d",yyextra->currentCtxId);
+    if (yyextra->braceCount==0 && YY_START==ObjCCall)
     {
-      g_currentCtx->objectTypeOrName=g_currentCtx->format.mid(1);
-      //printf("new type=%s\n",g_currentCtx->objectTypeOrName.data());
+      yyextra->currentCtx->objectTypeOrName=yyextra->currentCtx->format.mid(1);
+      //printf("new type=%s\n",yyextra->currentCtx->objectTypeOrName.data());
     }
-    g_contextStack.push(g_currentCtx);
+    yyextra->contextStack.push(yyextra->currentCtx);
   }
   else
   {
     //printf("Trying to save NULL context!\n");
   }
   ObjCCallCtx *newCtx = new ObjCCallCtx;
-  newCtx->id = g_currentCtxId;
+  newCtx->id = yyextra->currentCtxId;
   newCtx->lexState = YY_START;
-  newCtx->braceCount = g_braceCount;
+  newCtx->braceCount = yyextra->braceCount;
   newCtx->objectType = 0;
   newCtx->objectVar = 0;
   newCtx->method = 0;
   //printf("save state=%d\n",YY_START);
-  g_contextDict.insert(g_currentCtxId,newCtx);
-  g_currentCtx = newCtx;
-  g_braceCount = 0;
-  g_currentCtxId++;
+  yyextra->contextDict.insert(yyextra->currentCtxId,newCtx);
+  yyextra->currentCtx = newCtx;
+  yyextra->braceCount = 0;
+  yyextra->currentCtxId++;
 }
 
-static void restoreObjCContext()
+static void restoreObjCContext(yyscan_t yyscanner)
 {
-  //printf("restore state=%d->%d\n",YY_START,g_currentCtx->lexState);
-  BEGIN(g_currentCtx->lexState);
-  g_braceCount = g_currentCtx->braceCount;
-  if (!g_contextStack.isEmpty())
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  //printf("restore state=%d->%d\n",YY_START,yyextra->currentCtx->lexState);
+  BEGIN(yyextra->currentCtx->lexState);
+  yyextra->braceCount = yyextra->currentCtx->braceCount;
+  if (!yyextra->contextStack.isEmpty())
   {
-    g_currentCtx = g_contextStack.pop();
+    yyextra->currentCtx = yyextra->contextStack.pop();
   }
   else
   {
-    g_currentCtx = 0;
-    //printf("Trying to pop context while g_contextStack is empty!\n");
+    yyextra->currentCtx = 0;
+    //printf("Trying to pop context while yyextra->contextStack is empty!\n");
   }
 }
 
-void resetCCodeParserState()
+struct CCodeParser::Private
+{
+  yyscan_t yyscanner;
+  codeYY_state state;
+};
+
+CCodeParser::CCodeParser() : p(std::make_unique<CCodeParser::Private>())
+{
+  codeYYlex_init_extra(&p->state,&p->yyscanner);
+#ifdef FLEX_DEBUG
+  codeYYset_debug(1,p->yyscanner);
+#endif
+}
+
+CCodeParser::~CCodeParser()
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
+  yyextra->classScopeLengthStack.clear();
+  delete yyextra->codeClassSDict;
+  yyextra->codeClassSDict=0;
+  codeYYlex_destroy(p->yyscanner);
+}
+
+void CCodeParser::resetCodeParserState()
 {
-  //printf("***initParseCodeContext()\n");
-  g_forceTagReference.resize(0);
-  g_theVarContext.clear();
-  g_classScopeLengthStack.setAutoDelete(TRUE);
-  g_classScopeLengthStack.clear();
-  delete g_codeClassSDict;
-  g_codeClassSDict = new ClassSDict(17);
-  g_codeClassSDict->setAutoDelete(TRUE);
-  g_codeClassSDict->clear();
-  g_curClassBases.clear();
-  g_anchorCount = 0;
+  struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
+  //printf("***CodeParser::reset()\n");
+  yyextra->forceTagReference.resize(0);
+  yyextra->theVarContext.clear();
+  yyextra->classScopeLengthStack.setAutoDelete(TRUE);
+  yyextra->classScopeLengthStack.clear();
+  delete yyextra->codeClassSDict;
+  yyextra->codeClassSDict = new ClassSDict(17);
+  yyextra->codeClassSDict->setAutoDelete(TRUE);
+  yyextra->codeClassSDict->clear();
+  yyextra->curClassBases.clear();
+  yyextra->anchorCount = 0;
 }
 
-void parseCCode(CodeOutputInterface &od,const char *className,const QCString &s, 
+void CCodeParser::parseCode(CodeOutputInterface &od,const char *className,const QCString &s, 
                 SrcLangExt lang,bool exBlock, const char *exName,FileDef *fd,
                int startLine,int endLine,bool inlineFragment,
                const MemberDef *memberDef,bool showLineNumbers,const Definition *searchCtx,
                 bool collectXRefs)
 {
+  yyscan_t yyscanner = p->yyscanner;
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
   //printf("***parseCode() exBlock=%d exName=%s fd=%p className=%s searchCtx=%s\n",
   //      exBlock,exName,fd,className,searchCtx?searchCtx->name().data():"<none>");
 
@@ -3762,116 +3915,93 @@ void parseCCode(CodeOutputInterface &od,const char *className,const QCString &s,
 
   printlex(yy_flex_debug, TRUE, __FILE__, fd ? fd->fileName().data(): NULL);
 
-  if (g_codeClassSDict==0)
+  if (yyextra->codeClassSDict==0)
   {
-    resetCCodeParserState();
+    resetCodeParserState();
   }
-  g_code = &od;
-  g_inputString   = s;
-  g_inputPosition = 0;
-  g_currentFontClass = 0;
-  g_needsTermination = FALSE;
-  g_searchCtx = searchCtx;
-  g_collectXRefs = collectXRefs;
-  g_inFunctionTryBlock = FALSE;
+  yyextra->code = &od;
+  yyextra->inputString   = s;
+  yyextra->inputPosition = 0;
+  codeYYrestart(0,yyscanner);
+  yyextra->currentFontClass = 0;
+  yyextra->needsTermination = FALSE;
+  yyextra->searchCtx = searchCtx;
+  yyextra->collectXRefs = collectXRefs;
+  yyextra->inFunctionTryBlock = FALSE;
 
   if (startLine!=-1)
-    g_yyLineNr    = startLine;
+    yyextra->yyLineNr    = startLine;
   else
-    g_yyLineNr    = 1;
+    yyextra->yyLineNr    = 1;
 
   if (endLine!=-1)
-    g_inputLines  = endLine+1;
+    yyextra->inputLines  = endLine+1;
   else
-    g_inputLines  = g_yyLineNr + countLines() - 1;
-
-  g_curlyCount    = 0;
-  g_bodyCurlyCount    = 0;
-  g_bracketCount  = 0;
-  g_sharpCount    = 0;
-  g_insideTemplate = FALSE;
-  g_theCallContext.clear();
-  g_scopeStack.clear();
-  g_classScope    = className;
+    yyextra->inputLines  = yyextra->yyLineNr + countLines(yyscanner) - 1;
+
+  yyextra->curlyCount    = 0;
+  yyextra->bodyCurlyCount    = 0;
+  yyextra->bracketCount  = 0;
+  yyextra->sharpCount    = 0;
+  yyextra->insideTemplate = FALSE;
+  yyextra->theCallContext.clear();
+  yyextra->scopeStack.clear();
+  yyextra->classScope    = className;
   //printf("parseCCode %s\n",className);
-  g_exampleBlock  = exBlock; 
-  g_exampleName   = exName;
-  g_sourceFileDef = fd;
-  g_lineNumbers   = fd!=0 && showLineNumbers;
+  yyextra->exampleBlock  = exBlock; 
+  yyextra->exampleName   = exName;
+  yyextra->sourceFileDef = fd;
+  yyextra->lineNumbers   = fd!=0 && showLineNumbers;
   bool cleanupSourceDef = FALSE;
   if (fd==0)
   {
     // create a dummy filedef for the example
-    g_sourceFileDef = createFileDef("",(exName?exName:"generated"));
+    yyextra->sourceFileDef = createFileDef("",(exName?exName:"generated"));
     cleanupSourceDef = TRUE;
   }
-  g_insideObjC  = lang==SrcLangExt_ObjC;
-  g_insideJava  = lang==SrcLangExt_Java;
-  g_insideCS    = lang==SrcLangExt_CSharp;
-  g_insidePHP   = lang==SrcLangExt_PHP;
-  g_insideCpp   = lang==SrcLangExt_Cpp;
-  g_insideSlice = lang==SrcLangExt_Slice;
-  if (g_sourceFileDef) 
+  yyextra->lang        = lang;
+  yyextra->insideObjC  = lang==SrcLangExt_ObjC;
+  if (yyextra->sourceFileDef) 
   {
-    setCurrentDoc("l00001");
+    setCurrentDoc(yyscanner,"l00001");
   }
-  g_currentDefinition = 0;
-  g_currentMemberDef = 0;
-  g_searchingForBody = exBlock;
-  g_insideBody = FALSE;
-  g_bracketCount = 0;
-  if (!g_exampleName.isEmpty())
+  yyextra->currentDefinition = 0;
+  yyextra->currentMemberDef = 0;
+  yyextra->searchingForBody = exBlock;
+  yyextra->insideBody = FALSE;
+  yyextra->bracketCount = 0;
+  if (!yyextra->exampleName.isEmpty())
   {
-    g_exampleFile = convertNameToFile(g_exampleName+"-example",FALSE,TRUE);
-    //printf("g_exampleFile=%s\n",g_exampleFile.data());
+    yyextra->exampleFile = convertNameToFile(yyextra->exampleName+"-example",FALSE,TRUE);
+    //printf("yyextra->exampleFile=%s\n",yyextra->exampleFile.data());
   }
-  g_includeCodeFragment = inlineFragment;
+  yyextra->includeCodeFragment = inlineFragment;
   //printf("** exBlock=%d exName=%s include=%d\n",exBlock,exName,inlineFragment);
-  startCodeLine();
-  g_type.resize(0);
-  g_name.resize(0);
-  g_args.resize(0);
-  g_parmName.resize(0);
-  g_parmType.resize(0);
-  if (memberDef) setParameterList(memberDef);
-  codeYYrestart( codeYYin );
+  startCodeLine(yyscanner);
+  yyextra->type.resize(0);
+  yyextra->name.resize(0);
+  yyextra->args.resize(0);
+  yyextra->parmName.resize(0);
+  yyextra->parmType.resize(0);
+  if (memberDef) setParameterList(yyscanner,memberDef);
   BEGIN( Body );
-  codeYYlex();
-  g_lexInit=TRUE;
-  if (g_needsTermination)
+  codeYYlex(yyscanner);
+  yyextra->lexInit=TRUE;
+  if (yyextra->needsTermination)
   {
-    endFontClass();
-    DBG_CTX((stderr,"endCodeLine(%d)\n",g_yyLineNr));
-    g_code->endCodeLine();
+    endFontClass(yyscanner);
+    DBG_CTX((stderr,"endCodeLine(%d)\n",yyextra->yyLineNr));
+    yyextra->code->endCodeLine();
   }
   if (cleanupSourceDef)
   {
     // delete the temporary file definition used for this example
-    delete g_sourceFileDef;
-    g_sourceFileDef=0;
+    delete yyextra->sourceFileDef;
+    yyextra->sourceFileDef=0;
   }
 
   printlex(yy_flex_debug, FALSE, __FILE__, fd ? fd->fileName().data(): NULL);
   return;
 }
 
-void codeFreeScanner()
-{
-#if defined(YY_FLEX_SUBMINOR_VERSION) 
-  if (g_lexInit)
-  {
-    codeYYlex_destroy();
-  }
-#endif
-}
-
-
-
-#if !defined(YY_FLEX_SUBMINOR_VERSION) 
-extern "C" { // some bogus code to keep the compiler happy
-  void codeYYdummy() { yy_flex_realloc(0,0); } 
-}
-#elif YY_FLEX_MAJOR_VERSION<=2 && YY_FLEX_MINOR_VERSION<=5 && YY_FLEX_SUBMINOR_VERSION<33
-#error "You seem to be using a version of flex newer than 2.5.4. These are currently incompatible with 2.5.4, and do NOT work with doxygen! Please use version 2.5.4 or expect things to be parsed wrongly! A bug report has been submitted (#732132)."
-#endif
-
+#include "code.l.h"
index a5dd0af..f3367a4 100644 (file)
@@ -16,6 +16,8 @@
  */
 %option never-interactive
 %option prefix="commentcnvYY"
+%option reentrant
+%option extra-type="struct commentcnvYY_state *"
 
 %{
 
@@ -41,8 +43,8 @@
 #define YY_NO_INPUT 1
 #define YY_NO_UNISTD_H 1
 
-#define ADDCHAR(c)    g_outBuf->addChar(c)
-#define ADDARRAY(a,s) g_outBuf->addArray(a,s)
+#define ADDCHAR(c)    yyextra->outBuf->addChar(c)
+#define ADDARRAY(a,s) yyextra->outBuf->addArray(a,s)
   
 struct CondCtx
 {
@@ -60,183 +62,66 @@ struct CommentCtx
   int lineNr;
 };
   
-static BufStr * g_inBuf;
-static BufStr * g_outBuf;
-static int      g_inBufPos;
-static int      g_col;
-static int      g_blockHeadCol;
-static bool     g_mlBrief;
-static int      g_readLineCtx;
-static bool     g_skip;
-static QCString g_fileName;
-static int      g_lineNr;
-static int      g_condCtx;
-static QStack<CondCtx> g_condStack;
-static QStack<CommentCtx> g_commentStack;
-static QCString g_blockName;
-static int      g_lastCommentContext;
-static bool     g_inSpecialComment;
-static bool     g_inRoseComment;
-static int      g_stringContext;
-static int      g_charContext;
-static int      g_javaBlock;
-static bool     g_specialComment;
-
-static QCString g_aliasString;
-static int      g_blockCount;
-static bool     g_lastEscaped;
-static int      g_lastBlockContext;
-static bool     g_pythonDocString;
-static int      g_nestingCount;
-
-static bool     g_vhdl; // for VHDL old style --! comment
+struct commentcnvYY_state
+{
+  BufStr * inBuf = 0;
+  BufStr * outBuf = 0;
+  int      inBufPos = 0;
+  int      col = 0;
+  int      blockHeadCol = 0;
+  bool     mlBrief = FALSE;
+  int      readLineCtx = 0;
+  bool     skip = FALSE;
+  QCString fileName;
+  int      lineNr = 0;
+  int      condCtx = 0;
+  QStack<CondCtx> condStack;
+  QStack<CommentCtx> commentStack;
+  QCString blockName;
+  int      lastCommentContext = 0;
+  bool     inSpecialComment = FALSE;
+  bool     inRoseComment= FALSE;
+  int      stringContext = 0;
+  int      charContext = 0;
+  int      javaBlock = 0;
+  bool     specialComment = FALSE;
 
-static SrcLangExt g_lang;
-static bool       isFixedForm; // For Fortran
+  QCString aliasString;
+  int      blockCount = 0;
+  bool     lastEscaped = FALSE;
+  int      lastBlockContext= 0;
+  bool     pythonDocString = FALSE;
+  int      nestingCount= 0;
 
-static void replaceCommentMarker(const char *s,int len)
-{
-  const char *p=s;
-  char c;
-  // copy leading blanks
-  while ((c=*p) && (c==' ' || c=='\t' || c=='\n')) 
-  {
-    ADDCHAR(c);
-    g_lineNr += c=='\n';
-    p++;
-  }
-  // replace start of comment marker by blanks and the last character by a *
-  int blanks=0;
-  while ((c=*p) && (c=='/' || c=='!' || c=='#')) 
-  {
-    blanks++;
-    p++;
-    if (*p=='<') // comment-after-item marker 
-    { 
-      blanks++;
-      p++; 
-    }
-    if (c=='!') // end after first !
-    {
-      break;
-    }
-  }
-  if (blanks>0)
-  {
-    while (blanks>2)
-    {
-      ADDCHAR(' ');
-      blanks--;
-    }
-    if (blanks>1) ADDCHAR('*');
-    ADDCHAR(' ');
-  }
-  // copy comment line to output
-  ADDARRAY(p,len-(int)(p-s));
-}
+  bool     vhdl = FALSE; // for VHDL old style --! comment
 
-static inline int computeIndent(const char *s)
-{
-  int col=0;
-  static int tabSize=Config_getInt(TAB_SIZE);
-  const char *p=s;
-  char c;
-  while ((c=*p++))
-  {
-    if (c==' ') col++;
-    else if (c=='\t') col+=tabSize-(col%tabSize); 
-    else break;
-  }
-  return col;
-}
+  SrcLangExt lang = SrcLangExt_Unknown;
+  bool       isFixedForm = FALSE; // For Fortran
+};
 
-static inline void copyToOutput(const char *s,int len)
-{
-  int i;
-  if (g_skip) // only add newlines.
-  {
-    for (i=0;i<len;i++) 
-    {
-      if (s[i]=='\n') 
-      {
-       ADDCHAR('\n');
-       //fprintf(stderr,"---> skip %d\n",g_lineNr);
-       g_lineNr++;
-      }
-    }
-  }
-  else if (len>0)
-  {
-    ADDARRAY(s,len);
-    static int tabSize=Config_getInt(TAB_SIZE);
-    for (i=0;i<len;i++) 
-    {
-      switch (s[i])
-      {
-       case '\n': g_col=0; 
-                  //fprintf(stderr,"---> copy %d\n",g_lineNr);
-                  g_lineNr++; break;
-       case '\t': g_col+=tabSize-(g_col%tabSize); break;
-       default:   g_col++; break;
-      }
-    }
-  }
-}
+static const char *stateToString(int state);
+static inline int computeIndent(const char *s);
 
-static void startCondSection(const char *sectId)
-{
-  //printf("startCondSection: skip=%d stack=%d\n",g_skip,g_condStack.count());
-  CondParser prs;
-  bool expResult = prs.parse(g_fileName,g_lineNr,sectId);
-  g_condStack.push(new CondCtx(g_lineNr,sectId,g_skip));
-  if (!expResult) // not enabled
-  {
-    g_skip=TRUE;
-  }
-}
+static void replaceCommentMarker(yyscan_t yyscanner,const char *s,int len);
+static inline void copyToOutput(yyscan_t yyscanner,const char *s,int len);
+static void startCondSection(yyscan_t yyscanner,const char *sectId);
+static void endCondSection(yyscan_t yyscanner);
+static void handleCondSectionId(yyscan_t yyscanner,const char *expression);
+static void replaceAliases(yyscan_t yyscanner,const char *s);
+static int yyread(yyscan_t yyscanner,char *buf,int max_size);
+static void replaceComment(yyscan_t yyscanner,int offset);
 
-static void endCondSection()
-{
-  if (g_condStack.isEmpty())
-  {
-    warn(g_fileName,g_lineNr,"Found \\endcond command without matching \\cond");
-    g_skip=FALSE;
-  }
-  else
-  {
-    CondCtx *ctx = g_condStack.pop();
-    g_skip=ctx->skip;
-  }
-  //printf("endCondSection: skip=%d stack=%d\n",g_skip,g_condStack.count());
-}
 
-/** copies string \a s with length \a len to the output, while 
- *  replacing any alias commands found in the string.
- */
-static void replaceAliases(const char *s)
-{
-  QCString result = resolveAliasCmd(s);
-  //printf("replaceAliases(%s)->'%s'\n",s,result.data());
-  copyToOutput(result,result.length());
-}
 
 
 #undef  YY_INPUT
-#define YY_INPUT(buf,result,max_size) result=yyread(buf,max_size);
-
-static int yyread(char *buf,int max_size)
-{
-  int bytesInBuf = g_inBuf->curPos()-g_inBufPos;
-  int bytesToCopy = QMIN(max_size,bytesInBuf);
-  memcpy(buf,g_inBuf->data()+g_inBufPos,bytesToCopy);
-  g_inBufPos+=bytesToCopy;
-  return bytesToCopy;
-}
+#define YY_INPUT(buf,result,max_size) result=yyread(yyscanner,buf,max_size);
 
-void replaceComment(int offset);
 
 %}
 
+MAILADR   ("mailto:")?[a-z_A-Z0-9.+-]+"@"[a-z_A-Z0-9-]+("."[a-z_A-Z0-9\-]+)+[a-z_A-Z0-9\-]+
+
 %option noyywrap
 
 %x Scan
@@ -253,55 +138,55 @@ void replaceComment(int offset);
 %%
 
 <Scan>[^"'!\/\n\\#,\-]*             { /* eat anything that is not " / , or \n */
-                                       copyToOutput(yytext,(int)yyleng);
+                                       copyToOutput(yyscanner,yytext,(int)yyleng);
                                     }
 <Scan>[,]                           { /* eat , so we have a nice separator in long initialization lines */ 
-                                       copyToOutput(yytext,(int)yyleng);
+                                       copyToOutput(yyscanner,yytext,(int)yyleng);
                                     }
 <Scan>"\"\"\""!                     { /* start of python long comment */
-                                     if (g_lang!=SrcLangExt_Python)
+                                     if (yyextra->lang!=SrcLangExt_Python)
                                     {
                                       REJECT;
                                     }
                                     else
                                     {
-                                       g_pythonDocString = TRUE;
-                                       g_nestingCount=1;
-                                       g_commentStack.clear(); /*  to be on the save side */
-                                       copyToOutput(yytext,(int)yyleng);
+                                       yyextra->pythonDocString = TRUE;
+                                       yyextra->nestingCount=1;
+                                       yyextra->commentStack.clear(); /*  to be on the save side */
+                                       copyToOutput(yyscanner,yytext,(int)yyleng);
                                       BEGIN(CComment);
-                                       g_commentStack.push(new CommentCtx(g_lineNr));
+                                       yyextra->commentStack.push(new CommentCtx(yyextra->lineNr));
                                     }
                                    }
 <Scan>![><!]/.*\n         {
-                                     if (g_lang!=SrcLangExt_Fortran)
+                                     if (yyextra->lang!=SrcLangExt_Fortran)
                                     {
                                       REJECT;
                                     }
                                     else
                                     {
-                                       copyToOutput(yytext,(int)yyleng); 
-                                       g_nestingCount=0; // Fortran doesn't have an end comment
-                                       g_commentStack.clear(); /*  to be on the save side */
+                                       copyToOutput(yyscanner,yytext,(int)yyleng); 
+                                       yyextra->nestingCount=0; // Fortran doesn't have an end comment
+                                       yyextra->commentStack.clear(); /*  to be on the save side */
                                       BEGIN(CComment);
-                                       g_commentStack.push(new CommentCtx(g_lineNr));
+                                       yyextra->commentStack.push(new CommentCtx(yyextra->lineNr));
                                     }
                                   }
 <Scan>[Cc\*][><!]/.*\n    {
-                                     if (g_lang!=SrcLangExt_Fortran)
+                                     if (yyextra->lang!=SrcLangExt_Fortran)
                                     {
                                       REJECT;
                                     }
                                     else
                                     {
                                        /* check for fixed format; we might have some conditional as part of multiline if like C<5 .and. & */
-                                       if (isFixedForm && (g_col == 0))
+                                       if (yyextra->isFixedForm && (yyextra->col == 0))
                                        {
-                                         copyToOutput(yytext,(int)yyleng); 
-                                         g_nestingCount=0; // Fortran doesn't have an end comment
-                                         g_commentStack.clear(); /* to be on the safe side */
+                                         copyToOutput(yyscanner,yytext,(int)yyleng); 
+                                         yyextra->nestingCount=0; // Fortran doesn't have an end comment
+                                         yyextra->commentStack.clear(); /* to be on the safe side */
                                         BEGIN(CComment);
-                                         g_commentStack.push(new CommentCtx(g_lineNr));
+                                         yyextra->commentStack.push(new CommentCtx(yyextra->lineNr));
                                       }
                                       else
                                       {
@@ -310,25 +195,25 @@ void replaceComment(int offset);
                                     }
                                   }
 <Scan>!.*\n               {
-                                    if (g_lang!=SrcLangExt_Fortran)
+                                    if (yyextra->lang!=SrcLangExt_Fortran)
                                     {
                                       REJECT;
                                     }
                                     else
                                     {
-                                       copyToOutput(yytext,(int)yyleng); 
+                                       copyToOutput(yyscanner,yytext,(int)yyleng); 
                                     }
                                    }
 <Scan>[Cc\*].*\n                  {
-                                    if (g_lang!=SrcLangExt_Fortran)
+                                    if (yyextra->lang!=SrcLangExt_Fortran)
                                     {
                                       REJECT;
                                     }
                                     else
                                     {
-                                       if (g_col == 0)
+                                       if (yyextra->col == 0)
                                        {
-                                         copyToOutput(yytext,(int)yyleng); 
+                                         copyToOutput(yyscanner,yytext,(int)yyleng); 
                                       }
                                       else
                                       {
@@ -337,24 +222,24 @@ void replaceComment(int offset);
                                     }
                                    }
 <Scan>"\""                         { /* start of a string */ 
-                                     copyToOutput(yytext,(int)yyleng); 
-                                    g_stringContext = YY_START;
+                                     copyToOutput(yyscanner,yytext,(int)yyleng); 
+                                    yyextra->stringContext = YY_START;
                                     BEGIN(SkipString); 
                                    }
 <Scan>'                                   {
-                                     copyToOutput(yytext,(int)yyleng); 
-                                    g_charContext = YY_START;
-                                     if (g_lang!=SrcLangExt_VHDL)
+                                     copyToOutput(yyscanner,yytext,(int)yyleng); 
+                                    yyextra->charContext = YY_START;
+                                     if (yyextra->lang!=SrcLangExt_VHDL)
                                      {
                                       BEGIN(SkipChar);
                                      }
                                   }
 <Scan>\n                           { /* new line */ 
-                                     copyToOutput(yytext,(int)yyleng); 
+                                     copyToOutput(yyscanner,yytext,(int)yyleng); 
                                    }
 <Scan>"//!"/.*\n[ \t]*"//"[\/!][^\/] | /* start C++ style special comment block */
 <Scan>("///"[/]*)/[^/].*\n[ \t]*"//"[\/!][^\/] { /* start C++ style special comment block */
-                                    if (g_mlBrief) 
+                                    if (yyextra->mlBrief) 
                                     {
                                       REJECT; // bail out if we do not need to convert
                                     }
@@ -365,190 +250,194 @@ void replaceComment(int offset);
                                       {
                                         while (i<(int)yyleng && yytext[i]=='/') i++;
                                       }
-                                      g_blockHeadCol=g_col;
-                                      copyToOutput("/**",3); 
-                                      replaceAliases(yytext+i);
-                                      g_inSpecialComment=TRUE;
+                                      yyextra->blockHeadCol=yyextra->col;
+                                      copyToOutput(yyscanner,"/**",3); 
+                                      replaceAliases(yyscanner,yytext+i);
+                                      yyextra->inSpecialComment=TRUE;
                                       //BEGIN(SComment); 
-                                      g_readLineCtx=SComment;
+                                      yyextra->readLineCtx=SComment;
                                       BEGIN(ReadLine);
                                     }
                                    }
 <Scan>"//##Documentation".*/\n    { /* Start of Rational Rose ANSI C++ comment block */
-                                     if (g_mlBrief) REJECT;
+                                     if (yyextra->mlBrief) REJECT;
                                      int i=17; //=strlen("//##Documentation");
-                                    g_blockHeadCol=g_col;
-                                    copyToOutput("/**",3);
-                                    replaceAliases(yytext+i);
-                                    g_inRoseComment=TRUE;
+                                    yyextra->blockHeadCol=yyextra->col;
+                                    copyToOutput(yyscanner,"/**",3);
+                                    replaceAliases(yyscanner,yytext+i);
+                                    yyextra->inRoseComment=TRUE;
                                     BEGIN(SComment);
                                   }
 <Scan>"//"[!\/]/.*\n[ \t]*"//"[|\/][ \t]*[@\\]"}" { // next line contains an end marker, see bug 752712
-                                    g_inSpecialComment=yytext[2]=='/' || yytext[2]=='!';
-                                    copyToOutput(yytext,(int)yyleng); 
-                                    g_readLineCtx=YY_START;
+                                    yyextra->inSpecialComment=yytext[2]=='/' || yytext[2]=='!';
+                                    copyToOutput(yyscanner,yytext,(int)yyleng); 
+                                    yyextra->readLineCtx=YY_START;
                                     BEGIN(ReadLine);
                                    }
 <Scan>"//"/.*\n                           { /* one line C++ comment */ 
-                                    g_inSpecialComment=yytext[2]=='/' || yytext[2]=='!';
-                                    copyToOutput(yytext,(int)yyleng); 
-                                    g_readLineCtx=YY_START;
+                                    yyextra->inSpecialComment=yytext[2]=='/' || yytext[2]=='!';
+                                    copyToOutput(yyscanner,yytext,(int)yyleng); 
+                                    yyextra->readLineCtx=YY_START;
                                     BEGIN(ReadLine);
                                   }
 <Scan>"/**/"                       { /* avoid matching next rule for empty C comment, see bug 711723 */
-                                     copyToOutput(yytext,(int)yyleng);
+                                     copyToOutput(yyscanner,yytext,(int)yyleng);
                                    }
 <Scan>"/*"[*!]?                           { /* start of a C comment */
-                                     if ((g_lang==SrcLangExt_Python) || (g_lang==SrcLangExt_Tcl))
+                                     if ((yyextra->lang==SrcLangExt_Python) || (yyextra->lang==SrcLangExt_Tcl))
                                     {
                                       REJECT;
                                      }
-                                    g_specialComment=(int)yyleng==3;
-                                     g_nestingCount=1;
-                                     g_commentStack.clear(); /*  to be on the save side */
-                                     copyToOutput(yytext,(int)yyleng); 
+                                    yyextra->specialComment=(int)yyleng==3;
+                                     yyextra->nestingCount=1;
+                                     yyextra->commentStack.clear(); /*  to be on the save side */
+                                     copyToOutput(yyscanner,yytext,(int)yyleng); 
                                     BEGIN(CComment); 
-                                     g_commentStack.push(new CommentCtx(g_lineNr));
+                                     yyextra->commentStack.push(new CommentCtx(yyextra->lineNr));
                                    }
 <Scan>"#"("#")?                           {
-                                     if (g_lang!=SrcLangExt_Python)
+                                     if (yyextra->lang!=SrcLangExt_Python)
                                     {
                                       REJECT;
                                     }
                                     else
                                     {
-                                       copyToOutput(yytext,(int)yyleng); 
-                                       g_nestingCount=0; // Python doesn't have an end comment for #
-                                       g_commentStack.clear(); /*  to be on the save side */
+                                       copyToOutput(yyscanner,yytext,(int)yyleng); 
+                                       yyextra->nestingCount=0; // Python doesn't have an end comment for #
+                                       yyextra->commentStack.clear(); /*  to be on the save side */
                                       BEGIN(CComment);
-                                       g_commentStack.push(new CommentCtx(g_lineNr));
+                                       yyextra->commentStack.push(new CommentCtx(yyextra->lineNr));
                                     }
                                   }
 <Scan>"--!"                       {
-                                     if (g_lang!=SrcLangExt_VHDL)
+                                     if (yyextra->lang!=SrcLangExt_VHDL)
                                     {
                                       REJECT;
                                     }
                                     else
                                     {
-                                       g_vhdl = TRUE;
-                                       copyToOutput(yytext,(int)yyleng); 
-                                       g_nestingCount=0;  // VHDL doesn't have an end comment
-                                       g_commentStack.clear(); /*  to be on the save side */
+                                       yyextra->vhdl = TRUE;
+                                       copyToOutput(yyscanner,yytext,(int)yyleng); 
+                                       yyextra->nestingCount=0;  // VHDL doesn't have an end comment
+                                       yyextra->commentStack.clear(); /*  to be on the save side */
                                       BEGIN(CComment);
-                                       g_commentStack.push(new CommentCtx(g_lineNr));
+                                       yyextra->commentStack.push(new CommentCtx(yyextra->lineNr));
                                     }
                                   }
 <Scan>![><!]                      {
-                                     if (g_lang!=SrcLangExt_Fortran)
+                                     if (yyextra->lang!=SrcLangExt_Fortran)
                                     {
                                       REJECT;
                                     }
                                     else
                                     {
-                                       copyToOutput(yytext,(int)yyleng); 
-                                       g_nestingCount=0;  // Fortran doesn't have an end comment
-                                       g_commentStack.clear(); /*  to be on the save side */
+                                       copyToOutput(yyscanner,yytext,(int)yyleng); 
+                                       yyextra->nestingCount=0;  // Fortran doesn't have an end comment
+                                       yyextra->commentStack.clear(); /*  to be on the save side */
                                       BEGIN(CComment);
-                                       g_commentStack.push(new CommentCtx(g_lineNr));
+                                       yyextra->commentStack.push(new CommentCtx(yyextra->lineNr));
                                     }
                                   }
+<CComment,ReadLine>{MAILADR}      |
+<CComment,ReadLine>"<"{MAILADR}">" { // Mail address, to prevent seeing e.g x@code-factory.org as start of a code block
+                                     copyToOutput(yyscanner,yytext,(int)yyleng);
+                                   }
 <CComment>"{@code"/[ \t\n]        {
-                                     copyToOutput("@code",5); 
-                                    g_lastCommentContext = YY_START;
-                                    g_javaBlock=1;
-                                    g_blockName=&yytext[1];
+                                     copyToOutput(yyscanner,"@code",5); 
+                                    yyextra->lastCommentContext = YY_START;
+                                    yyextra->javaBlock=1;
+                                    yyextra->blockName=&yytext[1];
                                      BEGIN(VerbatimCode);
                                   }
 <CComment,ReadLine>[\\@]("dot"|"code"|"msc"|"startuml")/[^a-z_A-Z0-9] { /* start of a verbatim block */
-                                     copyToOutput(yytext,(int)yyleng); 
-                                    g_lastCommentContext = YY_START;
-                                    g_javaBlock=0;
+                                     copyToOutput(yyscanner,yytext,(int)yyleng); 
+                                    yyextra->lastCommentContext = YY_START;
+                                    yyextra->javaBlock=0;
                                      if (qstrcmp(&yytext[1],"startuml")==0)
                                      {
-                                       g_blockName="uml";
+                                       yyextra->blockName="uml";
                                      }
                                      else
                                      {
-                                      g_blockName=&yytext[1];
+                                      yyextra->blockName=&yytext[1];
                                      }
                                      BEGIN(VerbatimCode);
                                   }
 <CComment,ReadLine>[\\@]("f$"|"f["|"f{") {
-                                     copyToOutput(yytext,(int)yyleng); 
-                                    g_blockName=&yytext[1];
-                                    if (g_blockName.at(1)=='[')
+                                     copyToOutput(yyscanner,yytext,(int)yyleng); 
+                                    yyextra->blockName=&yytext[1];
+                                    if (yyextra->blockName.at(1)=='[')
                                     {
-                                      g_blockName.at(1)=']';
+                                      yyextra->blockName.at(1)=']';
                                     }
-                                    else if (g_blockName.at(1)=='{')
+                                    else if (yyextra->blockName.at(1)=='{')
                                     {
-                                      g_blockName.at(1)='}';
+                                      yyextra->blockName.at(1)='}';
                                     }
-                                    g_lastCommentContext = YY_START;
+                                    yyextra->lastCommentContext = YY_START;
                                     BEGIN(Verbatim);
                                   }
 <CComment,ReadLine>[\\@]("verbatim"|"latexonly"|"htmlonly"|"xmlonly"|"docbookonly"|"rtfonly"|"manonly")/[^a-z_A-Z0-9] { /* start of a verbatim block */
-                                     copyToOutput(yytext,(int)yyleng); 
-                                    g_blockName=&yytext[1];
-                                    g_lastCommentContext = YY_START;
+                                     copyToOutput(yyscanner,yytext,(int)yyleng); 
+                                    yyextra->blockName=&yytext[1];
+                                    yyextra->lastCommentContext = YY_START;
                                      BEGIN(Verbatim);
                                    }
-<Scan>.                            { /* any ather character */
-                                     copyToOutput(yytext,(int)yyleng); 
+<Scan>.                            { /* any other character */
+                                     copyToOutput(yyscanner,yytext,(int)yyleng); 
                                    }
 <Verbatim>[\\@]("endverbatim"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endrtfonly"|"endmanonly"|"f$"|"f]"|"f}") { /* end of verbatim block */
-                                     copyToOutput(yytext,(int)yyleng);
-                                    if (&yytext[1]==g_blockName) // end of formula
+                                     copyToOutput(yyscanner,yytext,(int)yyleng);
+                                    if (&yytext[1]==yyextra->blockName) // end of formula
                                     {
-                                      BEGIN(g_lastCommentContext);
+                                      BEGIN(yyextra->lastCommentContext);
                                     }
-                                    else if (&yytext[4]==g_blockName)
+                                    else if (&yytext[4]==yyextra->blockName)
                                     {
-                                      BEGIN(g_lastCommentContext);
+                                      BEGIN(yyextra->lastCommentContext);
                                     }
                                    }
 <VerbatimCode>"{"                 {
-                                     if (g_javaBlock==0)
+                                     if (yyextra->javaBlock==0)
                                     {
                                       REJECT;
                                     }
                                     else
                                     {
-                                      g_javaBlock++;
-                                       copyToOutput(yytext,(int)yyleng);
+                                      yyextra->javaBlock++;
+                                       copyToOutput(yyscanner,yytext,(int)yyleng);
                                     }
                                    }
 <VerbatimCode>"}"                 {
-                                     if (g_javaBlock==0)
+                                     if (yyextra->javaBlock==0)
                                     {
                                       REJECT;
                                     }
                                     else
                                     {
-                                      g_javaBlock--;
-                                      if (g_javaBlock==0)
+                                      yyextra->javaBlock--;
+                                      if (yyextra->javaBlock==0)
                                       {
-                                         copyToOutput(" @endcode ",10);
-                                        BEGIN(g_lastCommentContext);
+                                         copyToOutput(yyscanner," @endcode ",10);
+                                        BEGIN(yyextra->lastCommentContext);
                                       }
                                       else
                                       {
-                                         copyToOutput(yytext,(int)yyleng);
+                                         copyToOutput(yyscanner,yytext,(int)yyleng);
                                       }
                                     }
                                   }
 <VerbatimCode>[\\@]("enddot"|"endcode"|"endmsc"|"enduml") { /* end of verbatim block */
-                                     copyToOutput(yytext,(int)yyleng);
-                                    if (&yytext[4]==g_blockName)
+                                     copyToOutput(yyscanner,yytext,(int)yyleng);
+                                    if (&yytext[4]==yyextra->blockName)
                                     {
-                                      BEGIN(g_lastCommentContext);
+                                      BEGIN(yyextra->lastCommentContext);
                                     }
                                    }
 <VerbatimCode>^[ \t]*"//"[\!\/]?   { /* skip leading comments */
-                                    if (!g_inSpecialComment)
+                                    if (!yyextra->inSpecialComment)
                                     {
-                                       copyToOutput(yytext,(int)yyleng); 
+                                       copyToOutput(yyscanner,yytext,(int)yyleng); 
                                     }
                                      else
                                      {
@@ -557,25 +446,25 @@ void replaceComment(int offset);
                                        {
                                          l++;
                                        }
-                                       copyToOutput(yytext,l);
+                                       copyToOutput(yyscanner,yytext,l);
                                        if (yyleng-l==3) // ends with //! or ///
                                        {
-                                         copyToOutput(" * ",3);
+                                         copyToOutput(yyscanner," * ",3);
                                        }
                                        else // ends with //
                                        {
-                                         copyToOutput("//",2);
+                                         copyToOutput(yyscanner,"//",2);
                                        }
                                      }
                                   }
 <Verbatim,VerbatimCode>[^@\/\\\n{}]* { /* any character not a backslash or new line or } */
-                                     copyToOutput(yytext,(int)yyleng); 
+                                     copyToOutput(yyscanner,yytext,(int)yyleng); 
                                    }
 <Verbatim,VerbatimCode>\n         { /* new line in verbatim block */
-                                     copyToOutput(yytext,(int)yyleng); 
+                                     copyToOutput(yyscanner,yytext,(int)yyleng); 
                                    }
 <Verbatim>^[ \t]*"///"             {
-                                    if (g_blockName=="dot" || g_blockName=="msc" || g_blockName=="uml" || g_blockName.at(0)=='f')
+                                    if (yyextra->blockName=="dot" || yyextra->blockName=="msc" || yyextra->blockName=="uml" || yyextra->blockName.at(0)=='f')
                                     {
                                       // see bug 487871, strip /// from dot images and formulas.
                                        int l=0;
@@ -583,8 +472,8 @@ void replaceComment(int offset);
                                        {
                                          l++;
                                        }
-                                       copyToOutput(yytext,l);
-                                      copyToOutput("   ",3);
+                                       copyToOutput(yyscanner,yytext,l);
+                                      copyToOutput(yyscanner,"   ",3);
                                     }
                                     else // even slashes are verbatim (e.g. \verbatim, \code)
                                     {
@@ -592,119 +481,119 @@ void replaceComment(int offset);
                                     }
                                   }
 <Verbatim,VerbatimCode>.          { /* any other character */
-                                     copyToOutput(yytext,(int)yyleng); 
+                                     copyToOutput(yyscanner,yytext,(int)yyleng); 
                                    }
 <SkipString>\\.                    { /* escaped character in string */
-                                     if (g_lang==SrcLangExt_Fortran)
+                                     if (yyextra->lang==SrcLangExt_Fortran)
                                      {
                                        unput(yytext[1]);
-                                       copyToOutput(yytext,1);
+                                       copyToOutput(yyscanner,yytext,1);
                                      }
                                      else
                                      {
-                                       copyToOutput(yytext,(int)yyleng);
+                                       copyToOutput(yyscanner,yytext,(int)yyleng);
                                      }
                                    }
 <SkipString>"\""                          { /* end of string */ 
-                                     copyToOutput(yytext,(int)yyleng); 
-                                    BEGIN(g_stringContext); 
+                                     copyToOutput(yyscanner,yytext,(int)yyleng); 
+                                    BEGIN(yyextra->stringContext); 
                                    }
 <SkipString>.                      { /* any other string character */ 
-                                     copyToOutput(yytext,(int)yyleng); 
+                                     copyToOutput(yyscanner,yytext,(int)yyleng); 
                                    }
 <SkipString>\n                     { /* new line inside string (illegal for some compilers) */ 
-                                     copyToOutput(yytext,(int)yyleng); 
+                                     copyToOutput(yyscanner,yytext,(int)yyleng); 
                                    }
 <SkipChar>\\.                     { /* escaped character */
-                                     if (g_lang==SrcLangExt_Fortran)
+                                     if (yyextra->lang==SrcLangExt_Fortran)
                                      {
                                        unput(yytext[1]);
-                                       copyToOutput(yytext,1);
+                                       copyToOutput(yyscanner,yytext,1);
                                      }
                                      else
                                      {
-                                       copyToOutput(yytext,(int)yyleng);
+                                       copyToOutput(yyscanner,yytext,(int)yyleng);
                                      }
                                    }
 <SkipChar>'                        { /* end of character literal */ 
-                                     copyToOutput(yytext,(int)yyleng); 
-                                     BEGIN(g_charContext);
+                                     copyToOutput(yyscanner,yytext,(int)yyleng); 
+                                     BEGIN(yyextra->charContext);
                                    }
 <SkipChar>.                        { /* any other string character */ 
-                                     copyToOutput(yytext,(int)yyleng); 
+                                     copyToOutput(yyscanner,yytext,(int)yyleng); 
                                    }
 <SkipChar>\n                       { /* new line character */
-                                     copyToOutput(yytext,(int)yyleng); 
+                                     copyToOutput(yyscanner,yytext,(int)yyleng); 
                                    }
 
-<CComment>[^\\!@*\n{\"\/]*           { /* anything that is not a '*' or command */ 
-                                     copyToOutput(yytext,(int)yyleng); 
+<CComment>[^ <\\!@*\n{\"\/]*       { /* anything that is not a '*' or command */ 
+                                     copyToOutput(yyscanner,yytext,(int)yyleng); 
                                    }
 <CComment>"*"+[^*/\\@\n{\"]*       { /* stars without slashes */
-                                     copyToOutput(yytext,(int)yyleng); 
+                                     copyToOutput(yyscanner,yytext,(int)yyleng); 
                                    }
 <CComment>"\"\"\""                 { /* end of Python docstring */
-                                     if (g_lang!=SrcLangExt_Python)
+                                     if (yyextra->lang!=SrcLangExt_Python)
                                     {
                                       REJECT;
                                     }
                                     else
                                     {
-                                       g_nestingCount--;
-                                       g_pythonDocString = FALSE;
-                                      copyToOutput(yytext,(int)yyleng);
+                                       yyextra->nestingCount--;
+                                       yyextra->pythonDocString = FALSE;
+                                      copyToOutput(yyscanner,yytext,(int)yyleng);
                                       BEGIN(Scan);
                                     }
                                   }
 <CComment>\n                       { /* new line in comment */
-                                     copyToOutput(yytext,(int)yyleng); 
+                                     copyToOutput(yyscanner,yytext,(int)yyleng); 
                                      /* in case of Fortran always end of comment */
-                                    if (g_lang==SrcLangExt_Fortran)
+                                    if (yyextra->lang==SrcLangExt_Fortran)
                                     {
                                       BEGIN(Scan);
                                     }
                                    }
 <CComment>"/"+"*"                  { /* nested C comment */
-                                     if ((g_lang==SrcLangExt_Python) || (g_lang==SrcLangExt_Tcl))
+                                     if ((yyextra->lang==SrcLangExt_Python) || (yyextra->lang==SrcLangExt_Tcl))
                                     {
                                       REJECT;
                                      }
-                                     g_nestingCount++;
-                                     g_commentStack.push(new CommentCtx(g_lineNr));
-                                     copyToOutput(yytext,(int)yyleng); 
+                                     yyextra->nestingCount++;
+                                     yyextra->commentStack.push(new CommentCtx(yyextra->lineNr));
+                                     copyToOutput(yyscanner,yytext,(int)yyleng); 
                                    }
 <CComment>"*"+"/"                  { /* end of C comment */
-                                     if ((g_lang==SrcLangExt_Python) || (g_lang==SrcLangExt_Tcl))
+                                     if ((yyextra->lang==SrcLangExt_Python) || (yyextra->lang==SrcLangExt_Tcl))
                                     {
                                       REJECT;
                                     }
                                     else
                                     {
-                                      copyToOutput(yytext,(int)yyleng);
-                                       g_nestingCount--;
-                                       if (g_nestingCount<=0)
+                                      copyToOutput(yyscanner,yytext,(int)yyleng);
+                                       yyextra->nestingCount--;
+                                       if (yyextra->nestingCount<=0)
                                        {
                                         BEGIN(Scan);
                                        }
                                        else
                                        {
-                                         //g_nestingCount--;
-                                         delete g_commentStack.pop();
+                                         //yyextra->nestingCount--;
+                                         delete yyextra->commentStack.pop();
                                        }
                                     }
                                    }
   /* Python an VHDL share CComment, so special attention for ending comments is required */
 <CComment>"\n"/[ \t]*"#"          {
-                                     if (g_lang!=SrcLangExt_VHDL)
+                                     if (yyextra->lang!=SrcLangExt_VHDL)
                                      {
                                        REJECT;
                                      }
                                      else
                                      {
-                                       if (g_vhdl) // inside --! comment
+                                       if (yyextra->vhdl) // inside --! comment
                                        {
-                                         g_vhdl = FALSE;
-                                        copyToOutput(yytext,(int)yyleng);
+                                         yyextra->vhdl = FALSE;
+                                        copyToOutput(yyscanner,yytext,(int)yyleng);
                                         BEGIN(Scan);
                                        }
                                        else // C-type comment
@@ -714,35 +603,35 @@ void replaceComment(int offset);
                                      }
                                    }
 <CComment>"\n"/[ \t]*"-"          {
-                                     if (g_lang!=SrcLangExt_Python || g_pythonDocString)
+                                     if (yyextra->lang!=SrcLangExt_Python || yyextra->pythonDocString)
                                     {
                                       REJECT;
                                     }
                                     else
                                     {
-                                      copyToOutput(yytext,(int)yyleng);
+                                      copyToOutput(yyscanner,yytext,(int)yyleng);
                                       BEGIN(Scan);
                                     }
                                    }
 <CComment>"\n"/[ \t]*[^ \t#\-]            {
-                                     if (g_lang==SrcLangExt_Python)
+                                     if (yyextra->lang==SrcLangExt_Python)
                                      {
-                                       if (g_pythonDocString)
+                                       if (yyextra->pythonDocString)
                                        {
                                          REJECT;
                                        }
                                        else
                                        {
-                                        copyToOutput(yytext,(int)yyleng);
+                                        copyToOutput(yyscanner,yytext,(int)yyleng);
                                         BEGIN(Scan);
                                        }
                                      }
-                                     else if (g_lang==SrcLangExt_VHDL)
+                                     else if (yyextra->lang==SrcLangExt_VHDL)
                                      {
-                                       if (g_vhdl) // inside --! comment
+                                       if (yyextra->vhdl) // inside --! comment
                                        {
-                                         g_vhdl = FALSE;
-                                        copyToOutput(yytext,(int)yyleng);
+                                         yyextra->vhdl = FALSE;
+                                        copyToOutput(yyscanner,yytext,(int)yyleng);
                                         BEGIN(Scan);
                                        }
                                        else // C-type comment
@@ -757,122 +646,125 @@ void replaceComment(int offset);
                                    }
    /* removed for bug 674842 (bug was introduced in rev 768)
 <CComment>"'"                     {
-                                    g_charContext = YY_START;
-                                    copyToOutput(yytext,(int)yyleng);
+                                    yyextra->charContext = YY_START;
+                                    copyToOutput(yyscanner,yytext,(int)yyleng);
                                     BEGIN(SkipChar);
                                   }
 <CComment>"\""                    {
-                                    g_stringContext = YY_START;
-                                    copyToOutput(yytext,(int)yyleng);
+                                    yyextra->stringContext = YY_START;
+                                    copyToOutput(yyscanner,yytext,(int)yyleng);
                                     BEGIN(SkipString);
                                   }
    */
 <CComment>.                       {
-                                     copyToOutput(yytext,(int)yyleng); 
+                                     copyToOutput(yyscanner,yytext,(int)yyleng); 
                                   }
 <SComment>^[ \t]*"///"[\/]*/\n     {
-                                    replaceComment(0);
+                                    replaceComment(yyscanner,0);
                                   }
 <SComment>\n[ \t]*"///"[\/]*/\n    {
-                                     replaceComment(1); 
+                                     replaceComment(yyscanner,1); 
                                    }
 <SComment>^[ \t]*"///"[^\/\n]/.*\n { 
-                                    replaceComment(0);
-                                    g_readLineCtx=YY_START;
+                                    replaceComment(yyscanner,0);
+                                    yyextra->readLineCtx=YY_START;
                                     BEGIN(ReadLine);
                                   }
 <SComment>\n[ \t]*"//"[\/!]("<")?[ \t]*[\\@]"}".*\n {   
                                      /* See Bug 752712: end the multiline comment when finding a @} or \} command */
-                                     copyToOutput(" */",3); 
-                                    copyToOutput(yytext,(int)yyleng); 
-                                    g_inSpecialComment=FALSE;
-                                    g_inRoseComment=FALSE;
+                                     copyToOutput(yyscanner," */",3); 
+                                    copyToOutput(yyscanner,yytext,(int)yyleng); 
+                                    yyextra->inSpecialComment=FALSE;
+                                    yyextra->inRoseComment=FALSE;
                                     BEGIN(Scan); 
                                    }
 <SComment>\n[ \t]*"///"[^\/\n]/.*\n  { 
-                                     replaceComment(1); 
-                                    g_readLineCtx=YY_START;
+                                     replaceComment(yyscanner,1); 
+                                    yyextra->readLineCtx=YY_START;
                                     BEGIN(ReadLine);
                                   }
 <SComment>^[ \t]*"//!"             |    // just //!
 <SComment>^[ \t]*"//!<"/.*\n       |    // or   //!< something
 <SComment>^[ \t]*"//!"[^<]/.*\n    {    // or   //!something
-                                    replaceComment(0);
-                                    g_readLineCtx=YY_START;
+                                    replaceComment(yyscanner,0);
+                                    yyextra->readLineCtx=YY_START;
                                     BEGIN(ReadLine);
                                    }
 <SComment>\n[ \t]*"//!"            |
 <SComment>\n[ \t]*"//!<"/.*\n      |
 <SComment>\n[ \t]*"//!"[^<\n]/.*\n { 
-                                     replaceComment(1); 
-                                    g_readLineCtx=YY_START;
+                                     replaceComment(yyscanner,1); 
+                                    yyextra->readLineCtx=YY_START;
                                     BEGIN(ReadLine);
                                    }
 <SComment>^[ \t]*"//##"/.*\n       {
-                                     if (!g_inRoseComment)
+                                     if (!yyextra->inRoseComment)
                                     {
                                       REJECT;
                                     }
                                     else
                                     {
-                                      replaceComment(0);
-                                      g_readLineCtx=YY_START;
+                                      replaceComment(yyscanner,0);
+                                      yyextra->readLineCtx=YY_START;
                                       BEGIN(ReadLine);
                                     }
                                    }
 <SComment>\n[ \t]*"//##"/.*\n      {
-                                     if (!g_inRoseComment)
+                                     if (!yyextra->inRoseComment)
                                     {
                                       REJECT;
                                     }
                                     else
                                     {
-                                       replaceComment(1); 
-                                      g_readLineCtx=YY_START;
+                                       replaceComment(yyscanner,1); 
+                                      yyextra->readLineCtx=YY_START;
                                       BEGIN(ReadLine);
                                     }
                                    }
 <SComment>\n                      { /* end of special comment */
-                                     copyToOutput(" */",3); 
-                                    copyToOutput(yytext,(int)yyleng); 
-                                    g_inSpecialComment=FALSE;
-                                    g_inRoseComment=FALSE;
+                                     copyToOutput(yyscanner," */",3); 
+                                    copyToOutput(yyscanner,yytext,(int)yyleng); 
+                                    yyextra->inSpecialComment=FALSE;
+                                    yyextra->inRoseComment=FALSE;
                                     BEGIN(Scan); 
                                    }
+<ReadLine>"/**"                    {
+                                    copyToOutput(yyscanner,"/&zwj;**",8);
+                                  }
 <ReadLine>"*/"                     {
-                                    copyToOutput("*&zwj;/",7);
+                                    copyToOutput(yyscanner,"*&zwj;/",7);
                                   }
 <ReadLine>"*"                      {
-                                    copyToOutput(yytext,(int)yyleng);
+                                    copyToOutput(yyscanner,yytext,(int)yyleng);
                                   }
-<ReadLine>[^\\@\n\*]*              {
-                                    copyToOutput(yytext,(int)yyleng);
+<ReadLine>[^\\@\n\*/]*             {
+                                    copyToOutput(yyscanner,yytext,(int)yyleng);
                                   }
-<ReadLine>[^\\@\n\*]*/\n           {
-                                    copyToOutput(yytext,(int)yyleng);
-                                    BEGIN(g_readLineCtx);
+<ReadLine>[^\\@\n\*/]*/\n          {
+                                    copyToOutput(yyscanner,yytext,(int)yyleng);
+                                    BEGIN(yyextra->readLineCtx);
                                   }
 <CComment,ReadLine>[\\@][\\@][~a-z_A-Z][a-z_A-Z0-9]*[ \t]* { // escaped command
-                                    copyToOutput(yytext,(int)yyleng);
+                                    copyToOutput(yyscanner,yytext,(int)yyleng);
                                   }
 <CComment,ReadLine>[\\@]"cond"/[^a-z_A-Z0-9]      { // conditional section
-                                    g_condCtx = YY_START; 
+                                    yyextra->condCtx = YY_START; 
                                     BEGIN(CondLine);
                                   }
 <CComment,ReadLine>[\\@]"endcond"/[^a-z_A-Z0-9] { // end of conditional section
-                                    bool oldSkip=g_skip;
-                                    endCondSection();
-                                    if (YY_START==CComment && oldSkip && !g_skip) 
+                                    bool oldSkip=yyextra->skip;
+                                    endCondSection(yyscanner);
+                                    if (YY_START==CComment && oldSkip && !yyextra->skip) 
                                     {
                                       //printf("** Adding start of comment!\n");
-                                      if (g_lang!=SrcLangExt_Python &&
-                                          g_lang!=SrcLangExt_VHDL &&
-                                          g_lang!=SrcLangExt_Markdown &&
-                                          g_lang!=SrcLangExt_Fortran)
+                                      if (yyextra->lang!=SrcLangExt_Python &&
+                                          yyextra->lang!=SrcLangExt_VHDL &&
+                                          yyextra->lang!=SrcLangExt_Markdown &&
+                                          yyextra->lang!=SrcLangExt_Fortran)
                                       {
                                         ADDCHAR('/');
                                         ADDCHAR('*');
-                                        if (g_specialComment)
+                                        if (yyextra->specialComment)
                                         {
                                           ADDCHAR('*');
                                         }
@@ -880,140 +772,277 @@ void replaceComment(int offset);
                                     }
                                    }
 <CondLine>[!()&| \ta-z_A-Z0-9.\-]+ {
-                                    bool oldSkip=g_skip;
-                                     startCondSection(yytext);
-                                    if ((g_condCtx==CComment || g_readLineCtx==SComment) && 
-                                         !oldSkip && g_skip) 
-                                    {
-                                      if (g_lang!=SrcLangExt_Python &&
-                                          g_lang!=SrcLangExt_VHDL &&
-                                          g_lang!=SrcLangExt_Markdown &&
-                                          g_lang!=SrcLangExt_Fortran)
-                                      {
-                                        ADDCHAR('*');
-                                        ADDCHAR('/');
-                                      }
-                                    }
-                                     if (g_readLineCtx==SComment)
-                                     {
-                                       BEGIN(SComment);
-                                     }
-                                     else
-                                     {
-                                      BEGIN(g_condCtx);
-                                     }
+                                     handleCondSectionId(yyscanner,yytext);
                                   }
-<CondLine>[ \t]*
-<CComment,ReadLine>[\\@]"cond"[ \t\r]*/\n |
+<CComment,ReadLine>[\\@]"cond"[ \t\r]*/\n {
+                                    yyextra->condCtx=YY_START;
+                                     handleCondSectionId(yyscanner," "); // fake section id causing the section to be hidden unconditionally
+                                   }
 <CondLine>.                       { // forgot section id?
-                                    if (YY_START!=CondLine) g_condCtx=YY_START;
-                                    bool oldSkip=g_skip;
-                                    startCondSection(" "); // fake section id causing the section to be hidden unconditionally
-                                    if ((g_condCtx==CComment || g_readLineCtx==SComment) && 
-                                         !oldSkip && g_skip) 
-                                    {
-                                      //printf("** Adding terminator for comment!\n");
-                                      if (g_lang!=SrcLangExt_Python &&
-                                          g_lang!=SrcLangExt_VHDL)
-                                      {
-                                        ADDCHAR('*');
-                                        ADDCHAR('/');
-                                      }
-                                    }
-                                    if (*yytext=='\n') g_lineNr++;
-                                     if (g_readLineCtx==SComment)
-                                     {
-                                       BEGIN(SComment);
-                                     }
-                                     else
-                                     {
-                                      BEGIN(g_condCtx);
-                                     }
+                                     handleCondSectionId(yyscanner," "); // fake section id causing the section to be hidden unconditionally
+                                    if (*yytext=='\n') yyextra->lineNr++;
                                   }
 <CComment,ReadLine>[\\@][a-z_A-Z][a-z_A-Z0-9]*  { // expand alias without arguments
-                                    replaceAliases(yytext);
+                                    replaceAliases(yyscanner,yytext);
                                   }
 <CComment,ReadLine>[\\@][a-z_A-Z][a-z_A-Z0-9]*"{" { // expand alias with arguments
-                                     g_lastBlockContext=YY_START;
-                                    g_blockCount=1;
-                                    g_aliasString=yytext;
-                                    g_lastEscaped=0;
+                                     yyextra->lastBlockContext=YY_START;
+                                    yyextra->blockCount=1;
+                                    yyextra->aliasString=yytext;
+                                    yyextra->lastEscaped=0;
                                     BEGIN( ReadAliasArgs );
                                   }
 <ReadAliasArgs>^[ \t]*"//"[/!]/[^\n]+   { // skip leading special comments (see bug 618079)
                                   }
 <ReadAliasArgs>"*/"               { // oops, end of comment in the middle of an alias?
-                                     if (g_lang==SrcLangExt_Python)
+                                     if (yyextra->lang==SrcLangExt_Python)
                                     {
                                       REJECT;
                                     }
                                     else // abort the alias, restart scanning
                                     {
-                                      copyToOutput(g_aliasString,g_aliasString.length());
-                                      copyToOutput(yytext,(int)yyleng);
+                                      copyToOutput(yyscanner,yyextra->aliasString,yyextra->aliasString.length());
+                                      copyToOutput(yyscanner,yytext,(int)yyleng);
                                       BEGIN(Scan);
                                     }
                                   }
 <ReadAliasArgs>[^{}\n\\\*]+       {
-                                     g_aliasString+=yytext;
-                                    g_lastEscaped=FALSE;
+                                     yyextra->aliasString+=yytext;
+                                    yyextra->lastEscaped=FALSE;
                                   }
 <ReadAliasArgs>"\\"               {
-                                     if (g_lastEscaped)  g_lastEscaped=FALSE;
-                                     else                g_lastEscaped=TRUE;
-                                     g_aliasString+=yytext;
+                                     if (yyextra->lastEscaped)  yyextra->lastEscaped=FALSE;
+                                     else                yyextra->lastEscaped=TRUE;
+                                     yyextra->aliasString+=yytext;
                                    }
 <ReadAliasArgs>\n                 {
-                                     g_aliasString+=yytext;
-                                     g_lineNr++;
-                                    g_lastEscaped=FALSE;
+                                     yyextra->aliasString+=yytext;
+                                     yyextra->lineNr++;
+                                    yyextra->lastEscaped=FALSE;
                                   }
 <ReadAliasArgs>"{"                {
-                                     g_aliasString+=yytext;
-                                     if (!g_lastEscaped) g_blockCount++;
-                                    g_lastEscaped=FALSE;
+                                     yyextra->aliasString+=yytext;
+                                     if (!yyextra->lastEscaped) yyextra->blockCount++;
+                                    yyextra->lastEscaped=FALSE;
                                    }
 <ReadAliasArgs>"}"                {
-                                     g_aliasString+=yytext;
-                                    if (!g_lastEscaped) g_blockCount--;
-                                    if (g_blockCount==0)
+                                     yyextra->aliasString+=yytext;
+                                    if (!yyextra->lastEscaped) yyextra->blockCount--;
+                                    if (yyextra->blockCount==0)
                                     {
-                                      replaceAliases(g_aliasString);
-                                      BEGIN( g_lastBlockContext );
+                                      replaceAliases(yyscanner,yyextra->aliasString);
+                                      BEGIN( yyextra->lastBlockContext );
                                     }
-                                    g_lastEscaped=FALSE;
+                                    yyextra->lastEscaped=FALSE;
                                   }
 <ReadAliasArgs>.                  {
-                                     g_aliasString+=yytext;
-                                    g_lastEscaped=FALSE;
+                                     yyextra->aliasString+=yytext;
+                                    yyextra->lastEscaped=FALSE;
                                   }
 <ReadLine>.                       {
-                                    copyToOutput(yytext,(int)yyleng);
+                                    copyToOutput(yyscanner,yytext,(int)yyleng);
                                   }
 
 %%
 
-void replaceComment(int offset)
+static void replaceCommentMarker(yyscan_t yyscanner,const char *s,int len)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  const char *p=s;
+  char c;
+  // copy leading blanks
+  while ((c=*p) && (c==' ' || c=='\t' || c=='\n')) 
+  {
+    ADDCHAR(c);
+    yyextra->lineNr += c=='\n';
+    p++;
+  }
+  // replace start of comment marker by blanks and the last character by a *
+  int blanks=0;
+  while ((c=*p) && (c=='/' || c=='!' || c=='#')) 
+  {
+    blanks++;
+    p++;
+    if (*p=='<') // comment-after-item marker 
+    { 
+      blanks++;
+      p++; 
+    }
+    if (c=='!') // end after first !
+    {
+      break;
+    }
+  }
+  if (blanks>0)
+  {
+    while (blanks>2)
+    {
+      ADDCHAR(' ');
+      blanks--;
+    }
+    if (blanks>1) ADDCHAR('*');
+    ADDCHAR(' ');
+  }
+  // copy comment line to output
+  ADDARRAY(p,len-(int)(p-s));
+}
+
+static inline int computeIndent(const char *s)
+{
+  int col=0;
+  static int tabSize=Config_getInt(TAB_SIZE);
+  const char *p=s;
+  char c;
+  while ((c=*p++))
+  {
+    if (c==' ') col++;
+    else if (c=='\t') col+=tabSize-(col%tabSize); 
+    else break;
+  }
+  return col;
+}
+
+static inline void copyToOutput(yyscan_t yyscanner,const char *s,int len)
+{
+  int tabSize=Config_getInt(TAB_SIZE);
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  int i;
+  if (yyextra->skip) // only add newlines.
+  {
+    for (i=0;i<len;i++)
+    {
+      switch(s[i])
+      {
+        case '\n':
+         ADDCHAR('\n');
+         yyextra->lineNr++;
+          yyextra->col=0;
+          break;
+        case '\t':
+          yyextra->col+=tabSize-(yyextra->col%tabSize);
+          break;
+        default:
+          yyextra->col++;
+          break;
+      }
+    }
+  }
+  else if (len>0)
+  {
+    ADDARRAY(s,len);
+    for (i=0;i<len;i++) 
+    {
+      switch (s[i])
+      {
+       case '\n': yyextra->col=0; 
+                  //fprintf(stderr,"---> copy %d\n",g_lineNr);
+                  yyextra->lineNr++; break;
+       case '\t': yyextra->col+=tabSize-(yyextra->col%tabSize); break;
+       default:   yyextra->col++; break;
+      }
+    }
+  }
+}
+
+static void startCondSection(yyscan_t yyscanner,const char *sectId)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  //printf("startCondSection: skip=%d stack=%d\n",g_skip,g_condStack.count());
+  CondParser prs;
+  bool expResult = prs.parse(yyextra->fileName,yyextra->lineNr,sectId);
+  yyextra->condStack.push(new CondCtx(yyextra->lineNr,sectId,yyextra->skip));
+  if (!expResult) // not enabled
+  {
+    yyextra->skip=TRUE;
+  }
+}
+
+static void endCondSection(yyscan_t yyscanner)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  if (yyextra->condStack.isEmpty())
+  {
+    warn(yyextra->fileName,yyextra->lineNr,"Found \\endcond command without matching \\cond");
+    yyextra->skip=FALSE;
+  }
+  else
+  {
+    CondCtx *ctx = yyextra->condStack.pop();
+    yyextra->skip=ctx->skip;
+  }
+  //printf("endCondSection: skip=%d stack=%d\n",g_skip,g_condStack.count());
+}
+
+static void handleCondSectionId(yyscan_t yyscanner,const char *expression)
 {
-  if (g_mlBrief || g_skip)
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  bool oldSkip=yyextra->skip;
+  startCondSection(yyscanner,expression);
+  if ((yyextra->condCtx==CComment || yyextra->readLineCtx==SComment) && 
+      !oldSkip && yyextra->skip) 
+  {
+    if (yyextra->lang!=SrcLangExt_Python &&
+        yyextra->lang!=SrcLangExt_VHDL &&
+        yyextra->lang!=SrcLangExt_Markdown &&
+        yyextra->lang!=SrcLangExt_Fortran)
+    {
+      ADDCHAR('*');
+      ADDCHAR('/');
+    }
+  }
+  if (yyextra->readLineCtx==SComment)
   {
-    copyToOutput(yytext,(int)yyleng);
+    BEGIN(SComment);
+  }
+  else
+  {
+    BEGIN(yyextra->condCtx);
+  }
+}
+
+/** copies string \a s with length \a len to the output, while 
+ *  replacing any alias commands found in the string.
+ */
+static void replaceAliases(yyscan_t yyscanner,const char *s)
+{
+  QCString result = resolveAliasCmd(s);
+  //printf("replaceAliases(%s)->'%s'\n",s,result.data());
+  copyToOutput(yyscanner,result,result.length());
+}
+
+
+static int yyread(yyscan_t yyscanner,char *buf,int max_size)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  int bytesInBuf = yyextra->inBuf->curPos()-yyextra->inBufPos;
+  int bytesToCopy = QMIN(max_size,bytesInBuf);
+  memcpy(buf,yyextra->inBuf->data()+yyextra->inBufPos,bytesToCopy);
+  yyextra->inBufPos+=bytesToCopy;
+  return bytesToCopy;
+}
+
+static void replaceComment(yyscan_t yyscanner,int offset)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  if (yyextra->mlBrief || yyextra->skip)
+  {
+    copyToOutput(yyscanner,yytext,(int)yyleng);
   }
   else
   {
     //printf("replaceComment(%s)\n",yytext);
     int i=computeIndent(&yytext[offset]);
-    if (i==g_blockHeadCol)
+    if (i==yyextra->blockHeadCol)
     {
-      replaceCommentMarker(yytext,(int)yyleng);
+      replaceCommentMarker(yyscanner,yytext,(int)yyleng);
     }
     else
     {
-      copyToOutput(" */",3);
+      copyToOutput(yyscanner," */",3);
       int i;for (i=(int)yyleng-1;i>=0;i--) unput(yytext[i]);
-      g_inSpecialComment=FALSE;
-      BEGIN(Scan);                                            
-    }                                                         
+      yyextra->inSpecialComment=FALSE;
+      BEGIN(Scan);
+    }
   }
 }
 
@@ -1064,82 +1093,86 @@ static bool recognizeFixedForm(const char* contents)
  */
 void convertCppComments(BufStr *inBuf,BufStr *outBuf,const char *fileName)
 {
+  yyscan_t yyscanner;
+  commentcnvYY_state extra;
+  commentcnvYYlex_init_extra(&extra,&yyscanner);
+#ifdef FLEX_DEBUG
+  commentcnvYYset_debug(1,yyscanner);
+#endif
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
   //printf("convertCppComments(%s)\n",fileName);
-  g_inBuf    = inBuf;
-  g_outBuf   = outBuf;
-  g_inBufPos = 0;
-  g_col      = 0;
-  g_mlBrief = Config_getBool(MULTILINE_CPP_IS_BRIEF);
-  g_skip     = FALSE;
-  g_fileName = fileName;
-  g_lang = getLanguageFromFileName(fileName);
-  g_pythonDocString = FALSE;
-  g_lineNr   = 1;
-  g_condStack.clear();
-  g_condStack.setAutoDelete(TRUE);
-  g_commentStack.clear();
-  g_commentStack.setAutoDelete(TRUE);
-  g_vhdl = FALSE;
+  yyextra->inBuf    = inBuf;
+  yyextra->outBuf   = outBuf;
+  yyextra->inBufPos = 0;
+  yyextra->col      = 0;
+  yyextra->mlBrief = Config_getBool(MULTILINE_CPP_IS_BRIEF);
+  yyextra->skip     = FALSE;
+  yyextra->fileName = fileName;
+  yyextra->lang = getLanguageFromFileName(fileName);
+  yyextra->pythonDocString = FALSE;
+  yyextra->lineNr   = 1;
+  yyextra->condStack.clear();
+  yyextra->condStack.setAutoDelete(TRUE);
+  yyextra->commentStack.clear();
+  yyextra->commentStack.setAutoDelete(TRUE);
+  yyextra->vhdl = FALSE;
 
   printlex(yy_flex_debug, TRUE, __FILE__, fileName);
-  isFixedForm = FALSE;
-  if (g_lang==SrcLangExt_Fortran)
+  yyextra->isFixedForm = FALSE;
+  if (yyextra->lang==SrcLangExt_Fortran)
   {
-    isFixedForm = recognizeFixedForm(inBuf->data());
+    yyextra->isFixedForm = recognizeFixedForm(inBuf->data());
   }
 
-  if (g_lang==SrcLangExt_Markdown)
+  if (yyextra->lang==SrcLangExt_Markdown)
   {
-    g_nestingCount=0;
+    yyextra->nestingCount=0;
     BEGIN(CComment);
-    g_commentStack.push(new CommentCtx(g_lineNr));
+    yyextra->commentStack.push(new CommentCtx(yyextra->lineNr));
   }
   else
   {
     BEGIN(Scan);
   }
-  yylex();
-  while (!g_condStack.isEmpty())
+  yylex(yyscanner);
+  while (!yyextra->condStack.isEmpty())
   {
-    CondCtx *ctx = g_condStack.pop();
+    CondCtx *ctx = yyextra->condStack.pop();
     QCString sectionInfo = " ";
     if (ctx->sectionId!=" ") sectionInfo.sprintf(" with label '%s' ",ctx->sectionId.stripWhiteSpace().data());
-    warn(g_fileName,ctx->lineNr,"Conditional section%sdoes not have "
+    warn(yyextra->fileName,ctx->lineNr,"Conditional section%sdoes not have "
        "a corresponding \\endcond command within this file.",sectionInfo.data());
   }
-  if (g_nestingCount>0 && g_lang!=SrcLangExt_Markdown)
+  if (yyextra->nestingCount>0 && yyextra->lang!=SrcLangExt_Markdown)
   {
     QCString tmp= "(probable line reference: ";
     bool first = TRUE;
-    while (!g_commentStack.isEmpty())
+    while (!yyextra->commentStack.isEmpty())
     {
-      CommentCtx *ctx = g_commentStack.pop();
+      CommentCtx *ctx = yyextra->commentStack.pop();
       if (!first) tmp += ", ";
       tmp += QCString().setNum(ctx->lineNr);
       first = FALSE;
       delete ctx;
     }
     tmp += ")";
-    warn(g_fileName,g_lineNr,"Reached end of file while still inside a (nested) comment. "
-        "Nesting level %d %s",g_nestingCount,tmp.data());
+    warn(yyextra->fileName,yyextra->lineNr,"Reached end of file while still inside a (nested) comment. "
+        "Nesting level %d %s",yyextra->nestingCount,tmp.data());
   }
-  g_commentStack.clear();
-  g_nestingCount = 0;
+  yyextra->commentStack.clear();
+  yyextra->nestingCount = 0;
   if (Debug::isFlagSet(Debug::CommentCnv))
   {
-    g_outBuf->at(g_outBuf->curPos())='\0';
+    yyextra->outBuf->at(yyextra->outBuf->curPos())='\0';
     Debug::print(Debug::CommentCnv,0,"-----------\nCommentCnv: %s\n"
-                 "output=[\n%s]\n-----------\n",fileName,g_outBuf->data()
+                 "output=[\n%s]\n-----------\n",fileName,yyextra->outBuf->data()
                 );
   }
   printlex(yy_flex_debug, FALSE, __FILE__, fileName);
+  commentcnvYYlex_destroy(yyscanner);
 }
 
 
 //----------------------------------------------------------------------------
-#if !defined(YY_FLEX_SUBMINOR_VERSION) 
-extern "C" { // some bogus code to keep the compiler happy
-    void commentcnvYYdummy() { yy_flex_realloc(0,0); } 
-}
-#endif
 
+#include "commentcnv.l.h"
index 7d2189f..f471890 100644 (file)
@@ -19,7 +19,7 @@
 #include "types.h"
 
 class Entry;
-class ParserInterface;
+class OutlineParserInterface;
 
 /** @file
  *  @brief Interface for the comment block parser */
@@ -72,7 +72,7 @@ QCString preprocessCommentBlock(const QCString &comment,
  *         where to proceed parsing. FALSE indicates no further processing is
  *         needed.
  */
-bool parseCommentBlock(ParserInterface *parser,
+bool parseCommentBlock(OutlineParserInterface *parser,
                        Entry *curEntry,
                        const QCString &comment,
                       const QCString &fileName,
index a495c5e..d7cf3c8 100644 (file)
@@ -78,6 +78,7 @@ static bool handleFile(const QCString &, const QCStringList &);
 static bool handleDir(const QCString &, const QCStringList &);
 static bool handleExample(const QCString &, const QCStringList &);
 static bool handleDetails(const QCString &, const QCStringList &);
+static bool handleNoop(const QCString &, const QCStringList &);
 static bool handleName(const QCString &, const QCStringList &);
 static bool handleTodo(const QCString &, const QCStringList &);
 static bool handleTest(const QCString &, const QCStringList &);
@@ -132,6 +133,8 @@ static bool handleEndParBlock(const QCString &, const QCStringList &);
 static bool handleParam(const QCString &, const QCStringList &);
 static bool handleRetval(const QCString &, const QCStringList &);
 
+static const char *stateToString(int state);
+
 typedef bool (*DocCmdFunc)(const QCString &name, const QCStringList &optList);
 
 struct DocCmdMap
@@ -279,6 +282,7 @@ static DocCmdMap docCmdMap[] =
   { "warning",         0,                       TRUE  },
   { "snippet",         0,                       TRUE  },
   { "snippetlineno",   0,                       TRUE  },
+  { "noop",            &handleNoop,             TRUE },
   { 0, 0, FALSE }
 };
 
@@ -323,8 +327,7 @@ class DocCmdMapper
       {
        if (m_map.find(p->cmdName)!=0)
        {
-         err("DocCmdMapper: command %s already added\n",p->cmdName);
-         exit(1);
+         term("DocCmdMapper: command %s already added\n",p->cmdName);
        }
        Cmd *cmd = new Cmd;
        cmd->func = p->handler;
@@ -391,7 +394,7 @@ class GuardedSection
  *     statics
  */
 
-static ParserInterface *langParser;          // the language parser that is calling us
+static OutlineParserInterface *langParser;   // the language parser that is calling us
 static QCString         inputString;         // input string
 static int             inputPosition;       // read pointer
 static QCString                yyFileName;          // file name that is read from
@@ -411,11 +414,8 @@ static GuardType        guardType;           // kind of guard for conditional se
 static bool             enabledSectionFound;
 static QCString         functionProto;       // function prototype
 static QStack<GuardedSection> guards;        // tracks nested conditional sections (if,ifnot,..)
-static Entry*          current      = 0 ;   // working entry
-//static Entry*                current_root = 0 ;   // parent of working entry
-
+static Entry           *current = 0;         // working entry
 
-//static Entry*                previous     = 0 ;   // TODO: remove need for this
 static bool             needNewEntry;
 
 static QCString         g_sectionLabel;
@@ -529,11 +529,10 @@ static QCString stripQuotes(const char *s)
 static void addXRefItem(const char *listName,const char *itemTitle,
                         const char *listTitle,bool append)
 {
-  Entry *docEntry = current; // inBody && previous ? previous : current;
   if (listName==0) return;
   //printf("addXRefItem(%s,%s,%s,%d)\n",listName,itemTitle,listTitle,append);
 
-  ListItemInfo *lii=0;
+  const ListItemInfo *lii=0;
   RefList *refList = Doxygen::xrefLists->find(listName);
   if (refList==0) // new list
   {
@@ -541,16 +540,13 @@ static void addXRefItem(const char *listName,const char *itemTitle,
     Doxygen::xrefLists->insert(listName,refList);
     //printf("new list!\n");
   }
-  if (docEntry->sli)
+  for (const ListItemInfo &item : current->sli)
   {
-    QListIterator<ListItemInfo> slii(*docEntry->sli);
-    for (slii.toLast();(lii=slii.current());--slii)
+    if (qstrcmp(item.type,listName)==0) 
     {
-      if (qstrcmp(lii->type,listName)==0) 
-      {
-        //printf("found %s lii->type=%s\n",listName,lii->type);
-        break;
-      }
+      //printf("found %s lii->type=%s\n",listName,lii->type);
+      lii = &item;
+      break;
     }
   }
   if (lii && append) // already found item of same type just before this one
@@ -576,16 +572,16 @@ static void addXRefItem(const char *listName,const char *itemTitle,
     ASSERT(item!=0);
     item->text = outputXRef;
     item->listAnchor = anchorLabel;
-    docEntry->addSpecialListItem(listName,itemId);
+    current->addSpecialListItem(listName,itemId);
     QCString cmdString;
     cmdString.sprintf(" \\xrefitem %s %d.",listName,itemId);
     if (inBody)
     {
-      docEntry->inbodyDocs += cmdString;
+      current->inbodyDocs += cmdString;
     }
     else
     {
-      docEntry->doc += cmdString;
+      current->doc += cmdString;
     }
     SectionInfo *si = Doxygen::sectionDict->find(anchorLabel);
     if (si)
@@ -605,7 +601,7 @@ static void addXRefItem(const char *listName,const char *itemTitle,
                          g_sectionTitle,SectionInfo::Anchor,
                          g_sectionLevel);
       Doxygen::sectionDict->append(anchorLabel,si);
-      docEntry->anchors->append(si);
+      current->anchors.push_back(si);
     }
   }
   outputXRef.resize(0);
@@ -625,12 +621,12 @@ static QCString addFormula()
     f = new Formula(fText);
     Doxygen::formulaList->append(f);
     Doxygen::formulaDict->insert(fText,f);
-    formLabel.sprintf("\\form#%d",f->getId());
+    formLabel.sprintf("\\_form#%d",f->getId());
     Doxygen::formulaNameDict->insert(formLabel,f);
   }
   else
   {
-    formLabel.sprintf("\\form#%d",f->getId());
+    formLabel.sprintf("\\_form#%d",f->getId());
   }
   int i;
   for (i=0;i<formulaNewLines;i++) formLabel+="@_fakenl"; // add fake newlines to
@@ -673,7 +669,7 @@ static void addSection()
                           g_sectionTitle,sectionLevelToType(g_sectionLevel),g_sectionLevel);
 
     // add section to this entry
-    current->anchors->append(si);
+    current->anchors.push_back(si);
 
     // add section to the global dictionary
     Doxygen::sectionDict->append(g_sectionLabel,si);
@@ -850,7 +846,7 @@ static void addAnchor(const char *anchor)
   {
     si = new SectionInfo(yyFileName,yyLineNr,anchor,0,SectionInfo::Anchor,0);
     Doxygen::sectionDict->append(anchor,si);
-    current->anchors->append(si);
+    current->anchors.push_back(si);
   }
 }
 
@@ -998,6 +994,7 @@ RCSTAG    "$"{ID}":"[^\n$]+"$"
 %x     CopyDoc
 %x      GuardExpr
 %x      CdataSection
+%x      Noop
 
 %%
 
@@ -1175,7 +1172,7 @@ RCSTAG    "$"{ID}":"[^\n$]+"$"
                                          addOutput(yytext);
                                        }
 <Comment>{B}*{CMD}"~"[a-z_A-Z-]*               { // language switch command
-                                          QCString langId = QString(yytext).stripWhiteSpace().data()+2;
+                                          QCString langId = QCString(yytext).stripWhiteSpace().data()+2;
                                          if (!langId.isEmpty() &&
                                              qstricmp(Config_getEnum(OUTPUT_LANGUAGE),langId)!=0)
                                          { // enable language specific section
@@ -1185,7 +1182,7 @@ RCSTAG    "$"{ID}":"[^\n$]+"$"
 <Comment>{B}*{CMD}"f{"[^}\n]+"}"("{"?)  { // start of a formula with custom environment
                                          setOutput(OutputDoc);
                                          formulaText="\\begin";
-                                         formulaEnv=QString(yytext).stripWhiteSpace().data()+2;
+                                         formulaEnv=QCString(yytext).stripWhiteSpace().data()+2;
                                          if (formulaEnv.at(formulaEnv.length()-1)=='{')
                                          {
                                            // remove trailing open brace
@@ -1823,7 +1820,7 @@ RCSTAG    "$"{ID}":"[^\n$]+"$"
                                           addOutput(yytext);
                                          // we add subpage labels as a kind of "inheritance" relation to prevent
                                          // needing to add another list to the Entry class.
-                                         current->extends->append(new BaseInfo(yytext,Public,Normal));
+                                         current->extends.push_back(BaseInfo(yytext,Public,Normal));
                                          BEGIN(SubpageTitle);
                                        }
 <SubpageLabel>{DOCNL}                  { // missing argument
@@ -1972,7 +1969,7 @@ RCSTAG    "$"{ID}":"[^\n$]+"$"
                                          BEGIN(Comment);
                                        }
 <GuardParamEnd>{B}*                    {
-                                         if (!g_spaceBeforeIf.isEmpty()) // needed for 665313 in combation with bug620924
+                                         if (!g_spaceBeforeIf.isEmpty()) // needed for 665313 in combination with bug620924
                                          {
                                            addOutput(g_spaceBeforeIf);
                                          }
@@ -2129,11 +2126,19 @@ RCSTAG    "$"{ID}":"[^\n$]+"$"
                                          current->name+=*yytext;
                                        }
 
+  /* ----- handle argument of noop command ------- */
+<Noop>{DOCNL}                          { // end of argument
+                                         if (*yytext=='\n') yyLineNr++;
+                                         addOutput('\n');
+                                         BEGIN( Comment );
+                                       }
+<Noop>.                                        { // ignore other stuff
+                                       }
   /* ----- handle argument of ingroup command ------- */
 
 <InGroupParam>{LABELID}                        { // group id
-                                         current->groups->append(
-                                           new Grouping(yytext, Grouping::GROUPING_INGROUP)
+                                         current->groups.push_back(
+                                            Grouping(yytext, Grouping::GROUPING_INGROUP)
                                          );
                                          inGroupParamFound=TRUE;
                                        }
@@ -2215,8 +2220,8 @@ RCSTAG    "$"{ID}":"[^\n$]+"$"
   /* ----- handle argument of inherit command ------- */
 
 <InheritParam>({ID}("::"|"."))*{ID}    { // found argument
-                                         current->extends->append(
-                                           new BaseInfo(removeRedundantWhiteSpace(yytext),Public,Normal)
+                                         current->extends.push_back(
+                                           BaseInfo(removeRedundantWhiteSpace(yytext),Public,Normal)
                                          );
                                          BEGIN( Comment );
                                        }
@@ -2238,8 +2243,8 @@ RCSTAG    "$"{ID}":"[^\n$]+"$"
   /* ----- handle argument of extends and implements commands ------- */
 
 <ExtendsParam>({ID}("::"|"."))*{ID}    { // found argument
-                                         current->extends->append(
-                                           new BaseInfo(removeRedundantWhiteSpace(yytext),Public,Normal)
+                                         current->extends.push_back(
+                                           BaseInfo(removeRedundantWhiteSpace(yytext),Public,Normal)
                                          );
                                          BEGIN( Comment );
                                        }
@@ -2462,11 +2467,11 @@ static bool handlePage(const QCString &, const QCStringList &)
 static bool handleMainpage(const QCString &, const QCStringList &)
 {
   bool stop=makeStructuralIndicator(Entry::MAINPAGEDOC_SEC);
+  current->name = "";
   if (!stop) 
   {
     current->name = "mainpage";
   }
-  current->name = "";
   BEGIN( PageDocArg2 );
   return stop;
 }
@@ -2540,6 +2545,12 @@ static bool handleDetails(const QCString &, const QCStringList &)
   return FALSE;
 }
 
+static bool handleNoop(const QCString &, const QCStringList &)
+{
+  BEGIN( Noop );
+  return FALSE;
+}
+
 static bool handleName(const QCString &, const QCStringList &)
 {
   bool stop=makeStructuralIndicator(Entry::MEMBERGRP_SEC);
@@ -3115,7 +3126,7 @@ QCString preprocessCommentBlock(const QCString &comment,
   }
 }
 
-bool parseCommentBlock(/* in */     ParserInterface *parser,
+bool parseCommentBlock(/* in */     OutlineParserInterface *parser,
                        /* in */     Entry *curEntry,
                        /* in */     const QCString &comment,
                       /* in */     const QCString &fileName,
@@ -3269,12 +3280,4 @@ static void handleGuard(const QCString &expr)
   }
 }
 
-
-
-#if !defined(YY_FLEX_SUBMINOR_VERSION) 
-//----------------------------------------------------------------------------
-extern "C" { // some bogus code to keep the compiler happy
-  void commentscanYYdummy() { yy_flex_realloc(0,0); } 
-}
-#endif
-
+#include "commentscan.l.h"
index 74e26bc..9d7ac45 100644 (file)
@@ -257,7 +257,7 @@ bool CondParser::parseLevel3()
 
 bool CondParser::parseVar()
 {
-  bool ans = 0;
+  bool ans = false;
   switch (m_tokenType)
   {
     case VARIABLE:
index 09a4f74..1ad13b1 100644 (file)
@@ -13,7 +13,7 @@
  * Documents produced by Doxygen are derivative works derived from the
  * input used in their production; they are not affected by this license.
  *
- * C++ Expression parser for EXTABLED_SETIONS in Doxygen
+ * C++ Expression parser for ENABLED_SECTIONS in Doxygen
  *
  * Features used:
  *     Operators:
index e68b3d7..f40744d 100644 (file)
@@ -648,7 +648,7 @@ Go to the <a href="commands.html">next</a> section or return to the
  With this tag you can assign which parser to use for a given extension.
  Doxygen has a built-in mapping, but you can override or extend it using this tag.
  The format is <code>ext=language</code>, where \c ext is a file extension, and language is one of
- the parsers supported by doxygen: IDL, Java, Javascript, Csharp (C#), C, C++, D, PHP,
+ the parsers supported by doxygen: IDL, Java, JavaScript, Csharp (C#), C, C++, D, PHP,
  md (Markdown), Objective-C, Python, Slice, Fortran (fixed format Fortran: FortranFixed,
  free formatted Fortran: FortranFree, unknown formatted Fortran: Fortran. In
  the later case the parser tries to guess whether the code is fixed or free
@@ -927,7 +927,7 @@ Go to the <a href="commands.html">next</a> section or return to the
       <docs>
 <![CDATA[
  If the \c HIDE_FRIEND_COMPOUNDS tag is set to \c YES, doxygen will hide all
- friend (class|struct|union) declarations.
+ friend declarations.
  If set to \c NO, these declarations will be included in the
  documentation.
 ]]>
@@ -953,7 +953,7 @@ Go to the <a href="commands.html">next</a> section or return to the
 ]]>
       </docs>
     </option>
-    <option type='bool' id='CASE_SENSE_NAMES' defval='0' altdefval='portable_fileSystemIsCaseSensitive()'>
+    <option type='bool' id='CASE_SENSE_NAMES' defval='0' altdefval='Portable::fileSystemIsCaseSensitive()'>
       <docs>
 <![CDATA[
  If the \c CASE_SENSE_NAMES tag is set to \c NO then doxygen
@@ -1404,7 +1404,9 @@ FILE_VERSION_FILTER = "cleartool desc -fmt \%Vn"
       <value name='*.markdown'/>
       <value name='*.md'/>
       <value name='*.mm'/>
-      <value name='*.dox'/>
+      <value name='*.dox' desc='(to be provided as doxygen C comment)'/>
+      <value name='*.doc' desc='(to be provided as doxygen C comment)'/>
+      <value name='*.txt' desc='(to be provided as doxygen C comment)'/>
       <value name='*.py'/>
       <value name='*.pyw'/>
       <value name='*.f90'/>
@@ -2032,9 +2034,9 @@ hr.footer {
 <![CDATA[
  If the \c HTML_DYNAMIC_MENUS tag is set to \c YES then the generated HTML
  documentation will contain a main index with vertical navigation menus that
- are dynamically created via Javascript. If disabled, the navigation index will consists of
+ are dynamically created via JavaScript. If disabled, the navigation index will consists of
  multiple levels of tabs that are statically embedded in every HTML page.
- Disable this option to support browsers that do not have Javascript, like
+ Disable this option to support browsers that do not have JavaScript, like
  the Qt help browser.
 ]]>
       </docs>
@@ -2377,11 +2379,21 @@ The \c DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
 ]]>
       </docs>
     </option>
+    <option type='string' id='FORMULA_MACROFILE' format='file' defval=''>
+      <docs>
+<![CDATA[
+ The \c FORMULA_MACROFILE can contain \f$\mbox{\LaTeX}\f$ `\newcommand` and 
+ `\renewcommand` commands to create new \f$\mbox{\LaTeX}\f$ commands to be used
+ in formulas as building blocks.
+ See the section \ref formulas for details.
+]]>
+      </docs>
+    </option>
     <option type='bool' id='USE_MATHJAX' defval='0' depends='GENERATE_HTML'>
       <docs>
 <![CDATA[
  Enable the \c USE_MATHJAX option to render \f$\mbox{\LaTeX}\f$ formulas using MathJax
- (see https://www.mathjax.org) which uses client side Javascript for the
+ (see https://www.mathjax.org) which uses client side JavaScript for the
  rendering instead of using pre-rendered bitmaps. Use this if you do not
  have \f$\mbox{\LaTeX}\f$ installed or if you want to formulas look prettier in the HTML
  output. When enabled you may also need to install MathJax separately and
@@ -2491,7 +2503,7 @@ MATHJAX_CODEFILE = disableRenderer.js
       <docs>
 <![CDATA[
 When the \c SERVER_BASED_SEARCH tag is enabled the search engine will be
-implemented using a web server instead of a web client using Javascript.
+implemented using a web server instead of a web client using JavaScript.
 
 There are two flavors of web server based searching depending on the
 \ref cfg_external_search "EXTERNAL_SEARCH" setting. When disabled,
index dbba264..6720116 100755 (executable)
@@ -21,6 +21,7 @@ from xml.dom import minidom, Node
 def transformDocs(doc):
        # join lines, unless it is an empty line
        # remove doxygen layout constructs
+        # Note: also look at expert.cpp of doxywizard for doxywizard parts
        doc = doc.strip()
        doc = doc.replace("\n", " ")
        doc = doc.replace("\r", " ")
@@ -57,6 +58,7 @@ def transformDocs(doc):
                                 doc)
        doc = re.sub('\\\\ref +external', '"Linking to external documentation"',
                                 doc)
+       doc = re.sub('\\\\ref +formulas', '"Including formulas"', doc)
        # fallback for not handled
        doc = re.sub('\\\\ref', '', doc)
        #<a href="address">description</a> -> description (see: address)
index 1594d47..6b85d8a 100644 (file)
@@ -37,14 +37,14 @@ class ConfigOption
     /*! The type of option */
     enum OptionType 
     { 
-      O_Info,      //<! A section header
-      O_List,      //<! A list of items
-      O_Enum,      //<! A fixed set of items
-      O_String,    //<! A single item
-      O_Int,       //<! An integer value
-      O_Bool,      //<! A boolean value
-      O_Obsolete,  //<! An obsolete option
-      O_Disabled   //<! Disabled compile time option
+      O_Info,      //!< A section header
+      O_List,      //!< A list of items
+      O_Enum,      //!< A fixed set of items
+      O_String,    //!< A single item
+      O_Int,       //!< An integer value
+      O_Bool,      //!< A boolean value
+      O_Obsolete,  //!< An obsolete option
+      O_Disabled   //!< Disabled compile time option
     };
     enum 
     { 
@@ -126,6 +126,7 @@ class ConfigList : public ConfigOption
     void setWidgetType(WidgetType w) { m_widgetType = w; }
     WidgetType widgetType() const { return m_widgetType; }
     QStrList *valueRef() { return &m_value; }
+    QStrList getDefault() { return m_defaultValue; }
     void writeTemplate(FTextStream &t,bool sl,bool);
     void compareDoxyfile(FTextStream &t);
     void substEnvVars();
index bcb5a8c..4da1634 100644 (file)
@@ -30,6 +30,7 @@
 #include <qregexp.h>
 #include <qstack.h>
 #include <qglobal.h>
+#include <qthread.h>
   
 #include "configimpl.h"
 #include "version.h"
@@ -43,6 +44,8 @@
 #define YY_NO_INPUT 1
 #define YY_NO_UNISTD_H 1
 
+static const char *stateToString(int state);
+
 static const char *warning_str = "warning: ";
 static const char *error_str = "error: ";
 
@@ -53,6 +56,16 @@ void config_err(const char *fmt, ...)
   vfprintf(stderr, (QCString(error_str) + fmt).data(), args);
   va_end(args); 
 }
+void config_term(const char *fmt, ...)
+{
+  va_list args;
+  va_start(args, fmt);
+  vfprintf(stderr, (QCString(error_str) + fmt).data(), args);
+  va_end(args);
+  fprintf(stderr, "%s\n", "Exiting...");
+  exit(1);
+}
+
 void config_warn(const char *fmt, ...)
 {
   va_list args;
@@ -210,13 +223,11 @@ QCString &ConfigImpl::getString(const char *fileName,int num,const char *name) c
   ConfigOption *opt = m_dict->find(name);
   if (opt==0) 
   {
-    config_err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
-    exit(1);
+    config_term("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
   }
   else if (opt->kind()!=ConfigOption::O_String)
   {
-    config_err("%s<%d>: Internal error: Requested option %s not of string type!\n",fileName,num,name);
-    exit(1);
+    config_term("%s<%d>: Internal error: Requested option %s not of string type!\n",fileName,num,name);
   }
   return *((ConfigString *)opt)->valueRef();
 }
@@ -226,13 +237,11 @@ QStrList &ConfigImpl::getList(const char *fileName,int num,const char *name) con
   ConfigOption *opt = m_dict->find(name);
   if (opt==0) 
   {
-    config_err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
-    exit(1);
+    config_term("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
   }
   else if (opt->kind()!=ConfigOption::O_List)
   {
-    config_err("%s<%d>: Internal error: Requested option %s not of list type!\n",fileName,num,name);
-    exit(1);
+    config_term("%s<%d>: Internal error: Requested option %s not of list type!\n",fileName,num,name);
   }
   return *((ConfigList *)opt)->valueRef();
 }
@@ -242,13 +251,11 @@ QCString &ConfigImpl::getEnum(const char *fileName,int num,const char *name) con
   ConfigOption *opt = m_dict->find(name);
   if (opt==0) 
   {
-    config_err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
-    exit(1);
+    config_term("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
   }
   else if (opt->kind()!=ConfigOption::O_Enum)
   {
-    config_err("%s<%d>: Internal error: Requested option %s not of enum type!\n",fileName,num,name);
-    exit(1);
+    config_term("%s<%d>: Internal error: Requested option %s not of enum type!\n",fileName,num,name);
   }
   return *((ConfigEnum *)opt)->valueRef();
 }
@@ -258,13 +265,11 @@ int &ConfigImpl::getInt(const char *fileName,int num,const char *name) const
   ConfigOption *opt = m_dict->find(name);
   if (opt==0) 
   {
-    config_err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
-    exit(1);
+    config_term("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
   }
   else if (opt->kind()!=ConfigOption::O_Int)
   {
-    config_err("%s<%d>: Internal error: Requested option %s not of integer type!\n",fileName,num,name);
-    exit(1);
+    config_term("%s<%d>: Internal error: Requested option %s not of integer type!\n",fileName,num,name);
   }
   return *((ConfigInt *)opt)->valueRef();
 }
@@ -274,13 +279,11 @@ bool &ConfigImpl::getBool(const char *fileName,int num,const char *name) const
   ConfigOption *opt = m_dict->find(name);
   if (opt==0) 
   {
-    config_err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
-    exit(1);
+    config_term("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
   }
   else if (opt->kind()!=ConfigOption::O_Bool)
   {
-    config_err("%s<%d>: Internal error: Requested option %s not of boolean type!\n",fileName,num,name);
-    exit(1);
+    config_term("%s<%d>: Internal error: Requested option %s not of boolean type!\n",fileName,num,name);
   }
   return *((ConfigBool *)opt)->valueRef();
 }
@@ -563,9 +566,8 @@ static QCString configStringRecode(
   void *cd = portable_iconv_open(outputEncoding,inputEncoding);
   if (cd==(void *)(-1)) 
   {
-    fprintf(stderr,"Error: unsupported character conversion: '%s'->'%s'\n",
+    config_term("Error: unsupported character conversion: '%s'->'%s'\n",
         inputEncoding.data(),outputEncoding.data());
-    exit(1);
   }
   size_t iLeft=(size_t)inputSize;
   size_t oLeft=(size_t)outputSize;
@@ -580,9 +582,8 @@ static QCString configStringRecode(
   }
   else
   {
-    fprintf(stderr,"Error: failed to translate characters from %s to %s: %s\n",
+    config_term("Error: failed to translate characters from %s to %s: %s\n",
         inputEncoding.data(),outputEncoding.data(),strerror(errno));
-    exit(1);
   }
   portable_iconv_close(cd);
   return output;
@@ -600,7 +601,7 @@ static FILE *tryPath(const char *path,const char *fileName)
   QFileInfo fi(absName);
   if (fi.exists() && fi.isFile())
   {
-    FILE *f=portable_fopen(absName,"r");
+    FILE *f=Portable::fopen(absName,"r");
     if (!f) config_err("could not open file %s for reading\n",absName.data());
     return f;
   }
@@ -616,7 +617,7 @@ static FILE *findFile(const char *fileName)
   {
     return 0;
   }
-  if (portable_isAbsolutePath(fileName))
+  if (Portable::isAbsolutePath(fileName))
   {
     return tryPath(NULL, fileName);
   }
@@ -635,9 +636,8 @@ static FILE *findFile(const char *fileName)
 static void readIncludeFile(const char *incName)
 {
   if (includeDepth==MAX_INCLUDE_DEPTH) {
-    config_err("maximum include depth (%d) reached, %s is not included. Aborting...\n",
+    config_term("maximum include depth (%d) reached, %s is not included. Aborting...\n",
        MAX_INCLUDE_DEPTH,incName);
-    exit(1);
   } 
 
   QCString inc = incName;
@@ -675,8 +675,7 @@ static void readIncludeFile(const char *incName)
   } 
   else
   {
-    config_err("@INCLUDE = %s: not found!\n",inc.data());
-    exit(1);
+    config_term("@INCLUDE = %s: not found!\n",inc.data());
   }
 }
 
@@ -1009,7 +1008,7 @@ static void substEnvVarsInString(QCString &s)
   while ((i=re.match(s,p,&l))!=-1 || (i=re2.match(s,p,&l))!=-1)
   {
     //printf("Found environment var s.mid(%d,%d)='%s'\n",i+2,l-3,s.mid(i+2,l-3).data());
-    QCString env=portable_getenv(s.mid(i+2,l-3));
+    QCString env=Portable::getenv(s.mid(i+2,l-3));
     substEnvVarsInString(env); // recursively expand variables if needed.
     s = s.left(i)+env+s.right(s.length()-i-l);
     p=i+env.length(); // next time start at the end of the expanded string
@@ -1158,9 +1157,8 @@ void ConfigImpl::init()
       ConfigOption * opt = ConfigImpl::instance()->get(depName);
       if (opt==0)
       {
-        config_warn("Config option '%s' has invalid depends relation on unknown option '%s'\n",
+        config_term("Config option '%s' has invalid depends relation on unknown option '%s'\n",
             option->name().data(),depName.data());
-        exit(1);
       }
     }
   }
@@ -1226,8 +1224,7 @@ static QCString configFileToString(const char *name)
   }
   if (!fileOpened)  
   {
-    config_err("cannot open file '%s' for reading\n",name);
-    exit(1);
+    config_term("cannot open file '%s' for reading\n",name);
   }
   return "";
 }
@@ -1287,14 +1284,13 @@ static void cleanUpPaths(QStrList &str)
       if (fi.exists() && fi.isDir())
       {
         int i = str.at();
-        QString p = fi.absFilePath();
-        if (p.at(p.length()-1)!='/')
-          p.append('/');
+        QCString p = fi.absFilePath().utf8();
+        if (p[p.length()-1]!='/') p+='/';
         str.remove();
         if (str.at()==i) // did not remove last item
-          str.insert(i,p.utf8());
+          str.insert(i,p);
         else
-          str.append(p.utf8());
+          str.append(p);
       }
     }
     sfp = str.next();
@@ -1319,6 +1315,38 @@ void Config::init()
   ConfigImpl::instance()->init();
 }
 
+static void checkList(QStrList &list,const char *name, bool equalRequired,bool valueRequired)
+{
+  const char *s=list.first();
+  while (s)
+  {
+    QCString item=s;
+    item=item.stripWhiteSpace();
+    int i=item.find('=');
+    if (i==-1 && equalRequired)
+    {
+      err("Illegal format for option %s, no equal sign ('=') specified for item '%s'\n",name,item.data());
+    }
+    if (i!=-1)
+    {
+      QCString myName=item.left(i).stripWhiteSpace();
+      if (myName.isEmpty())
+      {
+        err("Illegal format for option %s, no name specified for item '%s'\n",name,item.data());
+      }
+      else if (valueRequired)
+      {
+        QCString myValue=item.right(item.length()-i-1).stripWhiteSpace();
+        if (myValue.isEmpty())
+        {
+          err("Illegal format for option %s, no value specified for item '%s'\n",name,item.data());
+        }
+      }
+    }
+    s=list.next();
+  }
+}
+
 void Config::checkAndCorrect()
 {
   ConfigValues::instance().init();
@@ -1406,9 +1434,8 @@ void Config::checkAndCorrect()
     QFileInfo fi(headerFile);
     if (!fi.exists())
     {
-      err("tag HTML_HEADER: header file '%s' "
+      config_term("tag HTML_HEADER: header file '%s' "
          "does not exist\n",headerFile.data());
-      exit(1);
     }
   }
   // Test to see if HTML footer is valid
@@ -1418,9 +1445,8 @@ void Config::checkAndCorrect()
     QFileInfo fi(footerFile);
     if (!fi.exists())
     {
-      err("tag HTML_FOOTER: footer file '%s' "
+      config_term("tag HTML_FOOTER: footer file '%s' "
          "does not exist\n",footerFile.data());
-      exit(1);
     }
   }
 
@@ -1433,9 +1459,8 @@ void Config::checkAndCorrect()
       QFileInfo fi(MathJaxCodefile);
       if (!fi.exists())
       {
-        err("tag MATHJAX_CODEFILE file '%s' "
+        config_term("tag MATHJAX_CODEFILE file '%s' "
            "does not exist\n",MathJaxCodefile.data());
-        exit(1);
       }
     }
     QCString &path = Config_getString(MATHJAX_RELPATH);
@@ -1453,9 +1478,8 @@ void Config::checkAndCorrect()
     QFileInfo fi(latexHeaderFile);
     if (!fi.exists())
     {
-      err("tag LATEX_HEADER: header file '%s' "
+      config_term("tag LATEX_HEADER: header file '%s' "
          "does not exist\n",latexHeaderFile.data());
-      exit(1);
     }
   }
   // Test to see if LaTeX footer is valid
@@ -1465,9 +1489,8 @@ void Config::checkAndCorrect()
     QFileInfo fi(latexFooterFile);
     if (!fi.exists())
     {
-      err("tag LATEX_FOOTER: footer file '%s' "
+      config_term("tag LATEX_FOOTER: footer file '%s' "
          "does not exist\n",latexFooterFile.data());
-      exit(1);
     }
   }
 
@@ -1482,23 +1505,60 @@ void Config::checkAndCorrect()
     s=includePath.next();
   }
 
-  // check aliases
+  // check PREDEFINED
+  if (Config_getBool(ENABLE_PREPROCESSING))
+  {
+    QStrList &predefList = Config_getList(PREDEFINED);
+    s=predefList.first();
+    while (s)
+    {
+      QCString predef=s;
+      predef=predef.stripWhiteSpace();
+      int i_equals=predef.find('=');
+      int i_obrace=predef.find('(');
+      if ((i_obrace==0) || (i_equals==0) || (i_equals==1 && predef.at(i_equals-1)==':'))
+      {
+        err("Illegal PREDEFINED format '%s', no define name specified\n",predef.data());
+      }
+      s=predefList.next();
+    }
+  }
+
+  // check ALIASES
   QStrList &aliasList = Config_getList(ALIASES);
   s=aliasList.first();
   while (s)
   {
     QRegExp re1("[a-z_A-Z][a-z_A-Z0-9]*[ \t]*=");         // alias without argument
-    QRegExp re2("[a-z_A-Z][a-z_A-Z0-9]*{[0-9]*}[ \t]*="); // alias with argument
+    QRegExp re2("[a-z_A-Z][a-z_A-Z0-9]*{[0-9]+}[ \t]*="); // alias with argument
     QCString alias=s;
     alias=alias.stripWhiteSpace();
     if (alias.find(re1)!=0 && alias.find(re2)!=0)
     {
-      err("Illegal alias format '%s'. Use \"name=value\" or \"name(n)=value\", where n is the number of arguments\n",
+      err("Illegal ALIASES format '%s'. Use \"name=value\" or \"name{n}=value\", where n is the number of arguments\n",
          alias.data());
     }
     s=aliasList.next();
   }
 
+  // check FILTER_PATTERNS
+  checkList(Config_getList(FILTER_PATTERNS),"FILTER_PATTERNS",TRUE,TRUE);
+
+  // check FILTER_SOURCE_PATTERNS
+  checkList(Config_getList(FILTER_SOURCE_PATTERNS),"FILTER_SOURCE_PATTERNS",FALSE,FALSE);
+
+  // check TAGFILES
+  checkList(Config_getList(TAGFILES),"TAGFILES",FALSE,TRUE);
+
+  // check EXTRA_SEARCH_MAPPINGS
+  if (Config_getBool(SEARCHENGINE) && Config_getBool(GENERATE_HTML))
+  {
+    checkList(Config_getList(EXTRA_SEARCH_MAPPINGS),"EXTRA_SEARCH_MAPPING",TRUE,TRUE);
+  }
+
+  // check TCL_SUBST
+  checkList(Config_getList(TCL_SUBST),"TCL_SUBST",TRUE,TRUE);
+
   // check if GENERATE_TREEVIEW and GENERATE_HTMLHELP are both enabled
   if (Config_getBool(GENERATE_TREEVIEW) && Config_getBool(GENERATE_HTMLHELP))
   {
@@ -1531,6 +1591,7 @@ void Config::checkAndCorrect()
   //  dotImageFormat = "png";
   //}
 
+  // correct DOT_FONTNAME if needed
   QCString &dotFontName=Config_getString(DOT_FONTNAME);
   if (dotFontName=="FreeSans" || dotFontName=="FreeSans.ttf")
   {
@@ -1538,7 +1599,32 @@ void Config::checkAndCorrect()
                "You may want to clear or change DOT_FONTNAME.\n"
                "Otherwise you run the risk that the wrong font is being used for dot generated graphs.\n");
   }
+  else if (dotFontName.isEmpty())
+  {
+    dotFontName = "Helvetica";
+  }
 
+  // clip dotFontSize against the maximum bounds
+  int &dotFontSize = Config_getInt(DOT_FONTSIZE);
+  if (dotFontSize<4)
+  {
+    dotFontSize=4;
+  }
+  else if (dotFontSize>24)
+  {
+    dotFontSize=24;
+  }
+
+  // clip number of threads
+  int &dotNumThreads = Config_getInt(DOT_NUM_THREADS);
+  if (dotNumThreads>32)
+  {
+    dotNumThreads=32;
+  }
+  else if (dotNumThreads<=0)
+  {
+    dotNumThreads=QMAX(2,QThread::idealThreadCount()+1);
+  }
 
   // check dot path
   QCString &dotPath = Config_getString(DOT_PATH);
@@ -1551,7 +1637,7 @@ void Config::checkAndCorrect()
     }
     else
     {
-      QFileInfo dp(dotPath+"/dot"+portable_commandExtension());
+      QFileInfo dp(dotPath+"/dot"+Portable::commandExtension());
       if (!dp.exists() || !dp.isFile())
       {
        warn_uncond("the dot tool could not be found at %s\n",dotPath.data());
@@ -1579,10 +1665,10 @@ void Config::checkAndCorrect()
     QFileInfo pu(plantumlJarPath);
     if (pu.exists() && pu.isDir()) // PLANTUML_JAR_PATH is directory
     {
-      QFileInfo jar(plantumlJarPath+portable_pathSeparator()+"plantuml.jar");
+      QFileInfo jar(plantumlJarPath+Portable::pathSeparator()+"plantuml.jar");
       if (jar.exists() && jar.isFile())
       {
-        plantumlJarPath = jar.dirPath(TRUE).utf8()+portable_pathSeparator();
+        plantumlJarPath = jar.dirPath(TRUE).utf8()+Portable::pathSeparator();
       }
       else
       {
@@ -1593,7 +1679,7 @@ void Config::checkAndCorrect()
     }
     else if (pu.exists() && pu.isFile() && plantumlJarPath.right(4)==".jar") // PLANTUML_JAR_PATH is file
     {
-      plantumlJarPath = pu.dirPath(TRUE).utf8()+portable_pathSeparator();
+      plantumlJarPath = pu.dirPath(TRUE).utf8()+Portable::pathSeparator();
     }
     else
     {
@@ -1607,7 +1693,7 @@ void Config::checkAndCorrect()
   QCString &diaPath = Config_getString(DIA_PATH);
   if (!diaPath.isEmpty())
   {
-    QFileInfo dp(diaPath+"/dia"+portable_commandExtension());
+    QFileInfo dp(diaPath+"/dia"+Portable::commandExtension());
     if (!dp.exists() || !dp.isFile())
     {
       warn_uncond("dia could not be found at %s\n",diaPath.data());
@@ -1652,11 +1738,17 @@ void Config::checkAndCorrect()
   QStrList &filePatternList = Config_getList(FILE_PATTERNS);
   if (filePatternList.isEmpty())
   {
-      ConfigOption * opt = ConfigImpl::instance()->get("FILE_PATTERNS");
-      if (opt->kind()==ConfigOption::O_List)
+    ConfigOption * opt = ConfigImpl::instance()->get("FILE_PATTERNS");
+    if (opt->kind()==ConfigOption::O_List)
+    {
+      QStrList l = ((ConfigList*)opt)->getDefault();
+      const char *p = l.first();
+      while (p)
       {
-        ((ConfigList*)opt)->init();
+        filePatternList.append(p);
+        p = l.next();
       }
+    }
   }
 
   // add default pattern if needed
@@ -1876,3 +1968,4 @@ void Config::deinit()
   ConfigImpl::instance()->deleteInstance();
 }
 
+#include "configimpl.l.h"
index 8bf582e..0b52e14 100644 (file)
 #ifndef _CONSTEXP_H
 #define _CONSTEXP_H
 
-#include "cppvalue.h"
 #include <qcstring.h>
 
-#define YYSTYPE CPPValue
-typedef void* yyscan_t;
-struct constexpYY_state
+class ConstExpressionParser
 {
-  QCString    g_strToken;
-  CPPValue    g_resultValue;
-  int         g_constExpLineNr;
-  QCString    g_constExpFileName;
-
-  const char *g_inputString;
-  int         g_inputPosition;
+  public:
+    ConstExpressionParser();
+   ~ConstExpressionParser();
+    bool parse(const char *fileName,int line,const QCString &expression);
+  private:
+    struct Private;
+    Private *p;
 };
 
-extern bool parseconstexp(const char *fileName,int line,const QCString &s);
-extern int constexpYYparse(yyscan_t);
-extern int constexpYYlex(YYSTYPE *lvalp, yyscan_t);
-struct constexpYY_state*  constexpYYget_extra (yyscan_t yyscanner );
 #endif
index c9b984a..eae8a3b 100644 (file)
@@ -24,6 +24,7 @@
 %{
 
 #include "constexp.h"  
+#include "constexp_p.h"  
 #include "cppvalue.h"
 #include "ce_parse.hpp" // generated header file
 #include "message.h"
@@ -31,7 +32,7 @@
 #define YY_NO_INPUT 1
 #define YY_NO_UNISTD_H 1
 
-
+static const char *stateToString(int state);
 static int yyread(char *buf,int max_size,yyscan_t yyscanner);
 
 #undef  YY_INPUT
@@ -69,23 +70,23 @@ CONSTSUFFIX ([uU][lL]?[lL]?)|([lL][lL]?[uU]?)
 "("                               { return TOK_LPAREN; }
 ")"                               { return TOK_RPAREN; }
 "'"(([^\'\n\r\\]+)|(\\(([ntvbrfa\\?'\"])|([0-9]+)|([xX][0-9a-fA-F]+))))"'"   { 
-                                     yyextra->g_strToken=yytext;  
+                                     yyextra->strToken=yytext;  
                                     return TOK_CHARACTER; 
                                   }
-0[0-7]*{CONSTSUFFIX}?              { yyextra->g_strToken=yytext; 
+0[0-7]*{CONSTSUFFIX}?              { yyextra->strToken=yytext; 
                                     return TOK_OCTALINT; 
                                   }
-[1-9][0-9]*{CONSTSUFFIX}?          { yyextra->g_strToken=yytext; 
+[1-9][0-9]*{CONSTSUFFIX}?          { yyextra->strToken=yytext; 
                                     return TOK_DECIMALINT; 
                                   }
-(0x|0X)[0-9a-fA-F]+{CONSTSUFFIX}?  { yyextra->g_strToken=yytext+2; 
+(0x|0X)[0-9a-fA-F]+{CONSTSUFFIX}?  { yyextra->strToken=yytext+2; 
                                      return TOK_HEXADECIMALINT; 
                                    }
 (([0-9]+\.[0-9]*)|([0-9]*\.[0-9]+))([eE]([\-\+])?[0-9]+)?([fFlL])? { 
-                                     yyextra->g_strToken=yytext; return TOK_FLOAT; 
+                                     yyextra->strToken=yytext; return TOK_FLOAT; 
                                    }
 ([0-9]+[eE])([\-\+])?[0-9]+([fFlL])? { 
-                                     yyextra->g_strToken=yytext; return TOK_FLOAT; 
+                                     yyextra->strToken=yytext; return TOK_FLOAT; 
                                   }
 .                                 
 \n
@@ -96,46 +97,60 @@ static int yyread(char *buf,int max_size,yyscan_t yyscanner)
 {
   struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
   int c=0;
-  while( c < max_size && yyextra->g_inputString[yyextra->g_inputPosition] )
+  while( c < max_size && yyextra->inputString[yyextra->inputPosition] )
   {
-    *buf = yyextra->g_inputString[yyextra->g_inputPosition++] ;
+    *buf = yyextra->inputString[yyextra->inputPosition++] ;
     c++; buf++;
   }
   return c;
 }
 
+struct ConstExpressionParser::Private
+{
+  yyscan_t yyscanner;
+  struct constexpYY_state constexpYY_extra;
+};
 
-static yyscan_t yyscanner;
-static struct constexpYY_state constexpYY_extra;
 
-bool parseconstexp(const char *fileName,int lineNr,const QCString &s)
+ConstExpressionParser::ConstExpressionParser()
 {
-  constexpYYlex_init_extra(&constexpYY_extra, &yyscanner);
-  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  p = new Private;
+  constexpYYlex_init_extra(&p->constexpYY_extra, &p->yyscanner);
+}
+
+ConstExpressionParser::~ConstExpressionParser()
+{
+  constexpYYlex_destroy(p->yyscanner);
+  delete p;
+}
+
+bool ConstExpressionParser::parse(const char *fileName,int lineNr,const QCString &s)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
 
 #ifdef FLEX_DEBUG
   yyset_debug(1,yyscanner);
 #endif
 
-  yyextra->g_constExpFileName = fileName;
-  yyextra->g_constExpLineNr = lineNr;
-  yyextra->g_inputString = s;
-  yyextra->g_inputPosition = 0;
-  constexpYYrestart( yyin, yyscanner );
+  yyextra->constExpFileName = fileName;
+  yyextra->constExpLineNr = lineNr;
+  yyextra->inputString = s;
+  yyextra->inputPosition = 0;
+  constexpYYrestart( yyin, p->yyscanner );
 
   printlex(yy_flex_debug, TRUE, __FILE__, fileName);
   //printf("Expression: '%s'\n",s.data());
 
-  constexpYYparse(yyscanner);
+  constexpYYparse(p->yyscanner);
 
   //printf("Result: %ld\n",(long)g_resultValue);
   printlex(yy_flex_debug, FALSE, __FILE__, fileName);
-  bool result = (long)yyextra->g_resultValue!=0;
+  bool result = (long)yyextra->resultValue!=0;
 
-  constexpYYlex_destroy(yyscanner);
   return result;
 }
 
 extern "C" {
   int constexpYYwrap(yyscan_t yyscanner) { return 1; }
 }
+#include "constexp.l.h"
index 62a51f3..100614a 100644 (file)
 %{
 
 #include "cppvalue.h"
-#include "constexp.h"
+#include "constexp_p.h"
 #include "message.h"
 
-#if defined(_MSC_VER)
-#define MSDOS
-#endif
-
-
 #include <stdio.h>
 #include <stdlib.h>
 
 int constexpYYerror(yyscan_t yyscanner, const char *s)
 {
   struct constexpYY_state* yyextra = constexpYYget_extra(yyscanner);
-  warn(yyextra->g_constExpFileName, yyextra->g_constExpLineNr,
+  warn(yyextra->constExpFileName, yyextra->constExpLineNr,
        "preprocessing issue while doing constant expression evaluation: %s",s);
   return 0;
 }
@@ -80,7 +75,7 @@ int constexpYYerror(yyscan_t yyscanner, const char *s)
 start: constant_expression
        {
          struct constexpYY_state* yyextra = constexpYYget_extra(yyscanner);
-         yyextra->g_resultValue = $1; return 0;
+         yyextra->resultValue = $1; return 0;
        }
 ;
 
@@ -272,27 +267,27 @@ primary_expression: constant
 constant: TOK_OCTALINT
          {
            struct constexpYY_state* yyextra = constexpYYget_extra(yyscanner);
-           $$ = parseOctal(yyextra->g_strToken);
+           $$ = parseOctal(yyextra->strToken);
          }
        | TOK_DECIMALINT
          {
            struct constexpYY_state* yyextra = constexpYYget_extra(yyscanner);
-           $$ = parseDecimal(yyextra->g_strToken);
+           $$ = parseDecimal(yyextra->strToken);
          }
        | TOK_HEXADECIMALINT
          {
            struct constexpYY_state* yyextra = constexpYYget_extra(yyscanner);
-           $$ = parseHexadecimal(yyextra->g_strToken);
+           $$ = parseHexadecimal(yyextra->strToken);
          }
        | TOK_CHARACTER
          {
            struct constexpYY_state* yyextra = constexpYYget_extra(yyscanner);
-           $$ = parseCharacter(yyextra->g_strToken);
+           $$ = parseCharacter(yyextra->strToken);
          }
        | TOK_FLOAT
          {
            struct constexpYY_state* yyextra = constexpYYget_extra(yyscanner);
-           $$ = parseFloat(yyextra->g_strToken);
+           $$ = parseFloat(yyextra->strToken);
          }
 ;
 
diff --git a/src/constexp_p.h b/src/constexp_p.h
new file mode 100644 (file)
index 0000000..ad09b2d
--- /dev/null
@@ -0,0 +1,44 @@
+/******************************************************************************
+ *
+ * Copyright (C) 1997-2019 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby 
+ * granted. No representations are made about the suitability of this software 
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ * Documents produced by Doxygen are derivative works derived from the
+ * input used in their production; they are not affected by this license.
+ *
+ */
+
+#ifndef _CONSTEXP_P_H
+#define _CONSTEXP_P_H
+
+#include <qcstring.h>
+
+//! @file
+//! @brief Private interface between Parser (constexp.y) and Lexer (constexp.l)
+
+#include "cppvalue.h"
+#define YYSTYPE CPPValue
+
+typedef void* yyscan_t;
+struct constexpYY_state
+{
+  QCString    strToken;
+  CPPValue    resultValue;
+  int         constExpLineNr;
+  QCString    constExpFileName;
+
+  const char *inputString;
+  int         inputPosition;
+};
+constexpYY_state* constexpYYget_extra(yyscan_t yyscanner );
+
+extern int constexpYYlex(YYSTYPE *lvalp, yyscan_t);
+extern int constexpYYparse(yyscan_t);
+
+
+#endif
index 49c9afa..5ee89cd 100644 (file)
@@ -1079,7 +1079,7 @@ class TranslateContext::Private
         s_inst.addProperty("fileMembers",       &Private::fileMembers);
         //%% string fileMembersDescription
         s_inst.addProperty("fileMembersDescription", &Private::fileMembersDescription);
-        //%% string relatedPagesDescripiton
+        //%% string relatedPagesDescription
         s_inst.addProperty("relatedPagesDesc",  &Private::relatedPagesDesc);
         //%% string more
         s_inst.addProperty("more",              &Private::more);
@@ -1133,7 +1133,7 @@ class TranslateContext::Private
         s_inst.addProperty("referencesRelation",   &Private::referencesRelation);
         //%% markerstring inheritedFrom
         s_inst.addProperty("inheritedFrom",      &Private::inheritedFrom);
-        //%% string addtionalInheritedMembers
+        //%% string additionalInheritedMembers
         s_inst.addProperty("additionalInheritedMembers",&Private::additionalInheritedMembers);
         //%% string includeDependencyGraph:container_name
         s_inst.addProperty("includeDependencyGraph",&Private::includeDependencyGraph);
@@ -1302,8 +1302,8 @@ static TemplateVariant parseDoc(const Definition *def,const QCString &file,int l
 static TemplateVariant parseCode(MemberDef *md,const QCString &scopeName,const QCString &relPath,
                                  const QCString &code,int startLine=-1,int endLine=-1,bool showLineNumbers=FALSE)
 {
-  ParserInterface *pIntf = Doxygen::parserManager->getParser(md->getDefFileExtension());
-  pIntf->resetCodeParserState();
+  CodeParserInterface &intf = Doxygen::parserManager->getCodeParser(md->getDefFileExtension());
+  intf.resetCodeParserState();
   QGString s;
   FTextStream t(&s);
   switch (g_globals.outputFormat)
@@ -1311,14 +1311,14 @@ static TemplateVariant parseCode(MemberDef *md,const QCString &scopeName,const Q
     case ContextOutputFormat_Html:
       {
         HtmlCodeGenerator codeGen(t,relPath);
-        pIntf->parseCode(codeGen,scopeName,code,md->getLanguage(),FALSE,0,md->getBodyDef(),
+        intf.parseCode(codeGen,scopeName,code,md->getLanguage(),FALSE,0,md->getBodyDef(),
             startLine,endLine,TRUE,md,showLineNumbers,md);
       }
       break;
     case ContextOutputFormat_Latex:
       {
         LatexCodeGenerator codeGen(t,relPath,md->docFile());
-        pIntf->parseCode(codeGen,scopeName,code,md->getLanguage(),FALSE,0,md->getBodyDef(),
+        intf.parseCode(codeGen,scopeName,code,md->getLanguage(),FALSE,0,md->getBodyDef(),
             startLine,endLine,TRUE,md,showLineNumbers,md);
       }
       break;
@@ -1333,8 +1333,8 @@ static TemplateVariant parseCode(MemberDef *md,const QCString &scopeName,const Q
 static TemplateVariant parseCode(const FileDef *fd,const QCString &relPath)
 {
   static bool filterSourceFiles = Config_getBool(FILTER_SOURCE_FILES);
-  ParserInterface *pIntf = Doxygen::parserManager->getParser(fd->getDefFileExtension());
-  pIntf->resetCodeParserState();
+  CodeParserInterface &intf = Doxygen::parserManager->getCodeParser(fd->getDefFileExtension());
+  intf.resetCodeParserState();
   QGString s;
   FTextStream t(&s);
   switch (g_globals.outputFormat)
@@ -1342,7 +1342,7 @@ static TemplateVariant parseCode(const FileDef *fd,const QCString &relPath)
     case ContextOutputFormat_Html:
       {
         HtmlCodeGenerator codeGen(t,relPath);
-        pIntf->parseCode(codeGen,0,
+        intf.parseCode(codeGen,0,
               fileToString(fd->absFilePath(),filterSourceFiles,TRUE), // the sources
               fd->getLanguage(),  // lang
               FALSE,              // isExampleBlock
@@ -1361,7 +1361,7 @@ static TemplateVariant parseCode(const FileDef *fd,const QCString &relPath)
     case ContextOutputFormat_Latex:
       {
         LatexCodeGenerator codeGen(t,relPath,fd->docFile());
-        pIntf->parseCode(codeGen,0,
+        intf.parseCode(codeGen,0,
               fileToString(fd->absFilePath(),filterSourceFiles,TRUE), // the sources
               fd->getLanguage(),  // lang
               FALSE,              // isExampleBlock
@@ -1978,7 +1978,7 @@ class ClassContext::Private : public DefinitionContext<ClassContext::Private>
             {
               cg->writeGraph(t,GOF_BITMAP,EOF_Html,
                              g_globals.outputDir,
-                             g_globals.outputDir+portable_pathSeparator()+m_classDef->getOutputFileBase()+Doxygen::htmlFileExtension,
+                             g_globals.outputDir+Portable::pathSeparator()+m_classDef->getOutputFileBase()+Doxygen::htmlFileExtension,
                              relPathAsString(),TRUE,TRUE,g_globals.dynSectionId
                             );
             }
@@ -1987,7 +1987,7 @@ class ClassContext::Private : public DefinitionContext<ClassContext::Private>
             {
               cg->writeGraph(t,GOF_EPS,EOF_LaTeX,
                              g_globals.outputDir,
-                             g_globals.outputDir+portable_pathSeparator()+m_classDef->getOutputFileBase()+".tex",
+                             g_globals.outputDir+Portable::pathSeparator()+m_classDef->getOutputFileBase()+".tex",
                              relPathAsString(),TRUE,TRUE,g_globals.dynSectionId
                             );
             }
@@ -2077,7 +2077,7 @@ class ClassContext::Private : public DefinitionContext<ClassContext::Private>
             {
               cg->writeGraph(t,GOF_BITMAP,EOF_Html,
                              g_globals.outputDir,
-                             g_globals.outputDir+portable_pathSeparator()+m_classDef->getOutputFileBase()+Doxygen::htmlFileExtension,
+                             g_globals.outputDir+Portable::pathSeparator()+m_classDef->getOutputFileBase()+Doxygen::htmlFileExtension,
                              relPathAsString(),TRUE,TRUE,g_globals.dynSectionId
                             );
             }
@@ -2086,7 +2086,7 @@ class ClassContext::Private : public DefinitionContext<ClassContext::Private>
             {
               cg->writeGraph(t,GOF_EPS,EOF_LaTeX,
                              g_globals.outputDir,
-                             g_globals.outputDir+portable_pathSeparator()+m_classDef->getOutputFileBase()+".tex",
+                             g_globals.outputDir+Portable::pathSeparator()+m_classDef->getOutputFileBase()+".tex",
                              relPathAsString(),TRUE,TRUE,g_globals.dynSectionId
                             );
             }
@@ -2353,7 +2353,7 @@ class ClassContext::Private : public DefinitionContext<ClassContext::Private>
           const ClassDef *cd;
           for (sdi.toFirst();(cd=sdi.current());++sdi)
           {
-            if (cd->name().find('@')==-1 &&
+            if (!cd->isAnonymous() &&
                 cd->isLinkableInProject() &&
                 cd->isEmbeddedInOuterScope() &&
                 cd->partOfGroups()==0
@@ -2381,7 +2381,7 @@ class ClassContext::Private : public DefinitionContext<ClassContext::Private>
           addTemplateDecls(parent,tl);
         }
         const ClassDef *cd=dynamic_cast<const ClassDef *>(d);
-        if (cd->templateArguments())
+        if (!cd->templateArguments().empty())
         {
           ArgumentListContext *al = ArgumentListContext::alloc(cd->templateArguments(),cd,relPathAsString());
           // since a TemplateVariant does take ownership of the object, we add it
@@ -2422,10 +2422,10 @@ class ClassContext::Private : public DefinitionContext<ClassContext::Private>
     }
     TemplateVariant typeConstraints() const
     {
-      if (m_classDef->typeConstraints())
+      if (!m_classDef->typeConstraints().empty())
       {
         Cachable &cache = getCache();
-        if (!cache.typeConstraints && m_classDef->typeConstraints())
+        if (!cache.typeConstraints && !m_classDef->typeConstraints().empty())
         {
           cache.typeConstraints.reset(ArgumentListContext::alloc(m_classDef->typeConstraints(),m_classDef,relPathAsString()));
         }
@@ -2941,7 +2941,7 @@ class NamespaceContext::Private : public DefinitionContext<NamespaceContext::Pri
           const ClassDef *cd;
           for (sdi.toFirst();(cd=sdi.current());++sdi)
           {
-            if (cd->name().find('@')==-1 &&
+            if (!cd->isAnonymous() &&
                 cd->isLinkableInProject() &&
                 cd->isEmbeddedInOuterScope() &&
                 cd->partOfGroups()==0)
@@ -3123,7 +3123,7 @@ class FileContext::Private : public DefinitionContext<FileContext::Private>
             {
               cg->writeGraph(t,GOF_BITMAP,EOF_Html,
                   g_globals.outputDir,
-                  g_globals.outputDir+portable_pathSeparator()+m_fileDef->getOutputFileBase()+Doxygen::htmlFileExtension,
+                  g_globals.outputDir+Portable::pathSeparator()+m_fileDef->getOutputFileBase()+Doxygen::htmlFileExtension,
                   relPathAsString(),TRUE,g_globals.dynSectionId
                   );
             }
@@ -3132,7 +3132,7 @@ class FileContext::Private : public DefinitionContext<FileContext::Private>
             {
               cg->writeGraph(t,GOF_EPS,EOF_LaTeX,
                   g_globals.outputDir,
-                  g_globals.outputDir+portable_pathSeparator()+m_fileDef->getOutputFileBase()+".tex",
+                  g_globals.outputDir+Portable::pathSeparator()+m_fileDef->getOutputFileBase()+".tex",
                   relPathAsString(),TRUE,g_globals.dynSectionId
                   );
             }
@@ -3175,7 +3175,7 @@ class FileContext::Private : public DefinitionContext<FileContext::Private>
             {
               cg->writeGraph(t,GOF_BITMAP,EOF_Html,
                   g_globals.outputDir,
-                  g_globals.outputDir+portable_pathSeparator()+m_fileDef->getOutputFileBase()+Doxygen::htmlFileExtension,
+                  g_globals.outputDir+Portable::pathSeparator()+m_fileDef->getOutputFileBase()+Doxygen::htmlFileExtension,
                   relPathAsString(),TRUE,g_globals.dynSectionId
                   );
             }
@@ -3184,7 +3184,7 @@ class FileContext::Private : public DefinitionContext<FileContext::Private>
             {
               cg->writeGraph(t,GOF_EPS,EOF_LaTeX,
                   g_globals.outputDir,
-                  g_globals.outputDir+portable_pathSeparator()+m_fileDef->getOutputFileBase()+".tex",
+                  g_globals.outputDir+Portable::pathSeparator()+m_fileDef->getOutputFileBase()+".tex",
                   relPathAsString(),TRUE,g_globals.dynSectionId
                   );
             }
@@ -3405,7 +3405,7 @@ class FileContext::Private : public DefinitionContext<FileContext::Private>
           const ClassDef *cd;
           for (sdi.toFirst();(cd=sdi.current());++sdi)
           {
-            if (cd->name().find('@')==-1 &&
+            if (!cd->isAnonymous() &&
                 cd->isLinkableInProject() &&
                 cd->isEmbeddedInOuterScope() &&
                 cd->partOfGroups()==0)
@@ -3613,7 +3613,7 @@ class DirContext::Private : public DefinitionContext<DirContext::Private>
               graph->writeGraph(t,GOF_BITMAP,
                                 EOF_Html,
                                 g_globals.outputDir,
-                                g_globals.outputDir+portable_pathSeparator()+m_dirDef->getOutputFileBase()+Doxygen::htmlFileExtension,
+                                g_globals.outputDir+Portable::pathSeparator()+m_dirDef->getOutputFileBase()+Doxygen::htmlFileExtension,
                                 relPathAsString(),
                                 TRUE,
                                 g_globals.dynSectionId,
@@ -3625,7 +3625,7 @@ class DirContext::Private : public DefinitionContext<DirContext::Private>
               graph->writeGraph(t,GOF_EPS,
                                 EOF_LaTeX,
                                 g_globals.outputDir,
-                                g_globals.outputDir+portable_pathSeparator()+m_dirDef->getOutputFileBase()+".tex",
+                                g_globals.outputDir+Portable::pathSeparator()+m_dirDef->getOutputFileBase()+".tex",
                                 relPathAsString(),
                                 TRUE,
                                 g_globals.dynSectionId,
@@ -4450,8 +4450,7 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private>
     }
     TemplateVariant isAnonymous() const
     {
-      QCString name = m_memberDef->name();
-      return !name.isEmpty() && name.at(0)=='@';
+      return m_memberDef->isAnonymous();
     }
     TemplateVariant anonymousType() const
     {
@@ -4529,7 +4528,7 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private>
     TemplateVariant templateArgs() const
     {
       Cachable &cache = getCache();
-      if (!cache.templateArgs && m_memberDef->templateArguments())
+      if (!cache.templateArgs && !m_memberDef->templateArguments().empty())
       {
         cache.templateArgs.reset(ArgumentListContext::alloc(m_memberDef->templateArguments(),m_memberDef,relPathAsString()));
       }
@@ -4644,7 +4643,7 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private>
       return createLinkedText(m_memberDef,relPathAsString(),
                               m_memberDef->displayDefinition());
     }
-    const ArgumentList *getDefArgList() const
+    const ArgumentList &getDefArgList() const
     {
       return (m_memberDef->isDocsForDefinition()) ?
               m_memberDef->argumentList() : m_memberDef->declArgumentList();
@@ -4654,8 +4653,8 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private>
       Cachable &cache = getCache();
       if (!cache.arguments)
       {
-        const ArgumentList *defArgList = getDefArgList();
-        if (defArgList && !m_memberDef->isProperty())
+        const ArgumentList &defArgList = getDefArgList();
+        if (!m_memberDef->isProperty())
         {
           cache.arguments.reset(ArgumentListContext::alloc(defArgList,m_memberDef,relPathAsString()));
         }
@@ -4668,35 +4667,31 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private>
     }
     TemplateVariant hasParameters() const
     {
-      return getDefArgList()!=0;
+      return !getDefArgList().empty();
     }
     TemplateVariant hasConstQualifier() const
     {
-      const ArgumentList *al = getDefArgList();
-      return al ? al->constSpecifier : FALSE;
+      return getDefArgList().constSpecifier;
     }
     TemplateVariant hasVolatileQualifier() const
     {
-      const ArgumentList *al = getDefArgList();
-      return al ? al->volatileSpecifier : FALSE;
+      return getDefArgList().volatileSpecifier;
     }
     TemplateVariant hasRefQualifierLValue() const
     {
-      const ArgumentList *al = getDefArgList();
-      return al ? al->refQualifier==RefQualifierLValue : FALSE;
+      return getDefArgList().refQualifier==RefQualifierLValue;
     }
     TemplateVariant hasRefQualifierRValue() const
     {
-      const ArgumentList *al = getDefArgList();
-      return al ? al->refQualifier==RefQualifierRValue : FALSE;
+      return getDefArgList().refQualifier==RefQualifierRValue;
     }
     TemplateVariant trailingReturnType() const
     {
-      const ArgumentList *al = getDefArgList();
-      if (al && !al->trailingReturnType.isEmpty())
+      const ArgumentList &al = getDefArgList();
+      if (!al.trailingReturnType.isEmpty())
       {
         return createLinkedText(m_memberDef,relPathAsString(),
-                                al->trailingReturnType);
+                                al.trailingReturnType);
       }
       else
       {
@@ -4710,13 +4705,11 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private>
     void addTemplateDecls(TemplateList *tl) const
     {
       const ClassDef *cd=m_memberDef->getClassDef();
-      if (m_memberDef->definitionTemplateParameterLists())
+      if (!m_memberDef->definitionTemplateParameterLists().empty())
       {
-        QListIterator<ArgumentList> ali(*m_memberDef->definitionTemplateParameterLists());
-        ArgumentList *tal;
-        for (ali.toFirst();(tal=ali.current());++ali)
+        for (const ArgumentList &tal : m_memberDef->definitionTemplateParameterLists())
         {
-          if (tal->count()>0)
+          if (!tal.empty())
           {
             ArgumentListContext *al = ArgumentListContext::alloc(tal,m_memberDef,relPathAsString());
             tl->append(al);
@@ -4727,21 +4720,16 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private>
       {
         if (cd && !m_memberDef->isRelated() && !m_memberDef->isTemplateSpecialization())
         {
-          QList<ArgumentList> tempParamLists;
-          cd->getTemplateParameterLists(tempParamLists);
-          //printf("#tempParamLists=%d\n",tempParamLists.count());
-          QListIterator<ArgumentList> ali(tempParamLists);
-          ArgumentList *tal;
-          for (ali.toFirst();(tal=ali.current());++ali)
+          for (const ArgumentList &tal : cd->getTemplateParameterLists())
           {
-            if (tal->count()>0)
+            if (!tal.empty())
             {
               ArgumentListContext *al = ArgumentListContext::alloc(tal,m_memberDef,relPathAsString());
               tl->append(al);
             }
           }
         }
-        if (m_memberDef->templateArguments()) // function template prefix
+        if (!m_memberDef->templateArguments().empty()) // function template prefix
         {
           ArgumentListContext *al = ArgumentListContext::alloc(
               m_memberDef->templateArguments(),m_memberDef,relPathAsString());
@@ -4785,18 +4773,15 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private>
       Cachable &cache = getCache();
       if (!cache.paramDocs)
       {
-        if (m_memberDef->argumentList() && m_memberDef->argumentList()->hasDocumentation())
+        if (m_memberDef->argumentList().hasDocumentation())
         {
           QCString paramDocs;
-          ArgumentListIterator ali(*m_memberDef->argumentList());
-          Argument *a;
-          // convert the parameter documentation into a list of @param commands
-          for (ali.toFirst();(a=ali.current());++ali)
+          for (Argument &a : m_memberDef->argumentList())
           {
-            if (a->hasDocumentation())
+            if (a.hasDocumentation())
             {
-              QCString direction = extractDirection(a->docs);
-              paramDocs+="@param"+direction+" "+a->name+" "+a->docs;
+              QCString direction = extractDirection(a.docs);
+              paramDocs+="@param"+direction+" "+a.name+" "+a.docs;
             }
           }
           cache.paramDocs.reset(new TemplateVariant(parseDoc(m_memberDef,
@@ -4929,7 +4914,7 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private>
     TemplateVariant typeConstraints() const
     {
       Cachable &cache = getCache();
-      if (!cache.typeConstraints && m_memberDef->typeConstraints())
+      if (cache.typeConstraints && !m_memberDef->typeConstraints().empty())
       {
         cache.typeConstraints.reset(ArgumentListContext::alloc(m_memberDef->typeConstraints(),m_memberDef,relPathAsString()));
       }
@@ -5041,7 +5026,7 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private>
             {
               cg->writeGraph(t,GOF_BITMAP,EOF_Html,
                   g_globals.outputDir,
-                  g_globals.outputDir+portable_pathSeparator()+m_memberDef->getOutputFileBase()+Doxygen::htmlFileExtension,
+                  g_globals.outputDir+Portable::pathSeparator()+m_memberDef->getOutputFileBase()+Doxygen::htmlFileExtension,
                   relPathAsString(),TRUE,g_globals.dynSectionId
                   );
             }
@@ -5050,7 +5035,7 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private>
             {
               cg->writeGraph(t,GOF_EPS,EOF_LaTeX,
                   g_globals.outputDir,
-                  g_globals.outputDir+portable_pathSeparator()+m_memberDef->getOutputFileBase()+".tex",
+                  g_globals.outputDir+Portable::pathSeparator()+m_memberDef->getOutputFileBase()+".tex",
                   relPathAsString(),TRUE,g_globals.dynSectionId
                   );
             }
@@ -5113,7 +5098,7 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private>
             {
               cg->writeGraph(t,GOF_BITMAP,EOF_Html,
                   g_globals.outputDir,
-                  g_globals.outputDir+portable_pathSeparator()+m_memberDef->getOutputFileBase()+Doxygen::htmlFileExtension,
+                  g_globals.outputDir+Portable::pathSeparator()+m_memberDef->getOutputFileBase()+Doxygen::htmlFileExtension,
                   relPathAsString(),TRUE,g_globals.dynSectionId
                   );
             }
@@ -5122,7 +5107,7 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private>
             {
               cg->writeGraph(t,GOF_EPS,EOF_LaTeX,
                   g_globals.outputDir,
-                  g_globals.outputDir+portable_pathSeparator()+m_memberDef->getOutputFileBase()+".tex",
+                  g_globals.outputDir+Portable::pathSeparator()+m_memberDef->getOutputFileBase()+".tex",
                   relPathAsString(),TRUE,g_globals.dynSectionId
                   );
             }
@@ -5383,7 +5368,7 @@ class ModuleContext::Private : public DefinitionContext<ModuleContext::Private>
               graph->writeGraph(t,GOF_BITMAP,
                                 EOF_Html,
                                 g_globals.outputDir,
-                                g_globals.outputDir+portable_pathSeparator()+m_groupDef->getOutputFileBase()+Doxygen::htmlFileExtension,
+                                g_globals.outputDir+Portable::pathSeparator()+m_groupDef->getOutputFileBase()+Doxygen::htmlFileExtension,
                                 relPathAsString(),
                                 TRUE,
                                 g_globals.dynSectionId);
@@ -5394,7 +5379,7 @@ class ModuleContext::Private : public DefinitionContext<ModuleContext::Private>
               graph->writeGraph(t,GOF_EPS,
                                 EOF_LaTeX,
                                 g_globals.outputDir,
-                                g_globals.outputDir+portable_pathSeparator()+m_groupDef->getOutputFileBase()+".tex",
+                                g_globals.outputDir+Portable::pathSeparator()+m_groupDef->getOutputFileBase()+".tex",
                                 relPathAsString(),
                                 TRUE,
                                 g_globals.dynSectionId);
@@ -5739,7 +5724,7 @@ class ModuleContext::Private : public DefinitionContext<ModuleContext::Private>
           const ClassDef *cd;
           for (sdi.toFirst();(cd=sdi.current());++sdi)
           {
-            if (cd->name().find('@')==-1 &&
+            if (!cd->isAnonymous() &&
                 cd->isLinkableInProject() &&
                 cd->isEmbeddedInOuterScope() &&
                 cd->partOfGroups()==0)
@@ -6557,7 +6542,7 @@ class NestingContext::Private : public GenericNodeListContext
       const NamespaceDef *nd;
       for (nli.toFirst();(nd=nli.current());++nli)
       {
-        if (nd->localName().find('@')==-1 &&
+        if (!nd->isAnonymous() &&
             (!rootOnly || nd->getOuterScope()==Doxygen::globalScope))
         {
           bool hasChildren = namespaceHasVisibleChild(nd,addClasses,false,ClassDef::Class);
@@ -8446,7 +8431,7 @@ TemplateVariant NamespaceMembersIndexContext::get(const char *name) const
 
 //------------------------------------------------------------------------
 
-//%% struct InheritanceGraph: a connected graph reprenting part of the overall interitance tree
+//%% struct InheritanceGraph: a connected graph representing part of the overall inheritance tree
 //%% {
 class InheritanceGraphContext::Private
 {
@@ -8476,7 +8461,7 @@ class InheritanceGraphContext::Private
                           /*GOF_BITMAP,
                           EOF_Html,*/
                           g_globals.outputDir,
-                          g_globals.outputDir+portable_pathSeparator()+"inherits"+Doxygen::htmlFileExtension,
+                          g_globals.outputDir+Portable::pathSeparator()+"inherits"+Doxygen::htmlFileExtension,
                           m_id);
       }
       return TemplateVariant(result.data(),TRUE);
@@ -8813,7 +8798,7 @@ class AllMembersListContext::Private : public GenericNodeListContext
           {
             MemberDef *md=mi->memberDef;
             const ClassDef  *cd=md->getClassDef();
-            if (cd && !md->name().isEmpty() && md->name()[0]!='@')
+            if (cd && !md->isAnonymous())
             {
               if ((cd->isLinkable() && md->isLinkable()) ||
                   (!cd->isArtificial() && !hideUndocMembers &&
@@ -9302,7 +9287,7 @@ class InheritedMemberInfoListContext::Private : public GenericNodeListContext
             MemberDef *md;
             for (li.toFirst();(md=li.current());++li)
             {
-              if (lt==md->getSectionList(mg->parent())->listType() &&
+              if (lt==md->getSectionList()->listType() &&
                   !md->isReimplementedBy(inheritedFrom) &&
                   md->isBriefSectionVisible())
               {
@@ -9413,7 +9398,7 @@ TemplateListIntf::ConstIterator *InheritedMemberInfoListContext::createIterator(
 class ArgumentContext::Private
 {
   public:
-    Private(const Argument *arg,const Definition *def,const QCString &relPath) :
+    Private(const Argument &arg,const Definition *def,const QCString &relPath) :
       m_argument(arg), m_def(def), m_relPath(relPath)
     {
       static bool init=FALSE;
@@ -9435,33 +9420,33 @@ class ArgumentContext::Private
     }
     TemplateVariant type() const
     {
-      return createLinkedText(m_def,m_relPath,m_argument->type);
+      return createLinkedText(m_def,m_relPath,m_argument.type);
     }
     TemplateVariant attrib() const
     {
-      return m_argument->attrib;
+      return m_argument.attrib;
     }
     TemplateVariant name() const
     {
-      return m_argument->name;
+      return m_argument.name;
     }
     TemplateVariant defVal() const
     {
-      return createLinkedText(m_def,m_relPath,m_argument->defval);
+      return createLinkedText(m_def,m_relPath,m_argument.defval);
     }
     TemplateVariant array() const
     {
-      return m_argument->array;
+      return m_argument.array;
     }
     TemplateVariant docs() const
     {
       if (!m_cache.docs && m_def)
       {
-        if (!m_argument->docs.isEmpty())
+        if (!m_argument.docs.isEmpty())
         {
           m_cache.docs.reset(new TemplateVariant(
                              parseDoc(m_def,m_def->docFile(),m_def->docLine(),
-                             m_relPath,m_argument->docs,TRUE)));
+                             m_relPath,m_argument.docs,TRUE)));
         }
         else
         {
@@ -9472,7 +9457,7 @@ class ArgumentContext::Private
     }
     TemplateVariant namePart() const
     {
-      QCString result = m_argument->attrib;
+      QCString result = m_argument.attrib;
       int l = result.length();
       if (l>2 && result.at(0)=='[' && result.at(l-1)==']')
       {
@@ -9482,7 +9467,7 @@ class ArgumentContext::Private
       return result;
     }
   private:
-    const Argument *m_argument;
+    const Argument &m_argument;
     const Definition *m_def;
     QCString m_relPath;
     struct Cachable
@@ -9496,7 +9481,7 @@ class ArgumentContext::Private
 
 PropertyMapper<ArgumentContext::Private> ArgumentContext::Private::s_inst;
 
-ArgumentContext::ArgumentContext(const Argument *al,const Definition *def,const QCString &relPath) : RefCountedContext("ArgumentContext")
+ArgumentContext::ArgumentContext(const Argument &al,const Definition *def,const QCString &relPath) : RefCountedContext("ArgumentContext")
 {
   p = new Private(al,def,relPath);
 }
@@ -9517,7 +9502,7 @@ TemplateVariant ArgumentContext::get(const char *name) const
 class ArgumentListContext::Private : public GenericNodeListContext
 {
   public:
-    void addArgument(const Argument *arg,const Definition *def,const QCString &relPath)
+    void addArgument(const Argument &arg,const Definition *def,const QCString &relPath)
     {
       append(ArgumentContext::alloc(arg,def,relPath));
     }
@@ -9528,18 +9513,13 @@ ArgumentListContext::ArgumentListContext() : RefCountedContext("ArgumentListCont
   p = new Private;
 }
 
-ArgumentListContext::ArgumentListContext(const ArgumentList *list,
+ArgumentListContext::ArgumentListContext(const ArgumentList &list,
                         const Definition *def,const QCString &relPath) : RefCountedContext("ArgumentListContext")
 {
   p = new Private;
-  if (list)
+  for (const Argument &arg : list)
   {
-    ArgumentListIterator ali(*list);
-    const Argument *arg;
-    for (ali.toFirst();(arg=ali.current());++ali)
-    {
-      p->addArgument(arg,def,relPath);
-    }
+    p->addArgument(arg,def,relPath);
   }
 }
 
@@ -10316,7 +10296,7 @@ void generateOutputViaTemplate()
       ctx->set("classMembersIndex",classMembersIndex.get());
       //%% NamespaceMembersIndex namespaceMembersIndex:
       ctx->set("namespaceMembersIndex",namespaceMembersIndex.get());
-      //%% SearchIndicaes searchindicaes
+      //%% SearchIndices searchIndices
       ctx->set("searchIndices",searchIndices.get());
       //%% string space
       ctx->set("space"," ");
index ecd1227..fc1278b 100644 (file)
@@ -1138,7 +1138,7 @@ class AllMembersListContext : public RefCountedContext, public TemplateListIntf
 class ArgumentContext : public RefCountedContext, public TemplateStructIntf
 {
   public:
-    static ArgumentContext *alloc(const Argument *arg,const Definition *def,const QCString &relPath)
+    static ArgumentContext *alloc(const Argument &arg,const Definition *def,const QCString &relPath)
     { return new ArgumentContext(arg,def,relPath); }
 
     // TemplateStructIntf methods
@@ -1147,7 +1147,7 @@ class ArgumentContext : public RefCountedContext, public TemplateStructIntf
     virtual int release() { return RefCountedContext::release(); }
 
   private:
-    ArgumentContext(const Argument *arg,const Definition *def,const QCString &relPath);
+    ArgumentContext(const Argument &arg,const Definition *def,const QCString &relPath);
    ~ArgumentContext();
     class Private;
     Private *p;
@@ -1159,7 +1159,7 @@ class ArgumentListContext : public RefCountedContext, public TemplateListIntf
 {
   public:
     static ArgumentListContext *alloc() { return new ArgumentListContext; }
-    static ArgumentListContext *alloc(const ArgumentList *al,const Definition *def,const QCString &relPath)
+    static ArgumentListContext *alloc(const ArgumentList &al,const Definition *def,const QCString &relPath)
     { return new ArgumentListContext(al,def,relPath); }
 
     // TemplateListIntf
@@ -1171,7 +1171,7 @@ class ArgumentListContext : public RefCountedContext, public TemplateListIntf
 
   private:
     ArgumentListContext();
-    ArgumentListContext(const ArgumentList *al,const Definition *def,const QCString &relPath);
+    ArgumentListContext(const ArgumentList &al,const Definition *def,const QCString &relPath);
    ~ArgumentListContext();
     class Private;
     Private *p;
index 36ef94a..af94569 100644 (file)
@@ -63,6 +63,7 @@ struct declinfoYY_state
      bool         insidePHP;
 };
 
+static const char *stateToString(int state);
 static void addType(yyscan_t yyscanner);
 static void addTypeName(yyscan_t yyscanner);
 static int yyread(char *buf,int max_size, yyscan_t yyscanner);
@@ -261,7 +262,7 @@ void parseFuncDecl(const QCString &decl,const SrcLangExt lang,QCString &cl,QCStr
   struct yyguts_t *yyg = (struct yyguts_t*)g_yyscanner;
 
 #ifdef FLEX_DEBUG
-  yyset_debug(1,g_yyscanner);
+  declinfoYYset_debug(1,g_yyscanner);
 #endif
 
   printlex(yy_flex_debug, TRUE, __FILE__, NULL);
@@ -289,7 +290,7 @@ void parseFuncDecl(const QCString &decl,const SrcLangExt lang,QCString &cl,QCStr
   //        yyextra->type.data(),yyextra->scope.data(),yyextra->name.data(),yyextra->args.data());
 
   int nb = yyextra->name.findRev('[');
-  if (nb!=-1 && yyextra->args.isEmpty()) // correct for [] in yyextra->name ambigity (due to Java return yyextra->type allowing [])
+  if (nb!=-1 && yyextra->args.isEmpty()) // correct for [] in yyextra->name ambiguity (due to Java return yyextra->type allowing [])
   {
     yyextra->args.prepend(yyextra->name.right(yyextra->name.length()-nb));
     yyextra->name=yyextra->name.left(nb);
@@ -346,11 +347,6 @@ void parseFuncDecl(const QCString &decl,const SrcLangExt lang,QCString &cl,QCStr
   return;
 }
 
-//extern "C" { // some bogus code to keep the compiler happy
-//  int  declinfoYYwrap() { return 1 ; }
-//  void declinfoYYdummy() { yy_flex_realloc(0,0); } 
-//}
-
 #if 0
 void dumpDecl(const char *s)
 {
@@ -384,10 +380,5 @@ int main()
 }
 #endif
 
-#if !defined(YY_FLEX_SUBMINOR_VERSION) 
-//----------------------------------------------------------------------------
-extern "C" { // some bogus code to keep the compiler happy
-  void declinfoYYdummy() { yy_flex_realloc(0,0); } 
-}
-#endif
 
+#include "declinfo.l.h"
index 34a19a2..4a38723 100644 (file)
 #ifndef DEFARGS_H
 #define DEFARGS_H
 
+#include "types.h"
+
 class ArgumentList;
 class QCString;
 
-extern void stringToArgumentList(const char *argsString,ArgumentList* argList,
+extern void stringToArgumentList(SrcLangExt lang, const char *argsString,ArgumentList& argList,
                                  QCString *extraTypeChars=0);
 
 #endif
index 85878c1..9745f44 100644 (file)
@@ -86,7 +86,9 @@ static int              g_lastDocContext;
 static int              g_lastDocChar;
 static int              g_lastExtendsContext;
 static QCString         g_delimiter;
+static SrcLangExt       g_lang;
 
+static const char *stateToString(int state);
 /* -----------------------------------------------------------------
  */
 #undef YY_INPUT
@@ -308,9 +310,21 @@ RAWEND    ")"[^ \t\(\)\\]{0,16}\"
                                        }
 <CopyArgSharp>">"                      {
                                          *g_copyArgValue += *yytext;
-                                          // don't count > inside )
-                                         if (g_argSharpCount>0 && g_argRoundCount==0) g_argSharpCount--;
-                                         else BEGIN( g_readArgContext );
+                                          if (g_argRoundCount>0 && g_argSharpCount==0)
+                                          {
+                                            // don't count > inside )
+                                          }
+                                          else
+                                          {
+                                            if (g_argSharpCount>0)
+                                            {
+                                              g_argSharpCount--;
+                                            }
+                                            else
+                                            {
+                                              BEGIN( g_readArgContext );
+                                            }
+                                          }
                                        }
 <CopyArgSharp>"("                       {
                                           g_argRoundCount++;
@@ -374,12 +388,12 @@ RAWEND    ")"[^ \t\(\)\\]{0,16}\"
                                              int i=l-1;
                                              while (i>=0 && (isspace((uchar)g_curArgTypeName.at(i)) || g_curArgTypeName.at(i)=='.')) i--;
                                              while (i>=0 && (isId(g_curArgTypeName.at(i)) || g_curArgTypeName.at(i)=='$')) i--;
-                                             Argument *a = new Argument;
-                                             a->attrib  = g_curArgAttrib.copy();
-                                              a->typeConstraint = g_curTypeConstraint.stripWhiteSpace();
+                                             Argument a;
+                                             a.attrib  = g_curArgAttrib.copy();
+                                              a.typeConstraint = g_curTypeConstraint.stripWhiteSpace();
                                              //printf("a->type=%s a->name=%s i=%d l=%d\n",
                                              //        a->type.data(),a->name.data(),i,l);
-                                             a->array.resize(0);
+                                             a.array.resize(0);
                                              if (i==l-1 && g_curArgTypeName.at(i)==')') // function argument
                                              {
                                                int bi=g_curArgTypeName.find('(');
@@ -388,67 +402,67 @@ RAWEND    ")"[^ \t\(\)\\]{0,16}\"
                                                while (fi>=0 && (isId(g_curArgTypeName.at(fi)) || g_curArgTypeName.at(fi)==':')) fi--;
                                                if (fi>=0)
                                                {
-                                                 a->type  = g_curArgTypeName.left(fi+1);
-                                                 a->name  = g_curArgTypeName.mid(fi+1,bi-fi-1).stripWhiteSpace();
-                                                 a->array = g_curArgTypeName.right(l-bi);
+                                                 a.type  = g_curArgTypeName.left(fi+1);
+                                                 a.name  = g_curArgTypeName.mid(fi+1,bi-fi-1).stripWhiteSpace();
+                                                 a.array = g_curArgTypeName.right(l-bi);
                                                }
                                                else
                                                {
-                                                 a->type = g_curArgTypeName;
+                                                 a.type = g_curArgTypeName;
                                                }
                                              }
                                              else if (i>=0 && g_curArgTypeName.at(i)!=':')
                                              { // type contains a name
-                                               a->type = removeRedundantWhiteSpace(g_curArgTypeName.left(i+1)).stripWhiteSpace();
-                                               a->name = g_curArgTypeName.right(l-i-1).stripWhiteSpace();
+                                               a.type = removeRedundantWhiteSpace(g_curArgTypeName.left(i+1)).stripWhiteSpace();
+                                               a.name = g_curArgTypeName.right(l-i-1).stripWhiteSpace();
 
                                                // if the type becomes a type specifier only then we make a mistake
                                                // and need to correct it to avoid seeing a nameless parameter
                                                // "struct A" as a parameter with type "struct" and name "A".
                                                int sv=0;
-                                               if      (a->type.left(6)=="const ")    sv=6;
-                                               else if (a->type.left(9)=="volatile ") sv=9;
+                                               if      (a.type.left(6)=="const ")    sv=6;
+                                               else if (a.type.left(9)=="volatile ") sv=9;
 
-                                               if (a->type.mid(sv)=="struct"    ||
-                                                   a->type.mid(sv)=="union"     ||
-                                                   a->type.mid(sv)=="class"     ||
-                                                   a->type.mid(sv)=="typename"  ||
-                                                   nameIsActuallyPartOfType(a->name)
+                                               if (a.type.mid(sv)=="struct"    ||
+                                                   a.type.mid(sv)=="union"     ||
+                                                   a.type.mid(sv)=="class"     ||
+                                                   a.type.mid(sv)=="typename"  ||
+                                                   nameIsActuallyPartOfType(a.name)
                                                   )
                                                {
-                                                 a->type = a->type + " " + a->name;
-                                                 a->name.resize(0);
+                                                 a.type = a.type + " " + a.name;
+                                                 a.name.resize(0);
                                                }
                                                //printf(" --> a->type='%s' a->name='%s'\n",a->type.data(),a->name.data());
                                              }
                                              else // assume only the type was specified, try to determine name later 
                                              {
-                                               a->type = removeRedundantWhiteSpace(g_curArgTypeName);  
+                                               a.type = removeRedundantWhiteSpace(g_curArgTypeName);  
                                              }
-                                              if (!a->type.isEmpty() && a->type.at(0)=='$') // typeless PHP name?
+                                              if (!a.type.isEmpty() && a.type.at(0)=='$') // typeless PHP name?
                                               {
-                                                a->name = a->type;
-                                                a->type = "";
+                                                a.name = a.type;
+                                                a.type = "";
                                               }
-                                             a->array  += removeRedundantWhiteSpace(g_curArgArray);
+                                             a.array  += removeRedundantWhiteSpace(g_curArgArray);
                                              //printf("array=%s\n",a->array.data());
-                                             int alen = a->array.length();
-                                             if (alen>2 && a->array.at(0)=='(' && 
-                                                           a->array.at(alen-1)==')') // fix-up for int *(a[10])
+                                             int alen = a.array.length();
+                                             if (alen>2 && a.array.at(0)=='(' && 
+                                                           a.array.at(alen-1)==')') // fix-up for int *(a[10])
                                              {
-                                               int i=a->array.find('[')-1;
-                                               a->array = a->array.mid(1,alen-2);
-                                               if (i>0 && a->name.isEmpty())
+                                               int i=a.array.find('[')-1;
+                                               a.array = a.array.mid(1,alen-2);
+                                               if (i>0 && a.name.isEmpty())
                                                {
-                                                 a->name  = a->array.left(i).stripWhiteSpace();
-                                                 a->array = a->array.mid(i);
+                                                 a.name  = a.array.left(i).stripWhiteSpace();
+                                                 a.array = a.array.mid(i);
                                                }
                                              }
-                                             a->defval = g_curArgDefValue.copy();
+                                             a.defval = g_curArgDefValue.copy();
                                              //printf("a->type=%s a->name=%s a->defval=\"%s\"\n",a->type.data(),a->name.data(),a->defval.data());
-                                             a->docs   = g_curArgDocs.stripWhiteSpace();
+                                             a.docs   = g_curArgDocs.stripWhiteSpace();
                                              //printf("Argument '%s' '%s' adding docs='%s'\n",a->type.data(),a->name.data(),a->docs.data());
-                                             g_argList->append(a);
+                                             g_argList->push_back(a);
                                            }
                                            g_curArgAttrib.resize(0);
                                            g_curArgTypeName.resize(0);
@@ -468,9 +482,16 @@ RAWEND    ")"[^ \t\(\)\\]{0,16}\"
                                          }
                                        }
 <ReadFuncArgType,ReadFuncArgPtr>"extends" {
-                                          g_curTypeConstraint.resize(0);
-                                          g_lastExtendsContext=YY_START;
-                                          BEGIN(ReadTypeConstraint);
+                                           if (g_lang!=SrcLangExt_Java)
+                                           {
+                                             REJECT;
+                                           }
+                                           else
+                                           {
+                                             g_curTypeConstraint.resize(0);
+                                             g_lastExtendsContext=YY_START;
+                                             BEGIN(ReadTypeConstraint);
+                                           }
                                         }
 <ReadFuncArgType,ReadFuncArgPtr>"$"?{ID} { 
                                          QCString name=yytext; //resolveDefines(yytext);
@@ -588,9 +609,8 @@ RAWEND    ")"[^ \t\(\)\\]{0,16}\"
  *              for complex types are written to
  */
  
-void stringToArgumentList(const char *argsString,ArgumentList* al,QCString *extraTypeChars)
+void stringToArgumentList(SrcLangExt lang, const char *argsString,ArgumentList& al,QCString *extraTypeChars)
 {
-  if (al==0) return; 
   if (argsString==0) return;
   printlex(yy_flex_debug, TRUE, __FILE__, NULL);
 
@@ -610,18 +630,18 @@ void stringToArgumentList(const char *argsString,ArgumentList* al,QCString *extr
   g_curArgTypeName.resize(0);
   g_curArgDefValue.resize(0);
   g_curArgName.resize(0);
-  g_argList = al;
+  g_argList = &al;
+  g_lang = lang;
   defargsYYrestart( defargsYYin );
   BEGIN( Start );
   defargsYYlex();
+  if (g_argList->empty())
+  {
+    g_argList->noParameters = TRUE;
+  }
   if (extraTypeChars) *extraTypeChars=g_extraTypeChars;
   //printf("stringToArgumentList(%s) result=%s\n",argsString,argListToString(al).data());
   printlex(yy_flex_debug, FALSE, __FILE__, NULL);
 }
 
-#if !defined(YY_FLEX_SUBMINOR_VERSION) 
-extern "C" { // some bogus code to keep the compiler happy
-  void defargsYYdummy() { yy_flex_realloc(0,0); } 
-}
-#endif
-
+#include "defargs.l.h"
index aa9a1da..cc3d5af 100644 (file)
@@ -144,71 +144,66 @@ void generateDEFForMember(MemberDef *md,
 
   if (isFunc) //function
   {
-    ArgumentList *declAl = new ArgumentList;
-    const ArgumentList *defAl = md->argumentList();
-    stringToArgumentList(md->argsString(),declAl);
+    const ArgumentList &defAl = md->argumentList();
+    ArgumentList declAl;
+    stringToArgumentList(md->getLanguage(),md->argsString(),declAl);
     QCString fcnPrefix = "  " + memPrefix + "param-";
 
-    if (defAl && declAl->count()>0)
+    auto defIt = defAl.begin();
+    for (const Argument &a : declAl)
     {
-      ArgumentListIterator declAli(*declAl);
-      ArgumentListIterator defAli(*defAl);
-      Argument *a;
-      for (declAli.toFirst();(a=declAli.current());++declAli)
+      const Argument *defArg = 0;
+      if (defIt!=defAl.end())
       {
-        Argument *defArg = defAli.current();
-        t << memPrefix << "param = {" << endl;
-        if (!a->attrib.isEmpty())
-        {
-          t << fcnPrefix << "attributes = ";
-          writeDEFString(t,a->attrib);
-          t << ';' << endl;
-        }
-        if (!a->type.isEmpty())
-        {
-          t << fcnPrefix << "type = <<_EnD_oF_dEf_TeXt_" << endl
-            << a->type << endl << "_EnD_oF_dEf_TeXt_;" << endl;
-        }
-        if (!a->name.isEmpty())
-        {
-          t << fcnPrefix << "declname = ";
-          writeDEFString(t,a->name);
-          t << ';' << endl;
-        }
-        if (defArg && !defArg->name.isEmpty() && defArg->name!=a->name)
-        {
-          t << fcnPrefix << "defname = ";
-          writeDEFString(t,defArg->name);
-          t << ';' << endl;
-        }
-        if (!a->array.isEmpty())
-        {
-          t << fcnPrefix << "array = ";
-          writeDEFString(t,a->array); 
-          t << ';' << endl;
-        }
-        if (!a->defval.isEmpty())
-        {
-          t << fcnPrefix << "defval = <<_EnD_oF_dEf_TeXt_" << endl
-            << a->defval << endl << "_EnD_oF_dEf_TeXt_;" << endl;
-        }
-        if (defArg) ++defAli;
-        t << "      }; /*" << fcnPrefix << "-param */" << endl;
+        defArg = &(*defIt);
+        ++defIt;
       }
+      t << memPrefix << "param = {" << endl;
+      if (!a.attrib.isEmpty())
+      {
+        t << fcnPrefix << "attributes = ";
+        writeDEFString(t,a.attrib);
+        t << ';' << endl;
+      }
+      if (!a.type.isEmpty())
+      {
+        t << fcnPrefix << "type = <<_EnD_oF_dEf_TeXt_" << endl
+          << a.type << endl << "_EnD_oF_dEf_TeXt_;" << endl;
+      }
+      if (!a.name.isEmpty())
+      {
+        t << fcnPrefix << "declname = ";
+        writeDEFString(t,a.name);
+        t << ';' << endl;
+      }
+      if (defArg && !defArg->name.isEmpty() && defArg->name!=a.name)
+      {
+        t << fcnPrefix << "defname = ";
+        writeDEFString(t,defArg->name);
+        t << ';' << endl;
+      }
+      if (!a.array.isEmpty())
+      {
+        t << fcnPrefix << "array = ";
+        writeDEFString(t,a.array); 
+        t << ';' << endl;
+      }
+      if (!a.defval.isEmpty())
+      {
+        t << fcnPrefix << "defval = <<_EnD_oF_dEf_TeXt_" << endl
+          << a.defval << endl << "_EnD_oF_dEf_TeXt_;" << endl;
+      }
+      t << "      }; /*" << fcnPrefix << "-param */" << endl;
     }
-    delete declAl;
   }
   else if (  md->memberType()==MemberType_Define
       && md->argsString()!=0)
   {
-    ArgumentListIterator ali(*md->argumentList());
-    Argument *a;
     QCString defPrefix = "  " + memPrefix + "def-";
-
-    for (ali.toFirst();(a=ali.current());++ali)
+    for (const Argument &a : md->argumentList())
     {
       t << memPrefix << "param  = {" << endl;
-      t << defPrefix << "name = '" << a->type << "';" << endl;
+      t << defPrefix << "name = '" << a.type << "';" << endl;
       t << "      }; /*" << defPrefix << "-param */" << endl;
     }
   }
@@ -293,7 +288,7 @@ void generateDEFForMember(MemberDef *md,
     {
       if (rmd->getStartBodyLine()!=-1 && rmd->getBodyDef())
       {
-        t << memPrefix << "referenceby = {" << endl;
+        t << memPrefix << "referencedby = {" << endl;
         t << refPrefix << "id = '"
           << rmd->getBodyDef()->getOutputFileBase()
           << "_1"   // encoded ':' character (see util.cpp:convertNameToFile)
@@ -577,9 +572,8 @@ void generateDEF()
       dir.setPath(QDir::currentDirPath());
       if (!dir.mkdir(outputDirectory))
       {
-        err("tag OUTPUT_DIRECTORY: Output directory '%s' does not "
+        term("tag OUTPUT_DIRECTORY: Output directory '%s' does not "
             "exist and cannot be created\n",outputDirectory.data());
-        exit(1);
       }
       else
       {
index 3b5fea1..7540eff 100644 (file)
@@ -15,6 +15,7 @@
  *
  */
 
+#include <algorithm>
 #include <ctype.h>
 #include <qregexp.h>
 #include "md5.h"
 class DefinitionImpl::IMPL
 {
   public:
-    IMPL();
    ~IMPL();
     void init(const char *df, const char *n);
     void setDefFileName(const QCString &df);
 
-    SectionDict *sectionDict;  // dictionary of all sections, not accessible
+    SectionDict *sectionDict = 0;  // dictionary of all sections, not accessible
 
-    MemberSDict *sourceRefByDict;
-    MemberSDict *sourceRefsDict;
-    QList<ListItemInfo> *xrefListItems;
-    GroupList *partOfGroups;
+    MemberSDict *sourceRefByDict = 0;
+    MemberSDict *sourceRefsDict = 0;
+    std::vector<ListItemInfo> xrefListItems;
+    GroupList *partOfGroups = 0;
 
-    DocInfo   *details;    // not exported
-    DocInfo   *inbodyDocs; // not exported
-    BriefInfo *brief;      // not exported
-    BodyInfo  *body;       // not exported
+    DocInfo   *details = 0;    // not exported
+    DocInfo   *inbodyDocs = 0; // not exported
+    BriefInfo *brief = 0;      // not exported
+    BodyInfo  *body = 0;       // not exported
     QCString   briefSignatures;
     QCString   docSignatures;
 
@@ -74,16 +74,17 @@ class DefinitionImpl::IMPL
     QCString qualifiedName;
     QCString ref;   // reference to external documentation
 
-    bool hidden;
-    bool isArtificial;
+    bool hidden = FALSE;
+    bool isArtificial = FALSE;
+    bool isAnonymous = FALSE;
 
-    Definition *outerScope;  // not owner
+    Definition *outerScope = 0;  // not owner
 
     // where the item was defined
     QCString defFileName;
     QCString defFileExt;
 
-    SrcLangExt lang;
+    SrcLangExt lang = SrcLangExt_Unknown;
 
     QCString id; // clang unique id
 
@@ -95,13 +96,6 @@ class DefinitionImpl::IMPL
     Cookie *cookie;
 };
 
-DefinitionImpl::IMPL::IMPL()
-  : sectionDict(0), sourceRefByDict(0), sourceRefsDict(0),
-    xrefListItems(0), partOfGroups(0),
-    details(0), inbodyDocs(0), brief(0), body(0), hidden(FALSE), isArtificial(FALSE),
-    outerScope(0), lang(SrcLangExt_Unknown)
-{
-}
 
 DefinitionImpl::IMPL::~IMPL()
 {
@@ -109,7 +103,6 @@ DefinitionImpl::IMPL::~IMPL()
   delete sourceRefByDict;
   delete sourceRefsDict;
   delete partOfGroups;
-  delete xrefListItems;
   delete brief;
   delete details;
   delete body;
@@ -150,7 +143,6 @@ void DefinitionImpl::IMPL::init(const char *df, const char *n)
   sectionDict     = 0, 
   outerScope      = Doxygen::globalScope;
   partOfGroups    = 0;
-  xrefListItems   = 0;
   hidden          = FALSE;
   isArtificial    = FALSE;
   lang            = SrcLangExt_Unknown;
@@ -305,7 +297,7 @@ DefinitionImpl::DefinitionImpl(const char *df,int dl,int dc,
                        const char *d,bool isSymbol)
 {
   m_impl = new DefinitionImpl::IMPL;
-  m_impl->name = name;
+  setName(name);
   m_impl->defLine = dl;
   m_impl->defColumn = dc;
   m_impl->init(df,name);
@@ -327,7 +319,6 @@ DefinitionImpl::DefinitionImpl(const DefinitionImpl &d)
   m_impl->sourceRefByDict = 0;
   m_impl->sourceRefsDict = 0;
   m_impl->partOfGroups = 0;
-  m_impl->xrefListItems = 0;
   m_impl->brief = 0;
   m_impl->details = 0;
   m_impl->body = 0;
@@ -371,10 +362,6 @@ DefinitionImpl::DefinitionImpl(const DefinitionImpl &d)
       makePartOfGroup(gd);
     }
   }
-  if (d.m_impl->xrefListItems)
-  {
-    setRefItems(d.m_impl->xrefListItems);
-  }
   if (d.m_impl->brief)
   {
     m_impl->brief = new BriefInfo(*d.m_impl->brief);
@@ -412,6 +399,9 @@ void DefinitionImpl::setName(const char *name)
 {
   if (name==0) return;
   m_impl->name = name;
+  m_impl->isAnonymous = m_impl->name.isEmpty() ||
+                        m_impl->name.at(0)=='@' ||
+                        m_impl->name.find("::@")!=-1;
 }
 
 void DefinitionImpl::setId(const char *id)
@@ -420,7 +410,7 @@ void DefinitionImpl::setId(const char *id)
   m_impl->id = id;
   if (Doxygen::clangUsrMap) 
   {
-    //printf("DefinitionImpl::setId '%s'->'%s'\n",id,m_name.data());
+    //printf("DefinitionImpl::setId '%s'->'%s'\n",id,m_impl->name.data());
     Doxygen::clangUsrMap->insert(id,this);
   }
 }
@@ -430,13 +420,10 @@ QCString DefinitionImpl::id() const
   return m_impl->id;
 }
 
-void DefinitionImpl::addSectionsToDefinition(QList<SectionInfo> *anchorList)
+void DefinitionImpl::addSectionsToDefinition(const std::vector<const SectionInfo*> &anchorList)
 {
-  if (!anchorList) return;
   //printf("%s: addSectionsToDefinition(%d)\n",name().data(),anchorList->count());
-  QListIterator<SectionInfo> it(*anchorList);
-  SectionInfo *si;
-  for (;(si=it.current());++it)
+  for (const SectionInfo *si : anchorList)
   {
     //printf("Add section '%s' to definition '%s'\n",
     //    si->label.data(),name().data());
@@ -541,11 +528,11 @@ void DefinitionImpl::writeDocAnchorsToTagFile(FTextStream &tagFile) const
     SectionInfo *si;
     for (;(si=sdi.current());++sdi)
     {
-      if (!si->generated && si->ref.isEmpty())
+      if (!si->generated && si->ref.isEmpty() && !si->label.startsWith("autotoc_md"))
       {
         //printf("write an entry!\n");
         if (definitionType()==TypeMember) tagFile << "  ";
-        tagFile << "    <docanchor file=\"" << si->fileName << "\"";
+        tagFile << "    <docanchor file=\"" << addHtmlExtensionIfMissing(si->fileName) << "\"";
         if (!si->title.isEmpty())
         {
           tagFile << " title=\"" << convertToXML(si->title) << "\"";
@@ -757,12 +744,12 @@ class FilterCache
         // file already processed, get the results after filtering from the tmp file
         Debug::print(Debug::FilterOutput,0,"Reusing filter result for %s from %s at offset=%d size=%d\n",
                qPrint(fileName),qPrint(Doxygen::filterDBFileName),(int)item->filePos,(int)item->fileSize);
-        f = portable_fopen(Doxygen::filterDBFileName,"rb");
+        f = Portable::fopen(Doxygen::filterDBFileName,"rb");
         if (f)
         {
           bool success=TRUE;
           str.resize(item->fileSize+1);
-          if (portable_fseek(f,item->filePos,SEEK_SET)==-1)
+          if (Portable::fseek(f,item->filePos,SEEK_SET)==-1)
           {
             err("Failed to seek to position %d in filter database file %s\n",(int)item->filePos,qPrint(Doxygen::filterDBFileName));
             success=FALSE;
@@ -793,8 +780,8 @@ class FilterCache
         // filter file
         QCString cmd=filter+" \""+fileName+"\"";
         Debug::print(Debug::ExtCmd,0,"Executing popen(`%s`)\n",qPrint(cmd));
-        f = portable_popen(cmd,"r");
-        FILE *bf = portable_fopen(Doxygen::filterDBFileName,"a+b");
+        f = Portable::popen(cmd,"r");
+        FILE *bf = Portable::fopen(Doxygen::filterDBFileName,"a+b");
         FilterCacheItem *item = new FilterCacheItem;
         item->filePos = m_endPos;
         if (bf==0)
@@ -803,7 +790,7 @@ class FilterCache
           err("Error opening filter database file %s\n",qPrint(Doxygen::filterDBFileName));
           str.addChar('\0');
           delete item;
-          portable_pclose(f);
+          Portable::pclose(f);
           return FALSE;
         }
         // append the filtered output to the database file
@@ -819,7 +806,7 @@ class FilterCache
                 qPrint(Doxygen::filterDBFileName),bytesWritten,bytesRead);
             str.addChar('\0');
             delete item;
-            portable_pclose(f);
+            Portable::pclose(f);
             fclose(bf);
             return FALSE;
           }
@@ -834,14 +821,14 @@ class FilterCache
                qPrint(fileName),qPrint(Doxygen::filterDBFileName),(int)item->filePos,(int)item->fileSize);
         // update end of file position
         m_endPos += size;
-        portable_pclose(f);
+        Portable::pclose(f);
         fclose(bf);
       }
       else // no filtering
       {
         // normal file
         //printf("getFileContents(%s): no filter\n",qPrint(fileName));
-        f = portable_fopen(fileName,"r");
+        f = Portable::fopen(fileName,"r");
         while (!feof(f))
         {
           int bytesRead = fread(buf,1,blockSize,f);
@@ -1010,7 +997,7 @@ bool readCodeFragment(const char *fileName,
   }
   result = transcodeCharacterStringToUTF8(result);
   if (!result.isEmpty() && result.at(result.length()-1)!='\n') result += "\n";
-  //fprintf(stderr,"readCodeFragement(%d-%d)=%s\n",startLine,endLine,result.data());
+  //printf("readCodeFragment(%d-%d)=%s\n",startLine,endLine,result.data());
   return found;
 }
 
@@ -1275,26 +1262,26 @@ void DefinitionImpl::writeInlineCode(OutputList &ol,const char *scopeName) const
     {
       //printf("Adding code fragment '%s' ext='%s'\n",
       //    codeFragment.data(),m_impl->defFileExt.data());
-      ParserInterface *pIntf = Doxygen::parserManager->getParser(m_impl->defFileExt);
-      pIntf->resetCodeParserState();
+      CodeParserInterface &intf = Doxygen::parserManager->getCodeParser(m_impl->defFileExt);
+      intf.resetCodeParserState();
       //printf("Read:\n'%s'\n\n",codeFragment.data());
       const MemberDef *thisMd = 0;
       if (definitionType()==TypeMember) thisMd = dynamic_cast <const MemberDef*>(this);
 
       ol.startCodeFragment();
-      pIntf->parseCode(ol,               // codeOutIntf
-                       scopeName,        // scope
-                       codeFragment,     // input
-                       m_impl->lang,     // lang
-                       FALSE,            // isExample
-                       0,                // exampleName
-                       m_impl->body->fileDef,  // fileDef
-                       actualStart,      // startLine
-                       actualEnd,        // endLine
-                       TRUE,             // inlineFragment
-                       thisMd,           // memberDef
-                       TRUE              // show line numbers
-                      );
+      intf.parseCode(ol,               // codeOutIntf
+                     scopeName,        // scope
+                     codeFragment,     // input
+                     m_impl->lang,     // lang
+                     FALSE,            // isExample
+                     0,                // exampleName
+                     m_impl->body->fileDef,  // fileDef
+                     actualStart,      // startLine
+                     actualEnd,        // endLine
+                     TRUE,             // inlineFragment
+                     thisMd,           // memberDef
+                     TRUE              // show line numbers
+                    );
       ol.endCodeFragment();
     }
   }
@@ -1617,76 +1604,47 @@ void DefinitionImpl::makePartOfGroup(GroupDef *gd)
   m_impl->partOfGroups->append(gd);
 }
 
-void DefinitionImpl::setRefItems(const QList<ListItemInfo> *sli)
+void DefinitionImpl::setRefItems(const std::vector<ListItemInfo> &sli)
 {
-  //printf("%s::setRefItems()\n",name().data());
-  if (sli)
-  {
-    // deep copy the list
-    if (m_impl->xrefListItems==0) 
-    {
-      m_impl->xrefListItems=new QList<ListItemInfo>;
-      m_impl->xrefListItems->setAutoDelete(TRUE);
-    }
-    QListIterator<ListItemInfo> slii(*sli);
-    ListItemInfo *lii;
-    for (slii.toFirst();(lii=slii.current());++slii)
-    {
-      m_impl->xrefListItems->append(new ListItemInfo(*lii));
-    } 
-  }
+  m_impl->xrefListItems.insert(m_impl->xrefListItems.end(), sli.cbegin(), sli.cend());
 }
 
 void DefinitionImpl::mergeRefItems(Definition *d)
 {
-  //printf("%s::mergeRefItems()\n",name().data());
-  QList<ListItemInfo> *xrefList = d->xrefListItems();
-  if (xrefList!=0)
-  {
-    // deep copy the list
-    if (m_impl->xrefListItems==0) 
-    {
-      m_impl->xrefListItems=new QList<ListItemInfo>;
-      m_impl->xrefListItems->setAutoDelete(TRUE);
-    }
-    QListIterator<ListItemInfo> slii(*xrefList);
-    QListIterator<ListItemInfo> mlii(*m_impl->xrefListItems);
-    ListItemInfo *lii;
-    ListItemInfo *mii;
-    for (slii.toFirst();(lii=slii.current());++slii)
-    {
-      bool found = false;
-      for (mlii.toFirst();(mii=mlii.current());++mlii)
-      {
-        if ((qstrcmp(lii->type,mii->type)==0) && (lii->itemId == mii->itemId))
-       {
-          found = true;
-          break;
-       }
-      }
-      if (!found) m_impl->xrefListItems->append(new ListItemInfo(*lii));
-    } 
-  }
+  auto otherXrefList = d->xrefListItems();
+
+  // append vectors
+  m_impl->xrefListItems.reserve(m_impl->xrefListItems.size()+otherXrefList.size());
+  m_impl->xrefListItems.insert (m_impl->xrefListItems.end(),
+                                otherXrefList.begin(),otherXrefList.end());
+
+  // sort results on itemId
+  std::sort(m_impl->xrefListItems.begin(),m_impl->xrefListItems.end(),
+            [](const ListItemInfo &left,const ListItemInfo &right)
+            { return left.itemId<right.itemId ||
+                     (left.itemId==right.itemId && qstrcmp(left.type,right.type)<0);
+            });
+
+  // filter out duplicates
+  auto last = std::unique(m_impl->xrefListItems.begin(),m_impl->xrefListItems.end(),
+            [](const ListItemInfo &left,const ListItemInfo &right)
+            { return left.itemId==right.itemId && left.type==right.type; });
+  m_impl->xrefListItems.erase(last, m_impl->xrefListItems.end());
 }
 
 int DefinitionImpl::_getXRefListId(const char *listName) const
 {
-  if (m_impl->xrefListItems)
+  for (const ListItemInfo &lii : m_impl->xrefListItems)
   {
-    QListIterator<ListItemInfo> slii(*m_impl->xrefListItems);
-    ListItemInfo *lii;
-    for (slii.toFirst();(lii=slii.current());++slii)
+    if (lii.type==listName)
     {
-      if (qstrcmp(lii->type,listName)==0)
-      {
-        return lii->itemId;
-      }
+      return lii.itemId;
     }
   }
   return -1;
 }
 
-QList<ListItemInfo> *DefinitionImpl::xrefListItems() const
+const std::vector<ListItemInfo> &DefinitionImpl::xrefListItems() const
 {
   return m_impl->xrefListItems;
 }
@@ -2241,6 +2199,11 @@ QCString DefinitionImpl::name() const
   return m_impl->name;
 }
 
+bool DefinitionImpl::isAnonymous() const
+{
+  return m_impl->isAnonymous;
+}
+
 int DefinitionImpl::getDefLine() const
 {
   return m_impl->defLine;
index db9bbbc..b3ece2c 100644 (file)
@@ -18,6 +18,7 @@
 #ifndef DEFINITION_H
 #define DEFINITION_H
 
+#include <vector>
 #include <qlist.h>
 #include <qdict.h>
 
@@ -111,6 +112,11 @@ class Definition : public DefinitionIntf
     /*! Returns the name of the definition */
     virtual QCString name() const = 0;
 
+    /*! Returns TRUE iff this definition has an artificially generated name
+     * (typically starting with a @) that is used for nameless definitions
+     */
+    virtual bool isAnonymous() const = 0;
+
     /*! Returns the name of the definition as it appears in the output */
     virtual QCString displayName(bool includeScope=TRUE) const = 0;
 
@@ -257,7 +263,7 @@ class Definition : public DefinitionIntf
     virtual GroupList *partOfGroups() const = 0;
     virtual bool isLinkableViaGroup() const = 0;
 
-    virtual QList<ListItemInfo> *xrefListItems() const = 0;
+    virtual const std::vector<ListItemInfo> &xrefListItems() const = 0;
 
     virtual Definition *findInnerCompound(const char *name) const = 0;
     virtual Definition *getOuterScope() const = 0;
@@ -313,7 +319,7 @@ class Definition : public DefinitionIntf
     virtual void setBodySegment(int bls,int ble) = 0;
     virtual void setBodyDef(FileDef *fd) = 0;
 
-    virtual void setRefItems(const QList<ListItemInfo> *sli) = 0;
+    virtual void setRefItems(const std::vector<ListItemInfo> &sli) = 0;
     virtual void setOuterScope(Definition *d) = 0;
 
     virtual void setHidden(bool b) = 0;
@@ -331,7 +337,7 @@ class Definition : public DefinitionIntf
     /*! Add the list of anchors that mark the sections that are found in the 
      * documentation.
      */
-    virtual void addSectionsToDefinition(QList<SectionInfo> *anchorList) = 0;
+    virtual void addSectionsToDefinition(const std::vector<const SectionInfo*> &anchorList) = 0;
     virtual void addSourceReferencedBy(const MemberDef *d) = 0;
     virtual void addSourceReferences(const MemberDef *d) = 0;
     virtual void mergeRefItems(Definition *d) = 0;
index 4dd324b..2d8886d 100644 (file)
@@ -32,6 +32,7 @@ class DefinitionImpl : virtual public Definition
 
     virtual bool isAlias() const { return FALSE; }
     virtual QCString name() const;
+    virtual bool isAnonymous() const;
     virtual QCString localName() const;
     virtual QCString qualifiedName() const;
     virtual QCString symbolName() const;
@@ -66,7 +67,7 @@ class DefinitionImpl : virtual public Definition
     virtual SrcLangExt getLanguage() const;
     virtual GroupList *partOfGroups() const;
     virtual bool isLinkableViaGroup() const;
-    virtual QList<ListItemInfo> *xrefListItems() const;
+    virtual const std::vector<ListItemInfo> &xrefListItems() const;
     virtual Definition *findInnerCompound(const char *name) const;
     virtual Definition *getOuterScope() const;
     virtual MemberSDict *getReferencesMembers() const;
@@ -83,12 +84,12 @@ class DefinitionImpl : virtual public Definition
     virtual void setBriefDescription(const char *b,const char *briefFile,int briefLine);
     virtual void setInbodyDocumentation(const char *d,const char *docFile,int docLine);
     virtual void setReference(const char *r);
-    virtual void addSectionsToDefinition(QList<SectionInfo> *anchorList);
+    virtual void addSectionsToDefinition(const std::vector<const SectionInfo*> &anchorList);
     virtual void setBodySegment(int bls,int ble);
     virtual void setBodyDef(FileDef *fd);
     virtual void addSourceReferencedBy(const MemberDef *d);
     virtual void addSourceReferences(const MemberDef *d);
-    virtual void setRefItems(const QList<ListItemInfo> *sli);
+    virtual void setRefItems(const std::vector<ListItemInfo> &sli);
     virtual void mergeRefItems(Definition *d);
     virtual void addInnerCompound(const Definition *d);
     virtual void setOuterScope(Definition *d);
@@ -142,6 +143,8 @@ class DefinitionAliasImpl : virtual public Definition
     virtual bool isAlias() const { return TRUE; }
     virtual QCString name() const
     { return m_def->name(); }
+    virtual bool isAnonymous() const
+    { return m_def->isAnonymous(); }
     virtual QCString localName() const
     { return m_def->localName(); }
     virtual QCString qualifiedName() const
@@ -210,7 +213,7 @@ class DefinitionAliasImpl : virtual public Definition
     { return m_def->partOfGroups(); }
     virtual bool isLinkableViaGroup() const
     { return m_def->isLinkableViaGroup(); }
-    virtual QList<ListItemInfo> *xrefListItems() const
+    virtual const std::vector<ListItemInfo> &xrefListItems() const
     { return m_def->xrefListItems(); }
     virtual Definition *findInnerCompound(const char *name) const
     { return m_def->findInnerCompound(name); }
@@ -241,12 +244,12 @@ class DefinitionAliasImpl : virtual public Definition
     virtual void setBriefDescription(const char *b,const char *briefFile,int briefLine) {}
     virtual void setInbodyDocumentation(const char *d,const char *docFile,int docLine) {}
     virtual void setReference(const char *r) {}
-    virtual void addSectionsToDefinition(QList<SectionInfo> *anchorList) {}
+    virtual void addSectionsToDefinition(const std::vector<const SectionInfo*> &anchorList) {}
     virtual void setBodySegment(int bls,int ble) {}
     virtual void setBodyDef(FileDef *fd) {}
     virtual void addSourceReferencedBy(const MemberDef *d) {}
     virtual void addSourceReferences(const MemberDef *d) {}
-    virtual void setRefItems(const QList<ListItemInfo> *sli) {}
+    virtual void setRefItems(const std::vector<ListItemInfo> &sli) {}
     virtual void mergeRefItems(Definition *d) {}
     virtual void addInnerCompound(const Definition *d) {}
     virtual void setOuterScope(Definition *d) {}
index 8dab5b0..4a00a17 100644 (file)
@@ -29,7 +29,7 @@ void writeDiaGraphFromFile(const char *inFile,const char *outDir,
                            const char *outFile,DiaOutputFormat format)
 {
   QCString absOutFile = outDir;
-  absOutFile+=portable_pathSeparator();
+  absOutFile+=Portable::pathSeparator();
   absOutFile+=outFile;
 
   // chdir to the output dir, so dot can find the font file.
@@ -37,7 +37,7 @@ void writeDiaGraphFromFile(const char *inFile,const char *outDir,
   // go to the html output directory (i.e. path)
   QDir::setCurrent(outDir);
   //printf("Going to dir %s\n",QDir::currentDirPath().data());
-  QCString diaExe = Config_getString(DIA_PATH)+"dia"+portable_commandExtension();
+  QCString diaExe = Config_getString(DIA_PATH)+"dia"+Portable::commandExtension();
   QCString diaArgs;
   QCString extension;
   diaArgs+="-n ";
@@ -62,26 +62,26 @@ void writeDiaGraphFromFile(const char *inFile,const char *outDir,
 
   int exitCode;
   //printf("*** running: %s %s outDir:%s %s\n",diaExe.data(),diaArgs.data(),outDir,outFile);
-  portable_sysTimerStart();
-  if ((exitCode=portable_system(diaExe,diaArgs,FALSE))!=0)
+  Portable::sysTimerStart();
+  if ((exitCode=Portable::system(diaExe,diaArgs,FALSE))!=0)
   {
     err("Problems running %s. Check your installation or look typos in you dia file %s\n",
         diaExe.data(),inFile);
-    portable_sysTimerStop();
+    Portable::sysTimerStop();
     goto error;
   }
-  portable_sysTimerStop();
+  Portable::sysTimerStop();
   if ( (format==DIA_EPS) && (Config_getBool(USE_PDFLATEX)) )
   {
     QCString epstopdfArgs(maxCmdLine);
     epstopdfArgs.sprintf("\"%s.eps\" --outfile=\"%s.pdf\"",
                          outFile,outFile);
-    portable_sysTimerStart();
-    if (portable_system("epstopdf",epstopdfArgs)!=0)
+    Portable::sysTimerStart();
+    if (Portable::system("epstopdf",epstopdfArgs)!=0)
     {
       err("Problems running epstopdf. Check your TeX installation!\n");
     }
-    portable_sysTimerStop();
+    Portable::sysTimerStop();
   }
 
 error:
index 08b49ca..18817e9 100644 (file)
@@ -107,7 +107,7 @@ class DiagramRowIterator : public QListIterator<DiagramRow>
       : QListIterator<DiagramRow>(d) {}
 };
 
-/** Class represeting the tree layout for the built-in class diagram. */
+/** Class representing the tree layout for the built-in class diagram. */
 class TreeDiagram : public QList<DiagramRow>
 {
   public:
@@ -247,7 +247,7 @@ static void writeVectorBox(FTextStream &t,DiagramItem *di,
                            float x,float y,bool children=FALSE)
 {
   if (di->virtualness()==Virtual) t << "dashed\n";
-  t << " (" << di->label() << ") " << x << " " << y << " box\n";
+  t << " (" << convertToPSString(di->label()) << ") " << x << " " << y << " box\n";
   if (children) t << x << " " << y << " mark\n";
   if (di->virtualness()==Virtual) t << "solid\n";
 }
@@ -308,7 +308,7 @@ QCString DiagramItem::label() const
   QCString result;
   if (!templSpec.isEmpty())
   {
-    // we use classDef->name() here and not diplayName() in order
+    // we use classDef->name() here and not displayName() in order
     // to get the name used in the inheritance relation.
     QCString n = classDef->name();
     if (/*n.right(2)=="-g" ||*/ n.right(2)=="-p")
@@ -1101,8 +1101,7 @@ void ClassDiagram::writeFigure(FTextStream &output,const char *path,
   f1.setName(epsName.data());
   if (!f1.open(IO_WriteOnly))
   {
-    err("Could not open file %s for writing\n",f1.name().data());
-    exit(1);
+    term("Could not open file %s for writing\n",f1.name().data());
   }
   FTextStream t(&f1);
   
@@ -1297,7 +1296,7 @@ void ClassDiagram::writeFigure(FTextStream &output,const char *path,
     for (;(di=rit.current());++rit)
     {
       done=di->isInList();
-      t << "(" << di->label() << ") cw\n";
+      t << "(" << convertToPSString(di->label()) << ") cw\n";
     }
   }
   QListIterator<DiagramRow> sit(*super);
@@ -1310,7 +1309,7 @@ void ClassDiagram::writeFigure(FTextStream &output,const char *path,
     for (;(di=rit.current());++rit)
     {
       done=di->isInList();
-      t << "(" << di->label() << ") cw\n";
+      t << "(" << convertToPSString(di->label()) << ") cw\n";
     }
   }
 
@@ -1338,14 +1337,14 @@ void ClassDiagram::writeFigure(FTextStream &output,const char *path,
     epstopdfArgs.sprintf("\"%s.eps\" --outfile=\"%s.pdf\"",
                    epsBaseName.data(),epsBaseName.data());
     //printf("Converting eps using '%s'\n",epstopdfArgs.data());
-    portable_sysTimerStart();
-    if (portable_system("epstopdf",epstopdfArgs)!=0)
+    Portable::sysTimerStart();
+    if (Portable::system("epstopdf",epstopdfArgs)!=0)
     {
        err("Problems running epstopdf. Check your TeX installation!\n");
-       portable_sysTimerStop();
+       Portable::sysTimerStop();
        return;
     }
-    portable_sysTimerStop();
+    Portable::sysTimerStop();
   }
 }
 
index 5db8b99..ba792e1 100644 (file)
@@ -94,7 +94,7 @@ static int g_dirCount=0;
 DirDefImpl::DirDefImpl(const char *path) : DefinitionImpl(path,1,1,path)
 {
   bool fullPathNames = Config_getBool(FULL_PATH_NAMES);
-  // get display name (stipping the paths mentioned in STRIP_FROM_PATH)
+  // get display name (stripping the paths mentioned in STRIP_FROM_PATH)
   // get short name (last part of path)
   m_shortName = path;
   m_diskName = path;
index 7fe849a..fff9728 100644 (file)
@@ -233,7 +233,7 @@ void DocbookCodeGenerator::writeLineNumber(const char *ref,const char *fileName,
   {
     m_t << l << " ";
   }
-
+  m_col=0;
 }
 void DocbookCodeGenerator::setCurrentDoc(const Definition *,const char *,bool)
 {
@@ -260,7 +260,7 @@ void DocbookCodeGenerator::endCodeFragment()
 DocbookGenerator::DocbookGenerator() : OutputGenerator()
 {
 DB_GEN_C
-  dir=Config_getString(DOCBOOK_OUTPUT);
+  m_dir=Config_getString(DOCBOOK_OUTPUT);
   //insideTabbing=FALSE;
   //firstDescItem=TRUE;
   //disableLinks=FALSE;
@@ -289,8 +289,7 @@ void DocbookGenerator::init()
   QDir d(dir);
   if (!d.exists() && !d.mkdir(dir))
   {
-    err("Could not create output directory %s\n",dir.data());
-    exit(1);
+    term("Could not create output directory %s\n",dir.data());
   }
 
   createSubDirs(d);
@@ -918,7 +917,7 @@ DB_GEN_C
   t << "                <imagedata width=\"50%\" align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\"" 
                          << relPath << fileName << ".png\">" << "</imagedata>" << endl;
   t << "            </imageobject>" << endl;
-  d.writeImage(t,dir,relPath,fileName,FALSE);
+  d.writeImage(t,m_dir,relPath,fileName,FALSE);
   t << "        </mediaobject>" << endl;
   t << "    </informalfigure>" << endl;
   t << "</para>" << endl;
@@ -1109,7 +1108,7 @@ DB_GEN_C
 void DocbookGenerator::endGroupCollaboration(DotGroupCollaboration &g)
 {
 DB_GEN_C
-  g.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT),fileName,relPath,FALSE);
+  g.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT),m_fileName,relPath,FALSE);
 }
 void DocbookGenerator::startDotGraph()
 {
@@ -1118,7 +1117,7 @@ DB_GEN_C
 void DocbookGenerator::endDotGraph(DotClassGraph &g)
 {
 DB_GEN_C
-  g.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT),fileName,relPath,TRUE,FALSE);
+  g.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT),m_fileName,relPath,TRUE,FALSE);
 }
 void DocbookGenerator::startInclDepGraph()
 {
@@ -1127,7 +1126,7 @@ DB_GEN_C
 void DocbookGenerator::endInclDepGraph(DotInclDepGraph &g)
 {
 DB_GEN_C
-  QCString fn = g.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT), fileName,relPath,FALSE);
+  QCString fn = g.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT), m_fileName,relPath,FALSE);
 }
 void DocbookGenerator::startCallGraph()
 {
@@ -1136,7 +1135,7 @@ DB_GEN_C
 void DocbookGenerator::endCallGraph(DotCallGraph &g)
 {
 DB_GEN_C
-  QCString fn = g.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT), fileName,relPath,FALSE);
+  QCString fn = g.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT), m_fileName,relPath,FALSE);
 }
 void DocbookGenerator::startDirDepGraph()
 {
@@ -1145,7 +1144,7 @@ DB_GEN_C
 void DocbookGenerator::endDirDepGraph(DotDirDeps &g)
 {
 DB_GEN_C
-  QCString fn = g.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT), fileName,relPath,FALSE);
+  QCString fn = g.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT), m_fileName,relPath,FALSE);
 }
 void DocbookGenerator::startMemberDocList()
 {
index 8f71722..64e9e67 100644 (file)
@@ -104,12 +104,12 @@ class DocbookGenerator : public OutputGenerator
     // generic generator methods
     ///////////////////////////////////////////////////////////////
     void enable() 
-    { if (genStack->top()) active=*genStack->top(); else active=TRUE; }
-    void disable() { active=FALSE; }
+    { if (m_genStack->top()) m_active=*m_genStack->top(); else m_active=TRUE; }
+    void disable() { m_active=FALSE; }
     void enableIf(OutputType o)  { if (o==Docbook) enable();  }
     void disableIf(OutputType o) { if (o==Docbook) disable(); }
     void disableIfNot(OutputType o) { if (o!=Docbook) disable(); }
-    bool isEnabled(OutputType o) { return (o==Docbook && active); } 
+    bool isEnabled(OutputType o) { return (o==Docbook && m_active); } 
     OutputGenerator *get(OutputType o) { return (o==Docbook) ? this : 0; }
 
     // --- CodeOutputInterface
index a42a895..9de0a16 100644 (file)
@@ -36,6 +36,7 @@
 #include "htmlentity.h"
 #include "emoji.h"
 #include "plantuml.h"
+#include "growbuf.h"
 
 #if 0
 #define DB_VIS_C DB_VIS_C1(m_t)
 #define DB_VIS_C2a(x,y)
 #endif
 
+static QCString filterId(const char *s)
+{
+  static GrowBuf growBuf;
+  growBuf.clear();
+  if (s==0) return "";
+  const unsigned char *p=(const unsigned char *)s;
+  char c;
+  while ((c=*p++))
+  {
+    switch (c)
+    {
+      case ':':  growBuf.addStr("_1");   break;
+      default:   growBuf.addChar(c);       break;
+    }
+  }
+  growBuf.addChar(0);
+  return growBuf.get();
+}
+
 void DocbookDocVisitor::visitCaption(const QList<DocNode> &children)
 {
   QListIterator<DocNode> cli(children);
@@ -262,6 +282,7 @@ DB_VIS_C
       /* There is no equivalent Docbook tag for rendering Small text */
     case DocStyleChange::Small: /* XSLT Stylesheets can be used */ break;
                                                                    /* HTML only */
+    case DocStyleChange::S:  break;
     case DocStyleChange::Strike:  break;
     case DocStyleChange::Del:        break;
     case DocStyleChange::Underline:  break;
@@ -280,8 +301,8 @@ DB_VIS_C
   {
     case DocVerbatim::Code: // fall though
       m_t << "<literallayout><computeroutput>";
-      Doxygen::parserManager->getParser(m_langExt)
-        ->parseCode(m_ci,s->context(),s->text(),langExt,
+      Doxygen::parserManager->getCodeParser(m_langExt)
+         .parseCode(m_ci,s->context(),s->text(),langExt,
             s->isExample(),s->exampleFile());
       m_t << "</computeroutput></literallayout>";
       break;
@@ -374,7 +395,7 @@ void DocbookDocVisitor::visit(DocAnchor *anc)
 {
 DB_VIS_C
   if (m_hide) return;
-  m_t << "<anchor xml:id=\"_" <<  stripPath(anc->file()) << "_1" << anc->anchor() << "\"/>";
+  m_t << "<anchor xml:id=\"_" <<  stripPath(anc->file()) << "_1" << filterId(anc->anchor()) << "\"/>";
 }
 
 void DocbookDocVisitor::visit(DocInclude *inc)
@@ -389,8 +410,8 @@ DB_VIS_C
         m_t << "<literallayout><computeroutput>";
         QFileInfo cfi( inc->file() );
         FileDef *fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
-        Doxygen::parserManager->getParser(inc->extension())
-          ->parseCode(m_ci,inc->context(),
+        Doxygen::parserManager->getCodeParser(inc->extension())
+           .parseCode(m_ci,inc->context(),
               inc->text(),
               langExt,
               inc->isExample(),
@@ -401,8 +422,8 @@ DB_VIS_C
       break;
     case DocInclude::Include:
       m_t << "<literallayout><computeroutput>";
-      Doxygen::parserManager->getParser(inc->extension())
-        ->parseCode(m_ci,inc->context(),
+      Doxygen::parserManager->getCodeParser(inc->extension())
+         .parseCode(m_ci,inc->context(),
             inc->text(),
             langExt,
             inc->isExample(),
@@ -421,8 +442,8 @@ DB_VIS_C
       break;
     case DocInclude::Snippet:
       m_t << "<literallayout><computeroutput>";
-      Doxygen::parserManager->getParser(inc->extension())
-        ->parseCode(m_ci,
+      Doxygen::parserManager->getCodeParser(inc->extension())
+         .parseCode(m_ci,
             inc->context(),
             extractBlock(inc->text(),inc->blockId()),
             langExt,
@@ -436,8 +457,8 @@ DB_VIS_C
          QFileInfo cfi( inc->file() );
          FileDef *fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
          m_t << "<literallayout><computeroutput>";
-         Doxygen::parserManager->getParser(inc->extension())
-                               ->parseCode(m_ci,
+         Doxygen::parserManager->getCodeParser(inc->extension())
+                                .parseCode(m_ci,
                                            inc->context(),
                                            extractBlock(inc->text(),inc->blockId()),
                                            langExt,
@@ -489,8 +510,8 @@ DB_VIS_C
         fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
       }
 
-      Doxygen::parserManager->getParser(locLangExt)
-        ->parseCode(m_ci,op->context(),
+      Doxygen::parserManager->getCodeParser(locLangExt)
+         .parseCode(m_ci,op->context(),
             op->text(),langExt,op->isExample(),
             op->exampleFile(),
             fd,     // fileDef
@@ -550,7 +571,7 @@ void DocbookDocVisitor::visit(DocCite *cite)
 {
 DB_VIS_C
   if (m_hide) return;
-  if (!cite->file().isEmpty()) startLink(cite->file(),cite->anchor());
+  if (!cite->file().isEmpty()) startLink(cite->file(),filterId(cite->anchor()));
   filter(cite->text());
   if (!cite->file().isEmpty()) endLink();
 }
@@ -1105,6 +1126,10 @@ DB_VIS_C
     {
       // just skip it
     }
+    else if (opt->name=="nowrap" && opt->value.isEmpty())
+    {
+      m_t << " " << opt->name << "='nowrap'";
+    }
     else
     {
       m_t << " " << opt->name << "='" << opt->value << "'";
index 1f4fb6d..fbdb842 100644 (file)
@@ -1,3 +1,18 @@
+/******************************************************************************
+ *
+ * Copyright (C) 1997-2019 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby 
+ * granted. No representations are made about the suitability of this software 
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ * Documents produced by Doxygen are derivative works derived from the
+ * input used in their production; they are not affected by this license.
+ *
+ */
+
 #include "doxygen.h"
 #include "util.h"
 #include "entry.h"
@@ -8,7 +23,6 @@
 void DocGroup::enterFile(const char *fileName,int)
 {
   m_openCount = 0;
-  m_autoGroupStack.setAutoDelete(TRUE);
   m_autoGroupStack.clear();
   m_memberGroupId = DOX_NOGROUP;
   m_memberGroupDocs.resize(0);
@@ -25,7 +39,7 @@ void DocGroup::leaveFile(const char *fileName,int line)
   m_memberGroupId=DOX_NOGROUP;
   m_memberGroupRelates.resize(0);
   m_memberGroupDocs.resize(0);
-  if (!m_autoGroupStack.isEmpty())
+  if (!m_autoGroupStack.empty())
   {
     warn(fileName,line,"end of file while inside a group");
   }
@@ -94,10 +108,10 @@ void DocGroup::open(Entry *e,const char *,int, bool implicit)
 {
   if (!implicit) m_openCount++;
   //printf("==> openGroup(name=%s,sec=%x) m_autoGroupStack=%d\n",
-  //   e->name.data(),e->section,m_autoGroupStack.count());
+  //   e->name.data(),e->section,m_autoGroupStack.size());
   if (e->section==Entry::GROUPDOC_SEC) // auto group
   {
-    m_autoGroupStack.push(new Grouping(e->name,e->groupingPri()));
+    m_autoGroupStack.push_back(Grouping(e->name,e->groupingPri()));
   }
   else // start of a member group
   {
@@ -133,7 +147,7 @@ void DocGroup::close(Entry *e,const char *fileName,int line,bool foundInline,boo
     }
   }
   //printf("==> closeGroup(name=%s,sec=%x,file=%s,line=%d) m_autoGroupStack=%d\n",
-  //    e->name.data(),e->section,fileName,line,m_autoGroupStack.count());
+  //    e->name.data(),e->section,fileName,line,m_autoGroupStack.size());
   if (m_memberGroupId!=DOX_NOGROUP) // end of member group
   {
     MemberGroupInfo *info=Doxygen::memGrpInfoDict.find(m_memberGroupId);
@@ -149,13 +163,13 @@ void DocGroup::close(Entry *e,const char *fileName,int line,bool foundInline,boo
     if (!foundInline) e->mGrpId=DOX_NOGROUP;
     //printf("new group id=%d\n",m_memberGroupId);
   }
-  else if (!m_autoGroupStack.isEmpty()) // end of auto group
+  else if (!m_autoGroupStack.empty()) // end of auto group
   {
-    Grouping *grp = m_autoGroupStack.pop();
+    Grouping grp = m_autoGroupStack.back();
+    m_autoGroupStack.pop_back();
     // see bug577005: we should not remove the last group for e
-    if (!foundInline) e->groups->removeLast();
+    if (!foundInline && !e->groups.empty()) e->groups.pop_back();
     //printf("Removing %s e=%p\n",grp->groupname.data(),e);
-    delete grp;
     if (!foundInline) initGroupInfo(e);
   }
 }
@@ -166,12 +180,12 @@ void DocGroup::initGroupInfo(Entry *e)
   //       m_memberGroupRelates.data(),e);
   e->mGrpId     = m_memberGroupId;
   e->relates    = m_memberGroupRelates;
-  if (!m_autoGroupStack.isEmpty())
+  if (!m_autoGroupStack.empty())
   {
     //printf("Appending group %s to %s: count=%d entry=%p\n",
     // m_autoGroupStack.top()->groupname.data(),
     // e->name.data(),e->groups->count(),e);
-    e->groups->append(new Grouping(*m_autoGroupStack.top()));
+    e->groups.push_back(Grouping(m_autoGroupStack.back()));
   }
 }
 
index 4775d90..3ccef0d 100644 (file)
@@ -16,7 +16,7 @@
 #ifndef DOCGROUP_H
 #define DOCGROUP_H
 
-#include <qstack.h>
+#include <vector>
 #include <qstring.h>
 #include "membergroup.h"
 
@@ -42,12 +42,12 @@ class DocGroup
 
   private:
     int findExistingGroup(int &groupId,const MemberGroupInfo *info);
-    int              m_openCount;
+    int              m_openCount = 0;
     QCString         m_memberGroupHeader;
-    int              m_memberGroupId;
+    int              m_memberGroupId = 0;
     QCString         m_memberGroupRelates;
     QCString         m_memberGroupDocs;
-    QStack<Grouping> m_autoGroupStack;
+    std::vector<Grouping> m_autoGroupStack;
     QCString         m_compoundName;
 };
 
index 9dd1c71..5498adb 100644 (file)
@@ -285,10 +285,19 @@ static QCString findAndCopyImage(const char *fileName,DocImage::Type type, bool
 {
   QCString result;
   bool ambig;
-  FileDef *fd;
+  FileDef *fd = findFileDef(Doxygen::imageNameDict,fileName,ambig);
   //printf("Search for %s\n",fileName);
-  if ((fd=findFileDef(Doxygen::imageNameDict,fileName,ambig)) && !ambig)
+  if (fd)
   {
+    if (ambig & dowarn)
+    {
+      QCString text;
+      text.sprintf("image file name %s is ambiguous.\n",qPrint(fileName));
+      text+="Possible candidates:\n";
+      text+=showFileDefMatches(Doxygen::imageNameDict,fileName);
+      warn_doc_error(g_fileName,doctokenizerYYlineno,text);
+    }
+
     QCString inputFile = fd->absFilePath();
     QFile inImage(inputFile);
     if (inImage.open(IO_ReadOnly))
@@ -369,26 +378,15 @@ static QCString findAndCopyImage(const char *fileName,DocImage::Type type, bool
       epstopdfArgs.sprintf("\"%s/%s.eps\" --outfile=\"%s/%s.pdf\"",
                            outputDir.data(), baseName.data(),
                           outputDir.data(), baseName.data());
-      portable_sysTimerStart();
-      if (portable_system("epstopdf",epstopdfArgs)!=0)
+      Portable::sysTimerStart();
+      if (Portable::system("epstopdf",epstopdfArgs)!=0)
       {
        err("Problems running epstopdf. Check your TeX installation!\n");
       }
-      portable_sysTimerStop();
+      Portable::sysTimerStop();
       return baseName;
     }
   }
-  else if (ambig)
-  {
-    if (dowarn)
-    {
-      QCString text;
-      text.sprintf("image file name %s is ambiguous.\n",qPrint(fileName));
-      text+="Possible candidates:\n";
-      text+=showFileDefMatches(Doxygen::imageNameDict,fileName);
-      warn_doc_error(g_fileName,doctokenizerYYlineno,text);
-    }
-  }
   else
   {
     result=fileName;
@@ -413,12 +411,12 @@ static void checkArgumentName(const QCString &name)
 {                
   if (!Config_getBool(WARN_IF_DOC_ERROR)) return;
   if (g_memberDef==0) return; // not a member
-  const ArgumentList *al=g_memberDef->isDocsForDefinition() ?
+  const ArgumentList &al=g_memberDef->isDocsForDefinition() ?
                         g_memberDef->argumentList() :
                          g_memberDef->declArgumentList();
   SrcLangExt lang = g_memberDef->getLanguage();
   //printf("isDocsForDefinition()=%d\n",g_memberDef->isDocsForDefinition());
-  if (al==0) return; // no argument list
+  if (al.empty()) return; // no argument list
 
   static QRegExp re("$?[a-zA-Z0-9_\\x80-\\xFF]+\\.*");
   int p=0,i=0,l;
@@ -427,12 +425,10 @@ static void checkArgumentName(const QCString &name)
     QCString aName=name.mid(i,l);
     if (lang==SrcLangExt_Fortran) aName=aName.lower();
     //printf("aName='%s'\n",aName.data());
-    ArgumentListIterator ali(*al);
-    const Argument *a;
     bool found=FALSE;
-    for (ali.toFirst();(a=ali.current());++ali)
+    for (const Argument &a : al)
     {
-      QCString argName = g_memberDef->isDefine() ? a->type : a->name;
+      QCString argName = g_memberDef->isDefine() ? a.type : a.name;
       if (lang==SrcLangExt_Fortran) argName=argName.lower();
       argName=argName.stripWhiteSpace();
       //printf("argName='%s' aName=%s\n",argName.data(),aName.data());
@@ -460,7 +456,6 @@ static void checkArgumentName(const QCString &name)
             inheritedMd->docLine(),qPrint(inheritedMd->docFile()));
         docFile = g_memberDef->getDefFileName();
         docLine = g_memberDef->getDefLine();
-        
       }
       QCString alStr = argListToString(al);
       warn_doc_error(docFile,docLine,
@@ -500,30 +495,28 @@ static void checkUnOrMultipleDocumentedParams()
 {
   if (g_memberDef && g_hasParamCommand && Config_getBool(WARN_IF_DOC_ERROR))
   {
-    const ArgumentList *al=g_memberDef->isDocsForDefinition() ? 
+    const ArgumentList &al=g_memberDef->isDocsForDefinition() ?
       g_memberDef->argumentList() :
       g_memberDef->declArgumentList();
     SrcLangExt lang = g_memberDef->getLanguage();
-    if (al!=0)
+    if (!al.empty())
     {
-      ArgumentListIterator ali(*al);
-      const Argument *a;
-      bool found=FALSE;
-      for (ali.toFirst();(a=ali.current());++ali)
+      int notArgCnt=0;
+      for (const Argument &a: al)
       {
         int count = 0;
-        QCString argName = g_memberDef->isDefine() ? a->type : a->name;
+        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 (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()) 
+        else if (!argName.isEmpty() && g_paramsFound.find(argName)==0 && a.docs.isEmpty()) 
         {
-          found = TRUE;
+          notArgCnt++;
         }
         else
         {
@@ -544,24 +537,26 @@ static void checkUnOrMultipleDocumentedParams()
                          " has multiple @param documentation sections");
         }
       }
-      if (found)
+      if (notArgCnt>0)
       {
         bool first=TRUE;
         QCString errMsg=
-            "The following parameters of "+
+            "The following parameter";
+        errMsg+= (notArgCnt>1 ? "s" : "");
+        errMsg+=" of "+
             QCString(g_memberDef->qualifiedName()) + 
             QCString(argListToString(al)) +
-            " are not documented:\n";
-        for (ali.toFirst();(a=ali.current());++ali)
+            (notArgCnt>1 ? " are" : " is") + " not documented:\n";
+        for (const Argument &a : al)
         {
-          QCString argName = g_memberDef->isDefine() ? a->type : a->name;
+          QCString argName = g_memberDef->isDefine() ? a.type : a.name;
           if (lang==SrcLangExt_Fortran) argName = argName.lower();
           argName=argName.stripWhiteSpace();
           if (lang==SrcLangExt_Python && (argName=="self" || argName=="cls"))
-          { 
+          {
             // allow undocumented self / cls parameter for Python
           }
-          else if (!argName.isEmpty() && g_paramsFound.find(argName)==0) 
+          else if (!argName.isEmpty() && g_paramsFound.find(argName)==0)
           {
             if (!first)
             {
@@ -806,14 +801,15 @@ static bool findDocsForMemberOrCompound(const char *commandName,
 inline void errorHandleDefaultToken(DocNode *parent,int tok,
                                QList<DocNode> &children,const char *txt)
 {
+  const char *cmd_start = "\\";
   switch (tok)
   {
     case TK_COMMAND_AT:
-        // fall through
+      cmd_start = "@";
     case TK_COMMAND_BS:
       children.append(new DocWord(parent,TK_COMMAND_CHAR(tok) + g_token->name));
       warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s as part of a %s",
-       qPrint(TK_COMMAND_CHAR(tok) + g_token->name), txt);
+       qPrint(cmd_start + g_token->name),txt);
       break;
     case TK_SYMBOL:
       warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found found as part of a %s",
@@ -886,10 +882,10 @@ static int handleStyleArgument(DocNode *parent,QList<DocNode> &children,
  *  encountered.
  */
 static void handleStyleEnter(DocNode *parent,QList<DocNode> &children,
-          DocStyleChange::Style s,const HtmlAttribList *attribs)
+          DocStyleChange::Style s,const QCString &tagName,const HtmlAttribList *attribs)
 {
   DBG(("HandleStyleEnter\n"));
-  DocStyleChange *sc= new DocStyleChange(parent,g_nodeStack.count(),s,TRUE,attribs);
+  DocStyleChange *sc= new DocStyleChange(parent,g_nodeStack.count(),s,tagName,TRUE,attribs);
   children.append(sc);
   g_styleStack.push(sc);
 }
@@ -901,8 +897,10 @@ static void handleStyleLeave(DocNode *parent,QList<DocNode> &children,
          DocStyleChange::Style s,const char *tagName)
 {
   DBG(("HandleStyleLeave\n"));
+  QCString tagNameLower = QCString(tagName).lower();
   if (g_styleStack.isEmpty() ||                           // no style change
       g_styleStack.top()->style()!=s ||                   // wrong style change
+      g_styleStack.top()->tagName()!=tagNameLower ||      // wrong style change
       g_styleStack.top()->position()!=g_nodeStack.count() // wrong position
      )
   {
@@ -911,10 +909,15 @@ static void handleStyleLeave(DocNode *parent,QList<DocNode> &children,
       warn_doc_error(g_fileName,doctokenizerYYlineno,"found </%s> tag without matching <%s>",
           qPrint(tagName),qPrint(tagName));
     }
+    else if (g_styleStack.top()->tagName()!=tagNameLower)
+    {
+      warn_doc_error(g_fileName,doctokenizerYYlineno,"found </%s> tag while expecting </%s>",
+          qPrint(tagName),qPrint(g_styleStack.top()->tagName()));
+    }
     else if (g_styleStack.top()->style()!=s)
     {
       warn_doc_error(g_fileName,doctokenizerYYlineno,"found </%s> tag while expecting </%s>",
-          qPrint(tagName),qPrint(g_styleStack.top()->styleString()));
+          qPrint(tagName),qPrint(g_styleStack.top()->tagName()));
     }
     else
     {
@@ -924,7 +927,7 @@ static void handleStyleLeave(DocNode *parent,QList<DocNode> &children,
   }
   else // end the section
   {
-    DocStyleChange *sc= new DocStyleChange(parent,g_nodeStack.count(),s,FALSE);
+    DocStyleChange *sc= new DocStyleChange(parent,g_nodeStack.count(),s,g_styleStack.top()->tagName(),FALSE);
     children.append(sc);
     g_styleStack.pop();
   }
@@ -941,7 +944,7 @@ static void handlePendingStyleCommands(DocNode *parent,QList<DocNode> &children)
     DocStyleChange *sc = g_styleStack.top();
     while (sc && sc->position()>=g_nodeStack.count()) 
     { // there are unclosed style modifiers in the paragraph
-      children.append(new DocStyleChange(parent,g_nodeStack.count(),sc->style(),FALSE));
+      children.append(new DocStyleChange(parent,g_nodeStack.count(),sc->style(),sc->tagName(),FALSE));
       g_initialStyleStack.push(sc);
       g_styleStack.pop();
       sc = g_styleStack.top();
@@ -954,7 +957,7 @@ static void handleInitialStyleCommands(DocPara *parent,QList<DocNode> &children)
   DocStyleChange *sc;
   while ((sc=g_initialStyleStack.pop()))
   {
-    handleStyleEnter(parent,children,sc->style(),&sc->attribs());
+    handleStyleEnter(parent,children,sc->style(),sc->tagName(),&sc->attribs());
   }
 }
 
@@ -966,7 +969,7 @@ static int handleAHref(DocNode *parent,QList<DocNode> &children,const HtmlAttrib
   int retval = RetVal_OK;
   for (li.toFirst();(opt=li.current());++li,++index)
   {
-    if (opt->name=="name") // <a name=label> tag
+    if (opt->name=="name" || opt->name=="id") // <a name=label> or <a id=label> tag
     {
       if (!opt->value.isEmpty())
       {
@@ -1020,6 +1023,7 @@ const char *DocStyleChange::styleString() const
     case DocStyleChange::Div:          return "div";
     case DocStyleChange::Span:         return "span";
     case DocStyleChange::Strike:       return "strike";
+    case DocStyleChange::S:            return "s";
     case DocStyleChange::Del:          return "del";
     case DocStyleChange::Underline:    return "u";
     case DocStyleChange::Ins:          return "ins";
@@ -1036,7 +1040,7 @@ static void handleUnclosedStyleCommands()
     handleUnclosedStyleCommands();
     warn_doc_error(g_fileName,doctokenizerYYlineno,
              "end of comment block while expecting "
-             "command </%s>",qPrint(sc->styleString()));
+             "command </%s>",qPrint(sc->tagName()));
   }
 }
 
@@ -1171,7 +1175,7 @@ static void handleParameterType(DocNode *parent,QList<DocNode> &children,const Q
 {
   QCString name = g_token->name; // save token name
   QCString name1;
-  int p=0,i,l,ii;
+  int p=0,i,ii;
   while ((i=paramTypes.find('|',p))!=-1)
   {
     name1 = paramTypes.mid(p,i-p);
@@ -1392,9 +1396,9 @@ reparsetoken:
           break;
         case CMD_EMPHASIS:
           {
-            children.append(new DocStyleChange(parent,g_nodeStack.count(),DocStyleChange::Italic,TRUE));
+            children.append(new DocStyleChange(parent,g_nodeStack.count(),DocStyleChange::Italic,tokenName,TRUE));
             tok=handleStyleArgument(parent,children,tokenName);
-            children.append(new DocStyleChange(parent,g_nodeStack.count(),DocStyleChange::Italic,FALSE));
+            children.append(new DocStyleChange(parent,g_nodeStack.count(),DocStyleChange::Italic,tokenName,FALSE));
             if (tok!=TK_WORD) children.append(new DocWhiteSpace(parent," "));
             if (tok==TK_NEWPARA) goto handlepara;
             else if (tok==TK_WORD || tok==TK_HTMLTAG) 
@@ -1406,9 +1410,9 @@ reparsetoken:
           break;
         case CMD_BOLD:
           {
-            children.append(new DocStyleChange(parent,g_nodeStack.count(),DocStyleChange::Bold,TRUE));
+            children.append(new DocStyleChange(parent,g_nodeStack.count(),DocStyleChange::Bold,tokenName,TRUE));
             tok=handleStyleArgument(parent,children,tokenName);
-            children.append(new DocStyleChange(parent,g_nodeStack.count(),DocStyleChange::Bold,FALSE));
+            children.append(new DocStyleChange(parent,g_nodeStack.count(),DocStyleChange::Bold,tokenName,FALSE));
             if (tok!=TK_WORD) children.append(new DocWhiteSpace(parent," "));
             if (tok==TK_NEWPARA) goto handlepara;
             else if (tok==TK_WORD || tok==TK_HTMLTAG) 
@@ -1420,9 +1424,9 @@ reparsetoken:
           break;
         case CMD_CODE:
           {
-            children.append(new DocStyleChange(parent,g_nodeStack.count(),DocStyleChange::Code,TRUE));
+            children.append(new DocStyleChange(parent,g_nodeStack.count(),DocStyleChange::Code,tokenName,TRUE));
             tok=handleStyleArgument(parent,children,tokenName);
-            children.append(new DocStyleChange(parent,g_nodeStack.count(),DocStyleChange::Code,FALSE));
+            children.append(new DocStyleChange(parent,g_nodeStack.count(),DocStyleChange::Code,tokenName,FALSE));
             if (tok!=TK_WORD) children.append(new DocWhiteSpace(parent," "));
             if (tok==TK_NEWPARA) goto handlepara;
             else if (tok==TK_WORD || tok==TK_HTMLTAG) 
@@ -1543,17 +1547,26 @@ reparsetoken:
           case HTML_BOLD:
             if (!g_token->endTag)
             {
-              handleStyleEnter(parent,children,DocStyleChange::Bold,&g_token->attribs);
+              handleStyleEnter(parent,children,DocStyleChange::Bold,tokenName,&g_token->attribs);
             }
             else
             {
               handleStyleLeave(parent,children,DocStyleChange::Bold,tokenName);
             }
             break;
+          case HTML_S:
+            if (!g_token->endTag)
+            {
+              handleStyleEnter(parent,children,DocStyleChange::S,tokenName,&g_token->attribs);
+            }
+            else
+            {
+              handleStyleLeave(parent,children,DocStyleChange::S,tokenName);
+            }
           case HTML_STRIKE:
             if (!g_token->endTag)
             {
-              handleStyleEnter(parent,children,DocStyleChange::Strike,&g_token->attribs);
+              handleStyleEnter(parent,children,DocStyleChange::Strike,tokenName,&g_token->attribs);
             }
             else
             {
@@ -1563,7 +1576,7 @@ reparsetoken:
           case HTML_DEL:
             if (!g_token->endTag)
             {
-              handleStyleEnter(parent,children,DocStyleChange::Del,&g_token->attribs);
+              handleStyleEnter(parent,children,DocStyleChange::Del,tokenName,&g_token->attribs);
             }
             else
             {
@@ -1573,7 +1586,7 @@ reparsetoken:
           case HTML_UNDERLINE:
             if (!g_token->endTag)
             {
-              handleStyleEnter(parent,children,DocStyleChange::Underline,&g_token->attribs);
+              handleStyleEnter(parent,children,DocStyleChange::Underline,tokenName,&g_token->attribs);
             }
             else
             {
@@ -1583,7 +1596,7 @@ reparsetoken:
           case HTML_INS:
             if (!g_token->endTag)
             {
-              handleStyleEnter(parent,children,DocStyleChange::Ins,&g_token->attribs);
+              handleStyleEnter(parent,children,DocStyleChange::Ins,tokenName,&g_token->attribs);
             }
             else
             {
@@ -1594,7 +1607,7 @@ reparsetoken:
           case XML_C:
             if (!g_token->endTag)
             {
-              handleStyleEnter(parent,children,DocStyleChange::Code,&g_token->attribs);
+              handleStyleEnter(parent,children,DocStyleChange::Code,tokenName,&g_token->attribs);
             }
             else
             {
@@ -1604,7 +1617,7 @@ reparsetoken:
           case HTML_EMPHASIS:
             if (!g_token->endTag)
             {
-              handleStyleEnter(parent,children,DocStyleChange::Italic,&g_token->attribs);
+              handleStyleEnter(parent,children,DocStyleChange::Italic,tokenName,&g_token->attribs);
             }
             else
             {
@@ -1614,7 +1627,7 @@ reparsetoken:
           case HTML_SUB:
             if (!g_token->endTag)
             {
-              handleStyleEnter(parent,children,DocStyleChange::Subscript,&g_token->attribs);
+              handleStyleEnter(parent,children,DocStyleChange::Subscript,tokenName,&g_token->attribs);
             }
             else
             {
@@ -1624,7 +1637,7 @@ reparsetoken:
           case HTML_SUP:
             if (!g_token->endTag)
             {
-              handleStyleEnter(parent,children,DocStyleChange::Superscript,&g_token->attribs);
+              handleStyleEnter(parent,children,DocStyleChange::Superscript,tokenName,&g_token->attribs);
             }
             else
             {
@@ -1634,7 +1647,7 @@ reparsetoken:
           case HTML_CENTER:
             if (!g_token->endTag)
             {
-              handleStyleEnter(parent,children,DocStyleChange::Center,&g_token->attribs);
+              handleStyleEnter(parent,children,DocStyleChange::Center,tokenName,&g_token->attribs);
             }
             else
             {
@@ -1644,7 +1657,7 @@ reparsetoken:
           case HTML_SMALL:
             if (!g_token->endTag)
             {
-              handleStyleEnter(parent,children,DocStyleChange::Small,&g_token->attribs);
+              handleStyleEnter(parent,children,DocStyleChange::Small,tokenName,&g_token->attribs);
             }
             else
             {
@@ -1820,7 +1833,7 @@ static int internalValidatingParseDoc(DocNode *parent,QList<DocNode> &children,
 
 static void readTextFileByName(const QCString &file,QCString &text)
 {
-  if (portable_isAbsolutePath(file.data()))
+  if (Portable::isAbsolutePath(file.data()))
   {
     QFileInfo fi(file);
     if (fi.exists())
@@ -1833,7 +1846,7 @@ static void readTextFileByName(const QCString &file,QCString &text)
   char *s=examplePathList.first();
   while (s)
   {
-    QCString absFileName = QCString(s)+portable_pathSeparator()+file;
+    QCString absFileName = QCString(s)+Portable::pathSeparator()+file;
     QFileInfo fi(absFileName);
     if (fi.exists())
     {
@@ -1845,17 +1858,17 @@ static void readTextFileByName(const QCString &file,QCString &text)
 
   // as a fallback we also look in the exampleNameDict
   bool ambig;
-  FileDef *fd;
-  if ((fd=findFileDef(Doxygen::exampleNameDict,file,ambig)) && !ambig)
+  FileDef *fd = findFileDef(Doxygen::exampleNameDict,file,ambig);
+  if (fd)
   {
     text = fileToString(fd->absFilePath(),Config_getBool(FILTER_SOURCE_FILES));
-  }
-  else if (ambig)
-  {
-    warn_doc_error(g_fileName,doctokenizerYYlineno,"included file name %s is ambiguous"
+    if (ambig)
+    {
+      warn_doc_error(g_fileName,doctokenizerYYlineno,"included file name %s is ambiguous"
            "Possible candidates:\n%s",qPrint(file),
            qPrint(showFileDefMatches(Doxygen::exampleNameDict,file))
           );
+    }
   }
   else
   {
@@ -2210,7 +2223,7 @@ DocFormula::DocFormula(DocNode *parent,int id) :
 {
   m_parent = parent; 
   QCString formCmd;
-  formCmd.sprintf("\\form#%d",id);
+  formCmd.sprintf("\\_form#%d",id);
   Formula *formula=Doxygen::formulaNameDict->find(formCmd);
   if (formula)
   {
@@ -2218,7 +2231,7 @@ DocFormula::DocFormula(DocNode *parent,int id) :
     m_name.sprintf("form_%d",m_id);
     m_text = formula->getFormulaText();
   }
-  else // wrong \form#<n> command
+  else // wrong \_form#<n> command
   {
     warn_doc_error(g_fileName,doctokenizerYYlineno,"Wrong formula id %d",id);
     m_id = -1;
@@ -2315,6 +2328,7 @@ void DocSecRefList::parse()
   {
     if (tok==TK_COMMAND_AT || tok == TK_COMMAND_BS)
     {
+      const char *cmd_start = (tok==TK_COMMAND_AT ? "@" : "\\");
       switch (Mappers::cmdMapper->map(g_token->name))
       {
         case CMD_SECREFITEM:
@@ -2342,7 +2356,7 @@ void DocSecRefList::parse()
           goto endsecreflist;
         default:
           warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s as part of a \\secreflist",
-              qPrint(g_token->name));
+              qPrint(cmd_start + g_token->name));
           goto endsecreflist;
       }
     }
@@ -2649,9 +2663,11 @@ QCString DocLink::parse(bool isJavaLink,bool isXmlLink)
   {
     if (!defaultHandleToken(this,tok,m_children,FALSE))
     {
+      const char *cmd_start = "\\";
       switch (tok)
       {
         case TK_COMMAND_AT:
+          cmd_start = "@";
         // fall through
         case TK_COMMAND_BS:
           switch (Mappers::cmdMapper->map(g_token->name))
@@ -2664,7 +2680,7 @@ QCString DocLink::parse(bool isJavaLink,bool isXmlLink)
               goto endlink;
             default:
               warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s as part of a \\link",
-                  qPrint(g_token->name));
+                  qPrint(cmd_start + g_token->name));
               break;
           }
           break;
@@ -2748,17 +2764,17 @@ bool DocDotFile::parse()
   {
     fd = findFileDef(Doxygen::dotFileNameDict,m_name+".dot",ambig);
   }
-  if (fd && !ambig)
+  if (fd)
   {
     m_file = fd->absFilePath();
     ok = true;
-  }
-  else if (ambig)
-  {
-    warn_doc_error(g_fileName,doctokenizerYYlineno,"included dot file name %s is ambiguous.\n"
+    if (ambig)
+    {
+      warn_doc_error(g_fileName,doctokenizerYYlineno,"included dot file name %s is ambiguous.\n"
            "Possible candidates:\n%s",qPrint(m_name),
            qPrint(showFileDefMatches(Doxygen::dotFileNameDict,m_name))
           );
+    }
   }
   else
   {
@@ -2785,17 +2801,17 @@ bool DocMscFile::parse()
   {
     fd = findFileDef(Doxygen::mscFileNameDict,m_name+".msc",ambig);
   }
-  if (fd && !ambig)
+  if (fd)
   {
     m_file = fd->absFilePath();
     ok = true;
-  }
-  else if (ambig)
-  {
-    warn_doc_error(g_fileName,doctokenizerYYlineno,"included msc file name %s is ambiguous.\n"
+    if (ambig)
+    {
+      warn_doc_error(g_fileName,doctokenizerYYlineno,"included msc file name %s is ambiguous.\n"
            "Possible candidates:\n%s",qPrint(m_name),
            qPrint(showFileDefMatches(Doxygen::mscFileNameDict,m_name))
           );
+    }
   }
   else
   {
@@ -2824,17 +2840,17 @@ bool DocDiaFile::parse()
   {
     fd = findFileDef(Doxygen::diaFileNameDict,m_name+".dia",ambig);
   }
-  if (fd && !ambig)
+  if (fd)
   {
     m_file = fd->absFilePath();
     ok = true;
-  }
-  else if (ambig)
-  {
-    warn_doc_error(g_fileName,doctokenizerYYlineno,"included dia file name %s is ambiguous.\n"
+    if (ambig)
+    {
+      warn_doc_error(g_fileName,doctokenizerYYlineno,"included dia file name %s is ambiguous.\n"
            "Possible candidates:\n%s",qPrint(m_name),
            qPrint(showFileDefMatches(Doxygen::diaFileNameDict,m_name))
           );
+    }
   }
   else
   {
@@ -2893,7 +2909,7 @@ bool DocImage::isSVG() const
   QCString  locName = m_url.isEmpty() ? m_name : m_url;
   int len = locName.length();
   int fnd = locName.find('?'); // ignore part from ? until end
-  if (fnd!=-1) fnd=len;
+  if (fnd==-1) fnd=len;
   return fnd>=4 && locName.mid(fnd-4,4)==".svg";
 }
 
@@ -3796,9 +3812,11 @@ int DocHtmlDescTitle::parse()
   {
     if (!defaultHandleToken(this,tok,m_children))
     {
+      const char *cmd_start = "\\";
       switch (tok)
       {
         case TK_COMMAND_AT:
+          cmd_start = "@";
         // fall through
         case TK_COMMAND_BS:
           {
@@ -3869,8 +3887,8 @@ int DocHtmlDescTitle::parse()
 
                 break;
               default:
-                warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command \\%s found as part of a <dt> tag",
-                               qPrint(g_token->name));
+                warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s found as part of a <dt> tag",
+                  qPrint(cmd_start + g_token->name));
             }
           }
           break;
@@ -4565,7 +4583,7 @@ void DocSimpleSect::appendLinkWord(const QCString &word)
   {
     p = (DocPara *)m_children.getLast();
     
-    // Comma-seperate <seealso> links.
+    // Comma-separate <seealso> links.
     p->injectToken(TK_WORD,",");
     p->injectToken(TK_WHITESPACE," ");
   }
@@ -5385,21 +5403,21 @@ int DocPara::handleCommand(const QCString &cmdName, const int tok)
       warn_doc_error(g_fileName,doctokenizerYYlineno,"Found unknown command '\\%s'",qPrint(cmdName));
       break;
     case CMD_EMPHASIS:
-      m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Italic,TRUE));
+      m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Italic,cmdName,TRUE));
       retval=handleStyleArgument(this,m_children,cmdName); 
-      m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Italic,FALSE));
+      m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Italic,cmdName,FALSE));
       if (retval!=TK_WORD) m_children.append(new DocWhiteSpace(this," "));
       break;
     case CMD_BOLD:
-      m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Bold,TRUE));
+      m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Bold,cmdName,TRUE));
       retval=handleStyleArgument(this,m_children,cmdName); 
-      m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Bold,FALSE));
+      m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Bold,cmdName,FALSE));
       if (retval!=TK_WORD) m_children.append(new DocWhiteSpace(this," "));
       break;
     case CMD_CODE:
-      m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Code,TRUE));
+      m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Code,cmdName,TRUE));
       retval=handleStyleArgument(this,m_children,cmdName); 
-      m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Code,FALSE));
+      m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Code,cmdName,FALSE));
       if (retval!=TK_WORD) m_children.append(new DocWhiteSpace(this," "));
       break;
     case CMD_BSLASH:
@@ -5892,13 +5910,15 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
   int retval=RetVal_OK;
   int tagId = Mappers::htmlTagMapper->map(tagName);
   if (g_token->emptyTag && !(tagId&XML_CmdMask) && 
-      tagId!=HTML_UNKNOWN && tagId!=HTML_IMG && tagId!=HTML_BR)
+      tagId!=HTML_UNKNOWN && tagId!=HTML_IMG && tagId!=HTML_BR && tagId!=HTML_HR && tagId!=HTML_P)
   {
-      warn_doc_error(g_fileName,doctokenizerYYlineno,"HTML tags may not use the 'empty tag' XHTML syntax.");
+      warn_doc_error(g_fileName,doctokenizerYYlineno,"HTML tag ('<%s/>') may not use the 'empty tag' XHTML syntax.",
+                     tagName.data());
   }
   switch (tagId)
   {
     case HTML_UL: 
+      if (!g_token->emptyTag)
       {
         DocHtmlList *list = new DocHtmlList(this,tagHtmlAttribs,DocHtmlList::Unordered);
         m_children.append(list);
@@ -5906,6 +5926,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
       }
       break;
     case HTML_OL: 
+      if (!g_token->emptyTag)
       {
         DocHtmlList *list = new DocHtmlList(this,tagHtmlAttribs,DocHtmlList::Ordered);
         m_children.append(list);
@@ -5913,6 +5934,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
       }
       break;
     case HTML_LI:
+      if (g_token->emptyTag) break;
       if (!insideUL(this) && !insideOL(this))
       {
         warn_doc_error(g_fileName,doctokenizerYYlineno,"lonely <li> tag found");
@@ -5923,21 +5945,25 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
       }
       break;
     case HTML_BOLD:
-      handleStyleEnter(this,m_children,DocStyleChange::Bold,&g_token->attribs);
+      if (!g_token->emptyTag) handleStyleEnter(this,m_children,DocStyleChange::Bold,tagName,&g_token->attribs);
+      break;
+    case HTML_S:
+      if (!g_token->emptyTag) handleStyleEnter(this,m_children,DocStyleChange::S,tagName,&g_token->attribs);
       break;
     case HTML_STRIKE:
-      handleStyleEnter(this,m_children,DocStyleChange::Strike,&g_token->attribs);
+      if (!g_token->emptyTag) handleStyleEnter(this,m_children,DocStyleChange::Strike,tagName,&g_token->attribs);
       break;
     case HTML_DEL:
-      handleStyleEnter(this,m_children,DocStyleChange::Del,&g_token->attribs);
+      if (!g_token->emptyTag) handleStyleEnter(this,m_children,DocStyleChange::Del,tagName,&g_token->attribs);
       break;
     case HTML_UNDERLINE:
-      handleStyleEnter(this,m_children,DocStyleChange::Underline,&g_token->attribs);
+      if (!g_token->emptyTag) handleStyleEnter(this,m_children,DocStyleChange::Underline,tagName,&g_token->attribs);
       break;
     case HTML_INS:
-      handleStyleEnter(this,m_children,DocStyleChange::Ins,&g_token->attribs);
+      if (!g_token->emptyTag) handleStyleEnter(this,m_children,DocStyleChange::Ins,tagName,&g_token->attribs);
       break;
     case HTML_CODE:
+      if (g_token->emptyTag) break;
       if (/*getLanguageFromFileName(g_fileName)==SrcLangExt_CSharp ||*/ g_xmlComment) 
         // for C# source or inside a <summary> or <remark> section we 
         // treat <code> as an XML tag (so similar to @code)
@@ -5947,32 +5973,33 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
       }
       else // normal HTML markup
       {
-        handleStyleEnter(this,m_children,DocStyleChange::Code,&g_token->attribs);
+        handleStyleEnter(this,m_children,DocStyleChange::Code,tagName,&g_token->attribs);
       }
       break;
     case HTML_EMPHASIS:
-      handleStyleEnter(this,m_children,DocStyleChange::Italic,&g_token->attribs);
+      if (!g_token->emptyTag) handleStyleEnter(this,m_children,DocStyleChange::Italic,tagName,&g_token->attribs);
       break;
     case HTML_DIV:
-      handleStyleEnter(this,m_children,DocStyleChange::Div,&g_token->attribs);
+      if (!g_token->emptyTag) handleStyleEnter(this,m_children,DocStyleChange::Div,tagName,&g_token->attribs);
       break;
     case HTML_SPAN:
-      handleStyleEnter(this,m_children,DocStyleChange::Span,&g_token->attribs);
+      if (!g_token->emptyTag) handleStyleEnter(this,m_children,DocStyleChange::Span,tagName,&g_token->attribs);
       break;
     case HTML_SUB:
-      handleStyleEnter(this,m_children,DocStyleChange::Subscript,&g_token->attribs);
+      if (!g_token->emptyTag) handleStyleEnter(this,m_children,DocStyleChange::Subscript,tagName,&g_token->attribs);
       break;
     case HTML_SUP:
-      handleStyleEnter(this,m_children,DocStyleChange::Superscript,&g_token->attribs);
+      if (!g_token->emptyTag) handleStyleEnter(this,m_children,DocStyleChange::Superscript,tagName,&g_token->attribs);
       break;
     case HTML_CENTER:
-      handleStyleEnter(this,m_children,DocStyleChange::Center,&g_token->attribs);
+      if (!g_token->emptyTag) handleStyleEnter(this,m_children,DocStyleChange::Center,tagName,&g_token->attribs);
       break;
     case HTML_SMALL:
-      handleStyleEnter(this,m_children,DocStyleChange::Small,&g_token->attribs);
+      if (!g_token->emptyTag) handleStyleEnter(this,m_children,DocStyleChange::Small,tagName,&g_token->attribs);
       break;
     case HTML_PRE:
-      handleStyleEnter(this,m_children,DocStyleChange::Preformatted,&g_token->attribs);
+      if (g_token->emptyTag) break;
+      handleStyleEnter(this,m_children,DocStyleChange::Preformatted,tagName,&g_token->attribs);
       setInsidePreformatted(TRUE);
       doctokenizerYYsetInsidePre(TRUE);
       break;
@@ -5980,6 +6007,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
       retval=TK_NEWPARA;
       break;
     case HTML_DL:
+      if (!g_token->emptyTag)
       {
         DocHtmlDescList *list = new DocHtmlDescList(this,tagHtmlAttribs);
         m_children.append(list);
@@ -5993,6 +6021,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
       warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected tag <dd> found");
       break;
     case HTML_TABLE:
+      if (!g_token->emptyTag)
       {
         DocHtmlTable *table = new DocHtmlTable(this,tagHtmlAttribs);
         m_children.append(table);
@@ -6027,22 +6056,22 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
       retval=handleAHref(this,m_children,tagHtmlAttribs);
       break;
     case HTML_H1:
-      retval=handleHtmlHeader(tagHtmlAttribs,1);
+      if (!g_token->emptyTag) retval=handleHtmlHeader(tagHtmlAttribs,1);
       break;
     case HTML_H2:
-      retval=handleHtmlHeader(tagHtmlAttribs,2);
+      if (!g_token->emptyTag) retval=handleHtmlHeader(tagHtmlAttribs,2);
       break;
     case HTML_H3:
-      retval=handleHtmlHeader(tagHtmlAttribs,3);
+      if (!g_token->emptyTag) retval=handleHtmlHeader(tagHtmlAttribs,3);
       break;
     case HTML_H4:
-      retval=handleHtmlHeader(tagHtmlAttribs,4);
+      if (!g_token->emptyTag) retval=handleHtmlHeader(tagHtmlAttribs,4);
       break;
     case HTML_H5:
-      retval=handleHtmlHeader(tagHtmlAttribs,5);
+      if (!g_token->emptyTag) retval=handleHtmlHeader(tagHtmlAttribs,5);
       break;
     case HTML_H6:
-      retval=handleHtmlHeader(tagHtmlAttribs,6);
+      if (!g_token->emptyTag) retval=handleHtmlHeader(tagHtmlAttribs,6);
       break;
     case HTML_IMG:
       {
@@ -6050,6 +6079,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
       }
       break;
     case HTML_BLOCKQUOTE:
+      if (!g_token->emptyTag)
       {
         DocHtmlBlockQuote *block = new DocHtmlBlockQuote(this,tagHtmlAttribs);
         m_children.append(block);
@@ -6076,7 +6106,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
       }
       break;
     case XML_C:
-      handleStyleEnter(this,m_children,DocStyleChange::Code,&g_token->attribs);
+      handleStyleEnter(this,m_children,DocStyleChange::Code,tagName,&g_token->attribs);
       break;
     case XML_PARAM:
     case XML_TYPEPARAM:
@@ -6112,9 +6142,9 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
         if (findAttribute(tagHtmlAttribs,"name",&paramName))
         {
           //printf("paramName=%s\n",paramName.data());
-          m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Italic,TRUE));
+          m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Italic,tagName,TRUE));
           m_children.append(new DocWord(this,paramName)); 
-          m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Italic,FALSE));
+          m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Italic,tagName,FALSE));
           if (retval!=TK_WORD) m_children.append(new DocWhiteSpace(this," "));
         }
         else
@@ -6204,9 +6234,9 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
           bool inSeeBlock = g_inSeeBlock;
           g_token->name = cref;
           g_inSeeBlock = TRUE;
-          m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Code,TRUE));
+          m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Code,tagName,TRUE));
           handleLinkedWord(this,m_children,TRUE);
-          m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Code,FALSE));
+          m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Code,tagName,FALSE));
           g_inSeeBlock = inSeeBlock;
         }
         else
@@ -6280,7 +6310,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
       break;
     case HTML_UNKNOWN:
       warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported xml/html tag <%s> found", qPrint(tagName));
-      m_children.append(new DocWord(this, "<"+tagName+tagHtmlAttribs.toString()+">"));
+      m_children.append(new DocWord(this, "<"+tagName+g_token->attribsStr+">"));
       break;
   case XML_INHERITDOC:
       handleInheritDoc();
@@ -6344,46 +6374,49 @@ int DocPara::handleHtmlEndTag(const QCString &tagName)
     //  }
     //  break;
     case HTML_BOLD:
-      handleStyleLeave(this,m_children,DocStyleChange::Bold,"b");
+      handleStyleLeave(this,m_children,DocStyleChange::Bold,tagName);
+      break;
+    case HTML_S:
+      handleStyleLeave(this,m_children,DocStyleChange::S,"s");
       break;
     case HTML_STRIKE:
-      handleStyleLeave(this,m_children,DocStyleChange::Strike,"strike");
+      handleStyleLeave(this,m_children,DocStyleChange::Strike,tagName);
       break;
     case HTML_DEL:
-      handleStyleLeave(this,m_children,DocStyleChange::Del,"del");
+      handleStyleLeave(this,m_children,DocStyleChange::Del,tagName);
       break;
     case HTML_UNDERLINE:
-      handleStyleLeave(this,m_children,DocStyleChange::Underline,"u");
+      handleStyleLeave(this,m_children,DocStyleChange::Underline,tagName);
       break;
     case HTML_INS:
-      handleStyleLeave(this,m_children,DocStyleChange::Ins,"ins");
+      handleStyleLeave(this,m_children,DocStyleChange::Ins,tagName);
       break;
     case HTML_CODE:
-      handleStyleLeave(this,m_children,DocStyleChange::Code,"code");
+      handleStyleLeave(this,m_children,DocStyleChange::Code,tagName);
       break;
     case HTML_EMPHASIS:
-      handleStyleLeave(this,m_children,DocStyleChange::Italic,"em");
+      handleStyleLeave(this,m_children,DocStyleChange::Italic,tagName);
       break;
     case HTML_DIV:
-      handleStyleLeave(this,m_children,DocStyleChange::Div,"div");
+      handleStyleLeave(this,m_children,DocStyleChange::Div,tagName);
       break;
     case HTML_SPAN:
-      handleStyleLeave(this,m_children,DocStyleChange::Span,"span");
+      handleStyleLeave(this,m_children,DocStyleChange::Span,tagName);
       break;
     case HTML_SUB:
-      handleStyleLeave(this,m_children,DocStyleChange::Subscript,"sub");
+      handleStyleLeave(this,m_children,DocStyleChange::Subscript,tagName);
       break;
     case HTML_SUP:
-      handleStyleLeave(this,m_children,DocStyleChange::Superscript,"sup");
+      handleStyleLeave(this,m_children,DocStyleChange::Superscript,tagName);
       break;
     case HTML_CENTER:
-      handleStyleLeave(this,m_children,DocStyleChange::Center,"center");
+      handleStyleLeave(this,m_children,DocStyleChange::Center,tagName);
       break;
     case HTML_SMALL:
-      handleStyleLeave(this,m_children,DocStyleChange::Small,"small");
+      handleStyleLeave(this,m_children,DocStyleChange::Small,tagName);
       break;
     case HTML_PRE:
-      handleStyleLeave(this,m_children,DocStyleChange::Preformatted,"pre");
+      handleStyleLeave(this,m_children,DocStyleChange::Preformatted,tagName);
       setInsidePreformatted(FALSE);
       doctokenizerYYsetInsidePre(FALSE);
       break;
@@ -6439,7 +6472,7 @@ int DocPara::handleHtmlEndTag(const QCString &tagName)
       warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected tag </img> found");
       break;
     case HTML_HR:
-      warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected tag </hr> found");
+      warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal </hr> tag found\n");
       break;
     case HTML_A:
       //warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected tag </a> found");
@@ -6465,7 +6498,7 @@ int DocPara::handleHtmlEndTag(const QCString &tagName)
       retval = RetVal_CloseXml;
       break;
     case XML_C:
-      handleStyleLeave(this,m_children,DocStyleChange::Code,"c");
+      handleStyleLeave(this,m_children,DocStyleChange::Code,tagName);
       break;
     case XML_ITEM:
     case XML_LISTHEADER:
@@ -6897,7 +6930,7 @@ int DocSection::parse()
     }
     else if (retval==RetVal_Subsubsection && m_level<=Doxygen::subpageNestingLevel+2)
     {
-      if ((m_level<=1+Doxygen::subpageNestingLevel) && !QString(g_token->sectionId).startsWith("autotoc_md"))
+      if ((m_level<=1+Doxygen::subpageNestingLevel) && !g_token->sectionId.startsWith("autotoc_md"))
           warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected subsubsection command found inside %s!",sectionLevelToName[m_level]);
       // then parse any number of nested sections
       while (retval==RetVal_Subsubsection) // more sections follow
@@ -6912,7 +6945,7 @@ int DocSection::parse()
     }
     else if (retval==RetVal_Paragraph && m_level<=QMIN(5,Doxygen::subpageNestingLevel+3))
     {
-      if ((m_level<=2+Doxygen::subpageNestingLevel) && !QString(g_token->sectionId).startsWith("autotoc_md"))
+      if ((m_level<=2+Doxygen::subpageNestingLevel) && !g_token->sectionId.startsWith("autotoc_md"))
         warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected paragraph command found inside %s!",sectionLevelToName[m_level]);
       // then parse any number of nested sections
       while (retval==RetVal_Paragraph) // more sections follow
@@ -7084,8 +7117,10 @@ void DocRoot::parse()
     }
     if (retval==RetVal_Paragraph)
     {
-      if (!QString(g_token->sectionId).startsWith("autotoc_md"))
+      if (!g_token->sectionId.startsWith("autotoc_md"))
+      {
          warn_doc_error(g_fileName,doctokenizerYYlineno,"found paragraph command outside of subsubsection context!");
+      }
       while (retval==RetVal_Paragraph)
       {
         if (!g_token->sectionId.isEmpty())
@@ -7113,7 +7148,7 @@ void DocRoot::parse()
     }
     if (retval==RetVal_Subsubsection)
     {
-      if (!(QString(g_token->sectionId).startsWith("autotoc_md")))
+      if (!(g_token->sectionId.startsWith("autotoc_md")))
         warn_doc_error(g_fileName,doctokenizerYYlineno,"found subsubsection command outside of subsection context!");
       while (retval==RetVal_Subsubsection)
       {
@@ -7142,8 +7177,10 @@ void DocRoot::parse()
     }
     if (retval==RetVal_Subsection)
     {
-      if (!(QString(g_token->sectionId).startsWith("autotoc_md")))
+      if (!g_token->sectionId.startsWith("autotoc_md"))
+      {
         warn_doc_error(g_fileName,doctokenizerYYlineno,"found subsection command outside of section context!");
+      }
       while (retval==RetVal_Subsection)
       {
         if (!g_token->sectionId.isEmpty())
@@ -7518,7 +7555,7 @@ QCString getDirHtmlClassOfPage(QCString pageTitle)
   return result;
 }
 
-QCString getHtmlDirEmbedingChar(QString::Direction textDir)
+QCString getHtmlDirEmbeddingChar(QString::Direction textDir)
 {
   if (textDir == QString::DirLTR)
     return "&#x202A;";
@@ -7527,7 +7564,7 @@ QCString getHtmlDirEmbedingChar(QString::Direction textDir)
   return "";
 }
 
-QCString getJsDirEmbedingChar(QString::Direction textDir)
+QCString getJsDirEmbeddingChar(QString::Direction textDir)
 {
   if (textDir == QString::DirLTR)
     return "\\u202A";
@@ -7797,10 +7834,9 @@ DocText *validatingParseText(const char *input)
 }
 
 void docFindSections(const char *input,
-                     Definition *d,
-                     MemberGroup *mg,
+                     const Definition *d,
                      const char *fileName)
 {
-  doctokenizerYYFindSections(input,d,mg,fileName);
+  doctokenizerYYFindSections(input,d,fileName);
 }
 
index e608d8f..b7164d7 100644 (file)
@@ -22,6 +22,7 @@
 #include <stdio.h>
 
 #include <qlist.h>
+#include <qstring.h>
 #include <qcstring.h>
 
 #include "docvisitor.h"
@@ -39,8 +40,8 @@ QString::Direction getTextDirByConfig(const DocNode *node);
 QString::Direction getTextDirByConfig(const DocPara *para, int nodeIndex);
 QCString getDirHtmlClassOfNode(QString::Direction textDir, const QCString &initValue="");
 QCString getDirHtmlClassOfPage(QCString pageTitle);
-QCString getHtmlDirEmbedingChar(QString::Direction textDir);
-QCString getJsDirEmbedingChar(QString::Direction textDir);
+QCString getHtmlDirEmbeddingChar(QString::Direction textDir);
+QCString getJsDirEmbeddingChar(QString::Direction textDir);
 //---------------------------------------------------------------------------
 
 
@@ -77,8 +78,7 @@ DocText *validatingParseText(const char *input);
 
 /*! Searches for section and anchor commands in the input */
 void docFindSections(const char *input,
-                     Definition *d,
-                     MemberGroup *m,
+                     const Definition *d,
                      const char *fileName);
 
 //---------------------------------------------------------------------------
@@ -173,10 +173,10 @@ class DocNode
   protected:
     /*! Sets whether or not this item is inside a preformatted section */
     void setInsidePreformatted(bool p) { m_insidePre = p; }
-    DocNode *m_parent;
+    DocNode *m_parent = 0;
   private:
 
-    bool m_insidePre;
+    bool m_insidePre = false;
 };
 
 /** Default accept implementation for compound nodes in the abstract
@@ -294,7 +294,7 @@ class DocURL : public DocNode
 
   private:
     QCString  m_url;
-    bool m_isEmail;
+    bool m_isEmail = false;
 };
 
 /** Node representing a line break */
@@ -385,13 +385,14 @@ class DocStyleChange : public DocNode
                  Strike        = (1<<10),
                  Underline     = (1<<11),
                  Del           = (1<<12),
-                 Ins           = (1<<13)
+                 Ins           = (1<<13),
+                 S             = (1<<14)
                };
 
-    DocStyleChange(DocNode *parent,uint position,Style s,bool enable,
-                   const HtmlAttribList *attribs=0) : 
+    DocStyleChange(DocNode *parent,uint position,Style s,const QCString &tagName,bool enable,
+                   const HtmlAttribList *attribs=0) :
       m_position(position), m_style(s), m_enable(enable)
-      { m_parent = parent; if (attribs) m_attribs=*attribs; }
+      { m_parent = parent; if (attribs) m_attribs=*attribs; m_tagName = tagName.lower();}
     Kind kind() const                     { return Kind_StyleChange; }
     Style style() const                   { return m_style; }
     const char *styleString() const;
@@ -399,12 +400,14 @@ class DocStyleChange : public DocNode
     uint position() const                 { return m_position; }
     void accept(DocVisitor *v)            { v->visit(this); }
     const HtmlAttribList &attribs() const { return m_attribs; }
+    QCString tagName() const              { return m_tagName; }
 
   private:
-    uint     m_position;
-    Style    m_style;
-    bool     m_enable;
+    uint     m_position = 0;
+    Style    m_style = Bold;
+    bool     m_enable = false;
     HtmlAttribList m_attribs;
+    QCString m_tagName;
 };
 
 /** Node representing a special symbol */
@@ -488,7 +491,7 @@ class DocSymbol : public DocNode
     static SymType decodeSymbol(const QCString &symName);
 
   private:
-    SymType  m_symbol;
+    SymType  m_symbol = Sym_Unknown;
 };
 
 /** Node representing a n emoji */
@@ -503,7 +506,7 @@ class DocEmoji : public DocNode
 
   private:
     QCString m_symName;
-    int m_index;
+    int m_index = 0;
 };
 
 /** Node representing some amount of white space */
@@ -562,12 +565,12 @@ class DocVerbatim : public DocNode
   private:
     QCString  m_context;
     QCString  m_text;
-    Type      m_type;
-    bool      m_isExample;
+    Type      m_type = Code;
+    bool      m_isExample = false;
     QCString  m_exampleFile;
     QCString  m_relPath;
     QCString  m_lang;
-    bool      m_isBlock;
+    bool      m_isBlock = false;
     QCString  m_width;
     QCString  m_height;
     QList<DocNode> m_children;
@@ -610,9 +613,9 @@ class DocInclude : public DocNode
     QCString  m_file;
     QCString  m_context;
     QCString  m_text;
-    Type      m_type;
-    bool      m_isExample;
-    bool      m_isBlock;
+    Type      m_type = Include;
+    bool      m_isExample = false;
+    bool      m_isBlock = false;
     QCString  m_exampleFile;
     QCString  m_blockId;
 };
@@ -656,15 +659,15 @@ class DocIncOperator : public DocNode
     void parse();
 
   private:
-    Type     m_type;
-    int      m_line;
-    bool     m_showLineNo;
+    Type     m_type = Line;
+    int      m_line = 0;
+    bool     m_showLineNo = false;
     QCString  m_text;
     QCString  m_pattern;
     QCString  m_context;
-    bool     m_isFirst;
-    bool     m_isLast;
-    bool     m_isExample;
+    bool     m_isFirst = false;
+    bool     m_isLast = false;
+    bool     m_isExample = false;
     QCString  m_exampleFile;
     QCString m_includeFileName;
 };
@@ -686,7 +689,7 @@ class DocFormula : public DocNode
     QCString  m_name;
     QCString  m_text;
     QCString  m_relPath;
-    int      m_id;
+    int      m_id = 0;
 };
 
 /** Node representing an entry in the index. */
@@ -704,8 +707,8 @@ class DocIndexEntry : public DocNode
 
   private:
     QCString     m_entry;
-    const Definition *m_scope;
-    const MemberDef  *m_member;
+    const Definition *m_scope = 0;
+    const MemberDef  *m_member = 0;
 };
 
 //-----------------------------------------------------------------------
@@ -722,9 +725,9 @@ class DocAutoList : public CompAccept<DocAutoList>
     int parse();
 
   private:
-    int      m_indent;
-    bool     m_isEnumList;
-    int      m_depth;
+    int      m_indent = 0;
+    bool     m_isEnumList = false;
+    int      m_depth = 0;
 };
 
 /** Node representing an item of a auto list */
@@ -737,8 +740,8 @@ class DocAutoListItem : public CompAccept<DocAutoListItem>
     int parse();
 
   private:
-    int m_indent;
-    int m_itemNum;
+    int m_indent = 0;
+    int m_itemNum = 0;
 };
 
 
@@ -770,7 +773,7 @@ class DocXRefItem : public CompAccept<DocXRefItem>
     bool parse();
 
   private:
-    int      m_id;
+    int      m_id = 0;
     QCString  m_key;
     QCString  m_file;
     QCString  m_anchor;
@@ -801,12 +804,12 @@ class DocImage : public CompAccept<DocImage>
   private:
     HtmlAttribList m_attribs;
     QCString  m_name;
-    Type      m_type;
+    Type      m_type = Html;
     QCString  m_width;
     QCString  m_height;
     QCString  m_relPath;
     QCString  m_url;
-    bool      m_inlineImage;
+    bool      m_inlineImage = false;
 };
 
 /** Node representing a dot file */
@@ -929,8 +932,8 @@ class DocRef : public CompAccept<DocRef>
 
   private:
     enum RefType { Unknown, Anchor, Section, Table };
-    RefType    m_refType;
-    bool       m_isSubPage;
+    RefType    m_refType = Unknown;
+    bool       m_isSubPage = false;
     QCString   m_file;
     QCString   m_relPath;
     QCString   m_ref;
@@ -986,7 +989,7 @@ class DocHtmlHeader : public CompAccept<DocHtmlHeader>
     int parse();
 
   private:
-    int           m_level;
+    int           m_level = 0;
     HtmlAttribList m_attribs;
 };
 
@@ -1033,7 +1036,7 @@ class DocSection : public CompAccept<DocSection>
     int parse();
 
   private:
-    int      m_level;
+    int       m_level = 0;
     QCString  m_id;
     QCString  m_title;
     QCString  m_anchor;
@@ -1117,7 +1120,7 @@ class DocHtmlList : public CompAccept<DocHtmlList>
     int parseXml();
 
   private:
-    Type          m_type;
+    Type           m_type = Unordered;
     HtmlAttribList m_attribs;
 };
 
@@ -1143,8 +1146,8 @@ class DocSimpleSect : public CompAccept<DocSimpleSect>
     bool hasTitle() const      { return m_title->hasTitle(); }
 
   private:
-    Type            m_type;
-    DocTitle *      m_title;
+    Type            m_type = Unknown;
+    DocTitle *      m_title = 0;
 };
 
 /** Node representing a separator between two simple sections of the
@@ -1183,9 +1186,9 @@ class DocParamSect : public CompAccept<DocParamSect>
     bool hasTypeSpecifier() const  { return m_hasTypeSpecifier; }
 
   private:
-    Type            m_type;
-    bool            m_hasInOutSpecifier;
-    bool            m_hasTypeSpecifier;
+    Type            m_type = Unknown;
+    bool            m_hasInOutSpecifier = false;
+    bool            m_hasTypeSpecifier = false;
 };
 
 /** Node representing a paragraph in the documentation tree */
@@ -1230,8 +1233,8 @@ class DocPara : public CompAccept<DocPara>
 
   private:
     QCString  m_sectionId;
-    bool     m_isFirst;
-    bool     m_isLast;
+    bool      m_isFirst = false;
+    bool      m_isLast = false;
     HtmlAttribList m_attribs;
 };
 
@@ -1271,10 +1274,10 @@ class DocParamList : public DocNode
     QList<DocPara>          m_paragraphs;
     QList<DocNode>          m_params;
     QList<DocNode>          m_paramTypes;
-    DocParamSect::Type      m_type;
-    DocParamSect::Direction m_dir;
-    bool                    m_isFirst;
-    bool                    m_isLast;
+    DocParamSect::Type      m_type = DocParamSect::Unknown;
+    DocParamSect::Direction m_dir = DocParamSect::Unspecified;
+    bool                    m_isFirst = false;
+    bool                    m_isLast = false;
 };
 
 /** Node representing a simple list item */
@@ -1294,7 +1297,7 @@ class DocSimpleListItem : public DocNode
     }
 
   private:
-    DocPara *m_paragraph;
+    DocPara *m_paragraph = 0;
 };
 
 /** Node representing a HTML list item */
@@ -1311,7 +1314,7 @@ class DocHtmlListItem : public CompAccept<DocHtmlListItem>
 
   private:
     HtmlAttribList m_attribs;
-    int            m_itemNum;
+    int            m_itemNum = 0;
 };
 
 /** Node representing a HTML description data */
@@ -1355,12 +1358,12 @@ class DocHtmlCell : public CompAccept<DocHtmlCell>
   private:
     void setRowIndex(int idx)    { m_rowIdx = idx; }
     void setColumnIndex(int idx) { m_colIdx = idx; }
-    bool           m_isHeading;
-    bool           m_isFirst;
-    bool           m_isLast;
+    bool           m_isHeading = false;
+    bool           m_isFirst = false;
+    bool           m_isLast = false;
     HtmlAttribList m_attribs;
-    int            m_rowIdx;
-    int            m_colIdx;
+    int            m_rowIdx = -1;
+    int            m_colIdx = -1;
 };
 
 /** Node representing a HTML table caption */
@@ -1377,7 +1380,7 @@ class DocHtmlCaption : public CompAccept<DocHtmlCaption>
 
   private:
     HtmlAttribList m_attribs;
-    bool           m_hasCaptionId;
+    bool           m_hasCaptionId = false;
     QCString       m_file;
     QCString       m_anchor;
 };
@@ -1414,8 +1417,8 @@ class DocHtmlRow : public CompAccept<DocHtmlRow>
   private:
     void setRowIndex(int idx)    { m_rowIdx = idx; }
     HtmlAttribList m_attribs;
-    int m_visibleCells;
-    int m_rowIdx;
+    int m_visibleCells = -1;
+    int m_rowIdx = -1;
 };
 
 /** Node representing a HTML table */
@@ -1442,9 +1445,9 @@ class DocHtmlTable : public CompAccept<DocHtmlTable>
 
   private:
     void computeTableGrid();
-    DocHtmlCaption    *m_caption;
+    DocHtmlCaption    *m_caption = 0;
     HtmlAttribList     m_attribs;
-    int m_numCols;
+    int m_numCols = 0;
 };
 
 /** Node representing an HTML blockquote */
@@ -1483,8 +1486,8 @@ class DocRoot : public CompAccept<DocRoot>
     bool isEmpty() const { return m_children.isEmpty(); }
 
   private:
-    bool m_indent;
-    bool m_singleLine;
+    bool m_indent = false;
+    bool m_singleLine = false;
 };
 
 
index 055532a..a838923 100644 (file)
@@ -62,8 +62,7 @@ void DocSets::initialize()
   QFile makefile(mfName);
   if (!makefile.open(IO_WriteOnly))
   {
-    err("Could not open file %s for writing\n",mfName.data());
-    exit(1);
+    term("Could not open file %s for writing\n",mfName.data());
   }
   FTextStream ts(&makefile);
 
@@ -113,8 +112,7 @@ void DocSets::initialize()
   QFile plist(plName);
   if (!plist.open(IO_WriteOnly))
   {
-    err("Could not open file %s for writing\n",plName.data());
-    exit(1);
+    term("Could not open file %s for writing\n",plName.data());
   }
   FTextStream ts(&plist);
 
@@ -149,8 +147,7 @@ void DocSets::initialize()
   m_nf = new QFile(notes);
   if (!m_nf->open(IO_WriteOnly))
   {
-    err("Could not open file %s for writing\n",notes.data());
-    exit(1);
+    term("Could not open file %s for writing\n",notes.data());
   }
   //QCString indexName=Config_getBool(GENERATE_TREEVIEW)?"main":"index";
   QCString indexName="index";
@@ -170,8 +167,7 @@ void DocSets::initialize()
   m_tf = new QFile(tokens);
   if (!m_tf->open(IO_WriteOnly))
   {
-    err("Could not open file %s for writing\n",tokens.data());
-    exit(1);
+    term("Could not open file %s for writing\n",tokens.data());
   }
   m_tts.setDevice(m_tf);
   m_tts << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl;
@@ -326,7 +322,7 @@ void DocSets::addIndexItem(const Definition *context,const MemberDef *md,
     case SrcLangExt_PHP:     lang="php"; break;        // PHP4/5
     case SrcLangExt_D:       lang="d"; break;          // D
     case SrcLangExt_Java:    lang="java"; break;       // Java
-    case SrcLangExt_JS:      lang="javascript"; break; // Javascript
+    case SrcLangExt_JS:      lang="javascript"; break; // JavaScript
     case SrcLangExt_Python:  lang="python"; break;     // Python
     case SrcLangExt_Fortran: lang="fortran"; break;    // Fortran
     case SrcLangExt_VHDL:    lang="vhdl"; break;       // VHDL
index b59fc09..e01f045 100644 (file)
@@ -25,7 +25,6 @@
 #include "htmlattrib.h"
 
 class Definition;
-class MemberGroup;
 
 enum Tokens
 {
@@ -81,8 +80,8 @@ struct TokenInfo
   // comment blocks
   
   // list token info
-  bool isEnumList;
-  int indent;
+  bool isEnumList = false;
+  int indent = 0;
 
   // sections
   QCString sectionId;
@@ -95,22 +94,23 @@ struct TokenInfo
   QCString verb;
 
   // xrefitem
-  int id;
+  int id = -1;
 
   // html tag
   HtmlAttribList attribs;
-  bool endTag;
-  bool emptyTag;
+  bool endTag = false;
+  bool emptyTag = false;
+  QCString attribsStr;
 
   // whitespace
   QCString chars;
 
   // url
-  bool isEMailAddr;
+  bool isEMailAddr = false;
 
   // param attributes
   enum ParamDir { In=1, Out=2, InOut=3, Unspecified=0 };
-  ParamDir paramDir;
+  ParamDir paramDir = Unspecified;
 };
 
 // globals
@@ -122,8 +122,8 @@ extern FILE *doctokenizerYYin;
 const char *tokToString(int token);
 
 // operations on the scanner
-void doctokenizerYYFindSections(const char *input,Definition *d,
-                                MemberGroup *mg,const char *fileName);
+void doctokenizerYYFindSections(const char *input,const Definition *d,
+                                const char *fileName);
 void doctokenizerYYinit(const char *input,const char *fileName);
 void doctokenizerYYcleanup();
 void doctokenizerYYpushContext();
index 194327c..4882570 100644 (file)
@@ -57,8 +57,7 @@ static bool g_insidePre;
 static int g_sharpCount=0;
 
 // context for section finding phase
-static Definition  *g_definition;
-static MemberGroup *g_memberGroup;
+static const Definition  *g_definition;
 static QCString     g_secLabel;
 static QCString     g_secTitle;
 static SectionInfo::SectionType g_secType;
@@ -77,6 +76,7 @@ struct DocLexerContext
 
 static QStack<DocLexerContext> g_lexerStack;
 
+static const char *stateToString(int state);
 //--------------------------------------------------------------------------
 
 void doctokenizerYYpushContext()
@@ -159,11 +159,7 @@ static void processSection()
 {
   //printf("%s: found section/anchor with name '%s'\n",g_fileName.data(),g_secLabel.data());
   QCString file;
-  if (g_memberGroup)
-  {
-    file = g_memberGroup->parent()->getOutputFileBase();
-  }
-  else if (g_definition)
+  if (g_definition)
   {
     file = g_definition->getOutputFileBase();
   }
@@ -207,6 +203,7 @@ static void handleHtmlTag()
   // Parse the attributes. Each attribute is a name, value pair
   // The result is stored in g_token->attribs.
   int startName,endName,startAttrib,endAttrib;
+  int startAttribList = i;
   while (i<(int)yyleng)
   {
     char c=tagText.at(i);
@@ -222,7 +219,7 @@ static void handleHtmlTag()
     }
     startName=i;
     // search for end of name
-    while (i<(int)yyleng && !isspace((uchar)c) && c!='=') { c=tagText.at(++i); }
+    while (i<(int)yyleng && !isspace((uchar)c) && c!='=' && c!= '>') { c=tagText.at(++i); }
     endName=i;
     HtmlAttrib opt;
     opt.name  = tagText.mid(startName,endName-startName).lower(); 
@@ -241,7 +238,7 @@ static void handleHtmlTag()
        // search for matching quote 
         while (i<(int)yyleng && c!='\'') { c=tagText.at(++i); } 
        endAttrib=i;
-        if (i<(int)yyleng) c=tagText.at(++i);
+        if (i<(int)yyleng) { c=tagText.at(++i);}
       }
       else if (tagText.at(i)=='"') // option "..."
       {
@@ -250,7 +247,7 @@ static void handleHtmlTag()
        // search for matching quote 
         while (i<(int)yyleng && c!='"') { c=tagText.at(++i); } 
        endAttrib=i;
-        if (i<(int)yyleng) c=tagText.at(++i);
+        if (i<(int)yyleng) { c=tagText.at(++i);}
       }
       else // value without any quotes
       {
@@ -258,7 +255,7 @@ static void handleHtmlTag()
        // search for separator or end symbol
         while (i<(int)yyleng && !isspace((uchar)c) && c!='>') { c=tagText.at(++i); } 
        endAttrib=i;
-       if (i<(int)yyleng) c=tagText.at(++i);
+        if (i<(int)yyleng) { c=tagText.at(++i);}
       }
       opt.value  = tagText.mid(startAttrib,endAttrib-startAttrib); 
       if (opt.name == "align") opt.value = opt.value.lower();
@@ -275,6 +272,7 @@ static void handleHtmlTag()
     //    opt.name.data(),opt.value.data());
     g_token->attribs.append(&opt);
   }
+  g_token->attribsStr = tagText.mid(startAttribList,i-startAttribList);
 }
   
 static QCString stripEmptyLines(const QCString &s)
@@ -333,8 +331,8 @@ static int yyread(char *buf,int max_size)
 
 //--------------------------------------------------------------------------
 //#define REAL_YY_DECL int doctokenizerYYlex (void)
-//#define YY_DECL static int local_doctokinizer(void)
-//#define LOCAL_YY_DECL local_doctokinizer()
+//#define YY_DECL static int local_doctokenizer(void)
+//#define LOCAL_YY_DECL local_doctokenizer()
 
 %}
 
@@ -348,25 +346,28 @@ PHPTYPE   [\\:a-z_A-Z0-9\x80-\xFF\-]+
 CITESCHAR [a-z_A-Z0-9\x80-\xFF\-\?]
 CITEECHAR [a-z_A-Z0-9\x80-\xFF\-\+:\/\?]
 CITEID    {CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)*|"\""{CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)*"\""
-MAILADR   ("mailto:")?[a-z_A-Z0-9.+-]+"@"[a-z_A-Z0-9-]+("."[a-z_A-Z0-9\-]+)+[a-z_A-Z0-9\-]+
+MAILADDR  ("mailto:")?[a-z_A-Z0-9.+-]+"@"[a-z_A-Z0-9-]+("."[a-z_A-Z0-9\-]+)+[a-z_A-Z0-9\-]+
+MAILWS    [\t a-z_A-Z0-9+-]
+MAILADDR2 {MAILWS}+{BLANK}+("at"|"AT"|"_at_"|"_AT_"){BLANK}+{MAILWS}+("dot"|"DOT"|"_dot_"|"_DOT_"){BLANK}+{MAILWS}+
 OPTSTARS  ("//"{BLANK}*)?"*"*{BLANK}*
 LISTITEM  {BLANK}*[-]("#")?{WS}
 MLISTITEM {BLANK}*[+*]{WS}
 OLISTITEM {BLANK}*[1-9][0-9]*"."{BLANK}
 ENDLIST   {BLANK}*"."{BLANK}*\n
-ATTRNAME  [a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF\-]*
+ATTRNAME  [a-z_A-Z\x80-\xFF][:a-z_A-Z0-9\x80-\xFF\-]*
 ATTRIB    {ATTRNAME}{WS}*("="{WS}*(("\""[^\"]*"\"")|("'"[^\']*"'")|[^ \t\r\n'"><]+))?
 URLCHAR   [a-z_A-Z0-9\!\~\,\:\;\'\$\?\@\&\%\#\.\-\+\/\=]
 URLMASK   ({URLCHAR}+([({]{URLCHAR}*[)}])?)+
-FILESCHAR [a-z_A-Z0-9\\:\\\/\-\+@&#]
-FILEECHAR [a-z_A-Z0-9\-\+@&#]
+URLPROTOCOL ("http:"|"https:"|"ftp:"|"file:"|"news:"|"irc")
+FILESCHAR [a-z_A-Z0-9\\:\\\/\-\+&#]
+FILEECHAR [a-z_A-Z0-9\-\+&#]
 HFILEMASK ("."{FILESCHAR}*{FILEECHAR}+)+
 FILEMASK  ({FILESCHAR}*{FILEECHAR}+("."{FILESCHAR}*{FILEECHAR}+)*)|{HFILEMASK}
 LINKMASK  [^ \t\n\r\\@<&${}]+("("[^\n)]*")")?({BLANK}*("const"|"volatile"){BLANK}+)? 
 VERBATIM  "verbatim"{BLANK}*
 SPCMD1    {CMD}([a-z_A-Z][a-z_A-Z0-9]*|{VERBATIM}|"--"|"---")
 SPCMD2    {CMD}[\\@<>&$#%~".+=|-]
-SPCMD3    {CMD}form#[0-9]+
+SPCMD3    {CMD}_form#[0-9]+
 SPCMD4    {CMD}"::"
 SPCMD5    {CMD}":"
 INOUT    "inout"|"in"|"out"|("in"{BLANK}*","{BLANK}*"out")|("out"{BLANK}*","{BLANK}*"in")
@@ -405,8 +406,8 @@ WORD1NQ   {ESCWORD}|{CHARWORDQ}+|"{"|"}"
 WORD2NQ   "."|","|"("|")"|"["|"]"|"::"|":"|";"|"\?"|"="|"'"
 CAPTION   [cC][aA][pP][tT][iI][oO][nN]
 HTMLTAG   "<"(("/")?){ID}({WS}+{ATTRIB})*{WS}*(("/")?)">" 
-HTMLKEYL  "strong"|"center"|"table"|"caption"|"small"|"code"|"dfn"|"var"|"img"|"pre"|"sub"|"sup"|"tr"|"td"|"th"|"ol"|"ul"|"li"|"tt"|"kbd"|"em"|"hr"|"dl"|"dt"|"dd"|"br"|"i"|"a"|"b"|"p"|"strike"|"u"|"del"|"ins"
-HTMLKEYU  "STRONG"|"CENTER"|"TABLE"|"CAPTION"|"SMALL"|"CODE"|"DFN"|"VAR"|"IMG"|"PRE"|"SUB"|"SUP"|"TR"|"TD"|"TH"|"OL"|"UL"|"LI"|"TT"|"KBD"|"EM"|"HR"|"DL"|"DT"|"DD"|"BR"|"I"|"A"|"B"|"P"|"STRIKE"|"U"|"DEL"|"INS"
+HTMLKEYL  "strong"|"center"|"table"|"caption"|"small"|"code"|"dfn"|"var"|"img"|"pre"|"sub"|"sup"|"tr"|"td"|"th"|"ol"|"ul"|"li"|"tt"|"kbd"|"em"|"hr"|"dl"|"dt"|"dd"|"br"|"i"|"a"|"b"|"p"|"strike"|"u"|"del"|"ins"|"s"
+HTMLKEYU  "STRONG"|"CENTER"|"TABLE"|"CAPTION"|"SMALL"|"CODE"|"DFN"|"VAR"|"IMG"|"PRE"|"SUB"|"SUP"|"TR"|"TD"|"TH"|"OL"|"UL"|"LI"|"TT"|"KBD"|"EM"|"HR"|"DL"|"DT"|"DD"|"BR"|"I"|"A"|"B"|"P"|"STRIKE"|"U"|"DEL"|"INS"|"S"
 HTMLKEYW  {HTMLKEYL}|{HTMLKEYU}
 REFWORD2_PRE   ("#"|"::")?((({ID}{TEMPLPART}?)|{ANONNS})("."|"#"|"::"|"-"|"/"))*({ID}{TEMPLPART}?(":")?)
 REFWORD2       {REFWORD2_PRE}{FUNCARG2}?
@@ -581,9 +582,9 @@ REFWORD_NOCV   {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
                              yylineno++; 
                          }
 <St_Para>{SPCMD3}      {
-                        g_token->name = "form";
+                        g_token->name = "_form";
                         bool ok;
-                        g_token->id = QCString(yytext).right((int)yyleng-6).toInt(&ok);
+                        g_token->id = QCString(yytext).right((int)yyleng-7).toInt(&ok);
                         ASSERT(ok);
                         return TK_COMMAND_SEL();
                       }
@@ -629,35 +630,39 @@ REFWORD_NOCV   {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
                         }
                         return TK_COMMAND_SEL();
                       }
-<St_Para>("http:"|"https:"|"ftp:"|"file:"|"news:"){URLMASK}/\. { // URL.
+<St_Para>{URLPROTOCOL}{URLMASK}/\. { // URL.
                          g_token->name=yytext;
                         g_token->isEMailAddr=FALSE;
                         return TK_URL;
                        }
-<St_Para>("http:"|"https:"|"ftp:"|"file:"|"news:"){URLMASK} { // URL
+<St_Para>{URLPROTOCOL}{URLMASK} { // URL
                          g_token->name=yytext;
                         g_token->isEMailAddr=FALSE;
                         return TK_URL;
                        }
-<St_Para>"<"("http:"|"https:"|"ftp:"|"file:"|"news:"){URLMASK}">" { // URL
+<St_Para>"<"{URLPROTOCOL}{URLMASK}">" { // URL
                          g_token->name=yytext;
                          g_token->name = g_token->name.mid(1,g_token->name.length()-2);
                         g_token->isEMailAddr=FALSE;
                         return TK_URL;
                        }
-<St_Para>{MAILADR}     { // Mail address
+<St_Para>{MAILADDR}    { // Mail address
                          g_token->name=yytext;
                          g_token->name.stripPrefix("mailto:");
                         g_token->isEMailAddr=TRUE;
                         return TK_URL;
                        }
-<St_Para>"<"{MAILADR}">" { // Mail address
+<St_Para>"<"{MAILADDR}">" { // Mail address
                          g_token->name=yytext;
                          g_token->name = g_token->name.mid(1,g_token->name.length()-2);
                          g_token->name.stripPrefix("mailto:");
                         g_token->isEMailAddr=TRUE;
                         return TK_URL;
                        }
+<St_Para>"<"{MAILADDR2}">" { // anti spam mail address
+                         g_token->name=yytext;
+                        return TK_WORD;
+                       }
 <St_Para>"$"{ID}":"[^:\n$][^\n$]*"$" { /* RCS tag */
                          QCString tagName(yytext+1);
                         int index=tagName.find(':');
@@ -677,7 +682,7 @@ REFWORD_NOCV   {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
 <St_Para,St_HtmlOnly,St_ManOnly,St_LatexOnly,St_RtfOnly,St_XmlOnly,St_DbOnly>"$("{ID}"("{ID}"))"   { /* environment variable */
                          QCString name = &yytext[2];
                         name = name.left(name.length()-1);
-                        QCString value = portable_getenv(name);
+                        QCString value = Portable::getenv(name);
                         for (int i=value.length()-1;i>=0;i--) unput(value.at(i));
                        }
 <St_Para>{HTMLTAG}     { /* html tag */ 
@@ -1369,8 +1374,8 @@ REFWORD_NOCV   {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
 
 //--------------------------------------------------------------------------
 
-void doctokenizerYYFindSections(const char *input,Definition *d,
-                                MemberGroup *mg,const char *fileName)
+void doctokenizerYYFindSections(const char *input,const Definition *d,
+                                const char *fileName)
 {
   if (input==0) return;
   printlex(yy_flex_debug, TRUE, __FILE__, fileName);
@@ -1378,7 +1383,6 @@ void doctokenizerYYFindSections(const char *input,Definition *d,
   //printf("parsing --->'%s'<---\n",input);
   g_inputPos    = 0;
   g_definition  = d;
-  g_memberGroup = mg;
   g_fileName    = fileName;
   BEGIN(St_Sections);
   doctokenizerYYlineno = 1;
@@ -1615,9 +1619,5 @@ void doctokenizerYYendAutoList()
 //  printlex(yy_flex_debug, FALSE, __FILE__, g_fileName);
 //  return retval;
 //}
-#if !defined(YY_FLEX_SUBMINOR_VERSION) 
-extern "C" { // some bogus code to keep the compiler happy
-    void doctokenizerYYdummy() { yy_flex_realloc(0,0); }
-}
-#endif
 
+#include "doctokenizer.l.h"
index 5cdf92c..f26bee4 100644 (file)
 #include <stdlib.h>
 
 #include <qdir.h>
-#include <qfile.h>
-#include <qqueue.h>
-#include <qthread.h>
-#include <qmutex.h>
-#include <qwaitcondition.h>
-#include <qregexp.h>
 
 #include "config.h"
 #include "dot.h"
 
 #define MAP_CMD "cmapx"
 
-static int DOT_NUM_THREADS;   // will be initialized in initDot
-
 //--------------------------------------------------------------------
 
-void initDot()
-{
-  DotGraph::DOT_FONTNAME = Config_getString(DOT_FONTNAME);
-  if (DotGraph::DOT_FONTNAME.isEmpty())
-  {
-    DotGraph::DOT_FONTNAME="Helvetica";
-  }
-
-  DotGraph::DOT_FONTSIZE = Config_getInt(DOT_FONTSIZE);
-  if (DotGraph::DOT_FONTSIZE<4) DotGraph::DOT_FONTSIZE=4;
-
-  DOT_NUM_THREADS = Config_getInt(DOT_NUM_THREADS);
-  if (DOT_NUM_THREADS > 32) DOT_NUM_THREADS = 32;
-  if (DOT_NUM_THREADS <= 0) DOT_NUM_THREADS = QMAX(2,QThread::idealThreadCount()+1);
-
-  // these are copied to be sure to be thread save
-  DotRunner::DOT_CLEANUP = Config_getBool(DOT_CLEANUP);
-  DotRunner::DOT_MULTI_TARGETS = Config_getBool(DOT_MULTI_TARGETS);
-  DotRunner::DOT_EXE.init(Config_getString(DOT_PATH) + "dot");
-
-  DotGraph::IMG_EXT = getDotImageExtension();
-}
-
-
 static QCString g_dotFontPath;
 
 static void setDotFontPath(const char *path)
 {
   ASSERT(g_dotFontPath.isEmpty());
-  g_dotFontPath = portable_getenv("DOTFONTPATH");
+  g_dotFontPath = Portable::getenv("DOTFONTPATH");
   QCString newFontPath = Config_getString(DOT_FONTPATH);
   QCString spath = path;
   if (!newFontPath.isEmpty() && !spath.isEmpty())
   {
-    newFontPath.prepend(spath+portable_pathListSeparator());
+    newFontPath.prepend(spath+Portable::pathListSeparator());
   }
   else if (newFontPath.isEmpty() && !spath.isEmpty())
   {
@@ -83,114 +51,25 @@ static void setDotFontPath(const char *path)
   }
   else
   {
-    portable_unsetenv("DOTFONTPATH");
+    Portable::unsetenv("DOTFONTPATH");
     return;
   }
-  portable_setenv("DOTFONTPATH",newFontPath);
+  Portable::setenv("DOTFONTPATH",newFontPath);
 }
 
 static void unsetDotFontPath()
 {
   if (g_dotFontPath.isEmpty())
   {
-    portable_unsetenv("DOTFONTPATH");
+    Portable::unsetenv("DOTFONTPATH");
   }
   else
   {
-    portable_setenv("DOTFONTPATH",g_dotFontPath);
+    Portable::setenv("DOTFONTPATH",g_dotFontPath);
   }
   g_dotFontPath="";
 }
 
-// extract size from a dot generated SVG file
-static bool readSVGSize(const QCString &fileName,int *width,int *height)
-{
-  bool found=FALSE;
-  QFile f(fileName);
-  if (!f.open(IO_ReadOnly))
-  {
-    return FALSE;
-  }
-  const int maxLineLen=4096;
-  char buf[maxLineLen];
-  while (!f.atEnd() && !found)
-  {
-    int numBytes = f.readLine(buf,maxLineLen-1); // read line
-    if (numBytes>0)
-    {
-      buf[numBytes]='\0';
-      if (qstrncmp(buf,"<!--zoomable ",13)==0)
-      {
-        *width=-1;
-        *height=-1;
-        sscanf(buf,"<!--zoomable %d",height);
-        //printf("Found zoomable for %s!\n",fileName.data());
-        found=TRUE;
-      }
-      else if (sscanf(buf,"<svg width=\"%dpt\" height=\"%dpt\"",width,height)==2)
-      {
-        //printf("Found fixed size %dx%d for %s!\n",*width,*height,fileName.data());
-        found=TRUE;
-      }
-    }
-    else // read error!
-    {
-      //printf("Read error %d!\n",numBytes);
-      return FALSE;
-    }
-  }
-  return TRUE;
-}
-
-static void writeSVGNotSupported(FTextStream &out)
-{
-  out << "<p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p>";
-}
-
-// check if a reference to a SVG figure can be written and does so if possible.
-// return FALSE if not possible (for instance because the SVG file is not yet generated).
-bool writeSVGFigureLink(FTextStream &out,const QCString &relPath,
-                        const QCString &baseName,const QCString &absImgName)
-{
-  int width=600,height=600;
-  if (!readSVGSize(absImgName,&width,&height))
-  {
-    return FALSE;
-  }
-  if (width==-1)
-  {
-    if (height<=60) 
-      height=300;
-    else 
-      height+=300; // add some extra space for zooming
-    if (height>600) height=600; // clip to maximum height of 600 pixels
-    out << "<div class=\"zoom\">";
-    //out << "<object type=\"image/svg+xml\" data=\"" 
-    //out << "<embed type=\"image/svg+xml\" src=\"" 
-    out << "<iframe scrolling=\"no\" frameborder=\"0\" src=\"" 
-        << relPath << baseName << ".svg\" width=\"100%\" height=\"" << height << "\">";
-  }
-  else
-  {
-    //out << "<object type=\"image/svg+xml\" data=\"" 
-    //out << "<embed type=\"image/svg+xml\" src=\"" 
-    out << "<iframe scrolling=\"no\" frameborder=\"0\" src=\"" 
-        << relPath << baseName << ".svg\" width=\"" 
-        << ((width*96+48)/72) << "\" height=\"" 
-        << ((height*96+48)/72) << "\">";
-  }
-  writeSVGNotSupported(out);
-  //out << "</object>";
-  //out << "</embed>";
-  out << "</iframe>";
-  if (width==-1)
-  {
-    out << "</div>";
-  }
-
-  return TRUE;
-}
-
 //--------------------------------------------------------------------
 
 DotManager *DotManager::m_theInstance = 0;
@@ -204,15 +83,16 @@ DotManager *DotManager::instance()
   return m_theInstance;
 }
 
-DotManager::DotManager() : m_dotMaps(1009)
+DotManager::DotManager() : m_runners(1009), m_filePatchers(1009)
 {
   m_runners.setAutoDelete(TRUE);
-  m_dotMaps.setAutoDelete(TRUE);
+  m_filePatchers.setAutoDelete(TRUE);
   m_queue = new DotRunnerQueue;
   int i;
-  if (DOT_NUM_THREADS!=1)
+  int dotNumThreads = Config_getInt(DOT_NUM_THREADS);
+  if (dotNumThreads!=1)
   {
-    for (i=0;i<DOT_NUM_THREADS;i++)
+    for (i=0;i<dotNumThreads;i++)
     {
       DotWorkerThread *thread = new DotWorkerThread(m_queue);
       thread->start();
@@ -253,62 +133,22 @@ DotRunner* DotManager::createRunner(const QCString& absDotName, const QCString&
   return run;
 }
 
-
-int DotManager::addMap(const QCString &file,const QCString &mapFile,
-                const QCString &relPath,bool urlOnly,const QCString &context,
-                const QCString &label)
-{
-  DotFilePatcher *map = m_dotMaps.find(file);
-  if (map==0)
-  {
-    map = new DotFilePatcher(file);
-    m_dotMaps.append(file,map);
-  }
-  return map->addMap(mapFile,relPath,urlOnly,context,label);
-}
-
-int DotManager::addFigure(const QCString &file,const QCString &baseName,
-                          const QCString &figureName,bool heightCheck)
-{
-  DotFilePatcher *map = m_dotMaps.find(file);
-  if (map==0)
-  {
-    map = new DotFilePatcher(file);
-    m_dotMaps.append(file,map);
-  }
-  return map->addFigure(baseName,figureName,heightCheck);
-}
-
-int DotManager::addSVGConversion(const QCString &file,const QCString &relPath,
-                       bool urlOnly,const QCString &context,bool zoomable,
-                       int graphId)
+DotFilePatcher *DotManager::createFilePatcher(const QCString &fileName)
 {
-  DotFilePatcher *map = m_dotMaps.find(file);
-  if (map==0)
+  DotFilePatcher *patcher = m_filePatchers.find(fileName);
+  if (patcher==0)
   {
-    map = new DotFilePatcher(file);
-    m_dotMaps.append(file,map);
+    patcher = new DotFilePatcher(fileName);
+    m_filePatchers.append(fileName,patcher);
   }
-  return map->addSVGConversion(relPath,urlOnly,context,zoomable,graphId);
+  return patcher;
 }
 
-int DotManager::addSVGObject(const QCString &file,const QCString &baseName,
-                             const QCString &absImgName,const QCString &relPath)
-{
-  DotFilePatcher *map = m_dotMaps.find(file);
-  if (map==0)
-  {
-    map = new DotFilePatcher(file);
-    m_dotMaps.append(file,map);
-  }
-  return map->addSVGObject(baseName,absImgName,relPath);
-}
-
-bool DotManager::run()
+bool DotManager::run() const
 {
   uint numDotRuns = m_runners.count();
-  uint numDotMaps = m_dotMaps.count();
-  if (numDotRuns+numDotMaps>1)
+  uint numFilePatchers = m_filePatchers.count();
+  if (numDotRuns+numFilePatchers>1)
   {
     if (m_workers.count()==0)
     {
@@ -316,7 +156,7 @@ bool DotManager::run()
     }
     else
     {
-      msg("Generating dot graphs using %d parallel threads...\n",QMIN(numDotRuns+numDotMaps,m_workers.count()));
+      msg("Generating dot graphs using %d parallel threads...\n",QMIN(numDotRuns+numFilePatchers,m_workers.count()));
     }
   }
   int i=1;
@@ -343,7 +183,7 @@ bool DotManager::run()
     setDotFontPath(Config_getString(DOCBOOK_OUTPUT));
     setPath=TRUE;
   }
-  portable_sysTimerStart();
+  Portable::sysTimerStart();
   // fill work queue with dot operations
   DotRunner *dr;
   int prev=1;
@@ -371,7 +211,7 @@ bool DotManager::run()
         msg("Running dot for graph %d/%d\n",prev,numDotRuns);
         prev++;
       }
-      portable_sleep(100);
+      Portable::sleep(100);
     }
     while ((int)numDotRuns>=prev)
     {
@@ -389,7 +229,7 @@ bool DotManager::run()
       m_workers.at(i)->wait();
     }
   }
-  portable_sysTimerStop();
+  Portable::sysTimerStop();
   if (setPath)
   {
     unsetDotFontPath();
@@ -397,27 +237,27 @@ bool DotManager::run()
 
   // patch the output file and insert the maps and figures
   i=1;
-  SDict<DotFilePatcher>::Iterator di(m_dotMaps);
-  DotFilePatcher *map;
+  SDict<DotFilePatcher>::Iterator di(m_filePatchers);
+  const DotFilePatcher *fp;
   // since patching the svg files may involve patching the header of the SVG
   // (for zoomable SVGs), and patching the .html files requires reading that
   // header after the SVG is patched, we first process the .svg files and 
   // then the other files. 
-  for (di.toFirst();(map=di.current());++di)
+  for (di.toFirst();(fp=di.current());++di)
   {
-    if (map->file().right(4)==".svg")
+    if (fp->isSVGFile())
     {
-      msg("Patching output file %d/%d\n",i,numDotMaps);
-      if (!map->run()) return FALSE;
+      msg("Patching output file %d/%d\n",i,numFilePatchers);
+      if (!fp->run()) return FALSE;
       i++;
     }
   }
-  for (di.toFirst();(map=di.current());++di)
+  for (di.toFirst();(fp=di.current());++di)
   {
-    if (map->file().right(4)!=".svg")
+    if (!fp->isSVGFile())
     {
-      msg("Patching output file %d/%d\n",i,numDotMaps);
-      if (!map->run()) return FALSE;
+      msg("Patching output file %d/%d\n",i,numFilePatchers);
+      if (!fp->run()) return FALSE;
       i++;
     }
   }
@@ -426,70 +266,13 @@ bool DotManager::run()
 
 //--------------------------------------------------------------------
 
-class GraphLegendDotGraph : public DotGraph
-{
-  private:
-    virtual QCString getBaseName() const
-    {
-      return "graph_legend";
-    }
-
-    virtual void computeTheGraph()
-    {
-      FTextStream md5stream(&m_theGraph);
-      writeGraphHeader(md5stream,theTranslator->trLegendTitle());
-      md5stream << "  Node9 [shape=\"box\",label=\"Inherited\",fontsize=\"" << DOT_FONTSIZE << "\",height=0.2,width=0.4,fontname=\"" << DOT_FONTNAME << "\",fillcolor=\"grey75\",style=\"filled\" fontcolor=\"black\"];\n";
-      md5stream << "  Node10 -> Node9 [dir=\"back\",color=\"midnightblue\",fontsize=\"" << DOT_FONTSIZE << "\",style=\"solid\",fontname=\"" << DOT_FONTNAME << "\"];\n";
-      md5stream << "  Node10 [shape=\"box\",label=\"PublicBase\",fontsize=\"" << DOT_FONTSIZE << "\",height=0.2,width=0.4,fontname=\"" << DOT_FONTNAME << "\",color=\"black\",URL=\"$classPublicBase" << Doxygen::htmlFileExtension << "\"];\n";
-      md5stream << "  Node11 -> Node10 [dir=\"back\",color=\"midnightblue\",fontsize=\"" << DOT_FONTSIZE << "\",style=\"solid\",fontname=\"" << DOT_FONTNAME << "\"];\n";
-      md5stream << "  Node11 [shape=\"box\",label=\"Truncated\",fontsize=\"" << DOT_FONTSIZE << "\",height=0.2,width=0.4,fontname=\"" << DOT_FONTNAME << "\",color=\"red\",URL=\"$classTruncated" << Doxygen::htmlFileExtension << "\"];\n";
-      md5stream << "  Node13 -> Node9 [dir=\"back\",color=\"darkgreen\",fontsize=\"" << DOT_FONTSIZE << "\",style=\"solid\",fontname=\"" << DOT_FONTNAME << "\"];\n";
-      md5stream << "  Node13 [shape=\"box\",label=\"ProtectedBase\",fontsize=\"" << DOT_FONTSIZE << "\",height=0.2,width=0.4,fontname=\"" << DOT_FONTNAME << "\",color=\"black\",URL=\"$classProtectedBase" << Doxygen::htmlFileExtension << "\"];\n";
-      md5stream << "  Node14 -> Node9 [dir=\"back\",color=\"firebrick4\",fontsize=\"" << DOT_FONTSIZE << "\",style=\"solid\",fontname=\"" << DOT_FONTNAME << "\"];\n";
-      md5stream << "  Node14 [shape=\"box\",label=\"PrivateBase\",fontsize=\"" << DOT_FONTSIZE << "\",height=0.2,width=0.4,fontname=\"" << DOT_FONTNAME << "\",color=\"black\",URL=\"$classPrivateBase" << Doxygen::htmlFileExtension << "\"];\n";
-      md5stream << "  Node15 -> Node9 [dir=\"back\",color=\"midnightblue\",fontsize=\"" << DOT_FONTSIZE << "\",style=\"solid\",fontname=\"" << DOT_FONTNAME << "\"];\n";
-      md5stream << "  Node15 [shape=\"box\",label=\"Undocumented\",fontsize=\"" << DOT_FONTSIZE << "\",height=0.2,width=0.4,fontname=\"" << DOT_FONTNAME << "\",color=\"grey75\"];\n";
-      md5stream << "  Node16 -> Node9 [dir=\"back\",color=\"midnightblue\",fontsize=\"" << DOT_FONTSIZE << "\",style=\"solid\",fontname=\"" << DOT_FONTNAME << "\"];\n";
-      md5stream << "  Node16 [shape=\"box\",label=\"Templ< int >\",fontsize=\"" << DOT_FONTSIZE << "\",height=0.2,width=0.4,fontname=\"" << DOT_FONTNAME << "\",color=\"black\",URL=\"$classTempl" << Doxygen::htmlFileExtension << "\"];\n";
-      md5stream << "  Node17 -> Node16 [dir=\"back\",color=\"orange\",fontsize=\"" << DOT_FONTSIZE << "\",style=\"dashed\",label=\"< int >\",fontname=\"" << DOT_FONTNAME << "\"];\n";
-      md5stream << "  Node17 [shape=\"box\",label=\"Templ< T >\",fontsize=\"" << DOT_FONTSIZE << "\",height=0.2,width=0.4,fontname=\"" << DOT_FONTNAME << "\",color=\"black\",URL=\"$classTempl" << Doxygen::htmlFileExtension << "\"];\n";
-      md5stream << "  Node18 -> Node9 [dir=\"back\",color=\"darkorchid3\",fontsize=\"" << DOT_FONTSIZE << "\",style=\"dashed\",label=\"m_usedClass\",fontname=\"" << DOT_FONTNAME << "\"];\n";
-      md5stream << "  Node18 [shape=\"box\",label=\"Used\",fontsize=\"" << DOT_FONTSIZE << "\",height=0.2,width=0.4,fontname=\"" << DOT_FONTNAME << "\",color=\"black\",URL=\"$classUsed" << Doxygen::htmlFileExtension << "\"];\n";
-      writeGraphFooter(md5stream);
-    }
-
-    virtual QCString getMapLabel() const
-    {
-      return "";
-    }
-
-    friend void generateGraphLegend(const char* path);
-};
-
-void generateGraphLegend(const char *path)
-{
-  QDir d(path);
-  GraphLegendDotGraph dg;
-  FTextStream ts;
-  dg.writeGraph(ts, GOF_BITMAP, EOF_Html, path, "", "", FALSE, 0);
-
-  if (getDotImageExtension()=="svg")
-  {
-    DotManager::instance()->addSVGObject(
-        dg.absBaseName()+Config_getString(HTML_FILE_EXTENSION),
-        "graph_legend",
-        dg.absImgName(),QCString());
-  }
-
-}
-
 void writeDotGraphFromFile(const char *inFile,const char *outDir,
                            const char *outFile,GraphOutputFormat format)
 {
   QDir d(outDir);
   if (!d.exists())
   {
-    err("Output dir %s does not exist!\n",outDir); exit(1);
+    term("Output dir %s does not exist!\n",outDir);
   }
 
   QCString imgExt = getDotImageExtension();
@@ -542,7 +325,7 @@ void writeDotImageMapFromFile(FTextStream &t,
   QDir d(outDir);
   if (!d.exists())
   {
-    err("Output dir %s does not exist!\n",outDir.data()); exit(1);
+    term("Output dir %s does not exist!\n",outDir.data());
   }
 
   QCString mapName = baseName+".map";
@@ -560,10 +343,8 @@ void writeDotImageMapFromFile(FTextStream &t,
 
   if (imgExt=="svg") // vector graphics
   {
-    //writeSVGFigureLink(t,relPath,inFile,inFile+".svg");
-    //DotFilePatcher patcher(inFile+".svg");
     QCString svgName=outDir+"/"+baseName+".svg";
-    writeSVGFigureLink(t,relPath,baseName,svgName);
+    DotFilePatcher::writeSVGFigureLink(t,relPath,baseName,svgName);
     DotFilePatcher patcher(svgName);
     patcher.addSVGConversion("",TRUE,context,TRUE,graphId);
     patcher.run();
@@ -575,7 +356,7 @@ void writeDotImageMapFromFile(FTextStream &t,
 
     t << "<img src=\"" << relPath << imgName << "\" alt=\""
       << imgName << "\" border=\"0\" usemap=\"#" << mapName << "\"/>" << endl;
-    convertMapFile(tt, absOutFile, relPath ,TRUE, context);
+    DotFilePatcher::convertMapFile(tt, absOutFile, relPath ,TRUE, context);
     if (!result.isEmpty())
     {
       t << "<map name=\"" << mapName << "\" id=\"" << mapName << "\">";
index 124a32b..60f7f26 100644 (file)
--- a/src/dot.h
+++ b/src/dot.h
 
 #include <qlist.h>
 #include <qdict.h>
-#include <qwaitcondition.h>
-#include <qmutex.h>
-#include <qqueue.h>
-#include <qthread.h>
+#include <qcstring.h>
+
 #include "sortdict.h"
-#include "qgstring.h"
-#include "qdir.h"
-#include "qcstring.h"
-#include "dotgraph.h"
+
+#include "dotgraph.h" // only for GraphOutputFormat
 #include "dotfilepatcher.h"
 #include "dotrunner.h"
 
 class FTextStream;
 class DotRunner;
 class DotRunnerQueue;
-class DotWorkerThread;
 
-/** Singleton that manages dot relation actions */
+/** Singleton that manages parallel dot invocations and patching files for embedding image maps */
 class DotManager
 {
   public:
     static DotManager *instance();
-    DotRunner* createRunner(const QCString& absDotName, const QCString& md5Hash);
-    int  addMap(const QCString &file,const QCString &mapFile,
-                const QCString &relPath,bool urlOnly,
-                const QCString &context,const QCString &label);
-    int addFigure(const QCString &file,const QCString &baseName,
-                  const QCString &figureName,bool heightCheck);
-    int addSVGConversion(const QCString &file,const QCString &relPath,
-               bool urlOnly,const QCString &context,bool zoomable,int graphId);
-    int addSVGObject(const QCString &file,const QCString &baseName,
-                     const QCString &figureNAme,const QCString &relPath);
-    bool run();
+    DotRunner*      createRunner(const QCString& absDotName, const QCString& md5Hash);
+    DotFilePatcher *createFilePatcher(const QCString &fileName);
+    bool run() const;
 
   private:
     DotManager();
     virtual ~DotManager();
 
     QDict<DotRunner>       m_runners;
-    SDict<DotFilePatcher> m_dotMaps;
+    SDict<DotFilePatcher>  m_filePatchers;
     static DotManager     *m_theInstance;
     DotRunnerQueue        *m_queue;
     QList<DotWorkerThread> m_workers;
 };
 
-void initDot();
-
-/** Generated a graphs legend page */
-void generateGraphLegend(const char *path);
-
 void writeDotGraphFromFile(const char *inFile,const char *outDir,
                            const char *outFile,GraphOutputFormat format);
 void writeDotImageMapFromFile(FTextStream &t,
                               const QCString& inFile, const QCString& outDir,
                               const QCString& relPath,const QCString& baseName,
                               const QCString& context,int graphId=-1);
-bool writeSVGFigureLink(FTextStream &out,const QCString &relPath,
-                        const QCString &baseName,const QCString &absImgName);
-bool convertMapFile(FTextStream &t,const char *mapName,
-                    const QCString relPath, bool urlOnly=FALSE,
-                    const QCString &context=QCString());
 
 #endif
index 15d408a..5e13f8e 100644 (file)
 #define DOT_GRAPH_MAX_NODES   Config_getInt(DOT_GRAPH_MAX_NODES)
 #define MAX_DOT_GRAPH_DEPTH   Config_getInt(MAX_DOT_GRAPH_DEPTH)
 
+static QCString getUniqueId(const MemberDef *md)
+{
+  QCString result = md->getReference()+"$"+
+         md->getOutputFileBase()+"#"+
+         md->anchor();
+  return result;
+}
+
 void DotCallGraph::buildGraph(DotNode *n,const MemberDef *md,int distance)
 {
   MemberSDict *refs = m_inverse ? md->getReferencedByMembers() : md->getReferencesMembers();
@@ -36,9 +44,7 @@ void DotCallGraph::buildGraph(DotNode *n,const MemberDef *md,int distance)
     {
       if (rmd->showInCallGraph())
       {
-        QCString uniqueId;
-        uniqueId=rmd->getReference()+"$"+
-          rmd->getOutputFileBase()+"#"+rmd->anchor();
+        QCString uniqueId = getUniqueId(rmd);
         DotNode *bn  = m_usedNodes->find(uniqueId);
         if (bn) // file is already a node in the graph
         {
@@ -131,9 +137,7 @@ DotCallGraph::DotCallGraph(const MemberDef *md,bool inverse)
   m_inverse = inverse;
   m_diskName = md->getOutputFileBase()+"_"+md->anchor();
   m_scope    = md->getOuterScope();
-  QCString uniqueId;
-  uniqueId = md->getReference()+"$"+
-    md->getOutputFileBase()+"#"+md->anchor();
+  QCString uniqueId = getUniqueId(md);
   QCString name;
   if (HIDE_SCOPE_NAMES)
   {
@@ -212,6 +216,11 @@ bool DotCallGraph::isTrivial() const
 
 bool DotCallGraph::isTooBig() const
 {
-  int numNodes = m_startNode->children() ? m_startNode->children()->count() : 0;
-  return numNodes>=DOT_GRAPH_MAX_NODES;
+  return numNodes()>=DOT_GRAPH_MAX_NODES;
 }
+
+int DotCallGraph::numNodes() const
+{
+  return m_startNode->children() ? m_startNode->children()->count() : 0;
+}
+
index c96b9cf..bba976c 100644 (file)
@@ -28,6 +28,7 @@ class DotCallGraph : public DotGraph
     ~DotCallGraph();
     bool isTrivial() const;
     bool isTooBig() const;
+    int numNodes() const;
     QCString writeGraph(FTextStream &t, GraphOutputFormat gf, EmbeddedOutputFormat ef,
                         const char *path,const char *fileName,
                         const char *relPath,bool writeImageMap=TRUE,
index 3f5d228..da272b4 100644 (file)
@@ -420,13 +420,18 @@ bool DotClassGraph::isTrivial() const
 
 bool DotClassGraph::isTooBig() const
 {
+  return numNodes()>=DOT_GRAPH_MAX_NODES;
+}
+
+int DotClassGraph::numNodes() const
+{
   int numNodes = 0;
   numNodes+= m_startNode->children() ? m_startNode->children()->count() : 0;
   if (m_graphType==Inheritance)
   {
     numNodes+= m_startNode->parents() ? m_startNode->parents()->count() : 0;
   }
-  return numNodes>=DOT_GRAPH_MAX_NODES;
+  return numNodes;
 }
 
 DotClassGraph::~DotClassGraph()
index b3b9291..1874f54 100644 (file)
@@ -28,6 +28,7 @@ public:
   ~DotClassGraph();
   bool isTrivial() const;
   bool isTooBig() const;
+  int numNodes() const;
   QCString writeGraph(FTextStream &t,GraphOutputFormat gf,EmbeddedOutputFormat ef,
     const char *path, const char *fileName, const char *relPath,
     bool TBRank=TRUE,bool imageMap=TRUE,int graphId=-1);
index 85906d1..c70128c 100644 (file)
 
 void writeDotDirDepGraph(FTextStream &t,const DirDef *dd,bool linkRelations)
 {
+  int fontSize = Config_getInt(DOT_FONTSIZE);
+  QCString fontName = Config_getString(DOT_FONTNAME);
   t << "digraph \"" << dd->displayName() << "\" {\n";
   if (Config_getBool(DOT_TRANSPARENT))
   {
     t << "  bgcolor=transparent;\n";
   }
   t << "  compound=true\n";
-  t << "  node [ fontsize=\"" << DotGraph::DOT_FONTSIZE << "\", fontname=\"" << DotGraph::DOT_FONTNAME << "\"];\n";
-  t << "  edge [ labelfontsize=\"" << DotGraph::DOT_FONTSIZE << "\", labelfontname=\"" << DotGraph::DOT_FONTNAME << "\"];\n";
+  t << "  node [ fontsize=\"" << fontSize << "\", fontname=\"" << fontName << "\"];\n";
+  t << "  edge [ labelfontsize=\"" << fontSize << "\", labelfontname=\"" << fontName << "\"];\n";
 
   QDict<DirDef> dirsInGraph(257);
 
@@ -39,7 +41,7 @@ void writeDotDirDepGraph(FTextStream &t,const DirDef *dd,bool linkRelations)
     t << "  subgraph cluster" << dd->parent()->getOutputFileBase() << " {\n";
     t << "    graph [ bgcolor=\"#ddddee\", pencolor=\"black\", label=\"" 
       << dd->parent()->shortName() 
-      << "\" fontname=\"" << DotGraph::DOT_FONTNAME << "\", fontsize=\"" << DotGraph::DOT_FONTSIZE << "\", URL=\"";
+      << "\" fontname=\"" << fontName << "\", fontsize=\"" << fontSize << "\", URL=\"";
     t << dd->parent()->getOutputFileBase() << Doxygen::htmlFileExtension;
     t << "\"]\n";
   }
@@ -138,8 +140,8 @@ void writeDotDirDepGraph(FTextStream &t,const DirDef *dd,bool linkRelations)
     for (udi.toFirst();(udir=udi.current());++udi) // foreach used dir
     {
       const DirDef *usedDir=udir->dir();
-      if ((dir!=dd || !udir->inherited()) &&     // only show direct dependendies for this dir
-        (usedDir!=dd || !udir->inherited()) && // only show direct dependendies for this dir
+      if ((dir!=dd || !udir->inherited()) &&     // only show direct dependencies for this dir
+        (usedDir!=dd || !udir->inherited()) && // only show direct dependencies for this dir
         !usedDir->isParentOf(dir) &&             // don't point to own parent
         dirsInGraph.find(usedDir->getOutputFileBase())) // only point to nodes that are in the graph
       {
index f5eef65..a71e8f1 100644 (file)
@@ -43,9 +43,9 @@ class DotDirDeps : public DotGraph
     virtual QCString getImgAltText() const;
 
   private:
-    const DirDef *m_dir;
+    const DirDef *m_dir = 0;
 
-    bool m_linkRelations;
+    bool m_linkRelations = false;
 };
 
 #endif
index 91b7c78..efc6341 100644 (file)
@@ -14,6 +14,7 @@
 */
 
 #include "dotfilepatcher.h"
+#include "dotrunner.h"
 
 #include "qstring.h"
 #include "config.h"
@@ -209,7 +210,7 @@ static QCString replaceRef(const QCString &buf,const QCString relPath,
 *                 map file was found
 *  \returns TRUE if successful.
 */
-bool convertMapFile(FTextStream &t,const char *mapName,
+bool DotFilePatcher::convertMapFile(FTextStream &t,const char *mapName,
                     const QCString relPath, bool urlOnly,
                     const QCString &context)
 {
@@ -255,9 +256,9 @@ DotFilePatcher::DotFilePatcher(const char *patchFile)
   m_maps.setAutoDelete(TRUE);
 }
 
-QCString DotFilePatcher::file() const
+bool DotFilePatcher::isSVGFile() const
 {
-  return m_patchFile;
+  return m_patchFile.right(4)==".svg";
 }
 
 int DotFilePatcher::addMap(const QCString &mapFile,const QCString &relPath,
@@ -320,7 +321,7 @@ int DotFilePatcher::addSVGObject(const QCString &baseName,
   return id;
 }
 
-bool DotFilePatcher::run()
+bool DotFilePatcher::run() const
 {
   //printf("DotFilePatcher::run(): %s\n",m_patchFile.data());
   bool interactiveSVG_local = Config_getBool(INTERACTIVE_SVG);
@@ -336,8 +337,8 @@ bool DotFilePatcher::run()
     //printf("DotFilePatcher::addSVGConversion: file=%s zoomable=%d\n",
     //    m_patchFile.data(),map->zoomable);
   }
-  QString tmpName = QString::fromUtf8(m_patchFile+".tmp");
-  QString patchFile = QString::fromUtf8(m_patchFile);
+  QCString tmpName = m_patchFile+".tmp";
+  QCString patchFile = m_patchFile;
   if (!QDir::current().rename(patchFile,tmpName))
   {
     err("Failed to rename file %s to %s!\n",m_patchFile.data(),tmpName.data());
@@ -479,7 +480,7 @@ bool DotFilePatcher::run()
         Map *map = m_maps.at(mapId);
         //printf("patching FIG %d in file %s with contents of %s\n",
         //   mapId,m_patchFile.data(),map->mapFile.data());
-        if (!DotGraph::writeVecGfxFigure(t,map->label,map->mapFile))
+        if (!writeVecGfxFigure(t,map->label,map->mapFile))
         {
           err("problem writing FIG %d figure!\n",mapId);
           return FALSE;
@@ -537,3 +538,144 @@ bool DotFilePatcher::run()
   QDir::current().remove(tmpName);
   return TRUE;
 }
+
+//---------------------------------------------------------------------------------------------
+
+
+// extract size from a dot generated SVG file
+static bool readSVGSize(const QCString &fileName,int *width,int *height)
+{
+  bool found=FALSE;
+  QFile f(fileName);
+  if (!f.open(IO_ReadOnly))
+  {
+    return FALSE;
+  }
+  const int maxLineLen=4096;
+  char buf[maxLineLen];
+  while (!f.atEnd() && !found)
+  {
+    int numBytes = f.readLine(buf,maxLineLen-1); // read line
+    if (numBytes>0)
+    {
+      buf[numBytes]='\0';
+      if (qstrncmp(buf,"<!--zoomable ",13)==0)
+      {
+        *width=-1;
+        *height=-1;
+        sscanf(buf,"<!--zoomable %d",height);
+        //printf("Found zoomable for %s!\n",fileName.data());
+        found=TRUE;
+      }
+      else if (sscanf(buf,"<svg width=\"%dpt\" height=\"%dpt\"",width,height)==2)
+      {
+        //printf("Found fixed size %dx%d for %s!\n",*width,*height,fileName.data());
+        found=TRUE;
+      }
+    }
+    else // read error!
+    {
+      //printf("Read error %d!\n",numBytes);
+      return FALSE;
+    }
+  }
+  return TRUE;
+}
+
+static void writeSVGNotSupported(FTextStream &out)
+{
+  out << "<p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p>";
+}
+
+/// Check if a reference to a SVG figure can be written and do so if possible.
+/// Returns FALSE if not possible (for instance because the SVG file is not yet generated).
+bool DotFilePatcher::writeSVGFigureLink(FTextStream &out,const QCString &relPath,
+                        const QCString &baseName,const QCString &absImgName)
+{
+  int width=600,height=600;
+  if (!readSVGSize(absImgName,&width,&height))
+  {
+    return FALSE;
+  }
+  if (width==-1)
+  {
+    if (height<=60) height=300; else height+=300; // add some extra space for zooming
+    if (height>600) height=600; // clip to maximum height of 600 pixels
+    out << "<div class=\"zoom\">";
+    //out << "<object type=\"image/svg+xml\" data=\"" 
+    //out << "<embed type=\"image/svg+xml\" src=\"" 
+    out << "<iframe scrolling=\"no\" frameborder=\"0\" src=\"" 
+        << relPath << baseName << ".svg\" width=\"100%\" height=\"" << height << "\">";
+  }
+  else
+  {
+    //out << "<object type=\"image/svg+xml\" data=\"" 
+    //out << "<embed type=\"image/svg+xml\" src=\"" 
+    out << "<iframe scrolling=\"no\" frameborder=\"0\" src=\"" 
+        << relPath << baseName << ".svg\" width=\"" 
+        << ((width*96+48)/72) << "\" height=\"" 
+        << ((height*96+48)/72) << "\">";
+  }
+  writeSVGNotSupported(out);
+  //out << "</object>";
+  //out << "</embed>";
+  out << "</iframe>";
+  if (width==-1)
+  {
+    out << "</div>";
+  }
+
+  return TRUE;
+}
+
+bool DotFilePatcher::writeVecGfxFigure(FTextStream &out,const QCString &baseName,
+                                 const QCString &figureName)
+{
+  int width=400,height=550;
+  if (Config_getBool(USE_PDFLATEX))
+  {
+    if (!DotRunner::readBoundingBox(figureName+".pdf",&width,&height,FALSE))
+    {
+      //printf("writeVecGfxFigure()=0\n");
+      return FALSE;
+    }
+  }
+  else
+  {
+    if (!DotRunner::readBoundingBox(figureName+".eps",&width,&height,TRUE))
+    {
+      //printf("writeVecGfxFigure()=0\n");
+      return FALSE;
+    }
+  }
+  //printf("Got PDF/EPS size %d,%d\n",width,height);
+  int maxWidth  = 350;  /* approx. page width in points, excl. margins */
+  int maxHeight = 550;  /* approx. page height in points, excl. margins */ 
+  out << "\\nopagebreak\n"
+         "\\begin{figure}[H]\n"
+         "\\begin{center}\n"
+         "\\leavevmode\n";
+  if (width>maxWidth || height>maxHeight) // figure too big for page
+  {
+    // c*width/maxWidth > c*height/maxHeight, where c=maxWidth*maxHeight>0
+    if (width*maxHeight>height*maxWidth)
+    {
+      out << "\\includegraphics[width=" << maxWidth << "pt]";
+    }
+    else
+    {
+      out << "\\includegraphics[height=" << maxHeight << "pt]";
+    }
+  }
+  else
+  {
+    out << "\\includegraphics[width=" << width << "pt]";
+  }
+
+  out << "{" << baseName << "}\n"
+         "\\end{center}\n"
+         "\\end{figure}\n";
+
+  //printf("writeVecGfxFigure()=1\n");
+  return TRUE;
+}
index dd5c511..b68208d 100644 (file)
 #include "qcstring.h"
 #include "qlist.h"
 
+class FTextStream;
+
 /** Helper class to insert a set of map file into an output file */
 class DotFilePatcher
 {
   public:
     DotFilePatcher(const char *patchFile);
+
     int addMap(const QCString &mapFile,const QCString &relPath,
                bool urlOnly,const QCString &context,const QCString &label);
+
     int addFigure(const QCString &baseName,
                   const QCString &figureName,bool heightCheck);
+
     int addSVGConversion(const QCString &relPath,bool urlOnly,
                          const QCString &context,bool zoomable,int graphId);
+
     int addSVGObject(const QCString &baseName, const QCString &figureName,
                      const QCString &relPath);
-    bool run();
-    QCString file() const;
+    bool run() const;
+    bool isSVGFile() const;
+
+    static bool convertMapFile(FTextStream &t,const char *mapName,
+                               const QCString relPath, bool urlOnly=FALSE,
+                               const QCString &context=QCString());
+
+    static bool writeSVGFigureLink(FTextStream &out,const QCString &relPath,
+                                   const QCString &baseName,const QCString &absImgName);
+
+    static bool writeVecGfxFigure(FTextStream& out, const QCString& baseName,
+                                  const QCString& figureName);
 
   private:
     struct Map
@@ -50,4 +66,5 @@ class DotFilePatcher
     QCString m_patchFile;
 };
 
+
 #endif
index 0a7942f..3d56de8 100644 (file)
@@ -86,7 +86,7 @@ void DotGfxHierarchyTable::writeGraph(FTextStream &out,
   // store the original directory
   if (!d.exists())
   {
-    err("Output dir %s does not exist!\n",path); exit(1);
+    term("Output dir %s does not exist!\n",path);
   }
 
   // put each connected subgraph of the hierarchy in a row of the HTML output
index ca6bcca..0bfa712 100644 (file)
 #include "dotrunner.h"
 #include "dotgraph.h"
 #include "dotnode.h"
+#include "dotfilepatcher.h"
 
 #define MAP_CMD "cmapx"
 
-QCString DotGraph::DOT_FONTNAME; // will be initialized in initDot
-int DotGraph::DOT_FONTSIZE;      // will be initialized in initDot
+//QCString DotGraph::DOT_FONTNAME; // will be initialized in initDot
+//int DotGraph::DOT_FONTSIZE;      // will be initialized in initDot
 
 /*! Checks if a file "baseName".md5 exists. If so the contents
 *  are compared with \a md5. If equal FALSE is returned.
@@ -90,7 +91,7 @@ static bool insertMapFile(FTextStream &out,const QCString &mapFile,
   {
     QGString tmpstr;
     FTextStream tmpout(&tmpstr);
-    convertMapFile(tmpout,mapFile,relPath,FALSE);
+    DotFilePatcher::convertMapFile(tmpout,mapFile,relPath,FALSE);
     if (!tmpstr.isEmpty())
     {
       out << "<map name=\"" << mapLabel << "\" id=\"" << mapLabel << "\">" << endl;
@@ -104,12 +105,10 @@ static bool insertMapFile(FTextStream &out,const QCString &mapFile,
 
 //--------------------------------------------------------------------
 
-QCString DotGraph::IMG_EXT;
-
 QCString DotGraph::imgName() const
 {
   return m_baseName + ((m_graphFormat == GOF_BITMAP) ?
-                      ("." + IMG_EXT) : (Config_getBool(USE_PDFLATEX) ? ".pdf" : ".eps")); 
+                      ("." + getDotImageExtension()) : (Config_getBool(USE_PDFLATEX) ? ".pdf" : ".eps")); 
 }
 
 QCString DotGraph::writeGraph(
@@ -118,7 +117,7 @@ QCString DotGraph::writeGraph(
         EmbeddedOutputFormat ef,  // html, latex, ...
         const char* path,         // output folder
         const char* fileName,     // name of the code file (for code patcher)
-        const char* relPath,      // output folder relativ to code file
+        const char* relPath,      // output folder relative to code file
         bool generateImageMap,    // in case of bitmap, shall there be code generated?
         int graphId)              // number of this graph in the current code, used in svg code
 {
@@ -148,7 +147,7 @@ bool DotGraph::prepareDotFile()
 {
   if (!m_dir.exists())
   {
-    err("Output dir %s does not exist!\n", m_dir.path().data()); exit(1);
+    term("Output dir %s does not exist!\n", m_dir.path().data());
   }
 
   QCString sigStr(33);
@@ -209,6 +208,7 @@ bool DotGraph::prepareDotFile()
 
 void DotGraph::generateCode(FTextStream &t)
 {
+  QCString imgExt = getDotImageExtension();
   if (m_graphFormat==GOF_BITMAP && m_textFormat==EOF_DocBook)
   {
     t << "<para>" << endl;
@@ -216,7 +216,7 @@ void DotGraph::generateCode(FTextStream &t)
     t << "        <mediaobject>" << endl;
     t << "            <imageobject>" << endl;
     t << "                <imagedata";
-    t << " width=\"50%\" align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\"" << m_relPath << m_baseName << "." << IMG_EXT << "\">";
+    t << " width=\"50%\" align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\"" << m_relPath << m_baseName << "." << imgExt << "\">";
     t << "</imagedata>" << endl;
     t << "            </imageobject>" << endl;
     t << "        </mediaobject>" << endl;
@@ -225,16 +225,20 @@ void DotGraph::generateCode(FTextStream &t)
   }
   else if (m_graphFormat==GOF_BITMAP && m_generateImageMap) // produce HTML to include the image
   {
-    if (IMG_EXT=="svg") // add link to SVG file without map file
+    if (imgExt=="svg") // add link to SVG file without map file
     {
       if (!m_noDivTag) t << "<div class=\"center\">";
-      if (m_regenerate || !writeSVGFigureLink(t,m_relPath,m_baseName,absImgName())) // need to patch the links in the generated SVG file
+      if (m_regenerate || !DotFilePatcher::writeSVGFigureLink(t,m_relPath,m_baseName,absImgName())) // need to patch the links in the generated SVG file
       {
         if (m_regenerate)
         {
-          DotManager::instance()->addSVGConversion(absImgName(),m_relPath,FALSE,QCString(),m_zoomable,m_graphId);
+          DotManager::instance()->
+               createFilePatcher(absImgName())->
+               addSVGConversion(m_relPath,FALSE,QCString(),m_zoomable,m_graphId);
         }
-        int mapId = DotManager::instance()->addSVGObject(m_fileName,m_baseName,absImgName(),m_relPath);
+        int mapId = DotManager::instance()->
+               createFilePatcher(m_fileName)->
+               addSVGObject(m_baseName,absImgName(),m_relPath);
         t << "<!-- SVG " << mapId << " -->" << endl;
       }
       if (!m_noDivTag) t << "</div>" << endl;
@@ -247,16 +251,20 @@ void DotGraph::generateCode(FTextStream &t)
       t << endl;
       if (m_regenerate || !insertMapFile(t, absMapName(), m_relPath, getMapLabel()))
       {
-        int mapId = DotManager::instance()->addMap(m_fileName, absMapName(), m_relPath, m_urlOnly, QCString(), getMapLabel());
+        int mapId = DotManager::instance()->
+          createFilePatcher(m_fileName)->
+          addMap(absMapName(), m_relPath, m_urlOnly, QCString(), getMapLabel());
         t << "<!-- MAP " << mapId << " -->" << endl;
       }
     }
   }
   else if (m_graphFormat==GOF_EPS) // produce tex to include the .eps image
   {
-    if (m_regenerate || !writeVecGfxFigure(t,m_baseName,absBaseName()))
+    if (m_regenerate || !DotFilePatcher::writeVecGfxFigure(t,m_baseName,absBaseName()))
     {
-      int figId = DotManager::instance()->addFigure(m_fileName,m_baseName,absBaseName(),FALSE /*TRUE*/);
+      int figId = DotManager::instance()->
+                  createFilePatcher(m_fileName)->
+                  addFigure(m_baseName,absBaseName(),FALSE /*TRUE*/);
       t << endl << "% FIG " << figId << endl;
     }
   }
@@ -264,6 +272,8 @@ void DotGraph::generateCode(FTextStream &t)
 
 void DotGraph::writeGraphHeader(FTextStream &t,const QCString &title)
 {
+  int fontSize      = Config_getInt(DOT_FONTSIZE);
+  QCString fontName = Config_getString(DOT_FONTNAME);
   t << "digraph ";
   if (title.isEmpty())
   {
@@ -279,17 +289,17 @@ void DotGraph::writeGraphHeader(FTextStream &t,const QCString &title)
   {
     t << " // INTERACTIVE_SVG=YES\n";
   }
-  t << " // LATEX_PDF_SIZE\n"; // write placeholder for LaTeX PDF bounding box size repacement
+  t << " // LATEX_PDF_SIZE\n"; // write placeholder for LaTeX PDF bounding box size replacement
   if (Config_getBool(DOT_TRANSPARENT))
   {
     t << "  bgcolor=\"transparent\";" << endl;
   }
-  t << "  edge [fontname=\"" << DOT_FONTNAME << "\","
-         "fontsize=\"" << DOT_FONTSIZE << "\","
-         "labelfontname=\"" << DOT_FONTNAME << "\","
-         "labelfontsize=\"" << DOT_FONTSIZE << "\"];\n";
-  t << "  node [fontname=\"" << DOT_FONTNAME << "\","
-         "fontsize=\"" << DOT_FONTSIZE << "\",shape=record];\n";
+  t << "  edge [fontname=\"" << fontName << "\","
+         "fontsize=\"" << fontSize << "\","
+         "labelfontname=\"" << fontName << "\","
+         "labelfontsize=\"" << fontSize << "\"];\n";
+  t << "  node [fontname=\"" << fontName << "\","
+         "fontsize=\"" << fontSize << "\",shape=record];\n";
 }
 
 void DotGraph::writeGraphFooter(FTextStream &t)
@@ -347,54 +357,3 @@ void DotGraph::computeGraph(DotNode *root,
   graphStr=buf.data();
 }
 
-bool DotGraph::writeVecGfxFigure(FTextStream &out,const QCString &baseName,
-                                 const QCString &figureName)
-{
-  int width=400,height=550;
-  if (Config_getBool(USE_PDFLATEX))
-  {
-    if (!DotRunner::readBoundingBox(figureName+".pdf",&width,&height,FALSE))
-    {
-      //printf("writeVecGfxFigure()=0\n");
-      return FALSE;
-    }
-  }
-  else
-  {
-    if (!DotRunner::readBoundingBox(figureName+".eps",&width,&height,TRUE))
-    {
-      //printf("writeVecGfxFigure()=0\n");
-      return FALSE;
-    }
-  }
-  //printf("Got PDF/EPS size %d,%d\n",width,height);
-  int maxWidth  = 350;  /* approx. page width in points, excl. margins */
-  int maxHeight = 550;  /* approx. page height in points, excl. margins */ 
-  out << "\\nopagebreak\n"
-         "\\begin{figure}[H]\n"
-         "\\begin{center}\n"
-         "\\leavevmode\n";
-  if (width>maxWidth || height>maxHeight) // figure too big for page
-  {
-    // c*width/maxWidth > c*height/maxHeight, where c=maxWidth*maxHeight>0
-    if (width*maxHeight>height*maxWidth)
-    {
-      out << "\\includegraphics[width=" << maxWidth << "pt]";
-    }
-    else
-    {
-      out << "\\includegraphics[height=" << maxHeight << "pt]";
-    }
-  }
-  else
-  {
-    out << "\\includegraphics[width=" << width << "pt]";
-  }
-
-  out << "{" << baseName << "}\n"
-         "\\end{center}\n"
-         "\\end{figure}\n";
-
-  //printf("writeVecGfxFigure()=1\n");
-  return TRUE;
-}
index 27d6938..edba009 100644 (file)
@@ -34,11 +34,6 @@ class DotGraph
     DotGraph() : m_curNodeNumber(0), m_doNotAddImageToIndex(FALSE), m_noDivTag(FALSE), m_zoomable(TRUE), m_urlOnly(FALSE) {}
     virtual ~DotGraph() {}
 
-    static QCString DOT_FONTNAME; // will be initialized in initDot
-    static int DOT_FONTSIZE;      // will be initialized in initDot
-
-    static bool writeVecGfxFigure(FTextStream& out, const QCString& baseName, const QCString& figureName);
-
   protected:
     /** returns node numbers. The Counter is reset by the constructor */
     int getNextNodeNumber() { return ++m_curNodeNumber; }
@@ -72,10 +67,6 @@ class DotGraph
 
     virtual void computeTheGraph() = 0;
 
-    static QCString IMG_EXT;
-
-    friend void initDot();
-
     QCString absBaseName() const { return m_absPath + m_baseName; }
     QCString absDotName()  const { return m_absPath + m_baseName + ".dot"; }
     QCString imgName()     const;
@@ -83,22 +74,22 @@ class DotGraph
     QCString relImgName()  const { return m_relPath + imgName(); }
 
     // the following variables are used while writing the graph to a .dot file
-    GraphOutputFormat      m_graphFormat;
-    EmbeddedOutputFormat   m_textFormat;
+    GraphOutputFormat      m_graphFormat = GOF_BITMAP;
+    EmbeddedOutputFormat   m_textFormat = EOF_Html;
     QDir                   m_dir;
     QCString               m_fileName;
     QCString               m_relPath;
-    bool                   m_generateImageMap;
-    int                    m_graphId;
+    bool                   m_generateImageMap = false;
+    int                    m_graphId = 0;
 
     QCString               m_absPath;
     QCString               m_baseName;
     QGString               m_theGraph;
-    bool                   m_regenerate;
-    bool                   m_doNotAddImageToIndex;
-    bool                   m_noDivTag;
-    bool                   m_zoomable;
-    bool                   m_urlOnly;
+    bool                   m_regenerate = false;
+    bool                   m_doNotAddImageToIndex = false;
+    bool                   m_noDivTag = false;
+    bool                   m_zoomable = true;
+    bool                   m_urlOnly = false;
 
   private:
     DotGraph(const DotGraph &);
index be55ac0..0a56460 100644 (file)
@@ -42,6 +42,16 @@ DotGroupCollaboration::DotGroupCollaboration(const GroupDef* gd)
 
 DotGroupCollaboration::~DotGroupCollaboration()
 {
+  // delete all created Nodes saved in m_usedNodes:QDict
+  if(m_usedNodes != NULL)
+  {
+    QDictIterator<DotNode> it(*m_usedNodes);
+    for(;it.current(); ++it)
+    {
+      delete it.current();
+    }
+  }
+
   delete m_usedNodes;
 }
 
@@ -356,9 +366,10 @@ bool DotGroupCollaboration::isTrivial() const
   return m_usedNodes->count() <= 1;
 }
 
-void DotGroupCollaboration::writeGraphHeader(FTextStream &t,
-  const QCString &title) const
+void DotGroupCollaboration::writeGraphHeader(FTextStream &t,const QCString &title) const
 {
+  int fontSize      = Config_getInt(DOT_FONTSIZE);
+  QCString fontName = Config_getString(DOT_FONTNAME);
   t << "digraph ";
   if (title.isEmpty())
   {
@@ -374,8 +385,8 @@ void DotGroupCollaboration::writeGraphHeader(FTextStream &t,
   {
     t << "  bgcolor=\"transparent\";" << endl;
   }
-  t << "  edge [fontname=\"" << DOT_FONTNAME << "\",fontsize=\"" << DOT_FONTSIZE << "\","
-    "labelfontname=\"" << DOT_FONTNAME << "\",labelfontsize=\"" << DOT_FONTSIZE << "\"];\n";
-  t << "  node [fontname=\"" << DOT_FONTNAME << "\",fontsize=\"" << DOT_FONTSIZE << "\",shape=box];\n";
+  t << "  edge [fontname=\"" << fontName << "\",fontsize=\"" << fontSize << "\","
+    "labelfontname=\"" << fontName << "\",labelfontsize=\"" << fontSize << "\"];\n";
+  t << "  node [fontname=\"" << fontName << "\",fontsize=\"" << fontSize << "\",shape=box];\n";
   t << "  rankdir=LR;\n";
 }
index 23588db..05a96d9 100644 (file)
@@ -213,8 +213,12 @@ bool DotInclDepGraph::isTrivial() const
 
 bool DotInclDepGraph::isTooBig() const
 {
-  int numNodes = m_startNode->children() ? m_startNode->children()->count() : 0;
-  return numNodes>=Config_getInt(DOT_GRAPH_MAX_NODES);
+  return numNodes()>=Config_getInt(DOT_GRAPH_MAX_NODES);
+}
+
+int DotInclDepGraph::numNodes() const
+{
+  return m_startNode->children() ? m_startNode->children()->count() : 0;
 }
 
 void DotInclDepGraph::writeXML(FTextStream &t)
index b664ccb..5807ce8 100644 (file)
@@ -32,6 +32,7 @@ class DotInclDepGraph : public DotGraph
                         bool writeImageMap=TRUE,int graphId=-1);
     bool isTrivial() const;
     bool isTooBig() const;
+    int numNodes() const;
     void writeXML(FTextStream &t);
     void writeDocbook(FTextStream &t);
 
diff --git a/src/dotlegendgraph.cpp b/src/dotlegendgraph.cpp
new file mode 100644 (file)
index 0000000..98e1f88
--- /dev/null
@@ -0,0 +1,72 @@
+/******************************************************************************
+*
+* Copyright (C) 1997-2019 by Dimitri van Heesch.
+*
+* Permission to use, copy, modify, and distribute this software and its
+* documentation under the terms of the GNU General Public License is hereby
+* granted. No representations are made about the suitability of this software
+* for any purpose. It is provided "as is" without express or implied warranty.
+* See the GNU General Public License for more details.
+*
+* Documents produced by Doxygen are derivative works derived from the
+* input used in their production; they are not affected by this license.
+*
+*/
+
+#include "dotlegendgraph.h"
+#include "util.h"
+#include "config.h"
+#include "doxygen.h"
+#include "dot.h"
+#include "language.h"
+#include "dotfilepatcher.h"
+
+void DotLegendGraph::writeGraph(const char *path)
+{
+  FTextStream ts;
+  DotGraph::writeGraph(ts, GOF_BITMAP, EOF_Html, path, "", "", FALSE, 0);
+
+  if (getDotImageExtension()=="svg")
+  {
+    DotManager::instance()->
+      createFilePatcher(absBaseName()+Config_getString(HTML_FILE_EXTENSION))->
+      addSVGObject("graph_legend", absImgName(),QCString());
+  }
+}
+
+QCString DotLegendGraph::getBaseName() const
+{
+  return "graph_legend";
+}
+
+void DotLegendGraph::computeTheGraph()
+{
+  int fontSize = Config_getInt(DOT_FONTSIZE);
+  QCString fontName = Config_getString(DOT_FONTNAME);
+  FTextStream md5stream(&m_theGraph);
+  writeGraphHeader(md5stream,theTranslator->trLegendTitle());
+  md5stream << "  Node9 [shape=\"box\",label=\"Inherited\",fontsize=\"" << fontSize << "\",height=0.2,width=0.4,fontname=\"" << fontName << "\",fillcolor=\"grey75\",style=\"filled\" fontcolor=\"black\"];\n";
+  md5stream << "  Node10 -> Node9 [dir=\"back\",color=\"midnightblue\",fontsize=\"" << fontSize << "\",style=\"solid\",fontname=\"" << fontName << "\"];\n";
+  md5stream << "  Node10 [shape=\"box\",label=\"PublicBase\",fontsize=\"" << fontSize << "\",height=0.2,width=0.4,fontname=\"" << fontName << "\",color=\"black\"];\n";
+  md5stream << "  Node11 -> Node10 [dir=\"back\",color=\"midnightblue\",fontsize=\"" << fontSize << "\",style=\"solid\",fontname=\"" << fontName << "\"];\n";
+  md5stream << "  Node11 [shape=\"box\",label=\"Truncated\",fontsize=\"" << fontSize << "\",height=0.2,width=0.4,fontname=\"" << fontName << "\",color=\"red\"];\n";
+  md5stream << "  Node13 -> Node9 [dir=\"back\",color=\"darkgreen\",fontsize=\"" << fontSize << "\",style=\"solid\",fontname=\"" << fontName << "\"];\n";
+  md5stream << "  Node13 [shape=\"box\",label=\"ProtectedBase\",fontsize=\"" << fontSize << "\",height=0.2,width=0.4,fontname=\"" << fontName << "\",color=\"black\"];\n";
+  md5stream << "  Node14 -> Node9 [dir=\"back\",color=\"firebrick4\",fontsize=\"" << fontSize << "\",style=\"solid\",fontname=\"" << fontName << "\"];\n";
+  md5stream << "  Node14 [shape=\"box\",label=\"PrivateBase\",fontsize=\"" << fontSize << "\",height=0.2,width=0.4,fontname=\"" << fontName << "\",color=\"black\"];\n";
+  md5stream << "  Node15 -> Node9 [dir=\"back\",color=\"midnightblue\",fontsize=\"" << fontSize << "\",style=\"solid\",fontname=\"" << fontName << "\"];\n";
+  md5stream << "  Node15 [shape=\"box\",label=\"Undocumented\",fontsize=\"" << fontSize << "\",height=0.2,width=0.4,fontname=\"" << fontName << "\",color=\"grey75\"];\n";
+  md5stream << "  Node16 -> Node9 [dir=\"back\",color=\"midnightblue\",fontsize=\"" << fontSize << "\",style=\"solid\",fontname=\"" << fontName << "\"];\n";
+  md5stream << "  Node16 [shape=\"box\",label=\"Templ< int >\",fontsize=\"" << fontSize << "\",height=0.2,width=0.4,fontname=\"" << fontName << "\",color=\"black\"];\n";
+  md5stream << "  Node17 -> Node16 [dir=\"back\",color=\"orange\",fontsize=\"" << fontSize << "\",style=\"dashed\",label=\"< int >\",fontname=\"" << fontName << "\"];\n";
+  md5stream << "  Node17 [shape=\"box\",label=\"Templ< T >\",fontsize=\"" << fontSize << "\",height=0.2,width=0.4,fontname=\"" << fontName << "\",color=\"black\"];\n";
+  md5stream << "  Node18 -> Node9 [dir=\"back\",color=\"darkorchid3\",fontsize=\"" << fontSize << "\",style=\"dashed\",label=\"m_usedClass\",fontname=\"" << fontName << "\"];\n";
+  md5stream << "  Node18 [shape=\"box\",label=\"Used\",fontsize=\"" << fontSize << "\",height=0.2,width=0.4,fontname=\"" << fontName << "\",color=\"black\"];\n";
+  writeGraphFooter(md5stream);
+}
+
+QCString DotLegendGraph::getMapLabel() const
+{
+  return "";
+}
+
diff --git a/src/dotlegendgraph.h b/src/dotlegendgraph.h
new file mode 100644 (file)
index 0000000..2d8eeec
--- /dev/null
@@ -0,0 +1,35 @@
+/******************************************************************************
+*
+* Copyright (C) 1997-2019 by Dimitri van Heesch.
+*
+* Permission to use, copy, modify, and distribute this software and its
+* documentation under the terms of the GNU General Public License is hereby
+* granted. No representations are made about the suitability of this software
+* for any purpose. It is provided "as is" without express or implied warranty.
+* See the GNU General Public License for more details.
+*
+* Documents produced by Doxygen are derivative works derived from the
+* input used in their production; they are not affected by this license.
+*
+*/
+
+#ifndef DOTLEGENDGRAPH_H
+#define DOTLEGENDGRAPH_H
+
+#include "dotgraph.h"
+
+/** Representation of a legend explaining the meaning of boxes, arrows, and colors */
+class DotLegendGraph : public DotGraph
+{
+  public:
+    void writeGraph(const char *path);
+
+  private:
+    virtual QCString getBaseName() const;
+    virtual void computeTheGraph();
+    virtual QCString getMapLabel() const;
+
+};
+
+#endif
+
index ae06fb2..9eccdde 100644 (file)
@@ -176,12 +176,12 @@ static void writeBoxMemberList(FTextStream &t,
 
 QCString DotNode::convertLabel(const QCString &l)
 {
-  QString bBefore("\\_/<({[: =-+@%#~?$"); // break before character set
-  QString bAfter(">]),:;|");              // break after  character set
-  QString p(l);
+  QCString bBefore("\\_/<({[: =-+@%#~?$"); // break before character set
+  QCString bAfter(">]),:;|");              // break after  character set
+  QCString p(l);
   if (p.isEmpty()) return QCString();
-  QString result;
-  QChar c,pc=0;
+  QCString result;
+  char c,pc=0;
   uint idx = 0;
   int len=p.length();
   int charsLeft=len;
@@ -190,18 +190,18 @@ QCString DotNode::convertLabel(const QCString &l)
   while (idx < p.length())
   {
     c = p[idx++];
-    QString replacement;
+    QCString replacement;
     switch(c)
     {
-    case '\\': replacement="\\\\"; break;
-    case '\n': replacement="\\n"; break;
-    case '<':  replacement="\\<"; break;
-    case '>':  replacement="\\>"; break;
-    case '|':  replacement="\\|"; break;
-    case '{':  replacement="\\{"; break;
-    case '}':  replacement="\\}"; break;
-    case '"':  replacement="\\\""; break;
-    default:   replacement=c; break;
+      case '\\': replacement="\\\\"; break;
+      case '\n': replacement="\\n"; break;
+      case '<':  replacement="\\<"; break;
+      case '>':  replacement="\\>"; break;
+      case '|':  replacement="\\|"; break;
+      case '{':  replacement="\\{"; break;
+      case '}':  replacement="\\}"; break;
+      case '"':  replacement="\\\""; break;
+      default:   replacement+=c; break;
     }
     // Some heuristics to insert newlines to prevent too long
     // boxes and at the same time prevent ugly breaks
@@ -219,7 +219,7 @@ QCString DotNode::convertLabel(const QCString &l)
       sinceLast=1;
     }
     else if (charsLeft>1+foldLen/4 && sinceLast>foldLen+foldLen/3 && 
-      !isupper(c) && p[idx].category()==QChar::Letter_Uppercase)
+      !isupper(c) && isupper(p[idx]))
     {
       result+=replacement;
       result+="\\l";
@@ -241,7 +241,7 @@ QCString DotNode::convertLabel(const QCString &l)
     charsLeft--;
     pc=c;
   }
-  return result.utf8();
+  return result;
 }
 
 static QCString stripProtectionPrefix(const QCString &s)
@@ -540,7 +540,7 @@ void DotNode::writeArrow(FTextStream &t,
 
   if (pointBack && !umlUseArrow) t << "dir=\"back\",";
   t << "color=\"" << eProps->edgeColorMap[ei->color()]
-    << "\",fontsize=\"" << DotGraph::DOT_FONTSIZE << "\",";
+    << "\",fontsize=\"" << Config_getInt(DOT_FONTSIZE) << "\",";
   t << "style=\"" << eProps->edgeStyleMap[ei->style()] << "\"";
   if (!ei->label().isEmpty())
   {
@@ -559,7 +559,7 @@ void DotNode::writeArrow(FTextStream &t,
       t << ",arrowhead=\"" << eProps->arrowStyleMap[ei->color()] << "\"";
   }
 
-  if (format==GOF_BITMAP) t << ",fontname=\"" << DotGraph::DOT_FONTNAME << "\"";
+  if (format==GOF_BITMAP) t << ",fontname=\"" << Config_getString(DOT_FONTNAME) << "\"";
   t << "];" << endl; 
 }
 
index 3a621c7..fbfeaca 100644 (file)
 #define MAX_LATEX_GRAPH_INCH  150
 #define MAX_LATEX_GRAPH_SIZE  (MAX_LATEX_GRAPH_INCH * 72)
 
+//-----------------------------------------------------------------------------------------
 
 // since dot silently reproduces the input file when it does not
 // support the PNG format, we need to check the result.
 static void checkPngResult(const char *imgName)
 {
-  FILE *f = portable_fopen(imgName,"rb");
+  FILE *f = Portable::fopen(imgName,"rb");
   if (f)
   {
     char data[4];
@@ -62,8 +63,8 @@ static void checkPngResult(const char *imgName)
 
 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");
+  QCString tmpName = QCString(base)+".tmp";
+  QCString patchFile = QCString(base)+".dot";
   if (!QDir::current().rename(patchFile,tmpName))
   {
     err("Failed to rename file %s to %s!\n",patchFile.data(),tmpName.data());
@@ -114,7 +115,7 @@ bool DotRunner::readBoundingBox(const char *fileName,int *width,int *height,bool
 {
   const char *bb = isEps ? "%%PageBoundingBox:" : "/MediaBox [";
   int bblen = strlen(bb);
-  FILE *f = portable_fopen(fileName,"rb");
+  FILE *f = Portable::fopen(fileName,"rb");
   if (!f) 
   {
     //printf("readBoundingBox: could not open %s\n",fileName);
@@ -142,12 +143,11 @@ bool DotRunner::readBoundingBox(const char *fileName,int *width,int *height,bool
   return FALSE;
 }
 
-bool DotRunner::DOT_CLEANUP;
-bool DotRunner::DOT_MULTI_TARGETS;
-DotConstString DotRunner::DOT_EXE;
+//---------------------------------------------------------------------------------
 
 DotRunner::DotRunner(const QCString& absDotName, const QCString& md5Hash)
-  : m_file(absDotName), m_md5Hash(md5Hash), m_cleanUp(DOT_CLEANUP)
+  : m_file(absDotName), m_md5Hash(md5Hash), m_cleanUp(Config_getBool(DOT_CLEANUP)),
+    m_dotExe(Config_getString(DOT_PATH)+"dot")
 {
   m_jobs.setAutoDelete(TRUE);
 }
@@ -183,7 +183,7 @@ bool DotRunner::run()
   DotJob *s;
 
   // create output
-  if (DOT_MULTI_TARGETS)
+  if (Config_getBool(DOT_MULTI_TARGETS))
   {
     dotArgs=QCString("\"")+m_file.data()+"\"";
     for (li.toFirst();(s=li.current());++li)
@@ -191,14 +191,14 @@ bool DotRunner::run()
       dotArgs+=' ';
       dotArgs+=s->args.data();
     }
-    if ((exitCode=portable_system(DOT_EXE.data(),dotArgs,FALSE))!=0) goto error;
+    if ((exitCode=Portable::system(m_dotExe.data(),dotArgs,FALSE))!=0) goto error;
   }
   else
   {
     for (li.toFirst();(s=li.current());++li)
     {
       dotArgs=QCString("\"")+m_file.data()+"\" "+s->args.data();
-      if ((exitCode=portable_system(DOT_EXE.data(),dotArgs,FALSE))!=0) goto error;
+      if ((exitCode=Portable::system(m_dotExe.data(),dotArgs,FALSE))!=0) goto error;
     }
   }
 
@@ -214,7 +214,7 @@ bool DotRunner::run()
       {
         if (!resetPDFSize(width,height,getBaseNameOfOutput(s->output.data()))) goto error;
         dotArgs=QCString("\"")+m_file.data()+"\" "+s->args.data();
-        if ((exitCode=portable_system(DOT_EXE.data(),dotArgs,FALSE))!=0) goto error;
+        if ((exitCode=Portable::system(m_dotExe.data(),dotArgs,FALSE))!=0) goto error;
       }
     }
 
@@ -228,14 +228,14 @@ bool DotRunner::run()
   if (m_cleanUp) 
   {
     //printf("removing dot file %s\n",m_file.data());
-    portable_unlink(m_file.data());
+    Portable::unlink(m_file.data());
   }
 
   // create checksum file
   if (!m_md5Hash.isEmpty()) 
   {
     QCString md5Name = getBaseNameOfOutput(m_file.data()) + ".md5";
-    FILE *f = portable_fopen(md5Name,"w");
+    FILE *f = Portable::fopen(md5Name,"w");
     if (f)
     {
       fwrite(m_md5Hash.data(),1,32,f); 
@@ -245,7 +245,7 @@ bool DotRunner::run()
   return TRUE;
 error:
   err("Problems running dot: exit code=%d, command='%s', arguments='%s'\n",
-    exitCode,DOT_EXE.data(),dotArgs.data());
+    exitCode,m_dotExe.data(),dotArgs.data());
   return FALSE;
 }
 
index 4128fe8..1b68c18 100644 (file)
@@ -34,7 +34,6 @@ class DotConstString
     DotConstString(const DotConstString &s) : m_str(0) { set(s.data()); }
     const char *data() const                           { return m_str; }
     bool isEmpty() const                               { return m_str==0 || m_str[0]=='\0'; }
-    void init(const char *s)                           { set(s); }
 
   private:
     void set(char const* s)
@@ -101,14 +100,9 @@ class DotRunner
   private:
     DotConstString m_file;
     DotConstString m_md5Hash;
+    DotConstString m_dotExe;
     bool           m_cleanUp;
     QList<DotJob>  m_jobs;
-
-    static bool DOT_CLEANUP;
-    static bool DOT_MULTI_TARGETS;
-    static DotConstString DOT_EXE;
-    friend void initDot();
-
 };
 
 /** Queue of dot jobs to run. */
index 6bf67a0..6388ce3 100644 (file)
@@ -33,6 +33,9 @@
 #include <qptrdict.h>
 #include <qtextstream.h>
 
+#include <unordered_map>
+#include <memory>
+
 #include "version.h"
 #include "doxygen.h"
 #include "scanner.h"
 #include "searchindex.h"
 #include "parserintf.h"
 #include "htags.h"
+#include "pycode.h"
 #include "pyscanner.h"
+#include "fortrancode.h"
 #include "fortranscanner.h"
-#include "xmlscanner.h"
-#include "sqlscanner.h"
+#include "xmlcode.h"
+#include "sqlcode.h"
 #include "tclscanner.h"
 #include "code.h"
 #include "objcache.h"
 #include "fileparser.h"
 #include "emoji.h"
 #include "plantuml.h"
+#include "stlsupport.h"
 
 // provided by the generated file resources.cpp
 extern void initResources();
 
-#define RECURSE_ENTRYTREE(func,var) \
-  do { if (var->children()) { \
-    EntryListIterator eli(*var->children()); \
-    for (;eli.current();++eli) func(eli.current()); \
-  } } while(0)
-
-
 #if !defined(_WIN32) || defined(__CYGWIN__)
 #include <signal.h>
 #define HAS_SIGNALS
@@ -175,9 +174,10 @@ bool             Doxygen::generatingXmlOutput = FALSE;
 bool             Doxygen::markdownSupport = TRUE;
 GenericsSDict   *Doxygen::genericsDict;
 DocGroup         Doxygen::docGroup;
+Preprocessor    *Doxygen::preprocessor = 0;
 
 // locally accessible globals
-static QDict<Entry>     g_classEntries(1009);
+static std::unordered_map< std::string, const Entry* > g_classEntries;
 static StringList       g_inputFiles;
 static QDict<void>      g_compoundKeywordDict(7);  // keywords recognised as compounds
 static OutputList      *g_outputList = 0;          // list of output generating objects
@@ -297,9 +297,12 @@ void statistics()
 
 
 
-static void addMemberDocs(Entry *root,MemberDef *md, const char *funcDecl,
-                   ArgumentList *al,bool over_load,NamespaceSDict *nl=0);
-static void findMember(Entry *root,
+static void addMemberDocs(const Entry *root,MemberDef *md, const char *funcDecl,
+                   const ArgumentList *al,bool over_load,uint64 spec);
+static void findMember(const Entry *root,
+                       const QCString &relates,
+                       const QCString &type,
+                       const QCString &args,
                        QCString funcDecl,
                        bool overloaded,
                        bool isFunc
@@ -313,253 +316,20 @@ enum FindBaseClassRelation_Mode
 };
 
 static bool findClassRelation(
-                           Entry *root,
+                           const Entry *root,
                            Definition *context,
                            ClassDef *cd,
-                           BaseInfo *bi,
+                           const BaseInfo *bi,
                            QDict<int> *templateNames,
                            /*bool insertUndocumented*/
                            FindBaseClassRelation_Mode mode,
                            bool isArtificial
                           );
 
-/** A struct contained the data for an STL class */
-struct STLInfo
-{
-  const char *className;
-  const char *baseClass1;
-  const char *baseClass2;
-  const char *templType1;
-  const char *templName1;
-  const char *templType2;
-  const char *templName2;
-  bool virtualInheritance;
-  bool iterators;
-};
-
-static STLInfo g_stlinfo[] =
-{
-  // className              baseClass1                      baseClass2             templType1     templName1     templType2    templName2     virtInheritance  // iterators
-  { "allocator",            0,                              0,                     "T",           "elements",    0,            0,             FALSE,              FALSE },
-  { "array",                0,                              0,                     "T",           "elements",    0,            0,             FALSE,              FALSE }, // C++11
-  { "auto_ptr",             0,                              0,                     "T",           "ptr",         0,            0,             FALSE,              FALSE }, // deprecated
-  { "smart_ptr",            0,                              0,                     "T",           "ptr",         0,            0,             FALSE,              FALSE }, // C++11
-  { "unique_ptr",           0,                              0,                     "T",           "ptr",         0,            0,             FALSE,              FALSE }, // C++11
-  { "shared_ptr",           0,                              0,                     "T",           "ptr",         0,            0,             FALSE,              FALSE }, // C++14
-  { "weak_ptr",             0,                              0,                     "T",           "ptr",         0,            0,             FALSE,              FALSE }, // C++11
-  { "ios_base",             0,                              0,                     0,             0,             0,            0,             FALSE,              FALSE }, // C++11
-  { "error_code",           0,                              0,                     0,             0,             0,            0,             FALSE,              FALSE }, // C++11
-  { "error_category",       0,                              0,                     0,             0,             0,            0,             FALSE,              FALSE }, // C++11
-  { "system_error",         0,                              0,                     0,             0,             0,            0,             FALSE,              FALSE }, // C++11
-  { "error_condition",      0,                              0,                     0,             0,             0,            0,             FALSE,              FALSE }, // C++11
-  { "thread",               0,                              0,                     0,             0,             0,            0,             FALSE,              FALSE }, // C++11
-  { "basic_ios",            "ios_base",                     0,                     "Char",        0,             0,            0,             FALSE,              FALSE },
-  { "basic_istream",        "basic_ios<Char>",              0,                     "Char",        0,             0,            0,             TRUE,               FALSE },
-  { "basic_ostream",        "basic_ios<Char>",              0,                     "Char",        0,             0,            0,             TRUE,               FALSE },
-  { "basic_iostream",       "basic_istream<Char>",          "basic_ostream<Char>", "Char",        0,             0,            0,             FALSE,              FALSE },
-  { "basic_ifstream",       "basic_istream<Char>",          0,                     "Char",        0,             0,            0,             FALSE,              FALSE },
-  { "basic_ofstream",       "basic_ostream<Char>",          0,                     "Char",        0,             0,            0,             FALSE,              FALSE },
-  { "basic_fstream",        "basic_iostream<Char>",         0,                     "Char",        0,             0,            0,             FALSE,              FALSE },
-  { "basic_istringstream",  "basic_istream<Char>",          0,                     "Char",        0,             0,            0,             FALSE,              FALSE },
-  { "basic_ostringstream",  "basic_ostream<Char>",          0,                     "Char",        0,             0,            0,             FALSE,              FALSE },
-  { "basic_stringstream",   "basic_iostream<Char>",         0,                     "Char",        0,             0,            0,             FALSE,              FALSE },
-  { "ios",                  "basic_ios<char>",              0,                     0,             0,             0,            0,             FALSE,              FALSE },
-  { "wios",                 "basic_ios<wchar_t>",           0,                     0,             0,             0,            0,             FALSE,              FALSE },
-  { "istream",              "basic_istream<char>",          0,                     0,             0,             0,            0,             FALSE,              FALSE },
-  { "wistream",             "basic_istream<wchar_t>",       0,                     0,             0,             0,            0,             FALSE,              FALSE },
-  { "ostream",              "basic_ostream<char>",          0,                     0,             0,             0,            0,             FALSE,              FALSE },
-  { "wostream",             "basic_ostream<wchar_t>",       0,                     0,             0,             0,            0,             FALSE,              FALSE },
-  { "ifstream",             "basic_ifstream<char>",         0,                     0,             0,             0,            0,             FALSE,              FALSE },
-  { "wifstream",            "basic_ifstream<wchar_t>",      0,                     0,             0,             0,            0,             FALSE,              FALSE },
-  { "ofstream",             "basic_ofstream<char>",         0,                     0,             0,             0,            0,             FALSE,              FALSE },
-  { "wofstream",            "basic_ofstream<wchar_t>",      0,                     0,             0,             0,            0,             FALSE,              FALSE },
-  { "fstream",              "basic_fstream<char>",          0,                     0,             0,             0,            0,             FALSE,              FALSE },
-  { "wfstream",             "basic_fstream<wchar_t>",       0,                     0,             0,             0,            0,             FALSE,              FALSE },
-  { "istringstream",        "basic_istringstream<char>",    0,                     0,             0,             0,            0,             FALSE,              FALSE },
-  { "wistringstream",       "basic_istringstream<wchar_t>", 0,                     0,             0,             0,            0,             FALSE,              FALSE },
-  { "ostringstream",        "basic_ostringstream<char>",    0,                     0,             0,             0,            0,             FALSE,              FALSE },
-  { "wostringstream",       "basic_ostringstream<wchar_t>", 0,                     0,             0,             0,            0,             FALSE,              FALSE },
-  { "stringstream",         "basic_stringstream<char>",     0,                     0,             0,             0,            0,             FALSE,              FALSE },
-  { "wstringstream",        "basic_stringstream<wchar_t>",  0,                     0,             0,             0,            0,             FALSE,              FALSE },
-  { "basic_string",         0,                              0,                     "Char",        0,             0,            0,             FALSE,              TRUE  },
-  { "string",               "basic_string<char>",           0,                     0,             0,             0,            0,             FALSE,              TRUE  },
-  { "wstring",              "basic_string<wchar_t>",        0,                     0,             0,             0,            0,             FALSE,              TRUE  },
-  { "complex",              0,                              0,                     0,             0,             0,            0,             FALSE,              FALSE },
-  { "bitset",               0,                              0,                     "Bits",        0,             0,            0,             FALSE,              FALSE },
-  { "deque",                0,                              0,                     "T",           "elements",    0,            0,             FALSE,              TRUE  },
-  { "list",                 0,                              0,                     "T",           "elements",    0,            0,             FALSE,              TRUE  },
-  { "forward_list",         0,                              0,                     "T",           "elements",    0,            0,             FALSE,              TRUE  }, // C++11
-  { "map",                  0,                              0,                     "K",           "keys",        "T",          "elements",    FALSE,              TRUE  },
-  { "unordered_map",        0,                              0,                     "K",           "keys",        "T",          "elements",    FALSE,              TRUE  }, // C++11
-  { "multimap",             0,                              0,                     "K",           "keys",        "T",          "elements",    FALSE,              TRUE  },
-  { "unordered_multimap",   0,                              0,                     "K",           "keys",        "T",          "elements",    FALSE,              TRUE  }, // C++11
-  { "set",                  0,                              0,                     "K",           "keys",        0,            0,             FALSE,              TRUE  },
-  { "unordered_set",        0,                              0,                     "K",           "keys",        0,            0,             FALSE,              TRUE  }, // C++11
-  { "multiset",             0,                              0,                     "K",           "keys",        0,            0,             FALSE,              TRUE  },
-  { "unordered_multiset",   0,                              0,                     "K",           "keys",        0,            0,             FALSE,              TRUE  }, // C++11
-  { "vector",               0,                              0,                     "T",           "elements",    0,            0,             FALSE,              TRUE  },
-  { "queue",                0,                              0,                     "T",           "elements",    0,            0,             FALSE,              FALSE },
-  { "priority_queue",       0,                              0,                     "T",           "elements",    0,            0,             FALSE,              FALSE },
-  { "stack",                0,                              0,                     "T",           "elements",    0,            0,             FALSE,              FALSE },
-  { "valarray",             0,                              0,                     "T",           "elements",    0,            0,             FALSE,              FALSE },
-  { "exception",            0,                              0,                     0,             0,             0,            0,             FALSE,              FALSE },
-  { "bad_alloc",            "exception",                    0,                     0,             0,             0,            0,             FALSE,              FALSE },
-  { "bad_cast",             "exception",                    0,                     0,             0,             0,            0,             FALSE,              FALSE },
-  { "bad_typeid",           "exception",                    0,                     0,             0,             0,            0,             FALSE,              FALSE },
-  { "logic_error",          "exception",                    0,                     0,             0,             0,            0,             FALSE,              FALSE },
-  { "ios_base::failure",    "exception",                    0,                     0,             0,             0,            0,             FALSE,              FALSE },
-  { "runtime_error",        "exception",                    0,                     0,             0,             0,            0,             FALSE,              FALSE },
-  { "bad_exception",        "exception",                    0,                     0,             0,             0,            0,             FALSE,              FALSE },
-  { "domain_error",         "logic_error",                  0,                     0,             0,             0,            0,             FALSE,              FALSE },
-  { "invalid_argument",     "logic_error",                  0,                     0,             0,             0,            0,             FALSE,              FALSE },
-  { "length_error",         "logic_error",                  0,                     0,             0,             0,            0,             FALSE,              FALSE },
-  { "out_of_range",         "logic_error",                  0,                     0,             0,             0,            0,             FALSE,              FALSE },
-  { "range_error",          "runtime_error",                0,                     0,             0,             0,            0,             FALSE,              FALSE },
-  { "overflow_error",       "runtime_error",                0,                     0,             0,             0,            0,             FALSE,              FALSE },
-  { "underflow_error",      "runtime_error",                0,                     0,             0,             0,            0,             FALSE,              FALSE },
-  { 0,                      0,                              0,                     0,             0,             0,            0,             FALSE,              FALSE }
-};
-
-static void addSTLMember(Entry *root,const char *type,const char *name)
-{
-  Entry *memEntry = new Entry;
-  memEntry->name       = name;
-  memEntry->type       = type;
-  memEntry->protection = Public;
-  memEntry->section    = Entry::VARIABLE_SEC;
-  memEntry->brief      = "STL member";
-  memEntry->hidden     = FALSE;
-  memEntry->artificial = TRUE;
-  //memEntry->parent     = root;
-  root->addSubEntry(memEntry);
-  //EntryNav *memEntryNav = new EntryNav(root,memEntry);
-  //memEntryNav->setEntry(memEntry);
-  //rootNav->addChild(memEntryNav);
-}
-
-static void addSTLIterator(Entry *classEntry,const char *name)
-{
-  Entry *iteratorClassEntry = new Entry;
-  iteratorClassEntry->fileName  = "[STL]";
-  iteratorClassEntry->startLine = 1;
-  iteratorClassEntry->name      = name;
-  iteratorClassEntry->section   = Entry::CLASS_SEC;
-  iteratorClassEntry->brief     = "STL iterator class";
-  iteratorClassEntry->hidden    = FALSE;
-  iteratorClassEntry->artificial= TRUE;
-  classEntry->addSubEntry(iteratorClassEntry);
-  //EntryNav *iteratorClassEntryNav = new EntryNav(classEntryNav,iteratorClassEntry);
-  //iteratorClassEntryNav->setEntry(iteratorClassEntry);
-  //classEntryNav->addChild(iteratorClassEntryNav);
-}
-
-
-static void addSTLClasses(Entry *root)
-{
-  Entry *namespaceEntry = new Entry;
-  namespaceEntry->fileName  = "[STL]";
-  namespaceEntry->startLine = 1;
-  //namespaceEntry->parent    = rootNav->entry();
-  namespaceEntry->name      = "std";
-  namespaceEntry->section   = Entry::NAMESPACE_SEC;
-  namespaceEntry->brief     = "STL namespace";
-  namespaceEntry->hidden    = FALSE;
-  namespaceEntry->artificial= TRUE;
-  root->addSubEntry(namespaceEntry);
-  //EntryNav *namespaceEntryNav = new EntryNav(rootNav,namespaceEntry);
-  //namespaceEntryNav->setEntry(namespaceEntry);
-  //rootNav->addChild(namespaceEntryNav);
-
-  STLInfo *info = g_stlinfo;
-  while (info->className)
-  {
-    //printf("Adding STL class %s\n",info->className);
-    QCString fullName = info->className;
-    fullName.prepend("std::");
-
-    // add fake Entry for the class
-    Entry *classEntry = new Entry;
-    classEntry->fileName  = "[STL]";
-    classEntry->startLine = 1;
-    classEntry->name      = fullName;
-    classEntry->section   = Entry::CLASS_SEC;
-    classEntry->brief     = "STL class";
-    classEntry->hidden    = FALSE;
-    classEntry->artificial= TRUE;
-    namespaceEntry->addSubEntry(classEntry);
-    //EntryNav *classEntryNav = new EntryNav(namespaceEntryNav,classEntry);
-    //classEntryNav->setEntry(classEntry);
-    //namespaceEntryNav->addChild(classEntryNav);
-
-    // add template arguments to class
-    if (info->templType1)
-    {
-      ArgumentList *al = new ArgumentList;
-      Argument *a=new Argument;
-      a->type="typename";
-      a->name=info->templType1;
-      al->append(a);
-      if (info->templType2) // another template argument
-      {
-        a=new Argument;
-        a->type="typename";
-        a->name=info->templType2;
-        al->append(a);
-      }
-      classEntry->tArgLists = new QList<ArgumentList>;
-      classEntry->tArgLists->setAutoDelete(TRUE);
-      classEntry->tArgLists->append(al);
-    }
-    // add member variables
-    if (info->templName1)
-    {
-      addSTLMember(classEntry,info->templType1,info->templName1);
-    }
-    if (info->templName2)
-    {
-      addSTLMember(classEntry,info->templType2,info->templName2);
-    }
-    if (fullName=="std::auto_ptr" || fullName=="std::smart_ptr" || fullName=="std::shared_ptr" ||
-        fullName=="std::unique_ptr" || fullName=="std::weak_ptr")
-    {
-      Entry *memEntry = new Entry;
-      memEntry->name       = "operator->";
-      memEntry->args       = "()";
-      memEntry->type       = "T*";
-      memEntry->protection = Public;
-      memEntry->section    = Entry::FUNCTION_SEC;
-      memEntry->brief      = "STL member";
-      memEntry->hidden     = FALSE;
-      memEntry->artificial = FALSE;
-      classEntry->addSubEntry(memEntry);
-      //EntryNav *memEntryNav = new EntryNav(classEntryNav,memEntry);
-      //memEntryNav->setEntry(memEntry);
-      //classEntryNav->addChild(memEntryNav);
-    }
-    if (info->baseClass1)
-    {
-      classEntry->extends->append(new BaseInfo(info->baseClass1,Public,info->virtualInheritance?Virtual:Normal));
-    }
-    if (info->baseClass2)
-    {
-      classEntry->extends->append(new BaseInfo(info->baseClass2,Public,info->virtualInheritance?Virtual:Normal));
-    }
-    if (info->iterators)
-    {
-      // add iterator class
-      addSTLIterator(classEntry,fullName+"::iterator");
-      addSTLIterator(classEntry,fullName+"::const_iterator");
-      addSTLIterator(classEntry,fullName+"::reverse_iterator");
-      addSTLIterator(classEntry,fullName+"::const_reverse_iterator");
-    }
-    info++;
-  }
-}
-
 //----------------------------------------------------------------------------
 
 static Definition *findScopeFromQualifiedName(Definition *startScope,const QCString &n,
-                                              FileDef *fileScope,TagInfo *tagInfo);
+                                              FileDef *fileScope,const TagInfo *tagInfo);
 
 static void addPageToContext(PageDef *pd,Entry *root)
 {
@@ -572,7 +342,7 @@ static void addPageToContext(PageDef *pd,Entry *root)
     }
     scope = stripAnonymousNamespaceScope(scope);
     scope+="::"+pd->name();
-    Definition *d = findScopeFromQualifiedName(Doxygen::globalScope,scope,0,root->tagInfo);
+    Definition *d = findScopeFromQualifiedName(Doxygen::globalScope,scope,0,root->tagInfo());
     if (d)
     {
       pd->setPageScope(d);
@@ -583,11 +353,9 @@ static void addPageToContext(PageDef *pd,Entry *root)
 static void addRelatedPage(Entry *root)
 {
   GroupDef *gd=0;
-  QListIterator<Grouping> gli(*root->groups);
-  Grouping *g;
-  for (;(g=gli.current());++gli)
+  for (const Grouping &g : root->groups)
   {
-    if (!g->groupname.isEmpty() && (gd=Doxygen::groupSDict->find(g->groupname))) break;
+    if (!g.groupname.isEmpty() && (gd=Doxygen::groupSDict->find(g.groupname))) break;
   }
   //printf("---> addRelatedPage() %s gd=%p\n",root->name.data(),gd);
   QCString doc;
@@ -599,10 +367,12 @@ static void addRelatedPage(Entry *root)
   {
     doc=root->brief+"\n\n"+root->doc+root->inbodyDocs;
   }
-  PageDef *pd = addRelatedPage(root->name,root->args,doc,root->anchors,
+
+  PageDef *pd = addRelatedPage(root->name,root->args,doc,
       root->docFile,root->docLine,
       root->sli,
-      gd,root->tagInfo,
+      gd,root->tagInfo(),
+      FALSE,
       root->lang
      );
   if (pd)
@@ -614,11 +384,11 @@ static void addRelatedPage(Entry *root)
   }
 }
 
-static void buildGroupListFiltered(Entry *root,bool additional, bool includeExternal)
+static void buildGroupListFiltered(const Entry *root,bool additional, bool includeExternal)
 {
   if (root->section==Entry::GROUPDOC_SEC && !root->name.isEmpty() &&
-        ((!includeExternal && root->tagInfo==0) ||
-         ( includeExternal && root->tagInfo!=0))
+        ((!includeExternal && root->tagInfo()==0) ||
+         ( includeExternal && root->tagInfo()!=0))
      )
   {
     if ((root->groupDocType==Entry::GROUPDOC_NORMAL && !additional) ||
@@ -649,10 +419,10 @@ static void buildGroupListFiltered(Entry *root,bool additional, bool includeExte
       }
       else
       {
-        if (root->tagInfo)
+        if (root->tagInfo())
         {
-          gd = createGroupDef(root->fileName,root->startLine,root->name,root->type,root->tagInfo->fileName);
-          gd->setReference(root->tagInfo->tagName);
+          gd = createGroupDef(root->fileName,root->startLine,root->name,root->type,root->tagInfo()->fileName);
+          gd->setReference(root->tagInfo()->tagName);
         }
         else
         {
@@ -669,18 +439,10 @@ static void buildGroupListFiltered(Entry *root,bool additional, bool includeExte
       }
     }
   }
-  if (root->children())
-  {
-    EntryListIterator eli(*root->children());
-    Entry *e;
-    for (;(e=eli.current());++eli)
-    {
-      buildGroupListFiltered(e,additional,includeExternal);
-    }
-  }
+  for (const auto &e : root->children()) buildGroupListFiltered(e.get(),additional,includeExternal);
 }
 
-static void buildGroupList(Entry *root)
+static void buildGroupList(const Entry *root)
 {
   // --- first process only local groups
   // first process the @defgroups blocks
@@ -695,7 +457,7 @@ static void buildGroupList(Entry *root)
   buildGroupListFiltered(root,TRUE,TRUE);
 }
 
-static void findGroupScope(Entry *root)
+static void findGroupScope(const Entry *root)
 {
   if (root->section==Entry::GROUPDOC_SEC && !root->name.isEmpty() &&
       root->parent() && !root->parent()->name.isEmpty())
@@ -710,17 +472,17 @@ static void findGroupScope(Entry *root)
       }
       scope = stripAnonymousNamespaceScope(scope);
       scope+="::"+gd->name();
-      Definition *d = findScopeFromQualifiedName(Doxygen::globalScope,scope,0,root->tagInfo);
+      Definition *d = findScopeFromQualifiedName(Doxygen::globalScope,scope,0,root->tagInfo());
       if (d)
       {
         gd->setGroupScope(d);
       }
     }
   }
-  RECURSE_ENTRYTREE(findGroupScope,root);
+  for (const auto &e : root->children()) findGroupScope(e.get());
 }
 
-static void organizeSubGroupsFiltered(Entry *root,bool additional)
+static void organizeSubGroupsFiltered(const Entry *root,bool additional)
 {
   if (root->section==Entry::GROUPDOC_SEC && !root->name.isEmpty())
   {
@@ -735,18 +497,10 @@ static void organizeSubGroupsFiltered(Entry *root,bool additional)
       }
     }
   }
-  if (root->children())
-  {
-    EntryListIterator eli(*root->children());
-    Entry *e;
-    for (;(e=eli.current());++eli)
-    {
-      organizeSubGroupsFiltered(e,additional);
-    }
-  }
+  for (const auto &e : root->children()) organizeSubGroupsFiltered(e.get(),additional);
 }
 
-static void organizeSubGroups(Entry *root)
+static void organizeSubGroups(const Entry *root)
 {
   //printf("Defining groups\n");
   // first process the @defgroups blocks
@@ -758,11 +512,11 @@ static void organizeSubGroups(Entry *root)
 
 //----------------------------------------------------------------------
 
-static void buildFileList(Entry *root)
+static void buildFileList(const Entry *root)
 {
   if (((root->section==Entry::FILEDOC_SEC) ||
         ((root->section & Entry::FILE_MASK) && Config_getBool(EXTRACT_ALL))) &&
-      !root->name.isEmpty() && !root->tagInfo // skip any file coming from tag files
+      !root->name.isEmpty() && !root->tagInfo() // skip any file coming from tag files
      )
   {
     bool ambig;
@@ -788,12 +542,10 @@ static void buildFileList(Entry *root)
       fd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
       fd->addSectionsToDefinition(root->anchors);
       fd->setRefItems(root->sli);
-      QListIterator<Grouping> gli(*root->groups);
-      Grouping *g;
-      for (;(g=gli.current());++gli)
+      for (const Grouping &g : root->groups)
       {
         GroupDef *gd=0;
-        if (!g->groupname.isEmpty() && (gd=Doxygen::groupSDict->find(g->groupname)))
+        if (!g.groupname.isEmpty() && (gd=Doxygen::groupSDict->find(g.groupname)))
         {
           gd->addFile(fd);
           fd->makePartOfGroup(gd);
@@ -822,10 +574,10 @@ static void buildFileList(Entry *root)
       warn(fn,root->startLine,text);
     }
   }
-  RECURSE_ENTRYTREE(buildFileList,root);
+  for (const auto &e : root->children()) buildFileList(e.get());
 }
 
-static void addIncludeFile(ClassDef *cd,FileDef *ifd,Entry *root)
+static void addIncludeFile(ClassDef *cd,FileDef *ifd,const Entry *root)
 {
   if (
       (!root->doc.stripWhiteSpace().isEmpty() ||
@@ -984,7 +736,7 @@ static Definition *findScope(Entry *root,int level=0)
  *  not found and set the parent/child scope relation if the scope is found.
  */
 static Definition *buildScopeFromQualifiedName(const QCString name,
-                                               int level,SrcLangExt lang,TagInfo *tagInfo)
+                                               int level,SrcLangExt lang,const TagInfo *tagInfo)
 {
   //printf("buildScopeFromQualifiedName(%s) level=%d\n",name.data(),level);
   int i=0;
@@ -1043,7 +795,7 @@ static Definition *buildScopeFromQualifiedName(const QCString name,
 }
 
 static Definition *findScopeFromQualifiedName(Definition *startScope,const QCString &n,
-                                              FileDef *fileScope,TagInfo *tagInfo)
+                                              FileDef *fileScope,const TagInfo *tagInfo)
 {
   //printf("<findScopeFromQualifiedName(%s,%s)\n",startScope ? startScope->name().data() : 0, n.data());
   Definition *resultScope=startScope;
@@ -1131,17 +883,15 @@ static Definition *findScopeFromQualifiedName(Definition *startScope,const QCStr
   return resultScope;
 }
 
-ArgumentList *getTemplateArgumentsFromName(
+ArgumentList getTemplateArgumentsFromName(
                   const QCString &name,
-                  const QList<ArgumentList> *tArgLists)
+                  const std::vector<ArgumentList> &tArgLists)
 {
-  if (tArgLists==0) return 0;
-
-  QListIterator<ArgumentList> ali(*tArgLists);
   // for each scope fragment, check if it is a template and advance through
   // the list if so.
   int i,p=0;
-  while ((i=name.find("::",p))!=-1)
+  auto alIt = tArgLists.begin();
+  while ((i=name.find("::",p))!=-1 && alIt!=tArgLists.end())
   {
     NamespaceDef *nd = Doxygen::namespaceSDict->find(name.left(i));
     if (nd==0)
@@ -1149,15 +899,15 @@ ArgumentList *getTemplateArgumentsFromName(
       ClassDef *cd = getClass(name.left(i));
       if (cd)
       {
-        if (cd->templateArguments())
+        if (!cd->templateArguments().empty())
         {
-          ++ali;
+          ++alIt;
         }
       }
     }
     p=i+2;
   }
-  return ali.current();
+  return alIt!=tArgLists.end() ? *alIt : ArgumentList();
 }
 
 static
@@ -1218,7 +968,7 @@ ClassDef::CompoundType convertToCompoundType(int section,uint64 specifier)
 }
 
 
-static void addClassToContext(Entry *root)
+static void addClassToContext(const Entry *root)
 {
   FileDef *fd = root->fileDef();
 
@@ -1266,13 +1016,12 @@ static void addClassToContext(Entry *root)
     }
     //cd->setName(fullName); // change name to match docs
 
-    if (cd->templateArguments()==0 || (cd->isForwardDeclared() && (root->spec&Entry::ForwardDecl)==0))
+    if (cd->templateArguments().empty() || (cd->isForwardDeclared() && (root->spec&Entry::ForwardDecl)==0))
     {
       // this happens if a template class declared with @class is found
       // before the actual definition or if a forward declaration has different template
       // parameter names.
-      ArgumentList *tArgList =
-        getTemplateArgumentsFromName(cd->name(),root->tArgLists);
+      ArgumentList tArgList = getTemplateArgumentsFromName(cd->name(),root->tArgLists);
       cd->setTemplateArguments(tArgList);
     }
 
@@ -1293,7 +1042,7 @@ static void addClassToContext(Entry *root)
 
     QCString tagName;
     QCString refFileName;
-    TagInfo *tagInfo = root->tagInfo;
+    const TagInfo *tagInfo = root->tagInfo();
     int i;
     if (tagInfo)
     {
@@ -1306,13 +1055,12 @@ static void addClassToContext(Entry *root)
         buildScopeFromQualifiedName(fullName,fullName.contains("::"),root->lang,tagInfo);
       }
     }
-    ArgumentList *tArgList = 0;
+    ArgumentList tArgList;
     if ((root->lang==SrcLangExt_CSharp || root->lang==SrcLangExt_Java) && (i=fullName.find('<'))!=-1)
     {
       // a Java/C# generic class looks like a C++ specialization, so we need to split the
       // name and template arguments here
-      tArgList = new ArgumentList;
-      stringToArgumentList(fullName.mid(i),tArgList);
+      stringToArgumentList(root->lang,fullName.mid(i),tArgList);
       fullName=fullName.left(i);
     }
     else
@@ -1322,7 +1070,7 @@ static void addClassToContext(Entry *root)
     cd=createClassDef(tagInfo?tagName:root->fileName,root->startLine,root->startColumn,
         fullName,sec,tagName,refFileName,TRUE,root->spec&Entry::Enum);
     Debug::print(Debug::Classes,0,"  New class '%s' (sec=0x%08x)! #tArgLists=%d tagInfo=%p\n",
-        qPrint(fullName),sec,root->tArgLists ? (int)root->tArgLists->count() : -1, tagInfo);
+        qPrint(fullName),sec,root->tArgLists.size(), tagInfo);
     cd->setDocumentation(root->doc,root->docFile,root->docLine); // copy docs to definition
     cd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
     cd->setLanguage(root->lang);
@@ -1354,7 +1102,7 @@ static void addClassToContext(Entry *root)
     //printf("ClassDict.insert(%s)\n",fullName.data());
     Doxygen::classSDict->append(fullName,cd);
 
-    if (cd->isGeneric()) // generics are also stored in a separate dictionary for fast lookup of instantions
+    if (cd->isGeneric()) // generics are also stored in a separate dictionary for fast lookup of instances
     {
       //printf("inserting generic '%s' cd=%p\n",fullName.data(),cd);
       Doxygen::genericsDict->insert(fullName,cd);
@@ -1384,7 +1132,7 @@ static void addClassToContext(Entry *root)
 //----------------------------------------------------------------------
 // build a list of all classes mentioned in the documentation
 // and all classes that have a documentation block before their definition.
-static void buildClassList(Entry *root)
+static void buildClassList(const Entry *root)
 {
   if (
         ((root->section & Entry::COMPOUND_MASK) ||
@@ -1393,10 +1141,10 @@ static void buildClassList(Entry *root)
   {
     addClassToContext(root);
   }
-  RECURSE_ENTRYTREE(buildClassList,root);
+  for (const auto &e : root->children()) buildClassList(e.get());
 }
 
-static void buildClassDocList(Entry *root)
+static void buildClassDocList(const Entry *root)
 {
   if (
        (root->section & Entry::COMPOUNDDOC_MASK) && !root->name.isEmpty()
@@ -1404,7 +1152,7 @@ static void buildClassDocList(Entry *root)
   {
     addClassToContext(root);
   }
-  RECURSE_ENTRYTREE(buildClassDocList,root);
+  for (const auto &e : root->children()) buildClassDocList(e.get());
 }
 
 static void resolveClassNestingRelations()
@@ -1448,7 +1196,7 @@ static void resolveClassNestingRelations()
                 d->addInnerCompound(aliasCd);
                 QCString aliasFullName = d->qualifiedName()+"::"+aliasCd->localName();
                 Doxygen::classSDict->append(aliasFullName,aliasCd);
-                printf("adding %s to %s as %s\n",qPrint(aliasCd->name()),qPrint(d->name()),qPrint(aliasFullName));
+                //printf("adding %s to %s as %s\n",qPrint(aliasCd->name()),qPrint(d->name()),qPrint(aliasFullName));
                 aliasCd->setVisited(TRUE);
               }
             }
@@ -1482,7 +1230,7 @@ static void resolveClassNestingRelations()
       Definition *d = buildScopeFromQualifiedName(name,name.contains("::"),cd->getLanguage(),0);
       if (d!=cd && !cd->getDefFileName().isEmpty())
                  // avoid recursion in case of redundant scopes, i.e: namespace N { class N::C {}; }
-                 // for this case doxygen assumes the exitance of a namespace N::N in which C is to be found!
+                 // for this case doxygen assumes the existence of a namespace N::N in which C is to be found!
                  // also avoid warning for stuff imported via a tagfile.
       {
         d->addInnerCompound(cd);
@@ -1587,7 +1335,7 @@ static ClassDef *createTagLessInstance(ClassDef *rootCd,ClassDef *templ,const QC
                                      md->typeString(),md->name(),md->argsString(),md->excpString(),
                                      md->protection(),md->virtualness(),md->isStatic(),Member,
                                      md->memberType(),
-                                     0,0,"");
+                                     ArgumentList(),ArgumentList(),"");
       imd->setMemberClass(cd);
       imd->setDocumentation(md->documentation(),md->docFile(),md->docLine());
       imd->setBriefDescription(md->briefDescription(),md->briefFile(),md->briefLine());
@@ -1641,7 +1389,7 @@ static void processTagLessClasses(ClassDef *rootCd,
             if (type.find(icd->name())!=-1) // matching tag less struct/union
             {
               QCString name = md->name();
-              if (name.at(0)=='@') name = "__unnamed__";
+              if (md->isAnonymous()) name = "__unnamed__";
               if (!prefix.isEmpty()) name.prepend(prefix+".");
               //printf("    found %s for class %s\n",name.data(),cd->name().data());
               ClassDef *ncd = createTagLessInstance(rootCd,icd,name);
@@ -1715,7 +1463,7 @@ static void findTagLessClasses()
 //----------------------------------------------------------------------
 // build a list of all namespaces mentioned in the documentation
 // and all namespaces that have a documentation block before their definition.
-static void buildNamespaceList(Entry *root)
+static void buildNamespaceList(const Entry *root)
 {
   if (
        (root->section==Entry::NAMESPACE_SEC ||
@@ -1749,7 +1497,7 @@ static void buildNamespaceList(Entry *root)
         {
           nd->setLanguage(root->lang);
         }
-        if (root->tagInfo==0) // if we found the namespace in a tag file
+        if (root->tagInfo()==0) // if we found the namespace in a tag file
                                    // and also in a project file, then remove
                                    // the tag file reference
         {
@@ -1769,7 +1517,7 @@ static void buildNamespaceList(Entry *root)
       {
         QCString tagName;
         QCString tagFileName;
-        TagInfo *tagInfo = root->tagInfo;
+        const TagInfo *tagInfo = root->tagInfo();
         if (tagInfo)
         {
           tagName     = tagInfo->tagName;
@@ -1845,7 +1593,7 @@ static void buildNamespaceList(Entry *root)
       }
     }
   }
-  RECURSE_ENTRYTREE(buildNamespaceList,root);
+  for (const auto &e : root->children()) buildNamespaceList(e.get());
 }
 
 //----------------------------------------------------------------------
@@ -1869,7 +1617,7 @@ static const NamespaceDef *findUsedNamespace(const NamespaceSDict *unl,
   return usingNd;
 }
 
-static void findUsingDirectives(Entry *root)
+static void findUsingDirectives(const Entry *root)
 {
   if (root->section==Entry::USINGDIR_SEC)
   {
@@ -1980,12 +1728,13 @@ static void findUsingDirectives(Entry *root)
         nd->setMetaData(root->metaData);
         nd->setInline((root->spec&Entry::Inline)!=0);
 
-        QListIterator<Grouping> gli(*root->groups);
-        Grouping *g;
-        for (;(g=gli.current());++gli)
+        //QListIterator<Grouping> gli(*root->groups);
+        //Grouping *g;
+        //for (;(g=gli.current());++gli)
+        for (const Grouping &g : root->groups)
         {
           GroupDef *gd=0;
-          if (!g->groupname.isEmpty() && (gd=Doxygen::groupSDict->find(g->groupname)))
+          if (!g.groupname.isEmpty() && (gd=Doxygen::groupSDict->find(g.groupname)))
             gd->addNamespace(nd);
         }
 
@@ -2005,12 +1754,12 @@ static void findUsingDirectives(Entry *root)
       }
     }
   }
-  RECURSE_ENTRYTREE(findUsingDirectives,root);
+  for (const auto &e : root->children()) findUsingDirectives(e.get());
 }
 
 //----------------------------------------------------------------------
 
-static void buildListOfUsingDecls(Entry *root)
+static void buildListOfUsingDecls(const Entry *root)
 {
   if (root->section==Entry::USINGDECL_SEC &&
       !(root->parent()->section&Entry::COMPOUND_MASK) // not a class/struct member
@@ -2027,11 +1776,11 @@ static void buildListOfUsingDecls(Entry *root)
       }
     }
   }
-  RECURSE_ENTRYTREE(buildListOfUsingDecls,root);
+  for (const auto &e : root->children()) buildListOfUsingDecls(e.get());
 }
 
 
-static void findUsingDeclarations(Entry *root)
+static void findUsingDeclarations(const Entry *root)
 {
   if (root->section==Entry::USINGDECL_SEC &&
       !(root->parent()->section&Entry::COMPOUND_MASK) // not a class/struct member
@@ -2081,7 +1830,7 @@ static void findUsingDeclarations(Entry *root)
       if (usingCd==0) // definition not in the input => add an artificial class
       {
         Debug::print(Debug::Classes,0,"  New using class '%s' (sec=0x%08x)! #tArgLists=%d\n",
-             qPrint(name),root->section,root->tArgLists ? (int)root->tArgLists->count() : -1);
+             qPrint(name),root->section,root->tArgLists.size());
         usingCd = createClassDef(
                      "<using>",1,1,
                      name,
@@ -2111,19 +1860,19 @@ static void findUsingDeclarations(Entry *root)
       }
     }
   }
-  RECURSE_ENTRYTREE(findUsingDeclarations,root);
+  for (const auto &e : root->children()) findUsingDeclarations(e.get());
 }
 
 //----------------------------------------------------------------------
 
-static void findUsingDeclImports(Entry *root)
+static void findUsingDeclImports(const Entry *root)
 {
   if (root->section==Entry::USINGDECL_SEC &&
       (root->parent()->section&Entry::COMPOUND_MASK) // in a class/struct member
      )
   {
     //printf("Found using declaration %s inside section %x\n",
-    //    rootNav->name().data(), rootNav->parent()->section());
+    //    root->name.data(), root->parent()->section);
     QCString fullName=removeRedundantWhiteSpace(root->parent()->name);
     fullName=stripAnonymousNamespaceScope(fullName);
     fullName=stripTemplateSpecifiersFromScope(fullName);
@@ -2137,7 +1886,7 @@ static void findUsingDeclImports(Entry *root)
         QCString scope=root->name.left(i);
         QCString memName=root->name.right(root->name.length()-i-2);
         const ClassDef *bcd = getResolvedClass(cd,0,scope); // todo: file in fileScope parameter
-        if (bcd)
+        if (bcd && bcd!=cd)
         {
           //printf("found class %s memName=%s\n",bcd->name().data(),memName.data());
           MemberNameInfoSDict *mndict=bcd->memberNameInfoSDict();
@@ -2157,12 +1906,12 @@ static void findUsingDeclImports(Entry *root)
                   MemberDef *newMd = 0;
                   {
                     QCString fileName = root->fileName;
-                    if (fileName.isEmpty() && root->tagInfo)
+                    if (fileName.isEmpty() && root->tagInfo())
                     {
-                      fileName = root->tagInfo->tagName;
+                      fileName = root->tagInfo()->tagName;
                     }
-                    const ArgumentList *templAl = md->templateArguments();
-                    const ArgumentList *al = md->templateArguments();
+                    const ArgumentList &templAl = md->templateArguments();
+                    const ArgumentList &al = md->templateArguments();
                     newMd = createMemberDef(
                       fileName,root->startLine,root->startColumn,
                       md->typeString(),memName,md->argsString(),
@@ -2209,7 +1958,7 @@ static void findUsingDeclImports(Entry *root)
     }
 
   }
-  RECURSE_ENTRYTREE(findUsingDeclImports,root);
+  for (const auto &e : root->children()) findUsingDeclImports(e.get());
 }
 
 //----------------------------------------------------------------------
@@ -2248,10 +1997,12 @@ static void findIncludedUsingDirectives()
 //----------------------------------------------------------------------
 
 static MemberDef *addVariableToClass(
-    Entry *root,
+    const Entry *root,
     ClassDef *cd,
     MemberType mtype,
+    const QCString &type,
     const QCString &name,
+    const QCString &args,
     bool fromAnnScope,
     MemberDef *fromAnnMemb,
     Protection prot,
@@ -2268,38 +2019,38 @@ static MemberDef *addVariableToClass(
   Debug::print(Debug::Variables,0,
       "  class variable:\n"
       "    '%s' '%s'::'%s' '%s' prot=%d ann=%d init='%s'\n",
-      qPrint(root->type),
+      qPrint(type),
       qPrint(qualScope),
       qPrint(name),
-      qPrint(root->args),
+      qPrint(args),
       root->protection,
       fromAnnScope,
       qPrint(root->initializer)
               );
 
   QCString def;
-  if (!root->type.isEmpty())
+  if (!type.isEmpty())
   {
     if (related || mtype==MemberType_Friend || Config_getBool(HIDE_SCOPE_NAMES))
     {
       if (root->spec&Entry::Alias) // turn 'typedef B A' into 'using A = B'
       {
-        def="using "+name+" = "+root->type.mid(7);
+        def="using "+name+" = "+type.mid(7);
       }
       else
       {
-        def=root->type+" "+name+root->args;
+        def=type+" "+name+root->args;
       }
     }
     else
     {
       if (root->spec&Entry::Alias) // turn 'typedef B C::A' into 'using C::A = B'
       {
-        def="using "+qualScope+scopeSeparator+name+" = "+root->type.mid(7);
+        def="using "+qualScope+scopeSeparator+name+" = "+type.mid(7);
       }
       else
       {
-        def=root->type+" "+qualScope+scopeSeparator+name+root->args;
+        def=type+" "+qualScope+scopeSeparator+name+args;
       }
     }
   }
@@ -2307,11 +2058,11 @@ static MemberDef *addVariableToClass(
   {
     if (Config_getBool(HIDE_SCOPE_NAMES))
     {
-      def=name+root->args;
+      def=name+args;
     }
     else
     {
-      def=qualScope+scopeSeparator+name+root->args;
+      def=qualScope+scopeSeparator+name+args;
     }
   }
   def.stripPrefix("static ");
@@ -2327,10 +2078,10 @@ static MemberDef *addVariableToClass(
     for (mni.toFirst();(md=mni.current());++mni)
     {
       //printf("md->getClassDef()=%p cd=%p type=[%s] md->typeString()=[%s]\n",
-      //    md->getClassDef(),cd,root->type.data(),md->typeString());
+      //    md->getClassDef(),cd,type.data(),md->typeString());
       if (!md->isAlias() &&
           md->getClassDef()==cd &&
-          removeRedundantWhiteSpace(root->type)==md->typeString())
+          removeRedundantWhiteSpace(type)==md->typeString())
         // member already in the scope
       {
 
@@ -2342,7 +2093,7 @@ static MemberDef *addVariableToClass(
           md->setProtection(root->protection);
           cd->reclassifyMember(md,MemberType_Property);
         }
-        addMemberDocs(root,md,def,0,FALSE);
+        addMemberDocs(root,md,def,0,FALSE,root->spec);
         //printf("    Member already found!\n");
         return md;
       }
@@ -2350,18 +2101,19 @@ static MemberDef *addVariableToClass(
   }
 
   QCString fileName = root->fileName;
-  if (fileName.isEmpty() && root->tagInfo)
+  if (fileName.isEmpty() && root->tagInfo())
   {
-    fileName = root->tagInfo->tagName;
+    fileName = root->tagInfo()->tagName;
   }
 
   // new member variable, typedef or enum value
   MemberDef *md=createMemberDef(
       fileName,root->startLine,root->startColumn,
-      root->type,name,root->args,root->exception,
+      type,name,args,root->exception,
       prot,Normal,root->stat,related,
-      mtype,root->tArgLists ? root->tArgLists->getLast() : 0,0, root->metaData);
-  md->setTagInfo(root->tagInfo);
+      mtype,!root->tArgLists.empty() ? root->tArgLists.back() : ArgumentList(),
+      ArgumentList(), root->metaData);
+  md->setTagInfo(root->tagInfo());
   md->setMemberClass(cd); // also sets outer scope (i.e. getOuterScope())
   //md->setDefFile(root->fileName);
   //md->setDefLine(root->startLine);
@@ -2419,17 +2171,19 @@ static MemberDef *addVariableToClass(
 
   //TODO: insert FileDef instead of filename strings.
   cd->insertUsedFile(root->fileDef());
-  root->changeSection(Entry::EMPTY_SEC);
+  root->markAsProcessed();
   return md;
 }
 
 //----------------------------------------------------------------------
 
 static MemberDef *addVariableToFile(
-    Entry *root,
+    const Entry *root,
     MemberType mtype,
     const QCString &scope,
+    const QCString &type,
     const QCString &name,
+    const QCString &args,
     bool fromAnnScope,
     /*int indentDepth,*/
     MemberDef *fromAnnMemb)
@@ -2438,10 +2192,10 @@ static MemberDef *addVariableToFile(
       "  global variable:\n"
       "    file='%s' type='%s' scope='%s' name='%s' args='%s' prot=`%d mtype=%d lang=%d\n",
       qPrint(root->fileName),
-      qPrint(root->type),
+      qPrint(type),
       qPrint(scope),
       qPrint(name),
-      qPrint(root->args),
+      qPrint(args),
       root->protection,
       mtype,
       root->lang
@@ -2452,18 +2206,18 @@ static MemberDef *addVariableToFile(
   // see if we have a typedef that should hide a struct or union
   if (mtype==MemberType_Typedef && Config_getBool(TYPEDEF_HIDES_STRUCT))
   {
-    QCString type = root->type;
-    type.stripPrefix("typedef ");
-    if (type.left(7)=="struct " || type.left(6)=="union ")
+    QCString ttype = type;
+    ttype.stripPrefix("typedef ");
+    if (ttype.left(7)=="struct " || ttype.left(6)=="union ")
     {
-      type.stripPrefix("struct ");
-      type.stripPrefix("union ");
+      ttype.stripPrefix("struct ");
+      ttype.stripPrefix("union ");
       static QRegExp re("[a-z_A-Z][a-z_A-Z0-9]*");
       int l,s;
-      s = re.match(type,0,&l);
+      s = re.match(ttype,0,&l);
       if (s>=0)
       {
-        QCString typeValue = type.mid(s,l);
+        QCString typeValue = ttype.mid(s,l);
         ClassDef *cd = getClass(typeValue);
         if (cd)
         {
@@ -2492,7 +2246,7 @@ static MemberDef *addVariableToFile(
   QCString def;
 
   // determine the definition of the global variable
-  if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@' &&
+  if (nd && !nd->isAnonymous() &&
       !Config_getBool(HIDE_SCOPE_NAMES)
      )
     // variable is inside a namespace, so put the scope before the name
@@ -2500,45 +2254,45 @@ static MemberDef *addVariableToFile(
     SrcLangExt lang = nd->getLanguage();
     QCString sep=getLanguageSpecificSeparator(lang);
 
-    if (!root->type.isEmpty())
+    if (!type.isEmpty())
     {
       if (root->spec&Entry::Alias) // turn 'typedef B NS::A' into 'using NS::A = B'
       {
-        def="using "+nd->name()+sep+name+" = "+root->type;
+        def="using "+nd->name()+sep+name+" = "+type;
       }
       else // normal member
       {
-        def=root->type+" "+nd->name()+sep+name+root->args;
+        def=type+" "+nd->name()+sep+name+args;
       }
     }
     else
     {
-      def=nd->name()+sep+name+root->args;
+      def=nd->name()+sep+name+args;
     }
   }
   else
   {
-    if (!root->type.isEmpty() && !root->name.isEmpty())
+    if (!type.isEmpty() && !root->name.isEmpty())
     {
       if (name.at(0)=='@') // dummy variable representing anonymous union
       {
-        def=root->type;
+        def=type;
       }
       else
       {
         if (root->spec&Entry::Alias) // turn 'typedef B A' into 'using A = B'
         {
-          def="using "+root->name+" = "+root->type.mid(7);
+          def="using "+root->name+" = "+type.mid(7);
         }
         else // normal member
         {
-          def=root->type+" "+name+root->args;
+          def=type+" "+name+args;
         }
       }
     }
     else
     {
-      def=name+root->args;
+      def=name+args;
     }
   }
   def.stripPrefix("static ");
@@ -2569,8 +2323,8 @@ static MemberDef *addVariableToFile(
         // variable already in the scope
       {
         bool isPHPArray = md->getLanguage()==SrcLangExt_PHP &&
-                          md->argsString()!=root->args &&
-                          root->args.find('[')!=-1;
+                          md->argsString()!=args &&
+                          args.find('[')!=-1;
         bool staticsInDifferentFiles =
                           root->stat && md->isStatic() &&
                           root->fileName!=md->getDefFileName();
@@ -2583,10 +2337,10 @@ static MemberDef *addVariableToFile(
         {
           Debug::print(Debug::Variables,0,
               "    variable already found: scope=%s\n",qPrint(md->getOuterScope()->name()));
-          addMemberDocs(root,md,def,0,FALSE);
+          addMemberDocs(root,md,def,0,FALSE,root->spec);
           md->setRefItems(root->sli);
           // if md is a variable forward declaration and root is the definition that
-          // turn md into the defintion
+          // turn md into the definition
           if (!root->explicitExternal && md->isExternal())
           {
             md->setDeclFile(md->getDefFileName(),md->getDefLine(),md->getDefColumn());
@@ -2605,20 +2359,21 @@ static MemberDef *addVariableToFile(
   }
 
   QCString fileName = root->fileName;
-  if (fileName.isEmpty() && root->tagInfo)
+  if (fileName.isEmpty() && root->tagInfo())
   {
-    fileName = root->tagInfo->tagName;
+    fileName = root->tagInfo()->tagName;
   }
 
   Debug::print(Debug::Variables,0,
-    "    new variable, nd=%s tagInfo=%p!\n",nd?qPrint(nd->name()):"<global>",root->tagInfo);
+    "    new variable, nd=%s tagInfo=%p!\n",nd?qPrint(nd->name()):"<global>",root->tagInfo());
   // new global variable, enum value or typedef
   MemberDef *md=createMemberDef(
       fileName,root->startLine,root->startColumn,
-      root->type,name,root->args,0,
+      type,name,args,0,
       root->protection, Normal,root->stat,Member,
-      mtype,root->tArgLists ? root->tArgLists->getLast() : 0,0, root->metaData);
-  md->setTagInfo(root->tagInfo);
+      mtype,!root->tArgLists.empty() ? root->tArgLists.back() : ArgumentList(),
+      ArgumentList(), root->metaData);
+  md->setTagInfo(root->tagInfo());
   md->setMemberSpecifiers(root->spec);
   md->setDocumentation(root->doc,root->docFile,root->docLine);
   md->setBriefDescription(root->brief,root->briefFile,root->briefLine);
@@ -2646,7 +2401,7 @@ static MemberDef *addVariableToFile(
   addMemberToGroups(root,md);
 
   md->setRefItems(root->sli);
-  if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@')
+  if (nd && !nd->isAnonymous())
   {
     md->setNamespace(nd);
     nd->insertMember(md);
@@ -2671,7 +2426,7 @@ static MemberDef *addVariableToFile(
     mn->append(md);
     Doxygen::functionNameSDict->append(name,mn);
   }
-  root->changeSection(Entry::EMPTY_SEC);
+  root->markAsProcessed();
   return md;
 }
 
@@ -2712,7 +2467,7 @@ static int findFunctionPtr(const QCString &type,int lang, int *pLength=0)
 /*! Returns TRUE iff \a type is a class within scope \a context.
  *  Used to detect variable declarations that look like function prototypes.
  */
-static bool isVarWithConstructor(Entry *root)
+static bool isVarWithConstructor(const Entry *root)
 {
   static QRegExp initChars("[0-9\"'&*!^]+");
   static QRegExp idChars("[a-z_A-Z][a-z_A-Z0-9]*");
@@ -2761,19 +2516,16 @@ static bool isVarWithConstructor(Entry *root)
                    // we need to rely on heuristics :-(
   {
     //printf("typeIsClass\n");
-    ArgumentList *al = root->argList;
-    if (al==0 || al->isEmpty())
+    if (root->argList.empty())
     {
       result=FALSE; // empty arg list -> function prototype.
       goto done;
     }
-    ArgumentListIterator ali(*al);
-    Argument *a;
-    for (ali.toFirst();(a=ali.current());++ali)
+    for (const Argument &a : root->argList)
     {
-      if (!a->name.isEmpty() || !a->defval.isEmpty())
+      if (!a.name.isEmpty() || !a.defval.isEmpty())
       {
-        if (a->name.find(initChars)==0)
+        if (a.name.find(initChars)==0)
         {
           result=TRUE;
         }
@@ -2783,31 +2535,31 @@ static bool isVarWithConstructor(Entry *root)
         }
         goto done;
       }
-      if (a->type.isEmpty() || getResolvedClass(ctx,fd,a->type)!=0)
+      if (a.type.isEmpty() || getResolvedClass(ctx,fd,a.type)!=0)
       {
         result=FALSE; // arg type is a known type
         goto done;
       }
-      if (checkIfTypedef(ctx,fd,a->type))
+      if (checkIfTypedef(ctx,fd,a.type))
       {
          //printf("%s:%d: false (arg is typedef)\n",__FILE__,__LINE__);
          result=FALSE; // argument is a typedef
          goto done;
       }
-      if (a->type.at(a->type.length()-1)=='*' ||
-          a->type.at(a->type.length()-1)=='&')
+      if (a.type.at(a.type.length()-1)=='*' ||
+          a.type.at(a.type.length()-1)=='&')
                      // type ends with * or & => pointer or reference
       {
         result=FALSE;
         goto done;
       }
-      if (a->type.find(initChars)==0)
+      if (a.type.find(initChars)==0)
       {
         result=TRUE; // argument type starts with typical initializer char
         goto done;
       }
-      QCString resType=resolveTypeDef(ctx,a->type);
-      if (resType.isEmpty()) resType=a->type;
+      QCString resType=resolveTypeDef(ctx,a.type);
+      if (resType.isEmpty()) resType=a.type;
       int len;
       if (idChars.match(resType,0,&len)==0) // resType starts with identifier
       {
@@ -2831,7 +2583,7 @@ done:
   return result;
 }
 
-static void addVariable(Entry *root,int isFuncPtr=-1)
+static void addVariable(const Entry *root,int isFuncPtr=-1)
 {
     static bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
 
@@ -2847,48 +2599,52 @@ static void addVariable(Entry *root,int isFuncPtr=-1)
                 );
     //printf("root->parent->name=%s\n",root->parent->name.data());
 
-    if (root->type.isEmpty() && root->name.find("operator")==-1 &&
-        (root->name.find('*')!=-1 || root->name.find('&')!=-1))
+    QCString type = root->type;
+    QCString name = root->name;
+    QCString args = root->args;
+    if (type.isEmpty() && name.find("operator")==-1 &&
+        (name.find('*')!=-1 || name.find('&')!=-1))
     {
       // recover from parse error caused by redundant braces
       // like in "int *(var[10]);", which is parsed as
       // type="" name="int *" args="(var[10])"
 
-      root->type=root->name;
+      type=name;
       static const QRegExp reName("[a-z_A-Z][a-z_A-Z0-9]*");
       int l=0;
-      int i=root->args.isEmpty() ? -1 : reName.match(root->args,0,&l);
+      int i=args.isEmpty() ? -1 : reName.match(args,0,&l);
       if (i!=-1)
       {
-        root->name=root->args.mid(i,l);
-        root->args=root->args.mid(i+l,root->args.find(')',i+l)-i-l);
+        name=args.mid(i,l);
+        args=args.mid(i+l,args.find(')',i+l)-i-l);
       }
       //printf("new: type='%s' name='%s' args='%s'\n",
-      //    root->type.data(),root->name.data(),root->args.data());
+      //    type.data(),name.data(),args.data());
     }
     else
     {
       int i=isFuncPtr;
-      if (i==-1 && (root->spec&Entry::Alias)==0) i=findFunctionPtr(root->type,root->lang); // for typedefs isFuncPtr is not yet set
+      if (i==-1 && (root->spec&Entry::Alias)==0) i=findFunctionPtr(type,root->lang); // for typedefs isFuncPtr is not yet set
       Debug::print(Debug::Variables,0,"  functionPtr? %s\n",i!=-1?"yes":"no");
       if (i!=-1) // function pointer
       {
-        int ai = root->type.find('[',i);
+        int ai = type.find('[',i);
         if (ai>i) // function pointer array
         {
-          root->args.prepend(root->type.right(root->type.length()-ai));
-          root->type=root->type.left(ai);
+          args.prepend(type.right(type.length()-ai));
+          type=type.left(ai);
         }
-        else if (root->type.find(')',i)!=-1) // function ptr, not variable like "int (*bla)[10]"
+        else if (type.find(')',i)!=-1) // function ptr, not variable like "int (*bla)[10]"
         {
-          root->type=root->type.left(root->type.length()-1);
-          root->args.prepend(") ");
-          //printf("root->type=%s root->args=%s\n",root->type.data(),root->args.data());
+          type=type.left(type.length()-1);
+          args.prepend(") ");
+          //printf("type=%s args=%s\n",type.data(),args.data());
         }
       }
     }
 
-    QCString scope,name=removeRedundantWhiteSpace(root->name);
+    QCString scope;
+    name=removeRedundantWhiteSpace(name);
 
     // find the scope of this variable
     Entry *p = root->parent();
@@ -2904,7 +2660,7 @@ static void addVariable(Entry *root,int isFuncPtr=-1)
     }
 
     MemberType mtype;
-    QCString type=root->type.stripWhiteSpace();
+    type=type.stripWhiteSpace();
     ClassDef *cd=0;
     bool isRelated=FALSE;
     bool isMemberOf=FALSE;
@@ -2913,10 +2669,10 @@ static void addVariable(Entry *root,int isFuncPtr=-1)
     classScope=stripTemplateSpecifiersFromScope(classScope,FALSE);
     QCString annScopePrefix=scope.left(scope.length()-classScope.length());
 
-    if (root->name.findRev("::")!=-1)
+    if (name.findRev("::")!=-1)
     {
-      if (root->type=="friend class" || root->type=="friend struct" ||
-          root->type=="friend union")
+      if (type=="friend class" || type=="friend struct" ||
+          type=="friend union")
       {
          cd=getClass(scope);
          if (cd)
@@ -2924,7 +2680,9 @@ static void addVariable(Entry *root,int isFuncPtr=-1)
            addVariableToClass(root,  // entry
                               cd,    // class to add member to
                               MemberType_Friend, // type of member
-                              name, // name of the member
+                              type,   // type value as string
+                              name,   // name of the member
+                              args,   // arguments as string
                               FALSE,  // from Anonymous scope
                               0,      // anonymous member
                               Public, // protection
@@ -2999,7 +2757,9 @@ static void addVariable(Entry *root,int isFuncPtr=-1)
             md=addVariableToClass(root,  // entry
                                   pcd,   // class to add member to
                                   mtype, // member type
+                                  type,  // type value as string
                                   name,  // member name
+                                  args,  // arguments as string
                                   TRUE,  // from anonymous scope
                                   0,     // from anonymous member
                                   root->protection,
@@ -3011,7 +2771,7 @@ static void addVariable(Entry *root,int isFuncPtr=-1)
           {
             if (mtype==MemberType_Variable)
             {
-              md=addVariableToFile(root,mtype,pScope,name,TRUE,0);
+              md=addVariableToFile(root,mtype,pScope,type,name,args,TRUE,0);
             }
             //added=TRUE;
           }
@@ -3024,7 +2784,9 @@ static void addVariable(Entry *root,int isFuncPtr=-1)
       addVariableToClass(root,   // entry
                          cd,     // class to add member to
                          mtype,  // member type
+                         type,   // type value as string
                          name,   // name of the member
+                         args,   // arguments as string
                          FALSE,  // from anonymous scope
                          md,     // from anonymous member
                          root->protection,
@@ -3033,7 +2795,7 @@ static void addVariable(Entry *root,int isFuncPtr=-1)
     else if (!name.isEmpty()) // global variable
     {
       //printf("Inserting member in global scope %s!\n",scope.data());
-      addVariableToFile(root,mtype,scope,name,FALSE,/*0,*/0);
+      addVariableToFile(root,mtype,scope,type,name,args,FALSE,/*0,*/0);
     }
 
 }
@@ -3041,7 +2803,7 @@ static void addVariable(Entry *root,int isFuncPtr=-1)
 //----------------------------------------------------------------------
 // Searches the Entry tree for typedef documentation sections.
 // If found they are stored in their class or in the global list.
-static void buildTypedefList(Entry *root)
+static void buildTypedefList(const Entry *root)
 {
   //printf("buildVarList(%s)\n",rootNav->name().data());
   if (!root->name.isEmpty() &&
@@ -3051,24 +2813,15 @@ static void buildTypedefList(Entry *root)
   {
     addVariable(root);
   }
-  if (root->children())
-  {
-    EntryListIterator eli(*root->children());
-    Entry *e;
-    for (;(e=eli.current());++eli)
-    {
-      if (e->section!=Entry::ENUM_SEC)
-      {
-        buildTypedefList(e);
-      }
-    }
-  }
+  for (const auto &e : root->children())
+    if (e->section!=Entry::ENUM_SEC)
+      buildTypedefList(e.get());
 }
 
 //----------------------------------------------------------------------
 // Searches the Entry tree for sequence documentation sections.
 // If found they are stored in the global list.
-static void buildSequenceList(Entry *root)
+static void buildSequenceList(const Entry *root)
 {
   if (!root->name.isEmpty() &&
       root->section==Entry::VARIABLE_SEC &&
@@ -3077,24 +2830,15 @@ static void buildSequenceList(Entry *root)
   {
     addVariable(root);
   }
-  if (root->children())
-  {
-    EntryListIterator eli(*root->children());
-    Entry *e;
-    for (;(e=eli.current());++eli)
-    {
-      if (e->section!=Entry::ENUM_SEC)
-      {
-        buildSequenceList(e);
-      }
-    }
-  }
+  for (const auto &e : root->children())
+    if (e->section!=Entry::ENUM_SEC)
+      buildSequenceList(e.get());
 }
 
 //----------------------------------------------------------------------
 // Searches the Entry tree for dictionary documentation sections.
 // If found they are stored in the global list.
-static void buildDictionaryList(Entry *root)
+static void buildDictionaryList(const Entry *root)
 {
   if (!root->name.isEmpty() &&
       root->section==Entry::VARIABLE_SEC &&
@@ -3103,25 +2847,16 @@ static void buildDictionaryList(Entry *root)
   {
     addVariable(root);
   }
-  if (root->children())
-  {
-    EntryListIterator eli(*root->children());
-    Entry *e;
-    for (;(e=eli.current());++eli)
-    {
-      if (e->section!=Entry::ENUM_SEC)
-      {
-        buildDictionaryList(e);
-      }
-    }
-  }
+  for (const auto &e : root->children())
+    if (e->section!=Entry::ENUM_SEC)
+      buildDictionaryList(e.get());
 }
 
 //----------------------------------------------------------------------
 // Searches the Entry tree for Variable documentation sections.
 // If found they are stored in their class or in the global list.
 
-static void buildVarList(Entry *root)
+static void buildVarList(const Entry *root)
 {
   //printf("buildVarList(%s) section=%08x\n",rootNav->name().data(),rootNav->section());
   int isFuncPtr=-1;
@@ -3141,18 +2876,9 @@ static void buildVarList(Entry *root)
   {
     addVariable(root,isFuncPtr);
   }
-  if (root->children())
-  {
-    EntryListIterator eli(*root->children());
-    Entry *e;
-    for (;(e=eli.current());++eli)
-    {
-      if (e->section!=Entry::ENUM_SEC)
-      {
-        buildVarList(e);
-      }
-    }
-  }
+  for (const auto &e : root->children())
+    if (e->section!=Entry::ENUM_SEC)
+      buildVarList(e.get());
 }
 
 //----------------------------------------------------------------------
@@ -3161,7 +2887,7 @@ static void buildVarList(Entry *root)
 //
 
 static void addInterfaceOrServiceToServiceOrSingleton(
-        Entry *const root,
+        const Entry *root,
         ClassDef *const cd,
         QCString const& rname)
 {
@@ -3170,15 +2896,15 @@ static void addInterfaceOrServiceToServiceOrSingleton(
       ? MemberType_Interface
       : MemberType_Service;
   QCString fileName = root->fileName;
-  if (fileName.isEmpty() && root->tagInfo)
+  if (fileName.isEmpty() && root->tagInfo())
   {
-    fileName = root->tagInfo->tagName;
+    fileName = root->tagInfo()->tagName;
   }
   MemberDef *const md = createMemberDef(
       fileName, root->startLine, root->startColumn, root->type, rname,
       "", "", root->protection, root->virt, root->stat, Member,
-      type, 0, root->argList, root->metaData);
-  md->setTagInfo(root->tagInfo);
+      type, ArgumentList(), root->argList, root->metaData);
+  md->setTagInfo(root->tagInfo());
   md->setMemberClass(cd);
   md->setDocumentation(root->doc,root->docFile,root->docLine);
   md->setDocsForDefinition(false);
@@ -3233,11 +2959,11 @@ static void addInterfaceOrServiceToServiceOrSingleton(
   cd->insertUsedFile(fd);
 
   addMemberToGroups(root,md);
-  root->changeSection(Entry::EMPTY_SEC);
+  root->markAsProcessed();
   md->setRefItems(root->sli);
 }
 
-static void buildInterfaceAndServiceList(Entry *root)
+static void buildInterfaceAndServiceList(const Entry *root)
 {
   if (root->section==Entry::EXPORTED_INTERFACE_SEC ||
       root->section==Entry::INCLUDED_SERVICE_SEC)
@@ -3254,7 +2980,7 @@ static void buildInterfaceAndServiceList(Entry *root)
                  qPrint(root->fileName),
                  root->startLine,
                  root->bodyLine,
-                 root->tArgLists ? (int)root->tArgLists->count() : -1,
+                 root->tArgLists.size(),
                  root->mGrpId,
                  root->spec,
                  root->proto,
@@ -3290,7 +3016,7 @@ static void buildInterfaceAndServiceList(Entry *root)
   {
     case SrcLangExt_Unknown: // fall through (root node always is Unknown)
     case SrcLangExt_IDL:
-        RECURSE_ENTRYTREE(buildInterfaceAndServiceList,root);
+        for (const auto &e : root->children()) buildInterfaceAndServiceList(e.get());
         break;
     default:
         return; // nothing to do here
@@ -3302,26 +3028,32 @@ static void buildInterfaceAndServiceList(Entry *root)
 // Searches the Entry tree for Function sections.
 // If found they are stored in their class or in the global list.
 
-static void addMethodToClass(Entry *root,ClassDef *cd,
-                  const QCString &rname,bool isFriend)
+static void addMethodToClass(const Entry *root,ClassDef *cd,
+                  const QCString &rtype,const QCString &rname,const QCString &rargs,
+                  bool isFriend,
+                  Protection protection,bool stat,Specifier virt,uint64 spec,
+                  const QCString &relates
+                  )
 {
   FileDef *fd=root->fileDef();
 
   int l;
   static QRegExp re("([a-z_A-Z0-9: ]*[ &*]+[ ]*");
-  int ts=root->type.find('<');
-  int te=root->type.findRev('>');
-  int i=re.match(root->type,0,&l);
+  QCString type = rtype;
+  QCString args = rargs;
+  int ts=type.find('<');
+  int te=type.findRev('>');
+  int i=re.match(type,0,&l);
   if (i!=-1 && ts!=-1 && ts<te && ts<i && i<te) // avoid changing A<int(int*)>, see bug 677315
   {
     i=-1;
   }
 
   if (cd->getLanguage()==SrcLangExt_Cpp && // only C has pointers
-      !root->type.isEmpty() && (root->spec&Entry::Alias)==0 && i!=-1) // function variable
+      !type.isEmpty() && (root->spec&Entry::Alias)==0 && i!=-1) // function variable
   {
-    root->args+=root->type.right(root->type.length()-i-l);
-    root->type=root->type.left(i+l);
+    args+=type.right(type.length()-i-l);
+    type=type.left(i+l);
   }
 
   QCString name=removeRedundantWhiteSpace(rname);
@@ -3342,32 +3074,33 @@ static void addMethodToClass(Entry *root,ClassDef *cd,
   }
 
   QCString fileName = root->fileName;
-  if (fileName.isEmpty() && root->tagInfo)
+  if (fileName.isEmpty() && root->tagInfo())
   {
-    fileName = root->tagInfo->tagName;
+    fileName = root->tagInfo()->tagName;
   }
 
-  //printf("root->name='%s; root->args='%s' root->argList='%s'\n",
-  //    root->name.data(),root->args.data(),argListToString(root->argList).data()
+  //printf("root->name='%s; args='%s' root->argList='%s'\n",
+  //    root->name.data(),args.data(),argListToString(root->argList).data()
   //   );
 
   // adding class member
   MemberDef *md=createMemberDef(
       fileName,root->startLine,root->startColumn,
-      root->type,name,root->args,root->exception,
-      root->protection,root->virt,
-      root->stat && root->relatesType != MemberOf,
-      root->relates.isEmpty() ? Member :
+      type,name,args,root->exception,
+      protection,virt,
+      stat && root->relatesType != MemberOf,
+      relates.isEmpty() ? Member :
           root->relatesType == MemberOf ? Foreign : Related,
-      mtype,root->tArgLists ? root->tArgLists->getLast() : 0,root->argList, root->metaData);
-  md->setTagInfo(root->tagInfo);
+      mtype,!root->tArgLists.empty() ? root->tArgLists.back() : ArgumentList(),
+      root->argList, root->metaData);
+  md->setTagInfo(root->tagInfo());
   md->setMemberClass(cd);
   md->setDocumentation(root->doc,root->docFile,root->docLine);
   md->setDocsForDefinition(!root->proto);
   md->setBriefDescription(root->brief,root->briefFile,root->briefLine);
   md->setInbodyDocumentation(root->inbodyDocs,root->inbodyFile,root->inbodyLine);
   md->setBodySegment(root->bodyLine,root->endBodyLine);
-  md->setMemberSpecifiers(root->spec);
+  md->setMemberSpecifiers(spec);
   md->setMemberGroupId(root->mGrpId);
   md->setTypeConstraints(root->typeConstr);
   md->setLanguage(root->lang);
@@ -3389,54 +3122,27 @@ static void addMethodToClass(Entry *root,ClassDef *cd,
     // for PHP we use Class::method and Namespace\method
     scopeSeparator="::";
   }
-  if (!root->relates.isEmpty() || isFriend || Config_getBool(HIDE_SCOPE_NAMES))
+//  QCString optArgs = root->argList.empty() ? args : QCString();
+  if (!relates.isEmpty() || isFriend || Config_getBool(HIDE_SCOPE_NAMES))
   {
-    if (!root->type.isEmpty())
+    if (!type.isEmpty())
     {
-      if (root->argList)
-      {
-        def=root->type+" "+name;
-      }
-      else
-      {
-        def=root->type+" "+name+root->args;
-      }
+      def=type+" "+name; //+optArgs;
     }
     else
     {
-      if (root->argList)
-      {
-        def=name;
-      }
-      else
-      {
-        def=name+root->args;
-      }
+      def=name; //+optArgs;
     }
   }
   else
   {
-    if (!root->type.isEmpty())
+    if (!type.isEmpty())
     {
-      if (root->argList)
-      {
-        def=root->type+" "+qualScope+scopeSeparator+name;
-      }
-      else
-      {
-        def=root->type+" "+qualScope+scopeSeparator+name+root->args;
-      }
+      def=type+" "+qualScope+scopeSeparator+name; //+optArgs;
     }
     else
     {
-      if (root->argList)
-      {
-        def=qualScope+scopeSeparator+name;
-      }
-      else
-      {
-        def=qualScope+scopeSeparator+name+root->args;
-      }
+      def=qualScope+scopeSeparator+name; //+optArgs;
     }
   }
   if (def.left(7)=="friend ") def=def.right(def.length()-7);
@@ -3450,10 +3156,10 @@ static void addMethodToClass(Entry *root,ClassDef *cd,
       "  Func Member:\n"
       "    '%s' '%s'::'%s' '%s' proto=%d\n"
       "    def='%s'\n",
-      qPrint(root->type),
+      qPrint(type),
       qPrint(qualScope),
       qPrint(rname),
-      qPrint(root->args),
+      qPrint(args),
       root->proto,
       qPrint(def)
               );
@@ -3478,12 +3184,12 @@ static void addMethodToClass(Entry *root,ClassDef *cd,
   cd->insertUsedFile(fd);
 
   addMemberToGroups(root,md);
-  root->changeSection(Entry::EMPTY_SEC);
+  root->markAsProcessed();
   md->setRefItems(root->sli);
 }
 
 
-static void buildFunctionList(Entry *root)
+static void buildFunctionList(const Entry *root)
 {
   if (root->section==Entry::FUNCTION_SEC)
   {
@@ -3499,7 +3205,7 @@ static void buildFunctionList(Entry *root)
                  qPrint(root->fileName),
                  root->startLine,
                  root->bodyLine,
-                 root->tArgLists ? (int)root->tArgLists->count() : -1,
+                 root->tArgLists.size(),
                  root->mGrpId,
                  root->spec,
                  root->proto,
@@ -3574,7 +3280,8 @@ static void buildFunctionList(Entry *root)
       {
         Debug::print(Debug::Functions,0,"  --> member %s of class %s!\n",
             qPrint(rname),qPrint(cd->name()));
-        addMethodToClass(root,cd,rname,isFriend);
+        addMethodToClass(root,cd,root->type,rname,root->args,isFriend,
+                         root->protection,root->stat,root->virt,root->spec,root->relates);
       }
       else if (!((root->parent()->section & Entry::COMPOUND_MASK)
                  || root->parent()->section==Entry::OBJCIMPL_SEC
@@ -3618,16 +3325,16 @@ static void buildFunctionList(Entry *root)
               if (rnd) rnsName = rnd->name().copy();
               //printf("matching arguments for %s%s %s%s\n",
               //    md->name().data(),md->argsString(),rname.data(),argListToString(root->argList).data());
-              ArgumentList *mdAl = md->argumentList();
-              const ArgumentList *mdTempl = md->templateArguments();
+              ArgumentList &mdAl = md->argumentList();
+              const ArgumentList &mdTempl = md->templateArguments();
 
               // in case of template functions, we need to check if the
               // functions have the same number of template parameters
               bool sameNumTemplateArgs = TRUE;
               bool matchingReturnTypes = TRUE;
-              if (mdTempl!=0 && root->tArgLists)
+              if (!mdTempl.empty() && !root->tArgLists.empty())
               {
-                if (mdTempl->count()!=root->tArgLists->getLast()->count())
+                if (mdTempl.size()!=root->tArgLists.back().size())
                 {
                   sameNumTemplateArgs = FALSE;
                 }
@@ -3650,9 +3357,9 @@ static void buildFunctionList(Entry *root)
                  )
               {
                 GroupDef *gd=0;
-                if (root->groups->getFirst() && !root->groups->getFirst()->groupname.isEmpty())
+                if (!root->groups.empty() && !root->groups.front().groupname.isEmpty())
                 {
-                  gd = Doxygen::groupSDict->find(root->groups->getFirst()->groupname);
+                  gd = Doxygen::groupSDict->find(root->groups.front().groupname);
                 }
                 //printf("match!\n");
                 //printf("mnd=%p rnd=%p nsName=%s rnsName=%s\n",mnd,rnd,nsName.data(),rnsName.data());
@@ -3675,12 +3382,13 @@ static void buildFunctionList(Entry *root)
                 if (found)
                 {
                   // merge argument lists
-                  mergeArguments(mdAl,root->argList,!root->doc.isEmpty());
+                  ArgumentList mergedArgList = root->argList;
+                  mergeArguments(mdAl,mergedArgList,!root->doc.isEmpty());
                   // merge documentation
                   if (md->documentation().isEmpty() && !root->doc.isEmpty())
                   {
-                    ArgumentList *argList = new ArgumentList;
-                    stringToArgumentList(root->args,argList);
+                    ArgumentList argList;
+                    stringToArgumentList(root->lang,root->args,argList);
                     if (root->proto)
                     {
                       //printf("setDeclArgumentList to %p\n",argList);
@@ -3715,16 +3423,15 @@ static void buildFunctionList(Entry *root)
                   md->enableReferencesRelation(md->hasReferencesRelation() || root->referencesRelation);
 
                   // merge ingroup specifiers
-                  if (md->getGroupDef()==0 && root->groups->getFirst()!=0)
+                  if (md->getGroupDef()==0 && !root->groups.empty())
                   {
                     addMemberToGroups(root,md);
                   }
-                  else if (md->getGroupDef()!=0 && root->groups->count()==0)
+                  else if (md->getGroupDef()!=0 && root->groups.empty())
                   {
                     //printf("existing member is grouped, new member not\n");
-                    root->groups->append(new Grouping(md->getGroupDef()->name(), md->getGroupPri()));
                   }
-                  else if (md->getGroupDef()!=0 && root->groups->getFirst()!=0)
+                  else if (md->getGroupDef()!=0 && !root->groups.empty())
                   {
                     //printf("both members are grouped\n");
                   }
@@ -3753,15 +3460,16 @@ static void buildFunctionList(Entry *root)
           //       root->type.data(),rname.data(),root->args.data(),root->bodyLine);
 
           // new global function
-          ArgumentList *tArgList = root->tArgLists ? root->tArgLists->getLast() : 0;
           QCString name=removeRedundantWhiteSpace(rname);
           md=createMemberDef(
               root->fileName,root->startLine,root->startColumn,
               root->type,name,root->args,root->exception,
               root->protection,root->virt,root->stat,Member,
-              MemberType_Function,tArgList,root->argList,root->metaData);
+              MemberType_Function,
+              !root->tArgLists.empty() ? root->tArgLists.back() : ArgumentList(),
+              root->argList,root->metaData);
 
-          md->setTagInfo(root->tagInfo);
+          md->setTagInfo(root->tagInfo());
           md->setLanguage(root->lang);
           md->setId(root->id);
           //md->setDefFile(root->fileName);
@@ -3803,27 +3511,14 @@ static void buildFunctionList(Entry *root)
           }
 
           QCString def;
+          //QCString optArgs = root->argList.empty() ? QCString() : root->args;
           if (!root->type.isEmpty())
           {
-            if (root->argList)
-            {
-              def=root->type+" "+scope+name;
-            }
-            else
-            {
-              def=root->type+" "+scope+name+root->args;
-            }
+            def=root->type+" "+scope+name; //+optArgs;
           }
           else
           {
-            if (root->argList)
-            {
-              def=scope+name.copy();
-            }
-            else
-            {
-              def=scope+name+root->args;
-            }
+            def=scope+name; //+optArgs;
           }
           Debug::print(Debug::Functions,0,
                      "  Global Function:\n"
@@ -3878,9 +3573,7 @@ static void buildFunctionList(Entry *root)
           if (root->relatesType == Simple) // if this is a relatesalso command,
                                            // allow find Member to pick it up
           {
-            root->changeSection(Entry::EMPTY_SEC); // Otherwise we have finished
-                                                   // with this entry.
-
+            root->markAsProcessed(); // Otherwise we have finished with this entry.
           }
         }
         else
@@ -3909,7 +3602,7 @@ static void buildFunctionList(Entry *root)
             );
     }
   }
-  RECURSE_ENTRYTREE(buildFunctionList,root);
+  for (const auto &e : root->children()) buildFunctionList(e.get());
 }
 
 //----------------------------------------------------------------------
@@ -3949,8 +3642,8 @@ static void findFriends()
              ) // if the member is related and the arguments match then the
                // function is actually a friend.
           {
-            ArgumentList *mmdAl = mmd->argumentList();
-            ArgumentList *fmdAl = fmd->argumentList();
+            ArgumentList &mmdAl = mmd->argumentList();
+            ArgumentList &fmdAl = fmd->argumentList();
             mergeArguments(mmdAl,fmdAl);
             if (!fmd->documentation().isEmpty())
             {
@@ -4031,7 +3724,7 @@ static void transferFunctionDocumentation()
         MemberNameIterator mni2(*mn);
         for (;(mdef=mni2.current());++mni2)
         {
-          if (!mdec->isAlias() && !mdef->isAlias())
+          if (mdec!=mdef && !mdec->isAlias() && !mdef->isAlias())
           {
             combineDeclarationAndDefinition(mdec,mdef);
           }
@@ -4066,8 +3759,8 @@ static void transferFunctionReferences()
     }
     if (mdef && mdec)
     {
-      ArgumentList *mdefAl = mdef->argumentList();
-      ArgumentList *mdecAl = mdec->argumentList();
+      ArgumentList &mdefAl = mdef->argumentList();
+      ArgumentList &mdecAl = mdec->argumentList();
       if (
           matchArguments2(mdef->getOuterScope(),mdef->getFileDef(),mdefAl,
                           mdec->getOuterScope(),mdec->getFileDef(),mdecAl,
@@ -4187,31 +3880,26 @@ static void transferRelatedFunctionDocumentation()
  * Example: A template class A with template arguments <R,S,T>
  * that inherits from B<T,T,S> will have T and S in the dictionary.
  */
-static QDict<int> *getTemplateArgumentsInName(ArgumentList *templateArguments,const QCString &name)
+static QDict<int> *getTemplateArgumentsInName(const ArgumentList &templateArguments,const QCString &name)
 {
   QDict<int> *templateNames = new QDict<int>(17);
   templateNames->setAutoDelete(TRUE);
   static QRegExp re("[a-z_A-Z][a-z_A-Z0-9:]*");
-  if (templateArguments)
+  int count=0;
+  for (const Argument &arg : templateArguments)
   {
-    ArgumentListIterator ali(*templateArguments);
-    Argument *arg;
-    int count=0;
-    for (ali.toFirst();(arg=ali.current());++ali,count++)
+    int i,p=0,l;
+    while ((i=re.match(name,p,&l))!=-1)
     {
-      int i,p=0,l;
-      while ((i=re.match(name,p,&l))!=-1)
+      QCString n = name.mid(i,l);
+      if (n==arg.name)
       {
-        QCString n = name.mid(i,l);
-        if (n==arg->name)
+        if (templateNames->find(n)==0)
         {
-          if (templateNames->find(n)==0)
-          {
-            templateNames->insert(n,new int(count));
-          }
+          templateNames->insert(n,new int(count));
         }
-        p=i+l;
       }
+      p=i+l;
     }
   }
   return templateNames;
@@ -4257,17 +3945,17 @@ static ClassDef *findClassWithinClassContext(Definition *context,ClassDef *cd,co
 }
 
 
-static void findUsedClassesForClass(Entry *root,
+static void findUsedClassesForClass(const Entry *root,
                            Definition *context,
                            ClassDef *masterCd,
                            ClassDef *instanceCd,
                            bool isArtificial,
-                           ArgumentList *actualArgs=0,
+                           const ArgumentList &actualArgs=ArgumentList(),
                            QDict<int> *templateNames=0
                            )
 {
   masterCd->setVisited(TRUE);
-  ArgumentList *formalArgs = masterCd->templateArguments();
+  const ArgumentList &formalArgs = masterCd->templateArguments();
   if (masterCd->memberNameInfoSDict())
   {
     MemberNameInfoSDict::Iterator mnili(*masterCd->memberNameInfoSDict());
@@ -4293,10 +3981,7 @@ static void findUsedClassesForClass(Entry *root,
           QCString templSpec;
           bool found=FALSE;
           // the type can contain template variables, replace them if present
-          if (actualArgs)
-          {
-            type = substituteTemplateArgumentsInString(type,formalArgs,actualArgs);
-          }
+          type = substituteTemplateArgumentsInString(type,formalArgs,actualArgs);
 
           //printf("      template substitution gives=%s\n",type.data());
           while (!found && extractClassNameFromType(type,pos,usedClassName,templSpec,root->lang)!=-1)
@@ -4336,37 +4021,32 @@ static void findUsedClassesForClass(Entry *root,
             BaseInfo bi(usedName,Public,Normal);
             findClassRelation(root,context,instanceCd,&bi,templateNames,TemplateInstances,isArtificial);
 
-            if (masterCd->templateArguments())
+            int count=0;
+            for (const Argument &arg : masterCd->templateArguments())
             {
-              ArgumentListIterator ali(*masterCd->templateArguments());
-              Argument *arg;
-              int count=0;
-              for (ali.toFirst();(arg=ali.current());++ali,++count)
+              if (arg.name==usedName) // type is a template argument
               {
-                if (arg->name==usedName) // type is a template argument
-                {
-                  found=TRUE;
-                  Debug::print(Debug::Classes,0,"    New used class '%s'\n", qPrint(usedName));
+                found=TRUE;
+                Debug::print(Debug::Classes,0,"    New used class '%s'\n", qPrint(usedName));
 
-                  ClassDef *usedCd = Doxygen::hiddenClasses->find(usedName);
-                  if (usedCd==0)
-                  {
-                    usedCd = createClassDef(
-                        masterCd->getDefFileName(),masterCd->getDefLine(),
-                        masterCd->getDefColumn(),
-                        usedName,
-                        ClassDef::Class);
-                    //printf("making %s a template argument!!!\n",usedCd->name().data());
-                    usedCd->makeTemplateArgument();
-                    usedCd->setUsedOnly(TRUE);
-                    usedCd->setLanguage(masterCd->getLanguage());
-                    Doxygen::hiddenClasses->append(usedName,usedCd);
-                  }
-                  if (isArtificial) usedCd->setArtificial(TRUE);
-                  Debug::print(Debug::Classes,0,"      Adding used class '%s' (1)\n", qPrint(usedCd->name()));
-                  instanceCd->addUsedClass(usedCd,md->name(),md->protection());
-                  usedCd->addUsedByClass(instanceCd,md->name(),md->protection());
+                ClassDef *usedCd = Doxygen::hiddenClasses->find(usedName);
+                if (usedCd==0)
+                {
+                  usedCd = createClassDef(
+                      masterCd->getDefFileName(),masterCd->getDefLine(),
+                      masterCd->getDefColumn(),
+                      usedName,
+                      ClassDef::Class);
+                  //printf("making %s a template argument!!!\n",usedCd->name().data());
+                  usedCd->makeTemplateArgument();
+                  usedCd->setUsedOnly(TRUE);
+                  usedCd->setLanguage(masterCd->getLanguage());
+                  Doxygen::hiddenClasses->append(usedName,usedCd);
                 }
+                if (isArtificial) usedCd->setArtificial(TRUE);
+                Debug::print(Debug::Classes,0,"      Adding used class '%s' (1)\n", qPrint(usedCd->name()));
+                instanceCd->addUsedClass(usedCd,md->name(),md->protection());
+                usedCd->addUsedByClass(instanceCd,md->name(),md->protection());
               }
             }
 
@@ -4427,37 +4107,32 @@ static void findUsedClassesForClass(Entry *root,
 }
 
 static void findBaseClassesForClass(
-      Entry *root,
+      const Entry *root,
       Definition *context,
       ClassDef *masterCd,
       ClassDef *instanceCd,
       FindBaseClassRelation_Mode mode,
       bool isArtificial,
-      ArgumentList *actualArgs=0,
+      const ArgumentList &actualArgs=ArgumentList(),
       QDict<int> *templateNames=0
     )
 {
   //if (masterCd->visited) return;
   masterCd->setVisited(TRUE);
   // The base class could ofcouse also be a non-nested class
-  ArgumentList *formalArgs = masterCd->templateArguments();
-  QListIterator<BaseInfo> bii(*root->extends);
-  BaseInfo *bi=0;
-  for (bii.toFirst();(bi=bii.current());++bii)
+  const ArgumentList &formalArgs = masterCd->templateArguments();
+  for (const BaseInfo &bi : root->extends)
   {
     //printf("masterCd=%s bi->name='%s' #actualArgs=%d\n",
     //    masterCd->localName().data(),bi->name.data(),actualArgs?(int)actualArgs->count():-1);
     bool delTempNames=FALSE;
     if (templateNames==0)
     {
-      templateNames = getTemplateArgumentsInName(formalArgs,bi->name);
+      templateNames = getTemplateArgumentsInName(formalArgs,bi.name);
       delTempNames=TRUE;
     }
-    BaseInfo tbi(bi->name,bi->prot,bi->virt);
-    if (actualArgs) // substitute the formal template arguments of the base class
-    {
-      tbi.name = substituteTemplateArgumentsInString(bi->name,formalArgs,actualArgs);
-    }
+    BaseInfo tbi = bi;
+    tbi.name = substituteTemplateArgumentsInString(bi.name,formalArgs,actualArgs);
     //printf("bi->name=%s tbi.name=%s\n",bi->name.data(),tbi.name.data());
 
     if (mode==DocumentedOnly)
@@ -4489,7 +4164,7 @@ static void findBaseClassesForClass(
 
 //----------------------------------------------------------------------
 
-static bool findTemplateInstanceRelation(Entry *root,
+static bool findTemplateInstanceRelation(const Entry *root,
             Definition *context,
             ClassDef *templateClass,const QCString &templSpec,
             QDict<int> *templateNames,
@@ -4529,19 +4204,19 @@ static bool findTemplateInstanceRelation(Entry *root,
 
     // search for new template instances caused by base classes of
     // instanceClass
-    Entry *templateRoot = g_classEntries.find(templateClass->name());
-    if (templateRoot)
+    auto it = g_classEntries.find(templateClass->name().data());
+    if (it!=g_classEntries.end())
     {
+      const Entry *templateRoot = it->second;
       Debug::print(Debug::Classes,0,"        template root found %s templSpec=%s!\n",
           qPrint(templateRoot->name),qPrint(templSpec));
-      ArgumentList *templArgs = new ArgumentList;
-      stringToArgumentList(templSpec,templArgs);
+      ArgumentList templArgs;
+      stringToArgumentList(root->lang,templSpec,templArgs);
       findBaseClassesForClass(templateRoot,context,templateClass,instanceClass,
           TemplateInstances,isArtificial,templArgs,templateNames);
 
       findUsedClassesForClass(templateRoot,context,templateClass,instanceClass,
           isArtificial,templArgs,templateNames);
-      delete templArgs;
     }
     else
     {
@@ -4651,10 +4326,10 @@ static int findEndOfTemplate(const QCString &s,int startPos)
 }
 
 static bool findClassRelation(
-                           Entry *root,
+                           const Entry *root,
                            Definition *context,
                            ClassDef *cd,
-                           BaseInfo *bi,
+                           const BaseInfo *bi,
                            QDict<int> *templateNames,
                            FindBaseClassRelation_Mode mode,
                            bool isArtificial
@@ -4757,7 +4432,7 @@ static bool findClassRelation(
           // base class has template specifiers
         {
           // TODO: here we should try to find the correct template specialization
-          // but for now, we only look for the unspecializated base class.
+          // but for now, we only look for the unspecialized base class.
           int e=findEndOfTemplate(baseClassName,i+1);
           //printf("baseClass==0 i=%d e=%d\n",i,e);
           if (e!=-1) // end of template was found at e
@@ -4882,13 +4557,13 @@ static bool findClassRelation(
               usedName=biName;
               //printf("***** usedName=%s templSpec=%s\n",usedName.data(),templSpec.data());
             }
-            static bool sipSupport = Config_getBool(SIP_SUPPORT);
-            if (sipSupport) bi->prot=Public;
+            Protection prot = bi->prot;
+            if (Config_getBool(SIP_SUPPORT)) prot=Public;
             if (!cd->isSubClass(baseClass)) // check for recursion, see bug690787
             {
-              cd->insertBaseClass(baseClass,usedName,bi->prot,bi->virt,templSpec);
+              cd->insertBaseClass(baseClass,usedName,prot,bi->virt,templSpec);
               // add this class as super class to the base class
-              baseClass->insertSubClass(cd,bi->prot,bi->virt,templSpec);
+              baseClass->insertSubClass(cd,prot,bi->virt,templSpec);
             }
             else
             {
@@ -4937,7 +4612,7 @@ static bool findClassRelation(
               int si = baseClassName.findRev("::");
               if (si!=-1) // class is nested
               {
-                Definition *sd = findScopeFromQualifiedName(Doxygen::globalScope,baseClassName.left(si),0,root->tagInfo);
+                Definition *sd = findScopeFromQualifiedName(Doxygen::globalScope,baseClassName.left(si),0,root->tagInfo());
                 if (sd==0 || sd==Doxygen::globalScope) // outer scope not found
                 {
                   baseClass->setArtificial(TRUE); // see bug678139
@@ -5008,7 +4683,7 @@ static bool findClassRelation(
 //----------------------------------------------------------------------
 // Computes the base and super classes for each class in the tree
 
-static bool isClassSection(Entry *root)
+static bool isClassSection(const Entry *root)
 {
   if ( !root->name.isEmpty() )
   {
@@ -5020,8 +4695,8 @@ static bool isClassSection(Entry *root)
     else if (root->section & Entry::COMPOUNDDOC_MASK)
          // is it a documentation block with inheritance info.
     {
-      bool extends = root->extends->count()>0;
-      if (extends) return TRUE;
+      bool hasExtends = !root->extends.empty();
+      if (hasExtends) return TRUE;
     }
   }
   return FALSE;
@@ -5030,16 +4705,16 @@ static bool isClassSection(Entry *root)
 
 /*! Builds a dictionary of all entry nodes in the tree starting with \a root
  */
-static void findClassEntries(Entry *root)
+static void findClassEntries(const Entry *root)
 {
   if (isClassSection(root))
   {
-    g_classEntries.insert(root->name,root);
+    g_classEntries.insert({root->name.data(),root});
   }
-  RECURSE_ENTRYTREE(findClassEntries,root);
+  for (const auto &e : root->children()) findClassEntries(e.get());
 }
 
-static QCString extractClassName(Entry *root)
+static QCString extractClassName(const Entry *root)
 {
   // strip any anonymous scopes first
   QCString bName=stripAnonymousNamespaceScope(root->name);
@@ -5064,10 +4739,9 @@ static void findInheritedTemplateInstances()
 {
   ClassSDict::Iterator cli(*Doxygen::classSDict);
   for (cli.toFirst();cli.current();++cli) cli.current()->setVisited(FALSE);
-  QDictIterator<Entry> edi(g_classEntries);
-  Entry *root;
-  for (;(root=edi.current());++edi)
+  for (const auto &kv : g_classEntries)
   {
+    const Entry *root = kv.second;
     ClassDef *cd;
     QCString bName = extractClassName(root);
     Debug::print(Debug::Classes,0,"  Inheritance: Class %s : \n",qPrint(bName));
@@ -5083,10 +4757,9 @@ static void findUsedTemplateInstances()
 {
   ClassSDict::Iterator cli(*Doxygen::classSDict);
   for (cli.toFirst();cli.current();++cli) cli.current()->setVisited(FALSE);
-  QDictIterator<Entry> edi(g_classEntries);
-  Entry *root;
-  for (;(root=edi.current());++edi)
+  for (const auto &kv : g_classEntries)
   {
+    const Entry *root = kv.second;
     ClassDef *cd;
     QCString bName = extractClassName(root);
     Debug::print(Debug::Classes,0,"  Usage: Class %s : \n",qPrint(bName));
@@ -5102,10 +4775,9 @@ static void computeClassRelations()
 {
   ClassSDict::Iterator cli(*Doxygen::classSDict);
   for (cli.toFirst();cli.current();++cli) cli.current()->setVisited(FALSE);
-  QDictIterator<Entry> edi(g_classEntries);
-  Entry *root;
-  for (;(root=edi.current());++edi)
+  for (const auto &kv : g_classEntries)
   {
+    const Entry *root = kv.second;
     ClassDef *cd;
 
     QCString bName = extractClassName(root);
@@ -5135,10 +4807,9 @@ static void computeClassRelations()
 
 static void computeTemplateClassRelations()
 {
-  QDictIterator<Entry> edi(g_classEntries);
-  Entry *root;
-  for (;(root=edi.current());++edi)
+  for (const auto &kv : g_classEntries)
   {
+    const Entry *root = kv.second;
     QCString bName=stripAnonymousNamespaceScope(root->name);
     bName=stripTemplateSpecifiersFromScope(bName);
     ClassDef *cd=getClass(bName);
@@ -5153,20 +4824,17 @@ static void computeTemplateClassRelations()
       {
         Debug::print(Debug::Classes,0,"    Template instance %s : \n",qPrint(tcd->name()));
         QCString templSpec = tdi.currentKey();
-        ArgumentList *templArgs = new ArgumentList;
-        stringToArgumentList(templSpec,templArgs);
-        QList<BaseInfo> *baseList=root->extends;
-        QListIterator<BaseInfo> it(*baseList);
-        BaseInfo *bi;
-        for (;(bi=it.current());++it) // for each base class of the template
+        ArgumentList templArgs;
+        stringToArgumentList(tcd->getLanguage(),templSpec,templArgs);
+        for (const BaseInfo &bi : root->extends)
         {
           // check if the base class is a template argument
-          BaseInfo tbi(bi->name,bi->prot,bi->virt);
-          ArgumentList *tl = cd->templateArguments();
-          if (tl)
+          BaseInfo tbi = bi;
+          const ArgumentList &tl = cd->templateArguments();
+          if (!tl.empty())
           {
             QDict<int> *baseClassNames = tcd->getTemplateBaseClassNames();
-            QDict<int> *templateNames = getTemplateArgumentsInName(tl,bi->name);
+            QDict<int> *templateNames = getTemplateArgumentsInName(tl,bi.name);
             // for each template name that we inherit from we need to
             // substitute the formal with the actual arguments
             QDict<int> *actualTemplateNames = new QDict<int>(17);
@@ -5175,23 +4843,25 @@ static void computeTemplateClassRelations()
             for (qdi.toFirst();qdi.current();++qdi)
             {
               int templIndex = *qdi.current();
-              Argument *actArg = 0;
-              if (templIndex<(int)templArgs->count())
+              Argument actArg;
+              bool hasActArg=FALSE;
+              if (templIndex<(int)templArgs.size())
               {
-                actArg=templArgs->at(templIndex);
+                actArg=templArgs.at(templIndex);
+                hasActArg=TRUE;
               }
-              if (actArg!=0 &&
+              if (hasActArg &&
                   baseClassNames!=0 &&
-                  baseClassNames->find(actArg->type)!=0 &&
-                  actualTemplateNames->find(actArg->type)==0
+                  baseClassNames->find(actArg.type)!=0 &&
+                  actualTemplateNames->find(actArg.type)==0
                  )
               {
-                actualTemplateNames->insert(actArg->type,new int(templIndex));
+                actualTemplateNames->insert(actArg.type,new int(templIndex));
               }
             }
             delete templateNames;
 
-            tbi.name = substituteTemplateArgumentsInString(bi->name,tl,templArgs);
+            tbi.name = substituteTemplateArgumentsInString(bi.name,tl,templArgs);
             // find a documented base class in the correct scope
             if (!findClassRelation(root,cd,tcd,&tbi,actualTemplateNames,DocumentedOnly,FALSE))
             {
@@ -5201,7 +4871,6 @@ static void computeTemplateClassRelations()
             delete actualTemplateNames;
           }
         }
-        delete templArgs;
       } // class has no base classes
     }
   }
@@ -5296,7 +4965,7 @@ static void addListReferences()
       name = pd->getGroupDef()->getOutputFileBase();
     }
     {
-      QList<ListItemInfo> *xrefItems = pd->xrefListItems();
+      const std::vector<ListItemInfo> &xrefItems = pd->xrefListItems();
       addRefItem(xrefItems,
           name,
           theTranslator->trPage(TRUE,TRUE),
@@ -5313,7 +4982,7 @@ static void addListReferences()
     //{
     //  name = dd->getGroupDef()->getOutputFileBase();
     //}
-    QList<ListItemInfo> *xrefItems = dd->xrefListItems();
+    const std::vector<ListItemInfo> &xrefItems = dd->xrefListItems();
     addRefItem(xrefItems,
         name,
         theTranslator->trDir(TRUE,TRUE),
@@ -5338,15 +5007,15 @@ static void generateXRefPages()
 // set the function declaration of the member to 'funcDecl'. If the boolean
 // over_load is set the standard overload text is added.
 
-static void addMemberDocs(Entry *root,
+static void addMemberDocs(const Entry *root,
                    MemberDef *md, const char *funcDecl,
-                   ArgumentList *al,
+                   const ArgumentList *al,
                    bool over_load,
-                   NamespaceSDict *
+                   uint64 spec
                   )
 {
-  //printf("addMemberDocs: '%s'::'%s' '%s' funcDecl='%s' mSpec=%d\n",
-  //     root->parent->name.data(),md->name().data(),md->argsString(),funcDecl,root->spec);
+  //printf("addMemberDocs: '%s'::'%s' '%s' funcDecl='%s' mSpec=%lld\n",
+  //     root->parent()->name.data(),md->name().data(),md->argsString(),funcDecl,spec);
   QCString fDecl=funcDecl;
   // strip extern specifier
   fDecl.stripPrefix("extern ");
@@ -5370,11 +5039,12 @@ static void addMemberDocs(Entry *root,
   // TODO determine scope based on root not md
   Definition *rscope = md->getOuterScope();
 
-  ArgumentList *mdAl = md->argumentList();
+  ArgumentList &mdAl = md->argumentList();
   if (al)
   {
+    ArgumentList mergedAl = *al;
     //printf("merging arguments (1) docs=%d\n",root->doc.isEmpty());
-    mergeArguments(mdAl,al,!root->doc.isEmpty());
+    mergeArguments(mdAl,mergedAl,!root->doc.isEmpty());
   }
   else
   {
@@ -5386,7 +5056,8 @@ static void addMemberDocs(Entry *root,
        )
     {
       //printf("merging arguments (2)\n");
-      mergeArguments(mdAl,root->argList,!root->doc.isEmpty());
+      ArgumentList mergedArgList = root->argList;
+      mergeArguments(mdAl,mergedArgList,!root->doc.isEmpty());
     }
   }
   if (over_load)  // the \overload keyword was used
@@ -5450,7 +5121,7 @@ static void addMemberDocs(Entry *root,
   md->enableReferencedByRelation(md->hasReferencedByRelation() || root->referencedByRelation);
   md->enableReferencesRelation(md->hasReferencesRelation() || root->referencesRelation);
 
-  md->mergeMemberSpecifiers(root->spec);
+  md->mergeMemberSpecifiers(spec);
   md->addSectionsToDefinition(root->anchors);
   addMemberToGroups(root,md);
   if (cd) cd->insertUsedFile(rfd);
@@ -5494,13 +5165,14 @@ static const ClassDef *findClassDefinition(FileDef *fd,NamespaceDef *nd,
 // with name 'name' and argument list 'args' (for overloading) and
 // function declaration 'decl' to the corresponding member definition.
 
-static bool findGlobalMember(Entry *root,
+static bool findGlobalMember(const Entry *root,
                            const QCString &namespaceName,
                            const char *type,
                            const char *name,
                            const char *tempArg,
                            const char *,
-                           const char *decl)
+                           const char *decl,
+                           uint64 spec)
 {
   Debug::print(Debug::FindMembers,0,
        "2. findGlobalMember(namespace=%s,type=%s,name=%s,tempArg=%s,decl=%s)\n",
@@ -5556,9 +5228,9 @@ static bool findGlobalMember(Entry *root,
         NamespaceDef *rnd = 0;
         if (!namespaceName.isEmpty()) rnd = Doxygen::namespaceSDict->find(namespaceName);
 
-        const ArgumentList *mdAl = const_cast<const MemberDef *>(md)->argumentList();
+        const ArgumentList &mdAl = const_cast<const MemberDef *>(md)->argumentList();
         bool matching=
-          (mdAl==0 && root->argList->count()==0) ||
+          (mdAl.empty() && root->argList.empty()) ||
           md->isVariable() || md->isTypedef() || /* in case of function pointers */
           matchArguments2(md->getOuterScope(),const_cast<const MemberDef *>(md)->getFileDef(),mdAl,
                           rnd ? rnd : Doxygen::globalScope,fd,root->argList,
@@ -5567,15 +5239,12 @@ static bool findGlobalMember(Entry *root,
         // for template members we need to check if the number of
         // template arguments is the same, otherwise we are dealing with
         // different functions.
-        if (matching && root->tArgLists)
+        if (matching && !root->tArgLists.empty())
         {
-          const ArgumentList *mdTempl = md->templateArguments();
-          if (mdTempl)
+          const ArgumentList &mdTempl = md->templateArguments();
+          if (root->tArgLists.back().size()!=mdTempl.size())
           {
-            if (root->tArgLists->getLast()->count()!=mdTempl->count())
-            {
-              matching=FALSE;
-            }
+            matching=FALSE;
           }
         }
 
@@ -5595,11 +5264,11 @@ static bool findGlobalMember(Entry *root,
         }
 
         // for template member we also need to check the return type
-        if (md->templateArguments()!=0 && root->tArgLists!=0)
+        if (!md->templateArguments().empty() && !root->tArgLists.empty())
         {
           //printf("Comparing return types '%s'<->'%s'\n",
           //    md->typeString(),type);
-          if (md->templateArguments()->count()!=root->tArgLists->getLast()->count() ||
+          if (md->templateArguments().size()!=root->tArgLists.back().size() ||
               qstrcmp(md->typeString(),type)!=0)
           {
             //printf(" ---> no matching\n");
@@ -5610,7 +5279,7 @@ static bool findGlobalMember(Entry *root,
         if (matching) // add docs to the member
         {
           Debug::print(Debug::FindMembers,0,"5. Match found\n");
-          addMemberDocs(root,md->resolveAlias(),decl,root->argList,FALSE);
+          addMemberDocs(root,md->resolveAlias(),decl,&root->argList,FALSE,root->spec);
           found=TRUE;
         }
       }
@@ -5618,7 +5287,7 @@ static bool findGlobalMember(Entry *root,
     if (!found && root->relatesType != Duplicate && root->section==Entry::FUNCTION_SEC) // no match
     {
       QCString fullFuncDecl=decl;
-      if (root->argList) fullFuncDecl+=argListToString(root->argList,TRUE);
+      if (!root->argList.empty()) fullFuncDecl+=argListToString(root->argList,TRUE);
       QCString warnMsg =
          QCString("no matching file member found for \n")+substitute(fullFuncDecl,"%","%%");
       if (mn->count()>0)
@@ -5654,17 +5323,17 @@ static bool findGlobalMember(Entry *root,
 }
 
 static bool isSpecialization(
-                  const QList<ArgumentList> &srcTempArgLists,
-                  const QList<ArgumentList> &dstTempArgLists
+                  const std::vector<ArgumentList> &srcTempArgLists,
+                  const std::vector<ArgumentList> &dstTempArgLists
     )
 {
-    QListIterator<ArgumentList> srclali(srcTempArgLists);
-    QListIterator<ArgumentList> dstlali(dstTempArgLists);
-    for (;srclali.current();++srclali,++dstlali)
+    auto srcIt = srcTempArgLists.begin();
+    auto dstIt = dstTempArgLists.begin();
+    while (srcIt!=srcTempArgLists.end() && dstIt!=dstTempArgLists.end())
     {
-      ArgumentList *sal = srclali.current();
-      ArgumentList *dal = dstlali.current();
-      if (!(sal && dal && sal->count()==dal->count())) return TRUE;
+      if ((*srcIt).size()!=(*dstIt).size()) return TRUE;
+      ++srcIt;
+      ++dstIt;
     }
     return FALSE;
 }
@@ -5674,15 +5343,15 @@ static bool scopeIsTemplate(const Definition *d)
   bool result=FALSE;
   if (d && d->definitionType()==Definition::TypeClass)
   {
-    result = (dynamic_cast<const ClassDef*>(d))->templateArguments() || scopeIsTemplate(d->getOuterScope());
+    result = !(dynamic_cast<const ClassDef*>(d))->templateArguments().empty() ||
+             scopeIsTemplate(d->getOuterScope());
   }
   return result;
 }
 
 static QCString substituteTemplatesInString(
-    const QList<ArgumentList> &srcTempArgLists,
-    const QList<ArgumentList> &dstTempArgLists,
-    ArgumentList *funcTempArgList, // can be used to match template specializations
+    const std::vector<ArgumentList> &srcTempArgLists,
+    const std::vector<ArgumentList> &dstTempArgLists,
     const QCString &src
     )
 {
@@ -5696,61 +5365,59 @@ static QCString substituteTemplatesInString(
     dst+=src.mid(p,i-p);
     QCString name=src.mid(i,l);
 
-    QListIterator<ArgumentList> srclali(srcTempArgLists);
-    QListIterator<ArgumentList> dstlali(dstTempArgLists);
-    for (;srclali.current() && !found;++srclali,++dstlali)
+    auto srcIt = srcTempArgLists.begin();
+    auto dstIt = dstTempArgLists.begin();
+    while (srcIt!=srcTempArgLists.end() && !found)
     {
-      ArgumentListIterator tsali(*srclali.current());
-      ArgumentListIterator tdali(*dstlali.current());
-      ArgumentListIterator *fali=0;
-      Argument *tsa =0,*tda=0, *fa=0;
-      if (funcTempArgList)
+      const ArgumentList *tdAli = 0;
+      std::vector<Argument>::const_iterator tdaIt;
+      if (dstIt!=dstTempArgLists.end())
       {
-        fali = new ArgumentListIterator(*funcTempArgList);
-        fa = fali->current();
+        tdAli = &(*dstIt);
+        tdaIt = tdAli->begin();
+        ++dstIt;
       }
 
-      for (tsali.toFirst();(tsa=tsali.current()) && !found;++tsali)
+      const ArgumentList &tsaLi = *srcIt;
+      for (auto tsaIt = tsaLi.begin(); tsaIt!=tsaLi.end() && !found; ++tsaIt)
       {
-        tda = tdali.current();
+        Argument tsa = *tsaIt;
+        const Argument *tda = 0;
+        if (tdAli && tdaIt!=tdAli->end())
+        {
+          tda = &(*tdaIt);
+          ++tdaIt;
+        }
         //if (tda) printf("tsa=%s|%s tda=%s|%s\n",
-        //    tsa->type.data(),tsa->name.data(),
+        //    tsa.type.data(),tsa.name.data(),
         //    tda->type.data(),tda->name.data());
-        if (name==tsa->name)
+        if (name==tsa.name)
         {
           if (tda && tda->name.isEmpty())
           {
+            QCString tdaName = tda->name;
+            QCString tdaType = tda->type;
             int vc=0;
-            if (tda->type.left(6)=="class ") vc=6;
-            else if (tda->type.left(9)=="typename ") vc=9;
+            if (tdaType.left(6)=="class ") vc=6;
+            else if (tdaType.left(9)=="typename ") vc=9;
             if (vc>0) // convert type=="class T" to type=="class" name=="T"
             {
-              tda->name = tda->type.mid(vc);
-              tda->type = tda->type.left(vc-1);
+              tdaName = tdaType.mid(vc);
+            }
+            if (!tdaName.isEmpty())
+            {
+              name=tdaName; // substitute
+              found=TRUE;
             }
-          }
-          if (tda && !tda->name.isEmpty())
-          {
-            name=tda->name; // substitute
-            found=TRUE;
-          }
-          else if (fa)
-          {
-            name=fa->type;
-            found=TRUE;
           }
         }
-        if (tda)
-          ++tdali;
-        else if (fali)
-        { ++(*fali); fa=fali->current(); }
       }
 
-      delete fali;
       //printf("   srcList='%s' dstList='%s faList='%s'\n",
       //  argListToString(srclali.current()).data(),
       //  argListToString(dstlali.current()).data(),
       //  funcTempArgList ? argListToString(funcTempArgList).data() : "<none>");
+      ++srcIt;
     }
     dst+=name;
     p=i+l;
@@ -5762,48 +5429,39 @@ static QCString substituteTemplatesInString(
 }
 
 static void substituteTemplatesInArgList(
-                  const QList<ArgumentList> &srcTempArgLists,
-                  const QList<ArgumentList> &dstTempArgLists,
-                  ArgumentList *src,
-                  ArgumentList *dst,
-                  ArgumentList *funcTempArgs = 0
+                  const std::vector<ArgumentList> &srcTempArgLists,
+                  const std::vector<ArgumentList> &dstTempArgLists,
+                  const ArgumentList &src,
+                  ArgumentList &dst
                  )
 {
-  ArgumentListIterator sali(*src);
-  ArgumentListIterator dali(*dst);
-  Argument *sa=0;
-  Argument *da=dali.current();
-
-  for (sali.toFirst();(sa=sali.current());++sali) // for each member argument
+  auto dstIt = dst.begin();
+  for (const Argument &sa : src)
   {
-    QCString dstType = substituteTemplatesInString(
-                                  srcTempArgLists,dstTempArgLists,funcTempArgs,
-                                  sa->type);
-    QCString dstArray = substituteTemplatesInString(
-                                  srcTempArgLists,dstTempArgLists,funcTempArgs,
-                                  sa->array);
-    if (da==0)
+    QCString dstType =  substituteTemplatesInString(srcTempArgLists,dstTempArgLists,sa.type);
+    QCString dstArray = substituteTemplatesInString(srcTempArgLists,dstTempArgLists,sa.array);
+    if (dstIt == dst.end())
     {
-      da=new Argument(*sa);
-      dst->append(da);
-      da->type=dstType;
-      da->array=dstArray;
-      da=0;
+      Argument da = sa;
+      da.type  = dstType;
+      da.array = dstArray;
+      dst.push_back(da);
+      dstIt = dst.end();
     }
     else
     {
-      da->type=dstType;
-      da->type=dstArray;
-      ++dali;
-      da=dali.current();
+      Argument da = *dstIt;
+      da.type  = dstType;
+      da.array = dstArray;
+      ++dstIt;
     }
   }
-  dst->constSpecifier     = src->constSpecifier;
-  dst->volatileSpecifier  = src->volatileSpecifier;
-  dst->pureSpecifier      = src->pureSpecifier;
-  dst->trailingReturnType = substituteTemplatesInString(
+  dst.constSpecifier     = src.constSpecifier;
+  dst.volatileSpecifier  = src.volatileSpecifier;
+  dst.pureSpecifier      = src.pureSpecifier;
+  dst.trailingReturnType = substituteTemplatesInString(
                              srcTempArgLists,dstTempArgLists,
-                             funcTempArgs,src->trailingReturnType);
+                             src.trailingReturnType);
   //printf("substituteTemplatesInArgList: replacing %s with %s\n",
   //    argListToString(src).data(),argListToString(dst).data()
   //    );
@@ -5820,7 +5478,10 @@ static void substituteTemplatesInArgList(
  * The boolean \a isFunc is a hint that indicates that this is a function
  * instead of a variable or typedef.
  */
-static void findMember(Entry *root,
+static void findMember(const Entry *root,
+                       const QCString &relates,
+                       const QCString &type,
+                       const QCString &args,
                        QCString funcDecl,
                        bool overloaded,
                        bool isFunc
@@ -5828,10 +5489,10 @@ static void findMember(Entry *root,
 {
   Debug::print(Debug::FindMembers,0,
                "findMember(root=%p,funcDecl='%s',related='%s',overload=%d,"
-               "isFunc=%d mGrpId=%d tArgList=%p (#=%d) "
+               "isFunc=%d mGrpId=%d #tArgList=%d "
                "spec=%lld lang=%x\n",
-               root,qPrint(funcDecl),qPrint(root->relates),overloaded,isFunc,root->mGrpId,
-               root->tArgLists,root->tArgLists ? root->tArgLists->count() : 0,
+               root,qPrint(funcDecl),qPrint(relates),overloaded,isFunc,root->mGrpId,
+               root->tArgLists.size(),
                root->spec,root->lang
               );
 
@@ -5848,6 +5509,7 @@ static void findMember(Entry *root,
   bool isMemberOf=FALSE;
   bool isFriend=FALSE;
   bool done;
+  uint64 spec = root->spec;
   do
   {
     done=TRUE;
@@ -5858,17 +5520,17 @@ static void findMember(Entry *root,
     }
     if (funcDecl.stripPrefix("inline "))
     {
-      root->spec|=Entry::Inline;
+      spec|=Entry::Inline;
       done=FALSE;
     }
     if (funcDecl.stripPrefix("explicit "))
     {
-      root->spec|=Entry::Explicit;
+      spec|=Entry::Explicit;
       done=FALSE;
     }
     if (funcDecl.stripPrefix("mutable "))
     {
-      root->spec|=Entry::Mutable;
+      spec|=Entry::Mutable;
       done=FALSE;
     }
     if (funcDecl.stripPrefix("virtual "))
@@ -5924,21 +5586,21 @@ static void findMember(Entry *root,
   // related field.
   //printf("scopeName='%s' className='%s' namespaceName='%s'\n",
   //    scopeName.data(),className.data(),namespaceName.data());
-  if (!root->relates.isEmpty())
+  if (!relates.isEmpty())
   {                             // related member, prefix user specified scope
     isRelated=TRUE;
     isMemberOf=(root->relatesType == MemberOf);
-    if (getClass(root->relates)==0 && !scopeName.isEmpty())
+    if (getClass(relates)==0 && !scopeName.isEmpty())
     {
-      scopeName= mergeScopes(scopeName,root->relates);
+      scopeName= mergeScopes(scopeName,relates);
     }
     else
     {
-      scopeName = root->relates;
+      scopeName = relates;
     }
   }
 
-  if (root->relates.isEmpty() && root->parent() &&
+  if (relates.isEmpty() && root->parent() &&
       ((root->parent()->section&Entry::SCOPE_MASK) ||
        (root->parent()->section==Entry::OBJCIMPL_SEC)
       ) &&
@@ -5987,9 +5649,8 @@ static void findMember(Entry *root,
   // empty while funcSpec is not empty we assume this is a
   // specialization of a method. If not, we clear the funcSpec and treat
   // this as a normal method of a template class.
-  if (!(root->tArgLists &&
-        root->tArgLists->count()>0 &&
-        root->tArgLists->getFirst()->count()==0
+  if (!(root->tArgLists.size()>0 &&
+        root->tArgLists.front().size()==0
        )
      )
   {
@@ -6013,7 +5674,7 @@ static void findMember(Entry *root,
     {
       scopeName=namespaceName;
     }
-    else if (!root->relates.isEmpty() || // relates command with explicit scope
+    else if (!relates.isEmpty() || // relates command with explicit scope
              !getClass(className)) // class name only exists in a namespace
     {
       scopeName=namespaceName+"::"+className;
@@ -6036,7 +5697,7 @@ static void findMember(Entry *root,
     if (funcSpec.isEmpty())
     {
       int argListIndex=0;
-      tempScopeName=cd->qualifiedNameWithTemplateParameters(root->tArgLists,&argListIndex);
+      tempScopeName=cd->qualifiedNameWithTemplateParameters(&root->tArgLists,&argListIndex);
     }
     else
     {
@@ -6120,7 +5781,7 @@ static void findMember(Entry *root,
            "  isFunc=%d\n\n",
            qPrint(namespaceName),qPrint(className),
            qPrint(funcType),qPrint(funcSpec),qPrint(funcName),qPrint(funcArgs),qPrint(funcTempList),
-           qPrint(funcDecl),qPrint(root->relates),qPrint(exceptions),isRelated,isMemberOf,isFriend,
+           qPrint(funcDecl),qPrint(relates),qPrint(exceptions),isRelated,isMemberOf,isFriend,
            isFunc
           );
 
@@ -6186,39 +5847,33 @@ static void findMember(Entry *root,
                   "4. class definition %s found\n",cd->name().data());
 
               // get the template parameter lists found at the member declaration
-              QList<ArgumentList> declTemplArgs;
-              cd->getTemplateParameterLists(declTemplArgs);
-              const ArgumentList *templAl = md->templateArguments();
-              if (templAl)
+              std::vector<ArgumentList> declTemplArgs = cd->getTemplateParameterLists();
+              const ArgumentList &templAl = md->templateArguments();
+              if (!templAl.empty())
               {
-                declTemplArgs.append(templAl);
+                declTemplArgs.push_back(templAl);
               }
 
               // get the template parameter lists found at the member definition
-              QList<ArgumentList> *defTemplArgs = root->tArgLists;
+              const std::vector<ArgumentList> &defTemplArgs = root->tArgLists;
               //printf("defTemplArgs=%p\n",defTemplArgs);
 
               // do we replace the decl argument lists with the def argument lists?
               bool substDone=FALSE;
-              ArgumentList *argList=0;
+              ArgumentList argList;
 
               /* substitute the occurrences of class template names in the
                * argument list before matching
                */
-              ArgumentList *mdAl = md->argumentList();
-              if (declTemplArgs.count()>0 && defTemplArgs &&
-                  declTemplArgs.count()==defTemplArgs->count() &&
-                  mdAl
-                 )
+              const ArgumentList &mdAl = md->argumentList();
+              if (declTemplArgs.size()>0 && declTemplArgs.size()==defTemplArgs.size())
               {
                 /* the function definition has template arguments
                  * and the class definition also has template arguments, so
                  * we must substitute the template names of the class by that
                  * of the function definition before matching.
                  */
-                argList = new ArgumentList;
-                substituteTemplatesInArgList(declTemplArgs,*defTemplArgs,
-                    mdAl,argList);
+                substituteTemplatesInArgList(declTemplArgs,defTemplArgs,mdAl,argList);
 
                 substDone=TRUE;
               }
@@ -6235,7 +5890,7 @@ static void findMember(Entry *root,
 
               bool matching=
                 md->isVariable() || md->isTypedef() || // needed for function pointers
-                (mdAl==0 && root->argList->count()==0) ||
+                (mdAl.empty() && root->argList.empty()) ||
                 matchArguments2(
                     md->getClassDef(),md->getFileDef(),argList,
                     cd,fd,root->argList,
@@ -6247,7 +5902,7 @@ static void findMember(Entry *root,
               }
 
               // for template member we also need to check the return type
-              if (md->templateArguments()!=0 && root->tArgLists!=0)
+              if (!md->templateArguments().empty() && !root->tArgLists.empty())
               {
                 QCString memType = md->typeString();
                 memType.stripPrefix("static "); // see bug700696
@@ -6258,8 +5913,8 @@ static void findMember(Entry *root,
                 Debug::print(Debug::FindMembers,0,
                    "5b. Comparing return types '%s'<->'%s' #args %d<->%d\n",
                     qPrint(md->typeString()),qPrint(funcType),
-                    md->templateArguments()->count(),root->tArgLists->getLast()->count());
-                if (md->templateArguments()->count()!=root->tArgLists->getLast()->count() ||
+                    md->templateArguments().size(),root->tArgLists.back().size());
+                if (md->templateArguments().size()!=root->tArgLists.back().size() ||
                     qstrcmp(memType,funcType))
                 {
                   //printf(" ---> no matching\n");
@@ -6268,9 +5923,9 @@ static void findMember(Entry *root,
               }
               bool rootIsUserDoc = (root->section&Entry::MEMBERDOC_SEC)!=0;
               bool classIsTemplate = scopeIsTemplate(md->getClassDef());
-              bool mdIsTemplate    = md->templateArguments()!=0;
+              bool mdIsTemplate    = md->templateArguments().hasParameters();
               bool classOrMdIsTemplate = mdIsTemplate || classIsTemplate;
-              bool rootIsTemplate  = root->tArgLists!=0;
+              bool rootIsTemplate  = !root->tArgLists.empty();
               //printf("classIsTemplate=%d mdIsTemplate=%d rootIsTemplate=%d\n",classIsTemplate,mdIsTemplate,rootIsTemplate);
               if (!rootIsUserDoc && // don't check out-of-line @fn references, see bug722457
                   (mdIsTemplate || rootIsTemplate) && // either md or root is a template
@@ -6286,37 +5941,33 @@ static void findMember(Entry *root,
 
 
               Debug::print(Debug::FindMembers,0,
-                  "6. match results of matchArguments2 = %d\n",matching);
+                  "6. match results of matchArguments2 = %d substDone=%d\n",matching,substDone);
 
               if (substDone) // found a new argument list
               {
                 if (matching) // replace member's argument list
                 {
                   md->setDefinitionTemplateParameterLists(root->tArgLists);
-                  md->setArgumentList(argList); // new owner of the list => no delete
+                  md->setArgumentList(argList);
                 }
                 else // no match
                 {
                   if (!funcTempList.isEmpty() &&
-                      isSpecialization(declTemplArgs,*defTemplArgs))
+                      isSpecialization(declTemplArgs,defTemplArgs))
                   {
                     // check if we are dealing with a partial template
                     // specialization. In this case we add it to the class
                     // even though the member arguments do not match.
 
-                    // TODO: copy other aspects?
-                    root->protection=md->protection(); // copy protection level
-                    root->stat=md->isStatic();
-                    root->virt=md->virtualness();
-                    addMethodToClass(root,cd,md->name(),isFriend);
+                    addMethodToClass(root,cd,type,md->name(),args,isFriend,
+                        md->protection(),md->isStatic(),md->virtualness(),spec,relates);
                     return;
                   }
-                  delete argList;
                 }
               }
               if (matching)
               {
-                addMemberDocs(root,md,funcDecl,0,overloaded,0/* TODO */);
+                addMemberDocs(root,md,funcDecl,0,overloaded,spec);
                 count++;
                 memFound=TRUE;
               }
@@ -6347,15 +5998,13 @@ static void findMember(Entry *root,
                 //printf("ccd->name()==%s className=%s\n",ccd->name().data(),className.data());
                 if (ccd!=0 && rightScopeMatch(ccd->name(),className))
                 {
-                  const ArgumentList *templAl = md->templateArguments();
-                  if (root->tArgLists && templAl!=0 &&
-                      root->tArgLists->getLast()->count()<=templAl->count())
+                  const ArgumentList &templAl = md->templateArguments();
+                  if (!root->tArgLists.empty() && !templAl.empty() &&
+                      root->tArgLists.back().size()<=templAl.size())
                   {
                     Debug::print(Debug::FindMembers,0,"7. add template specialization\n");
-                    root->protection=md->protection();
-                    root->stat=md->isStatic();
-                    root->virt=md->virtualness();
-                    addMethodToClass(root,ccd,md->name(),isFriend);
+                    addMethodToClass(root,ccd,type,md->name(),args,isFriend,
+                        root->protection,root->stat,root->virt,spec,relates);
                     return;
                   }
                   if (md->argsString()==argListToString(root->argList,TRUE,FALSE))
@@ -6385,7 +6034,7 @@ static void findMember(Entry *root,
               {
                 // we didn't find an actual match on argument lists, but there is only 1 member with this
                 // name in the same scope, so that has to be the one.
-                addMemberDocs(root,umd,funcDecl,0,overloaded,0);
+                addMemberDocs(root,umd,funcDecl,0,overloaded,spec);
                 return;
               }
               else if (candidates>1 && ecd && emd)
@@ -6393,7 +6042,7 @@ static void findMember(Entry *root,
                 // we didn't find a unique match using type resolution,
                 // but one of the matches has the exact same signature so
                 // we take that one.
-                addMemberDocs(root,emd,funcDecl,0,overloaded,0);
+                addMemberDocs(root,emd,funcDecl,0,overloaded,spec);
                 return;
               }
             }
@@ -6402,17 +6051,13 @@ static void findMember(Entry *root,
             if (noMatchCount>1) warnMsg+="uniquely ";
             warnMsg+="matching class member found for \n";
 
-            if (root->tArgLists)
+            for (const ArgumentList &al : root->tArgLists)
             {
-              QListIterator<ArgumentList> alli(*root->tArgLists);
-              ArgumentList *al;
-              for (;(al=alli.current());++alli)
-              {
-                warnMsg+="  template ";
-                warnMsg+=tempArgListToString(al,root->lang);
-                warnMsg+='\n';
-              }
+              warnMsg+="  template ";
+              warnMsg+=tempArgListToString(al,root->lang);
+              warnMsg+='\n';
             }
+
             QCString fullFuncDecl=funcDecl.copy();
             if (isFunc) fullFuncDecl+=argListToString(root->argList,TRUE);
 
@@ -6428,14 +6073,15 @@ static void findMember(Entry *root,
                 const ClassDef *cd=md->getClassDef();
                 if (cd!=0 && rightScopeMatch(cd->name(),className))
                 {
-                  const ArgumentList *templAl = md->templateArguments();
-                  if (templAl!=0)
+                  const ArgumentList &templAl = md->templateArguments();
+                  warnMsg+="  '";
+                  if (templAl.hasParameters())
                   {
-                    warnMsg+="  'template ";
+                    warnMsg+="template ";
                     warnMsg+=tempArgListToString(templAl,root->lang);
                     warnMsg+='\n';
+                    warnMsg+="  ";
                   }
-                  warnMsg+="  ";
                   if (md->typeString())
                   {
                     warnMsg+=md->typeString();
@@ -6451,6 +6097,8 @@ static void findMember(Entry *root,
                     warnMsg+="' at line "+QCString().setNum(md->getDefLine()) +
                              " of file "+md->getDefFileName();
                   }
+                 else
+                    warnMsg += "'";
 
                   warnMsg+='\n';
                 }
@@ -6474,7 +6122,7 @@ static void findMember(Entry *root,
             }
           }
           MemberType mtype=MemberType_Function;
-          ArgumentList *tArgList = new ArgumentList;
+          ArgumentList tArgList;
           //  getTemplateArgumentsFromName(cd->name()+"::"+funcName,root->tArgLists);
           md=createMemberDef(
               root->fileName,root->startLine,root->startColumn,
@@ -6483,7 +6131,7 @@ static void findMember(Entry *root,
               root->virt,root->stat,Member,
               mtype,tArgList,root->argList,root->metaData);
           //printf("new specialized member %s args='%s'\n",md->name().data(),funcArgs.data());
-          md->setTagInfo(root->tagInfo);
+          md->setTagInfo(root->tagInfo());
           md->setLanguage(root->lang);
           md->setId(root->id);
           md->setMemberClass(cd);
@@ -6503,12 +6151,11 @@ static void findMember(Entry *root,
           md->setBodySegment(root->bodyLine,root->endBodyLine);
           FileDef *fd=root->fileDef();
           md->setBodyDef(fd);
-          md->setMemberSpecifiers(root->spec);
+          md->setMemberSpecifiers(spec);
           md->setMemberGroupId(root->mGrpId);
           mn->append(md);
           cd->insertMember(md);
           md->setRefItems(root->sli);
-          delete tArgList;
         }
         else
         {
@@ -6543,7 +6190,7 @@ static void findMember(Entry *root,
           else                           mtype=MemberType_Function;
 
           // new overloaded member function
-          ArgumentList *tArgList =
+          ArgumentList tArgList =
             getTemplateArgumentsFromName(cd->name()+"::"+funcName,root->tArgLists);
           //printf("new related member %s args='%s'\n",md->name().data(),funcArgs.data());
           MemberDef *md=createMemberDef(
@@ -6551,7 +6198,7 @@ static void findMember(Entry *root,
               funcType,funcName,funcArgs,exceptions,
               root->protection,root->virt,root->stat,Related,
               mtype,tArgList,root->argList,root->metaData);
-          md->setTagInfo(root->tagInfo);
+          md->setTagInfo(root->tagInfo());
           md->setLanguage(root->lang);
           md->setId(root->id);
           md->setTypeConstraints(root->typeConstr);
@@ -6573,7 +6220,7 @@ static void findMember(Entry *root,
           md->setBodySegment(root->bodyLine,root->endBodyLine);
           FileDef *fd=root->fileDef();
           md->setBodyDef(fd);
-          md->setMemberSpecifiers(root->spec);
+          md->setMemberSpecifiers(spec);
           md->setMemberGroupId(root->mGrpId);
           mn->append(md);
           cd->insertMember(md);
@@ -6583,7 +6230,7 @@ static void findMember(Entry *root,
       }
       else // unrelated function with the same name as a member
       {
-        if (!findGlobalMember(root,namespaceName,funcType,funcName,funcTempList,funcArgs,funcDecl))
+        if (!findGlobalMember(root,namespaceName,funcType,funcName,funcTempList,funcArgs,funcDecl,spec))
         {
           QCString fullFuncDecl=funcDecl.copy();
           if (isFunc) fullFuncDecl+=argListToString(root->argList,TRUE);
@@ -6594,11 +6241,11 @@ static void findMember(Entry *root,
         }
       }
     }
-    else if (isRelated && !root->relates.isEmpty())
+    else if (isRelated && !relates.isEmpty())
     {
       Debug::print(Debug::FindMembers,0,"2. related function\n"
               "  scopeName=%s className=%s\n",qPrint(scopeName),qPrint(className));
-      if (className.isEmpty()) className=root->relates;
+      if (className.isEmpty()) className=relates;
       ClassDef *cd;
       //printf("scopeName='%s' className='%s'\n",scopeName.data(),className.data());
       if ((cd=getClass(scopeName)))
@@ -6634,7 +6281,7 @@ static void findMember(Entry *root,
           MemberDef *rmd;
           while ((rmd=mni.current()) && newMember) // see if we got another member with matching arguments
           {
-            ArgumentList *rmdAl = rmd->argumentList();
+            const ArgumentList &rmdAl = rmd->argumentList();
 
             newMember=
               className!=rmd->getOuterScope()->name() ||
@@ -6647,7 +6294,7 @@ static void findMember(Entry *root,
           {
             //printf("addMemberDocs for related member %s\n",root->name.data());
             //rmd->setMemberDefTemplateArguments(root->mtArgList);
-            addMemberDocs(root,rmd,funcDecl,0,overloaded);
+            addMemberDocs(root,rmd,funcDecl,0,overloaded,spec);
           }
         }
 
@@ -6678,7 +6325,7 @@ static void findMember(Entry *root,
 
           // first note that we pass:
           //   (root->tArgLists ? root->tArgLists->last() : 0)
-          // for the template arguments fo the new "member."
+          // for the template arguments for the new "member."
           // this accurately reflects the template arguments of
           // the related function, which don't have to do with
           // those of the related class.
@@ -6689,8 +6336,9 @@ static void findMember(Entry *root,
               root->stat && !isMemberOf,
               isMemberOf ? Foreign : Related,
               mtype,
-              (root->tArgLists ? root->tArgLists->getLast() : 0),
-              funcArgs.isEmpty() ? 0 : root->argList,root->metaData);
+              (!root->tArgLists.empty() ? root->tArgLists.back() : ArgumentList()),
+              funcArgs.isEmpty() ? ArgumentList() : root->argList,
+              root->metaData);
 
           if (isDefine && mdDefine)
           {
@@ -6710,7 +6358,7 @@ static void findMember(Entry *root,
           //
           md->setDefinitionTemplateParameterLists(root->tArgLists);
 
-          md->setTagInfo(root->tagInfo);
+          md->setTagInfo(root->tagInfo());
 
 
 
@@ -6729,7 +6377,7 @@ static void findMember(Entry *root,
               const MemberDef *rmd;
               while ((rmd=rmni.current()) && !found) // see if we got another member with matching arguments
               {
-                const ArgumentList *rmdAl = rmd->argumentList();
+                const ArgumentList &rmdAl = rmd->argumentList();
                 // check for matching argument lists
                 if (
                     matchArguments2(rmd->getOuterScope(),rmd->getFileDef(),rmdAl,
@@ -6761,7 +6409,7 @@ static void findMember(Entry *root,
           //  md->setMemberGroup(memberGroupDict[root->mGrpId]);
           //}
           md->setMemberClass(cd);
-          md->setMemberSpecifiers(root->spec);
+          md->setMemberSpecifiers(spec);
           md->setDefinition(funcDecl);
           md->enableCallGraph(root->callGraph);
           md->enableCallerGraph(root->callerGraph);
@@ -6796,7 +6444,7 @@ static void findMember(Entry *root,
         }
         if (root->relatesType == Duplicate)
         {
-          if (!findGlobalMember(root,namespaceName,funcType,funcName,funcTempList,funcArgs,funcDecl))
+          if (!findGlobalMember(root,namespaceName,funcType,funcName,funcTempList,funcArgs,funcDecl,spec))
           {
             QCString fullFuncDecl=funcDecl.copy();
             if (isFunc) fullFuncDecl+=argListToString(root->argList,TRUE);
@@ -6830,8 +6478,8 @@ localObjCMethod:
             root->fileName,root->startLine,root->startColumn,
             funcType,funcName,funcArgs,exceptions,
             root->protection,root->virt,root->stat,Member,
-            MemberType_Function,0,root->argList,root->metaData);
-        md->setTagInfo(root->tagInfo);
+            MemberType_Function,ArgumentList(),root->argList,root->metaData);
+        md->setTagInfo(root->tagInfo());
         md->setLanguage(root->lang);
         md->setId(root->id);
         md->makeImplementationDetail();
@@ -6850,7 +6498,7 @@ localObjCMethod:
         md->setBodySegment(root->bodyLine,root->endBodyLine);
         FileDef *fd=root->fileDef();
         md->setBodyDef(fd);
-        md->setMemberSpecifiers(root->spec);
+        md->setMemberSpecifiers(spec);
         md->setMemberGroupId(root->mGrpId);
         cd->insertMember(md);
         cd->insertUsedFile(fd);
@@ -6873,7 +6521,7 @@ localObjCMethod:
     }
     else // unrelated not overloaded member found
     {
-      bool globMem = findGlobalMember(root,namespaceName,funcType,funcName,funcTempList,funcArgs,funcDecl);
+      bool globMem = findGlobalMember(root,namespaceName,funcType,funcName,funcTempList,funcArgs,funcDecl,spec);
       if (className.isEmpty() && !globMem)
       {
         warn(root->fileName,root->startLine,
@@ -6902,7 +6550,7 @@ localObjCMethod:
 // find the members corresponding to the different documentation blocks
 // that are extracted from the sources.
 
-static void filterMemberDocumentation(Entry *root)
+static void filterMemberDocumentation(const Entry *root,const QCString relates)
 {
   int i=-1,l;
   Debug::print(Debug::FindMembers,0,
@@ -6912,26 +6560,20 @@ static void filterMemberDocumentation(Entry *root)
   //printf("root->parent()->name=%s\n",root->parent()->name.data());
   bool isFunc=TRUE;
 
-  if (root->relatesType == Duplicate && !root->relates.isEmpty())
-  {
-    QCString tmp = root->relates;
-    root->relates.resize(0);
-    filterMemberDocumentation(root);
-    root->relates = tmp;
-  }
-
+  QCString type = root->type;
+  QCString args = root->args;
   if ( // detect func variable/typedef to func ptr
-      (i=findFunctionPtr(root->type,root->lang,&l))!=-1
+      (i=findFunctionPtr(type,root->lang,&l))!=-1
      )
   {
     //printf("Fixing function pointer!\n");
     // fix type and argument
-    root->args.prepend(root->type.right(root->type.length()-i-l));
-    root->type=root->type.left(i+l);
-    //printf("Results type=%s,name=%s,args=%s\n",root->type.data(),root->name.data(),root->args.data());
+    args.prepend(type.right(type.length()-i-l));
+    type=type.left(i+l);
+    //printf("Results type=%s,name=%s,args=%s\n",type.data(),root->name.data(),args.data());
     isFunc=FALSE;
   }
-  else if ((root->type.left(8)=="typedef " && root->args.find('(')!=-1))
+  else if ((type.left(8)=="typedef " && args.find('(')!=-1))
     // detect function types marked as functions
   {
     isFunc=FALSE;
@@ -6941,80 +6583,117 @@ static void filterMemberDocumentation(Entry *root)
   if (root->section==Entry::MEMBERDOC_SEC)
   {
     //printf("Documentation for inline member '%s' found args='%s'\n",
-    //    root->name.data(),root->args.data());
-    //if (root->relates.length()) printf("  Relates %s\n",root->relates.data());
-    if (root->type.isEmpty())
-    {
-      findMember(root,root->name+root->args+root->exception,FALSE,isFunc);
+    //    root->name.data(),args.data());
+    //if (relates.length()) printf("  Relates %s\n",relates.data());
+    if (type.isEmpty())
+    {
+      findMember(root,
+                 relates,
+                 type,
+                 args,
+                 root->name + args + root->exception,
+                 FALSE,
+                 isFunc);
     }
     else
     {
-      findMember(root,root->type+" "+root->name+root->args+root->exception,FALSE,isFunc);
+      findMember(root,
+                 relates,
+                 type,
+                 args,
+                 type + " " + root->name + args + root->exception,
+                 FALSE,
+                 isFunc);
     }
   }
   else if (root->section==Entry::OVERLOADDOC_SEC)
   {
     //printf("Overloaded member %s found\n",root->name.data());
-    findMember(root,root->name,TRUE,isFunc);
+    findMember(root,
+               relates,
+               type,
+               args,
+               root->name,
+               TRUE,
+               isFunc);
   }
   else if
     ((root->section==Entry::FUNCTION_SEC      // function
       ||
       (root->section==Entry::VARIABLE_SEC &&  // variable
-       !root->type.isEmpty() &&                // with a type
-       g_compoundKeywordDict.find(root->type)==0 // that is not a keyword
+       !type.isEmpty() &&                // with a type
+       g_compoundKeywordDict.find(type)==0 // that is not a keyword
        // (to skip forward declaration of class etc.)
       )
      )
     )
     {
       //printf("Documentation for member '%s' found args='%s' excp='%s'\n",
-      //    root->name.data(),root->args.data(),root->exception.data());
-      //if (root->relates.length()) printf("  Relates %s\n",root->relates.data());
-      //printf("Inside=%s\n Relates=%s\n",root->inside.data(),root->relates.data());
-      if (root->type=="friend class" || root->type=="friend struct" ||
-          root->type=="friend union")
+      //    root->name.data(),args.data(),root->exception.data());
+      //if (relates.length()) printf("  Relates %s\n",relates.data());
+      //printf("Inside=%s\n Relates=%s\n",root->inside.data(),relates.data());
+      if (type=="friend class" || type=="friend struct" ||
+          type=="friend union")
       {
         findMember(root,
-            root->type+" "+
-            root->name,
+            relates,
+            type,
+            args,
+            type+" "+root->name,
             FALSE,FALSE);
 
       }
-      else if (!root->type.isEmpty())
+      else if (!type.isEmpty())
       {
         findMember(root,
-            root->type+" "+
-            root->inside+
-            root->name+
-            root->args+
-            root->exception,
+            relates,
+            type,
+            args,
+            type+" "+ root->inside + root->name + args + root->exception,
             FALSE,isFunc);
       }
       else
       {
         findMember(root,
-            root->inside+
-            root->name+
-            root->args+
-            root->exception,
+            relates,
+            type,
+            args,
+            root->inside + root->name + args + root->exception,
             FALSE,isFunc);
       }
     }
-  else if (root->section==Entry::DEFINE_SEC && !root->relates.isEmpty())
+  else if (root->section==Entry::DEFINE_SEC && !relates.isEmpty())
   {
-    findMember(root,root->name+root->args,FALSE,!root->args.isEmpty());
+    findMember(root,
+               relates,
+               type,
+               args,
+               root->name + args,
+               FALSE,
+               !args.isEmpty());
   }
   else if (root->section==Entry::VARIABLEDOC_SEC)
   {
     //printf("Documentation for variable %s found\n",root->name.data());
-    //if (!root->relates.isEmpty()) printf("  Relates %s\n",root->relates.data());
-    findMember(root,root->name,FALSE,FALSE);
+    //if (!relates.isEmpty()) printf("  Relates %s\n",relates.data());
+    findMember(root,
+               relates,
+               type,
+               args,
+               root->name,
+               FALSE,
+               FALSE);
   }
   else if (root->section==Entry::EXPORTED_INTERFACE_SEC ||
            root->section==Entry::INCLUDED_SERVICE_SEC)
   {
-    findMember(root,root->type + " " + root->name,FALSE,FALSE);
+    findMember(root,
+               relates,
+               type,
+               args,
+               type + " " + root->name,
+               FALSE,
+               FALSE);
   }
   else
   {
@@ -7023,7 +6702,7 @@ static void filterMemberDocumentation(Entry *root)
   }
 }
 
-static void findMemberDocumentation(Entry *root)
+static void findMemberDocumentation(const Entry *root)
 {
   if (root->section==Entry::MEMBERDOC_SEC ||
       root->section==Entry::OVERLOADDOC_SEC ||
@@ -7035,42 +6714,41 @@ static void findMemberDocumentation(Entry *root)
       root->section==Entry::EXPORTED_INTERFACE_SEC
      )
   {
-    filterMemberDocumentation(root);
+    if (root->relatesType == Duplicate && !root->relates.isEmpty())
+    {
+      filterMemberDocumentation(root,"");
+    }
+    filterMemberDocumentation(root,root->relates);
   }
-  if (root->children())
+  for (const auto &e : root->children())
   {
-    EntryListIterator eli(*root->children());
-    Entry *e;
-    for (;(e=eli.current());++eli)
+    if (e->section!=Entry::ENUM_SEC)
     {
-      if (e->section!=Entry::ENUM_SEC) findMemberDocumentation(e);
+      findMemberDocumentation(e.get());
     }
   }
 }
 
 //----------------------------------------------------------------------
 
-static void findObjCMethodDefinitions(Entry *root)
+static void findObjCMethodDefinitions(const Entry *root)
 {
-  if (root->children())
+  for (const auto &objCImpl : root->children())
   {
-    EntryListIterator eli(*root->children());
-    Entry *objCImpl;
-    for (;(objCImpl=eli.current());++eli)
+    if (objCImpl->section==Entry::OBJCIMPL_SEC)
     {
-      if (objCImpl->section==Entry::OBJCIMPL_SEC && objCImpl->children())
+      for (const auto &objCMethod : objCImpl->children())
       {
-        EntryListIterator seli(*objCImpl->children());
-        Entry *objCMethod;
-        for (;(objCMethod=seli.current());++seli)
+        if (objCMethod->section==Entry::FUNCTION_SEC)
         {
-          if (objCMethod->section==Entry::FUNCTION_SEC)
-          {
-            //Printf("  Found ObjC method definition %s\n",objCMethod->name.data());
-            findMember(objCMethod, objCMethod->type+" "+objCImpl->name+"::"+
-                       objCMethod->name+" "+objCMethod->args, FALSE,TRUE);
-            objCMethod->section=Entry::EMPTY_SEC;
-          }
+          //Printf("  Found ObjC method definition %s\n",objCMethod->name.data());
+          findMember(objCMethod.get(),
+                     objCMethod->relates,
+                     objCMethod->type,
+                     objCMethod->args,
+                     objCMethod->type+" "+objCImpl->name+"::"+objCMethod->name+" "+objCMethod->args,
+                     FALSE,TRUE);
+          objCMethod->section=Entry::EMPTY_SEC;
         }
       }
     }
@@ -7080,7 +6758,7 @@ static void findObjCMethodDefinitions(Entry *root)
 //----------------------------------------------------------------------
 // find and add the enumeration to their classes, namespaces or files
 
-static void findEnums(Entry *root)
+static void findEnums(const Entry *root)
 {
   if (root->section==Entry::ENUM_SEC)
   {
@@ -7134,7 +6812,7 @@ static void findEnums(Entry *root)
       mnsd=Doxygen::memberNameSDict;
       isGlobal=FALSE;
     }
-    else if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@') // found enum inside namespace
+    else if (nd) // found enum inside namespace
     {
       mnsd=Doxygen::functionNameSDict;
       isGlobal=TRUE;
@@ -7155,8 +6833,8 @@ static void findEnums(Entry *root)
           root->protection,Normal,FALSE,
           isMemberOf ? Foreign : isRelated ? Related : Member,
           MemberType_Enumeration,
-          0,0,root->metaData);
-      md->setTagInfo(root->tagInfo);
+          ArgumentList(),ArgumentList(),root->metaData);
+      md->setTagInfo(root->tagInfo());
       md->setLanguage(root->lang);
       md->setId(root->id);
       if (!isGlobal) md->setMemberClass(cd); else md->setFileDef(fd);
@@ -7183,7 +6861,7 @@ static void findEnums(Entry *root)
         baseType.prepend(" : ");
       }
 
-      if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@')
+      if (nd)
       {
         if (isRelated || Config_getBool(HIDE_SCOPE_NAMES))
         {
@@ -7202,7 +6880,7 @@ static void findEnums(Entry *root)
       // even if we have already added the enum to a namespace, we still
       // also want to add it to other appropriate places such as file
       // or class.
-      if (isGlobal)
+      if (isGlobal && (nd==0 || !nd->isAnonymous()))
       {
         if (!defSet) md->setDefinition(name+baseType);
         if (fd==0 && root->parent())
@@ -7253,13 +6931,13 @@ static void findEnums(Entry *root)
   }
   else
   {
-    RECURSE_ENTRYTREE(findEnums,root);
+    for (const auto &e : root->children()) findEnums(e.get());
   }
 }
 
 //----------------------------------------------------------------------
 
-static void addEnumValuesToEnums(Entry *root)
+static void addEnumValuesToEnums(const Entry *root)
 {
   if (root->section==Entry::ENUM_SEC)
     // non anonymous enumeration
@@ -7311,7 +6989,7 @@ static void addEnumValuesToEnums(Entry *root)
       mnsd=Doxygen::memberNameSDict;
       isGlobal=FALSE;
     }
-    else if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@') // found enum inside namespace
+    else if (nd && !nd->isAnonymous()) // found enum inside namespace
     {
       //printf("Enum in namespace '%s'::'%s'\n",nd->name().data(),name.data());
       mnsd=Doxygen::functionNameSDict;
@@ -7335,12 +7013,10 @@ static void addEnumValuesToEnums(Entry *root)
         MemberDef *md;
         for (mni.toFirst(); (md=mni.current()) ; ++mni)  // for each enum in this list
         {
-          if (!md->isAlias() && md->isEnumerate() && root->children())
+          if (!md->isAlias() && md->isEnumerate() && !root->children().empty())
           {
             //printf("   enum with %d children\n",root->children()->count());
-            EntryListIterator eli(*root->children()); // for each enum value
-            Entry *e;
-            for (;(e=eli.current());++eli)
+            for (const auto &e : root->children())
             {
               SrcLangExt sle;
               if (
@@ -7356,7 +7032,7 @@ static void addEnumValuesToEnums(Entry *root)
                 //printf("md->qualifiedName()=%s e->name=%s tagInfo=%p name=%s\n",
                 //    md->qualifiedName().data(),e->name.data(),e->tagInfo,e->name.data());
                 QCString qualifiedName = substitute(root->name,"::",".");
-                if (!scope.isEmpty() && root->tagInfo)
+                if (!scope.isEmpty() && root->tagInfo())
                 {
                   qualifiedName=substitute(scope,"::",".")+"."+qualifiedName;
                 }
@@ -7365,20 +7041,20 @@ static void addEnumValuesToEnums(Entry *root)
                    )
                 {
                   QCString fileName = e->fileName;
-                  if (fileName.isEmpty() && e->tagInfo)
+                  if (fileName.isEmpty() && e->tagInfo())
                   {
-                    fileName = e->tagInfo->tagName;
+                    fileName = e->tagInfo()->tagName;
                   }
                   MemberDef *fmd=createMemberDef(
                       fileName,e->startLine,e->startColumn,
                       e->type,e->name,e->args,0,
                       e->protection, Normal,e->stat,Member,
-                      MemberType_EnumValue,0,0,e->metaData);
+                      MemberType_EnumValue,ArgumentList(),ArgumentList(),e->metaData);
                   if      (md->getClassDef())     fmd->setMemberClass(md->getClassDef());
                   else if (md->getNamespaceDef()) fmd->setNamespace(md->getNamespaceDef());
                   else if (md->getFileDef())      fmd->setFileDef(md->getFileDef());
                   fmd->setOuterScope(md->getOuterScope());
-                  fmd->setTagInfo(e->tagInfo);
+                  fmd->setTagInfo(e->tagInfo());
                   fmd->setLanguage(e->lang);
                   fmd->setId(e->id);
                   fmd->setDocumentation(e->doc,e->docFile,e->docLine);
@@ -7421,7 +7097,7 @@ static void addEnumValuesToEnums(Entry *root)
                     {
                       //printf("found enum value with same name %s in scope %s\n",
                       //    fmd->name().data(),fmd->getOuterScope()->name().data());
-                      if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@')
+                      if (nd && !nd->isAnonymous())
                       {
                         const NamespaceDef *fnd=fmd->getNamespaceDef();
                         if (fnd==nd) // enum value is inside a namespace
@@ -7472,7 +7148,7 @@ static void addEnumValuesToEnums(Entry *root)
   }
   else
   {
-    RECURSE_ENTRYTREE(addEnumValuesToEnums,root);
+    for (const auto &e : root->children()) addEnumValuesToEnums(e.get());
   }
 }
 
@@ -7480,7 +7156,7 @@ static void addEnumValuesToEnums(Entry *root)
 //----------------------------------------------------------------------
 // find the documentation blocks for the enumerations
 
-static void findEnumDocumentation(Entry *root)
+static void findEnumDocumentation(const Entry *root)
 {
   if (root->section==Entry::ENUMDOC_SEC
       && !root->name.isEmpty()
@@ -7560,7 +7236,7 @@ static void findEnumDocumentation(Entry *root)
               md->setRefItems(root->sli);
 
               const GroupDef *gd=md->getGroupDef();
-              if (gd==0 &&root->groups->getFirst()!=0) // member not grouped but out-of-line documentation is
+              if (gd==0 && !root->groups.empty()) // member not grouped but out-of-line documentation is
               {
                 addMemberToGroups(root,md);
               }
@@ -7594,7 +7270,7 @@ static void findEnumDocumentation(Entry *root)
               md->setMemberGroupId(root->mGrpId);
 
               const GroupDef *gd=md->getGroupDef();
-              if (gd==0 && root->groups->getFirst()!=0) // member not grouped but out-of-line documentation is
+              if (gd==0 && !root->groups.empty()) // member not grouped but out-of-line documentation is
               {
                 addMemberToGroups(root,md);
               }
@@ -7613,7 +7289,7 @@ static void findEnumDocumentation(Entry *root)
       }
     }
   }
-  RECURSE_ENTRYTREE(findEnumDocumentation,root);
+  for (const auto &e : root->children()) findEnumDocumentation(e.get());
 }
 
 // search for each enum (member or function) in mnl if it has documented
@@ -7771,8 +7447,8 @@ static void computeMemberRelations()
               mcd->isBaseClass(bmcd,TRUE))
           {
             //printf("  derived scope\n");
-            ArgumentList *bmdAl = bmd->argumentList();
-            ArgumentList *mdAl =  md->argumentList();
+            const ArgumentList &bmdAl = bmd->argumentList();
+            const ArgumentList &mdAl =  md->argumentList();
             //printf(" Base argList='%s'\n Super argList='%s'\n",
             //        argListToString(bmdAl.pointer()).data(),
             //        argListToString(mdAl.pointer()).data()
@@ -8603,12 +8279,13 @@ static void findDefineDocumentation(Entry *root)
     //printf("found define '%s' '%s' brief='%s' doc='%s'\n",
     //       root->name.data(),root->args.data(),root->brief.data(),root->doc.data());
 
-    if (root->tagInfo && !root->name.isEmpty()) // define read from a tag file
+    if (root->tagInfo() && !root->name.isEmpty()) // define read from a tag file
     {
-      MemberDef *md=createMemberDef(root->tagInfo->tagName,1,1,
+      MemberDef *md=createMemberDef(root->tagInfo()->tagName,1,1,
                     "#define",root->name,root->args,0,
-                    Public,Normal,FALSE,Member,MemberType_Define,0,0,"");
-      md->setTagInfo(root->tagInfo);
+                    Public,Normal,FALSE,Member,MemberType_Define,
+                    ArgumentList(),ArgumentList(),"");
+      md->setTagInfo(root->tagInfo());
       md->setLanguage(root->lang);
       //printf("Searching for '%s' fd=%p\n",filePathName.data(),fd);
       md->setFileDef(root->parent()->fileDef());
@@ -8728,12 +8405,12 @@ static void findDefineDocumentation(Entry *root)
       }
     }
   }
-  RECURSE_ENTRYTREE(findDefineDocumentation,root);
+  for (const auto &e : root->children()) findDefineDocumentation(e.get());
 }
 
 //----------------------------------------------------------------------------
 
-static void findDirDocumentation(Entry *root)
+static void findDirDocumentation(const Entry *root)
 {
   if (root->section == Entry::DIRDOC_SEC)
   {
@@ -8789,7 +8466,7 @@ static void findDirDocumentation(Entry *root)
           "directory found for command \\dir %s\n",normalizedName.data());
     }
   }
-  RECURSE_ENTRYTREE(findDirDocumentation,root);
+  for (const auto &e : root->children()) findDirDocumentation(e.get());
 }
 
 
@@ -8819,7 +8496,7 @@ static void buildPageList(Entry *root)
                0,0
                );
   }
-  RECURSE_ENTRYTREE(buildPageList,root);
+  for (const auto &e : root->children()) buildPageList(e.get());
 }
 
 // search for the main page defined in this project
@@ -8827,7 +8504,7 @@ static void findMainPage(Entry *root)
 {
   if (root->section == Entry::MAINPAGEDOC_SEC)
   {
-    if (Doxygen::mainPage==0 && root->tagInfo==0)
+    if (Doxygen::mainPage==0 && root->tagInfo()==0)
     {
       //printf("Found main page! \n======\n%s\n=======\n",root->doc.data());
       QCString title=root->args.stripWhiteSpace();
@@ -8866,14 +8543,14 @@ static void findMainPage(Entry *root)
         Doxygen::mainPage->addSectionsToDefinition(root->anchors);
       }
     }
-    else if (root->tagInfo==0)
+    else if (root->tagInfo()==0)
     {
       warn(root->fileName,root->startLine,
            "found more than one \\mainpage comment block! (first occurrence: %s, line %d), Skipping current block!",
            Doxygen::mainPage->docFile().data(),Doxygen::mainPage->docLine());
     }
   }
-  RECURSE_ENTRYTREE(findMainPage,root);
+  for (const auto &e : root->children()) findMainPage(e.get());
 }
 
 // search for the main page imported via tag files and add only the section labels
@@ -8881,12 +8558,12 @@ static void findMainPageTagFiles(Entry *root)
 {
   if (root->section == Entry::MAINPAGEDOC_SEC)
   {
-    if (Doxygen::mainPage && root->tagInfo)
+    if (Doxygen::mainPage && root->tagInfo())
     {
       Doxygen::mainPage->addSectionsToDefinition(root->anchors);
     }
   }
-  RECURSE_ENTRYTREE(findMainPageTagFiles,root);
+  for (const auto &e : root->children()) findMainPageTagFiles(e.get());
 }
 
 static void computePageRelations(Entry *root)
@@ -8902,17 +8579,14 @@ static void computePageRelations(Entry *root)
                     Doxygen::mainPage;
     if (pd)
     {
-      QListIterator<BaseInfo> bii(*root->extends);
-      BaseInfo *bi;
-      for (bii.toFirst();(bi=bii.current());++bii)
+      for (const BaseInfo &bi : root->extends)
       {
-        PageDef *subPd = Doxygen::pageSDict->find(bi->name);
+        PageDef *subPd = Doxygen::pageSDict->find(bi.name);
         if (pd==subPd)
         {
-         err("page defined at line %d of file %s with label %s is a direct "
+         term("page defined at line %d of file %s with label %s is a direct "
              "subpage of itself! Please remove this cyclic dependency.\n",
               pd->docLine(),pd->docFile().data(),pd->name().data());
-          exit(1);
         }
         else if (subPd)
         {
@@ -8923,7 +8597,7 @@ static void computePageRelations(Entry *root)
       }
     }
   }
-  RECURSE_ENTRYTREE(computePageRelations,root);
+  for (const auto &e : root->children()) computePageRelations(e.get());
 }
 
 static void checkPageRelations()
@@ -8937,10 +8611,9 @@ static void checkPageRelations()
     {
       if (ppd==pd)
       {
-        err("page defined at line %d of file %s with label %s is a subpage "
+        term("page defined at line %d of file %s with label %s is a subpage "
             "of itself! Please remove this cyclic dependency.\n",
             pd->docLine(),pd->docFile().data(),pd->name().data());
-        exit(1);
       }
       ppd=ppd->getOuterScope();
     }
@@ -9069,7 +8742,7 @@ static void buildExampleList(Entry *root)
       //addExampleToGroups(root,pd);
     }
   }
-  RECURSE_ENTRYTREE(buildExampleList,root);
+  for (const auto &e : root->children()) buildExampleList(e.get());
 }
 
 //----------------------------------------------------------------------------
@@ -9083,10 +8756,9 @@ void printNavTree(Entry *root,int indent)
       indentStr.isEmpty()?"":indentStr.data(),
       root->name.isEmpty()?"<empty>":root->name.data(),
       root->section);
-  if (root->children())
+  for (const auto &e : root->children())
   {
-    EntryListIterator eli(*root->children());
-    for (;eli.current();++eli) printNavTree(eli.current(),indent+2);
+    printNavTree(e.get(),indent+2);
   }
 }
 
@@ -9102,7 +8774,8 @@ static void generateExampleDocs()
   for (pdi.toFirst();(pd=pdi.current());++pdi)
   {
     msg("Generating docs for example %s...\n",pd->name().data());
-    resetCCodeParserState();
+    CodeParserInterface &intf = Doxygen::parserManager->getCodeParser(".c"); // TODO: do this on code type
+    intf.resetCodeParserState();
     QCString n=pd->getOutputFileBase();
     startFile(*g_outputList,n,n,pd->name());
     startTitle(*g_outputList,n);
@@ -9273,8 +8946,7 @@ static void generateConfigFile(const char *configFile,bool shortList,
   }
   else
   {
-    err("Cannot open file %s for writing\n",configFile);
-    exit(1);
+    term("Cannot open file %s for writing\n",configFile);
   }
 }
 static void compareDoxyfile()
@@ -9291,8 +8963,7 @@ static void compareDoxyfile()
   }
   else
   {
-    err("Cannot open file %s for writing\n",configFile);
-    exit(1);
+    term("Cannot open file %s for writing\n",configFile);
   }
 }
 //----------------------------------------------------------------------------
@@ -9308,7 +8979,7 @@ static void compareDoxyfile()
 
 //----------------------------------------------------------------------------
 
-static void readTagFile(Entry *root,const char *tl)
+static void readTagFile(const std::shared_ptr<Entry> &root,const char *tl)
 {
   QCString tagLine = tl;
   QCString fileName;
@@ -9318,6 +8989,7 @@ static void readTagFile(Entry *root,const char *tl)
   {
     fileName = tagLine.left(eqPos).stripWhiteSpace();
     destName = tagLine.right(tagLine.length()-eqPos-1).stripWhiteSpace();
+    if (fileName.isEmpty() || destName.isEmpty()) return;
     QFileInfo fi(fileName);
     Doxygen::tagDestinationDict.insert(fi.absFilePath().utf8(),new QCString(destName));
     //printf("insert tagDestination %s->%s\n",fi.fileName().data(),destName.data());
@@ -9432,7 +9104,7 @@ static void copyLogo(const QCString &outputOption)
   }
 }
 
-static void copyExtraFiles(QStrList files,const QString &filesOption,const QCString &outputOption)
+static void copyExtraFiles(QStrList files,const QCString &filesOption,const QCString &outputOption)
 {
   uint i;
   for (i=0; i<files.count(); ++i)
@@ -9458,7 +9130,7 @@ static void copyExtraFiles(QStrList files,const QString &filesOption,const QCStr
 
 //----------------------------------------------------------------------------
 
-static ParserInterface *getParserForFile(const char *fn)
+static OutlineParserInterface &getParserForFile(const char *fn)
 {
   QCString fileName=fn;
   QCString extension;
@@ -9473,11 +9145,11 @@ static ParserInterface *getParserForFile(const char *fn)
     extension = ".no_extension";
   }
 
-  return Doxygen::parserManager->getParser(extension);
+  return Doxygen::parserManager->getOutlineParser(extension);
 }
 
-static void parseFile(ParserInterface *parser,
-                      Entry *root,FileDef *fd,const char *fn,
+static void parseFile(OutlineParserInterface &parser,
+                      const std::shared_ptr<Entry> &root,FileDef *fd,const char *fn,
                       bool sameTu,QStrList &filesInSameTu)
 {
 #if USE_LIBCLANG
@@ -9501,12 +9173,12 @@ static void parseFile(ParserInterface *parser,
   BufStr preBuf(fi.size()+4096);
 
   if (Config_getBool(ENABLE_PREPROCESSING) &&
-      parser->needsPreprocessing(extension))
+      parser.needsPreprocessing(extension))
   {
     BufStr inBuf(fi.size()+4096);
     msg("Preprocessing %s...\n",fn);
     readInputFile(fileName,inBuf);
-    preprocessFile(fileName,inBuf,preBuf);
+    Doxygen::preprocessor->processFile(fileName,inBuf,preBuf);
   }
   else // no preprocessing
   {
@@ -9530,15 +9202,15 @@ static void parseFile(ParserInterface *parser,
     fd->getAllIncludeFilesRecursively(filesInSameTu);
   }
 
-  Entry *fileRoot = new Entry;
+  std::shared_ptr<Entry> fileRoot = std::make_shared<Entry>();
   // use language parse to parse the file
-  parser->parseInput(fileName,convBuf.data(),fileRoot,sameTu,filesInSameTu);
+  parser.parseInput(fileName,convBuf.data(),fileRoot,sameTu,filesInSameTu);
   fileRoot->setFileDef(fd);
-  root->addSubEntry(fileRoot);
+  root->moveToSubEntryAndKeep(fileRoot);
 }
 
 //! parse the list of input files
-static void parseFiles(Entry *root)
+static void parseFiles(const std::shared_ptr<Entry> &root)
 {
 #if USE_LIBCLANG
   static bool clangAssistedParsing = Config_getBool(CLANG_ASSISTED_PARSING);
@@ -9564,8 +9236,8 @@ static void parseFiles(Entry *root)
       if (fd->isSource() && !fd->isReference()) // this is a source file
       {
         QStrList filesInSameTu;
-        ParserInterface * parser = getParserForFile(s->data());
-        parser->startTranslationUnit(s->data());
+        OutlineParserInterface &parser = getParserForFile(s->data());
+        parser.startTranslationUnit(s->data());
         parseFile(parser,root,fd,s->data(),FALSE,filesInSameTu);
         //printf("  got %d extra files in tu\n",filesInSameTu.count());
 
@@ -9587,7 +9259,7 @@ static void parseFiles(Entry *root)
           }
           incFile = filesInSameTu.next();
         }
-        parser->finishTranslationUnit();
+        parser.finishTranslationUnit();
         g_processedFiles.insert(*s,(void*)0x8);
       }
     }
@@ -9600,15 +9272,15 @@ static void parseFiles(Entry *root)
         QStrList filesInSameTu;
         FileDef *fd=findFileDef(Doxygen::inputNameDict,s->data(),ambig);
         ASSERT(fd!=0);
-        ParserInterface * parser = getParserForFile(s->data());
-        parser->startTranslationUnit(s->data());
+        OutlineParserInterface &parser = getParserForFile(s->data());
+        parser.startTranslationUnit(s->data());
         parseFile(parser,root,fd,s->data(),FALSE,filesInSameTu);
-        parser->finishTranslationUnit();
+        parser.finishTranslationUnit();
         g_processedFiles.insert(*s,(void*)0x8);
       }
     }
   }
-  else // normal pocessing
+  else // normal processing
 #endif
   {
     StringListIterator it(g_inputFiles);
@@ -9619,8 +9291,8 @@ static void parseFiles(Entry *root)
       QStrList filesInSameTu;
       FileDef *fd=findFileDef(Doxygen::inputNameDict,s->data(),ambig);
       ASSERT(fd!=0);
-      ParserInterface * parser = getParserForFile(s->data());
-      parser->startTranslationUnit(s->data());
+      OutlineParserInterface &parser = getParserForFile(s->data());
+      parser.startTranslationUnit(s->data());
       parseFile(parser,root,fd,s->data(),FALSE,filesInSameTu);
     }
   }
@@ -9699,7 +9371,7 @@ static QDict<void> g_pathsVisited(1009);
 //----------------------------------------------------------------------------
 // Read all files matching at least one pattern in 'patList' in the
 // directory represented by 'fi'.
-// The directory is read iff the recusiveFlag is set.
+// The directory is read iff the recursiveFlag is set.
 // The contents of all files is append to the input string
 
 int readDir(QFileInfo *fi,
@@ -9930,17 +9602,15 @@ void readFormulaRepository(QCString dir, bool cmp)
         {
           if ((f=Doxygen::formulaDict->find(formText))==0)
           {
-            err("discrepancy between formula repositories! Remove "
+            term("discrepancy between formula repositories! Remove "
                 "formula.repository and from_* files from output directories.");
-            exit(1);
           }
           QCString formLabel;
-          formLabel.sprintf("\\form#%d",f->getId());
+          formLabel.sprintf("\\_form#%d",f->getId());
           if (formLabel != formName)
           {
-            err("discrepancy between formula repositories! Remove "
+            term("discrepancy between formula repositories! Remove "
                 "formula.repository and from_* files from output directories.");
-            exit(1);
           }
           new_repository++;
         }
@@ -9957,9 +9627,8 @@ void readFormulaRepository(QCString dir, bool cmp)
   }
   if (cmp && (current_repository != new_repository))
   {
-    err("size discrepancy between formula repositories! Remove "
+    term("size discrepancy between formula repositories! Remove "
         "formula.repository and from_* files from output directories.");
-    exit(1);
   }
 }
 
@@ -10133,29 +9802,31 @@ static void usage(const char *name,const char *versionString)
   msg("You can use doxygen in a number of ways:\n\n");
   msg("1) Use doxygen to generate a template configuration file:\n");
   msg("    %s [-s] -g [configName]\n\n",name);
-  msg("    If - is used for configName doxygen will write to standard output.\n\n");
   msg("2) Use doxygen to update an old configuration file:\n");
   msg("    %s [-s] -u [configName]\n\n",name);
   msg("3) Use doxygen to generate documentation using an existing ");
   msg("configuration file:\n");
   msg("    %s [configName]\n\n",name);
-  msg("    If - is used for configName doxygen will read from standard input.\n\n");
   msg("4) Use doxygen to generate a template file controlling the layout of the\n");
   msg("   generated documentation:\n");
-  msg("    %s -l [layoutFileName.xml]\n\n",name);
+  msg("    %s -l [layoutFileName]\n\n",name);
+  msg("    In case layoutFileName is omitted layoutFileName.xml will be used as filename.\n");
+  msg("    If - is used for layoutFileName doxygen will write to standard output.\n\n");
   msg("5) Use doxygen to generate a template style sheet file for RTF, HTML or Latex.\n");
   msg("    RTF:        %s -w rtf styleSheetFile\n",name);
   msg("    HTML:       %s -w html headerFile footerFile styleSheetFile [configFile]\n",name);
   msg("    LaTeX:      %s -w latex headerFile footerFile styleSheetFile [configFile]\n\n",name);
   msg("6) Use doxygen to generate a rtf extensions file\n");
   msg("    RTF:   %s -e rtf extensionsFile\n\n",name);
+  msg("    If - is used for extensionsFile doxygen will write to standard output.\n\n");
   msg("7) Use doxygen to compare the used configuration file with the template configuration file\n");
   msg("    %s -x [configFile]\n\n",name);
   msg("8) Use doxygen to show a list of built-in emojis.\n");
   msg("    %s -f emoji outputFileName\n\n",name);
   msg("    If - is used for outputFileName doxygen will write to standard output.\n\n");
   msg("If -s is specified the comments of the configuration items in the config file will be omitted.\n");
-  msg("If configName is omitted 'Doxyfile' will be used as a default.\n\n");
+  msg("If configName is omitted 'Doxyfile' will be used as a default.\n");
+  msg("If - is used for configFile doxygen will write / read the configuration to /from standard output / input.\n\n");
   msg("-v print version string\n");
 }
 
@@ -10175,32 +9846,55 @@ static const char *getArg(int argc,char **argv,int &optind)
 
 //----------------------------------------------------------------------------
 
+/** @brief /dev/null outline parser */
+class NullOutlineParser : public OutlineParserInterface
+{
+  public:
+    void startTranslationUnit(const char *) {}
+    void finishTranslationUnit() {}
+    void parseInput(const char *, const char *,const std::shared_ptr<Entry> &, bool, QStrList &) {}
+    bool needsPreprocessing(const QCString &) const { return FALSE; }
+    void parsePrototype(const char *) {}
+};
+
+
+
 void initDoxygen()
 {
   initResources();
-  const char *lang = portable_getenv("LC_ALL");
-  if (lang) portable_setenv("LANG",lang);
+  const char *lang = Portable::getenv("LC_ALL");
+  if (lang) Portable::setenv("LANG",lang);
   setlocale(LC_ALL,"");
   setlocale(LC_CTYPE,"C"); // to get isspace(0xA0)==0, needed for UTF-8
   setlocale(LC_NUMERIC,"C");
 
-  portable_correct_path();
+  Portable::correct_path();
 
   Doxygen::runningTime.start();
-  initPreprocessor();
-
-  Doxygen::parserManager = new ParserManager;
-  Doxygen::parserManager->registerDefaultParser(         new FileParser);
-  Doxygen::parserManager->registerParser("c",            new CLanguageScanner);
-  Doxygen::parserManager->registerParser("python",       new PythonLanguageScanner);
-  Doxygen::parserManager->registerParser("fortran",      new FortranLanguageScanner);
-  Doxygen::parserManager->registerParser("fortranfree",  new FortranLanguageScannerFree);
-  Doxygen::parserManager->registerParser("fortranfixed", new FortranLanguageScannerFixed);
-  Doxygen::parserManager->registerParser("vhdl",         new VHDLLanguageScanner);
-  Doxygen::parserManager->registerParser("xml",          new XMLScanner);
-  Doxygen::parserManager->registerParser("sql",          new SQLScanner);
-  Doxygen::parserManager->registerParser("tcl",          new TclLanguageScanner);
-  Doxygen::parserManager->registerParser("md",           new MarkdownFileParser);
+  Doxygen::preprocessor = new Preprocessor();
+
+  Doxygen::parserManager = new ParserManager(            std::make_unique<NullOutlineParser>(),
+                                                         std::make_unique<FileCodeParser>());
+  Doxygen::parserManager->registerParser("c",            std::make_unique<COutlineParser>(),
+                                                         std::make_unique<CCodeParser>());
+  Doxygen::parserManager->registerParser("python",       std::make_unique<PythonOutlineParser>(),
+                                                         std::make_unique<PythonCodeParser>());
+  Doxygen::parserManager->registerParser("fortran",      std::make_unique<FortranOutlineParser>(),
+                                                         std::make_unique<FortranCodeParser>());
+  Doxygen::parserManager->registerParser("fortranfree",  std::make_unique<FortranOutlineParserFree>(),
+                                                         std::make_unique<FortranCodeParserFree>());
+  Doxygen::parserManager->registerParser("fortranfixed", std::make_unique<FortranOutlineParserFixed>(),
+                                                         std::make_unique<FortranCodeParserFixed>());
+  Doxygen::parserManager->registerParser("vhdl",         std::make_unique<VHDLOutlineParser>(),
+                                                         std::make_unique<VHDLCodeParser>());
+  Doxygen::parserManager->registerParser("xml",          std::make_unique<NullOutlineParser>(),
+                                                         std::make_unique<XMLCodeParser>());
+  Doxygen::parserManager->registerParser("sql",          std::make_unique<NullOutlineParser>(),
+                                                         std::make_unique<SQLCodeParser>());
+  Doxygen::parserManager->registerParser("tcl",          std::make_unique<TclOutlineParser>(),
+                                                         std::make_unique<TclCodeParser>());
+  Doxygen::parserManager->registerParser("md",           std::make_unique<MarkdownOutlineParser>(),
+                                                         std::make_unique<FileCodeParser>());
 
   // register any additional parsers here...
 
@@ -10291,11 +9985,10 @@ void cleanUpDoxygen()
   delete Doxygen::globalScope;
   delete Doxygen::xrefLists;
   delete Doxygen::parserManager;
-  cleanUpPreprocessor();
+  delete Doxygen::preprocessor;
   delete theTranslator;
   delete g_outputList;
   Mappers::freeMappers();
-  codeFreeScanner();
 
   if (Doxygen::symbolMap)
   {
@@ -10382,9 +10075,14 @@ void readConfiguration(int argc, char **argv)
         genConfig=TRUE;
         break;
       case 'l':
-        layoutName=getArg(argc,argv,optind);
-        if (!layoutName)
-        { layoutName="DoxygenLayout.xml"; }
+        if (optind+1>=argc)
+        {
+          layoutName="DoxygenLayout.xml";
+        }
+        else
+        {
+          layoutName=argv[optind+1];
+        }
         writeDefaultLayoutFile(layoutName);
         cleanUpDoxygen();
         exit(0);
@@ -10766,7 +10464,7 @@ void adjustConfiguration()
   while (s)
   {
     QFileInfo fi(s);
-    addSearchDir(fi.absFilePath().utf8());
+    Doxygen::preprocessor->addSearchDir(fi.absFilePath().utf8());
     s=includePath.next();
   }
 
@@ -10792,11 +10490,22 @@ void adjustConfiguration()
   while (mapping)
   {
     QCString mapStr = mapping;
-    int i;
-    if ((i=mapStr.find('='))!=-1)
+    int i=mapStr.find('=');
+    if (i==-1)
     {
-      QCString ext=mapStr.left(i).stripWhiteSpace().lower();
-      QCString language=mapStr.mid(i+1).stripWhiteSpace().lower();
+      mapping = extMaps.next();
+      continue;
+    }
+    else
+    {
+      QCString ext = mapStr.left(i).stripWhiteSpace().lower();
+      QCString language = mapStr.mid(i+1).stripWhiteSpace().lower();
+      if (ext.isEmpty() || language.isEmpty())
+      {
+        mapping = extMaps.next();
+        continue;
+      }
+
       if (!updateLanguageMapping(ext,language))
       {
         err("Failed to map file extension '%s' to unsupported language '%s'.\n"
@@ -10812,7 +10521,6 @@ void adjustConfiguration()
     mapping = extMaps.next();
   }
 
-
   // add predefined macro name to a dictionary
   QStrList &expandAsDefinedList =Config_getList(EXPAND_AS_DEFINED);
   s=expandAsDefinedList.first();
@@ -11001,6 +10709,8 @@ static QCString getQchFileName()
 
 void searchInputFiles()
 {
+  QDict<void> *killDict = new QDict<void>(10007);
+
   QStrList &exclPatterns = Config_getList(EXCLUDE_PATTERNS);
   bool alwaysRecursive = Config_getBool(RECURSIVE);
   StringDict excludeNameDict(1009);
@@ -11008,6 +10718,7 @@ void searchInputFiles()
 
   // gather names of all files in the include path
   g_s.begin("Searching for include files...\n");
+  killDict->clear();
   QStrList &includePathList = Config_getList(INCLUDE_PATH);
   char *s=includePathList.first();
   while (s)
@@ -11019,12 +10730,14 @@ void searchInputFiles()
     }
     readFileOrDirectory(s,0,Doxygen::includeNameDict,0,&pl,
                         &exclPatterns,0,0,
-                        alwaysRecursive);
+                        alwaysRecursive,
+                        TRUE,killDict);
     s=includePathList.next();
   }
   g_s.end();
 
   g_s.begin("Searching for example files...\n");
+  killDict->clear();
   QStrList &examplePathList = Config_getList(EXAMPLE_PATH);
   s=examplePathList.first();
   while (s)
@@ -11032,55 +10745,64 @@ void searchInputFiles()
     readFileOrDirectory(s,0,Doxygen::exampleNameDict,0,
                         &Config_getList(EXAMPLE_PATTERNS),
                         0,0,0,
-                        (alwaysRecursive || Config_getBool(EXAMPLE_RECURSIVE)));
+                        (alwaysRecursive || Config_getBool(EXAMPLE_RECURSIVE)),
+                        TRUE,killDict);
     s=examplePathList.next();
   }
   g_s.end();
 
   g_s.begin("Searching for images...\n");
+  killDict->clear();
   QStrList &imagePathList=Config_getList(IMAGE_PATH);
   s=imagePathList.first();
   while (s)
   {
     readFileOrDirectory(s,0,Doxygen::imageNameDict,0,0,
                         0,0,0,
-                        alwaysRecursive);
+                        alwaysRecursive,
+                        TRUE,killDict);
     s=imagePathList.next();
   }
   g_s.end();
 
   g_s.begin("Searching for dot files...\n");
+  killDict->clear();
   QStrList &dotFileList=Config_getList(DOTFILE_DIRS);
   s=dotFileList.first();
   while (s)
   {
     readFileOrDirectory(s,0,Doxygen::dotFileNameDict,0,0,
                         0,0,0,
-                        alwaysRecursive);
+                        alwaysRecursive,
+                        TRUE,killDict);
     s=dotFileList.next();
   }
   g_s.end();
 
   g_s.begin("Searching for msc files...\n");
+  killDict->clear();
   QStrList &mscFileList=Config_getList(MSCFILE_DIRS);
   s=mscFileList.first();
   while (s)
   {
     readFileOrDirectory(s,0,Doxygen::mscFileNameDict,0,0,
                         0,0,0,
-                        alwaysRecursive);
+                        alwaysRecursive,
+                        TRUE,killDict);
     s=mscFileList.next();
   }
   g_s.end();
 
   g_s.begin("Searching for dia files...\n");
+  killDict->clear();
   QStrList &diaFileList=Config_getList(DIAFILE_DIRS);
   s=diaFileList.first();
   while (s)
   {
     readFileOrDirectory(s,0,Doxygen::diaFileNameDict,0,0,
                         0,0,0,
-                        alwaysRecursive);
+                        alwaysRecursive,
+                        TRUE,killDict);
     s=diaFileList.next();
   }
   g_s.end();
@@ -11103,7 +10825,7 @@ void searchInputFiles()
    **************************************************************************/
 
   g_s.begin("Searching INPUT for files to process...\n");
-  QDict<void> *killDict = new QDict<void>(10007);
+  killDict->clear();
   QStrList &inputList=Config_getList(INPUT);
   g_inputFiles.setAutoDelete(TRUE);
   s=inputList.first();
@@ -11132,8 +10854,9 @@ void searchInputFiles()
     s=inputList.next();
   }
   Doxygen::inputNameList->sort();
-  delete killDict;
   g_s.end();
+
+  delete killDict;
 }
 
 
@@ -11191,7 +10914,7 @@ void parseInput()
   signal(SIGINT, stopDoxygen);
 #endif
 
-  uint pid = portable_pid();
+  uint pid = Portable::pid();
   Doxygen::objDBFileName.sprintf("doxygen_objdb_%d.tmp",pid);
   Doxygen::objDBFileName.prepend(outputDirectory+"/");
   Doxygen::entryDBFileName.sprintf("doxygen_entrydb_%d.tmp",pid);
@@ -11251,18 +10974,18 @@ void parseInput()
     QCString curFontPath = Config_getString(DOT_FONTPATH);
     if (curFontPath.isEmpty())
     {
-      portable_getenv("DOTFONTPATH");
+      Portable::getenv("DOTFONTPATH");
       QCString newFontPath = ".";
       if (!curFontPath.isEmpty())
       {
-        newFontPath+=portable_pathListSeparator();
+        newFontPath+=Portable::pathListSeparator();
         newFontPath+=curFontPath;
       }
-      portable_setenv("DOTFONTPATH",newFontPath);
+      Portable::setenv("DOTFONTPATH",newFontPath);
     }
     else
     {
-      portable_setenv("DOTFONTPATH",curFontPath);
+      Portable::setenv("DOTFONTPATH",curFontPath);
     }
   }
 
@@ -11329,7 +11052,7 @@ void parseInput()
    *             Handle Tag Files                                           *
    **************************************************************************/
 
-  Entry *root=new Entry;
+  std::shared_ptr<Entry> root = std::make_shared<Entry>();
   msg("Reading and parsing tag files\n");
 
   QStrList &tagFileList = Config_getList(TAGFILES);
@@ -11344,10 +11067,7 @@ void parseInput()
    *             Parse source files                                         *
    **************************************************************************/
 
-  if (Config_getBool(BUILTIN_STL_SUPPORT))
-  {
-    addSTLClasses(root);
-  }
+  addSTLSupport(root);
 
   g_s.begin("Parsing files\n");
   parseFiles(root);
@@ -11355,8 +11075,6 @@ void parseInput()
 
   // we are done with input scanning now, so free up the buffers used by flex
   // (can be around 4MB)
-  preFreeScanner();
-  scanFreeScanner();
   pyscanFreeScanner();
 
   /**************************************************************************
@@ -11364,31 +11082,31 @@ void parseInput()
    **************************************************************************/
 
   g_s.begin("Building group list...\n");
-  buildGroupList(root);
-  organizeSubGroups(root);
+  buildGroupList(root.get());
+  organizeSubGroups(root.get());
   g_s.end();
 
   g_s.begin("Building directory list...\n");
   buildDirectories();
-  findDirDocumentation(root);
+  findDirDocumentation(root.get());
   g_s.end();
 
   g_s.begin("Building namespace list...\n");
-  buildNamespaceList(root);
-  findUsingDirectives(root);
+  buildNamespaceList(root.get());
+  findUsingDirectives(root.get());
   g_s.end();
 
   g_s.begin("Building file list...\n");
-  buildFileList(root);
+  buildFileList(root.get());
   g_s.end();
   //generateFileTree();
 
   g_s.begin("Building class list...\n");
-  buildClassList(root);
+  buildClassList(root.get());
   g_s.end();
 
   // build list of using declarations here (global list)
-  buildListOfUsingDecls(root);
+  buildListOfUsingDecls(root.get());
   g_s.end();
 
   g_s.begin("Computing nesting relations for classes...\n");
@@ -11405,14 +11123,14 @@ void parseInput()
   g_usingDeclarations.clear();
 
   g_s.begin("Associating documentation with classes...\n");
-  buildClassDocList(root);
+  buildClassDocList(root.get());
 
   g_s.begin("Building example list...\n");
-  buildExampleList(root);
+  buildExampleList(root.get());
   g_s.end();
 
   g_s.begin("Searching for enumerations...\n");
-  findEnums(root);
+  findEnums(root.get());
   g_s.end();
 
   // Since buildVarList calls isVarWithConstructor
@@ -11420,24 +11138,24 @@ void parseInput()
   // typedefs first so the relations between classes via typedefs
   // are properly resolved. See bug 536385 for an example.
   g_s.begin("Searching for documented typedefs...\n");
-  buildTypedefList(root);
+  buildTypedefList(root.get());
   g_s.end();
 
   if (Config_getBool(OPTIMIZE_OUTPUT_SLICE))
   {
     g_s.begin("Searching for documented sequences...\n");
-    buildSequenceList(root);
+    buildSequenceList(root.get());
     g_s.end();
 
     g_s.begin("Searching for documented dictionaries...\n");
-    buildDictionaryList(root);
+    buildDictionaryList(root.get());
     g_s.end();
   }
 
   g_s.begin("Searching for members imported via using declarations...\n");
   // this should be after buildTypedefList in order to properly import
   // used typedefs
-  findUsingDeclarations(root);
+  findUsingDeclarations(root.get());
   g_s.end();
 
   g_s.begin("Searching for included using directives...\n");
@@ -11445,14 +11163,14 @@ void parseInput()
   g_s.end();
 
   g_s.begin("Searching for documented variables...\n");
-  buildVarList(root);
+  buildVarList(root.get());
   g_s.end();
 
   g_s.begin("Building interface member list...\n");
-  buildInterfaceAndServiceList(root); // UNO IDL
+  buildInterfaceAndServiceList(root.get()); // UNO IDL
 
   g_s.begin("Building member list...\n"); // using class info only !
-  buildFunctionList(root);
+  buildFunctionList(root.get());
   g_s.end();
 
   g_s.begin("Searching for friends...\n");
@@ -11460,11 +11178,11 @@ void parseInput()
   g_s.end();
 
   g_s.begin("Searching for documented defines...\n");
-  findDefineDocumentation(root);
+  findDefineDocumentation(root.get());
   g_s.end();
 
   g_s.begin("Computing class inheritance relations...\n");
-  findClassEntries(root);
+  findClassEntries(root.get());
   findInheritedTemplateInstances();
   g_s.end();
 
@@ -11495,14 +11213,14 @@ void parseInput()
   g_s.end();
 
   g_s.begin("Add enum values to enums...\n");
-  addEnumValuesToEnums(root);
-  findEnumDocumentation(root);
+  addEnumValuesToEnums(root.get());
+  findEnumDocumentation(root.get());
   g_s.end();
 
   g_s.begin("Searching for member function documentation...\n");
-  findObjCMethodDefinitions(root);
-  findMemberDocumentation(root); // may introduce new members !
-  findUsingDeclImports(root); // may introduce new members !
+  findObjCMethodDefinitions(root.get());
+  findMemberDocumentation(root.get()); // may introduce new members !
+  findUsingDeclImports(root.get()); // may introduce new members !
 
   transferRelatedFunctionDocumentation();
   transferFunctionDocumentation();
@@ -11515,21 +11233,21 @@ void parseInput()
   g_s.end();
 
   g_s.begin("Building page list...\n");
-  buildPageList(root);
+  buildPageList(root.get());
   g_s.end();
 
   g_s.begin("Search for main page...\n");
-  findMainPage(root);
-  findMainPageTagFiles(root);
+  findMainPage(root.get());
+  findMainPageTagFiles(root.get());
   g_s.end();
 
   g_s.begin("Computing page relations...\n");
-  computePageRelations(root);
+  computePageRelations(root.get());
   checkPageRelations();
   g_s.end();
 
   g_s.begin("Determining the scope of groups...\n");
-  findGroupScope(root);
+  findGroupScope(root.get());
   g_s.end();
 
   g_s.begin("Sorting lists...\n");
@@ -11665,7 +11383,6 @@ void generateOutput()
   }
 
   initSearchIndexer();
-  initDot();
 
   bool generateHtml  = Config_getBool(GENERATE_HTML);
   bool generateLatex = Config_getBool(GENERATE_LATEX);
@@ -11739,7 +11456,7 @@ void generateOutput()
   g_s.begin("Generating search indices...\n");
   if (searchEngine && !serverBasedSearch && (generateHtml || g_useOutputTemplate))
   {
-    createJavascriptSearchIndex();
+    createJavaScriptSearchIndex();
   }
 
   // generate search indices (need to do this before writing other HTML
@@ -11751,14 +11468,13 @@ void generateOutput()
     QDir searchDir(searchDirName);
     if (!searchDir.exists() && !searchDir.mkdir(searchDirName))
     {
-      err("Could not create search results directory '%s' $PWD='%s'\n",
+      term("Could not create search results directory '%s' $PWD='%s'\n",
           searchDirName.data(),QDir::currentDirPath().data());
-      exit(1);
     }
     HtmlGenerator::writeSearchData(searchDirName);
     if (!serverBasedSearch) // client side search index
     {
-      writeJavascriptSearchIndex();
+      writeJavaScriptSearchIndex();
     }
   }
   g_s.end();
@@ -11890,7 +11606,7 @@ void generateOutput()
       {
         searchDataFile="searchdata.xml";
       }
-      if (!portable_isAbsolutePath(searchDataFile))
+      if (!Portable::isAbsolutePath(searchDataFile))
       {
         searchDataFile.prepend(Config_getString(OUTPUT_DIRECTORY)+"/");
       }
@@ -11952,12 +11668,13 @@ void generateOutput()
     g_s.begin("Running html help compiler...\n");
     QString oldDir = QDir::currentDirPath();
     QDir::setCurrent(Config_getString(HTML_OUTPUT));
-    portable_sysTimerStart();
-    if (portable_system(Config_getString(HHC_LOCATION), "index.hhp", Debug::isFlagSet(Debug::ExtCmd))!=1)
+    Portable::setShortDir();
+    Portable::sysTimerStart();
+    if (Portable::system(Config_getString(HHC_LOCATION), "index.hhp", Debug::isFlagSet(Debug::ExtCmd))!=1)
     {
       err("failed to run html help compiler on index.hhp\n");
     }
-    portable_sysTimerStop();
+    Portable::sysTimerStop();
     QDir::setCurrent(oldDir);
     g_s.end();
   }
@@ -11972,12 +11689,12 @@ void generateOutput()
     QCString const args = QCString().sprintf("%s -o \"%s\"", qhpFileName.data(), qchFileName.data());
     QString const oldDir = QDir::currentDirPath();
     QDir::setCurrent(Config_getString(HTML_OUTPUT));
-    portable_sysTimerStart();
-    if (portable_system(Config_getString(QHG_LOCATION), args.data(), FALSE))
+    Portable::sysTimerStart();
+    if (Portable::system(Config_getString(QHG_LOCATION), args.data(), FALSE))
     {
       err("failed to run qhelpgenerator on index.qhp\n");
     }
-    portable_sysTimerStop();
+    Portable::sysTimerStop();
     QDir::setCurrent(oldDir);
     g_s.end();
   }
@@ -11998,7 +11715,7 @@ void generateOutput()
   {
     msg("Total elapsed time: %.3f seconds\n(of which %.3f seconds waiting for external tools to finish)\n",
          ((double)Doxygen::runningTime.elapsed())/1000.0,
-         portable_getSysElapsedTime()
+         Portable::getSysElapsedTime()
         );
     g_s.print();
   }
@@ -12014,7 +11731,7 @@ void generateOutput()
 
   cleanUpDoxygen();
 
-  finializeSearchIndexer();
+  finalizeSearchIndexer();
 //  Doxygen::symbolStorage->close();
   QDir thisDir;
   thisDir.remove(Doxygen::objDBFileName);
index c8eee7c..a23a678 100644 (file)
@@ -60,6 +60,7 @@ class FormulaList;
 class FormulaDict;
 class FormulaNameDict;
 class SectionDict;
+class Preprocessor;
 struct MemberGroupInfo;
 
 typedef QList<QCString>    StringList;
@@ -152,6 +153,7 @@ class Doxygen
     static bool                      markdownSupport;
     static GenericsSDict            *genericsDict;
     static DocGroup                  docGroup;
+    static Preprocessor             *preprocessor;
 };
 
 void initDoxygen();
index 7680a94..c124e09 100644 (file)
@@ -188,7 +188,7 @@ Topics TODO
   - Qt Help (qhp)
   - Eclipse Help
 - Search index
-  - Javascript based
+  - JavaScript based
   - Server based
   - External
 - Citations
index dab001a..bbb3b01 100644 (file)
@@ -72,8 +72,7 @@ void EclipseHelp::initialize()
   m_tocfile = new QFile(name);
   if (!m_tocfile->open(IO_WriteOnly)) 
   {
-    err("Could not open file %s for writing\n", name.data());
-    exit(1);
+    term("Could not open file %s for writing\n", name.data());
   }
 
   // -- initialize its text stream
@@ -115,7 +114,7 @@ void EclipseHelp::finalize()
   QFile pluginFile(name);
   if (pluginFile.open(IO_WriteOnly))
   {
-    QString docId = Config_getString(ECLIPSE_DOC_ID);
+    QCString docId = Config_getString(ECLIPSE_DOC_ID);
     FTextStream t(&pluginFile);
     t << "<plugin name=\""  << docId << "\" id=\"" << docId << "\"" << endl;
     t << "        version=\"1.0.0\" provider-name=\"Doxygen\">" << endl;
index e2a21c6..cc8cd1f 100644 (file)
@@ -15,6 +15,7 @@
  *
  */
 
+#include <algorithm>
 #include <stdlib.h>
 #include <qfile.h>
 #include "entry.h"
@@ -37,21 +38,9 @@ Entry::Entry()
   num++;
   m_parent=0;
   section = EMPTY_SEC;
-  m_sublist = new QList<Entry>;
-  m_sublist->setAutoDelete(TRUE);
-  extends = new QList<BaseInfo>;
-  extends->setAutoDelete(TRUE);
-  groups = new QList<Grouping>;
-  groups->setAutoDelete(TRUE);
-  anchors = new QList<SectionInfo>; // Doxygen::sectionDict takes ownership of the items!
-  argList = new ArgumentList;
-  argList->setAutoDelete(TRUE);
   //printf("Entry::Entry() tArgList=0\n");
-  tArgLists = 0;
-  typeConstr = 0;
   mGrpId = -1;
-  tagInfo = 0;
-  sli = 0;
+  hasTagInfo = FALSE;
   relatesType = Simple;
   hidden = FALSE;
   groupDocType = GROUPDOC_NORMAL;
@@ -65,7 +54,8 @@ Entry::Entry(const Entry &e)
   section     = e.section;
   type        = e.type;
   name        = e.name;
-  tagInfo     = e.tagInfo;
+  hasTagInfo  = e.hasTagInfo;
+  tagInfoData = e.tagInfoData;
   protection  = e.protection;
   mtype       = e.mtype;
   spec        = e.spec;
@@ -82,8 +72,8 @@ Entry::Entry(const Entry &e)
   virt        = e.virt;
   args        = e.args;
   bitfields   = e.bitfields;
-  argList     = e.argList->deepCopy();
-  tArgLists = 0;
+  argList     = e.argList;
+  tArgLists   = e.tArgLists;
   program     = e.program;
   initializer = e.initializer;
   includeFile = e.includeFile;
@@ -103,88 +93,31 @@ Entry::Entry(const Entry &e)
   write       = e.write;
   inside      = e.inside;
   exception   = e.exception;
-  typeConstr  = 0;
+  typeConstr  = e.typeConstr;
   bodyLine    = e.bodyLine;
   endBodyLine = e.endBodyLine;
   mGrpId      = e.mGrpId;
-  extends     = new QList<BaseInfo>;
-  extends->setAutoDelete(TRUE);
-  groups      = new QList<Grouping>;
-  groups->setAutoDelete(TRUE);
-  anchors     = new QList<SectionInfo>;
+  anchors     = e.anchors;
   fileName    = e.fileName;
   startLine   = e.startLine;
   startColumn = e.startColumn;
-  if (e.sli)
-  {
-    sli = new QList<ListItemInfo>;
-    sli->setAutoDelete(TRUE);
-    QListIterator<ListItemInfo> slii(*e.sli);
-    ListItemInfo *ili;
-    for (slii.toFirst();(ili=slii.current());++slii)
-    {
-      sli->append(new ListItemInfo(*ili));
-    }
-  }
-  else
-  {
-    sli=0;
-  }
+  sli         = e.sli;
   lang        = e.lang;
   hidden      = e.hidden;
   artificial  = e.artificial;
   groupDocType = e.groupDocType;
   id          = e.id;
+  extends     = e.extends;
+  groups      = e.groups;
+  m_fileDef   = e.m_fileDef;
 
   m_parent    = e.m_parent;
-  m_sublist   = new QList<Entry>;
-  m_sublist->setAutoDelete(TRUE);
-
-  // deep copy of the child entry list
-  QListIterator<Entry> eli(*e.m_sublist);
-  Entry *cur;
-  for (;(cur=eli.current());++eli)
-  {
-    m_sublist->append(new Entry(*cur));
-  }
-  
-  // deep copy base class list
-  QListIterator<BaseInfo> bli(*e.extends);
-  BaseInfo *bi;
-  for (;(bi=bli.current());++bli)
+  // deep copy child entries
+  m_sublist.reserve(e.m_sublist.size());
+  for (const auto &cur : e.m_sublist)
   {
-    extends->append(new BaseInfo(*bi));
+    m_sublist.push_back(std::make_shared<Entry>(*cur));
   }
-  
-  // deep copy group list
-  QListIterator<Grouping> gli(*e.groups);
-  Grouping *g;
-  for (;(g=gli.current());++gli)
-  {
-    groups->append(new Grouping(*g));
-  }
-  
-  QListIterator<SectionInfo> sli2(*e.anchors);
-  SectionInfo *s;
-  for (;(s=sli2.current());++sli2)
-  {
-    anchors->append(s); // shallow copy, object are owned by Doxygen::sectionDict
-  }
-
-  // deep copy type constraint list
-  if (e.typeConstr)
-  {
-    typeConstr  = e.typeConstr->deepCopy();
-  }
-
-  // deep copy template argument lists
-  if (e.tArgLists)
-  {
-    tArgLists = copyArgumentLists(e.tArgLists);
-  }
-
-  m_fileDef = e.m_fileDef;
-
 }
 
 Entry::~Entry()
@@ -192,31 +125,76 @@ Entry::~Entry()
   //printf("Entry::~Entry(%p) num=%d\n",this,num);
   //printf("Deleting entry %d name %s type %x children %d\n",
   //       num,name.data(),section,sublist->count());
-  
-  delete m_sublist; // each element is now own by a EntryNav so we do no longer own
-                  // our children.
-  delete extends;
-  delete groups;
-  delete anchors;
-  delete argList;
-  delete tArgLists;
-  delete tagInfo;
-  delete typeConstr;
-  delete sli;
+
   num--;
 }
 
-void Entry::addSubEntry(Entry *current)
+void Entry::moveToSubEntryAndRefresh(Entry *&current)
 {
-  //printf("Entry %d with name %s type 0x%x added to %s type 0x%x\n",
-  //    current->num,current->name.data(),current->section,
-  //    name.data(),section);
-  //printf("Entry::addSubEntry(%s:%p) to %s\n",current->name.data(),
-  //    current,name.data());
   current->m_parent=this;
-  m_sublist->append(current);  
+  m_sublist.emplace_back(current);
+  current = new Entry;
 }
 
+void Entry::moveToSubEntryAndRefresh(std::shared_ptr<Entry> &current)
+{
+  current->m_parent=this;
+  m_sublist.push_back(current);
+  current = std::make_shared<Entry>();
+}
+
+void Entry::moveToSubEntryAndKeep(Entry *current)
+{
+  current->m_parent=this;
+  m_sublist.emplace_back(current);
+}
+
+void Entry::moveToSubEntryAndKeep(std::shared_ptr<Entry> &current)
+{
+  current->m_parent=this;
+  m_sublist.push_back(current);
+}
+
+void Entry::copyToSubEntry(Entry *current)
+{
+  Entry *copy = new Entry(*current);
+  copy->m_parent=this;
+  m_sublist.emplace_back(copy);
+}
+
+void Entry::copyToSubEntry(const std::shared_ptr<Entry> &current)
+{
+  std::shared_ptr<Entry> copy = std::make_shared<Entry>(*current);
+  copy->m_parent=this;
+  m_sublist.push_back(copy);
+}
+
+void Entry::moveFromSubEntry(const Entry *child,std::shared_ptr<Entry> &moveTo)
+{
+  auto it = std::find_if(m_sublist.begin(),m_sublist.end(),
+      [child](const std::shared_ptr<Entry>&elem) { return elem.get()==child; });
+  if (it!=m_sublist.end())
+  {
+    moveTo = *it;
+    m_sublist.erase(it);
+  }
+  else
+  {
+    moveTo.reset();
+  }
+}
+
+void Entry::removeSubEntry(const Entry *e)
+{
+  auto it = std::find_if(m_sublist.begin(),m_sublist.end(),
+      [e](const std::shared_ptr<Entry>&elem) { return elem.get()==e; });
+  if (it!=m_sublist.end())
+  {
+    m_sublist.erase(it);
+  }
+}
+
+
 void Entry::reset()
 {
   static bool entryCallGraph   = Config_getBool(CALL_GRAPH);
@@ -271,56 +249,34 @@ void Entry::reset()
   groupDocType = GROUPDOC_NORMAL;
   id.resize(0);
   metaData.resize(0);
-  m_sublist->clear();
-  extends->clear();
-  groups->clear();
-  anchors->clear();
-  argList->clear();
-  if (tagInfo)    { delete tagInfo; tagInfo=0; }
-  if (tArgLists)  { delete tArgLists; tArgLists=0; }
-  if (sli)        { delete sli; sli=0; }
-  if (typeConstr) { delete typeConstr; typeConstr=0; }
-  //if (mtArgList) { delete mtArgList; mtArgList=0; }
+  m_sublist.clear();
+  extends.clear();
+  groups.clear();
+  anchors.clear();
+  argList.clear();
+  tArgLists.clear();
+  argList.reset();
+  typeConstr.reset();
+  sli.clear();
   m_fileDef = 0;
 }
 
-
-int Entry::getSize()
-{
-  return sizeof(Entry);
-}
-
 void Entry::setFileDef(FileDef *fd)
 {
   m_fileDef = fd;
-  if (m_sublist)
+  for (const auto &childNode : m_sublist)
   {
-    QListIterator<Entry> eli(*m_sublist);
-    Entry *childNode;
-    for (eli.toFirst();(childNode=eli.current());++eli)
-    {
       childNode->setFileDef(fd);
-    }
   }
 }
 
 void Entry::addSpecialListItem(const char *listName,int itemId)
 {
-  if (sli==0)
-  {
-    sli = new QList<ListItemInfo>;
-    sli->setAutoDelete(TRUE);
-  }
-  ListItemInfo *ili=new ListItemInfo;
-  ili->type = listName;
-  ili->itemId = itemId;
-  sli->append(ili);
+  ListItemInfo ili;
+  ili.type = listName;
+  ili.itemId = itemId;
+  sli.push_back(ili);
 }
 
-Entry *Entry::removeSubEntry(Entry *e)
-{
- int i = m_sublist->find(e);
- return i!=-1 ? m_sublist->take(i) : 0;
-}
 
 //------------------------------------------------------------------
index 6dfa0c6..0391075 100644 (file)
 #ifndef ENTRY_H
 #define ENTRY_H
 
-#include "types.h"
-
-#include <qlist.h>
 #include <qgstring.h>
 
+#include <vector>
+#include <memory>
+
+#include "types.h"
+#include "arguments.h"
+
 struct SectionInfo;
 class QFile;
 class FileDef;
-class FileStorage;
-class StorageIntf;
-class ArgumentList;
 struct ListItemInfo;
 
 /** This class stores information about an inheritance relation
@@ -194,47 +194,56 @@ class Entry
     Entry(const Entry &);
    ~Entry();
 
-    /*! Returns the static size of the Entry (so excluding any dynamic memory) */
-    int getSize();
-
     void addSpecialListItem(const char *listName,int index);
 
-    // while parsing a file these function can be used to navigate/build the tree
-    void setParent(Entry *parent) { m_parent = parent; }
-
     /*! Returns the parent for this Entry or 0 if this entry has no parent. */
     Entry *parent() const { return m_parent; }
 
     /*! Returns the list of children for this Entry
      *  @see addSubEntry() and removeSubEntry()
      */
-    const QList<Entry> *children() const { return m_sublist; }
+    const std::vector< std::shared_ptr<Entry> > &children() const { return m_sublist; }
 
-    /*! Adds entry \a e as a child to this entry */
-    void addSubEntry (Entry* e) ;
+    /*! @name add entry as a child and pass ownership.
+     *  @note This makes the entry passed invalid! (TODO: tclscanner.l still has use after move!)
+     *  @{
+     */
+    void moveToSubEntryAndKeep(Entry* e);
+    void moveToSubEntryAndKeep(std::shared_ptr<Entry> &e);
+    /*! @} */
+
+    /*! @name add entry as a child, pass ownership and reinitialize entry */
+    void moveToSubEntryAndRefresh(Entry* &e);
+    void moveToSubEntryAndRefresh(std::shared_ptr<Entry> &e);
+
+    /*! take \a child of of to list of children and move it into \a moveTo */
+    void moveFromSubEntry(const Entry *child,std::shared_ptr<Entry> &moveTo);
+
+    /*! make a copy of \a e and add it as a child to this entry */
+    void copyToSubEntry (Entry* e);
+    void copyToSubEntry (const std::shared_ptr<Entry> &e);
 
     /*! Removes entry \a e from the list of children.
-     *  Returns a pointer to the entry or 0 if the entry was not a child.
-     *  Note the entry will not be deleted.
+     *  The entry will be deleted if found.
      */
-    Entry *removeSubEntry(Entry *e);
+    void removeSubEntry(const Entry *e);
 
     /*! Restore the state of this Entry to the default value it has
      *  at construction time.
      */
     void reset();
 
-    void changeSection(int sec) { section = sec; }
+    void markAsProcessed() const { ((Entry*)(this))->section = Entry::EMPTY_SEC; }
     void setFileDef(FileDef *fd);
     FileDef *fileDef() const { return m_fileDef; }
 
-  public:
-
     // identification
     int          section;     //!< entry type (see Sections);
     QCString    type;        //!< member type
     QCString    name;        //!< member name
-    TagInfo     *tagInfo;     //!< tag file info
+    bool         hasTagInfo;  //!< is tag info valid
+    TagInfo      tagInfoData; //!< tag file info data
+    const TagInfo *tagInfo() const { return hasTagInfo ? &tagInfoData : 0; }
 
     // content
     Protection protection;    //!< class protection
@@ -252,8 +261,8 @@ class Entry
     Specifier    virt;        //!< virtualness of the entry
     QCString     args;        //!< member argument string
     QCString     bitfields;   //!< member's bit fields
-    ArgumentList *argList;    //!< member arguments as a list
-    QList<ArgumentList> *tArgLists; //!< template argument declarations
+    ArgumentList argList;     //!< member arguments as a list
+    std::vector<ArgumentList> tArgLists; //!< template argument declarations
     QGString    program;     //!< the program text
     QGString     initializer; //!< initial value (for variables)
     QCString     includeFile; //!< include file (2 arg of \\class, must be unique)
@@ -273,17 +282,17 @@ class Entry
     QCString     write;       //!< property write accessor
     QCString     inside;      //!< name of the class in which documents are found
     QCString     exception;   //!< throw specification
-    ArgumentList *typeConstr; //!< where clause (C#) for type constraints
+    ArgumentList typeConstr;  //!< where clause (C#) for type constraints
     int          bodyLine;    //!< line number of the definition in the source
     int          endBodyLine; //!< line number where the definition ends
     int          mGrpId;      //!< member group id
-    QList<BaseInfo> *extends; //!< list of base classes
-    QList<Grouping> *groups;  //!< list of groups this entry belongs to
-    QList<SectionInfo> *anchors; //!< list of anchors defined in this entry
+    std::vector<BaseInfo> extends; //!< list of base classes
+    std::vector<Grouping> groups;  //!< list of groups this entry belongs to
+    std::vector<const SectionInfo*> anchors; //!< list of anchors defined in this entry
     QCString   fileName;     //!< file this entry was extracted from
     int                startLine;    //!< start line of entry in the source
     int                startColumn;  //!< start column of entry in the source
-    QList<ListItemInfo> *sli; //!< special lists (test/todo/bug/deprecated/..) this entry is in
+    std::vector<ListItemInfo> sli; //!< special lists (test/todo/bug/deprecated/..) this entry is in
     SrcLangExt  lang;         //!< programming language in which this entry was found
     bool        hidden;       //!< does this represent an entity that is hidden from the output
     bool        artificial;   //!< Artificially introduced item
@@ -323,12 +332,9 @@ class Entry
 
   private:
     Entry         *m_parent;    //!< parent node in the tree
-    QList<Entry>  *m_sublist;   //!< entries that are children of this one
+    std::vector< std::shared_ptr<Entry> > m_sublist;
     Entry &operator=(const Entry &);
     FileDef       *m_fileDef;
 };
 
-typedef QList<Entry> EntryList;
-typedef QListIterator<Entry> EntryListIterator;
-
 #endif
index 9a82c8a..fb0e290 100644 (file)
@@ -312,14 +312,14 @@ void FileDefImpl::distributeMemberGroupDocumentation()
 
 void FileDefImpl::findSectionsInDocumentation()
 {
-  docFindSections(documentation(),this,0,docFile());
+  docFindSections(documentation(),this,docFile());
   if (m_memberGroupSDict)
   {
     MemberGroupSDict::Iterator mgli(*m_memberGroupSDict);
     MemberGroup *mg;
     for (;(mg=mgli.current());++mgli)
     {
-      mg->findSectionsInDocumentation();
+      mg->findSectionsInDocumentation(this);
     }
   }
 
@@ -329,7 +329,7 @@ void FileDefImpl::findSectionsInDocumentation()
   {
     if (ml->listType()&MemberListType_declarationLists)
     {
-      ml->findSectionsInDocumentation();
+      ml->findSectionsInDocumentation(this);
     }
   }
 }
@@ -349,7 +349,7 @@ void FileDefImpl::writeTagFile(FTextStream &tagFile)
   tagFile << "  <compound kind=\"file\">" << endl;
   tagFile << "    <name>" << convertToXML(name()) << "</name>" << endl;
   tagFile << "    <path>" << convertToXML(getPath()) << "</path>" << endl;
-  tagFile << "    <filename>" << convertToXML(getOutputFileBase()) << "</filename>" << endl;
+  tagFile << "    <filename>" << convertToXML(addHtmlExtensionIfMissing(getOutputFileBase())) << "</filename>" << endl;
   if (m_includeList && m_includeList->count()>0)
   {
     QListIterator<IncludeInfo> ili(*m_includeList);
@@ -664,7 +664,8 @@ void FileDefImpl::writeIncludeGraph(OutputList &ol)
     DotInclDepGraph incDepGraph(this,FALSE);
     if (incDepGraph.isTooBig())
     {
-       warn_uncond("Include graph for '%s' not generated, too many nodes. Consider increasing DOT_GRAPH_MAX_NODES.\n",name().data());
+       warn_uncond("Include graph for '%s' not generated, too many nodes (%d), threshold is %d. Consider increasing DOT_GRAPH_MAX_NODES.\n",
+           name().data(), incDepGraph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
     }
     else if (!incDepGraph.isTrivial())
     {
@@ -688,7 +689,8 @@ void FileDefImpl::writeIncludedByGraph(OutputList &ol)
     DotInclDepGraph incDepGraph(this,TRUE);
     if (incDepGraph.isTooBig())
     {
-       warn_uncond("Included by graph for '%s' not generated, too many nodes. Consider increasing DOT_GRAPH_MAX_NODES.\n",name().data());
+       warn_uncond("Included by graph for '%s' not generated, too many nodes (%d), threshold is %d. Consider increasing DOT_GRAPH_MAX_NODES.\n",
+           name().data(), incDepGraph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
     }
     else if (!incDepGraph.isTrivial())
     {
@@ -735,7 +737,7 @@ void FileDefImpl::writeClassDeclarations(OutputList &ol,const QCString &title,Cl
 
 void FileDefImpl::writeInlineClasses(OutputList &ol)
 {
-  // temporarily undo the disbling could be done by startMemberDocumentation()
+  // temporarily undo the disabling could be done by startMemberDocumentation()
   // as a result of setting SEPARATE_MEMBER_PAGES to YES; see bug730512
   bool isEnabled = ol.isEnabled(OutputGenerator::Html);
   ol.enable(OutputGenerator::Html);
@@ -1231,8 +1233,8 @@ void FileDefImpl::writeSource(OutputList &ol,bool sameTu,QStrList &filesInSameTu
   else
 #endif
   {
-    ParserInterface *pIntf = Doxygen::parserManager->getParser(getDefFileExtension());
-    pIntf->resetCodeParserState();
+    CodeParserInterface &intf = Doxygen::parserManager->getCodeParser(getDefFileExtension());
+    intf.resetCodeParserState();
     ol.startCodeFragment();
     bool needs2PassParsing = 
         Doxygen::parseSourcesNeeded &&                // we need to parse (filtered) sources for cross-references
@@ -1242,13 +1244,13 @@ void FileDefImpl::writeSource(OutputList &ol,bool sameTu,QStrList &filesInSameTu
     if (needs2PassParsing)
     {
       // parse code for cross-references only (see bug707641)
-      pIntf->parseCode(devNullIntf,0,
+      intf.parseCode(devNullIntf,0,
                        fileToString(absFilePath(),TRUE,TRUE),
                        getLanguage(),
                        FALSE,0,this
                       );
     }
-    pIntf->parseCode(ol,0,
+    intf.parseCode(ol,0,
         fileToString(absFilePath(),filterSourceFiles,TRUE),
         getLanguage(),      // lang
         FALSE,              // isExampleBlock
@@ -1293,9 +1295,9 @@ void FileDefImpl::parseSource(bool sameTu,QStrList &filesInSameTu)
   else
 #endif
   {
-    ParserInterface *pIntf = Doxygen::parserManager->getParser(getDefFileExtension());
-    pIntf->resetCodeParserState();
-    pIntf->parseCode(
+    CodeParserInterface &intf = Doxygen::parserManager->getCodeParser(getDefFileExtension());
+    intf.resetCodeParserState();
+    intf.parseCode(
             devNullIntf,0,
             fileToString(absFilePath(),filterSourceFiles,TRUE),
             getLanguage(),
@@ -1680,7 +1682,7 @@ bool FileDefImpl::generateSourceFile() const
 void FileDefImpl::addListReferences()
 {
   {
-    QList<ListItemInfo> *xrefItems = xrefListItems();
+    const std::vector<ListItemInfo> &xrefItems = xrefListItems();
     addRefItem(xrefItems,
                getOutputFileBase(),
                theTranslator->trFile(TRUE,TRUE),
@@ -2013,7 +2015,7 @@ void FileDefImpl::acquireFileVersion()
     msg("Version of %s : ",m_filePath.data());
     QCString cmd = vercmd+" \""+m_filePath+"\"";
     Debug::print(Debug::ExtCmd,0,"Executing popen(`%s`)\n",qPrint(cmd));
-    FILE *f=portable_popen(cmd,"r");
+    FILE *f=Portable::popen(cmd,"r");
     if (!f)
     {
       err("could not execute %s\n",vercmd.data());
@@ -2022,7 +2024,7 @@ void FileDefImpl::acquireFileVersion()
     const int bufSize=1024;
     char buf[bufSize];
     int numRead = (int)fread(buf,1,bufSize-1,f);
-    portable_pclose(f);
+    Portable::pclose(f);
     if (numRead>0 && numRead<bufSize)
     {
       buf[numRead]='\0';
@@ -2098,7 +2100,7 @@ void FileDefImpl::addMemberToList(MemberListType lt,MemberDef *md)
   {
     ml->setInFile(TRUE);
   }
-  if (ml->listType()&MemberListType_declarationLists) md->setSectionList(this,ml);
+  if (ml->listType()&MemberListType_declarationLists) md->setSectionList(ml);
 }
 
 void FileDefImpl::sortMemberLists()
index 45bdc81..34085dc 100644 (file)
@@ -16,7 +16,7 @@
 #include "fileparser.h"
 #include "outputgen.h"
 
-void FileParser::parseCode(CodeOutputInterface &codeOutIntf,
+void FileCodeParser::parseCode(CodeOutputInterface &codeOutIntf,
                const char *,     // scopeName
                const QCString &     input,
                SrcLangExt,       // lang
index 4b311e6..3245878 100644 (file)
 
 #include "parserintf.h"
 
-/** @brief General file parser */
-class FileParser : public ParserInterface
+/** @brief Generic code parser */
+class FileCodeParser : public CodeParserInterface
 {
   public:
-    virtual ~FileParser() {}
-    void startTranslationUnit(const char *) {}
-    void finishTranslationUnit() {}
-    void parseInput(const char *, const char *,Entry *, bool, QStrList &) {}
-    bool needsPreprocessing(const QCString &) { return FALSE; }
+    virtual ~FileCodeParser() {}
     void parseCode(CodeOutputInterface &codeOutIntf,
                    const char *scopeName,
                    const QCString &input,
@@ -43,8 +39,6 @@ class FileParser : public ParserInterface
                    bool collectXRefs=TRUE
                   );
     void resetCodeParserState() {}
-    void parsePrototype(const char *) {}
 };
 
-
 #endif
index 1c5042e..64555c9 100644 (file)
@@ -51,8 +51,20 @@ void FormulaList::generateBitmaps(const char *path)
   int x1,y1,x2,y2;
   QDir d(path);
   // store the original directory
-  if (!d.exists()) { err("Output dir %s does not exist!\n",path); exit(1); }
+  if (!d.exists())
+  {
+    term("Output dir %s does not exist!\n",path);
+  }
   QCString oldDir = QDir::currentDirPath().utf8();
+  QCString macroFile = Config_getString(FORMULA_MACROFILE);
+  QCString stripMacroFile;
+  if (!macroFile.isEmpty())
+  {
+    QFileInfo fi(macroFile);
+    macroFile=fi.absFilePath().utf8();
+    stripMacroFile = fi.fileName().data();
+  }
+
   // go to the html output directory (i.e. path)
   QDir::setCurrent(d.absPath());
   QDir thisDir;
@@ -74,6 +86,11 @@ void FormulaList::generateBitmaps(const char *path)
     t << "\\usepackage[utf8]{inputenc}" << endl; // looks like some older distributions with newunicode package 1.1 need this option.
     writeExtraLatexPackages(t);
     writeLatexSpecialFormulaChars(t);
+    if (!macroFile.isEmpty())
+    {
+      copyFile(macroFile,stripMacroFile);
+      t << "\\input{" << stripMacroFile << "}" << endl;
+    }
     t << "\\pagestyle{empty}" << endl; 
     t << "\\begin{document}" << endl;
     int page=0;
@@ -100,15 +117,15 @@ void FormulaList::generateBitmaps(const char *path)
     //printf("Running latex...\n");
     //system("latex _formulas.tex </dev/null >/dev/null");
     QCString latexCmd = "latex";
-    portable_sysTimerStart();
-    if (portable_system(latexCmd,"_formulas.tex")!=0)
+    Portable::sysTimerStart();
+    if (Portable::system(latexCmd,"_formulas.tex")!=0)
     {
       err("Problems running latex. Check your installation or look "
           "for typos in _formulas.tex and check _formulas.log!\n");
       formulaError=TRUE;
       //return;
     }
-    portable_sysTimerStop();
+    Portable::sysTimerStop();
     //printf("Running dvips...\n");
     QListIterator<int> pli(pagesToGenerate);
     int *pagePtr;
@@ -118,21 +135,34 @@ void FormulaList::generateBitmaps(const char *path)
       int pageNum=*pagePtr;
       msg("Generating image form_%d.png for formula\n",pageNum);
       char dviArgs[4096];
+      char psArgs[4096];
       QCString formBase;
       formBase.sprintf("_form%d",pageNum);
       // run dvips to convert the page with number pageIndex to an
-      // encapsulated postscript.
-      sprintf(dviArgs,"-q -D 600 -E -n 1 -p %d -o %s.eps _formulas.dvi",
+      // postscript file.
+      sprintf(dviArgs,"-q -D 600 -n 1 -p %d -o %s_tmp.ps _formulas.dvi",
           pageIndex,formBase.data());
-      portable_sysTimerStart();
-      if (portable_system("dvips",dviArgs)!=0)
+      Portable::sysTimerStart();
+      if (Portable::system("dvips",dviArgs)!=0)
       {
         err("Problems running dvips. Check your installation!\n");
-        portable_sysTimerStop();
+        Portable::sysTimerStop();
+        QDir::setCurrent(oldDir);
+        return;
+      }
+      Portable::sysTimerStop();
+      // run ps2epsi to convert to an encapsulated postscript file with
+      // boundingbox (dvips with -E has some problems here).
+      sprintf(psArgs,"%s_tmp.ps %s.eps",formBase.data(),formBase.data()); 
+      Portable::sysTimerStart();
+      if (Portable::system("ps2epsi",psArgs)!=0)
+      {
+        err("Problems running ps2epsi. Check your installation!\n");
+        Portable::sysTimerStop();
         QDir::setCurrent(oldDir);
         return;
       }
-      portable_sysTimerStop();
+      Portable::sysTimerStop();
       // now we read the generated postscript file to extract the bounding box
       QFileInfo fi(formBase+".eps");
       if (fi.exists())
@@ -180,20 +210,20 @@ void FormulaList::generateBitmaps(const char *path)
       // used.  
 
       char gsArgs[4096];
-      sprintf(gsArgs,"-q -g%dx%d -r%dx%dx -sDEVICE=ppmraw "
-                    "-sOutputFile=%s.pnm -dNOPAUSE -dBATCH -- %s.ps",
+      sprintf(gsArgs,"-q -g%dx%d -r%dx%d -sDEVICE=ppmraw "
+                    "-sOutputFile=%s.pnm -dNOPAUSE -dBATCH -dNOSAFER %s.ps",
                     gx,gy,(int)(scaleFactor*72),(int)(scaleFactor*72),
                     formBase.data(),formBase.data()
              );
-      portable_sysTimerStart();
-      if (portable_system(portable_ghostScriptCommand(),gsArgs)!=0)
+      Portable::sysTimerStart();
+      if (Portable::system(Portable::ghostScriptCommand(),gsArgs)!=0)
       {
-        err("Problem running ghostscript %s %s. Check your installation!\n",portable_ghostScriptCommand(),gsArgs);
-        portable_sysTimerStop();
+        err("Problem running ghostscript %s %s. Check your installation!\n",Portable::ghostScriptCommand(),gsArgs);
+        Portable::sysTimerStop();
         QDir::setCurrent(oldDir);
         return;
       }
-      portable_sysTimerStop();
+      Portable::sysTimerStop();
       f.setName(formBase+".pnm");
       uint imageX=0,imageY=0;
       // we read the generated image again, to obtain the pixel data.
@@ -282,6 +312,7 @@ void FormulaList::generateBitmaps(const char *path)
         f.close();
       } 
       // remove intermediate image files
+      thisDir.remove(formBase+"_tmp.ps");
       thisDir.remove(formBase+".eps");
       thisDir.remove(formBase+".pnm");
       thisDir.remove(formBase+".ps");
@@ -303,7 +334,7 @@ void FormulaList::generateBitmaps(const char *path)
     FTextStream t(&f);
     for (fli.toFirst();(formula=fli.current());++fli)
     {
-      t << "\\form#" << formula->getId() << ":" << formula->getFormulaText() << endl;
+      t << "\\_form#" << formula->getId() << ":" << formula->getFormulaText() << endl;
     }
     f.close();
   }
index 4df20a9..8391a0b 100644 (file)
@@ -18,7 +18,7 @@
 #ifndef FORTRANCODE_H
 #define FORTRANCODE_H
 
-#include "types.h"
+#include "parserintf.h"
 
 class CodeOutputInterface;
 class FileDef;
@@ -26,13 +26,45 @@ class MemberDef;
 class QCString;
 class Definition;
 
-void parseFortranCode(CodeOutputInterface &,const char *,const QCString &, 
-            bool ,const char *,FileDef *fd,
-            int startLine,int endLine,bool inlineFragment,
-            const MemberDef *memberDef,bool showLineNumbers,const Definition *searchCtx,
-            bool collectRefs, FortranFormat format);
-void resetFortranCodeParserState();
 void codeFreeScanner();
 
 const int fixedCommentAfter = 72;
+
+class FortranCodeParser : public CodeParserInterface
+{
+  public:
+    FortranCodeParser(FortranFormat format=FortranFormat_Unknown) : m_format(format) { }
+    void parseCode(CodeOutputInterface &codeOutIntf,
+                   const char *scopeName,
+                   const QCString &input,
+                   SrcLangExt lang,
+                   bool isExampleBlock,
+                   const char *exampleName=0,
+                   FileDef *fileDef=0,
+                   int startLine=-1,
+                   int endLine=-1,
+                   bool inlineFragment=FALSE,
+                   const MemberDef *memberDef=0,
+                   bool showLineNumbers=TRUE,
+                   const Definition *searchCtx=0,
+                   bool collectXRefs=TRUE
+                  );
+    void resetCodeParserState();
+
+  private:
+    FortranFormat m_format;
+};
+
+class FortranCodeParserFree : public FortranCodeParser
+{
+  public:
+    FortranCodeParserFree() : FortranCodeParser(FortranFormat_Free) { }
+};
+
+class FortranCodeParserFixed : public FortranCodeParser
+{
+  public:
+    FortranCodeParserFixed() : FortranCodeParser(FortranFormat_Fixed) { }
+};
+
 #endif
index 3e443b5..c4532f3 100644 (file)
@@ -17,7 +17,7 @@
  */
 
 /**
- @todo - continutation lines not always recognized
+ @todo - continuation lines not always recognized
        - merging of use-statements with same module name and different only-names
        - rename part of use-statement
        - links to interface functions 
@@ -166,6 +166,8 @@ static int           inTypeDecl = 0;
 
 static bool      g_endComment;
 
+static const char *stateToString(int state);
+
 static void endFontClass()
 {
   if (g_currentFontClass)
@@ -381,7 +383,7 @@ static bool getFortranNamespaceDefs(const QCString &mname,
   @param tname the name of the type
   @param moduleName name of enclosing module or null, if global entry
   @param cd the entry, if found or null
-  @param useDict dictionary of data of USE-statement
+  @param usedict dictionary of data of USE-statement
   @returns true, if type is found 
 */
 static bool getFortranTypeDefs(const QCString &tname, const QCString &moduleName, 
@@ -519,7 +521,7 @@ static bool getGenericProcedureLink(const ClassDef *cd,
   return FALSE;
 }
 
-static bool getLink(UseSDict *usedict, // dictonary with used modules
+static bool getLink(UseSDict *usedict, // dictionary with used modules
                     const char *memberText,  // exact member text
                    CodeOutputInterface &ol,
                    const char *text)
@@ -969,7 +971,7 @@ LANGUAGE_BIND_SPEC BIND{BS}"("{BS}C{BS}(,{BS}NAME{BS}"="{BS}"\""(.*)"\""{BS})?")
 <Start>{TYPE_SPEC}/[,:( ]               { 
                                           QCString typ = yytext;
                                           typ = removeRedundantWhiteSpace(typ.lower());
-                                          if (QString(typ).startsWith("real")) YY_FTN_REJECT;
+                                          if (typ.startsWith("real")) YY_FTN_REJECT;
                                           if (typ == "type" || typ == "class" || typ == "procedure") inTypeDecl = 1;
                                           yy_push_state(YY_START);
                                          BEGIN(Declaration);
@@ -1248,7 +1250,7 @@ LANGUAGE_BIND_SPEC BIND{BS}"("{BS}C{BS}(,{BS}NAME{BS}"="{BS}"\""(.*)"\""{BS})?")
                                           else
                                           {
                                             codifyLines(yytext);
-                                            // comment cannot extend over the end of a line so should always be terminatd at the end of the line.
+                                            // comment cannot extend over the end of a line so should always be terminated at the end of the line.
                                             if (g_currentFontClass && !strcmp(g_currentFontClass,"comment")) endFontClass();
                                           }
                                          g_contLineNr++;
@@ -1393,15 +1395,34 @@ void parseFortranCode(CodeOutputInterface &od,const char *,const QCString &s,
   return;
 }
 
-#if !defined(YY_FLEX_SUBMINOR_VERSION)
-extern "C" { // some bogus code to keep the compiler happy
-  void fortrancodeYYdummy() { yy_flex_realloc(0,0); }
+//---------------------------------------------------------
+
+void FortranCodeParser::parseCode(CodeOutputInterface & codeOutIntf,
+                   const char * scopeName,
+                   const QCString & input,
+                   SrcLangExt /*lang*/,
+                   bool isExampleBlock,
+                   const char * exampleName,
+                   FileDef * fileDef,
+                   int startLine,
+                   int endLine,
+                   bool inlineFragment,
+                  const MemberDef *memberDef,
+                   bool showLineNumbers,
+                   const Definition *searchCtx,
+                   bool collectXRefs
+                  )
+{
+  ::parseFortranCode(codeOutIntf,scopeName,input,isExampleBlock,exampleName,
+                     fileDef,startLine,endLine,inlineFragment,memberDef,
+                     showLineNumbers,searchCtx,collectXRefs,m_format);
 }
-#elif YY_FLEX_MAJOR_VERSION<=2 && YY_FLEX_MINOR_VERSION<=5 && YY_FLEX_SUBMINOR_VERSION<33
-#error "You seem to be using a version of flex newer than 2.5.4 but older than 2.5.33. These versions do NOT work with doxygen! Please use version <=2.5.4 or >=2.5.33 or expect things to be parsed wrongly!"
-#else
-extern "C" { // some bogus code to keep the compiler happy
-  void fortrancodeYYdummy() { yy_top_state(); } 
+
+void FortranCodeParser::resetCodeParserState()
+{
+  ::resetFortranCodeParserState();
 }
-#endif
 
+//---------------------------------------------------------
+
+#include "fortrancode.l.h"
index 15a9bf0..7a13f47 100644 (file)
  *
  *  This is the Fortran language parser for doxygen.
  */
-class FortranLanguageScanner : public ParserInterface
+class FortranOutlineParser : public OutlineParserInterface
 {
   public:
-    FortranLanguageScanner(FortranFormat format=FortranFormat_Unknown) : m_format(format) { }
-    virtual ~FortranLanguageScanner() {}
+    FortranOutlineParser(FortranFormat format=FortranFormat_Unknown) : m_format(format) { }
     void startTranslationUnit(const char *) {}
     void finishTranslationUnit() {}
     void parseInput(const char *fileName,
                     const char *fileBuf,
-                    Entry *root,
+                    const std::shared_ptr<Entry> &root,
                     bool sameTranslationUnit,
                     QStrList &filesInSameTranslationUnit);
-    bool needsPreprocessing(const QCString &extension);
-    void parseCode(CodeOutputInterface &codeOutIntf,
-                   const char *scopeName,
-                   const QCString &input,
-                   SrcLangExt lang,
-                   bool isExampleBlock,
-                   const char *exampleName=0,
-                   FileDef *fileDef=0,
-                   int startLine=-1,
-                   int endLine=-1,
-                   bool inlineFragment=FALSE,
-                   const MemberDef *memberDef=0,
-                   bool showLineNumbers=TRUE,
-                   const Definition *searchCtx=0,
-                   bool collectXRefs=TRUE
-                  );
-    void resetCodeParserState();
+    bool needsPreprocessing(const QCString &extension) const;
     void parsePrototype(const char *text);
 
   private:
     FortranFormat m_format;
 };
 
-class FortranLanguageScannerFree : public FortranLanguageScanner
+class FortranOutlineParserFree : public FortranOutlineParser
 {
   public:
-    FortranLanguageScannerFree() : FortranLanguageScanner(FortranFormat_Free) { }
+    FortranOutlineParserFree() : FortranOutlineParser(FortranFormat_Free) { }
 };
 
-class FortranLanguageScannerFixed : public FortranLanguageScanner
+class FortranOutlineParserFixed : public FortranOutlineParser
 {
   public:
-    FortranLanguageScannerFixed() : FortranLanguageScanner(FortranFormat_Fixed) { }
+    FortranOutlineParserFixed() : FortranOutlineParser(FortranFormat_Fixed) { }
 };
 
+
 #endif
index ea75836..08c7a6a 100644 (file)
@@ -106,12 +106,14 @@ struct SymbolModifiers {
   bool volat; /* volatile is a reserved name */
   bool value; /* volatile is a reserved name */
   QCString passVar;
+  QCString bindVar;
 
   SymbolModifiers() : type(), returnName(), protection(NONE_P), direction(NONE_D),
     optional(FALSE), protect(FALSE), dimension(), allocatable(FALSE),
     external(FALSE), intrinsic(FALSE), parameter(FALSE),
     pointer(FALSE), target(FALSE), save(FALSE), deferred(FALSE), nonoverridable(FALSE),
-    nopass(FALSE), pass(FALSE), contiguous(FALSE), volat(FALSE), value(FALSE), passVar() {}
+    nopass(FALSE), pass(FALSE), contiguous(FALSE), volat(FALSE), value(FALSE), passVar(),
+    bindVar() {}
 
   SymbolModifiers& operator|=(const SymbolModifiers &mdfs);
   SymbolModifiers& operator|=(QCString mdfrString);
@@ -134,16 +136,16 @@ static const char *directionParam[] =
  *
  *     statics
  */
-static ParserInterface *g_thisParser; 
+static OutlineParserInterface *g_thisParser; 
 static const char *     inputString;
 static int             inputPosition;
 static bool             isFixedForm;
 static QCString         inputStringPrepass; ///< Input string for prepass of line cont. '&'
-static QCString         inputStringSemi; ///< Input string after command separetor ';'
+static QCString         inputStringSemi; ///< Input string after command separator ';'
 static unsigned int     inputPositionPrepass;
 static int              lineCountPrepass = 0;
 
-static QList<Entry>  subrCurrent;
+static std::vector< std::shared_ptr<Entry> >  subrCurrent;
 
 struct CommentInPrepass {
   int column;
@@ -160,14 +162,15 @@ static QFile            inputFile;
 static QCString                yyFileName;
 static int             yyLineNr     = 1 ;
 static int             yyColNr     = 0 ;
-static Entry*          current_root = 0 ;
-static Entry*          global_root  = 0 ;
-static Entry*          file_root    = 0 ;
-static Entry*          current      = 0 ;
-static Entry*          last_entry   = 0 ;
-static Entry*          last_enum    = 0 ;
+static Entry           *current_root = 0;
+static Entry           *global_scope = 0;
+static std::shared_ptr<Entry> global_root;
+static std::shared_ptr<Entry> file_root;
+static std::shared_ptr<Entry> last_entry;
+static std::shared_ptr<Entry> last_enum;
+static std::shared_ptr<Entry> current;
 static ScanVar          v_type       = V_IGNORE; // type of parsed variable
-static QList<Entry>     moduleProcedures; // list of all interfaces which contain unresolved 
+static std::vector<std::shared_ptr<Entry> >  moduleProcedures; // list of all interfaces which contain unresolved 
                                           // module procedures
 static QCString         docBlock;
 static bool             docBlockInBody = FALSE;
@@ -179,7 +182,7 @@ static Specifier    virt;
 
 static QCString          debugStr;
 static QCString          result; // function result
-static Argument          *parameter; // element of parameter list
+static Argument         *parameter; // element of parameter list
 static QCString          argType;  // fortran type of an argument of a parameter list
 static QCString          argName;  // last identifier name in variable list
 static QCString          initializer;  // initial value of a variable
@@ -200,7 +203,6 @@ static SymbolModifiers currentModifiers;
 //! Holds program scope->symbol name->symbol modifiers.
 static QMap<Entry*,QMap<QCString,SymbolModifiers> > modifiers;
 
-static Entry           *global_scope = NULL;
 static int              anonCount    = 0 ;
 //-----------------------------------------------------------------------------
 
@@ -209,7 +211,7 @@ static void startCommentBlock(bool);
 static void handleCommentBlock(const QCString &doc,bool brief);
 static void subrHandleCommentBlock(const QCString &doc,bool brief);
 static void subrHandleCommentBlockResult(const QCString &doc,bool brief);
-static void addCurrentEntry(int case_insens);
+static void addCurrentEntry(bool case_insens);
 static void addModule(const char *name, bool isModule=FALSE);
 static void addSubprogram(const char *text);
 static void addInterface(QCString name, InterfaceType type);
@@ -219,7 +221,7 @@ static void scanner_abort();
 static void startScope(Entry *scope);
 static bool endScope(Entry *scope, bool isGlobalRoot=FALSE);
 //static bool isTypeName(QCString name);
-static void resolveModuleProcedures(QList<Entry> &moduleProcedures, Entry *current_root);
+static void resolveModuleProcedures(Entry *current_root);
 static int getAmpersandAtTheStart(const char *buf, int length);
 static int getAmpOrExclAtTheEnd(const char *buf, int length, char ch);
 static void truncatePrepass(int index);
@@ -227,6 +229,7 @@ static void pushBuffer(QCString &buffer);
 static void popBuffer();
 //static void extractPrefix(QCString& text);
 static QCString extractFromParens(const QCString name);
+static QCString extractBind(const QCString name);
 static CommentInPrepass* locatePrepassComment(int from, int to);
 static void updateVariablePrepassComment(int from, int to);
 static void newLine();
@@ -238,6 +241,7 @@ static const char *stateToString(int state);
 #undef YY_INPUT
 #define        YY_INPUT(buf,result,max_size) result=yyread(buf,max_size);
 #define YY_USER_ACTION yyColNr+=(int)yyleng;
+#define INVALID_ENTRY ((Entry*)0x8)
 //-----------------------------------------------------------------------------
 
 %}
@@ -273,7 +277,7 @@ TYPE_SPEC (({NUM_TYPE}({BS}"*"{BS}[0-9]+)?)|({NUM_TYPE}{KIND})|DOUBLE{BS}COMPLEX
 INTENT_SPEC intent{BS}"("{BS}(in|out|in{BS}out){BS}")"
 ATTR_SPEC (EXTERNAL|ALLOCATABLE|DIMENSION{ARGS}|{INTENT_SPEC}|INTRINSIC|OPTIONAL|PARAMETER|POINTER|PROTECTED|PRIVATE|PUBLIC|SAVE|TARGET|NOPASS|PASS{ARGS}?|DEFERRED|NON_OVERRIDABLE|CONTIGUOUS|VOLATILE|VALUE)
 ACCESS_SPEC (PRIVATE|PUBLIC)
-LANGUAGE_BIND_SPEC BIND{BS}"("{BS}C{BS}(,{BS}NAME{BS}"="{BS}"\""(.*)"\""{BS})?")"
+LANGUAGE_BIND_SPEC BIND{BS}"("{BS}C{BS}((,{BS}NAME{BS}"="{BS}"\""(.*)"\""{BS})|(,{BS}NAME{BS}"="{BS}"'"(.*)"'"{BS}))?")"
 /* Assume that attribute statements are almost the same as attributes. */
 ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC}
 EXTERNAL_STMT (EXTERNAL)
@@ -441,8 +445,7 @@ SCOPENAME ({ID}{BS}"::"{BS})*
                                           current->name=yytext;
                                           current->fileName = yyFileName; 
                                          current->section=Entry::USINGDIR_SEC;
-                                         current_root->addSubEntry(current);
-                                         current = new Entry;
+                                         current_root->moveToSubEntryAndRefresh(current);
                                           current->lang = SrcLangExt_Fortran; 
                                           yy_pop_state();
                                         }
@@ -456,8 +459,7 @@ SCOPENAME ({ID}{BS}"::"{BS})*
                                          current->name= useModuleName+"::"+yytext;
                                           current->fileName = yyFileName; 
                                          current->section=Entry::USINGDECL_SEC;
-                                         current_root->addSubEntry(current);
-                                         current = new Entry ;
+                                         current_root->moveToSubEntryAndRefresh(current);
                                           current->lang = SrcLangExt_Fortran; 
                                        }
 <Use,UseOnly>"\n"                       {
@@ -489,13 +491,13 @@ SCOPENAME ({ID}{BS}"::"{BS})*
                                           QCString name = QCString(yytext).stripWhiteSpace();
                                           name = name.right(name.length() - 9).stripWhiteSpace().lower();
                                           addInterface(name, ifType);
-                                          startScope(last_entry);
+                                          startScope(last_entry.get());
                                         }
 }
 
 <InterfaceBody>^{BS}end{BS}interface({BS_}{ID})? {
                                           // end scope only if GENERIC interface
-                                          if (ifType == IF_GENERIC)last_entry->parent()->endBodyLine = yyLineNr - 1;
+                                          if (ifType == IF_GENERIC) last_entry->parent()->endBodyLine = yyLineNr - 1;
                                           if (ifType == IF_GENERIC && !endScope(current_root))
                                             yyterminate();
 
@@ -508,13 +510,13 @@ SCOPENAME ({ID}{BS}"::"{BS})*
 <ModuleProcedure>{ID}                   { if (ifType == IF_ABSTRACT || ifType == IF_SPECIFIC)
                                           {
                                             addInterface(yytext, ifType);
-                                            startScope(last_entry);
+                                            startScope(last_entry.get());
                                           }
 
                                           current->section = Entry::FUNCTION_SEC ;
                                           current->name = yytext; 
-                                          moduleProcedures.append(current);
-                                          addCurrentEntry(1);
+                                          moduleProcedures.push_back(current);
+                                          addCurrentEntry(true);
                                         }
 <ModuleProcedure>"\n"                   { yyColNr -= 1;
                                          unput(*yytext); 
@@ -555,13 +557,13 @@ SCOPENAME ({ID}{BS}"::"{BS})*
                                            yy_pop_state();
                                        }
 <Start,ModuleBody,ModuleBodyContains>"end"({BS}(module|program)({BS_}{ID})?)?{BS}/(\n|!|;) { // end module
-                                           resolveModuleProcedures(moduleProcedures, current_root);
+                                           resolveModuleProcedures(current_root);
                                            if (!endScope(current_root))
                                              yyterminate();
                                             defaultProtection = Public;
                                            if (global_scope)
                                             {
-                                              if (global_scope != (Entry *) -1)
+                                              if (global_scope != INVALID_ENTRY)
                                                 yy_push_state(Start);
                                               else
                                                 yy_pop_state(); // cannot pop artrificial entry
@@ -569,7 +571,7 @@ SCOPENAME ({ID}{BS}"::"{BS})*
                                             else
                                             {
                                               yy_push_state(Start);
-                                              global_scope = (Entry *)-1; // signal that the global_scope has already been used.
+                                              global_scope = INVALID_ENTRY; // signal that the global_scope has already been used.
                                             }
                                        }
 <Module>{ID}                           {  
@@ -615,7 +617,7 @@ abstract                                {
                                         }
 extends{ARGS}                           {
                                           QCString basename = extractFromParens(yytext).lower();
-                                          current->extends->append(new BaseInfo(basename, Public, Normal));
+                                          current->extends.push_back(BaseInfo(basename, Public, Normal));
                                         }
 public                                  {
                                           current->protection = Public;
@@ -637,15 +639,15 @@ private                                 {
                                           current->startLine  = yyLineNr;
 
                                           /* if type is part of a module, mod name is necessary for output */
-                                          if ((current_root) && 
+                                          if (current_root && 
                                               (current_root->section == Entry::CLASS_SEC
                                                || current_root->section == Entry::NAMESPACE_SEC))
                                           {
                                             current->name = current_root->name + "::" + current->name;
                                           }
 
-                                          addCurrentEntry(1);
-                                          startScope(last_entry); 
+                                          addCurrentEntry(true);
+                                          startScope(last_entry.get()); 
                                           BEGIN(TypedefBody);
                                         }
 }
@@ -676,7 +678,7 @@ private                                 {
                                           current->fileName = yyFileName;
                                           current->bodyLine = yyLineNr;
                                           current->startLine  = yyLineNr;
-                                          addCurrentEntry(1);
+                                          addCurrentEntry(true);
                                         }
 {BS}"=>"[^(\n|\!)]*                     { /* Specific bindings come after the ID. */
                                           QCString args = yytext;
@@ -725,7 +727,7 @@ private                                 {
 
                                           if (!endScope(current_root))
                                             yyterminate();
-                                           subrCurrent.remove(0u);
+                                           subrCurrent.pop_back();
                                           yy_pop_state() ;
                                        }
 <BlockData>{
@@ -734,7 +736,7 @@ private                                 {
 }
 <Start,ModuleBody,TypedefBody,SubprogBody,Enum>{
 ^{BS}{TYPE_SPEC}/{SEPARATE}             {
-                                          last_enum = 0;
+                                          last_enum.reset();
                                           if (YY_START == Enum)
                                           {
                                            argType = "@"; // enum marker
@@ -810,6 +812,9 @@ private                                 {
 <AttributeList>{
 {COMMA}                                        {}
 {BS}                                   {}
+{LANGUAGE_BIND_SPEC}                    {
+                                          currentModifiers |= yytext;
+                                        }
 {ATTR_SPEC}.                           { /* update current modifiers when it is an ATTR_SPEC and not a variable name */
                                          /* bug_625519 */
                                           QChar chr = yytext[(int)yyleng-1];
@@ -860,17 +865,15 @@ private                                 {
                                             current->startLine  = yyLineNr;
                                             if (argType == "@")
                                             {
-                                              current_root->addSubEntry(current);
-                                              current = new Entry(*current);
+                                              current_root->copyToSubEntry(current);
                                               // add to the scope surrounding the enum (copy!)
-                                              current_root->parent()->addSubEntry(current);
                                               last_enum = current;
-                                              current = new Entry ;
+                                              current_root->parent()->moveToSubEntryAndRefresh(current);
                                               initEntry();
                                             }
                                             else
                                             {
-                                              addCurrentEntry(1);
+                                              addCurrentEntry(true);
                                             }
                                           } 
                                          else if (!argType.isEmpty())
@@ -883,7 +886,7 @@ private                                 {
                                              if (!docBlock.isNull()) 
                                              {
                                                subrHandleCommentBlock(docBlock,TRUE);
-                                             }                                     
+                                             }
                                            }
                                            // save, it may be function return type
                                            if (parameter)
@@ -1062,8 +1065,8 @@ private                                 {
                                             current->name = current_root->name + "::" + current->name;
                                           }
 
-                                          addCurrentEntry(1);
-                                          startScope(last_entry); 
+                                          addCurrentEntry(true);
+                                          startScope(last_entry.get()); 
                                          BEGIN( Enum ) ;
                                         }
 <Enum>"end"{BS}"enum"                   {
@@ -1080,7 +1083,7 @@ private                                 {
                                          if (ifType == IF_ABSTRACT || ifType == IF_SPECIFIC)
                                          {
                                            addInterface("$interface$", ifType);
-                                           startScope(last_entry);
+                                           startScope(last_entry.get());
                                          }
 
                                          // TYPE_SPEC is for old function style function result
@@ -1106,7 +1109,7 @@ private                                 {
                                          if (ifType == IF_ABSTRACT || ifType == IF_SPECIFIC)
                                          {
                                            addInterface("$interface$", ifType);
-                                           startScope(last_entry);
+                                           startScope(last_entry.get());
                                          }
 
                                          result = QCString(yytext).stripWhiteSpace();
@@ -1132,15 +1135,17 @@ private                                 {
 <Parameterlist>")"                     {
                                         current->args += ")";
                                         current->args = removeRedundantWhiteSpace(current->args);
-                                         addCurrentEntry(1);
-                                        startScope(last_entry);
+                                         addCurrentEntry(true);
+                                        startScope(last_entry.get());
                                         BEGIN(SubprogBody);
                                       }
 <Parameterlist>{COMMA}|{BS}            { current->args += yytext;
                                         CommentInPrepass *c = locatePrepassComment(yyColNr-(int)yyleng, yyColNr);
-                                        if (c!=NULL) {
-                                           if(current->argList->count()>0) {
-                                            current->argList->at(current->argList->count()-1)->docs = c->str;
+                                        if (c!=NULL)
+                                         {
+                                           if (!current->argList.empty())
+                                           {
+                                            current->argList.back().docs = c->str;
                                           }
                                         }                       
                                       }
@@ -1149,17 +1154,15 @@ private                                 {
                                            QCString param = yytext;
                                           // std::cout << "3=========> got parameter " << param << std::endl;
                                           current->args += param;
-                                          Argument *arg = new Argument;
-                                          arg->name = param;
-                                          arg->type = "";
-                                          current->argList->append(arg);
+                                          Argument arg;
+                                          arg.name = param;
+                                          current->argList.push_back(arg);
                                       } 
 <Parameterlist>{NOARGS}                {   
                                           newLine();
                                           //printf("3=========> without parameterlist \n");
-                                          //current->argList = ;
-                                           addCurrentEntry(1);
-                                          startScope(last_entry);
+                                           addCurrentEntry(true);
+                                          startScope(last_entry.get());
                                           BEGIN(SubprogBody);                                     
 }
 <SubprogBody>result{BS}\({BS}{ID}      {  
@@ -1211,11 +1214,19 @@ private                                 {
                                          unput(*yytext);                                        
                                          if (v_type == V_VARIABLE) 
                                          {
-                                           Entry *tmp_entry = current; 
-                                           current = last_entry; // temporarily switch to the previous entry
-                                            if (last_enum) current = last_enum;
+                                            std::shared_ptr<Entry> tmp_entry = current;
+                                            // temporarily switch to the previous entry
+                                            if (last_enum)
+                                            {
+                                              current = last_enum;
+                                            }
+                                            else
+                                            {
+                                             current = last_entry;
+                                            }
                                            handleCommentBlock(docBlock,TRUE);
-                                           current=tmp_entry;
+                                            // switch back
+                                           current = tmp_entry;
                                           }
                                          else if (v_type == V_PARAMETER) 
                                          {
@@ -1268,9 +1279,9 @@ private                                 {
 <PrototypeArgs>{
 "("|")"|","|{BS_}                      { current->args += yytext; }
 {ID}                                   { current->args += yytext; 
-                                         Argument *a = new Argument;
-                                         a->name = QCString(yytext).lower();
-                                         current->argList->append(a);
+                                         Argument a;
+                                         a.name = QCString(yytext).lower();
+                                         current->argList.push_back(a);
                                        }
 }
 
@@ -1654,6 +1665,7 @@ const char* prepassFixedForm(const char* contents, int *hasContLine)
         }
         inBackslash = FALSE;
         // fallthrough
+      case '#':
       case 'C':
       case 'c':
       case '*':
@@ -1766,34 +1778,29 @@ static void popBuffer() {
 }
 
 /** used to copy entry to an interface module procedure */
-static void copyEntry(Entry *dest, Entry *src) 
+static void copyEntry(std::shared_ptr<Entry> dest, const std::shared_ptr<Entry> &src) 
 {
-   dest->type     = src->type;
-   dest->fileName = src->fileName;
-   dest->startLine = src->startLine;
-   dest->bodyLine = src->bodyLine;
+   dest->type        = src->type;
+   dest->fileName    = src->fileName;
+   dest->startLine   = src->startLine;
+   dest->bodyLine    = src->bodyLine;
    dest->endBodyLine = src->endBodyLine;
-   dest->args     = src->args;
-   dest->argList  = new ArgumentList(*src->argList);
-   dest->doc      = src->doc;
-   dest->brief    = src->brief;
+   dest->args        = src->args;
+   dest->argList     = src->argList;
+   dest->doc         = src->doc;
+   dest->brief       = src->brief;
 }
 
 /** fill empty interface module procedures with info from 
     corresponding module subprogs 
     @TODO: handle procedures in used modules
 */
-void resolveModuleProcedures(QList<Entry> &moduleProcedures, Entry *current_root)
+void resolveModuleProcedures(Entry *current_root)
 {
-  if (moduleProcedures.isEmpty()) return;
-  EntryListIterator eli1(moduleProcedures);
-  // for all module procedures
-  for (Entry *ce1; (ce1=eli1.current()); ++eli1) 
+  for (const auto &ce1 : moduleProcedures)
   {
     // check all entries in this module
-    EntryListIterator eli2(*current_root->children());
-    for (Entry *ce2; (ce2=eli2.current()); ++eli2) 
+    for (const auto &ce2 : current_root->children())
     {
       if (ce1->name == ce2->name) 
       {
@@ -1833,6 +1840,29 @@ static QCString extractFromParens(const QCString name)
   return extracted;
 }
 
+/*! remove useless spaces from bind statement */
+static QCString extractBind(const QCString name)
+{
+  QCString parensPart = extractFromParens(name);
+  if (parensPart.length() == 1)
+  {
+    return "bind(C)";
+  }
+  else
+  {
+    //strip 'c'
+    parensPart = parensPart.mid(1).stripWhiteSpace();
+    // strip ','
+    parensPart = parensPart.mid(1).stripWhiteSpace();
+    // name part
+    parensPart = parensPart.mid(4).stripWhiteSpace();
+    // = part
+    parensPart = parensPart.mid(1).stripWhiteSpace();
+
+    return "bind(C, name=" + parensPart + ")";
+  }
+}
+
 /*! Adds passed modifiers to these modifiers.*/
 SymbolModifiers& SymbolModifiers::operator|=(const SymbolModifiers &mdfs)
 {
@@ -1853,6 +1883,7 @@ SymbolModifiers& SymbolModifiers::operator|=(const SymbolModifiers &mdfs)
   nopass |= mdfs.nopass;
   pass |= mdfs.pass;
   passVar = mdfs.passVar;
+  bindVar = mdfs.bindVar;
   contiguous |= mdfs.contiguous;
   volat |= mdfs.volat;
   value |= mdfs.value;
@@ -1860,9 +1891,9 @@ SymbolModifiers& SymbolModifiers::operator|=(const SymbolModifiers &mdfs)
 }
 
 /*! Extracts and adds passed modifier to these modifiers.*/
-SymbolModifiers& SymbolModifiers::operator|=(QCString mdfString)
+SymbolModifiers& SymbolModifiers::operator|=(QCString mdfStringArg)
 {
-  mdfString = mdfString.lower();
+  QCString mdfString = mdfStringArg.lower();
   SymbolModifiers newMdf;
 
   if (mdfString.find("dimension")==0) 
@@ -1954,6 +1985,11 @@ SymbolModifiers& SymbolModifiers::operator|=(QCString mdfString)
     else
       newMdf.passVar = "";
   }
+  else if (mdfString.startsWith("bind"))
+  {
+    // we need here the original string as we want to don't want to have the lowercase name between the quotes of the name= part
+    newMdf.bindVar = extractBind(mdfStringArg);
+  }
 
   (*this) |= newMdf;
   return *this;
@@ -1973,39 +2009,18 @@ SymbolModifiers& SymbolModifiers::operator|=(QCString mdfString)
 static Argument *findArgument(Entry* subprog, QCString name, bool byTypeName = FALSE)
 {
   QCString cname(name.lower());
-  for (unsigned int i=0; i<subprog->argList->count(); i++) 
+  for (Argument &arg : subprog->argList)
   {
-    Argument *arg = subprog->argList->at(i);
-    if ((!byTypeName && arg->name.lower() == cname) ||
-       (byTypeName && arg->type.lower() == cname)
+    if ((!byTypeName && arg.name.lower() == cname) ||
+        (byTypeName && arg.type.lower() == cname)
        )
     {
-      return arg;
+      return &arg;
     }
   }
   return 0;
 }
 
-/*! Find function with given name in \a entry. */
-#if 0
-static Entry *findFunction(Entry* entry, QCString name)
-{
-  QCString cname(name.lower());
-
-  EntryListIterator eli(*entry->children());
-  Entry *ce;
-  for (;(ce=eli.current());++eli) 
-  {
-    if (ce->section != Entry::FUNCTION_SEC)
-      continue;
-
-    if (ce->name.lower() == cname)
-      return ce;
-  }
-
-  return 0;
-}
-#endif
 
 /*! Apply modifiers stored in \a mdfs to the \a typeName string. */
 static QCString applyModifiers(QCString typeName, SymbolModifiers& mdfs) 
@@ -2085,6 +2100,11 @@ static QCString applyModifiers(QCString typeName, SymbolModifiers& mdfs)
     if (!mdfs.passVar.isEmpty())
       typeName += "(" + mdfs.passVar + ")";
   }
+  if (!mdfs.bindVar.isEmpty())
+  {
+    if (!typeName.isEmpty()) typeName += ", ";
+    typeName += mdfs.bindVar;
+  }
   if (mdfs.protection == SymbolModifiers::PUBLIC)
   {
     if (!typeName.isEmpty()) typeName += ", ";
@@ -2158,10 +2178,10 @@ static bool endScope(Entry *scope, bool isGlobalRoot)
 {
   if (global_scope == scope)
   {
-    global_scope = NULL;
+    global_scope = 0;
     return TRUE;
   }
-  if (global_scope == (Entry *) -1)
+  if (global_scope == INVALID_ENTRY)
   {
     return TRUE;
   }
@@ -2189,7 +2209,9 @@ static bool endScope(Entry *scope, bool isGlobalRoot)
       Argument *arg = findArgument(scope, it.key());
 
       if (arg)
+      {
         applyModifiers(arg, it.data());
+      }
     }
 
     // find return type for function
@@ -2209,11 +2231,9 @@ static bool endScope(Entry *scope, bool isGlobalRoot)
       // iterate functions of interface and 
       // try to find types for dummy(ie. argument) procedures.
       //cout<<"Search in "<<scope->name<<endl;
-      EntryListIterator eli(*scope->children());
-      Entry *ce;
       int count = 0;
       int found = FALSE;
-      for (;(ce=eli.current());++eli) 
+      for (const auto &ce : scope->children())
       {
         count++;
         if (ce->section != Entry::FUNCTION_SEC)
@@ -2232,7 +2252,7 @@ static bool endScope(Entry *scope, bool isGlobalRoot)
       {
         // clear all modifiers of the scope
         modifiers.remove(scope);
-        delete scope->parent()->removeSubEntry(scope);
+        scope->parent()->removeSubEntry(scope);
         scope = 0;
         return TRUE;
       }
@@ -2241,16 +2261,14 @@ static bool endScope(Entry *scope, bool isGlobalRoot)
   if (scope->section!=Entry::FUNCTION_SEC) 
   { // not function section 
     // iterate variables: get and apply modifiers
-    EntryListIterator eli(*scope->children());
-    Entry *ce;
-    for (;(ce=eli.current());++eli) 
+    for (const auto &ce : scope->children())
     {
       if (ce->section != Entry::VARIABLE_SEC && ce->section != Entry::FUNCTION_SEC)
         continue;
 
       //cout<<ce->name<<", "<<mdfsMap.contains(ce->name.lower())<<mdfsMap.count()<<endl;
       if (mdfsMap.contains(ce->name.lower()))
-        applyModifiers(ce, mdfsMap[ce->name.lower()]);
+        applyModifiers(ce.get(), mdfsMap[ce->name.lower()]);
     }
   }
 
@@ -2287,7 +2305,7 @@ static int yyread(char *buf,int max_size)
 
 static void initParser()
 {
-  last_entry = 0;
+  last_entry.reset();
 }
 
 static void initEntry()
@@ -2304,19 +2322,18 @@ static void initEntry()
   current->virt       = virt;
   current->stat       = gstat;
   current->lang       = SrcLangExt_Fortran; 
-  Doxygen::docGroup.initGroupInfo(current);
+  Doxygen::docGroup.initGroupInfo(current.get());
 }
 
 /**
   adds current entry to current_root and creates new current
 */
-static void addCurrentEntry(int case_insens)
+static void addCurrentEntry(bool case_insens)
 {
   if (case_insens) current->name = current->name.lower();
   //printf("===Adding entry %s to %s\n", current->name.data(), current_root->name.data());
-  current_root->addSubEntry(current);
   last_entry = current;
-  current = new Entry ;
+  current_root->moveToSubEntryAndRefresh(current);
   initEntry();
 }
 
@@ -2334,7 +2351,7 @@ static void addModule(const char *name, bool isModule)
   if (name!=NULL)
   {
     current->name = name;
-  } 
+  }
   else
   {
     QCString fname = yyFileName;
@@ -2348,15 +2365,15 @@ static void addModule(const char *name, bool isModule)
   current->bodyLine  = yyLineNr; // used for source reference
   current->startLine  = yyLineNr;
   current->protection = Public ;
-  addCurrentEntry(1);
-  startScope(last_entry);
+  addCurrentEntry(true);
+  startScope(last_entry.get());
 }
 
 
 static void addSubprogram(const char *text)
 {
   DBG_CTX((stderr,"1=========> got subprog, type: %s\n",text)); 
-  subrCurrent.prepend(current);
+  subrCurrent.push_back(current);
   current->section = Entry::FUNCTION_SEC ;
   QCString subtype = text; subtype=subtype.lower().stripWhiteSpace();
   functionLine = (subtype.find("function") != -1);
@@ -2366,7 +2383,7 @@ static void addSubprogram(const char *text)
   current->bodyLine  = yyLineNr; // used for source reference start of body of routine
   current->startLine  = yyLineNr; // used for source reference start of definition
   current->args.resize(0);
-  current->argList->clear();
+  current->argList.clear();
   docBlock.resize(0);
 }
 
@@ -2413,7 +2430,7 @@ static void addInterface(QCString name, InterfaceType type)
   current->fileName = yyFileName;
   current->bodyLine  = yyLineNr; 
   current->startLine  = yyLineNr;
-  addCurrentEntry(1);
+  addCurrentEntry(true);
 }
 
 
@@ -2421,18 +2438,15 @@ static void addInterface(QCString name, InterfaceType type)
 
 /*! Get the argument \a name.
  */
-static ArgumentgetParameter(const QCString &name)
+static Argument *getParameter(const QCString &name)
 {
   // std::cout<<"addFortranParameter(): "<<name<<" DOCS:"<<(docs.isNull()?QCString("null"):docs)<<std::endl;
   Argument *ret = 0;
-  if (current_root->argList==0) return 0;
-  ArgumentListIterator ali(*current_root->argList);
-  Argument *a;
-  for (ali.toFirst();(a=ali.current());++ali)
+  for (Argument &a:current_root->argList)
   {
-    if (a->name.lower()==name.lower())
+    if (a.name.lower()==name.lower())
     {
-      ret=a;
+      ret=&a;
       //printf("parameter found: %s\n",(const char*)name);
       break;
     }
@@ -2472,7 +2486,7 @@ static void handleCommentBlock(const QCString &doc,bool brief)
   QCString processedDoc = preprocessCommentBlock(doc,yyFileName,lineNr);
   while (parseCommentBlock(
        g_thisParser,
-       docBlockInBody ? subrCurrent.getFirst() : current,
+       docBlockInBody ? subrCurrent.back().get() : current.get(),
        processedDoc, // text
        yyFileName, // file
        lineNr,
@@ -2485,11 +2499,11 @@ static void handleCommentBlock(const QCString &doc,bool brief)
         )) 
   {
           DBG_CTX((stderr,"parseCommentBlock position=%d [%s]  needsEntry=%d\n",position,doc.data()+position,needsEntry));
-   if (needsEntry) addCurrentEntry(0);
+   if (needsEntry) addCurrentEntry(false);
   }
   DBG_CTX((stderr,"parseCommentBlock position=%d [%s]  needsEntry=%d\n",position,doc.data()+position,needsEntry));
 
-  if (needsEntry) addCurrentEntry(0);
+  if (needsEntry) addCurrentEntry(false);
   docBlockInBody = FALSE;
 }
 
@@ -2500,8 +2514,8 @@ static void subrHandleCommentBlock(const QCString &doc,bool brief)
   QCString loc_doc;
   loc_doc = doc.stripWhiteSpace();
 
-  Entry *tmp_entry = current; 
-  current = subrCurrent.getFirst(); // temporarily switch to the entry of the subroutine / function
+  std::shared_ptr<Entry> tmp_entry = current;
+  current = subrCurrent.back(); // temporarily switch to the entry of the subroutine / function
 
   // Still in the specification section so no inbodyDocs yet, but parameter documentation
   current->inbodyDocs = "";
@@ -2524,15 +2538,12 @@ static void subrHandleCommentBlock(const QCString &doc,bool brief)
       // strip direction
       loc_doc = loc_doc.right(loc_doc.length()-strlen(directionParam[SymbolModifiers::IN]));
       loc_doc.stripWhiteSpace();
-      // in case of empty documentation or (now) just name, consider it as no documemntation
-      if (loc_doc.isEmpty() || (loc_doc.lower() == argName.lower()))
+      // in case of empty documentation or (now) just name, consider it as no documentation
+      if (!loc_doc.isEmpty() && (loc_doc.lower() != argName.lower()))
       {
-        // reset current back to the part inside the routine
-        current=tmp_entry;
-        return;
-      }
-      handleCommentBlock(QCString("\n\n@param ") + directionParam[SymbolModifiers::IN] + " " + 
+        handleCommentBlock(QCString("\n\n@param ") + directionParam[SymbolModifiers::IN] + " " + 
                          argName + " " + loc_doc,brief);
+      }
     }
     else
     {
@@ -2553,7 +2564,7 @@ static void subrHandleCommentBlock(const QCString &doc,bool brief)
       loc_doc.stripWhiteSpace();
       if (loc_doc.isEmpty() || (loc_doc.lower() == argName.lower()))
       {
-        current=tmp_entry;
+        current = tmp_entry;
         return;
       }
       handleCommentBlock(QCString("\n\n@param ") + directionParam[SymbolModifiers::OUT] + " " + 
@@ -2575,13 +2586,11 @@ static void subrHandleCommentBlock(const QCString &doc,bool brief)
     {
       loc_doc = loc_doc.right(loc_doc.length()-strlen(directionParam[SymbolModifiers::INOUT]));
       loc_doc.stripWhiteSpace();
-      if (loc_doc.isEmpty() || (loc_doc.lower() == argName.lower()))
+      if (!loc_doc.isEmpty() && (loc_doc.lower() != argName.lower()))
       {
-        current=tmp_entry;
-        return;
+        handleCommentBlock(QCString("\n\n@param ") + directionParam[SymbolModifiers::INOUT] + " " + 
+                           argName + " " + loc_doc,brief);
       }
-      handleCommentBlock(QCString("\n\n@param ") + directionParam[SymbolModifiers::INOUT] + " " + 
-                         argName + " " + loc_doc,brief);
     }
     else
     {
@@ -2592,19 +2601,14 @@ static void subrHandleCommentBlock(const QCString &doc,bool brief)
     }
   }
   // analogous to the [in] case; here no direction specified
-  else
+  else if (!loc_doc.isEmpty() && (loc_doc.lower() != argName.lower()))
   {
-    if (loc_doc.isEmpty() || (loc_doc.lower() == argName.lower()))
-    {
-      current=tmp_entry;
-      return;
-    }
     handleCommentBlock(QCString("\n\n@param ") + directionParam[dir1] + " " + 
                        argName + " " + loc_doc,brief);
   }
 
   // reset current back to the part inside the routine
-  current=tmp_entry;
+  current = tmp_entry;
 }
 //----------------------------------------------------------------------------
 /// Handle result description as defined after the declaration of the parameter
@@ -2613,8 +2617,8 @@ static void subrHandleCommentBlockResult(const QCString &doc,bool brief)
   QCString loc_doc;
   loc_doc = doc.stripWhiteSpace();
 
-  Entry *tmp_entry = current; 
-  current = subrCurrent.getFirst(); // temporarily switch to the entry of the subroutine / function
+  std::shared_ptr<Entry> tmp_entry = current;
+  current = subrCurrent.back(); // temporarily switch to the entry of the subroutine / function
 
   // Still in the specification section so no inbodyDocs yet, but parameter documentation
   current->inbodyDocs = "";
@@ -2627,15 +2631,13 @@ static void subrHandleCommentBlockResult(const QCString &doc,bool brief)
      ) (void)loc_doc; // Do nothing work has been done by stripPrefix; (void)loc_doc: to overcome 'empty controlled statement' warning
   loc_doc.stripWhiteSpace();
 
-  if (loc_doc.isEmpty() || (loc_doc.lower() == argName.lower()))
+  if (!loc_doc.isEmpty() && (loc_doc.lower() != argName.lower()))
   {
-    current=tmp_entry;
-    return;
+    handleCommentBlock(QCString("\n\n@returns ") + loc_doc,brief);
   }
-  handleCommentBlock(QCString("\n\n@returns ") + loc_doc,brief);
 
   // reset current back to the part inside the routine
-  current=tmp_entry;
+  current = tmp_entry;
 }
 
 //----------------------------------------------------------------------------
@@ -2646,18 +2648,17 @@ static void debugCompounds(Entry *rt)  // print Entry structure (for debugging)
 {
  level++;
   printf("%d) debugCompounds(%s) line %d\n",level, rt->name.data(), rt->bodyLine);
-  EntryListIterator eli(*rt->children());
-  Entry *ce;
-  for (;(ce=eli.current());++eli)
+  for (const auto &ce : rt->children())
   {
-     debugCompounds(ce); 
-  } 
+     debugCompounds(ce.get());
+  }
 level--;
 }
 #endif
 
 
-static void parseMain(const char *fileName,const char *fileBuf,Entry *rt, FortranFormat format)
+static void parseMain(const char *fileName,const char *fileBuf,
+                      const std::shared_ptr<Entry> &rt, FortranFormat format)
 {
   char *tmpBuf = NULL;
   initParser();
@@ -2672,7 +2673,7 @@ static void parseMain(const char *fileName,const char *fileBuf,Entry *rt, Fortra
   mtype         = Method;
   gstat         = FALSE;
   virt          = Normal;
-  current_root  = rt;
+  current_root  = rt.get();
   global_root   = rt;
   inputFile.setName(fileName);
   if (inputFile.open(IO_ReadOnly))
@@ -2709,18 +2710,18 @@ 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
+    global_scope = rt.get();
+    startScope(rt.get()); // implies current_root = rt
     initParser();
     Doxygen::docGroup.enterFile(yyFileName,yyLineNr);
 
-    current          = new Entry;
+    // add entry for the file
+    current          = std::make_shared<Entry>();
     current->lang    = SrcLangExt_Fortran; 
     current->name    = yyFileName;
     current->section = Entry::SOURCE_SEC;
-    current_root->addSubEntry(current);
     file_root        = current;
-    current          = new Entry;
+    current_root->moveToSubEntryAndRefresh(current);
     current->lang    = SrcLangExt_Fortran; 
 
     fortranscannerYYrestart( fortranscannerYYin );
@@ -2731,12 +2732,12 @@ static void parseMain(const char *fileName,const char *fileBuf,Entry *rt, Fortra
     fortranscannerYYlex();
     Doxygen::docGroup.leaveFile(yyFileName,yyLineNr);
 
-    if (global_scope && global_scope != (Entry *) -1) endScope(current_root, TRUE); // TRUE - global root
+    if (global_scope && global_scope != INVALID_ENTRY) endScope(current_root, TRUE); // TRUE - global root
 
     //debugCompounds(rt); //debug 
 
     rt->program.resize(0);
-    delete current; current=0;
+    //delete current; current=0;
     moduleProcedures.clear();
     if (tmpBuf) {
       free((char*)tmpBuf);
@@ -2753,9 +2754,9 @@ static void parseMain(const char *fileName,const char *fileBuf,Entry *rt, Fortra
 
 //----------------------------------------------------------------------------
 
-void FortranLanguageScanner::parseInput(const char *fileName,
+void FortranOutlineParser::parseInput(const char *fileName,
                                         const char *fileBuf,
-                                        Entry *root,
+                                        const std::shared_ptr<Entry> &root,
                                         bool /*sameTranslationUnit*/,
                                         QStrList & /*filesInSameTranslationUnit*/)
 {
@@ -2768,37 +2769,11 @@ void FortranLanguageScanner::parseInput(const char *fileName,
   printlex(yy_flex_debug, FALSE, __FILE__, fileName);
 }
 
-void FortranLanguageScanner::parseCode(CodeOutputInterface & codeOutIntf,
-                   const char * scopeName,
-                   const QCString & input,
-                   SrcLangExt /*lang*/,
-                   bool isExampleBlock,
-                   const char * exampleName,
-                   FileDef * fileDef,
-                   int startLine,
-                   int endLine,
-                   bool inlineFragment,
-                  const MemberDef *memberDef,
-                   bool showLineNumbers,
-                   const Definition *searchCtx,
-                   bool collectXRefs
-                  )
-{
-  ::parseFortranCode(codeOutIntf,scopeName,input,isExampleBlock,exampleName,
-                     fileDef,startLine,endLine,inlineFragment,memberDef,
-                     showLineNumbers,searchCtx,collectXRefs,m_format);
-}
-
-bool FortranLanguageScanner::needsPreprocessing(const QCString &extension)
+bool FortranOutlineParser::needsPreprocessing(const QCString &extension) const
 {
   return extension!=extension.lower(); // use preprocessor only for upper case extensions
 }
-void FortranLanguageScanner::resetCodeParserState()
-{
-  ::resetFortranCodeParserState();
-}
-
-void FortranLanguageScanner::parsePrototype(const char *text)
+void FortranOutlineParser::parsePrototype(const char *text)
 {
   QCString buffer = QCString(text);
   pushBuffer(buffer);
@@ -2809,17 +2784,17 @@ void FortranLanguageScanner::parsePrototype(const char *text)
   popBuffer();
 }
 
+//----------------------------------------------------------------------------
+
 static void scanner_abort() 
 {
   fprintf(stderr,"********************************************************************\n");
   fprintf(stderr,"Error in file %s line: %d, state: %d(%s)\n",yyFileName.data(),yyLineNr,YY_START,stateToString(YY_START));
   fprintf(stderr,"********************************************************************\n");
    
-  EntryListIterator eli(*global_root->children());
-  Entry *ce;
   bool start=FALSE;
 
-  for (;(ce=eli.current());++eli)
+  for (const auto &ce : global_root->children())
   {
      if (ce == file_root) start=TRUE;
      if (start) ce->reset(); 
@@ -2834,54 +2809,4 @@ static void scanner_abort()
 
 //----------------------------------------------------------------------------
 
-#if !defined(YY_FLEX_SUBMINOR_VERSION) 
-//----------------------------------------------------------------------------
-extern "C" { // some bogus code to keep the compiler happy
-  void fortranscannernerYYdummy() { yy_flex_realloc(0,0); } 
-}
-#endif
-
-#define scanStateToString(x) case x: resultString = #x; break;
-static const char *stateToString(int state)
-{
-  const char *resultString;
-  switch(state)
-  {
-    scanStateToString(INITIAL)
-    scanStateToString(Subprog)
-    scanStateToString(SubprogPrefix)
-    scanStateToString(Parameterlist)
-    scanStateToString(SubprogBody)
-    scanStateToString(SubprogBodyContains)
-    scanStateToString(Start)
-    scanStateToString(Comment)
-    scanStateToString(Module)
-    scanStateToString(Program)
-    scanStateToString(ModuleBody)
-    scanStateToString(ModuleBodyContains)
-    scanStateToString(AttributeList)
-    scanStateToString(Variable)
-    scanStateToString(Initialization)
-    scanStateToString(ArrayInitializer)
-    scanStateToString(Enum)
-    scanStateToString(Typedef)
-    scanStateToString(TypedefBody)
-    scanStateToString(TypedefBodyContains)
-    scanStateToString(InterfaceBody)
-    scanStateToString(StrIgnore)
-    scanStateToString(String)
-    scanStateToString(Use)
-    scanStateToString(UseOnly)
-    scanStateToString(ModuleProcedure)
-    scanStateToString(Prepass)
-    scanStateToString(DocBlock)
-    scanStateToString(DocBackLine)
-    scanStateToString(EndDoc)
-    scanStateToString(BlockData)
-    scanStateToString(Prototype)
-    scanStateToString(PrototypeSubprog)
-    scanStateToString(PrototypeArgs)
-    default: resultString = "Unknown"; break;
-  }
-  return resultString;
-}
+#include "fortranscanner.l.h"
index d073f40..bfc5bd5 100644 (file)
@@ -23,7 +23,6 @@ class FTextStream
 
     FTextStream &operator<<( char );
     FTextStream &operator<<( const char *);
-    FTextStream &operator<<( const QString & );
     FTextStream &operator<<( const QCString & );
     FTextStream &operator<<( signed short );
     FTextStream &operator<<( unsigned short );
@@ -59,11 +58,6 @@ inline FTextStream &FTextStream::operator<<( const char* s)
   return *this;
 }
 
-inline FTextStream &FTextStream::operator<<( const QString & s)
-{
-  return operator<<(s.data());
-}
-
 inline FTextStream &FTextStream::operator<<( const QCString &s)
 {
   return operator<<(s.data());
index 9baf0aa..0d6d43f 100644 (file)
@@ -236,12 +236,12 @@ void GroupDefImpl::distributeMemberGroupDocumentation()
 
 void GroupDefImpl::findSectionsInDocumentation()
 {
-  docFindSections(documentation(),this,0,docFile());
+  docFindSections(documentation(),this,docFile());
   MemberGroupSDict::Iterator mgli(*memberGroupSDict);
   MemberGroup *mg;
   for (;(mg=mgli.current());++mgli)
   {
-    mg->findSectionsInDocumentation();
+    mg->findSectionsInDocumentation(this);
   }
 
   QListIterator<MemberList> mli(m_memberLists);
@@ -250,7 +250,7 @@ void GroupDefImpl::findSectionsInDocumentation()
   {
     if (ml->listType()&MemberListType_declarationLists)
     {
-      ml->findSectionsInDocumentation();
+      ml->findSectionsInDocumentation(this);
     }
   }
 }
@@ -396,15 +396,13 @@ bool GroupDefImpl::insertMember(MemberDef *md,bool docOnly)
            (srcMd->getOuterScope()->definitionType()==Definition::TypeFile &&
                md->getOuterScope()->definitionType()==Definition::TypeFile); 
 
-      const ArgumentList *srcMdAl  = srcMd->argumentList();
-      const ArgumentList *mdAl     = md->argumentList();
-      const ArgumentList *tSrcMdAl = srcMd->templateArguments();
-      const ArgumentList *tMdAl    = md->templateArguments();
-      
+      const ArgumentList &srcMdAl  = srcMd->argumentList();
+      const ArgumentList &mdAl     = md->argumentList();
+      const ArgumentList &tSrcMdAl = srcMd->templateArguments();
+      const ArgumentList &tMdAl    = md->templateArguments();
+
       if (srcMd->isFunction() && md->isFunction() && // both are a function
-          ((tSrcMdAl==0 && tMdAl==0) || 
-           (tSrcMdAl!=0 && tMdAl!=0 && tSrcMdAl->count()==tMdAl->count())
-          ) &&       // same number of template arguments
+          (tSrcMdAl.size()==tMdAl.size()) &&       // same number of template arguments
           matchArguments2(srcMd->getOuterScope(),srcMd->getFileDef(),srcMdAl,
                           md->getOuterScope(),md->getFileDef(),mdAl,
                           TRUE
@@ -1460,14 +1458,12 @@ void GroupDefImpl::writeQuickMemberLinks(OutputList &ol,const MemberDef *current
 
 //---- helper functions ------------------------------------------------------
 
-void addClassToGroups(Entry *root,ClassDef *cd)
+void addClassToGroups(const Entry *root,ClassDef *cd)
 {
-  QListIterator<Grouping> gli(*root->groups);
-  Grouping *g;
-  for (;(g=gli.current());++gli)
+  for (const Grouping &g : root->groups)
   {
     GroupDef *gd=0;
-    if (!g->groupname.isEmpty() && (gd=Doxygen::groupSDict->find(g->groupname)))
+    if (!g.groupname.isEmpty() && (gd=Doxygen::groupSDict->find(g.groupname)))
     {
       if (gd->addClass(cd)) 
       {
@@ -1478,16 +1474,14 @@ void addClassToGroups(Entry *root,ClassDef *cd)
   }
 }
 
-void addNamespaceToGroups(Entry *root,NamespaceDef *nd)
+void addNamespaceToGroups(const Entry *root,NamespaceDef *nd)
 {
-  //printf("root->groups->count()=%d\n",root->groups->count());
-  QListIterator<Grouping> gli(*root->groups);
-  Grouping *g;
-  for (;(g=gli.current());++gli)
+  //printf("root->groups.size()=%d\n",root->groups.size());
+  for (const Grouping &g : root->groups)
   {
     GroupDef *gd=0;
     //printf("group '%s'\n",s->data());
-    if (!g->groupname.isEmpty() && (gd=Doxygen::groupSDict->find(g->groupname)))
+    if (!g.groupname.isEmpty() && (gd=Doxygen::groupSDict->find(g.groupname)))
     {
       if (gd->addNamespace(nd)) nd->makePartOfGroup(gd);
       //printf("Namespace %s: in group %s\n",nd->name().data(),s->data());
@@ -1495,16 +1489,14 @@ void addNamespaceToGroups(Entry *root,NamespaceDef *nd)
   }
 }
 
-void addDirToGroups(Entry *root,DirDef *dd)
+void addDirToGroups(const Entry *root,DirDef *dd)
 {
-  //printf("*** root->groups->count()=%d\n",root->groups->count());
-  QListIterator<Grouping> gli(*root->groups);
-  Grouping *g;
-  for (;(g=gli.current());++gli)
+  //printf("*** root->groups.size()=%d\n",root->groups.size());
+  for (const Grouping &g : root->groups)
   {
     GroupDef *gd=0;
     //printf("group '%s'\n",g->groupname.data());
-    if (!g->groupname.isEmpty() && (gd=Doxygen::groupSDict->find(g->groupname)))
+    if (!g.groupname.isEmpty() && (gd=Doxygen::groupSDict->find(g.groupname)))
     {
       gd->addDir(dd);
       dd->makePartOfGroup(gd);
@@ -1513,16 +1505,13 @@ void addDirToGroups(Entry *root,DirDef *dd)
   }
 }
 
-void addGroupToGroups(Entry *root,GroupDef *subGroup)
+void addGroupToGroups(const Entry *root,GroupDef *subGroup)
 {
-  //printf("addGroupToGroups for %s groups=%d\n",root->name.data(),
-  //    root->groups?root->groups->count():-1);
-  QListIterator<Grouping> gli(*root->groups);
-  Grouping *g;
-  for (;(g=gli.current());++gli)
+  //printf("addGroupToGroups for %s groups=%d\n",root->name.data(),root->groups.size());
+  for (const Grouping &g : root->groups)
   {
     GroupDef *gd=0;
-    if (!g->groupname.isEmpty() && (gd=Doxygen::groupSDict->find(g->groupname)))
+    if (!g.groupname.isEmpty() && (gd=Doxygen::groupSDict->find(g.groupname)))
     {
       if (gd==subGroup)
       {
@@ -1544,24 +1533,22 @@ void addGroupToGroups(Entry *root,GroupDef *subGroup)
 }
 
 /*! Add a member to the group with the highest priority */
-void addMemberToGroups(Entry *root,MemberDef *md)
+void addMemberToGroups(const Entry *root,MemberDef *md)
 {
   //printf("addMemberToGroups:  Root %p = %s, md %p=%s groups=%d\n", 
   //    root, root->name.data(), md, md->name().data(), root->groups->count() );
-  QListIterator<Grouping> gli(*root->groups);
-  Grouping *g;
 
   // Search entry's group list for group with highest pri.
   Grouping::GroupPri_t pri = Grouping::GROUPING_LOWEST;
   GroupDef *fgd=0;
-  for (;(g=gli.current());++gli)
+  for (const Grouping &g : root->groups)
   {
     GroupDef *gd=0;
-    if (!g->groupname.isEmpty() &&
-        (gd=Doxygen::groupSDict->find(g->groupname)) &&
-        g->pri >= pri)
+    if (!g.groupname.isEmpty() &&
+        (gd=Doxygen::groupSDict->find(g.groupname)) &&
+        g.pri >= pri)
     {
-      if (fgd && gd!=fgd && g->pri==pri) 
+      if (fgd && gd!=fgd && g.pri==pri) 
       {
         warn(root->fileName.data(), root->startLine,
             "Member %s found in multiple %s groups! "
@@ -1572,7 +1559,7 @@ void addMemberToGroups(Entry *root,MemberDef *md)
       }
 
       fgd = gd;
-      pri = g->pri;
+      pri = g.pri;
     }
   }
   //printf("fgd=%p\n",fgd);
@@ -1650,14 +1637,12 @@ void addMemberToGroups(Entry *root,MemberDef *md)
 }
 
 
-void addExampleToGroups(Entry *root,PageDef *eg)
+void addExampleToGroups(const Entry *root,PageDef *eg)
 {
-  QListIterator<Grouping> gli(*root->groups);
-  Grouping *g;
-  for (;(g=gli.current());++gli)
+  for (const Grouping &g : root->groups)
   {
     GroupDef *gd=0;
-    if (!g->groupname.isEmpty() && (gd=Doxygen::groupSDict->find(g->groupname)))
+    if (!g.groupname.isEmpty() && (gd=Doxygen::groupSDict->find(g.groupname)))
     {
       gd->addExample(eg);
       eg->makePartOfGroup(gd);
@@ -1674,7 +1659,7 @@ QCString GroupDefImpl::getOutputFileBase() const
 void GroupDefImpl::addListReferences()
 {
   {
-    QList<ListItemInfo> *xrefItems = xrefListItems();
+    const std::vector<ListItemInfo> &xrefItems = xrefListItems();
     addRefItem(xrefItems,
              getOutputFileBase(),
              theTranslator->trGroup(TRUE,TRUE),
index 92d524f..8a84a98 100644 (file)
@@ -18,6 +18,8 @@
 #ifndef GROUPDEF_H
 #define GROUPDEF_H
 
+#include <memory>
+
 #include "sortdict.h"
 #include "definition.h"
 
@@ -138,13 +140,13 @@ class GroupListIterator : public QListIterator<GroupDef>
     virtual ~GroupListIterator() {}
 };
 
-void addClassToGroups(Entry *root,ClassDef *cd);
-void addNamespaceToGroups(Entry *root,NamespaceDef *nd);
-void addGroupToGroups(Entry *root,GroupDef *subGroup);
-void addMemberToGroups(Entry *root,MemberDef *md);
-void addPageToGroups(Entry *root,PageDef *pd);
-void addExampleToGroups(Entry *root,PageDef *eg);
-void addDirToGroups(Entry *root,DirDef *dd);
+void addClassToGroups    (const Entry *root,ClassDef *cd);
+void addNamespaceToGroups(const Entry *root,NamespaceDef *nd);
+void addGroupToGroups    (const Entry *root,GroupDef *subGroup);
+void addMemberToGroups   (const Entry *root,MemberDef *md);
+void addPageToGroups     (const Entry *root,PageDef *pd);
+void addExampleToGroups  (const Entry *root,PageDef *eg);
+void addDirToGroups      (const Entry *root,DirDef *dd);
 
 #endif
 
index 4c49dce..bf6d74e 100644 (file)
@@ -47,6 +47,7 @@ class GrowBuf
                       }
     const char *get()     { return str; }
     int getPos() const    { return pos; }
+    void setPos(const int newPos) { pos = newPos; }
     char at(int i) const  { return str[i]; }
   private:
     char *str;
index 51cd6d9..1a240b1 100644 (file)
@@ -89,13 +89,13 @@ bool Htags::execute(const QCString &htmldir)
   QCString oldDir = QDir::currentDirPath().utf8();
   QDir::setCurrent(g_inputDir.absPath());
   //printf("CommandLine=[%s]\n",commandLine.data());
-  portable_sysTimerStart();
-  bool result=portable_system("htags",commandLine,FALSE)==0;
+  Portable::sysTimerStart();
+  bool result=Portable::system("htags",commandLine,FALSE)==0;
   if (!result)
   {
     err("Problems running %s. Check your installation\n", "htags");
   }
-  portable_sysTimerStop();
+  Portable::sysTimerStop();
   QDir::setCurrent(oldDir);
   return result;
 }
index e1ff3e9..424fead 100644 (file)
@@ -65,7 +65,7 @@ static const char *contexts[10] =
   "intertd"    // 9
 };
 
-static QCString convertIndexWordToAnchor(const QString &word)
+static QCString convertIndexWordToAnchor(const QCString &word)
 {
   static char hex[] = "0123456789abcdef";
   static int cnt = 0;
@@ -263,6 +263,12 @@ static QCString htmlAttribsToString(const HtmlAttribList &attribs, QCString *pAl
         result+="=\""+convertToXML(att->value)+"\"";
       }
     }
+    else if (att->name=="nowrap") // In XHTML, attribute minimization is forbidden, and the nowrap attribute must be defined as <td nowrap="nowrap">.
+    {
+        result+=" ";
+        result+=att->name;
+        result+="=\"nowrap\"";
+    }
   }
   return result;
 }
@@ -400,6 +406,9 @@ void HtmlDocVisitor::visit(DocStyleChange *s)
     case DocStyleChange::Bold:
       if (s->enable()) m_t << "<b" << htmlAttribsToString(s->attribs()) << ">";      else m_t << "</b>";
       break;
+    case DocStyleChange::S:
+      if (s->enable()) m_t << "<s" << htmlAttribsToString(s->attribs()) << ">";      else m_t << "</s>";
+      break;
     case DocStyleChange::Strike:
       if (s->enable()) m_t << "<strike" << htmlAttribsToString(s->attribs()) << ">";      else m_t << "</strike>";
       break;
@@ -512,8 +521,8 @@ void HtmlDocVisitor::visit(DocVerbatim *s)
     case DocVerbatim::Code: 
       forceEndParagraph(s);
       m_t << PREFRAG_START;
-      Doxygen::parserManager->getParser(lang)
-                            ->parseCode(m_ci,
+      Doxygen::parserManager->getCodeParser(lang)
+                             .parseCode(m_ci,
                                         s->context(),
                                         s->text(),
                                         langExt,
@@ -660,8 +669,8 @@ void HtmlDocVisitor::visit(DocInclude *inc)
     case DocInclude::Include: 
       forceEndParagraph(inc);
       m_t << PREFRAG_START;
-      Doxygen::parserManager->getParser(inc->extension())
-                            ->parseCode(m_ci,                 
+      Doxygen::parserManager->getCodeParser(inc->extension())
+                             .parseCode(m_ci,                 
                                         inc->context(),
                                         inc->text(),
                                         langExt,
@@ -684,8 +693,8 @@ void HtmlDocVisitor::visit(DocInclude *inc)
          m_t << PREFRAG_START;
          QFileInfo cfi( inc->file() );
          FileDef *fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
-         Doxygen::parserManager->getParser(inc->extension())
-                               ->parseCode(m_ci,
+         Doxygen::parserManager->getCodeParser(inc->extension())
+                                .parseCode(m_ci,
                                            inc->context(),
                                            inc->text(),
                                            langExt,
@@ -726,8 +735,8 @@ void HtmlDocVisitor::visit(DocInclude *inc)
       {
          forceEndParagraph(inc);
          m_t << PREFRAG_START;
-         Doxygen::parserManager->getParser(inc->extension())
-                               ->parseCode(m_ci,
+         Doxygen::parserManager->getCodeParser(inc->extension())
+                                .parseCode(m_ci,
                                            inc->context(),
                                            extractBlock(inc->text(),inc->blockId()),
                                            langExt,
@@ -751,8 +760,8 @@ void HtmlDocVisitor::visit(DocInclude *inc)
          m_t << PREFRAG_START;
          QFileInfo cfi( inc->file() );
          FileDef *fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
-         Doxygen::parserManager->getParser(inc->extension())
-                               ->parseCode(m_ci,
+         Doxygen::parserManager->getCodeParser(inc->extension())
+                                .parseCode(m_ci,
                                            inc->context(),
                                            extractBlock(inc->text(),inc->blockId()),
                                            langExt,
@@ -804,8 +813,8 @@ void HtmlDocVisitor::visit(DocIncOperator *op)
         QFileInfo cfi( op->includeFileName() );
         fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
       }
-      Doxygen::parserManager->getParser(locLangExt)
-                            ->parseCode(
+      Doxygen::parserManager->getCodeParser(locLangExt)
+                             .parseCode(
                                 m_ci,
                                 op->context(),
                                 op->text(),
@@ -1253,7 +1262,7 @@ void HtmlDocVisitor::visitPre(DocPara *p)
   if (needsTag)
     m_t << "<p" << getDirHtmlClassOfNode(getTextDirByConfig(p), contexts[t]) << htmlAttribsToString(p->attribs()) << ">";
   else if(!paragraphAlreadyStarted)
-    m_t << getHtmlDirEmbedingChar(getTextDirByConfig(p)) << htmlAttribsToString(p->attribs());
+    m_t << getHtmlDirEmbeddingChar(getTextDirByConfig(p)) << htmlAttribsToString(p->attribs());
 }
 
 void HtmlDocVisitor::visitPost(DocPara *p)
@@ -1544,7 +1553,7 @@ void HtmlDocVisitor::visitPre(DocHtmlTable *t)
     }
   }
 
-  QString attrs = htmlAttribsToString(t->attribs());
+  QCString attrs = htmlAttribsToString(t->attribs());
   if (attrs.isEmpty())
   {
     m_t << "<table";
@@ -1679,7 +1688,7 @@ void HtmlDocVisitor::visitPre(DocImage *img)
       forceEndParagraph(img);
     }
     if (m_hide) return;
-    QString baseName=img->name();
+    QCString baseName=img->name();
     int i;
     if ((i=baseName.findRev('/'))!=-1 || (i=baseName.findRev('\\'))!=-1)
     {
@@ -1719,7 +1728,7 @@ void HtmlDocVisitor::visitPre(DocImage *img)
     }
     if (typeSVG)
     {
-      m_t << "<object type=\"image/svg+xml\" data=\"" << src
+      m_t << "<object type=\"image/svg+xml\" data=\"" << convertToHtml(src)
         << "\"" << sizeAttribs << attrs;
       if (inlineImage)
       {
@@ -1751,7 +1760,7 @@ void HtmlDocVisitor::visitPre(DocImage *img)
       else
       {
         m_t << "<div class=\"caption\">" << endl;
-        m_t << getHtmlDirEmbedingChar(getTextDirByConfig(img));
+        m_t << getHtmlDirEmbeddingChar(getTextDirByConfig(img));
       }
     }
     else if (inlineImage)
@@ -1906,12 +1915,7 @@ void HtmlDocVisitor::visitPost(DocRef *ref)
 void HtmlDocVisitor::visitPre(DocSecRefItem *ref)
 {
   if (m_hide) return;
-  QString refName=ref->file();
-  if (refName.right(Doxygen::htmlFileExtension.length())!=
-      QString(Doxygen::htmlFileExtension))
-  {
-    refName+=Doxygen::htmlFileExtension;
-  }
+  QCString refName=addHtmlExtensionIfMissing(ref->file());
   m_t << "<li><a href=\"" << refName << "#" << ref->anchor() << "\">";
 
 }
@@ -1940,7 +1944,7 @@ void HtmlDocVisitor::visitPost(DocSecRefList *s)
 
 //void HtmlDocVisitor::visitPre(DocLanguage *l)
 //{
-//  QString langId = Config_getEnum(OUTPUT_LANGUAGE);
+//  QCString langId = Config_getEnum(OUTPUT_LANGUAGE);
 //  if (l->id().lower()!=langId.lower())
 //  {
 //    pushEnabled();
@@ -1950,7 +1954,7 @@ void HtmlDocVisitor::visitPost(DocSecRefList *s)
 //
 //void HtmlDocVisitor::visitPost(DocLanguage *l) 
 //{
-//  QString langId = Config_getEnum(OUTPUT_LANGUAGE);
+//  QCString langId = Config_getEnum(OUTPUT_LANGUAGE);
 //  if (l->id().lower()!=langId.lower())
 //  {
 //    popEnabled();
@@ -2092,7 +2096,7 @@ void HtmlDocVisitor::visitPre(DocXRefItem *x)
   {
     m_t << "<dl" << getDirHtmlClassOfNode(getTextDirByConfig(x), x->key())  
         << "><dt><b><a class=\"el\" href=\""
-        << x->relPath() << x->file() << Doxygen::htmlFileExtension 
+        << x->relPath() << addHtmlExtensionIfMissing(x->file())
         << "#" << x->anchor() << "\">";
   }
   else 
@@ -2138,7 +2142,7 @@ void HtmlDocVisitor::visitPre(DocHtmlBlockQuote *b)
 {
   if (m_hide) return;
   forceEndParagraph(b);
-  QString attrs = htmlAttribsToString(b->attribs());
+  QCString attrs = htmlAttribsToString(b->attribs());
   if (attrs.isEmpty())
   {
     m_t << "<blockquote" << getDirHtmlClassOfNode(getTextDirByConfig(b), "doxtable")
@@ -2256,7 +2260,10 @@ void HtmlDocVisitor::startLink(const QCString &ref,const QCString &file,
   }
   m_t << "href=\"";
   m_t << externalRef(relPath,ref,TRUE);
-  if (!file.isEmpty()) m_t << file << Doxygen::htmlFileExtension;
+  if (!file.isEmpty())
+  {
+    m_t << addHtmlExtensionIfMissing(file);
+  }
   if (!anchor.isEmpty()) m_t << "#" << anchor;
   m_t << "\"";
   if (!tooltip.isEmpty()) m_t << " title=\"" << convertToHtml(tooltip) << "\"";
@@ -2485,7 +2492,7 @@ void HtmlDocVisitor::forceStartParagraph(DocNode *n)
     if (needsTag)
       m_t << "<p" << getDirHtmlClassOfNode(getTextDirByConfig(para, nodeIndex)) << ">";
     else
-      m_t << getHtmlDirEmbedingChar(getTextDirByConfig(para, nodeIndex));
+      m_t << getHtmlDirEmbeddingChar(getTextDirByConfig(para, nodeIndex));
   }
 }
 
index 402b4e4..bf52eed 100644 (file)
@@ -49,6 +49,7 @@
 #include "bufstr.h"
 #include "resourcemgr.h"
 #include "tooltip.h"
+#include "growbuf.h"
 
 //#define DBG_HTML(x) x;
 #define DBG_HTML(x)
@@ -56,6 +57,7 @@
 static QCString g_header;
 static QCString g_footer;
 static QCString g_mathjax_code;
+static QCString g_latex_macro;
 
 static bool DoxyCodeLineOpen = FALSE;
 
@@ -112,6 +114,174 @@ static void writeServerSearchBox(FTextStream &t,const char *relPath,bool highlig
 }
 
 //------------------------------------------------------------------------
+/// Convert a set of LaTeX `\(re)newcommand` to a form readable by MathJax
+/// LaTeX syntax:
+///       \newcommand{\cmd}{replacement}
+///         or
+///       \renewcommand{\cmd}{replacement}
+/// MathJax syntax:
+///        cmd: "{replacement}"
+///
+/// LaTeX syntax:
+///       \newcommand{\cmd}[nr]{replacement}
+///         or
+///       \renewcommand{\cmd}[nr]{replacement}
+/// MathJax syntax:
+///        cmd: ["{replacement}",nr]
+static QCString getConvertLatexMacro()
+{
+  QCString macrofile = Config_getString(FORMULA_MACROFILE);
+  if (macrofile.isEmpty()) return "";
+  QCString s = fileToString(macrofile);
+  macrofile = QFileInfo(macrofile).absFilePath().utf8();
+  int size = s.length();
+  GrowBuf out(size);
+  const char *data = s.data();
+  int line = 1;
+  int cnt = 0;
+  int i = 0;
+  QCString nr;
+  while (i < size)
+  {
+    nr = "";
+    // skip initial white space, but count lines
+    while (i < size && (data[i] == ' ' || data[i] == '\t' || data[i] == '\n'))
+    {
+      if (data[i] == '\n') line++;
+      i++;
+    }
+    if (i >= size) break;
+    // check for \newcommand or \renewcommand
+    if (data[i] != '\\')
+    {
+      warn(macrofile,line, "file contains non valid code, expected '\\' got '%c'\n",data[i]);
+      return "";
+    }
+    i++;
+    if (!qstrncmp(data + i, "newcommand", strlen("newcommand"))) i += strlen("newcommand");
+    else if (!qstrncmp(data + i, "renewcommand", strlen("renewcommand"))) i += strlen("renewcommand");
+    else
+    {
+      warn(macrofile,line, "file contains non valid code, expected 'newcommand' or 'renewcommand'");
+      return "";
+    }
+    // handle {cmd}
+    if (data[i] != '{')
+    {
+      warn(macrofile,line, "file contains non valid code, expected '{' got '%c'\n",data[i]);
+      return "";
+    }
+    i++;
+    if (data[i] != '\\')
+    {
+      warn(macrofile,line, "file contains non valid code, expected '\\' got '%c'\n",data[i]);
+      return "";
+    }
+    i++;
+    // run till }, i.e. cmd
+    out.addStr("    ");
+    while (i < size && (data[i] != '}')) out.addChar(data[i++]);
+    if (i >= size)
+    {
+      warn(macrofile,line, "file contains non valid code, no closing '}' for command");
+      return "";
+    }
+    out.addChar(':');
+    out.addChar(' ');
+    i++;
+
+    if (data[i] == '[')
+    {
+      // handle [nr]
+      // run till ]
+      out.addChar('[');
+      i++;
+      while (i < size && (data[i] != ']')) nr += data[i++];
+      if (i >= size)
+      {
+        warn(macrofile,line, "file contains non valid code, no closing ']'");
+        return "";
+      }
+      i++;
+    }
+    else if (data[i] != '{')
+    {
+      warn(macrofile,line, "file contains non valid code, expected '[' or '{' got '%c'\n",data[i]);
+      return "";
+    }
+    // handle {replacement}
+    // retest as the '[' part might have advanced so we can have a new '{'
+    if (data[i] != '{')
+    {
+      warn(macrofile,line, "file contains non valid code, expected '{' got '%c'\n",data[i]);
+      return "";
+    }
+    out.addChar('"');
+    out.addChar('{');
+    i++;
+    // run till }
+    cnt = 1;
+    while (i < size && cnt)
+    {
+      switch(data[i])
+      {
+        case '\\':
+          out.addChar('\\'); // need to escape it for MathJax js code
+          out.addChar('\\');
+          i++;
+          if (data[i] == '\\') // we have an escaped backslash
+          {
+            out.addChar('\\');
+            out.addChar('\\');
+            i++;
+          }
+          else if (data[i] != '"') out.addChar(data[i++]); // double quote handled separately
+          break;
+        case '{':
+          cnt++;
+          out.addChar(data[i++]);
+          break;
+        case '}':
+          cnt--;
+          if (cnt) out.addChar(data[i]);
+          i++;
+          break;
+        case '"':
+          out.addChar('\\'); // need to escape it for MathJax js code
+          out.addChar(data[i++]);
+          break;
+        case '\n':
+          line++;
+          out.addChar(data[i++]);
+          break;
+        default:
+          out.addChar(data[i++]);
+          break;
+      }
+    }
+    if (i > size)
+    {
+      warn(macrofile,line, "file contains non valid code, no closing '}' for replacement");
+      return "";
+    }
+    out.addChar('}');
+    out.addChar('"');
+    if (!nr.isEmpty())
+    {
+      out.addChar(',');
+      out.addStr(nr);
+    }
+    if (!nr.isEmpty())
+    {
+      out.addChar(']');
+    }
+    out.addChar(',');
+    out.addChar('\n');
+  }
+  out.addChar(0);
+  return out.get();
+}
+//------------------------------------------------------------------------
 
 /// Clear a text block \a s from \a begin to \a end markers
 QCString clearBlock(const char *s,const char *begin,const char *end)
@@ -229,7 +399,7 @@ static QCString substituteHtmlKeywords(const QCString &s,
                                        const QCString &relPath,
                                        const QCString &navPath=QCString())
 {
-  // Build CSS/Javascript tags depending on treeview, search engine settings
+  // Build CSS/JavaScript tags depending on treeview, search engine settings
   QCString cssFile;
   QStrList extraCssFile;
   QCString generatedBy;
@@ -300,12 +470,7 @@ static QCString substituteHtmlKeywords(const QCString &s,
     treeViewCssJs = "<link href=\"$relpath^navtree.css\" rel=\"stylesheet\" type=\"text/css\"/>\n"
                        "<script type=\"text/javascript\" src=\"$relpath^resize.js\"></script>\n"
                        "<script type=\"text/javascript\" src=\"$relpath^navtreedata.js\"></script>\n"
-                       "<script type=\"text/javascript\" src=\"$relpath^navtree.js\"></script>\n"
-                       "<script type=\"text/javascript\">\n"
-                       "/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */\n"
-                       "  $(document).ready(initResizable);\n"
-                       "/* @license-end */"
-                       "</script>";
+                       "<script type=\"text/javascript\" src=\"$relpath^navtree.js\"></script>\n";
   }
 
   if (searchEngine)
@@ -381,7 +546,18 @@ static QCString substituteHtmlKeywords(const QCString &s,
       mathJaxJs += g_mathjax_code;
       mathJaxJs += "\n";
     }
-    mathJaxJs += "</script>";
+    mathJaxJs += "</script>\n";
+    if (!g_latex_macro.isEmpty())
+    {
+      mathJaxJs += "<script type=\"text/x-mathjax-config\">\n"
+                   "  MathJax.Hub.Config({\n"
+                  "   TeX: { Macros: {\n";
+      mathJaxJs += g_latex_macro;
+      mathJaxJs += "\n"
+                   "  } }\n"
+                   "});\n"
+                   "</script>\n";
+    }
     mathJaxJs += "<script type=\"text/javascript\" async=\"async\" src=\"" + path + "MathJax.js\"></script>\n";
   }
 
@@ -492,7 +668,7 @@ void HtmlCodeGenerator::codify(const char *str)
 
 void HtmlCodeGenerator::docify(const char *str)
 {
-  m_t << getHtmlDirEmbedingChar(getTextDirByConfig(str));
+  m_t << getHtmlDirEmbeddingChar(getTextDirByConfig(str));
 
   if (str && m_streamSet)
   {
@@ -548,6 +724,7 @@ void HtmlCodeGenerator::writeLineNumber(const char *ref,const char *filename,
   }
   m_t << "</span>";
   m_t << "&#160;";
+  m_col=0;
 }
 
 void HtmlCodeGenerator::writeCodeLink(const char *ref,const char *f,
@@ -575,7 +752,7 @@ void HtmlCodeGenerator::_writeCodeLink(const char *className,
   }
   m_t << "href=\"";
   m_t << externalRef(m_relPath,ref,TRUE);
-  if (f) m_t << f << Doxygen::htmlFileExtension;
+  if (f) m_t << addHtmlExtensionIfMissing(f);
   if (anchor) m_t << "#" << anchor;
   m_t << "\"";
   if (tooltip) m_t << " title=\"" << convertToHtml(tooltip) << "\"";
@@ -596,7 +773,7 @@ void HtmlCodeGenerator::writeTooltip(const char *id, const DocLinkInfo &docInfo,
   {
     m_t << "<a href=\"";
     m_t << externalRef(m_relPath,docInfo.ref,TRUE);
-    m_t << docInfo.url << Doxygen::htmlFileExtension;
+    m_t << addHtmlExtensionIfMissing(docInfo.url);
     if (!docInfo.anchor.isEmpty())
     {
       m_t << "#" << docInfo.anchor;
@@ -628,7 +805,7 @@ void HtmlCodeGenerator::writeTooltip(const char *id, const DocLinkInfo &docInfo,
     {
       m_t << "<a href=\"";
       m_t << externalRef(m_relPath,defInfo.ref,TRUE);
-      m_t << defInfo.url << Doxygen::htmlFileExtension;
+      m_t << addHtmlExtensionIfMissing(defInfo.url);
       if (!defInfo.anchor.isEmpty())
       {
         m_t << "#" << defInfo.anchor;
@@ -649,7 +826,7 @@ void HtmlCodeGenerator::writeTooltip(const char *id, const DocLinkInfo &docInfo,
     {
       m_t << "<a href=\"";
       m_t << externalRef(m_relPath,declInfo.ref,TRUE);
-      m_t << declInfo.url << Doxygen::htmlFileExtension;
+      m_t << addHtmlExtensionIfMissing(declInfo.url);
       if (!declInfo.anchor.isEmpty())
       {
         m_t << "#" << declInfo.anchor;
@@ -716,7 +893,7 @@ void HtmlCodeGenerator::writeCodeAnchor(const char *anchor)
 
 HtmlGenerator::HtmlGenerator() : OutputGenerator()
 {
-  dir=Config_getString(HTML_OUTPUT);
+  m_dir=Config_getString(HTML_OUTPUT);
   m_emptySection=FALSE;
   m_sectionCount=0;
 }
@@ -732,8 +909,7 @@ void HtmlGenerator::init()
   QDir d(dname);
   if (!d.exists() && !d.mkdir(dname))
   {
-    err("Could not create output directory %s\n",dname.data());
-    exit(1);
+    term("Could not create output directory %s\n",dname.data());
   }
   //writeLogo(dname);
   if (!Config_getString(HTML_HEADER).isEmpty())
@@ -763,6 +939,8 @@ void HtmlGenerator::init()
       g_mathjax_code=fileToString(Config_getString(MATHJAX_CODEFILE));
       //printf("g_mathjax_code='%s'\n",g_mathjax_code.data());
     }
+    g_latex_macro=getConvertLatexMacro();
+    //printf("converted g_latex_macro='%s'\n",g_latex_macro.data());
   }
   createSubDirs(d);
 
@@ -908,21 +1086,17 @@ void HtmlGenerator::startFile(const char *name,const char *,
                               const char *title)
 {
   //printf("HtmlGenerator::startFile(%s)\n",name);
-  QCString fileName=name;
-  lastTitle=title;
-  relPath = relativePathToRoot(fileName);
+  m_relPath = relativePathToRoot(name);
+  QCString fileName = addHtmlExtensionIfMissing(name);
+  m_lastTitle=title;
 
-  if (fileName.right(Doxygen::htmlFileExtension.length())!=Doxygen::htmlFileExtension)
-  {
-    fileName+=Doxygen::htmlFileExtension;
-  }
   startPlainFile(fileName);
   m_codeGen.setTextStream(t);
-  m_codeGen.setRelativePath(relPath);
+  m_codeGen.setRelativePath(m_relPath);
   Doxygen::indexList->addIndexFile(fileName);
 
-  lastFile = fileName;
-  t << substituteHtmlKeywords(g_header,convertToHtml(filterTitle(title)),relPath);
+  m_lastFile = fileName;
+  t << substituteHtmlKeywords(g_header,convertToHtml(filterTitle(title)),m_relPath);
 
   t << "<!-- " << theTranslator->trGeneratedBy() << " Doxygen "
     << getVersion() << " -->" << endl;
@@ -933,7 +1107,7 @@ void HtmlGenerator::startFile(const char *name,const char *,
     t << "<script type=\"text/javascript\">\n";
                t << "/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */\n";
                t << "var searchBox = new SearchBox(\"searchBox\", \""
-      << relPath<< "search\",false,'" << theTranslator->trSearch() << "');\n";
+      << m_relPath<< "search\",false,'" << theTranslator->trSearch() << "');\n";
                t << "/* @license-end */\n";
     t << "</script>\n";
   }
@@ -941,13 +1115,12 @@ void HtmlGenerator::startFile(const char *name,const char *,
   m_sectionCount=0;
 }
 
-void HtmlGenerator::writeSearchInfo(FTextStream &t,const QCString &relPath)
+void HtmlGenerator::writeSearchInfo(FTextStream &t,const QCString &)
 {
   static bool searchEngine      = Config_getBool(SEARCHENGINE);
   static bool serverBasedSearch = Config_getBool(SERVER_BASED_SEARCH);
   if (searchEngine && !serverBasedSearch)
   {
-    (void)relPath;
     t << "<!-- window showing the filter options -->\n";
     t << "<div id=\"MSearchSelectWindow\"\n";
     t << "     onmouseover=\"return searchBox.OnSearchSelectShow()\"\n";
@@ -967,7 +1140,7 @@ void HtmlGenerator::writeSearchInfo(FTextStream &t,const QCString &relPath)
 
 void HtmlGenerator::writeSearchInfo()
 {
-  writeSearchInfo(t,relPath);
+  writeSearchInfo(t,m_relPath);
 }
 
 
@@ -997,7 +1170,7 @@ QCString HtmlGenerator::writeLogoAsString(const char *path)
 
 void HtmlGenerator::writeLogo()
 {
-  t << writeLogoAsString(relPath);
+  t << writeLogoAsString(m_relPath);
 }
 
 void HtmlGenerator::writePageFooter(FTextStream &t,const QCString &lastTitle,
@@ -1011,7 +1184,7 @@ void HtmlGenerator::writeFooter(const char *navPath)
   // Currently only tooltips in HTML
   TooltipManager::instance()->writeTooltips(m_codeGen);
 
-  writePageFooter(t,lastTitle,relPath,navPath);
+  writePageFooter(t,m_lastTitle,m_relPath,navPath);
 }
 
 void HtmlGenerator::endFile()
@@ -1148,8 +1321,8 @@ void HtmlGenerator::startIndexItem(const char *ref,const char *f)
       t << "<a class=\"el\" ";
     }
     t << "href=\"";
-    t << externalRef(relPath,ref,TRUE);
-    if (f) t << f << Doxygen::htmlFileExtension;
+    t << externalRef(m_relPath,ref,TRUE);
+    if (f) t << addHtmlExtensionIfMissing(f);
     t << "\">";
   }
   else
@@ -1176,7 +1349,7 @@ void HtmlGenerator::writeStartAnnoItem(const char *,const char *f,
 {
   t << "<li>";
   if (path) docify(path);
-  t << "<a class=\"el\" href=\"" << f << Doxygen::htmlFileExtension << "\">";
+  t << "<a class=\"el\" href=\"" << addHtmlExtensionIfMissing(f) << "\">";
   docify(name);
   t << "</a> ";
 }
@@ -1194,8 +1367,8 @@ void HtmlGenerator::writeObjectLink(const char *ref,const char *f,
     t << "<a class=\"el\" ";
   }
   t << "href=\"";
-  t << externalRef(relPath,ref,TRUE);
-  if (f) t << f << Doxygen::htmlFileExtension;
+  t << externalRef(m_relPath,ref,TRUE);
+  if (f) t << addHtmlExtensionIfMissing(f);
   if (anchor) t << "#" << anchor;
   t << "\">";
   docify(name);
@@ -1205,7 +1378,7 @@ void HtmlGenerator::writeObjectLink(const char *ref,const char *f,
 void HtmlGenerator::startTextLink(const char *f,const char *anchor)
 {
   t << "<a href=\"";
-  if (f)   t << relPath << f << Doxygen::htmlFileExtension;
+  if (f)   t << m_relPath << addHtmlExtensionIfMissing(f);
   if (anchor) t << "#" << anchor;
   t << "\">";
 }
@@ -1408,7 +1581,7 @@ static void endSectionContent(FTextStream &t)
 
 void HtmlGenerator::startClassDiagram()
 {
-  startSectionHeader(t,relPath,m_sectionCount);
+  startSectionHeader(t,m_relPath,m_sectionCount);
 }
 
 void HtmlGenerator::endClassDiagram(const ClassDiagram &d,
@@ -1421,12 +1594,12 @@ void HtmlGenerator::endClassDiagram(const ClassDiagram &d,
   startSectionSummary(t,m_sectionCount);
   endSectionSummary(t);
   startSectionContent(t,m_sectionCount);
-  d.writeImage(tt,dir,relPath,fileName);
+  d.writeImage(tt,m_dir,m_relPath,fileName);
   if (!result.isEmpty())
   {
     t << " <div class=\"center\">" << endl;
     t << "  <img src=\"";
-    t << relPath << fileName << ".png\" usemap=\"#" << convertToId(name);
+    t << m_relPath << fileName << ".png\" usemap=\"#" << convertToId(name);
     t << "_map\" alt=\"\"/>" << endl;
     t << "  <map id=\"" << convertToId(name);
     t << "_map\" name=\"" << convertToId(name);
@@ -1439,7 +1612,7 @@ void HtmlGenerator::endClassDiagram(const ClassDiagram &d,
   {
     t << " <div class=\"center\">" << endl;
     t << "  <img src=\"";
-    t << relPath << fileName << ".png\" alt=\"\"/>" << endl;
+    t << m_relPath << fileName << ".png\" alt=\"\"/>" << endl;
     t << " </div>";
   }
   endSectionContent(t);
@@ -1792,7 +1965,7 @@ void HtmlGenerator::endMemberDoc(bool hasArgs)
 
 void HtmlGenerator::startDotGraph()
 {
-  startSectionHeader(t,relPath,m_sectionCount);
+  startSectionHeader(t,m_relPath,m_sectionCount);
 }
 
 void HtmlGenerator::endDotGraph(DotClassGraph &g)
@@ -1804,11 +1977,11 @@ void HtmlGenerator::endDotGraph(DotClassGraph &g)
   endSectionSummary(t);
   startSectionContent(t,m_sectionCount);
 
-  g.writeGraph(t,GOF_BITMAP,EOF_Html,dir,fileName,relPath,TRUE,TRUE,m_sectionCount);
+  g.writeGraph(t,GOF_BITMAP,EOF_Html,m_dir,m_fileName,m_relPath,TRUE,TRUE,m_sectionCount);
   if (generateLegend && !umlLook)
   {
     t << "<center><span class=\"legend\">[";
-    startHtmlLink(relPath+"graph_legend"+Doxygen::htmlFileExtension);
+    startHtmlLink(m_relPath+"graph_legend"+Doxygen::htmlFileExtension);
     t << theTranslator->trLegend();
     endHtmlLink();
     t << "]</span></center>";
@@ -1820,7 +1993,7 @@ void HtmlGenerator::endDotGraph(DotClassGraph &g)
 
 void HtmlGenerator::startInclDepGraph()
 {
-  startSectionHeader(t,relPath,m_sectionCount);
+  startSectionHeader(t,m_relPath,m_sectionCount);
 }
 
 void HtmlGenerator::endInclDepGraph(DotInclDepGraph &g)
@@ -1830,7 +2003,7 @@ void HtmlGenerator::endInclDepGraph(DotInclDepGraph &g)
   endSectionSummary(t);
   startSectionContent(t,m_sectionCount);
 
-  g.writeGraph(t,GOF_BITMAP,EOF_Html,dir,fileName,relPath,TRUE,m_sectionCount);
+  g.writeGraph(t,GOF_BITMAP,EOF_Html,m_dir,m_fileName,m_relPath,TRUE,m_sectionCount);
 
   endSectionContent(t);
   m_sectionCount++;
@@ -1838,7 +2011,7 @@ void HtmlGenerator::endInclDepGraph(DotInclDepGraph &g)
 
 void HtmlGenerator::startGroupCollaboration()
 {
-  startSectionHeader(t,relPath,m_sectionCount);
+  startSectionHeader(t,m_relPath,m_sectionCount);
 }
 
 void HtmlGenerator::endGroupCollaboration(DotGroupCollaboration &g)
@@ -1848,7 +2021,7 @@ void HtmlGenerator::endGroupCollaboration(DotGroupCollaboration &g)
   endSectionSummary(t);
   startSectionContent(t,m_sectionCount);
 
-  g.writeGraph(t,GOF_BITMAP,EOF_Html,dir,fileName,relPath,TRUE,m_sectionCount);
+  g.writeGraph(t,GOF_BITMAP,EOF_Html,m_dir,m_fileName,m_relPath,TRUE,m_sectionCount);
 
   endSectionContent(t);
   m_sectionCount++;
@@ -1856,7 +2029,7 @@ void HtmlGenerator::endGroupCollaboration(DotGroupCollaboration &g)
 
 void HtmlGenerator::startCallGraph()
 {
-  startSectionHeader(t,relPath,m_sectionCount);
+  startSectionHeader(t,m_relPath,m_sectionCount);
 }
 
 void HtmlGenerator::endCallGraph(DotCallGraph &g)
@@ -1866,7 +2039,7 @@ void HtmlGenerator::endCallGraph(DotCallGraph &g)
   endSectionSummary(t);
   startSectionContent(t,m_sectionCount);
 
-  g.writeGraph(t,GOF_BITMAP,EOF_Html,dir,fileName,relPath,TRUE,m_sectionCount);
+  g.writeGraph(t,GOF_BITMAP,EOF_Html,m_dir,m_fileName,m_relPath,TRUE,m_sectionCount);
 
   endSectionContent(t);
   m_sectionCount++;
@@ -1874,7 +2047,7 @@ void HtmlGenerator::endCallGraph(DotCallGraph &g)
 
 void HtmlGenerator::startDirDepGraph()
 {
-  startSectionHeader(t,relPath,m_sectionCount);
+  startSectionHeader(t,m_relPath,m_sectionCount);
 }
 
 void HtmlGenerator::endDirDepGraph(DotDirDeps &g)
@@ -1884,7 +2057,7 @@ void HtmlGenerator::endDirDepGraph(DotDirDeps &g)
   endSectionSummary(t);
   startSectionContent(t,m_sectionCount);
 
-  g.writeGraph(t,GOF_BITMAP,EOF_Html,dir,fileName,relPath,TRUE,m_sectionCount);
+  g.writeGraph(t,GOF_BITMAP,EOF_Html,m_dir,m_fileName,m_relPath,TRUE,m_sectionCount);
 
   endSectionContent(t);
   m_sectionCount++;
@@ -1892,7 +2065,7 @@ void HtmlGenerator::endDirDepGraph(DotDirDeps &g)
 
 void HtmlGenerator::writeGraphicalHierarchy(DotGfxHierarchyTable &g)
 {
-  g.writeGraph(t,dir,fileName);
+  g.writeGraph(t,m_dir,m_fileName);
 }
 
 void HtmlGenerator::startMemberGroupHeader(bool)
@@ -2369,9 +2542,9 @@ QCString HtmlGenerator::writeSplitBarAsString(const char *name,const char *relpa
                                                                                        "<script type=\"text/javascript\">\n"
                                                                                        "/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */\n"
                                                                                        "$(document).ready(function(){initNavTree('") +
-                       QCString(name) + Doxygen::htmlFileExtension +
+                       QCString(addHtmlExtensionIfMissing(name)) +
                        QCString("','") + relpath +
-                       QCString("');});\n"
+                       QCString("'); initResizable(); });\n"
                                                         "/* @license-end */\n"
                                                         "</script>\n"
                                                         "<div id=\"doc-content\">\n");
@@ -2381,12 +2554,12 @@ QCString HtmlGenerator::writeSplitBarAsString(const char *name,const char *relpa
 
 void HtmlGenerator::writeSplitBar(const char *name)
 {
-  t << writeSplitBarAsString(name,relPath);
+  t << writeSplitBarAsString(name,m_relPath);
 }
 
 void HtmlGenerator::writeNavigationPath(const char *s)
 {
-  t << substitute(s,"$relpath^",relPath);
+  t << substitute(s,"$relpath^",m_relPath);
 }
 
 void HtmlGenerator::startContents()
@@ -2411,7 +2584,7 @@ void HtmlGenerator::endPageDoc()
 
 void HtmlGenerator::writeQuickLinks(bool compact,HighlightedItem hli,const char *file)
 {
-  writeDefaultQuickLinks(t,compact,hli,file,relPath);
+  writeDefaultQuickLinks(t,compact,hli,file,m_relPath);
 }
 
 // PHP based search script
@@ -2800,18 +2973,18 @@ void HtmlGenerator::writeInheritedSectionTitle(
   {
     classLink+= externalLinkTarget();
     classLink += " href=\"";
-    classLink+= externalRef(relPath,ref,TRUE);
+    classLink+= externalRef(m_relPath,ref,TRUE);
   }
   else
   {
     classLink += "href=\"";
-    classLink+=relPath;
+    classLink+=m_relPath;
   }
-  classLink+=file+Doxygen::htmlFileExtension+a;
+  classLink=classLink+addHtmlExtensionIfMissing(file)+a;
   classLink+=QCString("\">")+convertToHtml(name,FALSE)+"</a>";
   t << "<tr class=\"inherit_header " << id << "\">"
     << "<td colspan=\"2\" onclick=\"javascript:toggleInherit('" << id << "')\">"
-    << "<img src=\"" << relPath << "closed.png\" alt=\"-\"/>&#160;"
+    << "<img src=\"" << m_relPath << "closed.png\" alt=\"-\"/>&#160;"
     << theTranslator->trInheritedFrom(convertToHtml(title,FALSE),classLink)
     << "</td></tr>" << endl;
 }
@@ -2829,8 +3002,7 @@ void HtmlGenerator::writeSummaryLink(const char *file,const char *anchor,const c
   t << "<a href=\"";
   if (file)
   {
-    t << relPath << file;
-    t << Doxygen::htmlFileExtension;
+    t << m_relPath << addHtmlExtensionIfMissing(file);
   }
   else
   {
index 2db5b74..fe84061 100644 (file)
@@ -86,12 +86,12 @@ class HtmlGenerator : public OutputGenerator
     static QCString writeSplitBarAsString(const char *name,const char *relpath);
    
     void enable() 
-    { if (genStack->top()) active=*genStack->top(); else active=TRUE; }
-    void disable() { active=FALSE; }
+    { if (m_genStack->top()) m_active=*m_genStack->top(); else m_active=TRUE; }
+    void disable() { m_active=FALSE; }
     void enableIf(OutputType o)  { if (o==Html) enable();  }
     void disableIf(OutputType o) { if (o==Html) disable(); }
     void disableIfNot(OutputType o) { if (o!=Html) disable(); }
-    bool isEnabled(OutputType o) { return (o==Html && active); } 
+    bool isEnabled(OutputType o) { return (o==Html && m_active); } 
     OutputGenerator *get(OutputType o) { return (o==Html) ? this : 0; }
 
     // ---- CodeOutputInterface
@@ -339,9 +339,9 @@ class HtmlGenerator : public OutputGenerator
 
   private:
     static void writePageFooter(FTextStream &t,const QCString &,const QCString &,const QCString &);
-    QCString lastTitle;
-    QCString lastFile;
-    QCString relPath;
+    QCString m_lastTitle;
+    QCString m_lastFile;
+    QCString m_relPath;
     void docify(const char *text,bool inHtmlComment);
 
     HtmlGenerator &operator=(const HtmlGenerator &g);
index 20cb6ca..066e6f7 100644 (file)
@@ -93,7 +93,7 @@ HtmlHelpIndex::~HtmlHelpIndex()
 }
 
 /*! Stores an item in the index if it is not already present. 
- *  Items are stored in alphetical order, by sorting on the
+ *  Items are stored in alphabetical order, by sorting on the
  *  concatenation of \a level1 and \a level2 (if present).
  *
  *  \param level1 the string at level 1 in the index.
@@ -308,8 +308,7 @@ void HtmlHelp::initialize()
   m_fromUtf8 = portable_iconv_open(str,"UTF-8"); 
   if (m_fromUtf8==(void *)(-1))
   {
-    err("unsupported character conversion for CHM_INDEX_ENCODING: '%s'->'UTF-8'\n", str);
-    exit(1);
+    term("unsupported character conversion for CHM_INDEX_ENCODING: '%s'->'UTF-8'\n", str);
   }
 
   /* open the contents file */
@@ -317,8 +316,7 @@ void HtmlHelp::initialize()
   cf = new QFile(fName);
   if (!cf->open(IO_WriteOnly))
   {
-    err("Could not open file %s for writing\n",fName.data());
-    exit(1);
+    term("Could not open file %s for writing\n",fName.data());
   }
   /* Write the header of the contents file */
   cts.setDevice(cf);
@@ -334,8 +332,7 @@ void HtmlHelp::initialize()
   kf = new QFile(fName);
   if (!kf->open(IO_WriteOnly))
   {
-    err("Could not open file %s for writing\n",fName.data());
-    exit(1);
+    term("Could not open file %s for writing\n",fName.data());
   }
   /* Write the header of the contents file */
   kts.setDevice(kf);
index 0631ee4..edc302b 100644 (file)
@@ -41,6 +41,7 @@
 #include "ftvhelp.h"
 #include "dot.h"
 #include "dotgfxhierarchytable.h"
+#include "dotlegendgraph.h"
 #include "pagedef.h"
 #include "dirdef.h"
 #include "vhdldocgen.h"
@@ -367,7 +368,7 @@ void addMembersToIndex(T *def,LayoutDocManager::LayoutPart part,
           {
             const MemberList *enumList = md->enumFieldList();
             bool isDir = enumList!=0 && md->isEnumerate();
-            bool isAnonymous = md->name().find('@')!=-1;
+            bool isAnonymous = md->isAnonymous();
             static bool hideUndocMembers = Config_getBool(HIDE_UNDOC_MEMBERS);
             static bool extractStatic = Config_getBool(EXTRACT_STATIC);
             if (!isAnonymous &&
@@ -1659,7 +1660,7 @@ static void writeNamespaceTree(const NamespaceSDict *nsDict,FTVHelp *ftv,
     const NamespaceDef *nd;
     for (nli.toFirst();(nd=nli.current());++nli)
     {
-      if (nd->localName().find('@')==-1 &&
+      if (!nd->isAnonymous() &&
           (!rootOnly || nd->getOuterScope()==Doxygen::globalScope))
       {
 
@@ -1942,6 +1943,11 @@ inline bool isId1(int c)
   return (c<127 && c>31); // printable ASCII character
 }
 
+static QCString letterToString(uint letter)
+{
+  return QString(QChar(letter)).utf8();
+}
+
 static QCString letterToLabel(uint startLetter)
 {
   char s[11]; // max 0x12345678 + '\0'
@@ -2100,7 +2106,7 @@ static void writeAlphabeticalClassList(OutputList &ol, ClassDef::CompoundType ct
     if (headerItems) alphaLinks += "&#160;|&#160;";
     headerItems++;
     QCString li = letterToLabel(*pLetter);
-    QCString ls = QString(QChar(*pLetter)).utf8();
+    QCString ls = letterToString(*pLetter);
     alphaLinks += (QCString)"<a class=\"qindex\" href=\"#letter_" +
                   li + "\">" +
                   ls + "</a>";
@@ -2243,7 +2249,7 @@ static void writeAlphabeticalClassList(OutputList &ol, ClassDef::CompoundType ct
               ol.writeString("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"
                   "<tr>"
                   "<td><div class=\"ah\">&#160;&#160;");
-              ol.writeString(QString(QChar(cell->letter())).utf8());
+              ol.writeString(letterToString(cell->letter()));
               ol.writeString(         "&#160;&#160;</div>"
                   "</td>"
                   "</tr>"
@@ -2838,7 +2844,7 @@ static void writeMemberList(OutputList &ol,bool useSections,int page,
           if (!firstItem)    ol.endItemListItem();
           if (!firstSection) ol.endItemList();
           QCString cs = letterToLabel(ml->letter());
-          QCString cl = QString(QChar(ml->letter())).utf8();
+          QCString cl = letterToString(ml->letter());
           QCString anchor=(QCString)"index_"+convertToId(cs);
           QCString title=(QCString)"- "+cl+" -";
           ol.startSection(anchor,title,SectionInfo::Subsection);
@@ -3119,7 +3125,7 @@ static void writeQuickMemberIndex(OutputList &ol,
   {
     uint i = ml->letter();
     QCString is = letterToLabel(i);
-    QCString ci = QString(QChar(i)).utf8();
+    QCString ci = letterToString(i);
     QCString anchor;
     QCString extension=Doxygen::htmlFileExtension;
     if (!multiPage)
@@ -3209,7 +3215,7 @@ static void writeClassMemberIndexFiltered(OutputList &ol, ClassMemberHighlight h
       {
         fileName+="_"+letterToLabel(page);
       }
-      QCString cs = QString(QChar(page)).utf8();
+      QCString cs = letterToString(page);
       if (addToIndex)
       {
         Doxygen::indexList->addContentsItem(FALSE,cs,0,fileName,0,FALSE,TRUE);
@@ -3388,7 +3394,7 @@ static void writeFileMemberIndexFiltered(OutputList &ol, FileMemberHighlight hl)
       {
         fileName+="_"+letterToLabel(page);
       }
-      QCString cs = QString(QChar(page)).utf8();
+      QCString cs = letterToString(page);
       if (addToIndex)
       {
         Doxygen::indexList->addContentsItem(FALSE,cs,0,fileName,0,FALSE,TRUE);
@@ -3564,7 +3570,7 @@ static void writeNamespaceMemberIndexFiltered(OutputList &ol,
       {
         fileName+="_"+letterToLabel(page);
       }
-      QCString cs = QString(QChar(page)).utf8();
+      QCString cs = letterToString(page);
       if (addToIndex)
       {
         Doxygen::indexList->addContentsItem(FALSE,cs,0,fileName,0,FALSE,TRUE);
@@ -3919,7 +3925,9 @@ void writeGraphInfo(OutputList &ol)
   if (!Config_getBool(HAVE_DOT) || !Config_getBool(GENERATE_HTML)) return;
   ol.pushGeneratorState();
   ol.disableAllBut(OutputGenerator::Html);
-  generateGraphLegend(Config_getString(HTML_OUTPUT));
+
+  DotLegendGraph gd;
+  gd.writeGraph(Config_getString(HTML_OUTPUT));
 
   bool &stripCommentsStateRef = Config_getBool(STRIP_CODE_COMMENTS);
   bool oldStripCommentsState = stripCommentsStateRef;
@@ -3944,7 +3952,7 @@ void writeGraphInfo(OutputList &ol)
     legendDocs = legendDocs.left(s+8) + "[!-- SVG 0 --]\n" + legendDocs.mid(e);
     //printf("legendDocs=%s\n",legendDocs.data());
   }
-  FileDef *fd = createFileDef("","graph_legend");
+  FileDef *fd = createFileDef("","graph_legend.dox");
   ol.generateDoc("graph_legend",1,fd,0,legendDocs,FALSE,FALSE);
   delete fd;
 
@@ -4052,7 +4060,7 @@ static void writeGroupTreeNode(OutputList &ol, GroupDef *gd, int level, FTVHelp*
           {
             const MemberList *enumList = md->enumFieldList();
             bool isDir = enumList!=0 && md->isEnumerate();
-            if (md->isVisible() && md->name().find('@')==-1)
+            if (md->isVisible() && !md->isAnonymous())
             {
               Doxygen::indexList->addContentsItem(isDir,
                   md->name(),md->getReference(),
@@ -5197,7 +5205,7 @@ void renderMemberIndicesAsJs(FTextStream &t,
           if (!firstLetter) t << "," << endl;
           uint letter = ml->letter();
           QCString is = letterToLabel(letter);
-          QCString ci = QString(QChar(letter)).utf8();
+          QCString ci = letterToString(letter);
           QCString anchor;
           QCString extension=Doxygen::htmlFileExtension;
           QCString fullName = getInfo(i)->fname;
index c6baba5..f571375 100644 (file)
@@ -18,6 +18,7 @@
 #ifndef INDEX_H
 #define INDEX_H
 
+#include <utility>
 #include <qlist.h>
 #include <qcstring.h>
 
@@ -55,61 +56,17 @@ class IndexList : public IndexIntf
   private:
     QList<IndexIntf> m_intfs;
 
-    // --- foreach implementations for various number of arguments
-
-    void foreach(void (IndexIntf::*methodPtr)())
-    {
-      QListIterator<IndexIntf> li(m_intfs);
-      for (li.toFirst();li.current();++li) (li.current()->*methodPtr)();
-    }
-
-    template<typename A1>
-    void foreach(void (IndexIntf::*methodPtr)(A1),A1 a1)
-    {
-      QListIterator<IndexIntf> li(m_intfs);
-      for (li.toFirst();li.current();++li) (li.current()->*methodPtr)(a1);
-    }
-
-    template<typename A1,typename A2,typename A3>
-    void foreach(void (IndexIntf::*methodPtr)(A1,A2,A3),A1 a1,A2 a2,A3 a3)
-    {
-      QListIterator<IndexIntf> li(m_intfs);
-      for (li.toFirst();li.current();++li) (li.current()->*methodPtr)(a1,a2,a3);
-    }
-
-    template<typename A1,typename A2,typename A3,typename A4>
-    void foreach(void (IndexIntf::*methodPtr)(A1,A2,A3,A4),A1 a1,A2 a2,A3 a3,A4 a4)
-    {
-      QListIterator<IndexIntf> li(m_intfs);
-      for (li.toFirst();li.current();++li) (li.current()->*methodPtr)(a1,a2,a3,a4);
-    }
-
-    template<typename A1,typename A2,typename A3,typename A4,typename A5>
-    void foreach(void (IndexIntf::*methodPtr)(A1,A2,A3,A4,A5),A1 a1,A2 a2,A3 a3,A4 a4,A5 a5)
-    {
-      QListIterator<IndexIntf> li(m_intfs);
-      for (li.toFirst();li.current();++li) (li.current()->*methodPtr)(a1,a2,a3,a4,a5);
-    }
-
-    template<typename A1,typename A2,typename A3,typename A4,typename A5,typename A6>
-    void foreach(void (IndexIntf::*methodPtr)(A1,A2,A3,A4,A5,A6),A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6)
-    {
-      QListIterator<IndexIntf> li(m_intfs);
-      for (li.toFirst();li.current();++li) (li.current()->*methodPtr)(a1,a2,a3,a4,a5,a6);
-    }
-
-    template<typename A1,typename A2,typename A3,typename A4,typename A5,typename A6,typename A7,typename A8>
-    void foreach(void (IndexIntf::*methodPtr)(A1,A2,A3,A4,A5,A6,A7,A8),A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6,A7 a7,A8 a8)
-    {
-      QListIterator<IndexIntf> li(m_intfs);
-      for (li.toFirst();li.current();++li) (li.current()->*methodPtr)(a1,a2,a3,a4,a5,a6,a7,a8);
-    }
-
-    template<typename A1,typename A2,typename A3,typename A4,typename A5,typename A6,typename A7,typename A8,typename A9>
-    void foreach(void (IndexIntf::*methodPtr)(A1,A2,A3,A4,A5,A6,A7,A8,A9),A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6,A7 a7,A8 a8,A9 a9)
+    // For each index format we forward the method call.
+    // We use C++11 variadic templates and perfect forwarding to implement foreach() generically,
+    // and split the types of the methods from the arguments passed to allow implicit conversions.
+    template<class... Ts,class... As>
+    void foreach(void (IndexIntf::*methodPtr)(Ts...),As&&... args)
     {
       QListIterator<IndexIntf> li(m_intfs);
-      for (li.toFirst();li.current();++li) (li.current()->*methodPtr)(a1,a2,a3,a4,a5,a6,a7,a8,a9);
+      for (li.toFirst();li.current();++li)
+      {
+        (li.current()->*methodPtr)(std::forward<As>(args)...);
+      }
     }
 
   public:
@@ -137,17 +94,15 @@ class IndexList : public IndexIntf
     void addContentsItem(bool isDir, const char *name, const char *ref, 
                          const char *file, const char *anchor,bool separateIndex=FALSE,bool addToNavIndex=FALSE,
                          const Definition *def=0)
-    { if (m_enabled) foreach<bool,const char *,const char *,const char *,const char*,bool,bool,const Definition *>
-             (&IndexIntf::addContentsItem,isDir,name,ref,file,anchor,separateIndex,addToNavIndex,def); }
+    { if (m_enabled) foreach(&IndexIntf::addContentsItem,isDir,name,ref,file,anchor,separateIndex,addToNavIndex,def); }
     void addIndexItem(const Definition *context,const MemberDef *md,const char *sectionAnchor=0,const char *title=0)
-    { if (m_enabled) foreach<const Definition *,const MemberDef *,const char *,const char *>
-             (&IndexIntf::addIndexItem,context,md,sectionAnchor,title); }
+    { if (m_enabled) foreach(&IndexIntf::addIndexItem,context,md,sectionAnchor,title); }
     void addIndexFile(const char *name) 
-    { if (m_enabled) foreach<const char *>(&IndexIntf::addIndexFile,name); }
+    { if (m_enabled) foreach(&IndexIntf::addIndexFile,name); }
     void addImageFile(const char *name) 
-    { if (m_enabled) foreach<const char *>(&IndexIntf::addImageFile,name); }
+    { if (m_enabled) foreach(&IndexIntf::addImageFile,name); }
     void addStyleSheetFile(const char *name) 
-    { if (m_enabled) foreach<const char *>(&IndexIntf::addStyleSheetFile,name); }
+    { if (m_enabled) foreach(&IndexIntf::addStyleSheetFile,name); }
 
   private:
     bool m_enabled;
index 5bb65cf..ea3f348 100755 (executable)
@@ -74,7 +74,7 @@ for f in new_list:
         tmp = tmp.replace("\n","")
         l = re.sub('[^"]*"([^"]*)".*','\\1',tmp)
         l1 = l.replace("-","")
-        # capatalize first letter
+        # capitalize first letter
         l = l.title()
         print("""\
                                    <EnumProperty
index a0bbf73..730f083 100644 (file)
@@ -280,7 +280,10 @@ void LatexDocVisitor::visit(DocLineBreak *)
 void LatexDocVisitor::visit(DocHorRuler *)
 {
   if (m_hide) return;
-  m_t << "\\DoxyHorRuler\n";
+  if (insideTable())
+    m_t << "\\DoxyHorRuler{1}\n";
+  else
+    m_t << "\\DoxyHorRuler{0}\n";
 }
 
 void LatexDocVisitor::visit(DocStyleChange *s)
@@ -291,6 +294,7 @@ void LatexDocVisitor::visit(DocStyleChange *s)
     case DocStyleChange::Bold:
       if (s->enable()) m_t << "{\\bfseries{";      else m_t << "}}";
       break;
+    case DocStyleChange::S:
     case DocStyleChange::Strike:
     case DocStyleChange::Del:
       if (s->enable()) m_t << "\\sout{";     else m_t << "}";
@@ -349,8 +353,8 @@ void LatexDocVisitor::visit(DocVerbatim *s)
       {
         m_t << "\n\\begin{DoxyCode}{" << usedTableLevels() << "}\n";
        LatexCodeGenerator::setDoxyCodeOpen(TRUE);
-        Doxygen::parserManager->getParser(lang)
-                              ->parseCode(m_ci,s->context(),s->text(),langExt,
+        Doxygen::parserManager->getCodeParser(lang)
+                               .parseCode(m_ci,s->context(),s->text(),langExt,
                                           s->isExample(),s->exampleFile());
        LatexCodeGenerator::setDoxyCodeOpen(FALSE);
         m_t << "\\end{DoxyCode}\n";
@@ -461,8 +465,8 @@ void LatexDocVisitor::visit(DocInclude *inc)
         LatexCodeGenerator::setDoxyCodeOpen(TRUE);
          QFileInfo cfi( inc->file() );
          FileDef *fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
-         Doxygen::parserManager->getParser(inc->extension())
-                               ->parseCode(m_ci,inc->context(),
+         Doxygen::parserManager->getCodeParser(inc->extension())
+                                .parseCode(m_ci,inc->context(),
                                            inc->text(),
                                            langExt,
                                            inc->isExample(),
@@ -482,8 +486,8 @@ void LatexDocVisitor::visit(DocInclude *inc)
     case DocInclude::Include: 
       m_t << "\n\\begin{DoxyCodeInclude}{" << usedTableLevels() << "}\n";
       LatexCodeGenerator::setDoxyCodeOpen(TRUE);
-      Doxygen::parserManager->getParser(inc->extension())
-                            ->parseCode(m_ci,inc->context(),
+      Doxygen::parserManager->getCodeParser(inc->extension())
+                             .parseCode(m_ci,inc->context(),
                                         inc->text(),langExt,inc->isExample(),
                                         inc->exampleFile(),
                                         0,     // fileDef
@@ -512,8 +516,8 @@ void LatexDocVisitor::visit(DocInclude *inc)
       {
          m_t << "\n\\begin{DoxyCodeInclude}{" << usedTableLevels() << "}\n";
          LatexCodeGenerator::setDoxyCodeOpen(TRUE);
-         Doxygen::parserManager->getParser(inc->extension())
-                               ->parseCode(m_ci,
+         Doxygen::parserManager->getCodeParser(inc->extension())
+                                .parseCode(m_ci,
                                            inc->context(),
                                            extractBlock(inc->text(),inc->blockId()),
                                            langExt,
@@ -530,8 +534,8 @@ void LatexDocVisitor::visit(DocInclude *inc)
          FileDef *fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
          m_t << "\n\\begin{DoxyCodeInclude}{" << usedTableLevels() << "}\n";
          LatexCodeGenerator::setDoxyCodeOpen(TRUE);
-         Doxygen::parserManager->getParser(inc->extension())
-                               ->parseCode(m_ci,
+         Doxygen::parserManager->getCodeParser(inc->extension())
+                                .parseCode(m_ci,
                                            inc->context(),
                                            extractBlock(inc->text(),inc->blockId()),
                                            langExt,
@@ -583,8 +587,8 @@ void LatexDocVisitor::visit(DocIncOperator *op)
         fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
       }
 
-      Doxygen::parserManager->getParser(locLangExt)
-                            ->parseCode(m_ci,op->context(),op->text(),langExt,
+      Doxygen::parserManager->getCodeParser(locLangExt)
+                             .parseCode(m_ci,op->context(),op->text(),langExt,
                                         op->isExample(),op->exampleFile(),
                                         fd,     // fileDef
                                         op->line(),    // startLine
@@ -621,7 +625,7 @@ void LatexDocVisitor::visit(DocFormula *f)
     {
       switch (c)
       {
-        case '\'': m_t << "\\text{'}"; break;
+        case '\'': m_t << "\\textnormal{\\textquotesingle}"; break;
         default:  m_t << c; break;
       }
     }
index e6c6861..cdda22c 100644 (file)
@@ -223,6 +223,7 @@ void LatexCodeGenerator::writeLineNumber(const char *ref,const char *fileName,co
   {
     m_t << l << " ";
   }
+  m_col=0;
 }
 
 
@@ -265,11 +266,11 @@ void LatexCodeGenerator::setDoxyCodeOpen(bool val)
 
 LatexGenerator::LatexGenerator() : OutputGenerator()
 {
-  dir=Config_getString(LATEX_OUTPUT);
-  //printf("LatexGenerator::LatexGenerator() insideTabbing=FALSE\n");
-  insideTabbing=FALSE;
-  firstDescItem=TRUE;
-  disableLinks=FALSE;
+  m_dir=Config_getString(LATEX_OUTPUT);
+  //printf("LatexGenerator::LatexGenerator() m_insideTabbing=FALSE\n");
+  m_insideTabbing=FALSE;
+  m_firstDescItem=TRUE;
+  m_disableLinks=FALSE;
   m_indent=0;
   templateMemberItem = FALSE;
   m_prettyCode=Config_getBool(LATEX_SOURCE_CODE);
@@ -287,8 +288,7 @@ static void writeLatexMakefile()
   QFile file(fileName);
   if (!file.open(IO_WriteOnly))
   {
-    err("Could not open file %s for writing\n",fileName.data());
-    exit(1);
+    term("Could not open file %s for writing\n",fileName.data());
   }
   // inserted by KONNO Akihisa <konno@researchers.jp> 2002-03-05
   QCString latex_command = theTranslator->latexCommandName();
@@ -386,8 +386,7 @@ static void writeMakeBat()
   bool generateBib = !Doxygen::citeDict->isEmpty();
   if (!file.open(IO_WriteOnly))
   {
-    err("Could not open file %s for writing\n",fileName.data());
-    exit(1);
+    term("Could not open file %s for writing\n",fileName.data());
   }
   FTextStream t(&file);
   t << "set Dir_Old=%cd%\n";
@@ -467,8 +466,7 @@ void LatexGenerator::init()
   QDir d(dir);
   if (!d.exists() && !d.mkdir(dir))
   {
-    err("Could not create output directory %s\n",dir.data());
-    exit(1);
+    term("Could not create output directory %s\n",dir.data());
   }
 
   writeLatexMakefile();
@@ -623,6 +621,11 @@ static void writeDefaultHeaderPart1(FTextStream &t)
        "}\n"
        "\\makeatother\n"
        "\n";
+  // 
+  t << "\\makeatletter\n"
+       "\\newcommand\\hrulefilll{\\leavevmode\\leaders\\hrule\\hskip 0pt plus 1filll\\kern\\z@}\n"
+       "\\makeatother\n"
+       "\n";
 
   // Headers & footers
   QGString genString;
@@ -688,6 +691,16 @@ static void writeDefaultHeaderPart1(FTextStream &t)
 
   writeExtraLatexPackages(t);
   writeLatexSpecialFormulaChars(t);
+  QCString macroFile = Config_getString(FORMULA_MACROFILE);
+  if (!macroFile.isEmpty())
+  {
+    QCString dir=Config_getString(LATEX_OUTPUT);
+    QFileInfo fi(macroFile);
+    macroFile=fi.absFilePath().utf8();
+    QCString stripMacroFile = fi.fileName().data();
+    copyFile(macroFile,dir + "/" + stripMacroFile);
+    t << "\\input{" << stripMacroFile << "}" << endl;
+  }
 
   // Hyperlinks
   bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
@@ -873,11 +886,11 @@ void LatexGenerator::startFile(const char *name,const char *,const char *)
   setEncoding(Config_getString(LATEX_OUTPUT_ENCODING));
 #endif
   QCString fileName=name;
-  relPath = relativePathToRoot(fileName);
+  m_relPath = relativePathToRoot(fileName);
   if (fileName.right(4)!=".tex" && fileName.right(4)!=".sty") fileName+=".tex";
   startPlainFile(fileName);
   m_codeGen.setTextStream(t);
-  m_codeGen.setRelativePath(relPath);
+  m_codeGen.setRelativePath(m_relPath);
   m_codeGen.setSourceFileName(stripPath(fileName));
 }
 
@@ -1468,7 +1481,7 @@ void LatexGenerator::endIndexValue(const char *name,bool /*hasBrief*/)
 void LatexGenerator::startTextLink(const char *f,const char *anchor)
 {
   static bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
-  if (!disableLinks && pdfHyperlinks)
+  if (!m_disableLinks && pdfHyperlinks)
   {
     t << "\\mbox{\\hyperlink{";
     if (f) t << stripPath(f);
@@ -1484,7 +1497,7 @@ void LatexGenerator::startTextLink(const char *f,const char *anchor)
 void LatexGenerator::endTextLink()
 {
   static bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
-  if (!disableLinks && pdfHyperlinks)
+  if (!m_disableLinks && pdfHyperlinks)
   {
     t << "}";
   }
@@ -1495,7 +1508,7 @@ void LatexGenerator::writeObjectLink(const char *ref, const char *f,
                                      const char *anchor, const char *text)
 {
   static bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
-  if (!disableLinks && !ref && pdfHyperlinks)
+  if (!m_disableLinks && !ref && pdfHyperlinks)
   {
     t << "\\mbox{\\hyperlink{";
     if (f) t << stripPath(f);
@@ -1593,12 +1606,12 @@ void LatexGenerator::startGroupHeader(int extraIndentLevel)
   {
     t << "\\doxysubsection{";
   }
-  disableLinks=TRUE;
+  m_disableLinks=TRUE;
 }
 
 void LatexGenerator::endGroupHeader(int)
 {
-  disableLinks=FALSE;
+  m_disableLinks=FALSE;
   t << "}" << endl;
 }
 
@@ -1612,12 +1625,12 @@ void LatexGenerator::startMemberHeader(const char *,int)
   {
     t << "\\doxysubsection*{";
   }
-  disableLinks=TRUE;
+  m_disableLinks=TRUE;
 }
 
 void LatexGenerator::endMemberHeader()
 {
-  disableLinks=FALSE;
+  m_disableLinks=FALSE;
   t << "}" << endl;
 }
 
@@ -1683,12 +1696,12 @@ void LatexGenerator::startMemberDoc(const char *clname,
   }
   t << "}";
   t << "\n{\\footnotesize\\ttfamily ";
-  //disableLinks=TRUE;
+  //m_disableLinks=TRUE;
 }
 
 void LatexGenerator::endMemberDoc(bool)
 {
-  disableLinks=FALSE;
+  m_disableLinks=FALSE;
   t << "}\n\n";
   //if (Config_getBool(COMPACT_LATEX)) t << "\\hfill";
 }
@@ -1809,7 +1822,7 @@ void LatexGenerator::endSection(const char *lab,SectionInfo::SectionType)
 
 void LatexGenerator::docify(const char *str)
 {
-  filterLatexString(t,str,insideTabbing,FALSE,FALSE);
+  filterLatexString(t,str,m_insideTabbing,FALSE,FALSE);
 }
 
 void LatexGenerator::writeChar(char c)
@@ -1829,7 +1842,7 @@ void LatexGenerator::startClassDiagram()
 void LatexGenerator::endClassDiagram(const ClassDiagram &d,
                                        const char *fileName,const char *)
 {
-  d.writeFigure(t,dir,fileName);
+  d.writeFigure(t,m_dir,fileName);
 }
 
 
@@ -1839,7 +1852,7 @@ void LatexGenerator::startAnonTypeScope(int indent)
   {
     t << "\\begin{tabbing}" << endl;
     t << "xx\\=xx\\=xx\\=xx\\=xx\\=xx\\=xx\\=xx\\=xx\\=\\kill" << endl;
-    insideTabbing=TRUE;
+    m_insideTabbing=TRUE;
   }
   m_indent=indent;
 }
@@ -1849,7 +1862,7 @@ void LatexGenerator::endAnonTypeScope(int indent)
   if (indent==0)
   {
     t << endl << "\\end{tabbing}";
-    insideTabbing=FALSE;
+    m_insideTabbing=FALSE;
   }
   m_indent=indent;
 }
@@ -1873,7 +1886,7 @@ void LatexGenerator::endMemberTemplateParams(const char *,const char *)
 void LatexGenerator::startMemberItem(const char *,int annoType,const char *) 
 { 
   //printf("LatexGenerator::startMemberItem(%d)\n",annType);
-  if (!insideTabbing)
+  if (!m_insideTabbing)
   {
     t << "\\item " << endl; 
     templateMemberItem = (annoType == 3);
@@ -1882,7 +1895,7 @@ void LatexGenerator::startMemberItem(const char *,int annoType,const char *)
 
 void LatexGenerator::endMemberItem() 
 {
-  if (insideTabbing)
+  if (m_insideTabbing)
   {
     t << "\\\\";
   } 
@@ -1892,7 +1905,7 @@ void LatexGenerator::endMemberItem()
 
 void LatexGenerator::startMemberDescription(const char *,const char *,bool) 
 {
-  if (!insideTabbing)
+  if (!m_insideTabbing)
   { 
     t << "\\begin{DoxyCompactList}\\small\\item\\em "; 
   }
@@ -1905,7 +1918,7 @@ void LatexGenerator::startMemberDescription(const char *,const char *,bool)
 
 void LatexGenerator::endMemberDescription() 
 { 
-  if (!insideTabbing)
+  if (!m_insideTabbing)
   {
     //t << "\\item\\end{DoxyCompactList}"; 
     t << "\\end{DoxyCompactList}"; 
@@ -1919,8 +1932,8 @@ void LatexGenerator::endMemberDescription()
 
 void LatexGenerator::writeNonBreakableSpace(int) 
 {
-  //printf("writeNonBreakbleSpace()\n");
-  if (insideTabbing)
+  //printf("writeNonBreakableSpace()\n");
+  if (m_insideTabbing)
   {
     t << "\\>";
   }
@@ -1935,7 +1948,7 @@ void LatexGenerator::writeNonBreakableSpace(int)
 // startDescTable()
 // - startDescTableRow()
 //   - startDescTableTitle()
-//   - endDescTabelTitle()
+//   - endDescTableTitle()
 //   - startDescTableData()
 //   - endDescTableData()
 // - endDescTableRow()
@@ -1993,7 +2006,7 @@ void LatexGenerator::lastIndexPage()
 
 void LatexGenerator::startMemberList()  
 { 
-  if (!insideTabbing)
+  if (!m_insideTabbing)
   {
     t << "\\begin{DoxyCompactItemize}" << endl; 
   }
@@ -2001,8 +2014,8 @@ void LatexGenerator::startMemberList()
 
 void LatexGenerator::endMemberList()    
 {
-  //printf("LatexGenerator::endMemberList(%d)\n",insideTabbing);
-  if (!insideTabbing)
+  //printf("LatexGenerator::endMemberList(%d)\n",m_insideTabbing);
+  if (!m_insideTabbing)
   {
     t << "\\end{DoxyCompactItemize}"   << endl; 
   }
@@ -2058,7 +2071,7 @@ void LatexGenerator::startDotGraph()
 
 void LatexGenerator::endDotGraph(DotClassGraph &g) 
 {
-  g.writeGraph(t,GOF_EPS,EOF_LaTeX,Config_getString(LATEX_OUTPUT),fileName,relPath);
+  g.writeGraph(t,GOF_EPS,EOF_LaTeX,Config_getString(LATEX_OUTPUT),m_fileName,m_relPath);
 }
 
 void LatexGenerator::startInclDepGraph() 
@@ -2067,7 +2080,7 @@ void LatexGenerator::startInclDepGraph()
 
 void LatexGenerator::endInclDepGraph(DotInclDepGraph &g) 
 {
-  g.writeGraph(t,GOF_EPS,EOF_LaTeX,Config_getString(LATEX_OUTPUT),fileName,relPath);
+  g.writeGraph(t,GOF_EPS,EOF_LaTeX,Config_getString(LATEX_OUTPUT),m_fileName,m_relPath);
 }
 
 void LatexGenerator::startGroupCollaboration() 
@@ -2076,7 +2089,7 @@ void LatexGenerator::startGroupCollaboration()
 
 void LatexGenerator::endGroupCollaboration(DotGroupCollaboration &g) 
 {
-  g.writeGraph(t,GOF_EPS,EOF_LaTeX,Config_getString(LATEX_OUTPUT),fileName,relPath);
+  g.writeGraph(t,GOF_EPS,EOF_LaTeX,Config_getString(LATEX_OUTPUT),m_fileName,m_relPath);
 }
 
 void LatexGenerator::startCallGraph() 
@@ -2085,7 +2098,7 @@ void LatexGenerator::startCallGraph()
 
 void LatexGenerator::endCallGraph(DotCallGraph &g) 
 {
-  g.writeGraph(t,GOF_EPS,EOF_LaTeX,Config_getString(LATEX_OUTPUT),fileName,relPath);
+  g.writeGraph(t,GOF_EPS,EOF_LaTeX,Config_getString(LATEX_OUTPUT),m_fileName,m_relPath);
 }
 
 void LatexGenerator::startDirDepGraph() 
@@ -2094,7 +2107,7 @@ void LatexGenerator::startDirDepGraph()
 
 void LatexGenerator::endDirDepGraph(DotDirDeps &g) 
 {
-  g.writeGraph(t,GOF_EPS,EOF_LaTeX,Config_getString(LATEX_OUTPUT),fileName,relPath);
+  g.writeGraph(t,GOF_EPS,EOF_LaTeX,Config_getString(LATEX_OUTPUT),m_fileName,m_relPath);
 }
 
 void LatexGenerator::startDescription() 
@@ -2105,21 +2118,21 @@ void LatexGenerator::startDescription()
 void LatexGenerator::endDescription()   
 { 
   t << "\\end{description}" << endl; 
-  firstDescItem=TRUE;
+  m_firstDescItem=TRUE;
 }
 
 void LatexGenerator::startDescItem()    
 { 
-  firstDescItem=TRUE;
+  m_firstDescItem=TRUE;
   t << "\\item["; 
 }
 
 void LatexGenerator::endDescItem()      
 { 
-  if (firstDescItem) 
+  if (m_firstDescItem) 
   {
     t << "]" << endl;
-    firstDescItem=FALSE;
+    m_firstDescItem=FALSE;
   } 
   else
   {
@@ -2200,7 +2213,7 @@ void LatexGenerator::exceptionEntry(const char* prefix,bool closeBracket)
 void LatexGenerator::writeDoc(DocNode *n,const Definition *ctx,const MemberDef *)
 {
   LatexDocVisitor *visitor =
-    new LatexDocVisitor(t,*this,ctx?ctx->getDefFileExtension():QCString(""),insideTabbing);
+    new LatexDocVisitor(t,*this,ctx?ctx->getDefFileExtension():QCString(""),m_insideTabbing);
   n->accept(visitor);
   delete visitor;
 }
@@ -2280,7 +2293,7 @@ void LatexGenerator::endInlineHeader()
 
 void LatexGenerator::lineBreak(const char *)
 {
-  if (insideTabbing)
+  if (m_insideTabbing)
   {
     t << "\\\\\n";
   }
@@ -2321,24 +2334,24 @@ void LatexGenerator::endMemberDocSimple(bool isEnum)
 
 void LatexGenerator::startInlineMemberType()
 {
-  insideTabbing = TRUE; // to prevent \+ from causing unwanted breaks
+  m_insideTabbing = TRUE; // to prevent \+ from causing unwanted breaks
 }
 
 void LatexGenerator::endInlineMemberType()
 {
   t << "&" << endl;
-  insideTabbing = FALSE;
+  m_insideTabbing = FALSE;
 }
 
 void LatexGenerator::startInlineMemberName()
 {
-  insideTabbing = TRUE; // to prevent \+ from causing unwanted breaks
+  m_insideTabbing = TRUE; // to prevent \+ from causing unwanted breaks
 }
 
 void LatexGenerator::endInlineMemberName()
 {
   t << "&" << endl;
-  insideTabbing = FALSE;
+  m_insideTabbing = FALSE;
 }
 
 void LatexGenerator::startInlineMemberDoc()
index 6430dbc..7d4cae8 100644 (file)
@@ -82,12 +82,12 @@ class LatexGenerator : public OutputGenerator
     //OutputGenerator *clone() { return new LatexGenerator(*this); }
     //void append(const OutputGenerator *o);
     void enable() 
-    { if (genStack->top()) active=*genStack->top(); else active=TRUE; }
-    void disable() { active=FALSE; }
+    { if (m_genStack->top()) m_active=*m_genStack->top(); else m_active=TRUE; }
+    void disable() { m_active=FALSE; }
     void enableIf(OutputType o)  { if (o==Latex) enable();  }
     void disableIf(OutputType o) { if (o==Latex) disable(); }
     void disableIfNot(OutputType o) { if (o!=Latex) disable(); }
-    bool isEnabled(OutputType o) { return (o==Latex && active); } 
+    bool isEnabled(OutputType o) { return (o==Latex && m_active); } 
     OutputGenerator *get(OutputType o) { return (o==Latex) ? this : 0; }
 
     // --- CodeOutputInterface
@@ -328,10 +328,10 @@ class LatexGenerator : public OutputGenerator
   private:
     LatexGenerator(const LatexGenerator &);
     LatexGenerator &operator=(const LatexGenerator &);
-    bool insideTabbing;
-    bool firstDescItem;
-    bool disableLinks;
-    QCString relPath;
+    bool m_insideTabbing;
+    bool m_firstDescItem;
+    bool m_disableLinks;
+    QCString m_relPath;
     int m_indent;
     bool templateMemberItem;
     bool m_prettyCode;
index 38a55f4..946b612 100644 (file)
@@ -1561,6 +1561,7 @@ void writeDefaultLayoutFile(const char *fileName)
     return;
   }
   QTextStream t(&f);
+  t.setEncoding(QTextStream::UnicodeUTF8);
   t << substitute(layout_default,"$doxygenversion",getVersion());
 }
 
index 997b24e..6b76008 100644 (file)
@@ -136,6 +136,7 @@ void ManDocVisitor::visit(DocStyleChange *s)
       if (s->enable()) m_t << "\\fB";      else m_t << "\\fP";
       m_firstCol=FALSE;
       break;
+    case DocStyleChange::S:
     case DocStyleChange::Strike:
     case DocStyleChange::Del:
       /* not supported */
@@ -204,8 +205,8 @@ void ManDocVisitor::visit(DocVerbatim *s)
       if (!m_firstCol) m_t << endl;
       m_t << ".PP" << endl;
       m_t << ".nf" << endl;
-      Doxygen::parserManager->getParser(lang)
-                            ->parseCode(m_ci,s->context(),s->text(),
+      Doxygen::parserManager->getCodeParser(lang)
+                             .parseCode(m_ci,s->context(),s->text(),
                                         langExt,
                                         s->isExample(),s->exampleFile());
       if (!m_firstCol) m_t << endl;
@@ -257,8 +258,8 @@ void ManDocVisitor::visit(DocInclude *inc)
          m_t << ".nf" << endl;
          QFileInfo cfi( inc->file() );
          FileDef *fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
-         Doxygen::parserManager->getParser(inc->extension())
-                               ->parseCode(m_ci,inc->context(),
+         Doxygen::parserManager->getCodeParser(inc->extension())
+                                .parseCode(m_ci,inc->context(),
                                            inc->text(),
                                            langExt,
                                            inc->isExample(),
@@ -281,8 +282,8 @@ void ManDocVisitor::visit(DocInclude *inc)
       if (!m_firstCol) m_t << endl;
       m_t << ".PP" << endl;
       m_t << ".nf" << endl;
-      Doxygen::parserManager->getParser(inc->extension())
-                            ->parseCode(m_ci,inc->context(),
+      Doxygen::parserManager->getCodeParser(inc->extension())
+                             .parseCode(m_ci,inc->context(),
                                         inc->text(),
                                         langExt,
                                         inc->isExample(),
@@ -318,8 +319,8 @@ void ManDocVisitor::visit(DocInclude *inc)
       if (!m_firstCol) m_t << endl;
       m_t << ".PP" << endl;
       m_t << ".nf" << endl;
-      Doxygen::parserManager->getParser(inc->extension())
-                            ->parseCode(m_ci,
+      Doxygen::parserManager->getCodeParser(inc->extension())
+                             .parseCode(m_ci,
                                         inc->context(),
                                         extractBlock(inc->text(),inc->blockId()),
                                         langExt,
@@ -338,8 +339,8 @@ void ManDocVisitor::visit(DocInclude *inc)
          m_t << ".nf" << endl;
          QFileInfo cfi( inc->file() );
          FileDef *fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
-         Doxygen::parserManager->getParser(inc->extension())
-                               ->parseCode(m_ci,
+         Doxygen::parserManager->getCodeParser(inc->extension())
+                                .parseCode(m_ci,
                                            inc->context(),
                                            extractBlock(inc->text(),inc->blockId()),
                                            langExt,
@@ -397,8 +398,8 @@ void ManDocVisitor::visit(DocIncOperator *op)
         fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
       }
 
-      Doxygen::parserManager->getParser(locLangExt)
-                            ->parseCode(m_ci,op->context(),op->text(),langExt,
+      Doxygen::parserManager->getCodeParser(locLangExt)
+                             .parseCode(m_ci,op->context(),op->text(),langExt,
                                         op->isExample(),op->exampleFile(),
                                         fd,     // fileDef
                                         op->line(),    // startLine
@@ -905,25 +906,6 @@ void ManDocVisitor::visitPost(DocSecRefList *)
   m_t << ".PP" << endl;
 }
 
-//void ManDocVisitor::visitPre(DocLanguage *l)
-//{
-//  QString langId = Config_getEnum(OUTPUT_LANGUAGE);
-//  if (l->id().lower()!=langId.lower())
-//  {
-//    pushEnabled();
-//    m_hide = TRUE;
-//  }
-//}
-//
-//void ManDocVisitor::visitPost(DocLanguage *l) 
-//{
-//  QString langId = Config_getEnum(OUTPUT_LANGUAGE);
-//  if (l->id().lower()!=langId.lower())
-//  {
-//    popEnabled();
-//  }
-//}
-
 void ManDocVisitor::visitPre(DocParamSect *s)
 {
   if (m_hide) return;
index 06d3c4a..5f07932 100644 (file)
@@ -76,35 +76,19 @@ static QCString getSubdir()
 
 ManGenerator::ManGenerator() : OutputGenerator()
 {
-  dir=Config_getString(MAN_OUTPUT) + "/" + getSubdir();
-  firstCol=TRUE;
-  paragraph=TRUE;
-  col=0;
-  upperCase=FALSE;
-  insideTabbing=FALSE;
-  inHeader=FALSE;
+  m_dir=Config_getString(MAN_OUTPUT) + "/" + getSubdir();
+  m_firstCol=TRUE;
+  m_paragraph=TRUE;
+  m_col=0;
+  m_upperCase=FALSE;
+  m_insideTabbing=FALSE;
+  m_inHeader=FALSE;
 }
 
 ManGenerator::~ManGenerator()
 {
 }
 
-//void ManGenerator::append(const OutputGenerator *g)
-//{
-//  QCString r=g->getContents();
-//  if (upperCase)
-//    t << r.upper();
-//  else
-//    t << r;
-//  if (!r.isEmpty())
-//    firstCol = r.at(r.length()-1)=='\n';
-//  else
-//    firstCol = ((ManGenerator *)g)->firstCol;
-//  col+=((ManGenerator *)g)->col;
-//  inHeader=((ManGenerator *)g)->inHeader;
-//  paragraph=FALSE;
-//}
-
 void ManGenerator::init()
 {
   QCString &manOutput = Config_getString(MAN_OUTPUT);
@@ -112,14 +96,12 @@ void ManGenerator::init()
   QDir d(manOutput);
   if (!d.exists() && !d.mkdir(manOutput))
   {
-    err("Could not create output directory %s\n",manOutput.data());
-    exit(1);
+    term("Could not create output directory %s\n",manOutput.data());
   }
   d.setPath(manOutput + "/" + getSubdir());
   if (!d.exists() && !d.mkdir(manOutput + "/" + getSubdir()))
   {
-    err("Could not create output directory %s/%s\n",manOutput.data(), getSubdir().data());
-    exit(1);
+    term("Could not create output directory %s/%s\n",manOutput.data(), getSubdir().data());
   }
   createSubDirs(d);
 }
@@ -168,7 +150,7 @@ static QCString buildFileName(const char *name)
 void ManGenerator::startFile(const char *,const char *manName,const char *)
 {
   startPlainFile( buildFileName( manName ) );
-  firstCol=TRUE;
+  m_firstCol=TRUE;
 }
 
 void ManGenerator::endFile()
@@ -192,31 +174,31 @@ void ManGenerator::endTitleHead(const char *,const char *name)
   t << ".nh" << endl;
   t << ".SH NAME" << endl;
   t << name;
-  firstCol=FALSE;
-  paragraph=TRUE;
-  inHeader=TRUE;
+  m_firstCol=FALSE;
+  m_paragraph=TRUE;
+  m_inHeader=TRUE;
 }
 
 void ManGenerator::newParagraph()
 {
-  if (!paragraph)
+  if (!m_paragraph)
   {
-    if (!firstCol) t << endl;
+    if (!m_firstCol) t << endl;
     t << ".PP" << endl;
-    firstCol=TRUE;
+    m_firstCol=TRUE;
   }
-  paragraph=TRUE;
+  m_paragraph=TRUE;
 }
 
 void ManGenerator::startParagraph(const char *)
 {
-  if (!paragraph)
+  if (!m_paragraph)
   {
-    if (!firstCol) t << endl;
+    if (!m_firstCol) t << endl;
     t << ".PP" << endl;
-    firstCol=TRUE;
+    m_firstCol=TRUE;
   }
-  paragraph=TRUE;
+  m_paragraph=TRUE;
 }
 
 void ManGenerator::endParagraph()
@@ -269,31 +251,31 @@ void ManGenerator::endHtmlLink()
 
 void ManGenerator::startGroupHeader(int)
 {
-  if (!firstCol) t << endl;
+  if (!m_firstCol) t << endl;
   t << ".SH \"";
-  upperCase=TRUE;
-  firstCol=FALSE;
+  m_upperCase=TRUE;
+  m_firstCol=FALSE;
 }
 
 void ManGenerator::endGroupHeader(int)
 {
   t << "\"\n.PP " << endl;
-  firstCol=TRUE;
-  paragraph=TRUE;
-  upperCase=FALSE;
+  m_firstCol=TRUE;
+  m_paragraph=TRUE;
+  m_upperCase=FALSE;
 }
 
 void ManGenerator::startMemberHeader(const char *,int)
 {
-  if (!firstCol) t << endl;
+  if (!m_firstCol) t << endl;
   t << ".SS \"";
 }
 
 void ManGenerator::endMemberHeader()
 {
   t << "\"\n";
-  firstCol=TRUE;
-  paragraph=FALSE;
+  m_firstCol=TRUE;
+  m_paragraph=FALSE;
 }
 
 void ManGenerator::docify(const char *str)
@@ -308,16 +290,16 @@ void ManGenerator::docify(const char *str)
       {
         case '-':  t << "\\-"; break; // see  bug747780
         case '.':  t << "\\&."; break; // see  bug652277
-        case '\\': t << "\\\\"; col++; break;
-        case '\n': t << "\n"; col=0; break;
+        case '\\': t << "\\\\"; m_col++; break;
+        case '\n': t << "\n"; m_col=0; break;
         case '\"':  c = '\''; // no break!
-        default: t << c; col++; break;
+        default: t << c; m_col++; break;
       }
     }
-    firstCol=(c=='\n');
+    m_firstCol=(c=='\n');
     //printf("%s",str);fflush(stdout);
   }
-  paragraph=FALSE;
+  m_paragraph=FALSE;
 }
 
 void ManGenerator::codify(const char *str)
@@ -335,25 +317,25 @@ void ManGenerator::codify(const char *str)
       {
         case '.':   t << "\\&."; break; // see  bug652277
         case '\t':  spacesToNextTabStop =
-                          Config_getInt(TAB_SIZE) - (col%Config_getInt(TAB_SIZE));
+                          Config_getInt(TAB_SIZE) - (m_col%Config_getInt(TAB_SIZE));
                     t << Doxygen::spaces.left(spacesToNextTabStop); 
-                    col+=spacesToNextTabStop; 
+                    m_col+=spacesToNextTabStop; 
                     break;
-        case '\n':  t << "\n"; firstCol=TRUE; col=0; break;
-        case '\\':  t << "\\"; col++; break;
+        case '\n':  t << "\n"; m_firstCol=TRUE; m_col=0; break;
+        case '\\':  t << "\\"; m_col++; break;
         case '\"':  // no break!
-        default:    p=writeUtf8Char(t,p-1); firstCol=FALSE; col++; break;
+        default:    p=writeUtf8Char(t,p-1); m_firstCol=FALSE; m_col++; break;
       }
     }
     //printf("%s",str);fflush(stdout);
   }
-  paragraph=FALSE;
+  m_paragraph=FALSE;
 }
 
 void ManGenerator::writeChar(char c)
 {
-  firstCol=(c=='\n');
-  if (firstCol) col=0; else col++;
+  m_firstCol=(c=='\n');
+  if (m_firstCol) m_col=0; else m_col++;
   switch (c)
   {
     case '\\': t << "\\\\"; break;
@@ -361,26 +343,26 @@ void ManGenerator::writeChar(char c)
     default:   t << c; break;
   }
   //printf("%c",c);fflush(stdout);
-  paragraph=FALSE;
+  m_paragraph=FALSE;
 }
 
 void ManGenerator::startDescList(SectionTypes)      
 {
-  if (!firstCol) 
+  if (!m_firstCol) 
   { t << endl << ".PP" << endl; 
-    firstCol=TRUE; paragraph=TRUE; 
-    col=0;
+    m_firstCol=TRUE; m_paragraph=TRUE; 
+    m_col=0;
   }
-  paragraph=FALSE;
+  m_paragraph=FALSE;
   startBold();
 }
 
 void ManGenerator::startTitle() 
 { 
-  if (!firstCol) t << endl; 
+  if (!m_firstCol) t << endl; 
   t << ".SH \""; 
-  firstCol=FALSE;
-  paragraph=FALSE;
+  m_firstCol=FALSE;
+  m_paragraph=FALSE;
 }
 
 void ManGenerator::endTitle()
@@ -390,11 +372,11 @@ void ManGenerator::endTitle()
 
 void ManGenerator::startItemListItem() 
 { 
-  if (!firstCol) t << endl; 
+  if (!m_firstCol) t << endl; 
   t << ".TP" << endl; 
-  firstCol=TRUE;
-  paragraph=FALSE;
-  col=0;
+  m_firstCol=TRUE;
+  m_paragraph=FALSE;
+  m_col=0;
 } 
 
 void ManGenerator::endItemListItem()
@@ -405,25 +387,25 @@ void ManGenerator::startCodeFragment()
 { 
   newParagraph();
   t << ".nf" << endl; 
-  firstCol=TRUE;
-  paragraph=FALSE;
+  m_firstCol=TRUE;
+  m_paragraph=FALSE;
 }
 
 void ManGenerator::endCodeFragment()   
 { 
-  if (!firstCol) t << endl;
+  if (!m_firstCol) t << endl;
   t << ".fi" << endl; 
-  firstCol=TRUE;
-  paragraph=FALSE;
-  col=0;
+  m_firstCol=TRUE;
+  m_paragraph=FALSE;
+  m_col=0;
 }
 
 void ManGenerator::startMemberDoc(const char *,const char *,const char *,const char *,int,int,bool) 
 { 
-  if (!firstCol) t << endl;
+  if (!m_firstCol) t << endl;
   t << ".SS \""; 
-  firstCol=FALSE;
-  paragraph=FALSE;
+  m_firstCol=FALSE;
+  m_paragraph=FALSE;
 }
 
 void ManGenerator::startDoxyAnchor(const char *,const char *manName,
@@ -446,7 +428,7 @@ void ManGenerator::startDoxyAnchor(const char *,const char *manName,
     //       name,baseName.data(),buildFileName(baseName).data());
     
     // - remove dangerous characters and append suffix, then add dir prefix
-    QCString fileName=dir+"/"+buildFileName( baseName );
+    QCString fileName=m_dir+"/"+buildFileName( baseName );
     QFile linkfile( fileName );
     // - only create file if it doesn't exist already
     if ( !linkfile.open( IO_ReadOnly ) ) 
@@ -469,10 +451,10 @@ void ManGenerator::endMemberDoc(bool)
 
 void ManGenerator::startSubsection()    
 { 
-  if (!firstCol) t << endl;
+  if (!m_firstCol) t << endl;
   t << ".SS \""; 
-  firstCol=FALSE;
-  paragraph=FALSE;
+  m_firstCol=FALSE;
+  m_paragraph=FALSE;
 }
 
 void ManGenerator::endSubsection()
@@ -483,10 +465,10 @@ void ManGenerator::endSubsection()
 
 void ManGenerator::startSubsubsection() 
 { 
-  if (!firstCol) t << endl;
+  if (!m_firstCol) t << endl;
   t << "\n.SS \""; 
-  firstCol=FALSE;
-  paragraph=FALSE;
+  m_firstCol=FALSE;
+  m_paragraph=FALSE;
 }
 
 void ManGenerator::endSubsubsection()
@@ -496,33 +478,33 @@ void ManGenerator::endSubsubsection()
 
 void ManGenerator::writeSynopsis()      
 { 
-  if (!firstCol) t << endl;
+  if (!m_firstCol) t << endl;
   t << ".SH SYNOPSIS\n.br\n.PP\n"; 
-  firstCol=TRUE;
-  paragraph=FALSE;
+  m_firstCol=TRUE;
+  m_paragraph=FALSE;
 }
 
 void ManGenerator::startDescItem()
 {
-  if (!firstCol) t << endl;
+  if (!m_firstCol) t << endl;
   t << ".IP \"";
-  firstCol=FALSE;
+  m_firstCol=FALSE;
 }
 
 //void ManGenerator::endDescTitle()
 //{
 //  endBold();
-//  paragraph=TRUE;
+//  m_paragraph=TRUE;
 //}
 
 void ManGenerator::startDescForItem()
 {
-  if (!firstCol) t << endl;
-  if (!paragraph) t << ".in -1c" << endl;
+  if (!m_firstCol) t << endl;
+  if (!m_paragraph) t << ".in -1c" << endl;
   t << ".in +1c" << endl;
-  firstCol=TRUE;
-  paragraph=FALSE;
-  col=0;
+  m_firstCol=TRUE;
+  m_paragraph=FALSE;
+  m_col=0;
 }
 
 void ManGenerator::endDescForItem()
@@ -532,14 +514,14 @@ void ManGenerator::endDescForItem()
 void ManGenerator::endDescItem()
 {
   t << "\" 1c" << endl;
-  firstCol=TRUE;
+  m_firstCol=TRUE;
 }
 
 void ManGenerator::startAnonTypeScope(int indentLevel)
 {
   if (indentLevel==0)
   {
-    insideTabbing=TRUE;
+    m_insideTabbing=TRUE;
   }
 }
 
@@ -547,16 +529,16 @@ void ManGenerator::endAnonTypeScope(int indentLevel)
 {
   if (indentLevel==0)
   {
-    insideTabbing=FALSE;
+    m_insideTabbing=FALSE;
   }
 }
 
 
 void ManGenerator::startMemberItem(const char *,int,const char *) 
 { 
-  if (firstCol && !insideTabbing) t << ".in +1c\n";
+  if (m_firstCol && !m_insideTabbing) t << ".in +1c\n";
   t << "\n.ti -1c\n.RI \""; 
-  firstCol=FALSE;
+  m_firstCol=FALSE;
 }
 
 void ManGenerator::endMemberItem() 
@@ -566,17 +548,17 @@ void ManGenerator::endMemberItem()
 
 void ManGenerator::startMemberList() 
 { 
-  if (!insideTabbing)
+  if (!m_insideTabbing)
   {
-    t << "\n.in +1c"; firstCol=FALSE; 
+    t << "\n.in +1c"; m_firstCol=FALSE; 
   }
 }
 
 void ManGenerator::endMemberList() 
 { 
-  if (!insideTabbing)
+  if (!m_insideTabbing)
   {
-    t << "\n.in -1c"; firstCol=FALSE; 
+    t << "\n.in -1c"; m_firstCol=FALSE; 
   }
 }
 
@@ -588,7 +570,7 @@ void ManGenerator::startMemberGroupHeader(bool)
 void ManGenerator::endMemberGroupHeader()
 {
   t << "\\fP\"\n.br\n";
-  firstCol=TRUE;
+  m_firstCol=TRUE;
 }
 
 void ManGenerator::startMemberGroupDocs()
@@ -608,12 +590,12 @@ void ManGenerator::startMemberGroup()
 void ManGenerator::endMemberGroup(bool)
 {
   t << "\n.in -1c";
-  firstCol=FALSE;
+  m_firstCol=FALSE;
 }
 
 void ManGenerator::startSection(const char *,const char *,SectionInfo::SectionType type)
 {
-  if( !inHeader ) 
+  if( !m_inHeader ) 
   {
     switch(type)
     {
@@ -629,7 +611,7 @@ void ManGenerator::startSection(const char *,const char *,SectionInfo::SectionTy
 
 void ManGenerator::endSection(const char *,SectionInfo::SectionType type)
 {
-  if( !inHeader )
+  if( !m_inHeader )
   {
     switch(type)
     {
@@ -644,24 +626,24 @@ void ManGenerator::endSection(const char *,SectionInfo::SectionType type)
   else
   {
     t << "\n";
-    firstCol=TRUE;
-    paragraph=FALSE;
-    inHeader=FALSE;
+    m_firstCol=TRUE;
+    m_paragraph=FALSE;
+    m_inHeader=FALSE;
   }
 }
 
 void ManGenerator::startExamples()
 {
-  if (!firstCol) 
+  if (!m_firstCol) 
   { t << endl << ".PP" << endl; 
-    firstCol=TRUE; paragraph=TRUE; 
-    col=0;
+    m_firstCol=TRUE; m_paragraph=TRUE; 
+    m_col=0;
   }
-  paragraph=FALSE;
+  m_paragraph=FALSE;
   startBold();
   docify(theTranslator->trExamples());
   endBold();
-  paragraph=TRUE;
+  m_paragraph=TRUE;
 }
 
 void ManGenerator::endExamples()
@@ -670,16 +652,16 @@ void ManGenerator::endExamples()
 
 void ManGenerator::startDescTable(const char *title)
 {
-  if (!firstCol) 
+  if (!m_firstCol) 
   { t << endl << ".PP" << endl; 
-    firstCol=TRUE; paragraph=TRUE; 
-    col=0;
+    m_firstCol=TRUE; m_paragraph=TRUE; 
+    m_col=0;
   }
-  paragraph=FALSE;
+  m_paragraph=FALSE;
   startBold();
   docify(title);
   endBold();
-  paragraph=TRUE;
+  m_paragraph=TRUE;
   startDescForItem();
 }
 
@@ -690,16 +672,16 @@ void ManGenerator::endDescTable()
 
 void ManGenerator::startParamList(ParamListTypes,const char *title)
 {
-  if (!firstCol) 
+  if (!m_firstCol) 
   { t << endl << ".PP" << endl; 
-    firstCol=TRUE; paragraph=TRUE; 
-    col=0;
+    m_firstCol=TRUE; m_paragraph=TRUE; 
+    m_col=0;
   }
-  paragraph=FALSE;
+  m_paragraph=FALSE;
   startBold();
   docify(title);
   endBold();
-  paragraph=TRUE;
+  m_paragraph=TRUE;
 }
 
 void ManGenerator::endParamList()
@@ -711,22 +693,22 @@ void ManGenerator::writeDoc(DocNode *n,const Definition *ctx,const MemberDef *)
   ManDocVisitor *visitor = new ManDocVisitor(t,*this,ctx?ctx->getDefFileExtension():QCString(""));
   n->accept(visitor);
   delete visitor; 
-  firstCol=FALSE;
-  paragraph = FALSE;
+  m_firstCol=FALSE;
+  m_paragraph = FALSE;
 }
 
 void ManGenerator::startConstraintList(const char *header)
 {
-  if (!firstCol) 
+  if (!m_firstCol) 
   { t << endl << ".PP" << endl; 
-    firstCol=TRUE; paragraph=TRUE; 
-    col=0;
+    m_firstCol=TRUE; m_paragraph=TRUE; 
+    m_col=0;
   }
-  paragraph=FALSE;
+  m_paragraph=FALSE;
   startBold();
   docify(header);
   endBold();
-  paragraph=TRUE;
+  m_paragraph=TRUE;
 }
 
 void ManGenerator::startConstraintParam()
@@ -758,7 +740,7 @@ void ManGenerator::startConstraintDocs()
 
 void ManGenerator::endConstraintDocs()
 {
-  t << endl; firstCol=TRUE;
+  t << endl; m_firstCol=TRUE;
 }
 
 void ManGenerator::endConstraintList()
@@ -768,7 +750,7 @@ void ManGenerator::endConstraintList()
 
 void ManGenerator::startInlineHeader() 
 {
-  if (!firstCol) 
+  if (!m_firstCol) 
   {
     t << endl << ".PP" << endl << ".in -1c" << endl;
   }
@@ -778,12 +760,12 @@ void ManGenerator::startInlineHeader()
 void ManGenerator::endInlineHeader() 
 {
   t << "\\fP\"" << endl << ".in +1c" << endl;
-  firstCol = FALSE;
+  m_firstCol = FALSE;
 }
 
 void ManGenerator::startMemberDocSimple(bool isEnum)
 {
-  if (!firstCol) 
+  if (!m_firstCol) 
   {
     t << endl << ".PP" << endl;
   }
@@ -802,10 +784,10 @@ void ManGenerator::startMemberDocSimple(bool isEnum)
 
 void ManGenerator::endMemberDocSimple(bool)
 {
-  if (!firstCol) t << endl;
+  if (!m_firstCol) t << endl;
   t << ".RE" << endl;
   t << ".PP" << endl;
-  firstCol=TRUE;
+  m_firstCol=TRUE;
 }
 
 void ManGenerator::startInlineMemberType()
@@ -833,10 +815,10 @@ void ManGenerator::startInlineMemberDoc()
 
 void ManGenerator::endInlineMemberDoc()
 {
-  if (!firstCol) t << endl;
+  if (!m_firstCol) t << endl;
   t << ".br" << endl;
   t << ".PP" << endl;
-  firstCol=TRUE;
+  m_firstCol=TRUE;
 }
 
 void ManGenerator::startLabels()
index d912923..eba6c8d 100644 (file)
@@ -33,12 +33,12 @@ class ManGenerator : public OutputGenerator
     //OutputGenerator *clone() { return new ManGenerator(*this); }
     //void append(const OutputGenerator *o);
     void enable() 
-    { if (genStack->top()) active=*genStack->top(); else active=TRUE; }
-    void disable() { active=FALSE; }
+    { if (m_genStack->top()) m_active=*m_genStack->top(); else m_active=TRUE; }
+    void disable() { m_active=FALSE; }
     void enableIf(OutputType o)  { if (o==Man) enable(); }
     void disableIf(OutputType o) { if (o==Man) disable(); }
     void disableIfNot(OutputType o) { if (o!=Man) disable(); }
-    bool isEnabled(OutputType o) { return (o==Man && active); } 
+    bool isEnabled(OutputType o) { return (o==Man && m_active); } 
     OutputGenerator *get(OutputType o) { return (o==Man) ? this : 0; }
 
     void writeDoc(DocNode *,const Definition *,const MemberDef *);
@@ -91,8 +91,8 @@ class ManGenerator : public OutputGenerator
     void endTextLink() {}
     void startHtmlLink(const char *url);
     void endHtmlLink();
-    void startTypewriter() { t << "\\fC"; firstCol=FALSE; }
-    void endTypewriter()   { t << "\\fP"; firstCol=FALSE; }
+    void startTypewriter() { t << "\\fC"; m_firstCol=FALSE; }
+    void endTypewriter()   { t << "\\fP"; m_firstCol=FALSE; }
     void startGroupHeader(int);
     void endGroupHeader(int);
     void startMemberSections() {}
@@ -132,13 +132,13 @@ class ManGenerator : public OutputGenerator
     void writeAnchor(const char *,const char *) {}
     void startCodeFragment();
     void endCodeFragment();
-    void writeLineNumber(const char *,const char *,const char *,int l) { t << l << " "; }
+    void writeLineNumber(const char *,const char *,const char *,int l) { t << l << " "; m_col=0; }
     void startCodeLine(bool) {}
-    void endCodeLine() { codify("\n"); col=0; }
-    void startEmphasis() { t << "\\fI"; firstCol=FALSE; }
-    void endEmphasis()   { t << "\\fP"; firstCol=FALSE; }
-    void startBold()     { t << "\\fB"; firstCol=FALSE; }
-    void endBold()       { t << "\\fP"; firstCol=FALSE; }
+    void endCodeLine() { codify("\n"); m_col=0; }
+    void startEmphasis() { t << "\\fI"; m_firstCol=FALSE; }
+    void endEmphasis()   { t << "\\fP"; m_firstCol=FALSE; }
+    void startBold()     { t << "\\fB"; m_firstCol=FALSE; }
+    void endBold()       { t << "\\fP"; m_firstCol=FALSE; }
     void startDescription() {}
     void endDescription()   {}
     void startDescItem();
@@ -152,7 +152,7 @@ class ManGenerator : public OutputGenerator
     void writeLatexSpacing() {}
     void writeStartAnnoItem(const char *type,const char *file,
                             const char *path,const char *name);
-    void writeEndAnnoItem(const char *) { t << endl; firstCol=TRUE; }
+    void writeEndAnnoItem(const char *) { t << endl; m_firstCol=TRUE; }
     void startSubsection();
     void endSubsection();
     void startSubsubsection();
@@ -161,8 +161,8 @@ class ManGenerator : public OutputGenerator
     void endCenter()          {}
     void startSmall()         {}
     void endSmall()           {}
-    void startMemberDescription(const char *,const char *,bool) { t << "\n.RI \""; firstCol=FALSE; }
-    void endMemberDescription()   { t << "\""; firstCol=FALSE; }
+    void startMemberDescription(const char *,const char *,bool) { t << "\n.RI \""; m_firstCol=FALSE; }
+    void endMemberDescription()   { t << "\""; m_firstCol=FALSE; }
     void startMemberDeclaration() {} 
     void endMemberDeclaration(const char *,const char *) {}
     void writeInheritedSectionTitle(const char *,const char *,const char *,
@@ -203,7 +203,7 @@ class ManGenerator : public OutputGenerator
     void endDescTableRow() {}
     void startDescTableTitle() { startItemListItem(); startBold(); startEmphasis(); endItemListItem(); }
     void endDescTableTitle() { endEmphasis(); endBold(); }
-    void startDescTableData() { t << endl; firstCol=TRUE; }
+    void startDescTableData() { t << endl; m_firstCol=TRUE; }
     void endDescTableData() {}
 
     void startDotGraph() {}
@@ -264,12 +264,12 @@ class ManGenerator : public OutputGenerator
     void addWord(const char *,bool) {}
 
   private:
-    bool firstCol;
-    bool paragraph;
-    int col;
-    bool upperCase;
-    bool insideTabbing;
-    bool inHeader;
+    bool m_firstCol;
+    bool m_paragraph;
+    int  m_col;
+    bool m_upperCase;
+    bool m_insideTabbing;
+    bool m_inHeader;
 
     ManGenerator(const ManGenerator &g);
     ManGenerator &operator=(const ManGenerator &g);
index 2cbdcb5..8594a15 100644 (file)
@@ -51,6 +51,7 @@
 #include "config.h"
 #include "section.h"
 #include "message.h"
+#include "portable.h"
 
 //-----------
 
@@ -108,7 +109,8 @@ static Entry         *g_current;
 static QCString       g_fileName;
 static int            g_lineNr;
 static int            g_indentLevel=0;  // 0 is outside markdown, -1=page level
-
+static const char     g_utf8_nbsp[3] = {'\xc2', '\xa0', '\0'}; // UTF-8 nbsp
+static const char    *g_doxy_nsbp = "&_doxy_nbsp;";            // doxygen escape command for UTF-8 nbsp
 //----------
 
 const int codeBlockIndent = 4;
@@ -480,7 +482,7 @@ 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 && off>=2 && qstrncmp(data-2,"<!",2)==0) return 1-count; // 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
   {
@@ -1028,6 +1030,17 @@ static int processCodeSpan(GrowBuf &out, const char *data, int /*offset*/, int s
   return end;
 }
 
+static void addStrEscapeUtf8Nbsp(GrowBuf &out,const char *s,int len)
+{
+  if (Portable::strnstr(s,g_doxy_nsbp,len)==0) // no escape needed -> fast
+  {
+    out.addStr(s,len);
+  }
+  else // escape needed -> slow
+  {
+    out.addStr(substitute(QCString(s).left(len),g_doxy_nsbp,g_utf8_nbsp));
+  }
+}
 
 static int processSpecialCommand(GrowBuf &out, const char *data, int offset, int size)
 {
@@ -1044,7 +1057,7 @@ static int processSpecialCommand(GrowBuf &out, const char *data, int offset, int
         if (qstrncmp(&data[i+1],endBlockName,l)==0)
         {
           //printf("found end at %d\n",i);
-          out.addStr(data,i+1+l);
+          addStrEscapeUtf8Nbsp(out,data,i+1+l);
           return i+1+l;
         }
       }
@@ -1084,9 +1097,9 @@ static void processInline(GrowBuf &out,const char *data,int size)
     if (end>=size) break;
     i=end;
     end = action(out,data+i,i,size-i);
-    if (!end)
+    if (end<=0)
     {
-      end=i+1;
+      end=i+1-end;
     }
     else
     {
@@ -1828,7 +1841,7 @@ static int writeTableBlock(GrowBuf &out,const char *data,int size)
   }
 
 
-  out.addStr("<table class=\"markdownTable\">\n");
+  out.addStr("<table class=\"markdownTable\">");
   QCString cellTag("th"), cellClass("class=\"markdownTableHead");
   for (unsigned row = 0; row < tableContents.size(); row++)
   {
@@ -1836,16 +1849,16 @@ static int writeTableBlock(GrowBuf &out,const char *data,int size)
     {
       if (row % 2)
       {
-        out.addStr("<tr class=\"markdownTableRowOdd\">\n");
+        out.addStr("<tr class=\"markdownTableRowOdd\">");
       }
       else
       {
-        out.addStr("<tr class=\"markdownTableRowEven\">\n");
+        out.addStr("<tr class=\"markdownTableRowEven\">");
       }
     }
     else
     {
-      out.addStr("  <tr class=\"markdownTableHead\">\n");
+      out.addStr("  <tr class=\"markdownTableHead\">");
     }
     for (int c = 0; c < columns; c++)
     {
@@ -1900,7 +1913,7 @@ static int writeTableBlock(GrowBuf &out,const char *data,int size)
       }
       // need at least one space on either side of the cell text in
       // order for doxygen to do other formatting
-      out.addStr("> " + cellText + "\n</" + cellTag + ">\n");
+      out.addStr("> " + cellText + "</" + cellTag + ">");
     }
     cellTag = "td";
     cellClass = "class=\"markdownTableBody";
@@ -2021,7 +2034,7 @@ static int writeBlockQuote(GrowBuf &out,const char *data,int size)
         out.addStr("<blockquote>\n");
       }
     }
-    else if (level<curLevel) // quote level descreased => add end markers
+    else if (level<curLevel) // quote level decreased => add end markers
     {
       for (l=level;l<curLevel;l++)
       {
@@ -2064,7 +2077,7 @@ static int writeCodeBlock(GrowBuf &out,const char *data,int size,int refIndent)
       emptyLines++;
       i=end;
     }
-    else if (indent>=refIndent+codeBlockIndent) // enough indent to contine the code block
+    else if (indent>=refIndent+codeBlockIndent) // enough indent to continue the code block
     {
       while (emptyLines>0) // write skipped empty lines
       {
@@ -2174,9 +2187,9 @@ static void writeFencedCodeBlock(GrowBuf &out,const char *data,const char *lng,
   {
     out.addStr("{"+lang+"}");
   }
-  out.addStr(data+blockStart,blockEnd-blockStart);
+  addStrEscapeUtf8Nbsp(out,data+blockStart,blockEnd-blockStart);
   out.addStr("\n");
-  out.addStr("@endcode");
+  out.addStr("@endcode\n");
 }
 
 static QCString processQuotations(const QCString &s,int refIndent)
@@ -2470,7 +2483,7 @@ static QCString detab(const QCString &s,int &refIndent)
           while (stop--) out.addChar(' '); 
         }
         break;
-      case '\n': // reset colomn counter
+      case '\n': // reset column counter
         out.addChar(c);
         col=0;
         break;
@@ -2484,7 +2497,7 @@ static QCString detab(const QCString &s,int &refIndent)
           // special handling of the UTF-8 nbsp character 0xc2 0xa0
           if (c == '\xc2' && data[i] == '\xa0')
           {
-            out.addStr("&nbsp;");
+            out.addStr(g_doxy_nsbp);
             i++;
           }
           else
@@ -2561,7 +2574,7 @@ QCString processMarkdown(const QCString &fileName,const int lineNr,Entry *e,cons
   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()));
-  return out.get();
+  return substitute(out.get(),g_doxy_nsbp,"&nbsp;");
 }
 
 //---------------------------------------------------------------------------
@@ -2576,13 +2589,13 @@ QCString markdownFileNameToId(const QCString &fileName)
 }
 
 
-void MarkdownFileParser::parseInput(const char *fileName, 
+void MarkdownOutlineParser::parseInput(const char *fileName, 
                 const char *fileBuf, 
-                Entry *root,
+                const std::shared_ptr<Entry> &root,
                 bool /*sameTranslationUnit*/,
                 QStrList & /*filesInSameTranslationUnit*/)
 {
-  Entry *current = new Entry;
+  std::shared_ptr<Entry> current = std::make_shared<Entry>();
   current->lang = SrcLangExt_Markdown;
   current->fileName = fileName;
   current->docFile  = fileName;
@@ -2590,7 +2603,7 @@ void MarkdownFileParser::parseInput(const char *fileName,
   QCString docs = fileBuf;
   QCString id;
   QCString title=extractPageTitle(docs,id).stripWhiteSpace();
-  if (QString(id).startsWith("autotoc_md")) id = "";
+  if (id.startsWith("autotoc_md")) id = "";
   g_indentLevel=title.isEmpty() ? 0 : -1;
   QCString titleFn = QFileInfo(fileName).baseName().utf8();
   QCString fn      = QFileInfo(fileName).fileName().utf8();
@@ -2630,7 +2643,7 @@ void MarkdownFileParser::parseInput(const char *fileName,
   QCString processedDocs = preprocessCommentBlock(docs,fileName,lineNr);
   while (parseCommentBlock(
         this,
-        current,
+        current.get(),
         processedDocs,
         fileName,
         lineNr,
@@ -2644,8 +2657,7 @@ void MarkdownFileParser::parseInput(const char *fileName,
     if (needsEntry)
     {
       QCString docFile = current->docFile;
-      root->addSubEntry(current);
-      current = new Entry;
+      root->moveToSubEntryAndRefresh(current);
       current->lang = SrcLangExt_Markdown;
       current->docFile = docFile;
       current->docLine = lineNr;
@@ -2653,7 +2665,7 @@ void MarkdownFileParser::parseInput(const char *fileName,
   }
   if (needsEntry)
   {
-    root->addSubEntry(current);
+    root->moveToSubEntryAndKeep(current);
   }
 
   // restore setting
@@ -2661,47 +2673,14 @@ void MarkdownFileParser::parseInput(const char *fileName,
   g_indentLevel=0;
 }
 
-void MarkdownFileParser::parseCode(CodeOutputInterface &codeOutIntf,
-               const char *scopeName,
-               const QCString &input,
-               SrcLangExt lang,
-               bool isExampleBlock,
-               const char *exampleName,
-               FileDef *fileDef,
-               int startLine,
-               int endLine,
-               bool inlineFragment,
-               const MemberDef *memberDef,
-               bool showLineNumbers,
-               const Definition *searchCtx,
-               bool collectXRefs
-              )
+void MarkdownOutlineParser::parsePrototype(const char *text)
 {
-  ParserInterface *pIntf = Doxygen::parserManager->getParser("*.cpp");
-  if (pIntf!=this)
+  OutlineParserInterface &intf = Doxygen::parserManager->getOutlineParser("*.cpp");
+  if (&intf!=this)
   {
-    pIntf->parseCode(
-       codeOutIntf,scopeName,input,lang,isExampleBlock,exampleName,
-       fileDef,startLine,endLine,inlineFragment,memberDef,showLineNumbers,
-       searchCtx,collectXRefs);
+    intf.parsePrototype(text);
   }
 }
 
-void MarkdownFileParser::resetCodeParserState()
-{
-  ParserInterface *pIntf = Doxygen::parserManager->getParser("*.cpp");
-  if (pIntf!=this)
-  {
-    pIntf->resetCodeParserState();
-  }
-}
-
-void MarkdownFileParser::parsePrototype(const char *text)
-{
-  ParserInterface *pIntf = Doxygen::parserManager->getParser("*.cpp");
-  if (pIntf!=this)
-  {
-    pIntf->parsePrototype(text);
-  }
-}
+//------------------------------------------------------------------------
 
index 1a3895e..3ffd155 100644 (file)
@@ -25,38 +25,20 @@ class Entry;
 QCString processMarkdown(const QCString &fileName,const int lineNr,Entry *e,const QCString &s);
 QCString markdownFileNameToId(const QCString &fileName);
 
-class MarkdownFileParser : public ParserInterface
+class MarkdownOutlineParser : public OutlineParserInterface
 {
   public:
-    virtual ~MarkdownFileParser() {}
+    virtual ~MarkdownOutlineParser() {}
     void startTranslationUnit(const char *) {}
     void finishTranslationUnit() {}
     void parseInput(const char *fileName, 
                     const char *fileBuf, 
-                    Entry *root,
+                    const std::shared_ptr<Entry> &root,
                     bool sameTranslationUnit,
                     QStrList &filesInSameTranslationUnit);
-    bool needsPreprocessing(const QCString &) { return FALSE; }
-    void parseCode(CodeOutputInterface &codeOutIntf,
-                   const char *scopeName,
-                   const QCString &input,
-                   SrcLangExt lang,
-                   bool isExampleBlock,
-                   const char *exampleName=0,
-                   FileDef *fileDef=0,
-                   int startLine=-1,
-                   int endLine=-1,
-                   bool inlineFragment=FALSE,
-                   const MemberDef *memberDef=0,
-                   bool showLineNumbers=TRUE,
-                   const Definition *searchCtx=0,
-                   bool collectXRefs=TRUE
-                  );
-    void resetCodeParserState();
+    bool needsPreprocessing(const QCString &) const { return FALSE; }
     void parsePrototype(const char *text);
 };
 
 
-
-
 #endif
index 9d6ac51..1c935ac 100644 (file)
@@ -54,12 +54,12 @@ class MemberDefImpl : public DefinitionImpl, public MemberDef
     MemberDefImpl(const char *defFileName,int defLine,int defColumn,
               const char *type,const char *name,const char *args,
               const char *excp,Protection prot,Specifier virt,bool stat,
-              Relationship related,MemberType t,const ArgumentList *tal,
-              const ArgumentList *al,const char *metaData);
+              Relationship related,MemberType t,const ArgumentList &tal,
+              const ArgumentList &al,const char *metaData);
     virtual ~MemberDefImpl();
 
     virtual DefType definitionType() const        { return TypeMember; }
-    virtual MemberDef *resolveAlias() { return this; }
+    virtual       MemberDef *resolveAlias()       { return this; }
     virtual const MemberDef *resolveAlias() const { return this; }
     virtual MemberDef *deepCopy() const;
     virtual void moveTo(Definition *);
@@ -76,7 +76,7 @@ class MemberDefImpl : public DefinitionImpl, public MemberDef
     virtual const QCString &initializer() const;
     virtual int initializerLines() const;
     virtual uint64 getMemberSpecifiers() const;
-    virtual const MemberList *getSectionList(const Definition *d) const;
+    virtual const MemberList *getSectionList() const;
     virtual QCString    displayDefinition() const;
     virtual const ClassDef *getClassDef() const;
     virtual ClassDef *getClassDef();
@@ -202,11 +202,11 @@ class MemberDefImpl : public DefinitionImpl, public MemberDef
     virtual bool hasExamples() const;
     virtual ExampleSDict *getExamples() const;
     virtual bool isPrototype() const;
-    virtual const ArgumentList *argumentList() const;
-    virtual ArgumentList *argumentList();
-    virtual const ArgumentList *declArgumentList() const;
-    virtual const ArgumentList *templateArguments() const;
-    virtual const QList<ArgumentList> *definitionTemplateParameterLists() const;
+    virtual const ArgumentList &argumentList() const;
+    virtual ArgumentList &argumentList();
+    virtual const ArgumentList &declArgumentList() const;
+    virtual const ArgumentList &templateArguments() const;
+    virtual const std::vector<ArgumentList> &definitionTemplateParameterLists() const;
     virtual int getMemberGroupId() const;
     virtual MemberGroup *getMemberGroup() const;
     virtual bool fromAnonymousScope() const;
@@ -233,7 +233,7 @@ class MemberDefImpl : public DefinitionImpl, public MemberDef
     virtual QCString displayName(bool=TRUE) const;
     virtual QCString getDeclType() const;
     virtual void getLabels(QStrList &sl,const Definition *container) const;
-    virtual const ArgumentList *typeConstraints() const;
+    virtual const ArgumentList &typeConstraints() const;
     virtual QCString documentation() const;
     virtual QCString briefDescription(bool abbr=FALSE) const;
     virtual QCString fieldType() const;
@@ -252,7 +252,7 @@ class MemberDefImpl : public DefinitionImpl, public MemberDef
     virtual void setBitfields(const char *s);
     virtual void setMaxInitLines(int lines);
     virtual void setMemberClass(ClassDef *cd);
-    virtual void setSectionList(Definition *d,MemberList *sl);
+    virtual void setSectionList(MemberList *sl);
     virtual void setGroupDef(GroupDef *gd,Grouping::GroupPri_t pri,
                      const QCString &fileName,int startLine,bool hasDocs,
                      MemberDef *member=0);
@@ -262,7 +262,7 @@ class MemberDefImpl : public DefinitionImpl, public MemberDef
     virtual void makeRelated();
     virtual void makeForeign();
     virtual void setInheritsDocsFrom(MemberDef *md);
-    virtual void setTagInfo(TagInfo *i);
+    virtual void setTagInfo(const TagInfo *i);
     virtual void setArgsString(const char *as);
     virtual void setReimplements(MemberDef *md);
     virtual void insertReimplementedBy(MemberDef *md);
@@ -276,10 +276,10 @@ class MemberDefImpl : public DefinitionImpl, public MemberDef
     virtual void setPrototype(bool p,const QCString &df,int line, int column);
     virtual void setExplicitExternal(bool b,const QCString &df,int line,int column);
     virtual void setDeclFile(const QCString &df,int line,int column);
-    virtual void setArgumentList(ArgumentList *al);
-    virtual void setDeclArgumentList(ArgumentList *al);
-    virtual void setDefinitionTemplateParameterLists(QList<ArgumentList> *lists);
-    virtual void setTypeConstraints(ArgumentList *al);
+    virtual void setArgumentList(const ArgumentList &al);
+    virtual void setDeclArgumentList(const ArgumentList &al);
+    virtual void setDefinitionTemplateParameterLists(const std::vector<ArgumentList> &lists);
+    virtual void setTypeConstraints(const ArgumentList &al);
     virtual void setType(const char *t);
     virtual void setAccessorType(ClassDef *cd,const char *t);
     virtual void setNamespace(NamespaceDef *nd);
@@ -324,8 +324,8 @@ class MemberDefImpl : public DefinitionImpl, public MemberDef
     virtual void warnIfUndocumented() const;
     virtual void warnIfUndocumentedParams() const;
     virtual void detectUndocumentedParams(bool hasParamCommand,bool hasReturnCommand) const;
-    virtual MemberDef *createTemplateInstanceMember(ArgumentList *formalArgs,
-               ArgumentList *actualArgs) const;
+    virtual MemberDef *createTemplateInstanceMember(const ArgumentList &formalArgs,
+               const ArgumentList &actualArgs) const;
     virtual void findSectionsInDocumentation();
     virtual void writeLink(OutputList &ol,
                    const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,
@@ -367,8 +367,8 @@ class MemberDefImpl : public DefinitionImpl, public MemberDef
 MemberDef *createMemberDef(const char *defFileName,int defLine,int defColumn,
               const char *type,const char *name,const char *args,
               const char *excp,Protection prot,Specifier virt,bool stat,
-              Relationship related,MemberType t,const ArgumentList *tal,
-              const ArgumentList *al,const char *metaData)
+              Relationship related,MemberType t,const ArgumentList &tal,
+              const ArgumentList &al,const char *metaData)
 {
   return new MemberDefImpl(defFileName,defLine,defColumn,type,name,args,excp,prot,virt,
                            stat,related,t,tal,al,metaData);
@@ -380,12 +380,12 @@ class MemberDefAliasImpl : public DefinitionAliasImpl, public MemberDef
 {
   public:
     MemberDefAliasImpl(const Definition *newScope,const MemberDef *md) 
-    : DefinitionAliasImpl(newScope,md) {}
+    : DefinitionAliasImpl(newScope,md), m_memberGroup(0) {}
     virtual ~MemberDefAliasImpl() {}
     virtual DefType definitionType() const { return TypeMember; }
 
-    const MemberDef *getMdAlias() const { return dynamic_cast<const MemberDef*>(getAlias()); }
-    virtual MemberDef *resolveAlias() { return const_cast<MemberDef*>(getMdAlias()); }
+    const MemberDef *getMdAlias() const           { return dynamic_cast<const MemberDef*>(getAlias()); }
+    virtual       MemberDef *resolveAlias()       { return const_cast<MemberDef*>(getMdAlias()); }
     virtual const MemberDef *resolveAlias() const { return getMdAlias(); }
 
     virtual MemberDef *deepCopy() const  {
@@ -419,8 +419,8 @@ class MemberDefAliasImpl : public DefinitionAliasImpl, public MemberDef
     { return getMdAlias()->initializerLines(); }
     virtual uint64 getMemberSpecifiers() const
     { return getMdAlias()->getMemberSpecifiers(); }
-    virtual const MemberList *getSectionList(const Definition *d) const
-    { return getMdAlias()->getSectionList(d); }
+    virtual const MemberList *getSectionList() const
+    { return getMdAlias()->getSectionList(); }
     virtual QCString displayDefinition() const
     { return getMdAlias()->displayDefinition(); }
     virtual const ClassDef *getClassDef() const
@@ -661,18 +661,18 @@ class MemberDefAliasImpl : public DefinitionAliasImpl, public MemberDef
     { return getMdAlias()->getExamples(); }
     virtual bool isPrototype() const
     { return getMdAlias()->isPrototype(); }
-    virtual const ArgumentList *argumentList() const
+    virtual const ArgumentList &argumentList() const
     { return getMdAlias()->argumentList(); }
-    virtual const ArgumentList *declArgumentList() const
+    virtual const ArgumentList &declArgumentList() const
     { return getMdAlias()->declArgumentList(); }
-    virtual const ArgumentList *templateArguments() const
+    virtual const ArgumentList &templateArguments() const
     { return getMdAlias()->templateArguments(); }
-    virtual const QList<ArgumentList> *definitionTemplateParameterLists() const
+    virtual const std::vector<ArgumentList> &definitionTemplateParameterLists() const
     { return getMdAlias()->definitionTemplateParameterLists(); }
     virtual int getMemberGroupId() const
     { return getMdAlias()->getMemberGroupId(); }
     virtual MemberGroup *getMemberGroup() const
-    { return getMdAlias()->getMemberGroup(); }
+    { return m_memberGroup; }
     virtual bool fromAnonymousScope() const
     { return getMdAlias()->fromAnonymousScope(); }
     virtual bool anonymousDeclShown() const
@@ -721,7 +721,7 @@ class MemberDefAliasImpl : public DefinitionAliasImpl, public MemberDef
     { return getMdAlias()->getDeclType(); }
     virtual void getLabels(QStrList &sl,const Definition *container) const
     { return getMdAlias()->getLabels(sl,container); }
-    virtual const ArgumentList *typeConstraints() const
+    virtual const ArgumentList &typeConstraints() const
     { return getMdAlias()->typeConstraints(); }
     virtual QCString documentation() const
     { return getMdAlias()->documentation(); }
@@ -747,8 +747,10 @@ class MemberDefAliasImpl : public DefinitionAliasImpl, public MemberDef
     { err("non-const getNamespaceDef() called on aliased member. Please report as a bug.\n"); return 0; }
     virtual GroupDef *getGroupDef()
     { err("non-const getGroupDef() called on aliased member. Please report as a bug.\n"); return 0; }
-    virtual ArgumentList *argumentList()
-    { err("non-const argumentList() called on aliased member. Please report as bug.\n"); return 0; }
+    virtual ArgumentList &argumentList()
+    { err("non-const argumentList() called on aliased member. Please report as bug.\n");
+      static ArgumentList dummy; return dummy;
+    }
 
     virtual void setEnumBaseType(const QCString &type) {}
     virtual void setMemberType(MemberType t) {}
@@ -762,7 +764,7 @@ class MemberDefAliasImpl : public DefinitionAliasImpl, public MemberDef
     virtual void setBitfields(const char *s) {}
     virtual void setMaxInitLines(int lines) {}
     virtual void setMemberClass(ClassDef *cd) {}
-    virtual void setSectionList(Definition *d,MemberList *sl) {}
+    virtual void setSectionList(MemberList *sl) {}
     virtual void setGroupDef(GroupDef *gd,Grouping::GroupPri_t pri,
                      const QCString &fileName,int startLine,bool hasDocs,
                      MemberDef *member=0) {}
@@ -772,7 +774,7 @@ class MemberDefAliasImpl : public DefinitionAliasImpl, public MemberDef
     virtual void makeRelated() {}
     virtual void makeForeign() {}
     virtual void setInheritsDocsFrom(MemberDef *md) {}
-    virtual void setTagInfo(TagInfo *i) {}
+    virtual void setTagInfo(const TagInfo *i) {}
     virtual void setArgsString(const char *as) {}
     virtual void setReimplements(MemberDef *md) {}
     virtual void insertReimplementedBy(MemberDef *md) {}
@@ -786,14 +788,14 @@ class MemberDefAliasImpl : public DefinitionAliasImpl, public MemberDef
     virtual void setPrototype(bool p,const QCString &df,int line, int column) {}
     virtual void setExplicitExternal(bool b,const QCString &df,int line,int column) {}
     virtual void setDeclFile(const QCString &df,int line,int column) {}
-    virtual void setArgumentList(ArgumentList *al) {}
-    virtual void setDeclArgumentList(ArgumentList *al) {}
-    virtual void setDefinitionTemplateParameterLists(QList<ArgumentList> *lists) {}
-    virtual void setTypeConstraints(ArgumentList *al) {}
+    virtual void setArgumentList(const ArgumentList &al) {}
+    virtual void setDeclArgumentList(const ArgumentList &al) {}
+    virtual void setDefinitionTemplateParameterLists(const std::vector<ArgumentList> &lists) {}
+    virtual void setTypeConstraints(const ArgumentList &al) {}
     virtual void setType(const char *t) {}
     virtual void setAccessorType(ClassDef *cd,const char *t) {}
     virtual void setNamespace(NamespaceDef *nd) {}
-    virtual void setMemberGroup(MemberGroup *grp) {}
+    virtual void setMemberGroup(MemberGroup *grp) { m_memberGroup = grp; }
     virtual void setMemberGroupId(int id) {}
     virtual void makeImplementationDetail() {}
     virtual void setFromAnonymousScope(bool b) const {}
@@ -821,8 +823,8 @@ class MemberDefAliasImpl : public DefinitionAliasImpl, public MemberDef
     virtual void setHidden(bool b) {}
     virtual void addToSearchIndex() const {}
     virtual void findSectionsInDocumentation() {}
-    virtual MemberDef *createTemplateInstanceMember(ArgumentList *formalArgs,
-               ArgumentList *actualArgs) const
+    virtual MemberDef *createTemplateInstanceMember(const ArgumentList &formalArgs,
+               const ArgumentList &actualArgs) const
     { return getMdAlias()->createTemplateInstanceMember(formalArgs,actualArgs); }
     virtual void incrementFlowKeyWordCount() {}
 
@@ -849,6 +851,8 @@ class MemberDefAliasImpl : public DefinitionAliasImpl, public MemberDef
     virtual void warnIfUndocumented() const {}
     virtual void warnIfUndocumentedParams() const {}
     virtual void detectUndocumentedParams(bool hasParamCommand,bool hasReturnCommand) const {}
+  private:
+    MemberGroup *m_memberGroup; // group's member definition
 };
 
 
@@ -932,10 +936,10 @@ static QCString addTemplateNames(const QCString &s,const QCString &n,const QCStr
 
 static bool writeDefArgumentList(OutputList &ol,const Definition *scope,const MemberDef *md)
 {
-  const ArgumentList *defArgList=(md->isDocsForDefinition()) ?
+  const ArgumentList &defArgList=(md->isDocsForDefinition()) ?
                              md->argumentList() : md->declArgumentList();
   //printf("writeDefArgumentList '%s' isDocsForDefinition()=%d\n",md->name().data(),md->isDocsForDefinition());
-  if (defArgList==0 || md->isProperty())
+  if (!defArgList.hasParameters() || md->isProperty())
   {
     return FALSE; // member has no function like argument list
   }
@@ -943,23 +947,21 @@ static bool writeDefArgumentList(OutputList &ol,const Definition *scope,const Me
   // simple argument list for tcl
   if (md->getLanguage()==SrcLangExt_Tcl)
   {
-    if (defArgList->count()==0) return FALSE;
-    ArgumentListIterator ali(*defArgList);
-    Argument *a;
+    if (defArgList.empty()) return FALSE;
     ol.endMemberDocName();
     ol.startParameterList(FALSE);
     ol.startParameterType(TRUE,0);
     ol.endParameterType();
     ol.startParameterName(FALSE);
-    for (;(a=ali.current());++ali)
+    for (const Argument &a : defArgList)
     {
-      if (a->defval.isEmpty())
+      if (a.defval.isEmpty())
       {
-        ol.docify(a->name+" ");
+        ol.docify(a.name+" ");
       }
       else
       {
-        ol.docify("?"+a->name+"? ");
+        ol.docify("?"+a.name+"? ");
       }
     }
     ol.endParameterName(TRUE,FALSE,FALSE);
@@ -1006,9 +1008,10 @@ static bool writeDefArgumentList(OutputList &ol,const Definition *scope,const Me
       cName=cName.mid(il,ir-il+1);
       //printf("1. cName=%s\n",cName.data());
     }
-    else if (scope->definitionType()==Definition::TypeClass && (dynamic_cast<const ClassDef*>(scope))->templateArguments())
+    else if (scope->definitionType()==Definition::TypeClass)
     {
-      cName=tempArgListToString((dynamic_cast<const ClassDef*>(scope))->templateArguments(),scope->getLanguage());
+      cName=tempArgListToString((dynamic_cast<const ClassDef*>(scope))->templateArguments(),
+                             scope->getLanguage());
       //printf("2. cName=%s\n",cName.data());
     }
     else // no template specifier
@@ -1021,10 +1024,10 @@ static bool writeDefArgumentList(OutputList &ol,const Definition *scope,const Me
   bool first=TRUE;
   bool paramTypeStarted=FALSE;
   bool isDefine = md->isDefine();
-  ArgumentListIterator ali(*defArgList);
-  Argument *a=ali.current();
-  while (a)
+  auto alIt = defArgList.begin();
+  while (alIt!=defArgList.end())
   {
+    Argument a = *alIt;
     if (isDefine || first)
     {
       ol.startParameterType(first,0);
@@ -1036,30 +1039,30 @@ static bool writeDefArgumentList(OutputList &ol,const Definition *scope,const Me
       }
     }
     QRegExp re(")("),res("(.*\\*");
-    int vp=a->type.find(re);
-    int wp=a->type.find(res);
+    int vp=a.type.find(re);
+    int wp=a.type.find(res);
 
     // use the following to put the function pointer type before the name
     bool hasFuncPtrType=FALSE;
 
-    if (!a->attrib.isEmpty() && !md->isObjCMethod()) // argument has an IDL attribute
+    if (!a.attrib.isEmpty() && !md->isObjCMethod()) // argument has an IDL attribute
     {
-      ol.docify(a->attrib+" ");
+      ol.docify(a.attrib+" ");
     }
     if (hasFuncPtrType) // argument type is a function pointer
     {
-      //printf("a->type='%s' a->name='%s'\n",a->type.data(),a->name.data());
-      QCString n=a->type.left(vp);
-      if (hasFuncPtrType) n=a->type.left(wp);
+      //printf("a.type='%s' a.name='%s'\n",a.type.data(),a.name.data());
+      QCString n=a.type.left(vp);
+      if (hasFuncPtrType) n=a.type.left(wp);
       if (md->isObjCMethod()) { n.prepend("("); n.append(")"); }
       if (!cName.isEmpty()) n=addTemplateNames(n,scope->name(),cName);
       linkifyText(TextGeneratorOLImpl(ol),scope,md->getBodyDef(),md,n);
     }
     else // non-function pointer type
     {
-      QCString n=a->type;
+      QCString n=a.type;
       if (md->isObjCMethod()) { n.prepend("("); n.append(")"); }
-      if (a->type!="...")
+      if (a.type!="...")
       {
         if (!cName.isEmpty()) n=addTemplateNames(n,scope->name(),cName);
         linkifyText(TextGeneratorOLImpl(ol),scope,md->getBodyDef(),md,n);
@@ -1072,13 +1075,13 @@ static bool writeDefArgumentList(OutputList &ol,const Definition *scope,const Me
         ol.endParameterType();
         paramTypeStarted=FALSE;
       }
-      ol.startParameterName(defArgList->count()<2);
+      ol.startParameterName(defArgList.size()<2);
     }
     if (hasFuncPtrType)
     {
-      ol.docify(a->type.mid(wp,vp-wp));
+      ol.docify(a.type.mid(wp,vp-wp));
     }
-    if (!a->name.isEmpty() || a->type=="...") // argument has a name
+    if (!a.name.isEmpty() || a.type=="...") // argument has a name
     {
       //if (!hasFuncPtrType)
       //{
@@ -1094,7 +1097,7 @@ static bool writeDefArgumentList(OutputList &ol,const Definition *scope,const Me
       ol.enable(OutputGenerator::Man);
       if (latexOn) ol.enable(OutputGenerator::Latex);
       if (docbookOn) ol.enable(OutputGenerator::Docbook);
-      if (a->name.isEmpty()) ol.docify(a->type); else ol.docify(a->name);
+      if (a.name.isEmpty()) ol.docify(a.type); else ol.docify(a.name);
       ol.disable(OutputGenerator::Man);
       ol.disable(OutputGenerator::Latex);
       ol.disable(OutputGenerator::Docbook);
@@ -1103,19 +1106,19 @@ static bool writeDefArgumentList(OutputList &ol,const Definition *scope,const Me
       if (latexOn) ol.enable(OutputGenerator::Latex);
       if (docbookOn) ol.enable(OutputGenerator::Docbook);
     }
-    if (!a->array.isEmpty())
+    if (!a.array.isEmpty())
     {
-      ol.docify(a->array);
+      ol.docify(a.array);
     }
     if (hasFuncPtrType) // write the part of the argument type
                         // that comes after the name
     {
       linkifyText(TextGeneratorOLImpl(ol),scope,md->getBodyDef(),
-                  md,a->type.right(a->type.length()-vp));
+                  md,a.type.right(a.type.length()-vp));
     }
-    if (!a->defval.isEmpty()) // write the default value
+    if (!a.defval.isEmpty()) // write the default value
     {
-      QCString n=a->defval;
+      QCString n=a.defval;
       if (!cName.isEmpty()) n=addTemplateNames(n,scope->name(),cName);
       ol.docify(" = ");
 
@@ -1124,19 +1127,19 @@ static bool writeDefArgumentList(OutputList &ol,const Definition *scope,const Me
       ol.endTypewriter();
 
     }
-    ++ali;
-    a=ali.current();
-    if (a)
+    ++alIt;
+    if (alIt!=defArgList.end())
     {
+      a = *alIt;
       if (!md->isObjCMethod()) ol.docify(", "); // there are more arguments
       if (!isDefine)
       {
         QCString key;
-        if (md->isObjCMethod() && a->attrib.length()>=2)
+        if (md->isObjCMethod() && a.attrib.length()>=2)
         {
-          //printf("Found parameter keyword %s\n",a->attrib.data());
+          //printf("Found parameter keyword %s\n",a.attrib.data());
           // strip [ and ]
-          key=a->attrib.mid(1,a->attrib.length()-2);
+          key=a.attrib.mid(1,a.attrib.length()-2);
           if (key!=",") key+=":"; // for normal keywords add colon
         }
         ol.endParameterName(FALSE,FALSE,!md->isObjCMethod());
@@ -1163,36 +1166,36 @@ static bool writeDefArgumentList(OutputList &ol,const Definition *scope,const Me
   if (htmlOn) ol.enable(OutputGenerator::Html);
   if (latexOn) ol.enable(OutputGenerator::Latex);
   if (docbookOn) ol.enable(OutputGenerator::Docbook);
-  if (first) ol.startParameterName(defArgList->count()<2);
-  ol.endParameterName(TRUE,defArgList->count()<2,!md->isObjCMethod());
+  if (first) ol.startParameterName(defArgList.size()<2);
+  ol.endParameterName(TRUE,defArgList.size()<2,!md->isObjCMethod());
   ol.popGeneratorState();
   if (md->extraTypeChars())
   {
     ol.docify(md->extraTypeChars());
   }
-  if (defArgList->constSpecifier)
+  if (defArgList.constSpecifier)
   {
     ol.docify(" const");
   }
-  if (defArgList->volatileSpecifier)
+  if (defArgList.volatileSpecifier)
   {
     ol.docify(" volatile");
   }
-  if (defArgList->refQualifier==RefQualifierLValue)
+  if (defArgList.refQualifier==RefQualifierLValue)
   {
     ol.docify(" &");
   }
-  else if (defArgList->refQualifier==RefQualifierRValue)
+  else if (defArgList.refQualifier==RefQualifierRValue)
   {
     ol.docify(" &&");
   }
-  if (!defArgList->trailingReturnType.isEmpty())
+  if (!defArgList.trailingReturnType.isEmpty())
   {
     linkifyText(TextGeneratorOLImpl(ol), // out
                 scope,                   // scope
                 md->getBodyDef(),        // fileScope
                 md,                      // self
-                defArgList->trailingReturnType, // text
+                defArgList.trailingReturnType, // text
                 FALSE                    // autoBreak
                );
 
@@ -1262,24 +1265,22 @@ static void writeExceptionList(OutputList &ol, const ClassDef *cd, const MemberD
   }
 }
 
-static void writeTemplatePrefix(OutputList &ol,const ArgumentList *al)
+static void writeTemplatePrefix(OutputList &ol,const ArgumentList &al)
 {
   ol.docify("template<");
-  ArgumentListIterator ali(*al);
-  Argument *a = ali.current();
-  while (a)
+  for (auto it = al.begin(); it!=al.end();)
   {
-    ol.docify(a->type);
+    Argument a = *it;
+    ol.docify(a.type);
     ol.docify(" ");
-    ol.docify(a->name);
-    if (a->defval.length()!=0)
+    ol.docify(a.name);
+    if (a.defval.length()!=0)
     {
       ol.docify(" = ");
-      ol.docify(a->defval);
+      ol.docify(a.defval);
     }
-    ++ali;
-    a=ali.current();
-    if (a) ol.docify(", ");
+    ++it;
+    if (it!=al.end()) ol.docify(", ");
   }
   ol.docify("> ");
 }
@@ -1295,36 +1296,36 @@ class MemberDefImpl::IMPL
    ~IMPL();
     void init(Definition *def,const char *t,const char *a,const char *e,
               Protection p,Specifier v,bool s,Relationship r,
-              MemberType mt,const ArgumentList *tal,
-              const ArgumentList *al,const char *meta
+              MemberType mt,const ArgumentList &tal,
+              const ArgumentList &al,const char *meta
              );
 
-    ClassDef     *classDef;   // member of or related to
-    FileDef      *fileDef;    // member of file definition
-    NamespaceDef *nspace;     // the namespace this member is in.
+    ClassDef     *classDef = 0;   // member of or related to
+    FileDef      *fileDef = 0;    // member of file definition
+    NamespaceDef *nspace = 0;     // the namespace this member is in.
 
-    MemberDef  *enumScope;    // the enclosing scope, if this is an enum field
-    bool        livesInsideEnum;
-    const MemberDef  *annEnumType;  // the anonymous enum that is the type of this member
-    MemberList *enumFields;   // enumeration fields
+    MemberDef  *enumScope = 0;    // the enclosing scope, if this is an enum field
+    bool        livesInsideEnum = false;
+    const MemberDef  *annEnumType = 0;  // the anonymous enum that is the type of this member
+    MemberList *enumFields = 0;   // enumeration fields
 
-    MemberDef  *redefines;    // the members that this member redefines
-    MemberList *redefinedBy;  // the list of members that redefine this one
+    MemberDef  *redefines = 0;    // the members that this member redefines
+    MemberList *redefinedBy = 0;  // the list of members that redefine this one
 
-    MemberDef  *memDef;       // member definition for this declaration
-    MemberDef  *memDec;       // member declaration for this definition
-    ClassDef   *relatedAlso;  // points to class marked by relatedAlso
+    MemberDef  *memDef = 0;       // member definition for this declaration
+    MemberDef  *memDec = 0;       // member declaration for this definition
+    ClassDef   *relatedAlso = 0;  // points to class marked by relatedAlso
 
-    ExampleSDict *exampleSDict; // a dictionary of all examples for quick access
+    ExampleSDict *exampleSDict = 0; // a dictionary of all examples for quick access
 
     QCString type;            // return actual type
     QCString accessorType;    // return type that tell how to get to this member
-    ClassDef *accessorClass;  // class that this member accesses (for anonymous types)
+    ClassDef *accessorClass = 0;  // class that this member accesses (for anonymous types)
     QCString args;            // function arguments/variable array specifiers
     QCString def;             // member definition in code (fully qualified name)
     QCString anc;             // HTML anchor name
-    Specifier virt;           // normal/virtual/pure virtual
-    Protection prot;          // protection type [Public/Protected/Private]
+    Specifier virt = Normal;  // normal/virtual/pure virtual
+    Protection prot = Public; // protection type [Public/Protected/Private]
     QCString decl;            // member declaration in class
 
     QCString bitfields;       // struct member bitfields
@@ -1334,21 +1335,21 @@ class MemberDefImpl::IMPL
     QCString initializer;     // initializer
     QCString extraTypeChars;  // extra type info found after the argument list
     QCString enumBaseType;    // base type of the enum (C++11)
-    int initLines;            // number of lines in the initializer
+    int initLines = 0;            // number of lines in the initializer
 
-    uint64  memSpec;          // The specifiers present for this member
-    MemberType mtype;         // returns the kind of member
-    int maxInitLines;         // when the initializer will be displayed
-    int userInitLines;        // result of explicit \hideinitializer or \showinitializer
-    MemberDef  *annMemb;
+    uint64  memSpec = 0;          // The specifiers present for this member
+    MemberType mtype = MemberType_Define; // returns the kind of member
+    int maxInitLines = 0;         // when the initializer will be displayed
+    int userInitLines = 0;        // result of explicit \hideinitializer or \showinitializer
+    MemberDef  *annMemb = 0;
 
-    ArgumentList *defArgList;    // argument list of this member definition
-    ArgumentList *declArgList;   // argument list of this member declaration
+    ArgumentList defArgList;    // argument list of this member definition
+    ArgumentList declArgList;   // argument list of this member declaration
 
-    ArgumentList *tArgList;      // template argument list of function template
-    ArgumentList *typeConstraints; // type constraints for template parameters
+    ArgumentList tArgList;      // template argument list of function template
+    ArgumentList typeConstraints; // type constraints for template parameters
     MemberDef *templateMaster;
-    QList<ArgumentList> *defTmpArgLists; // lists of template argument lists
+    std::vector<ArgumentList> defTmpArgLists; // lists of template argument lists
                                          // (for template functions in nested template classes)
 
     QCString metaData;        // Slice metadata.
@@ -1357,19 +1358,19 @@ class MemberDefImpl::IMPL
                                    // as its type then this is computed by
                                    // getClassDefOfAnonymousType() and
                                    // cached here.
-    SDict<MemberList> *classSectionSDict; // not accessible
+    SDict<MemberList> *classSectionSDict = 0; // not accessible
 
-    const MemberDef *groupAlias;    // Member containing the definition
-    int grpId;                // group id
-    MemberGroup *memberGroup; // group's member definition
-    GroupDef *group;          // group in which this member is in
+    const MemberDef *groupAlias = 0;    // Member containing the definition
+    int grpId = 0;                // group id
+    MemberGroup *memberGroup = 0; // group's member definition
+    GroupDef *group = 0;          // group in which this member is in
     Grouping::GroupPri_t grouppri; // priority of this definition
     QCString groupFileName;   // file where this grouping was defined
-    int groupStartLine;       // line  "      "      "     "     "
-    MemberDef *groupMember;
+    int groupStartLine = 0;       // line  "      "      "     "     "
+    MemberDef *groupMember = 0;
 
-    bool isTypedefValCached;
-    const ClassDef *cachedTypedefValue;
+    bool isTypedefValCached = false;
+    const ClassDef *cachedTypedefValue = 0;
     QCString cachedTypedefTemplSpec;
     QCString cachedResolvedType;
 
@@ -1379,52 +1380,47 @@ class MemberDefImpl::IMPL
     //QCString inbodyDocs;
 
     // documentation inheritance
-    MemberDef *docProvider;
+    MemberDef *docProvider = 0;
 
     // to store the output file base from tag files
     QCString explicitOutputFileBase;
 
     // objective-c
-    bool implOnly; // function found in implementation but not
-                     // in the interface
-    mutable bool hasDocumentedParams;
-    mutable bool hasDocumentedReturnType;
-    bool isDMember;
-    Relationship related    // relationship of this to the class
-    bool stat;                // is it a static function?
-    bool proto;               // is it a prototype;
-    bool docEnumValues;       // is an enum with documented enum values.
-
-    mutable bool annScope;    // member is part of an anonymous scope
-    mutable bool annUsed;     // ugly: needs to be mutable to allow setAnonymousUsed to act as a
-                              // const member.
-    bool hasCallGraph;
-    bool hasCallerGraph;
-    bool hasReferencedByRelation;
-    bool hasReferencesRelation;
-    bool explExt;             // member was explicitly declared external
-    bool tspec;               // member is a template specialization
-    bool groupHasDocs;        // true if the entry that caused the grouping was documented
-    bool docsForDefinition;   // TRUE => documentation block is put before
-                              //         definition.
-                              // FALSE => block is put before declaration.
-    ClassDef *category;
-    MemberDef *categoryRelation;
+    bool implOnly = false; // function found in implementation but not
+                           // in the interface
+    mutable bool hasDocumentedParams = false;
+    mutable bool hasDocumentedReturnType = false;
+    bool isDMember = false;
+    Relationship related = Member;    // relationship of this to the class
+    bool stat = false;                // is it a static function?
+    bool proto = false;               // is it a prototype?
+    bool docEnumValues = false;       // is an enum with documented enum values.
+
+    mutable bool annScope = false;    // member is part of an anonymous scope
+    mutable bool annUsed = false;     // ugly: needs to be mutable to allow setAnonymousUsed to act as a
+                                      // const member.
+    bool hasCallGraph = false;
+    bool hasCallerGraph = false;
+    bool hasReferencedByRelation = false;
+    bool hasReferencesRelation = false;
+    bool explExt = false;             // member was explicitly declared external
+    bool tspec = false;               // member is a template specialization
+    bool groupHasDocs = false;        // true if the entry that caused the grouping was documented
+    bool docsForDefinition = false;   // TRUE => documentation block is put before
+                                      //         definition.
+                                      // FALSE => block is put before declaration.
+    ClassDef *category = 0;
+    MemberDef *categoryRelation = 0;
     QCString declFileName;
-    int declLine;
-    int declColumn;
-    int numberOfFlowKW;
+    int declLine = 0;
+    int declColumn = 0;
+    int numberOfFlowKW = 0;
 };
 
 MemberDefImpl::IMPL::IMPL() :
     enumFields(0),
     redefinedBy(0),
     exampleSDict(0),
-    defArgList(0),
-    declArgList(0),
-    tArgList(0),
-    typeConstraints(0),
-    defTmpArgLists(0),
     classSectionSDict(0),
     category(0),
     categoryRelation(0),
@@ -1439,19 +1435,14 @@ MemberDefImpl::IMPL::~IMPL()
   delete redefinedBy;
   delete exampleSDict;
   delete enumFields;
-  delete defArgList;
-  delete tArgList;
-  delete typeConstraints;
-  delete defTmpArgLists;
   delete classSectionSDict;
-  delete declArgList;
 }
 
 void MemberDefImpl::IMPL::init(Definition *def,
                      const char *t,const char *a,const char *e,
                      Protection p,Specifier v,bool s,Relationship r,
-                     MemberType mt,const ArgumentList *tal,
-                     const ArgumentList *al,const char *meta
+                     MemberType mt,const ArgumentList &tal,
+                     const ArgumentList &al,const char *meta
                     )
 {
   classDef=0;
@@ -1469,7 +1460,6 @@ void MemberDefImpl::IMPL::init(Definition *def,
   enumFields=0;
   enumScope=0;
   livesInsideEnum=FALSE;
-  defTmpArgLists=0;
   hasCallGraph = FALSE;
   hasCallerGraph = FALSE;
   hasReferencedByRelation = FALSE;
@@ -1506,36 +1496,17 @@ void MemberDefImpl::IMPL::init(Definition *def,
   userInitLines=-1;
   docEnumValues=FALSE;
   // copy function template arguments (if any)
-  if (tal)
-  {
-    tArgList = tal->deepCopy();
-  }
-  else
-  {
-    tArgList=0;
-  }
+  tArgList = tal;
   //printf("new member al=%p\n",al);
   // copy function definition arguments (if any)
-  if (al)
-  {
-    defArgList = al->deepCopy();
-  }
-  else
-  {
-    defArgList=0;
-  }
+  defArgList = al;
   // convert function declaration arguments (if any)
   if (!args.isEmpty())
   {
-    declArgList = new ArgumentList;
-    stringToArgumentList(args,declArgList,&extraTypeChars);
+    stringToArgumentList(def->getLanguage(),args,declArgList,&extraTypeChars);
     //printf("setDeclArgList %s to %s const=%d\n",args.data(),
     //    argListToString(declArgList).data(),declArgList->constSpecifier);
   }
-  else
-  {
-    declArgList = 0;
-  }
   metaData = meta;
   templateMaster = 0;
   classSectionSDict = 0;
@@ -1582,7 +1553,7 @@ void MemberDefImpl::IMPL::init(Definition *def,
 MemberDefImpl::MemberDefImpl(const char *df,int dl,int dc,
                      const char *t,const char *na,const char *a,const char *e,
                      Protection p,Specifier v,bool s,Relationship r,MemberType mt,
-                     const ArgumentList *tal,const ArgumentList *al,const char *meta
+                     const ArgumentList &tal,const ArgumentList &al,const char *meta
                     ) : DefinitionImpl(df,dl,dc,removeRedundantWhiteSpace(na))
 {
   //printf("MemberDefImpl::MemberDef(%s)\n",na);
@@ -1611,12 +1582,7 @@ MemberDef *MemberDefImpl::deepCopy() const
   result->m_impl->redefinedBy= 0;
   result->m_impl->exampleSDict=0;
   result->m_impl->enumFields=0;
-  result->m_impl->defArgList=0;
-  result->m_impl->tArgList=0;
-  result->m_impl->typeConstraints=0;
-  result->m_impl->defTmpArgLists=0;
   result->m_impl->classSectionSDict=0;
-  result->m_impl->declArgList=0;
   // replace pointers owned by the object by deep copies
   if (m_impl->redefinedBy)
   {
@@ -1645,18 +1611,9 @@ MemberDef *MemberDefImpl::deepCopy() const
       result->insertEnumField(md);
     }
   }
-  if (m_impl->defArgList)
-  {
-    result->m_impl->defArgList = m_impl->defArgList->deepCopy();
-  }
-  if (m_impl->tArgList)
-  {
-    result->m_impl->tArgList = m_impl->tArgList->deepCopy();
-  }
-  if (m_impl->typeConstraints)
-  {
-    result->m_impl->typeConstraints = m_impl->typeConstraints->deepCopy();
-  }
+  result->m_impl->defArgList = m_impl->defArgList;
+  result->m_impl->tArgList = m_impl->tArgList;
+  result->m_impl->typeConstraints = m_impl->typeConstraints;
   result->setDefinitionTemplateParameterLists(m_impl->defTmpArgLists);
   if (m_impl->classSectionSDict)
   {
@@ -1668,10 +1625,7 @@ MemberDef *MemberDefImpl::deepCopy() const
       result->m_impl->classSectionSDict->append(it.currentKey(),ml);
     }
   }
-  if (m_impl->declArgList)
-  {
-    result->m_impl->declArgList = m_impl->declArgList->deepCopy();
-  }
+  result->m_impl->declArgList = m_impl->declArgList;
   return result;
 }
 
@@ -1817,7 +1771,7 @@ QCString MemberDefImpl::getOutputFileBase() const
       return baseName;
     }
   }
-  else if (nspace && nspace->isLinkableInProject())
+  else if (nspace && (nspace->isLinkable() || nspace->isAnonymous()))
   {
     baseName=nspace->getOutputFileBase();
   }
@@ -1923,7 +1877,7 @@ void MemberDefImpl::_computeLinkableInProject()
     m_isLinkableCached = templateMaster()->isLinkableInProject() ? 2 : 1;
     return;
   }
-  if (name().isEmpty() || name().at(0)=='@')
+  if (isAnonymous())
   {
     //printf("name invalid\n");
     m_isLinkableCached = 1; // not a valid or a dummy name
@@ -2031,13 +1985,9 @@ bool MemberDefImpl::isLinkable() const
 }
 
 
-void MemberDefImpl::setDefinitionTemplateParameterLists(QList<ArgumentList> *lists)
+void MemberDefImpl::setDefinitionTemplateParameterLists(const std::vector<ArgumentList> &lists)
 {
-  if (lists)
-  {
-    if (m_impl->defTmpArgLists) delete m_impl->defTmpArgLists;
-    m_impl->defTmpArgLists = copyArgumentLists(lists);
-  }
+  m_impl->defTmpArgLists = lists;
 }
 
 void MemberDefImpl::writeLink(OutputList &ol,
@@ -2195,11 +2145,11 @@ bool MemberDefImpl::isBriefSectionVisible() const
 
   // Hide friend (class|struct|union) declarations if HIDE_FRIEND_COMPOUNDS is true
   bool visibleIfFriendCompound = !(hideFriendCompounds &&
-                                   isFriend() &&
+                                   isFriend() /*&&
                                    (m_impl->type=="friend class" ||
                                     m_impl->type=="friend struct" ||
                                     m_impl->type=="friend union"
-                                   )
+                                   )*/
                                   );
 
   // only include members that are non-private unless EXTRACT_PRIVATE is
@@ -2223,16 +2173,15 @@ bool MemberDefImpl::isBriefSectionVisible() const
   // hide default constructors or destructors (no args) without
   // documentation
   bool visibleIfNotDefaultCDTor = !(cOrDTor &&
-                                   m_impl->defArgList &&
-                                   (m_impl->defArgList->isEmpty() ||
-                                    m_impl->defArgList->getFirst()->type == "void"
+                                   (m_impl->defArgList.empty() ||
+                                    m_impl->defArgList.front().type == "void"
                                    ) &&
                                    !hasDocs
                                   );
 
 
   //printf("visibleIfStatic=%d visibleIfDocumented=%d visibleIfEnabled=%d "
-  //       "visibleIfPrivate=%d visibltIfNotDefaultCDTor=%d "
+  //       "visibleIfPrivate=%d visibleIfNotDefaultCDTor=%d "
   //       "visibleIfFriendCompound=%d !annScope=%d\n",
   //       visibleIfStatic,visibleIfDocumented,
   //       visibleIfEnabled,visibleIfPrivate,visibleIfNotDefaultCDTor,
@@ -2308,10 +2257,10 @@ void MemberDefImpl::writeDeclaration(OutputList &ol,
   ol.startMemberDeclaration();
 
   // start a new member declaration
-  bool isAnonymous = annoClassDef || m_impl->annMemb || m_impl->annEnumType;
+  bool isAnonType = annoClassDef || m_impl->annMemb || m_impl->annEnumType;
   ///printf("startMemberItem for %s\n",name().data());
   ol.startMemberItem(anchor(),
-                     isAnonymous ? 1 : m_impl->tArgList ? 3 : 0,
+                     isAnonType ? 1 : !m_impl->tArgList.empty() ? 3 : 0,
                      inheritId
                     );
 
@@ -2350,11 +2299,11 @@ void MemberDefImpl::writeDeclaration(OutputList &ol,
   }
 
   // *** write template lists
-  if (m_impl->tArgList && getLanguage()==SrcLangExt_Cpp)
+  if (m_impl->tArgList.hasParameters() && getLanguage()==SrcLangExt_Cpp)
   {
-    if (!isAnonymous) ol.startMemberTemplateParams();
+    if (!isAnonType) ol.startMemberTemplateParams();
     writeTemplatePrefix(ol,m_impl->tArgList);
-    if (!isAnonymous) ol.endMemberTemplateParams(anchor(),inheritId);
+    if (!isAnonType) ol.endMemberTemplateParams(anchor(),inheritId);
   }
 
   // *** write type
@@ -2394,7 +2343,7 @@ void MemberDefImpl::writeDeclaration(OutputList &ol,
       QCString varName=ltype.right(ltype.length()-ir).stripWhiteSpace();
       //printf(">>>>>> ltype='%s' varName='%s'\n",ltype.data(),varName.data());
       ol.docify("}");
-      if (varName.isEmpty() && (name().isEmpty() || name().at(0)=='@'))
+      if (varName.isEmpty() && isAnonymous())
       {
         ol.docify(";");
       }
@@ -2472,17 +2421,17 @@ void MemberDefImpl::writeDeclaration(OutputList &ol,
   }
   else
   {
-    ol.insertMemberAlign(m_impl->tArgList!=0);
+    ol.insertMemberAlign(m_impl->tArgList.hasParameters());
   }
 
   // *** write name
-  if (!name().isEmpty() && name().at(0)!='@') // hide anonymous stuff
+  if (!isAnonymous()) // hide anonymous stuff
   {
     static bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
     static bool extractPrivateVirtual = Config_getBool(EXTRACT_PRIV_VIRTUAL);
     static bool extractStatic  = Config_getBool(EXTRACT_STATIC);
     //printf("Member name=`%s gd=%p md->groupDef=%p inGroup=%d isLinkable()=%d hasDocumentation=%d\n",name().data(),gd,getGroupDef(),inGroup,isLinkable(),hasDocumentation());
-    if (!(name().isEmpty() || name().at(0)=='@') && // name valid
+    if (!name().isEmpty() && // name valid
         (hasDocumentation() || isReference()) && // has docs
         !(m_impl->prot==Private && !extractPrivate && (m_impl->virt==Normal || !extractPrivateVirtual) && m_impl->mtype!=MemberType_Friend) && // hidden due to protection
         !(isStatic() && getClassDef()==0 && !extractStatic) // hidden due to static-ness
@@ -2530,7 +2479,7 @@ void MemberDefImpl::writeDeclaration(OutputList &ol,
   }
 
   // add to index
-  if (isEnumerate() && name().at(0)=='@')
+  if (isEnumerate() && isAnonymous())
   {
     // don't add to index
   }
@@ -2752,7 +2701,7 @@ bool MemberDefImpl::isDetailedSectionLinkable() const
          //(initLines>0 && initLines<maxInitLines) ||
          (hasMultiLineInitializer() && !hideUndocMembers) ||
          // has one or more documented arguments
-         (m_impl->defArgList!=0 && m_impl->defArgList->hasDocumentation()) ||
+         (m_impl->defArgList.hasDocumentation()) ||
          // is an attribute or property - need to display that tag
          (m_impl->memSpec & (Entry::Attribute|Entry::Property)) ||
          // has user comments
@@ -2770,11 +2719,11 @@ bool MemberDefImpl::isDetailedSectionLinkable() const
   // hide friend (class|struct|union) member if HIDE_FRIEND_COMPOUNDS
   // is true
   bool friendCompoundFilter = !(Config_getBool(HIDE_FRIEND_COMPOUNDS) &&
-                                isFriend() &&
+                                isFriend() /*&&
                                 (m_impl->type=="friend class" ||
                                  m_impl->type=="friend struct" ||
                                  m_impl->type=="friend union"
-                                )
+                                )*/
                                );
 
 
@@ -2795,7 +2744,7 @@ bool MemberDefImpl::isDetailedSectionVisible(bool inGroup,bool inFile) const
   bool visible = isDetailedSectionLinkable() && groupFilter && fileFilter &&
                  !isReference();
   bool result = visible || simpleFilter;
-  //printf("%s::isDetailedSectionVisble: %d groupFilter=%d fileFilter=%d\n",
+  //printf("%s::isDetailedSectionVisible: %d groupFilter=%d fileFilter=%d\n",
   //    name().data(),result,groupFilter,fileFilter);
   return result;
 }
@@ -2928,7 +2877,8 @@ void MemberDefImpl::_writeCallGraph(OutputList &ol) const
     DotCallGraph callGraph(this,FALSE);
     if (callGraph.isTooBig())
     {
-       warn_uncond("Call graph for '%s' not generated, too many nodes. Consider increasing DOT_GRAPH_MAX_NODES.\n",qPrint(qualifiedName()));
+       warn_uncond("Call graph for '%s' not generated, too many nodes (%d), threshold is %d. Consider increasing DOT_GRAPH_MAX_NODES.\n",
+           qPrint(qualifiedName()), callGraph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
     }
     else if (!callGraph.isTrivial())
     {
@@ -2951,7 +2901,8 @@ void MemberDefImpl::_writeCallerGraph(OutputList &ol) const
     DotCallGraph callerGraph(this, TRUE);
     if (callerGraph.isTooBig())
     {
-       warn_uncond("Caller graph for '%s' not generated, too many nodes. Consider increasing DOT_GRAPH_MAX_NODES.\n",qPrint(qualifiedName()));
+       warn_uncond("Caller graph for '%s' not generated, too many nodes (%d), threshold is %d. Consider increasing DOT_GRAPH_MAX_NODES.\n",
+           qPrint(qualifiedName()), callerGraph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
     }
     else if (!callerGraph.isTrivial())
     {
@@ -3167,7 +3118,7 @@ void MemberDefImpl::_writeExamples(OutputList &ol) const
 
 void MemberDefImpl::_writeTypeConstraints(OutputList &ol) const
 {
-  if (m_impl->typeConstraints)
+  if (m_impl->typeConstraints.hasParameters())
   {
     writeTypeConstraints(ol,this,m_impl->typeConstraints);
   }
@@ -3253,7 +3204,7 @@ QCString MemberDefImpl::displayDefinition() const
   QCString title = name();
   if (isEnumerate())
   {
-    if (title.at(0)=='@')
+    if (isAnonymous())
     {
       ldef = title = "anonymous enum";
       if (!m_impl->enumBaseType.isEmpty())
@@ -3272,7 +3223,7 @@ QCString MemberDefImpl::displayDefinition() const
   }
   else if (isEnumValue())
   {
-    if (ldef.at(0)=='@')
+    if (isAnonymous())
     {
       ldef=ldef.mid(2);
     }
@@ -3411,9 +3362,9 @@ void MemberDefImpl::writeDocumentation(const MemberList *ml,
     else if (getFileDef())      { scopeName=getFileDef()->displayName();      scopedContainer=getFileDef(); }
     ciname = (dynamic_cast<const GroupDef *>(container))->groupTitle();
   }
-  else if (container->definitionType()==TypeFile && getNamespaceDef() && lang != SrcLangExt_Python)
+  else if (container->definitionType()==TypeFile && getNamespaceDef() && getNamespaceDef()->isLinkable())
   { // member is in a namespace, but is written as part of the file documentation
-    // as well, so we need to make sure its label is unique.
+    // as well, so we need to make sure its anchor is unique (it is not really used).
     memAnchor.prepend("file_");
   }
 
@@ -3458,7 +3409,7 @@ void MemberDefImpl::writeDocumentation(const MemberList *ml,
       ldef=ldef.mid(2);
     }
   }
-  else if (isFunction())
+  else if (isFunction() && !isObjCMethod())
   {
     title += "()";
   }
@@ -3544,14 +3495,12 @@ void MemberDefImpl::writeDocumentation(const MemberList *ml,
     {
       bool first=TRUE;
       SrcLangExt lang = getLanguage();
-      if (m_impl->defTmpArgLists && lang==SrcLangExt_Cpp)
+      if (!m_impl->defTmpArgLists.empty() && lang==SrcLangExt_Cpp)
         // definition has explicit template parameter declarations
       {
-        QListIterator<ArgumentList> ali(*m_impl->defTmpArgLists);
-        ArgumentList *tal;
-        for (ali.toFirst();(tal=ali.current());++ali)
+        for (const ArgumentList &tal : m_impl->defTmpArgLists)
         {
-          if (tal->count()>0)
+          if (!tal.empty())
           {
             if (!first) ol.docify(" ");
             ol.startMemberDocPrefixItem();
@@ -3565,14 +3514,9 @@ void MemberDefImpl::writeDocumentation(const MemberList *ml,
       {
         if (cd && lang==SrcLangExt_Cpp && !isTemplateSpecialization())
         {
-          QList<ArgumentList> tempParamLists;
-          cd->getTemplateParameterLists(tempParamLists);
-          //printf("#tempParamLists=%d\n",tempParamLists.count());
-          QListIterator<ArgumentList> ali(tempParamLists);
-          ArgumentList *tal;
-          for (ali.toFirst();(tal=ali.current());++ali)
+          for (const ArgumentList &tal : cd->getTemplateParameterLists())
           {
-            if (tal->count()>0)
+            if (!tal.empty())
             {
               if (!first) ol.docify(" ");
               ol.startMemberDocPrefixItem();
@@ -3581,7 +3525,7 @@ void MemberDefImpl::writeDocumentation(const MemberList *ml,
             }
           }
         }
-        if (m_impl->tArgList && lang==SrcLangExt_Cpp) // function template prefix
+        if (m_impl->tArgList.hasParameters() && lang==SrcLangExt_Cpp) // function template prefix
         {
           ol.startMemberDocPrefixItem();
           writeTemplatePrefix(ol,m_impl->tArgList);
@@ -3763,17 +3707,17 @@ void MemberDefImpl::writeDocumentation(const MemberList *ml,
     else
       ol.parseText(theTranslator->trInitialValue());
     ol.endBold();
-    ParserInterface *pIntf = Doxygen::parserManager->getParser(getDefFileExtension());
-    pIntf->resetCodeParserState();
+    CodeParserInterface &intf = Doxygen::parserManager->getCodeParser(getDefFileExtension());
+    intf.resetCodeParserState();
     ol.startCodeFragment();
-    pIntf->parseCode(ol,scopeName,m_impl->initializer,lang,FALSE,0,const_cast<FileDef*>(getFileDef()),
+    intf.parseCode(ol,scopeName,m_impl->initializer,lang,FALSE,0,const_cast<FileDef*>(getFileDef()),
                      -1,-1,TRUE,this,FALSE,this);
     ol.endCodeFragment();
   }
 
   QCString brief           = briefDescription();
   QCString detailed        = documentation();
-  ArgumentList *docArgList = m_impl->defArgList;
+  ArgumentList &docArgList = m_impl->defArgList;
   if (m_impl->templateMaster)
   {
     brief      = m_impl->templateMaster->briefDescription();
@@ -3830,18 +3774,16 @@ void MemberDefImpl::writeDocumentation(const MemberList *ml,
   //printf("***** defArgList=%p name=%s docs=%s hasDocs=%d\n",
   //     defArgList,
   //     defArgList?defArgList->hasDocumentation():-1);
-  if (docArgList!=0 && docArgList->hasDocumentation())
+  if (docArgList.hasDocumentation())
   {
     QCString paramDocs;
-    ArgumentListIterator ali(*docArgList);
-    Argument *a;
-    // convert the parameter documentation into a list of @param commands
-    for (ali.toFirst();(a=ali.current());++ali)
+    for (const Argument &a : docArgList)
     {
-      if (a->hasDocumentation())
+      if (a.hasDocumentation())
       {
-        QCString direction = extractDirection(a->docs);
-        paramDocs+="@param"+direction+" "+a->name+" "+a->docs;
+        QCString docsWithoutDir = a.docs;
+        QCString direction = extractDirection(docsWithoutDir);
+        paramDocs+="@param"+direction+" "+a.name+" "+a.docs;
       }
     }
     // feed the result to the documentation parser
@@ -4144,41 +4086,37 @@ void MemberDefImpl::detectUndocumentedParams(bool hasParamCommand,bool hasReturn
   }
   else if (!m_impl->hasDocumentedParams)
   {
-    const ArgumentList *al     = argumentList();
-    const ArgumentList *declAl = declArgumentList();
+    const ArgumentList &al     = argumentList();
+    const ArgumentList &declAl = declArgumentList();
     bool allDoc=TRUE; // no parameter => all parameters are documented
     if ( // member has parameters
-        al!=0 &&       // but the member has a parameter list
-        al->count()>0  // with at least one parameter (that is not void)
+        al.hasParameters()  // with at least one parameter (that is not void)
        )
     {
-      ArgumentListIterator ali(*al);
-      Argument *a;
-
       // see if all parameters have documentation
-      for (ali.toFirst();(a=ali.current()) && allDoc;++ali)
+      for (auto it = al.begin(); it!=al.end() && allDoc; ++it)
       {
-        if (!a->name.isEmpty() && a->type!="void" &&
-            !(isPython && (a->name=="self" || a->name=="cls"))
+        Argument a = *it;
+        if (!a.name.isEmpty() && a.type!="void" &&
+            !(isPython && (a.name=="self" || a.name=="cls"))
            )
         {
-          allDoc = !a->docs.isEmpty();
+          allDoc = !a.docs.isEmpty();
         }
         //printf("a->type=%s a->name=%s doc=%s\n",
         //        a->type.data(),a->name.data(),a->docs.data());
       }
-      if (!allDoc && declAl!=0) // try declaration arguments as well
+      if (!allDoc && declAl.empty()) // try declaration arguments as well
       {
         allDoc=TRUE;
-        ArgumentListIterator ali(*declAl);
-        Argument *a;
-        for (ali.toFirst();(a=ali.current()) && allDoc;++ali)
+        for (auto it = al.begin(); it!=al.end() && allDoc; ++it)
         {
-          if (!a->name.isEmpty() && a->type!="void" &&
-              !(isPython && (a->name=="self" || a->name=="cls"))
+          Argument a = *it;
+          if (!a.name.isEmpty() && a.type!="void" &&
+              !(isPython && (a.name=="self" || a.name=="cls"))
              )
           {
-            allDoc = !a->docs.isEmpty();
+            allDoc = !a.docs.isEmpty();
           }
           //printf("a->name=%s doc=%s\n",a->name.data(),a->docs.data());
         }
@@ -4199,25 +4137,25 @@ void MemberDefImpl::detectUndocumentedParams(bool hasParamCommand,bool hasReturn
     m_impl->hasDocumentedReturnType = TRUE;
   }
   else if ( // see if return type is documented in a function w/o return type
-      hasReturnCommand &&
-      (
-       returnType.find("void")!=-1       || // void return type
-       returnType.find("subroutine")!=-1 || // fortran subroutine
-       isConstructor()      || // a constructor
-       isDestructor()          // or destructor
-      )
-      )
+            hasReturnCommand &&
+            (
+              returnType=="void"   || // void return type
+              returnType.find("subroutine")!=-1 || // fortran subroutine
+              isConstructor()      || // a constructor
+              isDestructor()          // or destructor
+            )
+          )
   {
-    warn_doc_error(getDefFileName(),getDefLine(),"documented empty return type of  %s",
+    warn_doc_error(getDefFileName(),getDefLine(),"documented empty return type of %s",
                           qualifiedName().data());
   }
   else if ( // see if return needs to documented 
-      m_impl->hasDocumentedReturnType ||
-      returnType.find("void")!=-1  || // void return type
-      returnType.find("subroutine")!=-1 || // fortran subroutine
-      isConstructor() || // a constructor
-      isDestructor()     // or destructor
-      )
+            m_impl->hasDocumentedReturnType ||
+           returnType=="void" || // void return type
+           returnType.find("subroutine")!=-1 || // fortran subroutine
+           isConstructor()    || // a constructor
+           isDestructor()        // or destructor
+          )
   {
     m_impl->hasDocumentedReturnType = TRUE;
   }
@@ -4232,6 +4170,7 @@ void MemberDefImpl::warnIfUndocumentedParams() const
       !isReference() &&
       !Doxygen::suppressDocWarnings)
   {
+    QCString returnType = typeString();
     if (!m_impl->hasDocumentedParams)
     {
       warn_doc_error(getDefFileName(),getDefLine(),
@@ -4239,7 +4178,7 @@ void MemberDefImpl::warnIfUndocumentedParams() const
           qPrint(qualifiedName()));
     }
     if (!m_impl->hasDocumentedReturnType &&
-        isFunction() && hasDocumentation())
+        isFunction() && hasDocumentation() && !returnType.isEmpty())
     {
       warn_doc_error(getDefFileName(),getDefLine(),
           "return type of member %s is not documented",
@@ -4248,13 +4187,6 @@ void MemberDefImpl::warnIfUndocumentedParams() const
   }
 }
 
-bool MemberDefImpl::isFriendClass() const
-{
-  return (isFriend() &&
-         (m_impl->type=="friend class" || m_impl->type=="friend struct" ||
-          m_impl->type=="friend union"));
-}
-
 bool MemberDefImpl::isDocumentedFriendClass() const
 {
   ClassDef *fcd=0;
@@ -4267,14 +4199,14 @@ bool MemberDefImpl::isDocumentedFriendClass() const
 
 bool MemberDefImpl::isDeleted() const
 {
-  return m_impl->defArgList && m_impl->defArgList->isDeleted;
+  return m_impl->defArgList.isDeleted;
 }
 
 bool MemberDefImpl::hasDocumentation() const
 {
   return DefinitionImpl::hasDocumentation() ||
          (m_impl->mtype==MemberType_Enumeration && m_impl->docEnumValues) ||  // has enum values
-         (m_impl->defArgList!=0 && m_impl->defArgList->hasDocumentation());   // has doc arguments
+         (m_impl->defArgList.hasDocumentation());   // has doc arguments
 }
 
 #if 0
@@ -4342,10 +4274,10 @@ void MemberDefImpl::setAnchor()
   // include number of template arguments as well,
   // to distinguish between two template
   // specializations that only differ in the template parameters.
-  if (m_impl->tArgList)
+  if (m_impl->tArgList.hasParameters())
   {
     char buf[20];
-    qsnprintf(buf,20,"%d:",m_impl->tArgList->count());
+    qsnprintf(buf,20,"%d:",(int)m_impl->tArgList.size());
     buf[19]='\0';
     memAnchor.prepend(buf);
   }
@@ -4354,7 +4286,6 @@ void MemberDefImpl::setAnchor()
   uchar md5_sig[16];
   QCString sigStr(33);
   MD5Buffer((const unsigned char *)memAnchor.data(),memAnchor.length(),md5_sig);
-  //printf("memAnchor=%s\n",memAnchor.data());
   MD5SigToString(md5_sig,sigStr.rawData(),33);
   m_impl->anc = "a"+sigStr;
 }
@@ -4403,23 +4334,21 @@ void MemberDefImpl::setNamespace(NamespaceDef *nd)
 }
 
 MemberDef *MemberDefImpl::createTemplateInstanceMember(
-        ArgumentList *formalArgs,ArgumentList *actualArgs) const
+        const ArgumentList &formalArgs,const ArgumentList &actualArgs) const
 {
   //printf("  Member %s %s %s\n",typeString(),name().data(),argsString());
-  ArgumentList *actualArgList = 0;
-  if (m_impl->defArgList)
+  ArgumentList actualArgList;
+  if (!m_impl->defArgList.empty())
   {
-    actualArgList = m_impl->defArgList->deepCopy();
+    actualArgList = m_impl->defArgList;
 
     // replace formal arguments with actuals
-    ArgumentListIterator ali(*actualArgList);
-    Argument *arg;
-    for (;(arg=ali.current());++ali)
+    for (Argument &arg : actualArgList)
     {
-      arg->type = substituteTemplateArgumentsInString(arg->type,formalArgs,actualArgs);
+      arg.type = substituteTemplateArgumentsInString(arg.type,formalArgs,actualArgs);
     }
-    actualArgList->trailingReturnType =
-       substituteTemplateArgumentsInString(actualArgList->trailingReturnType,formalArgs,actualArgs);
+    actualArgList.trailingReturnType =
+       substituteTemplateArgumentsInString(actualArgList.trailingReturnType,formalArgs,actualArgs);
   }
 
   QCString methodName=name();
@@ -4434,7 +4363,8 @@ MemberDef *MemberDefImpl::createTemplateInstanceMember(
                        methodName,
                        substituteTemplateArgumentsInString(m_impl->args,formalArgs,actualArgs),
                        m_impl->exception, m_impl->prot,
-                       m_impl->virt, m_impl->stat, m_impl->related, m_impl->mtype, 0, 0, ""
+                       m_impl->virt, m_impl->stat, m_impl->related, m_impl->mtype, 
+                       ArgumentList(), ArgumentList(), ""
                    );
   imd->setArgumentList(actualArgList);
   imd->setDefinition(substituteTemplateArgumentsInString(m_impl->def,formalArgs,actualArgs));
@@ -4526,26 +4456,25 @@ void MemberDefImpl::addListReference(Definition *)
       memArgs = argsString();
     }
   }
-  QList<ListItemInfo> *xrefItems = xrefListItems();
-  if (xrefItems)
-  {
-    addRefItem(xrefItems,
+  const std::vector<ListItemInfo> &xrefItems = xrefListItems();
+  addRefItem(xrefItems,
         qualifiedName()+argsString(), // argsString is needed for overloaded functions (see bug 609624)
         memLabel,
         getOutputFileBase()+"#"+anchor(),memName,memArgs,pd);
-  }
 }
 
-const MemberList *MemberDefImpl::getSectionList(const Definition *d) const
+const MemberList *MemberDefImpl::getSectionList() const
 {
+  const Definition *d= resolveAlias()->getOuterScope();
   char key[20];
   sprintf(key,"%p",d);
   return (d!=0 && m_impl->classSectionSDict) ? m_impl->classSectionSDict->find(key) : 0;
 }
 
-void MemberDefImpl::setSectionList(Definition *d, MemberList *sl)
+void MemberDefImpl::setSectionList(MemberList *sl)
 {
   //printf("MemberDefImpl::setSectionList(%p,%p) name=%s\n",d,sl,name().data());
+  const Definition *d= resolveAlias()->getOuterScope();
   char key[20];
   sprintf(key,"%p",d);
   if (m_impl->classSectionSDict==0)
@@ -4875,30 +4804,19 @@ void MemberDefImpl::writeEnumDeclaration(OutputList &typeDecl,
   }
 }
 
-void MemberDefImpl::setArgumentList(ArgumentList *al)
+void MemberDefImpl::setArgumentList(const ArgumentList &al)
 {
-  if (m_impl->defArgList) delete m_impl->defArgList;
   m_impl->defArgList = al;
 }
 
-void MemberDefImpl::setDeclArgumentList(ArgumentList *al)
+void MemberDefImpl::setDeclArgumentList(const ArgumentList &al)
 {
-  if (m_impl->declArgList) delete m_impl->declArgList;
   m_impl->declArgList = al;
 }
 
-void MemberDefImpl::setTypeConstraints(ArgumentList *al)
+void MemberDefImpl::setTypeConstraints(const ArgumentList &al)
 {
-  if (al==0) return;
-  if (m_impl->typeConstraints) delete m_impl->typeConstraints;
-  m_impl->typeConstraints = new ArgumentList;
-  m_impl->typeConstraints->setAutoDelete(TRUE);
-  ArgumentListIterator ali(*al);
-  Argument *a;
-  for (;(a=ali.current());++ali)
-  {
-    m_impl->typeConstraints->append(new Argument(*a));
-  }
+  m_impl->typeConstraints = al;
 }
 
 void MemberDefImpl::setType(const char *t)
@@ -4919,7 +4837,7 @@ ClassDef *MemberDefImpl::accessorClass() const
 
 void MemberDefImpl::findSectionsInDocumentation()
 {
-  docFindSections(documentation(),this,0,docFile());
+  docFindSections(documentation(),this,docFile());
 }
 
 void MemberDefImpl::enableCallGraph(bool e)
@@ -5003,7 +4921,7 @@ QCString MemberDefImpl::qualifiedName() const
   }
 }
 
-void MemberDefImpl::setTagInfo(TagInfo *ti)
+void MemberDefImpl::setTagInfo(const TagInfo *ti)
 {
   if (ti)
   {
@@ -5553,27 +5471,27 @@ bool MemberDefImpl::isPrototype() const
   return m_impl->proto;
 }
 
-const ArgumentList *MemberDefImpl::argumentList() const
+const ArgumentList &MemberDefImpl::argumentList() const
 {
   return m_impl->defArgList;
 }
 
-ArgumentList *MemberDefImpl::argumentList()
+ArgumentList &MemberDefImpl::argumentList()
 {
   return m_impl->defArgList;
 }
 
-const ArgumentList *MemberDefImpl::declArgumentList() const
+const ArgumentList &MemberDefImpl::declArgumentList() const
 {
   return m_impl->declArgList;
 }
 
-const ArgumentList *MemberDefImpl::templateArguments() const
+const ArgumentList &MemberDefImpl::templateArguments() const
 {
   return m_impl->tArgList;
 }
 
-const QList<ArgumentList> *MemberDefImpl::definitionTemplateParameterLists() const
+const std::vector<ArgumentList> &MemberDefImpl::definitionTemplateParameterLists() const
 {
   return m_impl->defTmpArgLists;
 }
@@ -5927,47 +5845,44 @@ void MemberDefImpl::cacheTypedefVal(const ClassDef*val, const QCString & templSp
 void MemberDefImpl::copyArgumentNames(MemberDef *bmd)
 {
   {
-    const ArgumentList *arguments = bmd->argumentList();
-    if (m_impl->defArgList && arguments)
+    const ArgumentList &srcAl = bmd->argumentList();
+    ArgumentList &dstAl = m_impl->defArgList;
+    auto srcIt = srcAl.begin();
+    auto dstIt = dstAl.begin();
+    while ( srcIt!=srcAl.end() && dstIt!=dstAl.end())
     {
-      ArgumentListIterator aliDst(*m_impl->defArgList);
-      ArgumentListIterator aliSrc(*arguments);
-      Argument *argDst;
-      const Argument *argSrc;
-      for (;(argDst=aliDst.current()) && (argSrc=aliSrc.current());++aliDst,++aliSrc)
-      {
-        argDst->name = argSrc->name;
-        argDst->docs = argSrc->docs;
-      }
+      Argument &argDst       = *dstIt;
+      const Argument &argSrc = *srcIt;
+      argDst.name = argSrc.name;
+      argDst.docs = argSrc.docs;
+      ++srcIt;
+      ++dstIt;
     }
   }
+
   {
-    const ArgumentList *arguments = bmd->declArgumentList();
-    if (m_impl->declArgList && arguments)
+    const ArgumentList &srcAl = bmd->declArgumentList();
+    ArgumentList &dstAl = m_impl->declArgList;
+    auto srcIt = srcAl.begin();
+    auto dstIt = dstAl.begin();
+
+    while ( srcIt!=srcAl.end() && dstIt!=dstAl.end())
     {
-      ArgumentListIterator aliDst(*m_impl->declArgList);
-      ArgumentListIterator aliSrc(*arguments);
-      Argument *argDst;
-      const Argument *argSrc;
-      for (;(argDst=aliDst.current()) && (argSrc=aliSrc.current());++aliDst,++aliSrc)
-      {
-        argDst->name = argSrc->name;
-        argDst->docs = argSrc->docs;
-      }
+      Argument &argDst       = *dstIt;
+      const Argument &argSrc = *srcIt;
+      argDst.name = argSrc.name;
+      argDst.docs = argSrc.docs;
+      ++srcIt;
+      ++dstIt;
     }
   }
 }
 
-static void invalidateCachedTypesInArgumentList(ArgumentList *al)
+static void invalidateCachedTypesInArgumentList(ArgumentList &al)
 {
-  if (al)
+  for (Argument &a : al)
   {
-    ArgumentListIterator ali(*al);
-    Argument *a;
-    for (ali.toFirst();(a=ali.current());++ali)
-    {
-      a->canType.resize(0);
-    }
+    a.canType.resize(0);
   }
 }
 
@@ -6021,29 +5936,21 @@ void MemberDefImpl::addToSearchIndex() const
 
 //----------------
 
-static void transferArgumentDocumentation(ArgumentList *decAl,ArgumentList *defAl)
+static void transferArgumentDocumentation(ArgumentList &decAl,ArgumentList &defAl)
 {
-  if (decAl && defAl)
+  for (auto decIt = decAl.begin(), defIt = defAl.begin();
+            decIt!= decAl.end() && defIt!= defAl.end();
+          ++decIt,               ++defIt)
   {
-    ArgumentListIterator decAli(*decAl);
-    ArgumentListIterator defAli(*defAl);
-    Argument *decA,*defA;
-    for (decAli.toFirst(),defAli.toFirst();
-        (decA=decAli.current()) && (defA=defAli.current());
-        ++decAli,++defAli)
+    Argument decA = *decIt;
+    Argument defA = *defIt;
+    if (decA.docs.isEmpty() && !defA.docs.isEmpty())
     {
-      //printf("Argument decA->name=%s (doc=%s) defA->name=%s (doc=%s)\n",
-      //    decA->name.data(),decA->docs.data(),
-      //    defA->name.data(),defA->docs.data()
-      //      );
-      if (decA->docs.isEmpty() && !defA->docs.isEmpty())
-      {
-        decA->docs = defA->docs.copy();
-      }
-      else if (defA->docs.isEmpty() && !decA->docs.isEmpty())
-      {
-        defA->docs = decA->docs.copy();
-      }
+      decA.docs = defA.docs;
+    }
+    else if (defA.docs.isEmpty() && !decA.docs.isEmpty())
+    {
+      defA.docs = decA.docs;
     }
   }
 }
@@ -6062,8 +5969,8 @@ void combineDeclarationAndDefinition(MemberDef *mdec,MemberDef *mdef)
 
     const MemberDef *cmdec = const_cast<const MemberDef*>(mdec);
     const MemberDef *cmdef = const_cast<const MemberDef*>(mdef);
-    ArgumentList *mdefAl = mdef->argumentList();
-    ArgumentList *mdecAl = mdec->argumentList();
+    ArgumentList &mdefAl = mdef->argumentList();
+    ArgumentList &mdecAl = mdec->argumentList();
     if (matchArguments2(cmdef->getOuterScope(),cmdef->getFileDef(),mdefAl,
                         cmdec->getOuterScope(),cmdec->getFileDef(),mdecAl,
                         TRUE
@@ -6093,10 +6000,10 @@ void combineDeclarationAndDefinition(MemberDef *mdec,MemberDef *mdef)
         //printf("transferring docs mdef->mdec (%s->%s)\n",mdef->argsString(),mdec->argsString());
         mdec->setDocumentation(mdef->documentation(),mdef->docFile(),mdef->docLine());
         mdec->setDocsForDefinition(mdef->isDocsForDefinition());
-        if (mdefAl!=0)
+        if (mdefAl.hasParameters())
         {
-          ArgumentList *mdefAlComb = new ArgumentList;
-          stringToArgumentList(mdef->argsString(),mdefAlComb);
+          ArgumentList mdefAlComb;
+          stringToArgumentList(mdef->getLanguage(),mdef->argsString(),mdefAlComb);
           transferArgumentDocumentation(mdefAl,mdefAlComb);
           mdec->setArgumentList(mdefAlComb);
         }
@@ -6106,10 +6013,10 @@ void combineDeclarationAndDefinition(MemberDef *mdec,MemberDef *mdef)
         //printf("transferring docs mdec->mdef (%s->%s)\n",mdec->argsString(),mdef->argsString());
         mdef->setDocumentation(mdec->documentation(),mdec->docFile(),mdec->docLine());
         mdef->setDocsForDefinition(mdec->isDocsForDefinition());
-        if (mdecAl!=0)
+        if (mdecAl.hasParameters())
         {
-          ArgumentList *mdecAlComb = new ArgumentList;
-          stringToArgumentList(mdec->argsString(),mdecAlComb);
+          ArgumentList mdecAlComb;
+          stringToArgumentList(mdec->getLanguage(),mdec->argsString(),mdecAlComb);
           transferArgumentDocumentation(mdecAl,mdecAlComb);
           mdef->setDeclArgumentList(mdecAlComb);
         }
@@ -6206,7 +6113,7 @@ QCString MemberDefImpl::documentation() const
   }
 }
 
-const ArgumentList *MemberDefImpl::typeConstraints() const
+const ArgumentList &MemberDefImpl::typeConstraints() const
 {
   return m_impl->typeConstraints;
 }
@@ -6221,6 +6128,14 @@ bool MemberDefImpl::isFriendToHide() const
   return isFriendToHide;
 }
 
+bool MemberDefImpl::isFriendClass() const
+{
+  return (isFriend() &&
+         (m_impl->type=="friend class" || m_impl->type=="friend struct" ||
+          m_impl->type=="friend union"));
+}
+
+
 bool MemberDefImpl::isNotFriend() const
 {
   return !(isFriend() && isFriendToHide());
index c81af80..a9103e1 100644 (file)
@@ -18,6 +18,8 @@
 #ifndef MEMBERDEF_H
 #define MEMBERDEF_H
 
+#include <vector>
+
 #include <qlist.h>
 #include <sys/types.h>
 
@@ -50,7 +52,7 @@ class MemberDef : virtual public Definition
 
     virtual MemberDef *resolveAlias() = 0;
     virtual const MemberDef *resolveAlias() const = 0;
-    
+
     //-----------------------------------------------------------------------------------
     // ----  getters -----
     //-----------------------------------------------------------------------------------
@@ -70,7 +72,7 @@ class MemberDef : virtual public Definition
     virtual const QCString &initializer() const = 0;
     virtual int initializerLines() const = 0;
     virtual uint64 getMemberSpecifiers() const = 0;
-    virtual const MemberList *getSectionList(const Definition *d) const = 0;
+    virtual const MemberList *getSectionList() const = 0;
     virtual QCString    displayDefinition() const = 0;
 
     // scope query members
@@ -221,11 +223,11 @@ class MemberDef : virtual public Definition
     virtual bool isPrototype() const = 0;
 
     // argument related members
-    virtual const ArgumentList *argumentList() const = 0;
-    virtual ArgumentList *argumentList() = 0;
-    virtual const ArgumentList *declArgumentList() const = 0;
-    virtual const ArgumentList *templateArguments() const = 0;
-    virtual const QList<ArgumentList> *definitionTemplateParameterLists() const = 0;
+    virtual const ArgumentList &argumentList() const = 0;
+    virtual ArgumentList &argumentList() = 0;
+    virtual const ArgumentList &declArgumentList() const = 0;
+    virtual const ArgumentList &templateArguments() const = 0;
+    virtual const std::vector<ArgumentList> &definitionTemplateParameterLists() const = 0;
 
     // member group related members
     virtual int getMemberGroupId() const = 0;
@@ -239,7 +241,7 @@ class MemberDef : virtual public Definition
     virtual bool hasCallGraph() const = 0;
     virtual bool hasCallerGraph() const = 0;
     virtual bool visibleMemberGroup(bool hideNoHeader) const = 0;
-    // refrenced related members
+    // referenced related members
     virtual bool hasReferencesRelation() const = 0;
     virtual bool hasReferencedByRelation() const = 0;
 
@@ -265,7 +267,7 @@ class MemberDef : virtual public Definition
     virtual QCString getDeclType() const = 0;
     virtual void getLabels(QStrList &sl,const Definition *container) const = 0;
 
-    virtual const ArgumentList *typeConstraints() const = 0;
+    virtual const ArgumentList &typeConstraints() const = 0;
 
     // overrules
     virtual QCString documentation() const = 0;
@@ -294,7 +296,7 @@ class MemberDef : virtual public Definition
     virtual void setBitfields(const char *s) = 0;
     virtual void setMaxInitLines(int lines) = 0;
     virtual void setMemberClass(ClassDef *cd) = 0;
-    virtual void setSectionList(Definition *d,MemberList *sl) = 0;
+    virtual void setSectionList(MemberList *sl) = 0;
     virtual void setGroupDef(GroupDef *gd,Grouping::GroupPri_t pri,
                      const QCString &fileName,int startLine,bool hasDocs,
                      MemberDef *member=0) = 0;
@@ -305,7 +307,7 @@ class MemberDef : virtual public Definition
     virtual void makeRelated() = 0;
     virtual void makeForeign() = 0;
     virtual void setInheritsDocsFrom(MemberDef *md) = 0;
-    virtual void setTagInfo(TagInfo *i) = 0;
+    virtual void setTagInfo(const TagInfo *i) = 0;
     virtual void setArgsString(const char *as) = 0;
     virtual void incrementFlowKeyWordCount() = 0;
 
@@ -331,10 +333,10 @@ class MemberDef : virtual public Definition
     virtual void setDeclFile(const QCString &df,int line,int column) = 0;
 
     // argument related members
-    virtual void setArgumentList(ArgumentList *al) = 0;
-    virtual void setDeclArgumentList(ArgumentList *al) = 0;
-    virtual void setDefinitionTemplateParameterLists(QList<ArgumentList> *lists) = 0;
-    virtual void setTypeConstraints(ArgumentList *al) = 0;
+    virtual void setArgumentList(const ArgumentList &al) = 0;
+    virtual void setDeclArgumentList(const ArgumentList &al) = 0;
+    virtual void setDefinitionTemplateParameterLists(const std::vector<ArgumentList> &lists) = 0;
+    virtual void setTypeConstraints(const ArgumentList &al) = 0;
     virtual void setType(const char *t) = 0;
     virtual void setAccessorType(ClassDef *cd,const char *t) = 0;
 
@@ -384,8 +386,8 @@ class MemberDef : virtual public Definition
     // --- actions ----
     //-----------------------------------------------------------------------------------
 
-    virtual MemberDef *createTemplateInstanceMember(ArgumentList *formalArgs,
-               ArgumentList *actualArgs) const = 0;
+    virtual MemberDef *createTemplateInstanceMember(const ArgumentList &formalArgs,
+               const ArgumentList &actualArgs) const = 0;
     virtual void findSectionsInDocumentation() = 0;
     virtual void addToSearchIndex() const = 0;
 
@@ -421,8 +423,8 @@ class MemberDef : virtual public Definition
 MemberDef *createMemberDef(const char *defFileName,int defLine,int defColumn,
               const char *type,const char *name,const char *args,
               const char *excp,Protection prot,Specifier virt,bool stat,
-              Relationship related,MemberType t,const ArgumentList *tal,
-              const ArgumentList *al,const char *metaData);
+              Relationship related,MemberType t,const ArgumentList &tal,
+              const ArgumentList &al,const char *metaData);
 
 MemberDef *createMemberDefAlias(const Definition *newScope,const MemberDef *aliasMd);
 
index a5852e4..05c38c3 100644 (file)
@@ -40,8 +40,7 @@ MemberGroup::MemberGroup()
 {
 }
 
-MemberGroup::MemberGroup(const Definition *parent,
-      int id,const char *hdr,const char *d,const char *docFile,int docLine)
+MemberGroup::MemberGroup(int id,const char *hdr,const char *d,const char *docFile,int docLine)
 {
   static bool sortBriefDocs = Config_getBool(SORT_BRIEF_DOCS);
 
@@ -55,10 +54,8 @@ MemberGroup::MemberGroup(const Definition *parent,
   inDeclSection   = 0;
   m_numDecMembers = -1;
   m_numDocMembers = -1;
-  m_parent        = parent;
   m_docFile       = docFile;
   m_docLine       = docLine;
-  m_xrefListItems = 0;
   //printf("Member group docs='%s'\n",doc.data());
 }
 
@@ -69,33 +66,32 @@ MemberGroup::~MemberGroup()
 
 void MemberGroup::insertMember(MemberDef *md)
 {
-  //printf("MemberGroup::insertMember m_parent=%s memberList=%p count=%d"
+  //printf("MemberGroup::insertMember memberList=%p count=%d"
   //       " member section list: %p: md=%p:%s\n",
-  //       m_parent ? m_parent->name().data() : "<null>",
-  //       memberList->first() ? memberList->first()->getSectionList(m_parent) : 0,
+  //       memberList->first() ? memberList->first()->getSectionList() : 0,
   //       memberList->count(),
-  //       md->getSectionList(m_parent),
+  //       md->getSectionList(),
   //       md,md->name().data());
 
   MemberDef *firstMd = memberList->getFirst();
-  if (inSameSection && firstMd &&
-      firstMd->getSectionList(m_parent)!=md->getSectionList(m_parent))
+  if (inSameSection && firstMd && firstMd->getSectionList()!=md->getSectionList())
   {
     inSameSection=FALSE;
   }
   else if (inDeclSection==0)
   {
-    inDeclSection = const_cast<MemberList*>(md->getSectionList(m_parent));
+    inDeclSection = const_cast<MemberList*>(md->getSectionList());
     //printf("inDeclSection=%p type=%d\n",inDeclSection,inDeclSection->listType());
   }
   memberList->append(md);
 
   // copy the group of the first member in the memberGroup
   GroupDef *gd;
-  if (firstMd && (gd=const_cast<GroupDef*>(firstMd->getGroupDef())))
+  if (firstMd && !firstMd->isAlias() && (gd=const_cast<GroupDef*>(firstMd->getGroupDef())))
   {
-    md->setGroupDef(gd, firstMd->getGroupPri(), 
-                    firstMd->getGroupFileName(), firstMd->getGroupStartLine(), 
+    md->setGroupDef(gd, firstMd->getGroupPri(),
+                    firstMd->getGroupFileName(),
+                    firstMd->getGroupStartLine(),
                     firstMd->getGroupHasDocs());
     gd->insertMember(md);
   }
@@ -152,8 +148,8 @@ void MemberGroup::addGroupedInheritedMembers(OutputList &ol,const ClassDef *cd,
   MemberDef *md;
   for (li.toFirst();(md=li.current());++li)
   {
-    //printf("matching %d == %d\n",lt,md->getSectionList(m_parent)->listType());
-    const MemberList *ml = md->getSectionList(m_parent);
+    //printf("matching %d == %d\n",lt,md->getSectionList()->listType());
+    const MemberList *ml = md->getSectionList();
     if (ml && lt==ml->listType())
     {
       MemberList ml(lt);
@@ -172,8 +168,8 @@ int MemberGroup::countGroupedInheritedMembers(MemberListType lt)
   MemberDef *md;
   for (li.toFirst();(md=li.current());++li)
   {
-    //printf("matching %d == %d\n",lt,md->getSectionList(m_parent)->listType());
-    const MemberList *ml = md->getSectionList(m_parent);
+    //printf("matching %d == %d\n",lt,md->getSectionList()->listType());
+    const MemberList *ml = md->getSectionList();
     if (ml && lt==ml->listType())
     {
       count++;
@@ -343,7 +339,7 @@ QCString MemberGroup::anchor() const
 void MemberGroup::addListReferences(Definition *def)
 {
   memberList->addListReferences(def);
-  if (m_xrefListItems && def)
+  if (def)
   {
     QCString name = def->getOutputFileBase()+"#"+anchor();
     addRefItem(m_xrefListItems,
@@ -354,29 +350,15 @@ void MemberGroup::addListReferences(Definition *def)
   }
 }
 
-void MemberGroup::findSectionsInDocumentation()
+void MemberGroup::findSectionsInDocumentation(const Definition *d)
 {
-  docFindSections(doc,0,this,m_docFile);
-  memberList->findSectionsInDocumentation();
+  docFindSections(doc,d,m_docFile);
+  memberList->findSectionsInDocumentation(d);
 }
 
-void MemberGroup::setRefItems(const QList<ListItemInfo> *sli)
+void MemberGroup::setRefItems(const std::vector<ListItemInfo> &sli)
 {
-  if (sli)
-  {
-    // deep copy the list
-    if (m_xrefListItems==0) 
-    {
-      m_xrefListItems=new QList<ListItemInfo>;
-      m_xrefListItems->setAutoDelete(TRUE);
-    }
-    QListIterator<ListItemInfo> slii(*sli);
-    ListItemInfo *lii;
-    for (slii.toFirst();(lii=slii.current());++slii)
-    {
-      m_xrefListItems->append(new ListItemInfo(*lii));
-    } 
-  }
+  m_xrefListItems.insert(m_xrefListItems.end(), sli.cbegin(), sli.cend());
 }
 
 void MemberGroup::writeTagFile(FTextStream &tagFile)
@@ -386,18 +368,7 @@ void MemberGroup::writeTagFile(FTextStream &tagFile)
 
 //--------------------------------------------------------------------------
 
-void MemberGroupInfo::setRefItems(const QList<ListItemInfo> *sli)
+void MemberGroupInfo::setRefItems(const std::vector<ListItemInfo> &sli)
 {
-  if (!sli) return;
-  if (m_sli==0)
-  {
-    m_sli = new QList<ListItemInfo>;
-    m_sli->setAutoDelete(TRUE);
-  }
-  QListIterator<ListItemInfo> slii(*sli);
-  ListItemInfo *ili;
-  for (slii.toFirst();(ili=slii.current());++slii)
-  {
-    m_sli->append(new ListItemInfo(*ili));
-  }
+  m_sli.insert(m_sli.end(), sli.cbegin(), sli.cend());
 }
index c07d025..aa30063 100644 (file)
@@ -18,6 +18,8 @@
 #ifndef MEMBERGROUP_H
 #define MEMBERGROUP_H
 
+#include <vector>
+
 #include <qlist.h>
 #include "sortdict.h"
 #include "types.h"
@@ -32,7 +34,6 @@ class FileDef;
 class GroupDef;
 class OutputList;
 class Definition;
-class StorageIntf;
 class FTextStream;
 struct ListItemInfo;
 
@@ -41,7 +42,7 @@ class MemberGroup
 {
   public:
     MemberGroup();
-    MemberGroup(const Definition *parent,int id,const char *header,
+    MemberGroup(int id,const char *header,
                 const char *docs,const char *docFile,int docLine);
    ~MemberGroup();
     QCString header() const { return grpHeader; }
@@ -71,19 +72,7 @@ class MemberGroup
     void countDocMembers();
     int countGroupedInheritedMembers(MemberListType lt);
     void distributeMemberGroupDocumentation();
-    void findSectionsInDocumentation();
-    /*
-    int varCount() const;
-    int funcCount() const;
-    int enumCount() const;
-    int enumValueCount() const;
-    int typedefCount() const;
-    int sequenceCount() const;
-    int dictionaryCount() const;
-    int protoCount() const;
-    int defineCount() const;
-    int friendCount() const;
-    */
+    void findSectionsInDocumentation(const Definition *d);
     int numDecMembers() const;
     int numDecEnumValues() const;
     int numDocMembers() const;
@@ -92,28 +81,27 @@ class MemberGroup
     int countInheritableMembers(const ClassDef *inheritedFrom) const;
     void setInGroup(bool b);
     void addListReferences(Definition *d);
-    void setRefItems(const QList<ListItemInfo> *sli);
+    void setRefItems(const std::vector<ListItemInfo> &sli);
     MemberList *members() const { return memberList; }
-    const Definition *parent() const { return m_parent; }
     QCString anchor() const;
 
     QCString docFile() const { return m_docFile; }
     int docLine() const { return m_docLine; }
 
   private: 
-    MemberList *memberList;      // list of all members in the group
-    MemberList *inDeclSection;
-    int grpId;
+    MemberList *memberList = 0;      // list of all members in the group
+    MemberList *inDeclSection = 0;
+    int grpId = 0;
     QCString grpHeader;
     QCString fileName;           // base name of the generated file
     QCString doc;
-    bool inSameSection;
-    int  m_numDecMembers;
-    int  m_numDocMembers;
-    const Definition *m_parent;
+    bool inSameSection = 0;
+    int  m_numDecMembers = 0;
+    int  m_numDocMembers = 0;
+    const Definition *m_parent = 0;
     QCString m_docFile;
-    int m_docLine;
-    QList<ListItemInfo> *m_xrefListItems;
+    int m_docLine = 0;
+    std::vector<ListItemInfo> m_xrefListItems;
 };
 
 /** A list of MemberGroup objects. */
@@ -145,15 +133,13 @@ class MemberGroupSDict : public SIntDict<MemberGroup>
 /** Data collected for a member group */
 struct MemberGroupInfo
 {
-  MemberGroupInfo() : docLine(-1), m_sli(0) {}
- ~MemberGroupInfo() { delete m_sli; m_sli=0; }
-  void setRefItems(const QList<ListItemInfo> *sli);
+  void setRefItems(const std::vector<ListItemInfo> &sli);
   QCString header;
   QCString doc;
   QCString docFile;
-  int docLine;
+  int docLine = -1;
   QCString compoundName;
-  QList<ListItemInfo> *m_sli;
+  std::vector<ListItemInfo> m_sli;
 };
 
 #endif
index 1869808..278023b 100644 (file)
@@ -961,7 +961,7 @@ void MemberList::addListReferences(Definition *def)
   }
 }
 
-void MemberList::findSectionsInDocumentation()
+void MemberList::findSectionsInDocumentation(const Definition *d)
 {
   MemberListIterator mli(*this);
   MemberDef *md;
@@ -975,7 +975,7 @@ void MemberList::findSectionsInDocumentation()
     MemberGroup *mg;
     for (;(mg=mgli.current());++mgli)
     {
-      mg->findSectionsInDocumentation();
+      mg->findSectionsInDocumentation(d);
     }
   }
 }
index 3c227be..422c162 100644 (file)
@@ -26,7 +26,6 @@
 class GroupDef;
 class MemberGroup;
 class MemberGroupList;
-class StorageIntf;
 
 /** A list of MemberDef objects. */
 class MemberList : private QList<MemberDef>
@@ -89,7 +88,7 @@ class MemberList : private QList<MemberDef>
     void setInGroup(bool inGroup) { m_inGroup=inGroup; }
     void setInFile(bool inFile) { m_inFile=inFile; }
     void addListReferences(Definition *def);
-    void findSectionsInDocumentation();
+    void findSectionsInDocumentation(const Definition *d);
     void setNeedsSorting(bool b);
     MemberGroupList *getMemberGroupList() const { return memberGroupList; }
     void setAnonymousEnumType();
index ddf757a..d8f83ef 100644 (file)
@@ -90,7 +90,7 @@ void initWarningFormat()
 
   if (!Config_getString(WARN_LOGFILE).isEmpty())
   {
-    warnFile = portable_fopen(Config_getString(WARN_LOGFILE),"w");
+    warnFile = Portable::fopen(Config_getString(WARN_LOGFILE),"w");
   }
   if (!warnFile) // point it to something valid, because warn() relies on it
   {
@@ -251,6 +251,20 @@ extern void err_full(const char *file,int line,const char *fmt, ...)
   va_end(args);
 }
 
+void term(const char *fmt, ...)
+{
+  va_list args;
+  va_start(args, fmt);
+  vfprintf(warnFile, (QCString(error_str) + fmt).data(), args);
+  va_end(args);
+  if (warnFile != stderr)
+  {
+    for (int i = 0; i < strlen(error_str); i++) fprintf(warnFile, " ");
+    fprintf(warnFile, "%s\n", "Exiting...");
+  }
+  exit(1);
+}
+
 void printlex(int dbg, bool enter, const char *lexName, const char *fileName)
 {
   const char *enter_txt = "entering";
index 3b1a294..7b12ba8 100644 (file)
@@ -30,6 +30,7 @@ extern void warn_doc_error(const char *file,int line,const char *fmt, ...);
 extern void warn_uncond(const char *fmt, ...);
 extern void err(const char *fmt, ...);
 extern void err_full(const char *file,int line,const char *fmt, ...);
+extern void term(const char *fmt, ...);
 void initWarningFormat();
 
 extern void printlex(int dbg, bool enter, const char *lexName, const char *fileName);
index 51e23fa..29c9334 100644 (file)
@@ -95,7 +95,7 @@ void writeMscGraphFromFile(const char *inFile,const char *outDir,
                            const char *outFile,MscOutputFormat format)
 {
   QCString absOutFile = outDir;
-  absOutFile+=portable_pathSeparator();
+  absOutFile+=Portable::pathSeparator();
   absOutFile+=outFile;
 
   mscgen_format_t msc_format;
@@ -130,12 +130,12 @@ void writeMscGraphFromFile(const char *inFile,const char *outDir,
     QCString epstopdfArgs(maxCmdLine);
     epstopdfArgs.sprintf("\"%s.eps\" --outfile=\"%s.pdf\"",
                          absOutFile.data(),absOutFile.data());
-    portable_sysTimerStart();
-    if (portable_system("epstopdf",epstopdfArgs)!=0)
+    Portable::sysTimerStart();
+    if (Portable::system("epstopdf",epstopdfArgs)!=0)
     {
       err("Problems running epstopdf. Check your TeX installation!\n");
     }
-    portable_sysTimerStop();
+    Portable::sysTimerStop();
   }
 
   Doxygen::indexList->addImageFile(imgName);
index 38e5c04..220f300 100644 (file)
@@ -124,23 +124,23 @@ class NamespaceDefImpl : public DefinitionImpl, public NamespaceDef
     QCString              fileName;
     FileList              files;
 
-    NamespaceSDict       *usingDirList;
-    SDict<Definition> *usingDeclList;
-    SDict<Definition>    *m_innerCompounds;
+    NamespaceSDict       *usingDirList = 0;
+    SDict<Definition>    *usingDeclList = 0;
+    SDict<Definition>    *m_innerCompounds = 0;
 
-    MemberSDict          *m_allMembersDict;
+    MemberSDict          *m_allMembersDict = 0;
     QList<MemberList>     m_memberLists;
-    MemberGroupSDict     *memberGroupSDict;
-    ClassSDict           *classSDict;
-    ClassSDict           *interfaceSDict;
-    ClassSDict           *structSDict;
-    ClassSDict           *exceptionSDict;
-    NamespaceSDict       *namespaceSDict;
-    bool                  m_subGrouping;
+    MemberGroupSDict     *memberGroupSDict = 0;
+    ClassSDict           *classSDict = 0;
+    ClassSDict           *interfaceSDict = 0;
+    ClassSDict           *structSDict = 0;
+    ClassSDict           *exceptionSDict = 0;
+    NamespaceSDict       *namespaceSDict = 0;
+    bool                  m_subGrouping = false;
     enum { NAMESPACE, MODULE, CONSTANT_GROUP, LIBRARY } m_type;
-    bool m_isPublished;
+    bool m_isPublished = false;
     QCString              metaData;
-    bool                  m_inline;
+    bool                  m_inline = false;
 };
 
 NamespaceDef *createNamespaceDef(const char *defFileName,int defLine,int defColumn,
@@ -246,7 +246,7 @@ class NamespaceDefAliasImpl : public DefinitionAliasImpl, public NamespaceDef
     bool isVisited() const { return m_visited; }
 
   private:
-    bool m_visited;
+    bool m_visited = false;
 };
 
 NamespaceDef *createNamespaceDefAlias(const Definition *newScope,const NamespaceDef *nd)
@@ -349,12 +349,12 @@ void NamespaceDefImpl::distributeMemberGroupDocumentation()
 
 void NamespaceDefImpl::findSectionsInDocumentation()
 {
-  docFindSections(documentation(),this,0,docFile());
+  docFindSections(documentation(),this,docFile());
   MemberGroupSDict::Iterator mgli(*memberGroupSDict);
   MemberGroup *mg;
   for (;(mg=mgli.current());++mgli)
   {
-    mg->findSectionsInDocumentation();
+    mg->findSectionsInDocumentation(this);
   }
   QListIterator<MemberList> mli(m_memberLists);
   MemberList *ml;
@@ -362,7 +362,7 @@ void NamespaceDefImpl::findSectionsInDocumentation()
   {
     if (ml->listType()&MemberListType_declarationLists)
     {
-      ml->findSectionsInDocumentation();
+      ml->findSectionsInDocumentation(this);
     }
   }
 }
@@ -467,92 +467,119 @@ void NamespaceDefImpl::addMembersToMemberGroup()
 
 void NamespaceDefImpl::insertMember(MemberDef *md)
 {
-  //printf("%s::insertMember(%s)\n",qPrint(name()),qPrint(md->name()));
+  //printf("%s::insertMember(%s) isInline=%d hasDocs=%d\n",qPrint(name()),qPrint(md->name()),
+  //    isInline(),hasDocumentation());
   if (md->isHidden()) return;
-  MemberList *allMemberList = getMemberList(MemberListType_allMembersList);
-  if (allMemberList==0)
-  {
-    allMemberList = new MemberList(MemberListType_allMembersList);
-    m_memberLists.append(allMemberList);
-  }
-  allMemberList->append(md); 
-  if (m_allMembersDict==0)
-  {
-    m_allMembersDict = new MemberSDict;
-  }
-  //printf("%s::m_allMembersDict->append(%s)\n",name().data(),md->localName().data());
-  m_allMembersDict->append(md->localName(),md); 
-  //::addNamespaceMemberNameToIndex(md);
-  //static bool sortBriefDocs=Config_getBool(SORT_BRIEF_DOCS);
-  switch(md->memberType())
-  {
-    case MemberType_Variable:     
-      addMemberToList(MemberListType_decVarMembers,md);
-      addMemberToList(MemberListType_docVarMembers,md);
-      break;
-    case MemberType_Function: 
-      addMemberToList(MemberListType_decFuncMembers,md);
-      addMemberToList(MemberListType_docFuncMembers,md);
-      break;
-    case MemberType_Typedef:      
-      addMemberToList(MemberListType_decTypedefMembers,md);
-      addMemberToList(MemberListType_docTypedefMembers,md);
-      break;
-    case MemberType_Sequence:      
-      addMemberToList(MemberListType_decSequenceMembers,md);
-      addMemberToList(MemberListType_docSequenceMembers,md);
-      break;
-    case MemberType_Dictionary:      
-      addMemberToList(MemberListType_decDictionaryMembers,md);
-      addMemberToList(MemberListType_docDictionaryMembers,md);
-      break;
-    case MemberType_Enumeration:  
-      addMemberToList(MemberListType_decEnumMembers,md);
-      addMemberToList(MemberListType_docEnumMembers,md);
-      break;
-    case MemberType_EnumValue:    
-      break;
-    case MemberType_Define:       
-      addMemberToList(MemberListType_decDefineMembers,md);
-      addMemberToList(MemberListType_docDefineMembers,md);
-      break;
-    default:
-      err("NamespaceDefImpl::insertMembers(): "
-           "member '%s' with class scope '%s' inserted in namespace scope '%s'!\n",
-           md->name().data(),
-           md->getClassDef() ? md->getClassDef()->name().data() : "",
-           name().data());
-  }
-  // if this is an inline namespace, then insert an alias of this member in the outer scope.
-  if (isInline())
+
+  // if this is an inline namespace that is not documented, then insert the 
+  // member in the parent scope instead
+  if (isInline() && !hasDocumentation())
   {
     Definition *outerScope = getOuterScope();
     if (outerScope)
     {
-      MemberDef *aliasMd = 0;
       if (outerScope->definitionType()==Definition::TypeNamespace)
       {
-        aliasMd = createMemberDefAlias(outerScope,md);
-        dynamic_cast<NamespaceDef*>(outerScope)->insertMember(aliasMd);
+        NamespaceDef *nd = dynamic_cast<NamespaceDef*>(outerScope);
+        nd->insertMember(md);
+        md->setNamespace(nd);
       }
       else if (outerScope->definitionType()==Definition::TypeFile)
       {
-        aliasMd = createMemberDefAlias(outerScope,md);
-        dynamic_cast<FileDef*>(outerScope)->insertMember(aliasMd);
+        FileDef *fd = dynamic_cast<FileDef*>(outerScope);
+        fd->insertMember(md);
+        md->setFileDef(fd);
+        md->setOuterScope(fd);
       }
-      if (aliasMd)
+    }
+  }
+  else // member is a non-inline namespace or a documented inline namespace
+  {
+    MemberList *allMemberList = getMemberList(MemberListType_allMembersList);
+    if (allMemberList==0)
+    {
+      allMemberList = new MemberList(MemberListType_allMembersList);
+      m_memberLists.append(allMemberList);
+    }
+    allMemberList->append(md); 
+    if (m_allMembersDict==0)
+    {
+      m_allMembersDict = new MemberSDict;
+    }
+    //printf("%s::m_allMembersDict->append(%s)\n",name().data(),md->localName().data());
+    m_allMembersDict->append(md->localName(),md); 
+    //::addNamespaceMemberNameToIndex(md);
+    //static bool sortBriefDocs=Config_getBool(SORT_BRIEF_DOCS);
+    switch(md->memberType())
+    {
+      case MemberType_Variable:     
+        addMemberToList(MemberListType_decVarMembers,md);
+        addMemberToList(MemberListType_docVarMembers,md);
+        break;
+      case MemberType_Function: 
+        addMemberToList(MemberListType_decFuncMembers,md);
+        addMemberToList(MemberListType_docFuncMembers,md);
+        break;
+      case MemberType_Typedef:      
+        addMemberToList(MemberListType_decTypedefMembers,md);
+        addMemberToList(MemberListType_docTypedefMembers,md);
+        break;
+      case MemberType_Sequence:      
+        addMemberToList(MemberListType_decSequenceMembers,md);
+        addMemberToList(MemberListType_docSequenceMembers,md);
+        break;
+      case MemberType_Dictionary:      
+        addMemberToList(MemberListType_decDictionaryMembers,md);
+        addMemberToList(MemberListType_docDictionaryMembers,md);
+        break;
+      case MemberType_Enumeration:  
+        addMemberToList(MemberListType_decEnumMembers,md);
+        addMemberToList(MemberListType_docEnumMembers,md);
+        break;
+      case MemberType_EnumValue:    
+        break;
+      case MemberType_Define:       
+        addMemberToList(MemberListType_decDefineMembers,md);
+        addMemberToList(MemberListType_docDefineMembers,md);
+        break;
+      default:
+        err("NamespaceDefImpl::insertMembers(): "
+            "member '%s' with class scope '%s' inserted in namespace scope '%s'!\n",
+            md->name().data(),
+            md->getClassDef() ? md->getClassDef()->name().data() : "",
+            name().data());
+    }
+    // if this is an inline namespace, then insert an alias of this member in the outer scope.
+    if (isInline())
+    {
+      Definition *outerScope = getOuterScope();
+      if (outerScope)
       {
-        MemberName *mn;
-        QCString name = md->name();
-        if ((mn=Doxygen::functionNameSDict->find(name)))
+        MemberDef *aliasMd = 0;
+        if (outerScope->definitionType()==Definition::TypeNamespace)
         {
-          mn->append(aliasMd);
+          aliasMd = createMemberDefAlias(outerScope,md);
+          dynamic_cast<NamespaceDef*>(outerScope)->insertMember(aliasMd);
         }
-        else
+        else if (outerScope->definitionType()==Definition::TypeFile)
         {
-          mn = new MemberName(name);
-          mn->append(aliasMd);
-          Doxygen::functionNameSDict->append(name,mn);
+          aliasMd = createMemberDefAlias(outerScope,md);
+          dynamic_cast<FileDef*>(outerScope)->insertMember(aliasMd);
+        }
+        if (aliasMd)
+        {
+          MemberName *mn;
+          QCString name = md->name();
+          if ((mn=Doxygen::functionNameSDict->find(name)))
+          {
+            mn->append(aliasMd);
+          }
+          else
+          {
+            mn = new MemberName(name);
+            mn->append(aliasMd);
+            Doxygen::functionNameSDict->append(name,mn);
+          }
         }
       }
     }
@@ -1242,7 +1269,7 @@ void NamespaceDefImpl::addListReferences()
 {
   //bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
   {
-    QList<ListItemInfo> *xrefItems = xrefListItems();
+    const std::vector<ListItemInfo> &xrefItems = xrefListItems();
     addRefItem(xrefItems,
         qualifiedName(),
         getLanguage()==SrcLangExt_Fortran ? 
@@ -1460,7 +1487,7 @@ void NamespaceDefImpl::addMemberToList(MemberListType lt,MemberDef *md)
 
   if (ml->listType()&MemberListType_declarationLists)
   {
-    md->setSectionList(this,ml);
+    md->setSectionList(ml);
   }
 }
 
index 53d2d7f..b9f24fa 100644 (file)
 OutputGenerator::OutputGenerator()
 {
   //printf("OutputGenerator::OutputGenerator()\n");
-  file=0;
-  active=TRUE;
-  genStack = new QStack<bool>;
-  genStack->setAutoDelete(TRUE);
+  m_file=0;
+  m_active=TRUE;
+  m_genStack = new QStack<bool>;
+  m_genStack->setAutoDelete(TRUE);
 }
 
 OutputGenerator::~OutputGenerator()
 {
   //printf("OutputGenerator::~OutputGenerator()\n");
-  delete file;
-  delete genStack;
+  delete m_file;
+  delete m_genStack;
 }
 
 void OutputGenerator::startPlainFile(const char *name)
 {
   //printf("startPlainFile(%s)\n",name);
-  fileName=dir+"/"+name;
-  file = new QFile(fileName);
-  if (!file->open(IO_WriteOnly))
+  m_fileName=m_dir+"/"+name;
+  m_file = new QFile(m_fileName);
+  if (!m_file->open(IO_WriteOnly))
   {
-    err("Could not open file %s for writing\n",fileName.data());
-    exit(1);
+    term("Could not open file %s for writing\n",m_fileName.data());
   }
-  t.setDevice(file);
+  t.setDevice(m_file);
 }
 
 void OutputGenerator::endPlainFile()
 {
   t.unsetDevice();
-  delete file;
-  file=0;
-  fileName.resize(0);
+  delete m_file;
+  m_file=0;
+  m_fileName.resize(0);
 }
 
 void OutputGenerator::pushGeneratorState()
 {
-  genStack->push(new bool(isEnabled()));
+  m_genStack->push(new bool(isEnabled()));
   //printf("%p:pushGeneratorState(%d) enabled=%d\n",this,genStack->count(),isEnabled());
 }
 
 void OutputGenerator::popGeneratorState()
 {
   //printf("%p:popGeneratorState(%d) enabled=%d\n",this,genStack->count(),isEnabled());
-  bool *lb = genStack->pop();
+  bool *lb = m_genStack->pop();
   ASSERT(lb!=0);
   if (lb==0) return; // for some robustness against superfluous \endhtmlonly commands.
   if (*lb) enable(); else disable();
index 322f4b7..576e950 100644 (file)
@@ -340,7 +340,7 @@ class OutputGenerator : public BaseOutputDocInterface
     void startPlainFile(const char *name);
     void endPlainFile();
     //QCString getContents() const;
-    bool isEnabled() const { return active; }
+    bool isEnabled() const { return m_active; }
     void pushGeneratorState();
     void popGeneratorState();
     //void setEncoding(const QCString &enc) { encoding = enc; }
@@ -489,11 +489,11 @@ class OutputGenerator : public BaseOutputDocInterface
 
   protected:
     FTextStream t;
-    QFile *file;
-    QCString fileName;
-    QCString dir;
-    bool active;
-    QStack<bool> *genStack;
+    QFile *m_file;
+    QCString m_fileName;
+    QCString m_dir;
+    bool m_active;
+    QStack<bool> *m_genStack;
 
   private:
     OutputGenerator(const OutputGenerator &o);
index daf3270..c47c1c9 100644 (file)
@@ -196,163 +196,4 @@ void OutputList::parseText(const QCString &textStr)
   delete root;
 }
 
-
-//--------------------------------------------------------------------------
-// Create some overloaded definitions of the forall function.
-// Using template functions here would have made it a little less
-// portable (I guess).
-
-// zero arguments
-void OutputList::forall(void (OutputGenerator::*func)())
-{
-  QListIterator<OutputGenerator> it(m_outputs);
-  OutputGenerator *og;
-  for (it.toFirst();(og=it.current());++it)
-  {
-    if (og->isEnabled()) (og->*func)();
-  }
-}
-
-// one argument
-#define FORALL1(a1,p1)                                        \
-void OutputList::forall(void (OutputGenerator::*func)(a1),a1) \
-{                                                             \
-  QListIterator<OutputGenerator> it(m_outputs);               \
-  OutputGenerator *og;                                        \
-  for (it.toFirst();(og=it.current());++it)                   \
-  {                                                           \
-    if (og->isEnabled()) (og->*func)(p1);                     \
-  }                                                           \
-}
-
-// two arguments
-#define FORALL2(a1,a2,p1,p2)                                        \
-void OutputList::forall(void (OutputGenerator::*func)(a1,a2),a1,a2) \
-{                                                                   \
-  QListIterator<OutputGenerator> it(m_outputs);                     \
-  OutputGenerator *og;                                              \
-  for (it.toFirst();(og=it.current());++it)                         \
-  {                                                                 \
-    if (og->isEnabled()) (og->*func)(p1,p2);                        \
-  }                                                                 \
-}
-
-// three arguments
-#define FORALL3(a1,a2,a3,p1,p2,p3)                                        \
-void OutputList::forall(void (OutputGenerator::*func)(a1,a2,a3),a1,a2,a3) \
-{                                                                         \
-  QListIterator<OutputGenerator> it(m_outputs);                           \
-  OutputGenerator *og;                                                    \
-  for (it.toFirst();(og=it.current());++it)                               \
-  {                                                                       \
-    if (og->isEnabled()) (og->*func)(p1,p2,p3);                           \
-  }                                                                       \
-}
-
-// four arguments
-#define FORALL4(a1,a2,a3,a4,p1,p2,p3,p4)                                        \
-void OutputList::forall(void (OutputGenerator::*func)(a1,a2,a3,a4),a1,a2,a3,a4) \
-{                                                                               \
-  QListIterator<OutputGenerator> it(m_outputs);                                 \
-  OutputGenerator *og;                                                          \
-  for (it.toFirst();(og=it.current());++it)                                     \
-  {                                                                             \
-    if (og->isEnabled()) (og->*func)(p1,p2,p3,p4);                              \
-  }                                                                             \
-}
-
-// five arguments
-#define FORALL5(a1,a2,a3,a4,a5,p1,p2,p3,p4,p5)                                        \
-void OutputList::forall(void (OutputGenerator::*func)(a1,a2,a3,a4,a5),a1,a2,a3,a4,a5) \
-{                                                                                     \
-  QListIterator<OutputGenerator> it(m_outputs);                                       \
-  OutputGenerator *og;                                                                \
-  for (it.toFirst();(og=it.current());++it)                                           \
-  {                                                                                   \
-    if (og->isEnabled()) (og->*func)(p1,p2,p3,p4,p5);                                 \
-  }                                                                                   \
-}
-
-// six arguments
-#define FORALL6(a1,a2,a3,a4,a5,a6,p1,p2,p3,p4,p5,p6)                                  \
-void OutputList::forall(void (OutputGenerator::*func)(a1,a2,a3,a4,a5,a6),a1,a2,a3,a4,a5,a6) \
-{                                                                                     \
-  QListIterator<OutputGenerator> it(m_outputs);                                       \
-  OutputGenerator *og;                                                                \
-  for (it.toFirst();(og=it.current());++it)                                           \
-  {                                                                                   \
-    if (og->isEnabled()) (og->*func)(p1,p2,p3,p4,p5,p6);                              \
-  }                                                                                   \
-}
-
-// seven arguments
-#define FORALL7(a1,a2,a3,a4,a5,a6,a7,p1,p2,p3,p4,p5,p6,p7)                      \
-void OutputList::forall(void (OutputGenerator::*func)(a1,a2,a3,a4,a5,a6,a7),a1,a2,a3,a4,a5,a6,a7) \
-{                                                                                     \
-  QListIterator<OutputGenerator> it(m_outputs);                                       \
-  OutputGenerator *og;                                                                \
-  for (it.toFirst();(og=it.current());++it)                                           \
-  {                                                                                   \
-    if (og->isEnabled()) (og->*func)(p1,p2,p3,p4,p5,p6,p7);                           \
-  }                                                                                   \
-}
-
-
-// eight arguments
-#define FORALL8(a1,a2,a3,a4,a5,a6,a7,a8,p1,p2,p3,p4,p5,p6,p7,p8)                      \
-void OutputList::forall(void (OutputGenerator::*func)(a1,a2,a3,a4,a5,a6,a7,a8),a1,a2,a3,a4,a5,a6,a7,a8) \
-{                                                                                     \
-  QListIterator<OutputGenerator> it(m_outputs);                                       \
-  OutputGenerator *og;                                                                \
-  for (it.toFirst();(og=it.current());++it)                                           \
-  {                                                                                   \
-    if (og->isEnabled()) (og->*func)(p1,p2,p3,p4,p5,p6,p7,p8);                        \
-  }                                                                                   \
-}
-
-// now instantiate only the ones we need.
-
-FORALL1(const char *a1,a1)
-FORALL1(char a1,a1)
-FORALL1(int a1,a1)
-FORALL1(DotClassGraph &a1,a1)
-FORALL1(DotInclDepGraph &a1,a1)
-FORALL1(DotCallGraph &a1,a1)
-FORALL1(DotDirDeps &a1,a1)
-FORALL1(DotGfxHierarchyTable &a1,a1)
-FORALL1(DotGroupCollaboration &a1,a1)
-FORALL1(SectionTypes a1,a1)
-#if defined(HAS_BOOL_TYPE) || defined(Q_HAS_BOOL_TYPE)
-FORALL1(bool a1,a1)
-FORALL2(bool a1,int a2,a1,a2)
-FORALL2(bool a1,bool a2,a1,a2)
-FORALL2(const char *a1,bool a2,a1,a2)
-FORALL4(const char *a1,const char *a2,const char *a3,bool a4,a1,a2,a3,a4)
-#endif
-FORALL2(int a1,bool a2,a1,a2)
-FORALL2(bool a1,const char *a2,a1,a2)
-FORALL2(ParamListTypes a1,const char *a2,a1,a2)
-FORALL1(IndexSections a1,a1)
-FORALL2(const char *a1,const char *a2,a1,a2)
-FORALL2(const char *a1,int a2,a1,a2)
-FORALL2(const char *a1,SectionInfo::SectionType a2,a1,a2)
-FORALL3(bool a1,HighlightedItem a2,const char *a3,a1,a2,a3)
-FORALL3(bool a1,bool a2,bool a3,a1,a2,a3)
-FORALL3(const ClassDiagram &a1,const char *a2,const char *a3,a1,a2,a3)
-FORALL3(const char *a1,const char *a2,const char *a3,a1,a2,a3)
-FORALL3(const char *a1,const char *a2,bool a3,a1,a2,a3)
-FORALL3(const char *a1,int a2,const char *a3,a1,a2,a3)
-FORALL3(const char *a1,const char *a2,SectionInfo::SectionType a3,a1,a2,a3)
-FORALL3(uchar a1,uchar a2,uchar a3,a1,a2,a3)
-FORALL3(const Definition *a1,const char *a2,bool a3,a1,a2,a3)
-FORALL4(SectionTypes a1,const char *a2,const char *a3,const char *a4,a1,a2,a3,a4)
-FORALL4(const char *a1,const char *a2,const char *a3,const char *a4,a1,a2,a3,a4)
-FORALL4(const char *a1,const char *a2,const char *a3,int a4,a1,a2,a3,a4)
-FORALL5(const char *a1,const char *a2,const char *a3,const char *a4,const char *a5,a1,a2,a3,a4,a5)
-FORALL5(const char *a1,const char *a2,const char *a3,const char *a4,bool a5,a1,a2,a3,a4,a5)
-FORALL6(const char *a1,const char *a2,const char *a3,const char *a4,const char *a5,const char *a6,a1,a2,a3,a4,a5,a6)
-FORALL6(const char *a1,const DocLinkInfo &a2,const char *a3,const char *a4,const SourceLinkInfo &a5,const SourceLinkInfo &a6,a1,a2,a3,a4,a5,a6)
-FORALL7(const char *a1,const char *a2,const char *a3,const char *a4,int a5,int a6,bool a7,a1,a2,a3,a4,a5,a6,a7)
-
-
 //--------------------------------------------------------------------------
index 2a83020..cfd3773 100644 (file)
@@ -18,6 +18,7 @@
 #ifndef OUTPUTLIST_H
 #define OUTPUTLIST_H
 
+#include <utility>
 #include <qlist.h>
 #include "index.h" // for IndexSections
 #include "outputgen.h"
@@ -109,8 +110,6 @@ class OutputList : public OutputDocInterface
     { forall(&OutputGenerator::startTitle); }
     void endTitle() 
     { forall(&OutputGenerator::endTitle); }
-    //void newParagraph() 
-    //{ forall(&OutputGenerator::newParagraph); }
     void startParagraph(const char *classDef=0)
     { forall(&OutputGenerator::startParagraph,classDef); }
     void endParagraph() 
@@ -176,8 +175,6 @@ class OutputList : public OutputDocInterface
     { forall(&OutputGenerator::startGroupHeader,extraLevels); }
     void endGroupHeader(int extraLevels=0)
     { forall(&OutputGenerator::endGroupHeader,extraLevels); }
-    //void writeListItem() 
-    //{ forall(&OutputGenerator::writeListItem); }
     void startItemListItem() 
     { forall(&OutputGenerator::startItemListItem); }
     void endItemListItem() 
@@ -492,70 +489,28 @@ class OutputList : public OutputDocInterface
     { forall(&OutputGenerator::addWord,word,hiPriority); }
 
     void startPlainFile(const char *name)
-    {
-      QListIterator<OutputGenerator> it(m_outputs);
-      OutputGenerator *og;
-      for (;(og=it.current());++it)
-      {
-        if (og->isEnabled()) (og->startPlainFile)(name);
-      }
-    }
+    { forall(&OutputGenerator::startPlainFile,name); }
     void endPlainFile()
-    {
-      QListIterator<OutputGenerator> it(m_outputs);
-      OutputGenerator *og;
-      for (;(og=it.current());++it)
-      {
-        if (og->isEnabled()) (og->endPlainFile)();
-      }
-    }
+    { forall(&OutputGenerator::endPlainFile); }
 
   private:
     void debug();
     void clear();
 
-    void forall(void (OutputGenerator::*func)());
-    FORALLPROTO1(const char *);
-    FORALLPROTO1(char);
-    FORALLPROTO1(IndexSections);
-    FORALLPROTO1(int);
-    FORALLPROTO1(DotClassGraph &);
-    FORALLPROTO1(DotInclDepGraph &);
-    FORALLPROTO1(DotCallGraph &);
-    FORALLPROTO1(DotGroupCollaboration &);
-    FORALLPROTO1(DotDirDeps &);
-    FORALLPROTO1(DotGfxHierarchyTable &);
-    FORALLPROTO1(SectionTypes);
-#if defined(HAS_BOOL_TYPE) || defined(Q_HAS_BOOL_TYPE)
-    FORALLPROTO1(bool);
-    FORALLPROTO2(bool,int);
-    FORALLPROTO2(bool,bool);
-    FORALLPROTO2(const char *,bool);
-    FORALLPROTO4(const char *,const char *,const char *,int);
-#endif
-    FORALLPROTO2(int,bool);
-    FORALLPROTO2(bool,const char *);
-    FORALLPROTO2(ParamListTypes,const char *);
-    FORALLPROTO2(const char *,const char *);
-    FORALLPROTO2(const char *,int);
-    FORALLPROTO2(const char *,SectionInfo::SectionType);
-    FORALLPROTO3(bool,HighlightedItem,const char *);
-    FORALLPROTO3(bool,bool,bool);
-    FORALLPROTO3(const char *,const char *,bool);
-    FORALLPROTO3(const char *,int,const char *);
-    FORALLPROTO3(const char *,const char *,SectionInfo::SectionType);
-    FORALLPROTO3(uchar,uchar,uchar);
-    FORALLPROTO3(const char *,const char *,const char *);
-    FORALLPROTO3(const ClassDiagram &,const char *,const char *);
-    FORALLPROTO3(const Definition*,const char *,bool);
-    FORALLPROTO4(SectionTypes,const char *,const char *,const char *);
-    FORALLPROTO4(const char *,const char *,const char *,const char *);
-    FORALLPROTO4(const char *,const char *,const char *,bool);
-    FORALLPROTO5(const char *,const char *,const char *,const char *,const char *);
-    FORALLPROTO5(const char *,const char *,const char *,const char *,bool);
-    FORALLPROTO6(const char *,const char *,const char *,const char *,const char *,const char *);
-    FORALLPROTO6(const char *,const DocLinkInfo &,const char *,const char *,const SourceLinkInfo &,const SourceLinkInfo &);
-    FORALLPROTO7(const char *,const char *,const char *,const char *,int,int,bool);
+    // For each output format that is enabled (OutputGenerator::isEnabled()) we forward
+    // the method call.
+    // We use C++11 variadic templates and perfect forwarding to implement forall() generically,
+    // and split the types of the methods from the arguments passed to allow implicit conversions.
+    template<typename T,class... Ts,class... As>
+    void forall(void (T::*methodPtr)(Ts...),As&&... args)
+    {
+      QListIterator<OutputGenerator> li(m_outputs);
+      OutputGenerator *og;
+      for (li.toFirst();(og=li.current());++li)
+      {
+        if (og->isEnabled()) (og->*methodPtr)(std::forward<As>(args)...);
+      }
+    }
 
     OutputList(const OutputList &ol);
     QList<OutputGenerator> m_outputs;
index 9f11eb0..8b6228f 100644 (file)
@@ -99,7 +99,7 @@ PageDefImpl::~PageDefImpl()
 
 void PageDefImpl::findSectionsInDocumentation()
 {
-  docFindSections(documentation(),this,0,docFile());
+  docFindSections(documentation(),this,docFile());
 }
 
 GroupDef *PageDefImpl::getGroupDef() const 
index f03aac7..5095a1e 100644 (file)
 #ifndef PARSERINTF_H
 #define PARSERINTF_H
 
-#include <qdict.h>
 #include <qstrlist.h>
 
+#include <memory>
+#include <map>
+#include <string>
+
 #include "types.h"
 
 class Entry;
@@ -29,16 +32,16 @@ class CodeOutputInterface;
 class MemberDef;
 class Definition;
 
-/** \brief Abstract interface for programming language parsers.
+/** \brief Abstract interface for outline parsers.
  *
  *  By implementing the methods of this interface one can add
- *  a new language parser to doxygen. The parser can make use of the 
+ *  a new language parser to doxygen. The parser implementation can make use of the 
  *  comment block parser to parse the contents of special comment blocks.
  */
-class ParserInterface
+class OutlineParserInterface
 {
   public:
-    virtual ~ParserInterface() {}
+    virtual ~OutlineParserInterface() {}
 
     /** Starts processing a translation unit (source files + headers).
      *  After this call parseInput() is called with sameTranslationUnit
@@ -67,7 +70,7 @@ class ParserInterface
      */
     virtual void parseInput(const char *fileName,
                             const char *fileBuf,
-                            Entry *root,
+                            const std::shared_ptr<Entry> &root,
                             bool sameTranslationUnit,
                             QStrList &filesInSameTranslationUnit) = 0;
 
@@ -76,8 +79,29 @@ class ParserInterface
      *  parser.
      *  @see parseInput()
      */
-    virtual bool needsPreprocessing(const QCString &extension) = 0;
+    virtual bool needsPreprocessing(const QCString &extension) const = 0;
     
+    /** Callback function called by the comment block scanner.
+     *  It provides a string \a text containing the prototype of a function
+     *  or variable. The parser should parse this and store the information
+     *  in the Entry node that corresponds with the node for which the
+     *  comment block parser was invoked.
+     */
+    virtual void parsePrototype(const char *text) = 0;
+
+};
+
+/** \brief Abstract interface for code parsers.
+ *
+ *  By implementing the methods of this interface one can add
+ *  a new language parser to doxygen. This interface is used for
+ *  syntax highlighting, but also to extract cross references and call graphs.
+ */
+class CodeParserInterface
+{
+  public:
+    virtual ~CodeParserInterface() {}
+
     /** Parses a source file or fragment with the goal to produce
      *  highlighted and cross-referenced output.
      *  @param[in] codeOutIntf Abstract interface for writing the result.
@@ -123,14 +147,6 @@ class ParserInterface
      */
     virtual void resetCodeParserState() = 0;
 
-    /** Callback function called by the comment block scanner.
-     *  It provides a string \a text containing the prototype of a function
-     *  or variable. The parser should parse this and store the information
-     *  in the Entry node that corresponds with the node for which the
-     *  comment block parser was invoked.
-     */
-    virtual void parsePrototype(const char *text) = 0;
-
 };
 
 //-----------------------------------------------------------------------------
@@ -143,18 +159,22 @@ class ParserInterface
 class ParserManager
 {
   public:
-    /** Creates the parser manager object. 
-     */
-    ParserManager()
-      : m_defaultParser(0) { m_parsers.setAutoDelete(TRUE); }
-   ~ParserManager()
+    struct ParserPair
     {
-      delete m_defaultParser;
-    }
+      ParserPair(std::unique_ptr<OutlineParserInterface> oli,
+                 std::unique_ptr<CodeParserInterface> cpi)
+        : outlineParser(std::move(oli)), codeParser(std::move(cpi)) 
+      {
+      }
+
+      std::unique_ptr<OutlineParserInterface> outlineParser;
+      std::unique_ptr<CodeParserInterface>    codeParser;
+    };
 
-    void registerDefaultParser(ParserInterface *parser)
+    ParserManager(std::unique_ptr<OutlineParserInterface> outlineParser,
+                  std::unique_ptr<CodeParserInterface> codeParser)
+      : m_defaultParsers(std::move(outlineParser),std::move(codeParser))
     {
-      m_defaultParser = parser;
     }
 
     /** Registers an additional parser.
@@ -163,9 +183,11 @@ class ParserManager
      *  @param[in] parser    The parser that is to be used for the
      *                       given name.
      */
-    void registerParser(const char *name,ParserInterface *parser)
+    void registerParser(const char *name,std::unique_ptr<OutlineParserInterface> outlineParser,
+                                         std::unique_ptr<CodeParserInterface> codeParser)
     {
-      m_parsers.insert(name,parser);
+      m_parsers.emplace(std::string(name),
+                        ParserPair(std::move(outlineParser),std::move(codeParser)));
     }
 
     /** Registers a file \a extension with a parser with name \a parserName. 
@@ -174,13 +196,16 @@ class ParserManager
     bool registerExtension(const char *extension, const char *parserName)
     {
       if (parserName==0 || extension==0) return FALSE;
-      ParserInterface *intf = m_parsers.find(parserName);
-      if (intf==0) return FALSE;
-      if (m_extensions.find(extension)!=0) // extension already exists
+
+      const auto &parserIt = m_parsers.find(parserName);
+      if (parserIt == m_parsers.end()) return FALSE;
+
+      auto extensionIt = m_extensions.find(extension);
+      if (extensionIt != m_extensions.end()) // extension already exists
       {
-        m_extensions.remove(extension); // remove it
+        m_extensions.erase(extensionIt); // remove it (e.g. user specified extension overrules built in one)
       }
-      m_extensions.insert(extension,intf); // add new mapping
+      m_extensions.emplace(std::string(extension),parserIt->second); // add new mapping
       return TRUE;
     }
 
@@ -188,22 +213,36 @@ class ParserManager
      *  If there is no parser explicitly registered for the supplied extension, 
      *  the interface to the default parser will be returned.
      */
-    ParserInterface *getParser(const char *extension)
+    OutlineParserInterface &getOutlineParser(const char *extension)
+    {
+      return *getParsers(extension).outlineParser;
+    }
+
+    /** Gets the interface to the parser associated with given \a extension.
+     *  If there is no parser explicitly registered for the supplied extension, 
+     *  the interface to the default parser will be returned.
+     */
+    CodeParserInterface &getCodeParser(const char *extension)
     {
-      QCString ext = QCString(extension).lower();
+      return *getParsers(extension).codeParser;
+    }
+
+  private:
+    ParserPair &getParsers(const char *extension)
+    {
+      QCString ext = QCString(extension).lower().data();
       if (ext.isEmpty()) ext=".no_extension";
-      ParserInterface *intf = m_extensions.find(ext);
-      if (intf==0 && ext.length()>4)
+      auto it = m_extensions.find(ext.data());
+      if (it==m_extensions.end() && ext.length()>4)
       {
-        intf = m_extensions.find(ext.left(4));
+        it = m_extensions.find(ext.left(4).data());
       }
-      return intf ? intf : m_defaultParser;
+      return it!=m_extensions.end() ? it->second : m_defaultParsers;
     }
 
-  private:
-    QDict<ParserInterface> m_parsers;
-    QDict<ParserInterface> m_extensions;
-    ParserInterface *m_defaultParser;
+    std::map<std::string,ParserPair> m_parsers;
+    std::map<std::string,ParserPair &> m_extensions;
+    ParserPair m_defaultParsers;
 };
 
 #endif
index a288e0e..4ecee5e 100644 (file)
@@ -639,6 +639,7 @@ void PerlModDocVisitor::visit(DocStyleChange *s)
   switch (s->style())
   {
     case DocStyleChange::Bold:          style = "bold"; break;
+    case DocStyleChange::S:             style = "s"; break;
     case DocStyleChange::Strike:        style = "strike"; break;
     case DocStyleChange::Del:           style = "del"; break;
     case DocStyleChange::Underline:     style = "underline"; break;
@@ -1422,23 +1423,20 @@ void PerlModDocVisitor::visitPost(DocParBlock *)
 }
 
 
-static void addTemplateArgumentList(ArgumentList *al,PerlModOutput &output,const char *)
+static void addTemplateArgumentList(const ArgumentList &al,PerlModOutput &output,const char *)
 {
-  if (!al)
-    return;
+  if (!al.hasParameters()) return;
   output.openList("template_parameters");
-  ArgumentListIterator ali(*al);
-  Argument *a;
-  for (ali.toFirst();(a=ali.current());++ali)
+  for (const Argument &a : al)
   {
     output.openHash();
-    if (!a->type.isEmpty())
-      output.addFieldQuotedString("type", a->type);
-    if (!a->name.isEmpty())
-      output.addFieldQuotedString("declaration_name", a->name)
-       .addFieldQuotedString("definition_name", a->name);
-    if (!a->defval.isEmpty())
-      output.addFieldQuotedString("default", a->defval);
+    if (!a.type.isEmpty())
+      output.addFieldQuotedString("type", a.type);
+    if (!a.name.isEmpty())
+      output.addFieldQuotedString("declaration_name", a.name)
+       .addFieldQuotedString("definition_name", a.name);
+    if (!a.defval.isEmpty())
+      output.addFieldQuotedString("default", a.defval);
     output.closeHash();
   }
   output.closeList();
@@ -1609,45 +1607,46 @@ void PerlModGenerator::generatePerlModForMember(const MemberDef *md,const Defini
       md->memberType()!=MemberType_Enumeration)
     m_output.addFieldQuotedString("type", md->typeString());
   
-  const ArgumentList *al = md->argumentList();
+  const ArgumentList &al = md->argumentList();
   if (isFunc) //function
   {
-    m_output.addFieldBoolean("const", al!=0 && al->constSpecifier)
-      .addFieldBoolean("volatile", al!=0 && al->volatileSpecifier);
+    m_output.addFieldBoolean("const",    al.constSpecifier)
+            .addFieldBoolean("volatile", al.volatileSpecifier);
 
     m_output.openList("parameters");
-    const ArgumentList *declAl = md->declArgumentList();
-    const ArgumentList *defAl  = md->argumentList();
-    if (declAl && defAl && declAl->count()>0)
+    const ArgumentList &declAl = md->declArgumentList();
+    if (!declAl.empty())
     {
-      ArgumentListIterator declAli(*declAl);
-      ArgumentListIterator defAli(*defAl);
-      const Argument *a;
-      for (declAli.toFirst();(a=declAli.current());++declAli)
+      auto defIt = al.begin();
+      for (const Argument &a : declAl)
       {
-       const Argument *defArg = defAli.current();
+       const Argument *defArg = 0;
+        if (defIt!=al.end())
+        {
+          defArg = &(*defIt);
+          ++defIt;
+        }
        m_output.openHash();
 
-       if (!a->name.isEmpty())
-         m_output.addFieldQuotedString("declaration_name", a->name);
+       if (!a.name.isEmpty())
+         m_output.addFieldQuotedString("declaration_name", a.name);
 
-       if (defArg && !defArg->name.isEmpty() && defArg->name!=a->name)
+       if (defArg && !defArg->name.isEmpty() && defArg->name!=a.name)
          m_output.addFieldQuotedString("definition_name", defArg->name);
 
-       if (!a->type.isEmpty())
-         m_output.addFieldQuotedString("type", a->type);
+       if (!a.type.isEmpty())
+         m_output.addFieldQuotedString("type", a.type);
 
-       if (!a->array.isEmpty())
-         m_output.addFieldQuotedString("array", a->array);
+       if (!a.array.isEmpty())
+         m_output.addFieldQuotedString("array", a.array);
 
-       if (!a->defval.isEmpty())
-         m_output.addFieldQuotedString("default_value", a->defval);
+       if (!a.defval.isEmpty())
+         m_output.addFieldQuotedString("default_value", a.defval);
 
-       if (!a->attrib.isEmpty())
-         m_output.addFieldQuotedString("attributes", a->attrib);
+       if (!a.attrib.isEmpty())
+         m_output.addFieldQuotedString("attributes", a.attrib);
        
        m_output.closeHash();
-       if (defArg) ++defAli;
       }
     }
     m_output.closeList();
@@ -1656,12 +1655,10 @@ void PerlModGenerator::generatePerlModForMember(const MemberDef *md,const Defini
           md->argsString()!=0) // define
   {
     m_output.openList("parameters");
-    ArgumentListIterator ali(*al);
-    const Argument *a;
-    for (ali.toFirst();(a=ali.current());++ali)
+    for (const Argument &a : al)
     {
       m_output.openHash()
-       .addFieldQuotedString("name", a->type)
+       .addFieldQuotedString("name", a.type)
        .closeHash();
     }
     m_output.closeList();
@@ -1796,9 +1793,9 @@ void PerlModGenerator::generatePerlModForClass(const ClassDef *cd)
   // + standard member sections
   // + detailed member documentation
   // - examples using the class
-  
+
   if (cd->isReference())        return; // skip external references.
-  if (cd->name().find('@')!=-1) return; // skip anonymous compounds.
+  if (cd->isAnonymous())        return; // skip anonymous compounds.
   if (cd->templateMaster()!=0)  return; // skip generated template instances.
 
   m_output.openHash()
@@ -2275,9 +2272,8 @@ bool PerlModGenerator::createOutputDir(QDir &perlModDir)
       dir.setPath(QDir::currentDirPath());
       if (!dir.mkdir(outputDirectory))
       {
-       err("tag OUTPUT_DIRECTORY: Output directory '%s' does not "
+       term("tag OUTPUT_DIRECTORY: Output directory '%s' does not "
            "exist and cannot be created\n",outputDirectory.data());
-       exit(1);
       }
       else
       {
index ff4ebd3..fa50f2d 100644 (file)
@@ -210,7 +210,7 @@ static void runPlantumlContent(const QDict< QList <QCString> > &plantumlFiles,
   }
   while (s)
   {
-    pumlArgs += portable_pathListSeparator();
+    pumlArgs += Portable::pathListSeparator();
     pumlArgs += s;
     s = pumlIncludePathList.next(); 
   }
@@ -227,7 +227,7 @@ static void runPlantumlContent(const QDict< QList <QCString> > &plantumlFiles,
     pumlArgs += "-graphvizdot \"";
     pumlArgs += dotPath;
     pumlArgs += "dot";
-    pumlArgs += portable_commandExtension();
+    pumlArgs += Portable::commandExtension();
     pumlArgs += "\" ";
   }
   switch (format)
@@ -283,8 +283,8 @@ static void runPlantumlContent(const QDict< QList <QCString> > &plantumlFiles,
       file.close();
       Debug::print(Debug::Plantuml,0,"*** %s Running Plantuml arguments:%s\n","PlantumlManager::runPlantumlContent",qPrint(pumlArguments));
 
-      portable_sysTimerStart();
-      if ((exitCode=portable_system(pumlExe,pumlArguments,TRUE))!=0)
+      Portable::sysTimerStart();
+      if ((exitCode=Portable::system(pumlExe,pumlArguments,TRUE))!=0)
       {
         err("Problems running PlantUML. Verify that the command 'java -jar \"%splantuml.jar\" -h' works from the command line. Exit code: %d\n",
             plantumlJarPath.data(),exitCode);
@@ -294,7 +294,7 @@ static void runPlantumlContent(const QDict< QList <QCString> > &plantumlFiles,
         Debug::print(Debug::Plantuml,0,"*** %s Remove %s file\n","PlantumlManager::runPlantumlContent",qPrint(puFileName));
         file.remove();
       }
-      portable_sysTimerStop();
+      Portable::sysTimerStop();
 
       if ( (format==PlantumlManager::PUML_EPS) && (Config_getBool(USE_PDFLATEX)) )
       {
@@ -309,12 +309,12 @@ static void runPlantumlContent(const QDict< QList <QCString> > &plantumlFiles,
             const int maxCmdLine = 40960;
             QCString epstopdfArgs(maxCmdLine);
             epstopdfArgs.sprintf("\"%s%s.eps\" --outfile=\"%s%s.pdf\"",qPrint(pumlOutDir),qPrint(*nb),qPrint(pumlOutDir),qPrint(*nb));
-            portable_sysTimerStart();
-            if ((exitCode=portable_system("epstopdf",epstopdfArgs))!=0)
+            Portable::sysTimerStart();
+            if ((exitCode=Portable::system("epstopdf",epstopdfArgs))!=0)
             {
               err("Problems running epstopdf. Check your TeX installation! Exit code: %d\n",exitCode);
             }
-            portable_sysTimerStop();
+            Portable::sysTimerStop();
           }
         }
       }
index 6c99eba..d3a01f5 100644 (file)
@@ -64,7 +64,7 @@ class PlantumlManager
     QDict< QList<QCString> >    m_pngPlantumlFiles;
     QDict< QList<QCString> >    m_svgPlantumlFiles;
     QDict< QList<QCString> >    m_epsPlantumlFiles;
-    QDict< QCString >           m_pngPlantumlContent;     // use circular queue for using multi-proecessor (multi threading)
+    QDict< QCString >           m_pngPlantumlContent;     // use circular queue for using multi-processor (multi threading)
     QDict< QCString >           m_svgPlantumlContent;
     QDict< QCString >           m_epsPlantumlContent;
     QCString                    m_cachedPlantumlAllContent;         // read from CACHE_FILENAME file
index 3d64638..3ee1081 100644 (file)
@@ -1,36 +1,43 @@
+#include "portable.h"
+
 #include <stdlib.h>
-#include <ctype.h>
+#include <stdio.h>
+
 #if defined(_WIN32) && !defined(__CYGWIN__)
 #undef UNICODE
 #define _WIN32_DCOM
 #include <windows.h>
 #else
 #include <unistd.h>
-#include <stdlib.h>
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <errno.h>
 extern char **environ;
 #endif
 
+#include <ctype.h>
 #include <qglobal.h>
 #include <qdatetime.h>
+#include <qglobal.h>
+#include <qdir.h>
+#include <map>
+#include <string>
 
-#if defined(_MSC_VER) || defined(__BORLANDC__)
-#define popen _popen
-#define pclose _pclose
-#endif
-
-#include "portable.h"
 #include "util.h"
 #ifndef NODEBUG
 #include "debug.h"
 #endif
 
+#if !defined(_WIN32) || defined(__CYGWIN__)
+static bool environmentLoaded = false;
+static std::map<std::string,std::string> proc_env = std::map<std::string,std::string>();
+#endif
+
 static double  g_sysElapsedTime;
 static QTime   g_time;
 
-int portable_system(const char *command,const char *args,bool commandHasConsole)
+
+int Portable::system(const char *command,const char *args,bool commandHasConsole)
 {
 
   if (command==0) return 1;
@@ -127,7 +134,7 @@ int portable_system(const char *command,const char *args,bool commandHasConsole)
 #else // Win32 specific
   if (commandHasConsole)
   {
-    return system(fullCmd);
+    return ::system(fullCmd);
   }
   else
   {
@@ -189,13 +196,13 @@ int portable_system(const char *command,const char *args,bool commandHasConsole)
 
 }
 
-uint portable_pid()
+unsigned int Portable::pid(void)
 {
-  uint pid;
+  unsigned int pid;
 #if !defined(_WIN32) || defined(__CYGWIN__)
-  pid = (uint)getpid();
+  pid = (unsigned int)getpid();
 #else
-  pid = (uint)GetCurrentProcessId();
+  pid = (unsigned int)GetCurrentProcessId();
 #endif
   return pid;
 }
@@ -205,88 +212,50 @@ uint portable_pid()
   static char **last_environ;
 #endif
 
-void portable_setenv(const char *name,const char *value)
+#if !defined(_WIN32) || defined(__CYGWIN__)
+void loadEnvironment()
 {
-    if (value==0) value="";
-#if defined(_WIN32) && !defined(__CYGWIN__)
-    SetEnvironmentVariable(name,value);
-#else
-    char **ep = 0;
-    size_t size;
-    const size_t namelen=qstrlen(name);
-    const size_t vallen=qstrlen(value) + 1;
+  if(environ != NULL)
+  {
+    unsigned int i = 0;
+    char* current = environ[i];
 
-    size = 0;
-    if (environ!=0)
+    while(current != NULL)                            // parse all strings contained by environ til the last element (NULL)
     {
-      for (ep = environ; *ep; ++ep)
-      {
-        if (!qstrncmp (*ep, name, (uint)namelen) &&
-            (*ep)[namelen] == '=')
-          break;
-        else
-          ++size;
+      std::string env_var(current);                   // load current environment variable string
+      size_t pos = env_var.find("=");
+      if(pos != std::string::npos)                    // only parse the variable, if it is a valid environment variable...
+      {                                               // ...which has to contain an equal sign as delimiter by definition
+        std::string name = env_var.substr(0,pos);     // the string til the equal sign contains the name
+        std::string value = env_var.substr(pos + 1);  // the string from the equal sign contains the value
+
+        proc_env[name] = value;                       // save the value by the name as its key in the classes map
       }
+      i++;
+      current = environ[i];
     }
+  }
 
-    if (environ==0 || *ep==0) /* add new string */
-    {
-      char **new_environ;
-      if (environ == last_environ && environ!=0)
-      {
-        // We allocated this space; we can extend it. 
-        new_environ = (char **) realloc (last_environ, (size + 2) * sizeof (char *));
-      }
-      else
-      {
-        new_environ = (char **) malloc ((size + 2) * sizeof (char *));
-      }
-
-      if (new_environ==0) // no more memory 
-      {
-        return;
-      }
-
-      new_environ[size] = (char *)malloc (namelen + 1 + vallen);
-      if (new_environ[size]==0)
-      {
-        free (new_environ);
-        return;
-      }
-
-      if (environ != last_environ)
-      {
-        memcpy ((char *) new_environ, environ, size * sizeof (char *));
-      }
+  environmentLoaded = true;
+}
+#endif
 
-      memcpy(new_environ[size], name, namelen);
-      new_environ[size][namelen] = '=';
-      memcpy(&new_environ[size][namelen + 1], value, vallen);
-      new_environ[size + 1] = 0;
-      last_environ = environ = new_environ;
-    }
-    else /* replace existing string */
-    {
-      size_t len = qstrlen (*ep);
-      if (len + 1 < namelen + 1 + vallen)
-      {
-        /* The existing string is too short; malloc a new one.  */
-        char *newString = (char *)malloc(namelen + 1 + vallen);
-        if (newString==0)
-        {
-          return;
-        }
-        *ep = newString;
-      }
-      memcpy(*ep, name, namelen);
-      (*ep)[namelen] = '=';
-      memcpy(&(*ep)[namelen + 1], value, vallen);
+void Portable::setenv(const char *name,const char *value)
+{
+    if (value==0) value="";
+#if defined(_WIN32) && !defined(__CYGWIN__)
+    SetEnvironmentVariable(name,value);
+#else
+    if(!environmentLoaded) // if the environment variables are not loaded already...
+    {                                 // ...call loadEnvironment to store them in class
+      loadEnvironment();
     }
 
+    proc_env[name] = std::string(value); // create or replace exisiting value
 #endif
 }
 
-void portable_unsetenv(const char *variable)
+void Portable::unsetenv(const char *variable)
 {
 #if defined(_WIN32) && !defined(__CYGWIN__)
     SetEnvironmentVariable(variable,0);
@@ -300,32 +269,35 @@ void portable_unsetenv(const char *variable)
       return; // not properly formatted
     }
 
-    len = qstrlen(variable);
-
-    ep = environ;
-    while (*ep != NULL)
+    if(proc_env.find(variable) != proc_env.end())
     {
-      if (!qstrncmp(*ep, variable, (uint)len) && (*ep)[len]=='=')
-      {
-        /* Found it.  Remove this pointer by moving later ones back.  */
-        char **dp = ep;
-        do dp[0] = dp[1]; while (*dp++);
-        /* Continue the loop in case NAME appears again.  */
-      }
-      else
-      {
-        ++ep;
-      }
+      proc_env[variable].erase();
     }
 #endif
 }
 
-const char *portable_getenv(const char *variable)
-{
-  return getenv(variable);
+const char *Portable::getenv(const char *variable)
+{  
+#if defined(_WIN32) && !defined(__CYGWIN__)
+    return ::getenv(variable);
+#else
+    if(!environmentLoaded) // if the environment variables are not loaded already...
+    {                                 // ...call loadEnvironment to store them in class
+      loadEnvironment();
+    }
+
+    if(proc_env.find(variable) != proc_env.end())
+    {
+      return proc_env[variable].c_str();
+    }
+    else
+    {
+      return NULL;
+    }
+#endif
 }
 
-portable_off_t portable_fseek(FILE *f,portable_off_t offset, int whence)
+portable_off_t Portable::fseek(FILE *f,portable_off_t offset, int whence)
 {
 #if defined(__MINGW32__)
   return fseeko64(f,offset,whence);
@@ -336,7 +308,7 @@ portable_off_t portable_fseek(FILE *f,portable_off_t offset, int whence)
 #endif
 }
 
-portable_off_t portable_ftell(FILE *f)
+portable_off_t Portable::ftell(FILE *f)
 {
 #if defined(__MINGW32__)
   return ftello64(f);  
@@ -347,18 +319,18 @@ portable_off_t portable_ftell(FILE *f)
 #endif
 }
 
-FILE *portable_fopen(const char *fileName,const char *mode)
+FILE *Portable::fopen(const char *fileName,const char *mode)
 {
 #if defined(_WIN32) && !defined(__CYGWIN__)
   QString fn(fileName);
   QString m(mode);
   return _wfopen((wchar_t*)fn.ucs2(),(wchar_t*)m.ucs2());
 #else
-  return fopen(fileName,mode);
+  return ::fopen(fileName,mode);
 #endif
 }
 
-char  portable_pathSeparator()
+char  Portable::pathSeparator(void)
 {
 #if defined(_WIN32) && !defined(__CYGWIN__)
   return '\\';
@@ -367,7 +339,7 @@ char  portable_pathSeparator()
 #endif
 }
 
-char  portable_pathListSeparator()
+char  Portable::pathListSeparator(void)
 {
 #if defined(_WIN32) && !defined(__CYGWIN__)
   return ';';
@@ -376,7 +348,7 @@ char  portable_pathListSeparator()
 #endif
 }
 
-const char *portable_ghostScriptCommand()
+const char *Portable::ghostScriptCommand(void)
 {
 #if defined(_WIN32) && !defined(__CYGWIN__)
     return "gswin32c.exe";
@@ -385,7 +357,7 @@ const char *portable_ghostScriptCommand()
 #endif
 }
 
-const char *portable_commandExtension()
+const char *Portable::commandExtension(void)
 {
 #if defined(_WIN32) && !defined(__CYGWIN__)
     return ".exe";
@@ -394,7 +366,7 @@ const char *portable_commandExtension()
 #endif
 }
 
-bool portable_fileSystemIsCaseSensitive()
+bool Portable::fileSystemIsCaseSensitive(void)
 {
 #if defined(_WIN32) || defined(macintosh) || defined(__MACOSX__) || defined(__APPLE__) || defined(__CYGWIN__)
   return FALSE;
@@ -403,32 +375,40 @@ bool portable_fileSystemIsCaseSensitive()
 #endif
 }
 
-FILE * portable_popen(const char *name,const char *type)
+FILE * Portable::popen(const char *name,const char *type)
 {
-  return popen(name,type);
+  #if defined(_MSC_VER) || defined(__BORLANDC__)
+  return ::_popen(name,type);
+  #else
+  return ::popen(name,type);
+  #endif
 }
 
-int portable_pclose(FILE *stream)
+int Portable::pclose(FILE *stream)
 {
-  return pclose(stream);
+  #if defined(_MSC_VER) || defined(__BORLANDC__)
+  return ::_pclose(stream);
+  #else
+  return ::pclose(stream);
+  #endif
 }
 
-void portable_sysTimerStart()
+void Portable::sysTimerStart(void)
 {
   g_time.start();
 }
 
-void portable_sysTimerStop()
+void Portable::sysTimerStop(void)
 {
   g_sysElapsedTime+=((double)g_time.elapsed())/1000.0;
 }
 
-double portable_getSysElapsedTime()
+double Portable::getSysElapsedTime(void)
 {
   return g_sysElapsedTime;
 }
 
-void portable_sleep(int ms)
+void Portable::sleep(int ms)
 {
 #if defined(_WIN32) && !defined(__CYGWIN__)
   Sleep(ms);
@@ -437,7 +417,7 @@ void portable_sleep(int ms)
 #endif
 }
 
-bool portable_isAbsolutePath(const char *fileName)
+bool Portable::isAbsolutePath(const char *fileName)
 {
 # ifdef _WIN32
   if (isalpha (fileName [0]) && fileName[1] == ':')
@@ -457,24 +437,84 @@ bool portable_isAbsolutePath(const char *fileName)
 /**
  * Correct a possible wrong PATH variable
  *
- * This routine was inspired by the cause for bug 766059 was that in the Windows path there were forward slahes.
+ * This routine was inspired by the cause for bug 766059 was that in the Windows path there were forward slashes.
  */
-void portable_correct_path(void)
+void Portable::correct_path(void)
 {
 #if defined(_WIN32) && !defined(__CYGWIN__)
-  const char *p = portable_getenv("PATH");
+  const char *p = Portable::getenv("PATH");
   if (!p) return; // no path nothing to correct
   QCString result = substitute(p,'/','\\');
-  if (result!=p) portable_setenv("PATH",result.data());
+  if (result!=p) Portable::setenv("PATH",result.data());
 #endif
 }
 
-void portable_unlink(const char *fileName)
+void Portable::unlink(const char *fileName)
 {
 #if defined(_WIN32) && !defined(__CYGWIN__)
   _unlink(fileName);
 #else
-  unlink(fileName);
+  ::unlink(fileName);
 #endif
 }
 
+void Portable::setShortDir(void)
+{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+  long     length = 0;
+  TCHAR*   buffer = NULL;
+  // First obtain the size needed by passing NULL and 0.
+  length = GetShortPathName(QDir::currentDirPath().data(), NULL, 0);
+  // Dynamically allocate the correct size
+  // (terminating null char was included in length)
+  buffer = new TCHAR[length];
+  // Now simply call again using same (long) path.
+  length = GetShortPathName(QDir::currentDirPath().data(), buffer, length);
+  // Set the correct directory (short name)
+  QDir::setCurrent(buffer);
+  delete [] buffer;
+#endif
+}
+
+/* Return the first occurrence of NEEDLE in HAYSTACK.  */
+static const char * portable_memmem (const char *haystack, size_t haystack_len,
+                        const char *needle, size_t needle_len)
+{
+  const char *const last_possible = haystack + haystack_len - needle_len;
+
+  if (needle_len == 0)
+    // The first occurrence of the empty string should to occur at the beginning of the string.
+  {
+    return haystack;
+  }
+
+  // Sanity check
+  if (haystack_len < needle_len)
+  {
+    return 0;
+  }
+
+  for (const char *begin = haystack; begin <= last_possible; ++begin)
+  {
+    if (begin[0] == needle[0] && !memcmp(&begin[1], needle + 1, needle_len - 1))
+    {
+      return begin;
+    }
+  }
+
+  return 0;
+}
+
+const char *Portable::strnstr(const char *haystack, const char *needle, size_t haystack_len)
+{
+  size_t needle_len = strnlen(needle, haystack_len);
+  if (needle_len < haystack_len || !needle[needle_len]) 
+  {
+    const char *x = portable_memmem(haystack, haystack_len, needle, needle_len);
+    if (x && !memchr(haystack, 0, x - haystack))
+    {
+      return x;
+    }
+  }
+  return 0;
+}
index 83f90ef..771108e 100644 (file)
@@ -1,9 +1,11 @@
 #ifndef PORTABLE_H
 #define PORTABLE_H
 
-#include <sys/types.h>
 #include <stdio.h>
-#include <qglobal.h>
+#include <sys/types.h>
+
+
+
 
 #if defined(_WIN32)
 typedef __int64 portable_off_t;
@@ -15,28 +17,34 @@ typedef off_t portable_off_t;
  *  @brief Portable versions of functions that are platform dependent.
  */
 
-int            portable_system(const char *command,const char *args,bool commandHasConsole=TRUE);
-uint           portable_pid();
-const char *   portable_getenv(const char *variable);
-void           portable_setenv(const char *variable,const char *value);
-void           portable_unsetenv(const char *variable);
-portable_off_t portable_fseek(FILE *f,portable_off_t offset, int whence);
-portable_off_t portable_ftell(FILE *f);
-FILE *         portable_fopen(const char *fileName,const char *mode);
-void           portable_unlink(const char *fileName);
-char           portable_pathSeparator();
-char           portable_pathListSeparator();
-const char *   portable_ghostScriptCommand();
-const char *   portable_commandExtension();
-bool           portable_fileSystemIsCaseSensitive();
-FILE *         portable_popen(const char *name,const char *type);
-int            portable_pclose(FILE *stream);
-void           portable_sysTimerStart();
-void           portable_sysTimerStop();
-double         portable_getSysElapsedTime();
-void           portable_sleep(int ms);
-bool           portable_isAbsolutePath(const char *fileName);
-void           portable_correct_path(void);
+namespace Portable
+{
+  int            system(const char *command,const char *args,bool commandHasConsole=true);
+  unsigned int   pid(void);
+  const char *   getenv(const char *variable);
+  void           setenv(const char *variable,const char *value);
+  void           unsetenv(const char *variable);
+  portable_off_t fseek(FILE *f,portable_off_t offset, int whence);
+  portable_off_t ftell(FILE *f);
+  FILE *         fopen(const char *fileName,const char *mode);
+  void           unlink(const char *fileName);
+  char           pathSeparator(void);
+  char           pathListSeparator(void);
+  const char *   ghostScriptCommand(void);
+  const char *   commandExtension(void);
+  bool           fileSystemIsCaseSensitive();
+  FILE *         popen(const char *name,const char *type);
+  int            pclose(FILE *stream);
+  void           sysTimerStart(void);
+  void           sysTimerStop(void);
+  double         getSysElapsedTime(void);
+  void           sleep(int ms);
+  bool           isAbsolutePath(const char *fileName);
+  void           correct_path(void);
+  void           setShortDir(void);
+  const char *   strnstr(const char *haystack, const char *needle, size_t haystack_len);
+}
+
 
 extern "C" {
   void *         portable_iconv_open(const char* tocode, const char* fromcode);
index 190673f..137b397 100644 (file)
--- a/src/pre.h
+++ b/src/pre.h
 
 class BufStr;
 
-void initPreprocessor();
-void cleanUpPreprocessor();
-void addSearchDir(const char *dir);
-void preprocessFile(const char *fileName,BufStr &input,BufStr &output);
-void preFreeScanner();
+class Preprocessor
+{
+  public:
+    Preprocessor();
+   ~Preprocessor();
+    void processFile(const char *fileName,BufStr &input,BufStr &output);
+    void addSearchDir(const char *dir);
+ private:
+   struct Private;
+   Private *p;
+};
 
 #endif
index 596108f..7685853 100644 (file)
--- a/src/pre.l
+++ b/src/pre.l
@@ -16,6 +16,8 @@
  */
 %option never-interactive
 %option prefix="preYY"
+%option reentrant
+%option extra-type="struct preYY_state *"
 
 %{
 
@@ -62,6 +64,8 @@
 //#define DBG_CTX(x) fprintf x
 #define DBG_CTX(x) do { } while(0)
 
+static const char *stateToString(int state);
+
 struct CondCtx
 {
   CondCtx(int line,QCString id,bool b) 
@@ -85,7 +89,7 @@ struct FileState
 };  
 
 /** @brief Singleton that manages the defines available while 
- *  proprocessing files. 
+ *  preprocessing files. 
  */
 class DefineManager
 {
@@ -94,7 +98,8 @@ class DefineManager
   {
     public:
       /** Creates an empty container for defines */
-      DefinesPerFile() : m_defines(257), m_includedFiles(17)
+      DefinesPerFile(DefineManager *parent) 
+         : m_parent(parent), m_defines(257), m_includedFiles(17)
       {
         m_defines.setAutoDelete(TRUE);
       }
@@ -124,24 +129,25 @@ class DefineManager
       }
       void collectDefines(DefineDict *dict,QDict<void> &includeStack);
     private:
+      DefineManager *m_parent;
       DefineDict m_defines;
       QDict<void> m_includedFiles;
   };
 
   public:
     friend class DefinesPerFile;
-    /** Returns a reference to the singleton */
-    static DefineManager &instance()
+
+    /** Creates a new DefineManager object */
+    DefineManager() : m_fileMap(1009), m_contextDefines(1009)
     {
-      if (theInstance==0) theInstance = new DefineManager;
-      return *theInstance;
+      m_fileMap.setAutoDelete(TRUE);
     }
-    /** Deletes the singleton */
-    static void deleteInstance()
+
+    /** Destroys the object */
+    virtual ~DefineManager() 
     {
-      delete theInstance;
-      theInstance = 0;
     }
+
     /** Starts a context in which defines are collected. 
      *  Called at the start of a new file that is preprocessed.
      *  @param fileName the name of the file to process.
@@ -155,7 +161,7 @@ class DefineManager
       if (dpf==0)
       {
        //printf("New file!\n");
-       dpf = new DefinesPerFile;
+       dpf = new DefinesPerFile(this);
        m_fileMap.insert(fileName,dpf);
       }
     }
@@ -180,7 +186,7 @@ class DefineManager
       if (dpf==0)
       {
        //printf("New file!\n");
-       dpf = new DefinesPerFile;
+       dpf = new DefinesPerFile(this);
        m_fileMap.insert(fileName,dpf);
       }
       else
@@ -209,7 +215,7 @@ class DefineManager
       DefinesPerFile *dpf = m_fileMap.find(fileName);
       if (dpf==0)
       {
-       dpf = new DefinesPerFile;
+       dpf = new DefinesPerFile(this);
        m_fileMap.insert(fileName,dpf);
       }
       dpf->addDefine(def);
@@ -226,7 +232,7 @@ class DefineManager
       DefinesPerFile *dpf = m_fileMap.find(fromFileName);
       if (dpf==0)
       {
-       dpf = new DefinesPerFile;
+       dpf = new DefinesPerFile(this);
        m_fileMap.insert(fromFileName,dpf);
       }
       dpf->addInclude(toFileName);
@@ -246,9 +252,8 @@ class DefineManager
     {
       return m_contextDefines;
     }
-  private:
-    static DefineManager *theInstance;
 
+  private:
     /** Helper function to collect all define for a given file */
     void collectDefinesForFile(const char *fileName,DefineDict *dict)
     {
@@ -268,23 +273,10 @@ class DefineManager
       return m_fileMap.find(fileName);
     }
 
-    /** Creates a new DefineManager object */
-    DefineManager() : m_fileMap(1009), m_contextDefines(1009)
-    {
-      m_fileMap.setAutoDelete(TRUE);
-    }
-
-    /** Destroys the object */
-    virtual ~DefineManager() 
-    {
-    }
-
     QDict<DefinesPerFile> m_fileMap;
     DefineDict m_contextDefines;
 };
 
-/** Singleton instance */
-DefineManager *DefineManager::theInstance = 0;
 
 /** Collects all defines for a file and all files that the file includes.
  *  This function will recursively call itself for each file.
@@ -302,7 +294,7 @@ void DefineManager::DefinesPerFile::collectDefines(
     for (di.toFirst();(di.current());++di)
     {
       QCString incFile = di.currentKey();
-      DefinesPerFile *dpf = DefineManager::instance().find(incFile);
+      DefinesPerFile *dpf = m_parent->find(incFile);
       if (dpf && includeStack.find(incFile)==0) 
       {
         //printf("  processing include %s\n",incFile.data());
@@ -332,1878 +324,562 @@ void DefineManager::DefinesPerFile::collectDefines(
  *     scanner's state
  */
 
-static int                g_yyLineNr   = 1;
-static int                g_yyMLines   = 1;
-static int                g_yyColNr   = 1;
-static QCString           g_yyFileName;
-static FileDef           *g_yyFileDef;
-static FileDef           *g_inputFileDef;
-static int                g_ifcount    = 0;
-static QStrList          *g_pathList = 0;  
-static QStack<FileState>  g_includeStack;
-static QDict<int>        *g_argDict;
-static int                g_defArgs = -1;
-static QCString           g_defName;
-static QCString           g_defText;
-static QCString           g_defLitText;
-static QCString           g_defArgsStr;
-static QCString           g_defExtraSpacing;
-static bool               g_defVarArgs;
-static int                g_level;
-static int                g_lastCContext;
-static int                g_lastCPPContext;
-static QArray<int>        g_levelGuard;
-static BufStr            *g_inputBuf;
-static int                g_inputBufPos;
-static BufStr            *g_outputBuf;
-static int                g_roundCount;
-static bool               g_quoteArg;
-static DefineDict        *g_expandedDict;
-static int                g_findDefArgContext;
-static bool               g_expectGuard;
-static QCString           g_guardName;
-static QCString           g_lastGuardName;
-static QCString           g_incName;
-static QCString           g_guardExpr;
-static int                g_curlyCount;
-static bool               g_nospaces; // add extra spaces during macro expansion
-
-static bool               g_macroExpansion; // from the configuration
-static bool               g_expandOnlyPredef; // from the configuration
-static int                g_commentCount;
-static bool               g_insideComment;
-static bool               g_isImported;
-static QCString           g_blockName;
-static int                g_condCtx;
-static bool               g_skip;
-static QStack<CondCtx>    g_condStack;
-static bool               g_insideCS; // C# has simpler preprocessor
-static bool               g_isSource;
-
-static bool               g_lexInit = FALSE;
-static int                g_fenceSize = 0;
-static bool               g_ccomment;
-
-//DefineDict* getGlobalDefineDict() 
-//{
-//  return g_globalDefineDict;
-//}
-
-static void setFileName(const char *name)
-{
-  bool ambig;
-  QFileInfo fi(name);
-  g_yyFileName=fi.absFilePath().utf8();
-  g_yyFileDef=findFileDef(Doxygen::inputNameDict,g_yyFileName,ambig);
-  if (g_yyFileDef==0) // if this is not an input file check if it is an
-                      // include file
-  {
-    g_yyFileDef=findFileDef(Doxygen::includeNameDict,g_yyFileName,ambig);
-  }
-  //printf("setFileName(%s) g_yyFileName=%s g_yyFileDef=%p\n",
-  //    name,g_yyFileName.data(),g_yyFileDef);
-  if (g_yyFileDef && g_yyFileDef->isReference()) g_yyFileDef=0;
-  g_insideCS = getLanguageFromFileName(g_yyFileName)==SrcLangExt_CSharp;
-  g_isSource = guessSection(g_yyFileName);
-}
-
-static void incrLevel()
-{
-  g_level++;
-  g_levelGuard.resize(g_level);
-  g_levelGuard[g_level-1]=FALSE;
-  //printf("%s line %d: incrLevel %d\n",g_yyFileName.data(),g_yyLineNr,g_level);
-}
-
-static void decrLevel()
-{
-  //printf("%s line %d: decrLevel %d\n",g_yyFileName.data(),g_yyLineNr,g_level);
-  if (g_level > 0)
-  {
-    g_level--;
-    g_levelGuard.resize(g_level);
-  }
-  else
-  {
-    warn(g_yyFileName,g_yyLineNr,"More #endif's than #if's found.\n");
-  }
-}
-
-static bool otherCaseDone()
-{
-  if (g_level==0)
-  {
-    warn(g_yyFileName,g_yyLineNr,"Found an #else without a preceding #if.\n");
-    return TRUE;
-  }
-  else
-  {
-    return g_levelGuard[g_level-1];
-  }
-}
-
-static void setCaseDone(bool value)
+struct preYY_state
 {
-  g_levelGuard[g_level-1]=value;
-}
-
-static QDict<void> g_allIncludes(10009);
+  preYY_state() :    allIncludes(10009) {}
+  int                yyLineNr   = 1;
+  int                yyMLines   = 1;
+  int                yyColNr   = 1;
+  QCString           yyFileName;
+  FileDef           *yyFileDef;
+  FileDef           *inputFileDef;
+  int                ifcount    = 0;
+  QStrList          *pathList = 0;
+  QStack<FileState>  includeStack;
+  QDict<int>        *argDict = 0;
+  int                defArgs = -1;
+  QCString           defName;
+  QCString           defText;
+  QCString           defLitText;
+  QCString           defArgsStr;
+  QCString           defExtraSpacing;
+  bool               defVarArgs;
+  int                level;
+  int                lastCContext;
+  int                lastCPPContext;
+  QArray<int>        levelGuard;
+  BufStr            *inputBuf = 0;
+  int                inputBufPos;
+  BufStr            *outputBuf = 0;
+  int                roundCount;
+  bool               quoteArg;
+  DefineDict        *expandedDict = 0;
+  int                findDefArgContext;
+  bool               expectGuard;
+  QCString           guardName;
+  QCString           lastGuardName;
+  QCString           incName;
+  QCString           guardExpr;
+  int                curlyCount;
+  bool               nospaces; // add extra spaces during macro expansion
+
+  bool               macroExpansion; // from the configuration
+  bool               expandOnlyPredef; // from the configuration
+  int                commentCount;
+  bool               insideComment;
+  bool               isImported;
+  QCString           blockName;
+  int                condCtx;
+  bool               skip;
+  QStack<CondCtx>    condStack;
+  bool               insideCS; // C# has simpler preprocessor
+  bool               isSource;
+
+  int                fenceSize = 0;
+  bool               ccomment;
+  QCString           delimiter;
+  QDict<void>        allIncludes;
+  QDict<void>        expansionDict;
+  DefineManager      defineManager;
+  ConstExpressionParser constExpParser;
+};
 
-static FileState *checkAndOpenFile(const QCString &fileName,bool &alreadyIncluded)
-{
-  alreadyIncluded = FALSE;
-  FileState *fs = 0;
-  //printf("checkAndOpenFile(%s)\n",fileName.data());
-  QFileInfo fi(fileName);
-  if (fi.exists() && fi.isFile())
-  {
-    static QStrList &exclPatterns = Config_getList(EXCLUDE_PATTERNS);
-    if (patternMatch(fi,&exclPatterns)) return 0;
+// stateless functions
+static QCString escapeAt(const char *text);
+static QCString extractTrailingComment(const char *s);
+static char resolveTrigraph(char c);
+
+// statefull functions
+static inline void outputArray(yyscan_t yyscanner,const char *a,int len);
+static inline void  outputChar(yyscan_t yyscanner,char c);
+static QCString    expandMacro(yyscan_t yyscanner,const QCString &name);
+static void    readIncludeFile(yyscan_t yyscanner,const QCString &inc);
+static void          incrLevel(yyscan_t yyscanner);
+static void          decrLevel(yyscan_t yyscanner);
+static void        setCaseDone(yyscan_t yyscanner,bool value);
+static bool      otherCaseDone(yyscan_t yyscanner);
+static bool  computeExpression(yyscan_t yyscanner,const QCString &expr);
+static void   startCondSection(yyscan_t yyscanner,const char *sectId);
+static void     endCondSection(yyscan_t yyscanner);
+static void          addDefine(yyscan_t yyscanner);
+static Define *      newDefine(yyscan_t yyscanner);
+static void        setFileName(yyscan_t yyscanner,const char *name);
+static int              yyread(yyscan_t yyscanner,char *buf,int max_size);
 
-    QCString absName = fi.absFilePath().utf8();
+/* ----------------------------------------------------------------- */
 
-    // global guard
-    if (g_curlyCount==0) // not #include inside { ... }
-    {
-      if (g_allIncludes.find(absName)!=0)
-      {
-        alreadyIncluded = TRUE;
-        //printf("  already included 1\n");
-        return 0; // already done
-      }
-      g_allIncludes.insert(absName,(void *)0x8);
-    }
-    // check include stack for absName
+#undef  YY_INPUT
+#define YY_INPUT(buf,result,max_size) result=yyread(yyscanner,buf,max_size);
 
-    QStack<FileState> tmpStack;
-    g_includeStack.setAutoDelete(FALSE);
-    while ((fs=g_includeStack.pop()))
-    {
-      if (fs->fileName==absName) alreadyIncluded=TRUE;
-      tmpStack.push(fs);
-    }
-    while ((fs=tmpStack.pop()))
-    {
-      g_includeStack.push(fs);
-    }
-    g_includeStack.setAutoDelete(TRUE);
+/* ----------------------------------------------------------------- */
 
-    if (alreadyIncluded)
-    {
-      //printf("  already included 2\n");
-      return 0;
-    }
-    //printf("#include %s\n",absName.data());
+%}
 
-    fs = new FileState(fi.size()+4096);
-    alreadyIncluded = FALSE;
-    if (!readInputFile(absName,fs->fileBuf))
-    { // error
-      //printf("  error reading\n");
-      delete fs;
-      fs=0;
-    }
-    else
-    {
-      fs->oldFileBuf    = g_inputBuf;
-      fs->oldFileBufPos = g_inputBufPos;
-    }
-  }
-  return fs;
-}
+ID     [a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]*
+B       [ \t]
+BN     [ \t\r\n]
+RAWBEGIN  (u|U|L|u8)?R\"[^ \t\(\)\\]{0,16}"("
+RAWEND    ")"[^ \t\(\)\\]{0,16}\"
+CHARLIT   (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
 
-static FileState *findFile(const char *fileName,bool localInclude,bool &alreadyIncluded)
-{
-  //printf("** findFile(%s,%d) g_yyFileName=%s\n",fileName,localInclude,g_yyFileName.data());
-  if (portable_isAbsolutePath(fileName))
-  {
-    FileState *fs = checkAndOpenFile(fileName,alreadyIncluded);
-    if (fs)
-    {
-      setFileName(fileName);
-      g_yyLineNr=1;
-      return fs;
-    }
-    else if (alreadyIncluded)
-    {
-      return 0;
-    }
-  }
-  if (localInclude && !g_yyFileName.isEmpty())
-  {
-    QFileInfo fi(g_yyFileName);
-    if (fi.exists())
-    {
-      QCString absName = QCString(fi.dirPath(TRUE).data())+"/"+fileName;
-      FileState *fs = checkAndOpenFile(absName,alreadyIncluded);
-      if (fs)
-      {
-       setFileName(absName);
-       g_yyLineNr=1;
-       return fs;
-      }
-      else if (alreadyIncluded)
-      {
-       return 0;
-      }
-    }
-  }
-  if (g_pathList==0) 
-  {
-    return 0;
-  }
-  char *s=g_pathList->first();
-  while (s)
-  {
-    QCString absName = (QCString)s+"/"+fileName;
-    //printf("  Looking for %s in %s\n",fileName,s);
-    FileState *fs = checkAndOpenFile(absName,alreadyIncluded);
-    if (fs)
-    {
-      setFileName(absName);
-      g_yyLineNr=1;
-      //printf("  -> found it\n");
-      return fs;
-    }
-    else if (alreadyIncluded)
-    {
-      return 0;
-    }
+%option noyywrap
 
-    s=g_pathList->next();
-  } 
-  return 0;
-}
+%x      Start
+%x     Command
+%x     SkipCommand
+%x     SkipLine
+%x     SkipString
+%x     CopyLine
+%x     CopyString
+%x     CopyStringCs
+%x     CopyStringFtn
+%x     CopyStringFtnDouble
+%x      CopyRawString
+%x      Include
+%x      IncludeID
+%x      EndImport
+%x     DefName
+%x     DefineArg
+%x     DefineText
+%x      SkipCPPBlock
+%x      Ifdef
+%x      Ifndef
+%x     SkipCComment
+%x     ArgCopyCComment
+%x     CopyCComment
+%x     SkipVerbatim
+%x     SkipCPPComment
+%x     RemoveCComment
+%x     RemoveCPPComment
+%x     Guard
+%x     DefinedExpr1
+%x     DefinedExpr2
+%x     SkipDoubleQuote
+%x     SkipSingleQuote
+%x     UndefName
+%x     IgnoreLine
+%x     FindDefineArgs
+%x     ReadString
+%x     CondLineC
+%x     CondLineCpp
+%x      SkipCond
 
-static QCString extractTrailingComment(const char *s)
-{
-  if (s==0) return "";
-  int i=strlen(s)-1;
-  while (i>=0)
-  {
-    char c=s[i];
-    switch (c)
-    {
-      case '/':
-       {
-         i--;
-         if (i>=0 && s[i]=='*') // end of a comment block
-         {
-           i--;
-           while (i>0 && !(s[i-1]=='/' && s[i]=='*')) i--;
-           if (i==0) 
-           {
-             i++;
-           }
-           // only /*!< or /**< are treated as a comment for the macro name,
-           // otherwise the comment is treated as part of the macro definition
-           return ((s[i+1]=='*' || s[i+1]=='!') && s[i+2]=='<') ? &s[i-1] : ""; 
-         }
-         else
-         {
-           return "";
-         }
-       } 
-       break;
-       // whitespace or line-continuation
-      case ' ':
-      case '\t': 
-      case '\r':
-      case '\n':
-      case '\\':
-       break;
-      default:
-       return "";
-    }
-    i--;
-  }
-  return "";
-}
+%%
 
-static int getNextChar(const QCString &expr,QCString *rest,uint &pos);
-static int getCurrentChar(const QCString &expr,QCString *rest,uint pos);
-static void unputChar(const QCString &expr,QCString *rest,uint &pos,char c);
-static void expandExpression(QCString &expr,QCString *rest,int pos);
+<*>\x06                                        
+<*>\x00
+<*>\r
+<*>"??"[=/'()!<>-]                     { // Trigraph
+                                         unput(resolveTrigraph(yytext[2]));
+                                       }
+<Start>^{B}*"#"                                { BEGIN(Command); yyextra->yyColNr+=yyleng; yyextra->yyMLines=0;}
+<Start>^{B}*/[^#]                      {
+                                         outputArray(yyscanner,yytext,(int)yyleng);
+                                         BEGIN(CopyLine); 
+                                       }
+<Start>^{B}*[a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]+{B}*"("[^\)\n]*")"/{BN}{1,10}*[:{] { // constructors?
+                                         int i;
+                                         for (i=(int)yyleng-1;i>=0;i--)
+                                         {
+                                           unput(yytext[i]);
+                                         }
+                                         BEGIN(CopyLine);
+                                        }
+<Start>^{B}*[_A-Z][_A-Z0-9]+{B}*"("[^\(\)\n]*"("[^\)\n]*")"[^\)\n]*")"{B}*\n | // function list macro with one (...) argument, e.g. for K_GLOBAL_STATIC_WITH_ARGS
+<Start>^{B}*[_A-Z][_A-Z0-9]+{B}*"("[^\)\n]*")"{B}*\n { // function like macro
+                                         bool skipFuncMacros = Config_getBool(SKIP_FUNCTION_MACROS);
+                                         QCString name(yytext);
+                                         name=name.left(name.find('(')).stripWhiteSpace();
 
-static QCString stringize(const QCString &s)
-{
-  QCString result;
-  uint i=0;
-  bool inString=FALSE;
-  bool inChar=FALSE;
-  char c,pc;
-  while (i<s.length())
-  {
-    if (!inString && !inChar)
-    {
-      while (i<s.length() && !inString && !inChar)
-      {
-       c=s.at(i++);
-       if (c=='"')
-       {
-         result+="\\\"";
-         inString=TRUE;
-       }
-       else if (c=='\'')
-       {
-         result+=c;
-         inChar=TRUE;
-       }
-       else
-       {
-         result+=c;
-       }
-      }
-    }
-    else if (inChar)
-    {
-      while (i<s.length() && inChar)
-      {
-       c=s.at(i++);
-       if (c=='\'')
-       {
-         result+='\'';
-         inChar=FALSE;
-       }
-       else if (c=='\\')
-       {
-         result+="\\\\";
-       }
-       else
-       {
-         result+=c;
-       }
-      }
-    }
-    else
-    {
-      pc=0;
-      while (i<s.length() && inString)
-      {
-       char c=s.at(i++);
-       if (c=='"') 
-       {
-         result+="\\\"";
-         inString= pc=='\\';
-       }
-       else if (c=='\\')
-         result+="\\\\";
-       else
-         result+=c;
-       pc=c;
-      }
-    }
-  }
-  //printf("stringize '%s'->'%s'\n",s.data(),result.data());
-  return result;
-}
-
-/*! Execute all ## operators in expr. 
- * If the macro name before or after the operator contains a no-rescan 
- * marker (@-) then this is removed (before the concatenated macro name
- * may be expanded again.
- */
-static void processConcatOperators(QCString &expr)
-{
-  //printf("processConcatOperators: in='%s'\n",expr.data());
-  QRegExp r("[ \\t\\n]*##[ \\t\\n]*"); 
-  int l,n,i=0;
-  if (expr.isEmpty()) return;
-  while ((n=r.match(expr,i,&l))!=-1)
-  {
-    //printf("Match: '%s'\n",expr.data()+i);
-    if (n+l+1<(int)expr.length() && expr.at(n+l)=='@' && expr.at(n+l+1)=='-')
-    {
-      // remove no-rescan marker after ID
-      l+=2;
-    }
-    //printf("found '%s'\n",expr.mid(n,l).data());
-    // remove the ## operator and the surrounding whitespace
-    expr=expr.left(n)+expr.right(expr.length()-n-l);
-    int k=n-1;
-    while (k>=0 && isId(expr.at(k))) k--; 
-    if (k>0 && expr.at(k)=='-' && expr.at(k-1)=='@')
-    {
-      // remove no-rescan marker before ID
-      expr=expr.left(k-1)+expr.right(expr.length()-k-1);
-      n-=2;
-    }
-    i=n;
-  }
-  //printf("processConcatOperators: out='%s'\n",expr.data());
-}
-
-static void yyunput (int c,char *buf_ptr  );
-static void returnCharToStream(char c)
-{
-  unput(c);
-}
-
-static inline void addTillEndOfString(const QCString &expr,QCString *rest,
-                                       uint &pos,char term,QCString &arg)
-{
-  int cc;
-  while ((cc=getNextChar(expr,rest,pos))!=EOF && cc!=0)
-  {
-    if (cc=='\\') arg+=(char)cc,cc=getNextChar(expr,rest,pos);
-    else if (cc==term) return;
-    arg+=(char)cc;
-  }
-}
-
-/*! replaces the function macro \a def whose argument list starts at
- * \a pos in expression \a expr. 
- * Notice that this routine may scan beyond the \a expr string if needed.
- * In that case the characters will be read from the input file.
- * The replacement string will be returned in \a result and the 
- * length of the (unexpanded) argument list is stored in \a len.
- */ 
-static bool replaceFunctionMacro(const QCString &expr,QCString *rest,int pos,int &len,const Define *def,QCString &result)
-{
-  //printf("replaceFunctionMacro(expr=%s,rest=%s,pos=%d,def=%s) level=%d\n",expr.data(),rest ? rest->data() : 0,pos,def->name.data(),g_level);
-  uint j=pos;
-  len=0;
-  result.resize(0);
-  int cc;
-  while ((cc=getCurrentChar(expr,rest,j))!=EOF && isspace(cc)) 
-  { 
-    len++; 
-    getNextChar(expr,rest,j); 
-  }
-  if (cc!='(') 
-  { 
-    unputChar(expr,rest,j,' '); 
-    return FALSE; 
-  }
-  getNextChar(expr,rest,j); // eat the '(' character
-
-  QDict<QCString> argTable;  // list of arguments
-  argTable.setAutoDelete(TRUE);
-  QCString arg;
-  int argCount=0;
-  bool done=FALSE;
-  
-  // PHASE 1: read the macro arguments
-  if (def->nargs==0)
-  {
-    while ((cc=getNextChar(expr,rest,j))!=EOF && cc!=0)
-    {
-      char c = (char)cc;
-      if (c==')') break;
-    }
-  }
-  else
-  {
-    while (!done && (argCount<def->nargs || def->varArgs) && 
-       ((cc=getNextChar(expr,rest,j))!=EOF && cc!=0)
-         )
-    {
-      char c=(char)cc;
-      if (c=='(') // argument is a function => search for matching )
-      {
-       int level=1;
-       arg+=c;
-       //char term='\0';
-       while ((cc=getNextChar(expr,rest,j))!=EOF && cc!=0)
-       {
-         char c=(char)cc;
-         //printf("processing %c: term=%c (%d)\n",c,term,term);
-         if (c=='\'' || c=='\"') // skip ('s and )'s inside strings
-         {
-           arg+=c;
-           addTillEndOfString(expr,rest,j,c,arg);
-         }
-         if (c==')')
-         {
-           level--;
-           arg+=c;
-           if (level==0) break;
-         }
-         else if (c=='(')
-         {
-           level++;
-           arg+=c;
-         }
-         else
-           arg+=c;
-       }
-      }
-      else if (c==')' || c==',') // last or next argument found
-      {
-       if (c==',' && argCount==def->nargs-1 && def->varArgs)
-       {
-         arg=arg.stripWhiteSpace();
-         arg+=',';
-       }
-       else
-       {
-         QCString argKey;
-         argKey.sprintf("@%d",argCount++); // key name
-         arg=arg.stripWhiteSpace();
-         // add argument to the lookup table
-         argTable.insert(argKey, new QCString(arg));
-         arg.resize(0);
-         if (c==')') // end of the argument list
-         {
-           done=TRUE;
-         }
-       }
-      } 
-      else if (c=='\"') // append literal strings
-      {
-       arg+=c; 
-       bool found=FALSE;
-       while (!found && (cc=getNextChar(expr,rest,j))!=EOF && cc!=0)
-       {
-         found = cc=='"';
-         if (cc=='\\')
-         {
-           c=(char)cc;   
-           arg+=c;
-           if ((cc=getNextChar(expr,rest,j))==EOF || cc==0) break;
-         }
-         c=(char)cc;     
-         arg+=c;
-       }
-      }
-      else if (c=='\'') // append literal characters
-      {
-       arg+=c;
-       bool found=FALSE;
-       while (!found && (cc=getNextChar(expr,rest,j))!=EOF && cc!=0)
-       {
-         found = cc=='\'';
-         if (cc=='\\')
-         {
-           c=(char)cc;   
-           arg+=c;
-           if ((cc=getNextChar(expr,rest,j))==EOF || cc==0) break;
-         }
-         c=(char)cc;
-         arg+=c;
-       }
-      }            
-      else if (c=='/') // possible start of a comment
-      {
-        char prevChar = '\0';
-        arg+=c;
-        if ((cc=getCurrentChar(expr,rest,j)) == '*') // we have a comment
-        {
-          while ((cc=getNextChar(expr,rest,j))!=EOF && cc!=0)
-          {
-            c=(char)cc;
-            arg+=c;
-            if (c == '/' && prevChar == '*') break; // we have an end of comment
-            prevChar = c;
-          }
-        }
-      }
-      else // append other characters
-      {
-       arg+=c;
-      }
-    }
-  }
-
-  // PHASE 2: apply the macro function
-  if (argCount==def->nargs || // same number of arguments
-      (argCount>=def->nargs-1 && def->varArgs)) // variadic macro with at least as many
-                                                // params as the non-variadic part (see bug731985)
-  {
-    uint k=0;
-    // substitution of all formal arguments
-    QCString resExpr;
-    const QCString d=def->definition.stripWhiteSpace();
-    //printf("Macro definition: %s\n",d.data());
-    bool inString=FALSE;
-    while (k<d.length())
-    {
-      if (d.at(k)=='@') // maybe a marker, otherwise an escaped @
-      {
-       if (d.at(k+1)=='@') // escaped @ => copy it (is unescaped later)
-       {
-         k+=2;
-         resExpr+="@@"; // we unescape these later
-       }
-       else if (d.at(k+1)=='-') // no-rescan marker
-       {
-         k+=2;
-         resExpr+="@-";
-       }
-       else // argument marker => read the argument number
-       {
-         QCString key="@";
-         QCString *subst=0;
-         bool hash=FALSE;
-         int l=k-1;
-         // search for ## backward
-         if (l>=0 && d.at(l)=='"') l--;
-         while (l>=0 && d.at(l)==' ') l--;
-         if (l>0 && d.at(l)=='#' && d.at(l-1)=='#') hash=TRUE;
-         k++;
-         // scan the number
-         while (k<d.length() && d.at(k)>='0' && d.at(k)<='9') key+=d.at(k++);
-         if (!hash) 
-         {
-           // search for ## forward
-           l=k;
-           if (l<(int)d.length() && d.at(l)=='"') l++;
-           while (l<(int)d.length() && d.at(l)==' ') l++;
-           if (l<(int)d.length()-1 && d.at(l)=='#' && d.at(l+1)=='#') hash=TRUE;
-         }
-         //printf("request key %s result %s\n",key.data(),argTable[key]->data());
-         if (key.length()>1 && (subst=argTable[key])) 
-         {
-           QCString substArg=*subst;
-           //printf("substArg='%s'\n",substArg.data());
-           // only if no ## operator is before or after the argument
-           // marker we do macro expansion.
-           if (!hash) expandExpression(substArg,0,0);
-           if (inString)
-           {
-             //printf("'%s'=stringize('%s')\n",stringize(*subst).data(),subst->data());
-
-             // if the marker is inside a string (because a # was put 
-             // before the macro name) we must escape " and \ characters
-             resExpr+=stringize(substArg);
-           }
-           else
-           {
-             if (hash && substArg.isEmpty())
-             {
-               resExpr+="@E"; // empty argument will be remove later on
-             }
-             else if (g_nospaces)
-             {
-               resExpr+=substArg;
-             }
-             else
-             {
-               resExpr+=" "+substArg+" ";
-             }
-           }
-         }
-       }
-      }
-      else // no marker, just copy
-      {
-       if (!inString && d.at(k)=='\"') 
-       {
-         inString=TRUE; // entering a literal string
-       }
-       else if (inString && d.at(k)=='\"' && (d.at(k-1)!='\\' || d.at(k-2)=='\\'))
-       {
-         inString=FALSE; // leaving a literal string
-       }
-       resExpr+=d.at(k++);
-      }
-    }
-    len=j-pos;
-    result=resExpr;
-    //printf("result after substitution '%s' expr='%s'\n",
-    //       result.data(),expr.mid(pos,len).data());
-    return TRUE;
-  }
-  return FALSE;
-}
-
-
-/*! returns the next identifier in string \a expr by starting at position \a p.
- * The position of the identifier is returned (or -1 if nothing is found)
- * and \a l is its length. Any quoted strings are skipping during the search.
- */
-static int getNextId(const QCString &expr,int p,int *l)
-{
-  int n;
-  while (p<(int)expr.length())
-  {
-    char c=expr.at(p++);
-    if (isdigit(c)) // skip number
-    {
-      while (p<(int)expr.length() && isId(expr.at(p))) p++;
-    }
-    else if (isalpha(c) || c=='_') // read id
-    {
-      n=p-1;
-      while (p<(int)expr.length() && isId(expr.at(p))) p++;
-      *l=p-n;
-      return n; 
-    }
-    else if (c=='"') // skip string
-    {
-      char ppc=0,pc=c;
-      if (p<(int)expr.length()) c=expr.at(p);
-      while (p<(int)expr.length() && (c!='"' || (pc=='\\' && ppc!='\\'))) 
-       // continue as long as no " is found, but ignoring \", but not \\"
-      {
-       ppc=pc;
-       pc=c;
-       c=expr.at(p);
-       p++;
-      }
-      if (p<(int)expr.length()) ++p; // skip closing quote
-    }
-    else if (c=='/') // skip C Comment
-    {
-      //printf("Found C comment at p=%d\n",p);
-      char pc=c;
-      if (p<(int)expr.length()) 
-      {
-       c=expr.at(p);
-        if (c=='*')  // Start of C comment
-        { 
-         p++;
-         while (p<(int)expr.length() && !(pc=='*' && c=='/'))
-         {
-           pc=c;
-           c=expr.at(p++);
-         }
-        }
-      }
-      //printf("Found end of C comment at p=%d\n",p);
-    }
-  }
-  return -1;
-}
-
-/*! performs recursive macro expansion on the string \a expr
- *  starting at position \a pos.
- *  May read additional characters from the input while re-scanning!
- *  If \a expandAll is \c TRUE then all macros in the expression are
- *  expanded, otherwise only the first is expanded.
- */
-static void expandExpression(QCString &expr,QCString *rest,int pos)
-{
-  //printf("expandExpression(%s,%s)\n",expr.data(),rest ? rest->data() : 0);
-  QCString macroName;
-  QCString expMacro;
-  bool definedTest=FALSE;
-  int i=pos,l,p,len;
-  while ((p=getNextId(expr,i,&l))!=-1) // search for an macro name
-  {
-    bool replaced=FALSE;
-    macroName=expr.mid(p,l);
-    //printf("macroName=%s\n",macroName.data());
-    if (p<2 || !(expr.at(p-2)=='@' && expr.at(p-1)=='-')) // no-rescan marker?
-    {
-      if (g_expandedDict->find(macroName)==0) // expand macro
-      {
-       Define *def=DefineManager::instance().isDefined(macroName);
-        if (macroName=="defined")
-        {
-         //printf("found defined inside macro definition '%s'\n",expr.right(expr.length()-p).data());
-         definedTest=TRUE;
-        }
-       else if (definedTest) // macro name was found after defined 
-       {
-         if (def) expMacro = " 1 "; else expMacro = " 0 ";
-         replaced=TRUE;
-         len=l;
-         definedTest=FALSE;
-       }
-       else if (def && def->nargs==-1) // simple macro
-       {
-         // substitute the definition of the macro
-         //printf("macro '%s'->'%s'\n",macroName.data(),def->definition.data());
-         if (g_nospaces)
-         {
-           expMacro=def->definition.stripWhiteSpace();
-         }
-         else
-         {
-           expMacro=" "+def->definition.stripWhiteSpace()+" ";
-         }
-         //expMacro=def->definition.stripWhiteSpace();
-         replaced=TRUE;
-         len=l;
-         //printf("simple macro expansion='%s'->'%s'\n",macroName.data(),expMacro.data());
-       }
-       else if (def && def->nargs>=0) // function macro
-       {
-         replaced=replaceFunctionMacro(expr,rest,p+l,len,def,expMacro);
-         len+=l;
-       }
-
-       if (replaced) // expand the macro and rescan the expression
-       {
-         //printf("replacing '%s'->'%s'\n",expr.mid(p,len).data(),expMacro.data());
-         QCString resultExpr=expMacro;
-         QCString restExpr=expr.right(expr.length()-len-p);
-         processConcatOperators(resultExpr);
-         if (def && !def->nonRecursive)
-         {
-           g_expandedDict->insert(macroName,def);
-           expandExpression(resultExpr,&restExpr,0);
-           g_expandedDict->remove(macroName);
-         }
-         expr=expr.left(p)+resultExpr+restExpr;
-         i=p;
-         //printf("new expression: %s\n",expr.data());
-       }
-       else // move to the next macro name
-       {
-         //printf("moving to the next macro old=%d new=%d\n",i,p+l);
-         i=p+l;
-       }
-      }
-      else // move to the next macro name
-      {
-       expr=expr.left(p)+"@-"+expr.right(expr.length()-p);
-       //printf("macro already expanded, moving to the next macro expr=%s\n",expr.data());
-       i=p+l+2;
-       //i=p+l;
-      }
-    }
-    else // no re-scan marker found, skip the macro name
-    {
-      //printf("skipping marked macro\n");
-      i=p+l;
-    }
-  }
-}
-
-/*! @brief Process string or character literal.
- *
- * \a inputStr should point to the start of a string or character literal.
- * the routine will return a pointer to just after the end of the literal
- * the character making up the literal will be added to \a result.
- */
-const char *processUntilMatchingTerminator(const char *inputStr,QCString &result)
-{
-  if (inputStr==0) return inputStr;
-  char term = *inputStr; // capture start character of the literal
-  if (term!='\'' && term!='"') return inputStr; // not a valid literal
-  char c=term;
-  // output start character
-  result+=c;
-  inputStr++;
-  while ((c=*inputStr)) // while inside the literal
-  {
-    if (c==term) // found end marker of the literal
-    {
-      // output end character and stop
-      result+=c;
-      inputStr++;
-      break;
-    }
-    else if (c=='\\') // escaped character, process next character
-                      // as well without checking for end marker.
-    {
-      result+=c;
-      inputStr++;
-      c=*inputStr;
-      if (c==0) break; // unexpected end of string after escape character
-    }
-    result+=c;
-    inputStr++;
-  }
-  return inputStr;
-}
-
-/*! replaces all occurrences of @@@@ in \a s by @@
- *  and removes all occurrences of @@E.
- *  All identifiers found are replaced by 0L
- */
-QCString removeIdsAndMarkers(const char *s)
-{
-  //printf("removeIdsAndMarkers(%s)\n",s);
-  const char *p=s;
-  char c;
-  bool inNum=FALSE;
-  QCString result;
-  if (p)
-  {
-    while ((c=*p))
-    {
-      if (c=='@') // replace @@ with @ and remove @E
-      {
-       if (*(p+1)=='@')
-       {
-         result+=c; 
-       }
-       else if (*(p+1)=='E')
-       {
-         // skip
-       }
-       p+=2;
-      }
-      else if (isdigit(c)) // number
-      {
-       result+=c;
-       p++;
-        inNum=TRUE;    
-      }
-      else if (c=='\'') // quoted character
-      {
-        p = processUntilMatchingTerminator(p,result);
-      }
-      else if (c=='d' && !inNum) // identifier starting with a 'd'
-      {
-       if (qstrncmp(p,"defined ",8)==0 || qstrncmp(p,"defined(",8)==0) 
-                  // defined keyword
-       {
-         p+=7; // skip defined
-       }
-       else
-       {
-         result+="0L";
-         p++;
-         while ((c=*p) && isId(c)) p++;
-       }
-      }
-      else if ((isalpha(c) || c=='_') && !inNum) // replace identifier with 0L
-      {
-       result+="0L";
-       p++;
-       while ((c=*p) && isId(c)) p++;
-       while ((c=*p) && isspace((uchar)c)) p++;
-       if (*p=='(') // undefined function macro
-       {
-         p++;
-         int count=1;
-         while ((c=*p++))
-         {
-           if (c=='(') count++;
-           else if (c==')')
-           {
-             count--;
-             if (count==0) break;
-           }
-           else if (c=='/')
-           {
-             char pc=c;
-             c=*++p;
-             if (c=='*') // start of C comment
-             {
-               while (*p && !(pc=='*' && c=='/')) // search end of comment
-               {
-                 pc=c;
-                 c=*++p;
-               }
-               p++;
-             }
-           }
-         }
-       }
-      }
-      else if (c=='/') // skip C comments
-      {
-       char pc=c;
-       c=*++p;
-       if (c=='*') // start of C comment
-       { 
-         while (*p && !(pc=='*' && c=='/')) // search end of comment
-         {
-           pc=c;
-           c=*++p;
-         }
-         p++;
-       }
-       else // oops, not comment but division
-       {
-         result+=pc;
-         goto nextChar;
-       }
-      }
-      else 
-      {
-nextChar:
-       result+=c;
-       char lc=tolower(c);
-       if (!isId(lc) && lc!='.' /*&& lc!='-' && lc!='+'*/) inNum=FALSE;
-       p++;
-      }
-    }
-  }
-  //printf("removeIdsAndMarkers(%s)=%s\n",s,result.data());
-  return result;
-}
-
-/*! replaces all occurrences of @@ in \a s by @
- *  \par assumption: 
- *   \a s only contains pairs of @@'s
- */
-QCString removeMarkers(const char *s)
-{
-  const char *p=s;
-  char c;
-  QCString result;
-  if (p)
-  {
-    while ((c=*p))
-    {
-      switch(c)
-      {
-       case '@': // replace @@ with @
-         {
-           if (*(p+1)=='@')
-           {
-             result+=c; 
-           }
-           p+=2;
-         }
-         break;
-       case '/': // skip C comments
-         {
-           result+=c;
-           char pc=c;
-           c=*++p;
-           if (c=='*') // start of C comment
-           { 
-             while (*p && !(pc=='*' && c=='/')) // search end of comment
-             {
-               if (*p=='@' && *(p+1)=='@') 
-                 result+=c,p++;
-               else 
-                 result+=c;
-               pc=c;
-               c=*++p;
-             }
-             if (*p) result+=c,p++;
-           }
-         }
-         break;
-       case '"': // skip string literals
-       case '\'': // skip char literals
-          p = processUntilMatchingTerminator(p,result);
-         break;
-       default:
-         {
-           result+=c;
-           p++;
-         }
-         break;
-      }
-    }
-  }
-  //printf("RemoveMarkers(%s)=%s\n",s,result.data());
-  return result;
-}
-
-/*! compute the value of the expression in string \a expr.
- *  If needed the function may read additional characters from the input.
- */
-
-bool computeExpression(const QCString &expr)
-{
-  QCString e=expr;
-  expandExpression(e,0,0);
-  //printf("after expansion '%s'\n",e.data());
-  e = removeIdsAndMarkers(e);
-  if (e.isEmpty()) return FALSE;
-  //printf("parsing '%s'\n",e.data());
-  return parseconstexp(g_yyFileName,g_yyLineNr,e);
-}
-
-/*! expands the macro definition in \a name
- *  If needed the function may read additional characters from the input
- */
-
-QCString expandMacro(const QCString &name)
-{
-  QCString n=name;
-  expandExpression(n,0,0);
-  n=removeMarkers(n);
-  //printf("expandMacro '%s'->'%s'\n",name.data(),n.data());
-  return n;
-}
-
-Define *newDefine()
-{
-  Define *def=new Define;
-  def->name       = g_defName;
-  def->definition = g_defText.stripWhiteSpace();
-  def->nargs      = g_defArgs;
-  def->fileName   = g_yyFileName; 
-  def->fileDef    = g_yyFileDef;
-  def->lineNr     = g_yyLineNr-g_yyMLines;
-  def->columnNr   = g_yyColNr;
-  def->varArgs    = g_defVarArgs;
-  //printf("newDefine: %s %s file: %s\n",def->name.data(),def->definition.data(),
-  //    def->fileDef ? def->fileDef->name().data() : def->fileName.data());
-  //printf("newDefine: '%s'->'%s'\n",def->name.data(),def->definition.data());
-  if (!def->name.isEmpty() && Doxygen::expandAsDefinedDict[def->name])
-  {
-    def->isPredefined=TRUE;
-  }
-  return def;
-}
-
-void addDefine()
-{
-  if (g_skip) return; // do not add this define as it is inside a 
-                      // conditional section (cond command) that is disabled.
-  if (!Doxygen::gatherDefines) return;
-
-  //printf("addDefine %s %s\n",g_defName.data(),g_defArgsStr.data());
-  //ArgumentList *al = new ArgumentList;
-  //stringToArgumentList(g_defArgsStr,al);
-  MemberDef *md=createMemberDef(
-      g_yyFileName,g_yyLineNr-g_yyMLines,g_yyColNr,
-      "#define",g_defName,g_defArgsStr,0,
-      Public,Normal,FALSE,Member,MemberType_Define,0,0,"");
-  if (!g_defArgsStr.isEmpty())
-  {
-    ArgumentList *argList = new ArgumentList;
-    //printf("addDefine() g_defName='%s' g_defArgsStr='%s'\n",g_defName.data(),g_defArgsStr.data());
-    stringToArgumentList(g_defArgsStr,argList);
-    md->setArgumentList(argList);
-  }
-  //printf("Setting initializer for '%s' to '%s'\n",g_defName.data(),g_defText.data());
-  int l=g_defLitText.find('\n');
-  if (l>0 && g_defLitText.left(l).stripWhiteSpace()=="\\")
-  {
-    // strip first line if it only contains a slash
-    g_defLitText = g_defLitText.right(g_defLitText.length()-l-1);
-  }
-  else if (l>0)
-  {
-    // align the items on the first line with the items on the second line
-    int k=l+1;
-    const char *p=g_defLitText.data()+k;
-    char c;
-    while ((c=*p++) && (c==' ' || c=='\t')) k++;
-    g_defLitText=g_defLitText.mid(l+1,k-l-1)+g_defLitText.stripWhiteSpace();
-  }
-  md->setInitializer(g_defLitText.stripWhiteSpace());
-
-  //printf("pre.l: md->setFileDef(%p)\n",g_inputFileDef);
-  md->setFileDef(g_inputFileDef);
-  md->setDefinition("#define "+g_defName);
-
-  MemberName *mn=Doxygen::functionNameSDict->find(g_defName);
-  if (mn==0)
-  {
-    mn = new MemberName(g_defName);
-    Doxygen::functionNameSDict->append(g_defName,mn);
-  }
-  mn->append(md);
-  if (g_yyFileDef) 
-  {
-    g_yyFileDef->insertMember(md);
-  }
-
-  //Define *d;
-  //if ((d=defineDict[g_defName])==0) defineDict.insert(g_defName,newDefine()); 
-}
-
-static inline void outputChar(char c)
-{
-  if (g_includeStack.isEmpty() || g_curlyCount>0) g_outputBuf->addChar(c);
-}
-
-static inline void outputArray(const char *a,int len)
-{
-  if (g_includeStack.isEmpty() || g_curlyCount>0) g_outputBuf->addArray(a,len);
-}
-
-static void readIncludeFile(const QCString &inc)
-{
-  static bool searchIncludes = Config_getBool(SEARCH_INCLUDES);
-  uint i=0;
-
-  // find the start of the include file name
-  while (i<inc.length() &&
-         (inc.at(i)==' ' || inc.at(i)=='"' || inc.at(i)=='<')
-        ) i++;
-  uint s=i;
-
-  // was it a local include?
-  bool localInclude = s>0 && inc.at(s-1)=='"';
-
-  // find the end of the include file name
-  while (i<inc.length() && inc.at(i)!='"' && inc.at(i)!='>') i++;
-
-  if (s<inc.length() && i>s) // valid include file name found
-  {
-    // extract include path+name
-    QCString incFileName=inc.mid(s,i-s).stripWhiteSpace();
-
-    QCString dosExt = incFileName.right(4);
-    if (dosExt==".exe" || dosExt==".dll" || dosExt==".tlb")
-    {
-      // skip imported binary files (e.g. M$ type libraries)
-      return;
-    }
-
-    QCString oldFileName = g_yyFileName;
-    FileDef *oldFileDef  = g_yyFileDef;
-    int oldLineNr        = g_yyLineNr;
-    //printf("Searching for '%s'\n",incFileName.data());
-
-    // absIncFileName avoids difficulties for incFileName starting with "../" (bug 641336)
-    QCString absIncFileName = incFileName;
-    {
-      QFileInfo fi(g_yyFileName);
-      if (fi.exists())
-      {
-       QCString absName = QCString(fi.dirPath(TRUE).data())+"/"+incFileName;
-        QFileInfo fi2(absName);
-        if (fi2.exists())
-        {
-         absIncFileName=fi2.absFilePath().utf8();
-       }
-       else if (searchIncludes) // search in INCLUDE_PATH as well
-       {
-         QStrList &includePath = Config_getList(INCLUDE_PATH);
-         char *s=includePath.first();
-         while (s)
-         {
-           QFileInfo fi(s);
-           if (fi.exists() && fi.isDir())
-           {
-             QCString absName = QCString(fi.absFilePath().utf8())+"/"+incFileName;
-             //printf("trying absName=%s\n",absName.data());
-             QFileInfo fi2(absName);
-             if (fi2.exists())
-             {
-               absIncFileName=fi2.absFilePath().utf8();
-               break;
-             }
-             //printf( "absIncFileName = %s\n", absIncFileName.data() );
-           }
-           s=includePath.next();
-         }
-       }
-       //printf( "absIncFileName = %s\n", absIncFileName.data() );
-      }
-    }
-    DefineManager::instance().addInclude(g_yyFileName,absIncFileName);
-    DefineManager::instance().addFileToContext(absIncFileName);
-
-    // findFile will overwrite g_yyFileDef if found
-    FileState *fs;
-    bool alreadyIncluded = FALSE;
-    //printf("calling findFile(%s)\n",incFileName.data());
-    if ((fs=findFile(incFileName,localInclude,alreadyIncluded))) // see if the include file can be found
-    {
-      //printf("Found include file!\n");
-      if (Debug::isFlagSet(Debug::Preprocessor))
-      {
-        for (i=0;i<g_includeStack.count();i++) 
-        {
-          Debug::print(Debug::Preprocessor,0,"  ");
-        }
-        //msg("#include %s: parsing...\n",incFileName.data());
-      }
-      if (oldFileDef)
-      {
-        // add include dependency to the file in which the #include was found
-       bool ambig;
-       // change to absolute name for bug 641336 
-        FileDef *incFd = findFileDef(Doxygen::inputNameDict,absIncFileName,ambig);
-        oldFileDef->addIncludeDependency(ambig ? 0 : incFd,incFileName,localInclude,g_isImported,FALSE);
-        // add included by dependency
-        if (g_yyFileDef)
-        {
-          //printf("Adding include dependency %s->%s\n",oldFileDef->name().data(),incFileName.data());
-          g_yyFileDef->addIncludedByDependency(oldFileDef,oldFileDef->docName(),localInclude,g_isImported);
-        }
-      }
-      else if (g_inputFileDef)
-      {
-        g_inputFileDef->addIncludeDependency(0,absIncFileName,localInclude,g_isImported,TRUE);
-      }
-      fs->bufState = YY_CURRENT_BUFFER;
-      fs->lineNr   = oldLineNr;
-      fs->fileName = oldFileName;
-      fs->curlyCount = g_curlyCount;
-      g_curlyCount = 0;
-      // push the state on the stack
-      g_includeStack.push(fs);
-      // set the scanner to the include file
-
-      // Deal with file changes due to 
-      // #include's within { .. } blocks
-      QCString lineStr(g_yyFileName.length()+20);
-      lineStr.sprintf("# 1 \"%s\" 1\n",g_yyFileName.data());
-      outputArray(lineStr.data(),lineStr.length());
-
-      DBG_CTX((stderr,"Switching to include file %s\n",incFileName.data()));
-      g_expectGuard=TRUE;
-      g_inputBuf   = &fs->fileBuf;
-      g_inputBufPos=0;
-      yy_switch_to_buffer(yy_create_buffer(0, YY_BUF_SIZE));
-    }
-    else
-    {
-      //printf("  calling findFile(%s) alreadyInc=%d\n",incFileName.data(),alreadyIncluded);
-      if (oldFileDef)
-      {
-       bool ambig;
-       //QCString absPath = incFileName;
-       //if (QDir::isRelativePath(incFileName))
-       //{
-       //  absPath = QDir::cleanDirPath(oldFileDef->getPath()+"/"+incFileName);
-       //  //printf("%s + %s -> resolved path %s\n",oldFileDef->getPath().data(),incFileName.data(),absPath.data());
-       //}
-
-       // change to absolute name for bug 641336 
-       FileDef *fd = findFileDef(Doxygen::inputNameDict,absIncFileName,ambig);
-       //printf("%s::findFileDef(%s)=%p\n",oldFileDef->name().data(),incFileName.data(),fd);
-       // add include dependency to the file in which the #include was found
-       oldFileDef->addIncludeDependency(ambig ? 0 : fd,incFileName,localInclude,g_isImported,FALSE);
-       // add included by dependency
-        if (fd)
-        {
-          //printf("Adding include dependency (2) %s->%s ambig=%d\n",oldFileDef->name().data(),fd->name().data(),ambig);
-          fd->addIncludedByDependency(oldFileDef,oldFileDef->docName(),localInclude,g_isImported);
-        }
-      }
-      else if (g_inputFileDef)
-      {
-        g_inputFileDef->addIncludeDependency(0,absIncFileName,localInclude,g_isImported,TRUE);
-      }
-      if (Debug::isFlagSet(Debug::Preprocessor))
-      {
-       if (alreadyIncluded)
-       {
-          Debug::print(Debug::Preprocessor,0,"#include %s: already included! skipping...\n",qPrint(incFileName));
-       }
-       else
-       {
-          Debug::print(Debug::Preprocessor,0,"#include %s: not found! skipping...\n",qPrint(incFileName));
-       }
-        //printf("error: include file %s not found\n",yytext);
-      }
-      if (g_curlyCount>0 && !alreadyIncluded) // failed to find #include inside { ... }
-      {
-       warn(g_yyFileName,g_yyLineNr,"include file %s not found, perhaps you forgot to add its directory to INCLUDE_PATH?",incFileName.data());
-      }
-    }
-  }
-}
-
-/* ----------------------------------------------------------------- */
-
-static void startCondSection(const char *sectId)
-{
-  //printf("startCondSection: skip=%d stack=%d\n",g_skip,g_condStack.count());
-  CondParser prs;
-  bool expResult = prs.parse(g_yyFileName,g_yyLineNr,sectId);
-  g_condStack.push(new CondCtx(g_yyLineNr,sectId,g_skip));
-  if (!expResult)
-  {
-    g_skip=TRUE;
-  }
-  //printf("  expResult=%d skip=%d\n",expResult,g_skip);
-}
-
-static void endCondSection()
-{
-  if (g_condStack.isEmpty())
-  {
-    g_skip=FALSE;
-  }
-  else
-  {
-    CondCtx *ctx = g_condStack.pop();
-    g_skip=ctx->skip;
-    delete ctx;
-  }
-  //printf("endCondSection: skip=%d stack=%d\n",g_skip,g_condStack.count());
-}
-
-static void forceEndCondSection()
-{
-  while (!g_condStack.isEmpty())
-  {
-    delete g_condStack.pop();
-  }
-  g_skip=FALSE;
-}
-
-static QCString escapeAt(const char *text)
-{
-  QCString result;
-  if (text)
-  {
-    char c;
-    const char *p=text;
-    while ((c=*p++))
-    {
-      if (c=='@') result+="@@"; else result+=c;
-    }
-  }
-  return result;
-}
-
-static char resolveTrigraph(char c)
-{
-  switch (c)
-  {
-    case '=': return '#';
-    case '/': return '\\';
-    case '\'': return '^';
-    case '(': return '[';
-    case ')': return ']';
-    case '!': return '|';
-    case '<': return '{';
-    case '>': return '}';
-    case '-': return '~';
-  }
-  return '?';
-}
-
-/* ----------------------------------------------------------------- */
-
-#undef  YY_INPUT
-#define YY_INPUT(buf,result,max_size) result=yyread(buf,max_size);
-
-static int yyread(char *buf,int max_size)
-{
-  int bytesInBuf = g_inputBuf->curPos()-g_inputBufPos;
-  int bytesToCopy = QMIN(max_size,bytesInBuf);
-  memcpy(buf,g_inputBuf->data()+g_inputBufPos,bytesToCopy);
-  g_inputBufPos+=bytesToCopy;
-  return bytesToCopy;
-}
-
-/* ----------------------------------------------------------------- */
-
-%}
-
-ID     [a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]*
-B       [ \t]
-BN     [ \t\r\n]
-CHARLIT   (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
-
-%option noyywrap
-
-%x      Start
-%x     Command
-%x     SkipCommand
-%x     SkipLine
-%x     SkipString
-%x     CopyLine
-%x     CopyString
-%x     CopyStringCs
-%x     CopyStringFtn
-%x     CopyStringFtnDouble
-%x      Include
-%x      IncludeID
-%x      EndImport
-%x     DefName
-%x     DefineArg
-%x     DefineText
-%x      SkipCPPBlock
-%x      Ifdef
-%x      Ifndef
-%x     SkipCComment
-%x     ArgCopyCComment
-%x     CopyCComment
-%x     SkipVerbatim
-%x     SkipCPPComment
-%x     RemoveCComment
-%x     RemoveCPPComment
-%x     Guard
-%x     DefinedExpr1
-%x     DefinedExpr2
-%x     SkipDoubleQuote
-%x     SkipSingleQuote
-%x     UndefName
-%x     IgnoreLine
-%x     FindDefineArgs
-%x     ReadString
-%x     CondLineC
-%x     CondLineCpp
-%x      SkipCond
-
-%%
-
-<*>\x06                                        
-<*>\x00
-<*>\r
-<*>"??"[=/'()!<>-]                     { // Trigraph
-                                         unput(resolveTrigraph(yytext[2]));
-                                       }
-<Start>^{B}*"#"                                { BEGIN(Command); g_yyColNr+=yyleng; g_yyMLines=0;}
-<Start>^{B}*/[^#]                      {
-                                         outputArray(yytext,(int)yyleng);
-                                         BEGIN(CopyLine); 
-                                       }
-<Start>^{B}*[a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]+{B}*"("[^\)\n]*")"/{BN}{1,10}*[:{] { // constructors?
-                                         int i;
-                                         for (i=(int)yyleng-1;i>=0;i--)
-                                         {
-                                           unput(yytext[i]);
-                                         }
-                                         BEGIN(CopyLine);
-                                        }
-<Start>^{B}*[_A-Z][_A-Z0-9]+{B}*"("[^\(\)\n]*"("[^\)\n]*")"[^\)\n]*")"{B}*\n | // function list macro with one (...) argument, e.g. for K_GLOBAL_STATIC_WITH_ARGS
-<Start>^{B}*[_A-Z][_A-Z0-9]+{B}*"("[^\)\n]*")"{B}*\n { // function like macro
-                                         static bool skipFuncMacros = Config_getBool(SKIP_FUNCTION_MACROS);
-                                         QCString name(yytext);
-                                         name=name.left(name.find('(')).stripWhiteSpace();
-
-                                         Define *def=0;
-                                         if (skipFuncMacros && 
-                                             name!="Q_PROPERTY" &&
-                                             !(
-                                                (g_includeStack.isEmpty() || g_curlyCount>0) &&
-                                                g_macroExpansion &&
-                                                (def=DefineManager::instance().isDefined(name)) &&
-                                                /*macroIsAccessible(def) &&*/
-                                                (!g_expandOnlyPredef || def->isPredefined)
-                                              )
-                                            )
-                                         {
-                                           outputChar('\n');
-                                           g_yyLineNr++;
-                                         }
-                                         else // don't skip
-                                         {
-                                           int i;
-                                           for (i=(int)yyleng-1;i>=0;i--)
-                                           {
-                                             unput(yytext[i]);
-                                           }
-                                           BEGIN(CopyLine);
-                                         }
-                                       }
-<CopyLine>"extern"{BN}{0,80}"\"C\""*{BN}{0,80}"{"      {
-                                          QCString text=yytext;
-                                         g_yyLineNr+=text.contains('\n');
-                                         outputArray(yytext,(int)yyleng);
-                                       }
-<CopyLine>"{"                          { // count brackets inside the main file
-                                         if (g_includeStack.isEmpty()) 
-                                         {
-                                           g_curlyCount++;
-                                         }
-                                         outputChar(*yytext);
-                                       }
-<CopyLine>"}"                          { // count brackets inside the main file
-                                         if (g_includeStack.isEmpty() && g_curlyCount>0) 
-                                         {
-                                           g_curlyCount--;
-                                         }
-                                         outputChar(*yytext);
-                                       }
-<CopyLine>"'"\\[0-7]{1,3}"'"           { 
-                                         outputArray(yytext,(int)yyleng);
-                                       }
-<CopyLine>"'"\\."'"                    { 
-                                         outputArray(yytext,(int)yyleng);
-                                       }
-<CopyLine>"'"."'"                      { 
-                                         outputArray(yytext,(int)yyleng);
-                                       }
-<CopyLine>@\"                          {
-                                          if (getLanguageFromFileName(g_yyFileName)!=SrcLangExt_CSharp) REJECT;
-                                         outputArray(yytext,(int)yyleng);
-                                         BEGIN( CopyStringCs );
-                                       }
-<CopyLine>\"                           {
-                                         outputChar(*yytext);
-                                          if (getLanguageFromFileName(g_yyFileName)!=SrcLangExt_Fortran)
-                                          {
-                                           BEGIN( CopyString );
-                                          }
-                                          else
-                                          {
-                                           BEGIN( CopyStringFtnDouble );
-                                          }
-                                       }
-<CopyLine>\'                           {
-                                          if (getLanguageFromFileName(g_yyFileName)!=SrcLangExt_Fortran) REJECT;
-                                         outputChar(*yytext);
-                                         BEGIN( CopyStringFtn );
-                                       }
-<CopyString>[^\"\\\r\n]+               {
-                                         outputArray(yytext,(int)yyleng);
-                                       }
-<CopyStringCs>[^\"\r\n]+               {
-                                         outputArray(yytext,(int)yyleng);
-                                       }
-<CopyString>\\.                                {
-                                         outputArray(yytext,(int)yyleng);
-                                       }
-<CopyString,CopyStringCs>\"            {
-                                         outputChar(*yytext);
-                                         BEGIN( CopyLine );
-                                       }
-<CopyStringFtnDouble>[^\"\\\r\n]+      {
-                                         outputArray(yytext,(int)yyleng);
-                                       }
-<CopyStringFtnDouble>\\.               {
-                                         outputArray(yytext,(int)yyleng);
-                                       }
-<CopyStringFtnDouble>\"                        {
-                                         outputChar(*yytext);
-                                         BEGIN( CopyLine );
-                                       }
-<CopyStringFtn>[^\'\\\r\n]+            {
-                                         outputArray(yytext,(int)yyleng);
-                                       }
-<CopyStringFtn>\\.                     {
-                                         outputArray(yytext,(int)yyleng);
-                                       }
-<CopyStringFtn>\'                      {
-                                         outputChar(*yytext);
-                                         BEGIN( CopyLine );
-                                       }
-<CopyLine>{ID}/{BN}{0,80}"("           {
-                                         g_expectGuard = FALSE;
-                                         Define *def=0;
-                                         //def=g_globalDefineDict->find(yytext);
-                                         //def=DefineManager::instance().isDefined(yytext);
-                                         //printf("Search for define %s found=%d g_includeStack.isEmpty()=%d "
-                                         //       "g_curlyCount=%d g_macroExpansion=%d g_expandOnlyPredef=%d "
-                                         //     "isPreDefined=%d\n",yytext,def ? 1 : 0,
-                                         //     g_includeStack.isEmpty(),g_curlyCount,g_macroExpansion,g_expandOnlyPredef,
-                                         //     def ? def->isPredefined : -1
-                                         //    );
-                                         if ((g_includeStack.isEmpty() || g_curlyCount>0) &&
-                                             g_macroExpansion &&
-                                             (def=DefineManager::instance().isDefined(yytext)) &&
-                                             /*(def->isPredefined || macroIsAccessible(def)) && */
-                                             (!g_expandOnlyPredef || def->isPredefined)
-                                            )
-                                         {
-                                           //printf("Found it! #args=%d\n",def->nargs);
-                                           g_roundCount=0;
-                                           g_defArgsStr=yytext;
-                                           if (def->nargs==-1) // no function macro
-                                           {
-                                             QCString result = def->isPredefined ? def->definition : expandMacro(g_defArgsStr);
-                                             outputArray(result,result.length());
-                                           }
-                                           else // zero or more arguments
-                                           {
-                                             g_findDefArgContext = CopyLine;
-                                             BEGIN(FindDefineArgs);
-                                           }
-                                         }
-                                         else
-                                         {
-                                           outputArray(yytext,(int)yyleng);
-                                         }
-                                       }
-<CopyLine>{ID}                         {
-                                          Define *def=0;
-                                         if ((g_includeStack.isEmpty() || g_curlyCount>0) && 
-                                             g_macroExpansion &&
-                                             (def=DefineManager::instance().isDefined(yytext)) &&
-                                             def->nargs==-1 &&
-                                             /*(def->isPredefined || macroIsAccessible(def)) &&*/
-                                             (!g_expandOnlyPredef || def->isPredefined)
-                                            )
-                                         {
-                                           QCString result=def->isPredefined ? def->definition : expandMacro(yytext); 
-                                           outputArray(result,result.length());
-                                         }
-                                         else
-                                         {
-                                           outputArray(yytext,(int)yyleng);
-                                         }
-                                       }
-<CopyLine>"\\"\r?/\n                   { // strip line continuation characters
-                                          if (getLanguageFromFileName(g_yyFileName)==SrcLangExt_Fortran) outputChar(*yytext);
-                                       }
-<CopyLine>.                            {
-                                         outputChar(*yytext);
-                                       }
-<CopyLine>\n                           {
-                                         outputChar('\n');
-                                         BEGIN(Start);
-                                         g_yyLineNr++;
-                                         g_yyColNr=1;
-                                       }
-<FindDefineArgs>"("                    {
-                                         g_defArgsStr+='(';
-                                         g_roundCount++;
-                                       }
-<FindDefineArgs>")"                    {
-                                         g_defArgsStr+=')';
-                                         g_roundCount--;
-                                         if (g_roundCount==0)
-                                         {
-                                           QCString result=expandMacro(g_defArgsStr);
-                                           //printf("g_defArgsStr='%s'->'%s'\n",g_defArgsStr.data(),result.data());
-                                           if (g_findDefArgContext==CopyLine)
-                                           {
-                                             outputArray(result,result.length());
-                                             BEGIN(g_findDefArgContext);
-                                           }
-                                           else // g_findDefArgContext==IncludeID
-                                           {
-                                             readIncludeFile(result);
-                                             g_nospaces=FALSE;
-                                             BEGIN(Start);
-                                           }
-                                         }
-                                       }
-  /*
-<FindDefineArgs>")"{B}*"("             {
-                                         g_defArgsStr+=yytext;
-                                       }
-  */
-<FindDefineArgs>{CHARLIT}              {
-                                         g_defArgsStr+=yytext;
-                                       }
-<FindDefineArgs>"/*"[*]?                {
-                                          g_defArgsStr+=yytext;
-                                          BEGIN(ArgCopyCComment);
-                                        }
-<FindDefineArgs>\"                     {
-                                         g_defArgsStr+=*yytext;
-                                         BEGIN(ReadString);
-                                       }
-<FindDefineArgs>'                       {
-                                          if (getLanguageFromFileName(g_yyFileName)!=SrcLangExt_Fortran) REJECT;
-                                          g_defArgsStr+=*yytext;
-                                          BEGIN(ReadString);
-                                        }
-<FindDefineArgs>\n                     {
-                                          g_defArgsStr+=' ';
-                                         g_yyLineNr++;
-                                         outputChar('\n');
-                                       }
-<FindDefineArgs>"@"                    {
-                                         g_defArgsStr+="@@";
-                                       }
-<FindDefineArgs>.                      {
-                                         g_defArgsStr+=*yytext;
-                                       }
-<ArgCopyCComment>[^*\n]+               {
-                                         g_defArgsStr+=yytext;
-                                       }
-<ArgCopyCComment>"*/"                  {
-                                         g_defArgsStr+=yytext;
-                                         BEGIN(FindDefineArgs);
-                                       }
-<ArgCopyCComment>\n                    { 
-                                          g_defArgsStr+=' ';
-                                         g_yyLineNr++;
-                                         outputChar('\n');
-                                       }
-<ArgCopyCComment>.                     { 
-                                          g_defArgsStr+=yytext;
-                                        }
-<ReadString>"\""                       {
-                                         g_defArgsStr+=*yytext;
-                                         BEGIN(FindDefineArgs);
-                                       }
-<ReadString>"'"                         {
-                                          if (getLanguageFromFileName(g_yyFileName)!=SrcLangExt_Fortran) REJECT;
-                                          g_defArgsStr+=*yytext;
-                                          BEGIN(FindDefineArgs);
-                                        }
+                                         Define *def=0;
+                                         if (skipFuncMacros && 
+                                             name!="Q_PROPERTY" &&
+                                             !(
+                                                (yyextra->includeStack.isEmpty() || yyextra->curlyCount>0) &&
+                                                yyextra->macroExpansion &&
+                                                (def=yyextra->defineManager.isDefined(name)) &&
+                                                /*macroIsAccessible(def) &&*/
+                                                (!yyextra->expandOnlyPredef || def->isPredefined)
+                                              )
+                                            )
+                                         {
+                                           outputChar(yyscanner,'\n');
+                                           yyextra->yyLineNr++;
+                                         }
+                                         else // don't skip
+                                         {
+                                           int i;
+                                           for (i=(int)yyleng-1;i>=0;i--)
+                                           {
+                                             unput(yytext[i]);
+                                           }
+                                           BEGIN(CopyLine);
+                                         }
+                                       }
+<CopyLine>"extern"{BN}{0,80}"\"C\""*{BN}{0,80}"{"      {
+                                          QCString text=yytext;
+                                         yyextra->yyLineNr+=text.contains('\n');
+                                         outputArray(yyscanner,yytext,(int)yyleng);
+                                       }
+<CopyLine>{RAWBEGIN}                    {
+                                          yyextra->delimiter = yytext+2;
+                                          yyextra->delimiter=yyextra->delimiter.left(yyextra->delimiter.length()-1);
+                                         outputArray(yyscanner,yytext,(int)yyleng);
+                                          BEGIN(CopyRawString);
+                                        }
+<CopyLine>"{"                          { // count brackets inside the main file
+                                         if (yyextra->includeStack.isEmpty()) 
+                                         {
+                                           yyextra->curlyCount++;
+                                         }
+                                         outputChar(yyscanner,*yytext);
+                                       }
+<CopyLine>"}"                          { // count brackets inside the main file
+                                         if (yyextra->includeStack.isEmpty() && yyextra->curlyCount>0) 
+                                         {
+                                           yyextra->curlyCount--;
+                                         }
+                                         outputChar(yyscanner,*yytext);
+                                       }
+<CopyLine>"'"\\[0-7]{1,3}"'"           { 
+                                         outputArray(yyscanner,yytext,(int)yyleng);
+                                       }
+<CopyLine>"'"\\."'"                    { 
+                                         outputArray(yyscanner,yytext,(int)yyleng);
+                                       }
+<CopyLine>"'"."'"                      { 
+                                         outputArray(yyscanner,yytext,(int)yyleng);
+                                       }
+<CopyLine>@\"                          {
+                                          if (getLanguageFromFileName(yyextra->yyFileName)!=SrcLangExt_CSharp) REJECT;
+                                         outputArray(yyscanner,yytext,(int)yyleng);
+                                         BEGIN( CopyStringCs );
+                                       }
+<CopyLine>\"                           {
+                                         outputChar(yyscanner,*yytext);
+                                          if (getLanguageFromFileName(yyextra->yyFileName)!=SrcLangExt_Fortran)
+                                          {
+                                           BEGIN( CopyString );
+                                          }
+                                          else
+                                          {
+                                           BEGIN( CopyStringFtnDouble );
+                                          }
+                                       }
+<CopyLine>\'                           {
+                                          if (getLanguageFromFileName(yyextra->yyFileName)!=SrcLangExt_Fortran) REJECT;
+                                         outputChar(yyscanner,*yytext);
+                                         BEGIN( CopyStringFtn );
+                                       }
+<CopyString>[^\"\\\r\n]+               {
+                                         outputArray(yyscanner,yytext,(int)yyleng);
+                                       }
+<CopyStringCs>[^\"\r\n]+               {
+                                         outputArray(yyscanner,yytext,(int)yyleng);
+                                       }
+<CopyString>\\.                                {
+                                         outputArray(yyscanner,yytext,(int)yyleng);
+                                       }
+<CopyString,CopyStringCs>\"            {
+                                         outputChar(yyscanner,*yytext);
+                                         BEGIN( CopyLine );
+                                       }
+<CopyStringFtnDouble>[^\"\\\r\n]+      {
+                                         outputArray(yyscanner,yytext,(int)yyleng);
+                                       }
+<CopyStringFtnDouble>\\.               {
+                                         outputArray(yyscanner,yytext,(int)yyleng);
+                                       }
+<CopyStringFtnDouble>\"                        {
+                                         outputChar(yyscanner,*yytext);
+                                         BEGIN( CopyLine );
+                                       }
+<CopyStringFtn>[^\'\\\r\n]+            {
+                                         outputArray(yyscanner,yytext,(int)yyleng);
+                                       }
+<CopyStringFtn>\\.                     {
+                                         outputArray(yyscanner,yytext,(int)yyleng);
+                                       }
+<CopyStringFtn>\'                      {
+                                         outputChar(yyscanner,*yytext);
+                                         BEGIN( CopyLine );
+                                       }
+<CopyRawString>{RAWEND}                 {
+                                         outputArray(yyscanner,yytext,(int)yyleng);
+                                          QCString delimiter = yytext+1;
+                                          delimiter=delimiter.left(delimiter.length()-1);
+                                          if (delimiter==yyextra->delimiter)
+                                          {
+                                            BEGIN( CopyLine );
+                                          }
+                                        }
+<CopyRawString>[^)]+                    {
+                                         outputArray(yyscanner,yytext,(int)yyleng);
+                                        }
+<CopyRawString>.                        {
+                                         outputChar(yyscanner,*yytext);
+                                        }
+<CopyLine>{ID}/{BN}{0,80}"("           {
+                                         yyextra->expectGuard = FALSE;
+                                         Define *def=0;
+                                         //def=yyextra->globalDefineDict->find(yytext);
+                                         //def=yyextra->defineManager.isDefined(yytext);
+                                         //printf("Search for define %s found=%d yyextra->includeStack.isEmpty()=%d "
+                                         //       "yyextra->curlyCount=%d yyextra->macroExpansion=%d yyextra->expandOnlyPredef=%d "
+                                         //     "isPreDefined=%d\n",yytext,def ? 1 : 0,
+                                         //     yyextra->includeStack.isEmpty(),yyextra->curlyCount,yyextra->macroExpansion,yyextra->expandOnlyPredef,
+                                         //     def ? def->isPredefined : -1
+                                         //    );
+                                         if ((yyextra->includeStack.isEmpty() || yyextra->curlyCount>0) &&
+                                             yyextra->macroExpansion &&
+                                             (def=yyextra->defineManager.isDefined(yytext)) &&
+                                             /*(def->isPredefined || macroIsAccessible(def)) && */
+                                             (!yyextra->expandOnlyPredef || def->isPredefined)
+                                            )
+                                         {
+                                           //printf("Found it! #args=%d\n",def->nargs);
+                                           yyextra->roundCount=0;
+                                           yyextra->defArgsStr=yytext;
+                                           if (def->nargs==-1) // no function macro
+                                           {
+                                             QCString result = def->isPredefined ? def->definition : expandMacro(yyscanner,yyextra->defArgsStr);
+                                             outputArray(yyscanner,result,result.length());
+                                           }
+                                           else // zero or more arguments
+                                           {
+                                             yyextra->findDefArgContext = CopyLine;
+                                             BEGIN(FindDefineArgs);
+                                           }
+                                         }
+                                         else
+                                         {
+                                           outputArray(yyscanner,yytext,(int)yyleng);
+                                         }
+                                       }
+<CopyLine>{ID}                         {
+                                          Define *def=0;
+                                         if ((yyextra->includeStack.isEmpty() || yyextra->curlyCount>0) && 
+                                             yyextra->macroExpansion &&
+                                             (def=yyextra->defineManager.isDefined(yytext)) &&
+                                             def->nargs==-1 &&
+                                             /*(def->isPredefined || macroIsAccessible(def)) &&*/
+                                             (!yyextra->expandOnlyPredef || def->isPredefined)
+                                            )
+                                         {
+                                           QCString result=def->isPredefined ? def->definition : expandMacro(yyscanner,yytext); 
+                                           outputArray(yyscanner,result,result.length());
+                                         }
+                                         else
+                                         {
+                                           outputArray(yyscanner,yytext,(int)yyleng);
+                                         }
+                                       }
+<CopyLine>"\\"\r?/\n                   { // strip line continuation characters
+                                          if (getLanguageFromFileName(yyextra->yyFileName)==SrcLangExt_Fortran) outputChar(yyscanner,*yytext);
+                                       }
+<CopyLine>.                            {
+                                         outputChar(yyscanner,*yytext);
+                                       }
+<CopyLine>\n                           {
+                                         outputChar(yyscanner,'\n');
+                                         BEGIN(Start);
+                                         yyextra->yyLineNr++;
+                                         yyextra->yyColNr=1;
+                                       }
+<FindDefineArgs>"("                    {
+                                         yyextra->defArgsStr+='(';
+                                         yyextra->roundCount++;
+                                       }
+<FindDefineArgs>")"                    {
+                                         yyextra->defArgsStr+=')';
+                                         yyextra->roundCount--;
+                                         if (yyextra->roundCount==0)
+                                         {
+                                           QCString result=expandMacro(yyscanner,yyextra->defArgsStr);
+                                           //printf("yyextra->defArgsStr='%s'->'%s'\n",yyextra->defArgsStr.data(),result.data());
+                                           if (yyextra->findDefArgContext==CopyLine)
+                                           {
+                                             outputArray(yyscanner,result,result.length());
+                                             BEGIN(yyextra->findDefArgContext);
+                                           }
+                                           else // yyextra->findDefArgContext==IncludeID
+                                           {
+                                             readIncludeFile(yyscanner,result);
+                                             yyextra->nospaces=FALSE;
+                                             BEGIN(Start);
+                                           }
+                                         }
+                                       }
+  /*
+<FindDefineArgs>")"{B}*"("             {
+                                         yyextra->defArgsStr+=yytext;
+                                       }
+  */
+<FindDefineArgs>{CHARLIT}              {
+                                         yyextra->defArgsStr+=yytext;
+                                       }
+<FindDefineArgs>"/*"[*]?                {
+                                          yyextra->defArgsStr+=yytext;
+                                          BEGIN(ArgCopyCComment);
+                                        }
+<FindDefineArgs>\"                     {
+                                         yyextra->defArgsStr+=*yytext;
+                                         BEGIN(ReadString);
+                                       }
+<FindDefineArgs>'                       {
+                                          if (getLanguageFromFileName(yyextra->yyFileName)!=SrcLangExt_Fortran) REJECT;
+                                          yyextra->defArgsStr+=*yytext;
+                                          BEGIN(ReadString);
+                                        }
+<FindDefineArgs>\n                     {
+                                          yyextra->defArgsStr+=' ';
+                                         yyextra->yyLineNr++;
+                                         outputChar(yyscanner,'\n');
+                                       }
+<FindDefineArgs>"@"                    {
+                                         yyextra->defArgsStr+="@@";
+                                       }
+<FindDefineArgs>.                      {
+                                         yyextra->defArgsStr+=*yytext;
+                                       }
+<ArgCopyCComment>[^*\n]+               {
+                                         yyextra->defArgsStr+=yytext;
+                                       }
+<ArgCopyCComment>"*/"                  {
+                                         yyextra->defArgsStr+=yytext;
+                                         BEGIN(FindDefineArgs);
+                                       }
+<ArgCopyCComment>\n                    { 
+                                          yyextra->defArgsStr+=' ';
+                                         yyextra->yyLineNr++;
+                                         outputChar(yyscanner,'\n');
+                                       }
+<ArgCopyCComment>.                     { 
+                                          yyextra->defArgsStr+=yytext;
+                                        }
+<ReadString>"\""                       {
+                                         yyextra->defArgsStr+=*yytext;
+                                         BEGIN(FindDefineArgs);
+                                       }
+<ReadString>"'"                         {
+                                          if (getLanguageFromFileName(yyextra->yyFileName)!=SrcLangExt_Fortran) REJECT;
+                                          yyextra->defArgsStr+=*yytext;
+                                          BEGIN(FindDefineArgs);
+                                        }
 
 <ReadString>"//"|"/*"                  {
-                                         g_defArgsStr+=yytext;
+                                         yyextra->defArgsStr+=yytext;
                                        }
 <ReadString>\\/\r?\n                   { // line continuation
                                        }
 <ReadString>\\.                                {
-                                         g_defArgsStr+=yytext;
+                                         yyextra->defArgsStr+=yytext;
                                        }
 <ReadString>.                          {
-                                         g_defArgsStr+=*yytext;
+                                         yyextra->defArgsStr+=*yytext;
                                        }
 <Command>("include"|"import"){B}+/{ID} {
-                                         g_isImported = yytext[1]=='m';
-                                         if (g_macroExpansion) 
+                                         yyextra->isImported = yytext[1]=='m';
+                                         if (yyextra->macroExpansion) 
                                            BEGIN(IncludeID);
                                        }
 <Command>("include"|"import"){B}*[<"]  { 
-                                         g_isImported = yytext[1]=='m';
+                                         yyextra->isImported = yytext[1]=='m';
                                          char c[2];
                                          c[0]=yytext[yyleng-1];c[1]='\0';
-                                         g_incName=c;
+                                         yyextra->incName=c;
                                          BEGIN(Include); 
                                        }
 <Command>("cmake")?"define"{B}+                { 
                                          //printf("!!!DefName\n"); 
-                                         g_yyColNr+=yyleng;
+                                         yyextra->yyColNr+=yyleng;
                                          BEGIN(DefName); 
                                        }
 <Command>"ifdef"/{B}*"("               {
-                                         incrLevel();
-                                         g_guardExpr.resize(0);
+                                         incrLevel(yyscanner);
+                                         yyextra->guardExpr.resize(0);
                                          BEGIN(DefinedExpr2);
                                        }
 <Command>"ifdef"/{B}+                  {
                                          //printf("Pre.l: ifdef\n");
-                                         incrLevel();
-                                         g_guardExpr.resize(0);
+                                         incrLevel(yyscanner);
+                                         yyextra->guardExpr.resize(0);
                                          BEGIN(DefinedExpr1);
                                        }
 <Command>"ifndef"/{B}*"("              {
-                                         incrLevel();
-                                         g_guardExpr="! ";
+                                         incrLevel(yyscanner);
+                                         yyextra->guardExpr="! ";
                                          BEGIN(DefinedExpr2);
                                        }
 <Command>"ifndef"/{B}+                 {
-                                         incrLevel();
-                                         g_guardExpr="! ";
+                                         incrLevel(yyscanner);
+                                         yyextra->guardExpr="! ";
                                          BEGIN(DefinedExpr1);
                                        }
 <Command>"if"/[ \t(!]                  {
-                                         incrLevel();
-                                         g_guardExpr.resize(0);
+                                         incrLevel(yyscanner);
+                                         yyextra->guardExpr.resize(0);
                                          BEGIN(Guard);
                                        }
 <Command>("elif"|"else"{B}*"if")/[ \t(!]       {
-                                         if (!otherCaseDone())
+                                         if (!otherCaseDone(yyscanner))
                                          {
-                                           g_guardExpr.resize(0);
+                                           yyextra->guardExpr.resize(0);
                                            BEGIN(Guard);  
                                          }
                                          else
                                          {
-                                           g_ifcount=0;
+                                           yyextra->ifcount=0;
                                            BEGIN(SkipCPPBlock);
                                          }
                                        }
 <Command>"else"/[^a-z_A-Z0-9\x80-\xFF]         {
-                                         //printf("else g_levelGuard[%d]=%d\n",g_level-1,g_levelGuard[g_level-1]);
-                                         if (otherCaseDone())
+                                         //printf("else yyextra->levelGuard[%d]=%d\n",yyextra->level-1,yyextra->levelGuard[yyextra->level-1]);
+                                         if (otherCaseDone(yyscanner))
                                          {
-                                           g_ifcount=0;
+                                           yyextra->ifcount=0;
                                            BEGIN(SkipCPPBlock);
                                          }
                                          else
                                          {
-                                           setCaseDone(TRUE);
-                                           //g_levelGuard[g_level-1]=TRUE;
+                                           setCaseDone(yyscanner,TRUE);
+                                           //yyextra->levelGuard[yyextra->level-1]=TRUE;
                                          } 
                                        }
 <Command>"undef"{B}+                   {
                                          BEGIN(UndefName);
                                        }
 <Command>("elif"|"else"{B}*"if")/[ \t(!]       {
-                                         if (!otherCaseDone())
+                                         if (!otherCaseDone(yyscanner))
                                          {
-                                           g_guardExpr.resize(0);
+                                           yyextra->guardExpr.resize(0);
                                            BEGIN(Guard);
                                          }
                                        }
 <Command>"endif"/[^a-z_A-Z0-9\x80-\xFF]                {
                                          //printf("Pre.l: #endif\n");
-                                         decrLevel();
+                                         decrLevel(yyscanner);
                                        }
 <Command,IgnoreLine>\n                 {
-                                         outputChar('\n');
+                                         outputChar(yyscanner,'\n');
                                          BEGIN(Start);
-                                         g_yyLineNr++;
+                                         yyextra->yyLineNr++;
                                        }
 <Command>"pragma"{B}+"once"             {
-                                          g_expectGuard = FALSE;
+                                          yyextra->expectGuard = FALSE;
                                         }
 <Command>{ID}                          { // unknown directive
                                          BEGIN(IgnoreLine);
                                        }
 <IgnoreLine>\\[\r]?\n                  {
-                                         outputChar('\n');
-                                         g_yyLineNr++;
+                                         outputChar(yyscanner,'\n');
+                                         yyextra->yyLineNr++;
                                        }
 <IgnoreLine>.
-<Command>. {g_yyColNr+=yyleng;}
+<Command>. {yyextra->yyColNr+=yyleng;}
 <UndefName>{ID}                                {
                                          Define *def;
-                                         if ((def=DefineManager::instance().isDefined(yytext)) 
+                                         if ((def=yyextra->defineManager.isDefined(yytext)) 
                                              /*&& !def->isPredefined*/
                                              && !def->nonRecursive
                                             )
@@ -2214,9 +890,9 @@ CHARLIT   (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
                                          BEGIN(Start);
                                        }
 <Guard>\\[\r]?\n                       {
-                                         outputChar('\n');
-                                         g_guardExpr+=' ';
-                                         g_yyLineNr++;
+                                         outputChar(yyscanner,'\n');
+                                         yyextra->guardExpr+=' ';
+                                         yyextra->yyLineNr++;
                                        }
 <Guard>"defined"/{B}*"("               {
                                          BEGIN(DefinedExpr2);
@@ -2224,45 +900,45 @@ CHARLIT   (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
 <Guard>"defined"/{B}+                  {
                                          BEGIN(DefinedExpr1);
                                        }
-<Guard>{ID}                            { g_guardExpr+=yytext; }
-<Guard>"@"                              { g_guardExpr+="@@"; }
-<Guard>.                               { g_guardExpr+=*yytext; }
+<Guard>{ID}                            { yyextra->guardExpr+=yytext; }
+<Guard>"@"                              { yyextra->guardExpr+="@@"; }
+<Guard>.                               { yyextra->guardExpr+=*yytext; }
 <Guard>\n                              {
                                          unput(*yytext);
                                          //printf("Guard: '%s'\n",
-                                         //    g_guardExpr.data());
-                                         bool guard=computeExpression(g_guardExpr);
-                                         setCaseDone(guard);
-                                         //printf("if g_levelGuard[%d]=%d\n",g_level-1,g_levelGuard[g_level-1]);
+                                         //    yyextra->guardExpr.data());
+                                         bool guard=computeExpression(yyscanner,yyextra->guardExpr);
+                                         setCaseDone(yyscanner,guard);
+                                         //printf("if yyextra->levelGuard[%d]=%d\n",yyextra->level-1,yyextra->levelGuard[yyextra->level-1]);
                                          if (guard)
                                          {
                                            BEGIN(Start);
                                          } 
                                          else
                                          {
-                                           g_ifcount=0;
+                                           yyextra->ifcount=0;
                                            BEGIN(SkipCPPBlock);
                                          }
                                        }
-<DefinedExpr1,DefinedExpr2>\\\n                { g_yyLineNr++; outputChar('\n'); }
+<DefinedExpr1,DefinedExpr2>\\\n                { yyextra->yyLineNr++; outputChar(yyscanner,'\n'); }
 <DefinedExpr1>{ID}                     {
-                                         if (DefineManager::instance().isDefined(yytext) || g_guardName==yytext)
-                                           g_guardExpr+=" 1L ";
+                                         if (yyextra->defineManager.isDefined(yytext) || yyextra->guardName==yytext)
+                                           yyextra->guardExpr+=" 1L ";
                                          else
-                                           g_guardExpr+=" 0L ";
-                                         g_lastGuardName=yytext;
+                                           yyextra->guardExpr+=" 0L ";
+                                         yyextra->lastGuardName=yytext;
                                          BEGIN(Guard);
                                        }
 <DefinedExpr2>{ID}                     {
-                                         if (DefineManager::instance().isDefined(yytext) || g_guardName==yytext)
-                                           g_guardExpr+=" 1L ";
+                                         if (yyextra->defineManager.isDefined(yytext) || yyextra->guardName==yytext)
+                                           yyextra->guardExpr+=" 1L ";
                                          else
-                                           g_guardExpr+=" 0L ";
-                                         g_lastGuardName=yytext;
+                                           yyextra->guardExpr+=" 0L ";
+                                         yyextra->lastGuardName=yytext;
                                        }
 <DefinedExpr1,DefinedExpr2>\n          { // should not happen, handle anyway
-                                          g_yyLineNr++;
-                                         g_ifcount=0;
+                                          yyextra->yyLineNr++;
+                                         yyextra->ifcount=0;
                                          BEGIN(SkipCPPBlock); 
                                        }
 <DefinedExpr2>")"                      {
@@ -2271,29 +947,29 @@ CHARLIT   (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
 <DefinedExpr1,DefinedExpr2>.
 <SkipCPPBlock>^{B}*"#"                 { BEGIN(SkipCommand); }
 <SkipCPPBlock>^{B}*/[^#]               { BEGIN(SkipLine); }
-<SkipCPPBlock>\n                       { g_yyLineNr++; outputChar('\n'); }
+<SkipCPPBlock>\n                       { yyextra->yyLineNr++; outputChar(yyscanner,'\n'); }
 <SkipCPPBlock>.
 <SkipCommand>"if"(("n")?("def"))?/[ \t(!]      { 
-                                         incrLevel();
-                                          g_ifcount++; 
-                                         //printf("#if... depth=%d\n",g_ifcount);
+                                         incrLevel(yyscanner);
+                                          yyextra->ifcount++; 
+                                         //printf("#if... depth=%d\n",yyextra->ifcount);
                                        }
 <SkipCommand>"else"                    {
-                                         //printf("Else! g_ifcount=%d otherCaseDone=%d\n",g_ifcount,otherCaseDone());
-                                         if (g_ifcount==0 && !otherCaseDone())
+                                         //printf("Else! yyextra->ifcount=%d otherCaseDone=%d\n",yyextra->ifcount,otherCaseDone());
+                                         if (yyextra->ifcount==0 && !otherCaseDone(yyscanner))
                                          {
-                                           setCaseDone(TRUE);
-                                           //outputChar('\n');
+                                           setCaseDone(yyscanner,TRUE);
+                                           //outputChar(yyscanner,'\n');
                                            BEGIN(Start);
                                          }
                                        }
 <SkipCommand>("elif"|"else"{B}*"if")/[ \t(!]           {
-                                         if (g_ifcount==0) 
+                                         if (yyextra->ifcount==0) 
                                          {
-                                           if (!otherCaseDone())
+                                           if (!otherCaseDone(yyscanner))
                                            {
-                                             g_guardExpr.resize(0);
-                                             g_lastGuardName.resize(0);
+                                             yyextra->guardExpr.resize(0);
+                                             yyextra->lastGuardName.resize(0);
                                              BEGIN(Guard);
                                            }
                                            else
@@ -2303,17 +979,17 @@ CHARLIT   (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
                                          }
                                        }
 <SkipCommand>"endif"                   { 
-                                         g_expectGuard = FALSE;
-                                         decrLevel();
-                                         if (--g_ifcount<0)
+                                         yyextra->expectGuard = FALSE;
+                                         decrLevel(yyscanner);
+                                         if (--yyextra->ifcount<0)
                                          {
-                                           //outputChar('\n');
+                                           //outputChar(yyscanner,'\n');
                                            BEGIN(Start);
                                          }
                                        }
 <SkipCommand>\n                                { 
-                                         outputChar('\n');
-                                         g_yyLineNr++; 
+                                         outputChar(yyscanner,'\n');
+                                         yyextra->yyLineNr++; 
                                          BEGIN(SkipCPPBlock);
                                        }
 <SkipCommand>{ID}                      { // unknown directive 
@@ -2329,18 +1005,18 @@ CHARLIT   (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
 <SkipString>"//"/[^\n]*                 { 
                                         }
 <SkipLine,SkipCommand,SkipCPPBlock>"//"[^\n]* {
-                                         g_lastCPPContext=YY_START;
+                                         yyextra->lastCPPContext=YY_START;
                                          BEGIN(RemoveCPPComment);
                                        }
 <SkipString>"/*"/[^\n]*                 { 
                                         }
 <SkipLine,SkipCommand,SkipCPPBlock>"/*"/[^\n]* {
-                                         g_lastCContext=YY_START;
+                                         yyextra->lastCContext=YY_START;
                                          BEGIN(RemoveCComment);
                                        }
 <SkipLine>\n                           {
-                                         outputChar('\n');
-                                         g_yyLineNr++;  
+                                         outputChar(yyscanner,'\n');
+                                         yyextra->yyLineNr++;  
                                          BEGIN(SkipCPPBlock);
                                        }
 <SkipString>[^"\\\n]+                  { }
@@ -2350,21 +1026,21 @@ CHARLIT   (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
                                        }
 <SkipString>.                          { }
 <IncludeID>{ID}{B}*/"("                        {
-                                         g_nospaces=TRUE;
-                                         g_roundCount=0;
-                                         g_defArgsStr=yytext;
-                                         g_findDefArgContext = IncludeID;
+                                         yyextra->nospaces=TRUE;
+                                         yyextra->roundCount=0;
+                                         yyextra->defArgsStr=yytext;
+                                         yyextra->findDefArgContext = IncludeID;
                                          BEGIN(FindDefineArgs);
                                        }
 <IncludeID>{ID}                                {
-                                         g_nospaces=TRUE;
-                                          readIncludeFile(expandMacro(yytext));
+                                         yyextra->nospaces=TRUE;
+                                          readIncludeFile(yyscanner,expandMacro(yyscanner,yytext));
                                          BEGIN(Start);
                                        }
 <Include>[^\">\n]+[\">]                        { 
-                                         g_incName+=yytext;
-                                         readIncludeFile(g_incName);
-                                         if (g_isImported)
+                                         yyextra->incName+=yytext;
+                                         readIncludeFile(yyscanner,yyextra->incName);
+                                         if (yyextra->isImported)
                                          {
                                            BEGIN(EndImport);
                                          }
@@ -2377,391 +1053,389 @@ CHARLIT   (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
                                          BEGIN(Start);
                                        }
 <EndImport>\\[\r]?"\n"                 { 
-                                         outputChar('\n');
-                                         g_yyLineNr++;
+                                         outputChar(yyscanner,'\n');
+                                         yyextra->yyLineNr++;
                                        }
 <EndImport>.                           {
                                        }
 <DefName>{ID}/("\\\n")*"("             { // define with argument
                                          //printf("Define() '%s'\n",yytext);
-                                         delete g_argDict;
-                                         g_argDict = new QDict<int>(31);
-                                         g_argDict->setAutoDelete(TRUE);
-                                         g_defArgs = 0; 
-                                          g_defArgsStr.resize(0);
-                                         g_defText.resize(0);
-                                         g_defLitText.resize(0);
-                                         g_defName = yytext;
-                                         g_defVarArgs = FALSE;
-                                         g_defExtraSpacing.resize(0);
+                                         delete yyextra->argDict;
+                                         yyextra->argDict = new QDict<int>(31);
+                                         yyextra->argDict->setAutoDelete(TRUE);
+                                         yyextra->defArgs = 0; 
+                                          yyextra->defArgsStr.resize(0);
+                                         yyextra->defText.resize(0);
+                                         yyextra->defLitText.resize(0);
+                                         yyextra->defName = yytext;
+                                         yyextra->defVarArgs = FALSE;
+                                         yyextra->defExtraSpacing.resize(0);
                                          BEGIN(DefineArg);
                                        }
 <DefName>{ID}{B}+"1"/[ \r\t\n]         { // special case: define with 1 -> can be "guard"
                                          //printf("Define '%s'\n",yytext);
-                                         delete g_argDict; g_argDict=0;
-                                         g_defArgs = -1;
-                                          g_defArgsStr.resize(0);
-                                         g_defName = yytext;
-                                         g_defName = g_defName.left(g_defName.length()-1).stripWhiteSpace();
-                                         g_defVarArgs = FALSE;
+                                         delete yyextra->argDict; yyextra->argDict=0;
+                                         yyextra->defArgs = -1;
+                                          yyextra->defArgsStr.resize(0);
+                                         yyextra->defName = yytext;
+                                         yyextra->defName = yyextra->defName.left(yyextra->defName.length()-1).stripWhiteSpace();
+                                         yyextra->defVarArgs = FALSE;
                                          //printf("Guard check: %s!=%s || %d\n",
-                                         //    g_defName.data(),g_lastGuardName.data(),g_expectGuard);
-                                         if (g_curlyCount>0 || g_defName!=g_lastGuardName || !g_expectGuard)
+                                         //    yyextra->defName.data(),yyextra->lastGuardName.data(),yyextra->expectGuard);
+                                         if (yyextra->curlyCount>0 || yyextra->defName!=yyextra->lastGuardName || !yyextra->expectGuard)
                                          { // define may appear in the output
-                                           QCString tmp=(QCString)"#define "+g_defName;
-                                           outputArray(tmp.data(),tmp.length());
-                                           g_quoteArg=FALSE;
-                                           g_insideComment=FALSE;
-                                           g_lastGuardName.resize(0);
-                                           g_defText="1"; 
-                                           g_defLitText="1"; 
+                                           QCString tmp=(QCString)"#define "+yyextra->defName;
+                                           outputArray(yyscanner,tmp.data(),tmp.length());
+                                           yyextra->quoteArg=FALSE;
+                                           yyextra->insideComment=FALSE;
+                                           yyextra->lastGuardName.resize(0);
+                                           yyextra->defText="1"; 
+                                           yyextra->defLitText="1"; 
                                            BEGIN(DefineText); 
                                          }
                                          else // define is a guard => hide
                                          {
                                            //printf("Found a guard %s\n",yytext);
-                                           g_defText.resize(0);
-                                           g_defLitText.resize(0);
+                                           yyextra->defText.resize(0);
+                                           yyextra->defLitText.resize(0);
                                            BEGIN(Start);
                                          }
-                                         g_expectGuard=FALSE;
+                                         yyextra->expectGuard=FALSE;
                                        }
 <DefName>{ID}/{B}*"\n"                 { // empty define
-                                         delete g_argDict; g_argDict=0;
-                                         g_defArgs = -1;
-                                         g_defName = yytext;
-                                          g_defArgsStr.resize(0);
-                                         g_defText.resize(0);
-                                         g_defLitText.resize(0);
-                                         g_defVarArgs = FALSE;
+                                         delete yyextra->argDict; yyextra->argDict=0;
+                                         yyextra->defArgs = -1;
+                                         yyextra->defName = yytext;
+                                          yyextra->defArgsStr.resize(0);
+                                         yyextra->defText.resize(0);
+                                         yyextra->defLitText.resize(0);
+                                         yyextra->defVarArgs = FALSE;
                                          //printf("Guard check: %s!=%s || %d\n",
-                                         //    g_defName.data(),g_lastGuardName.data(),g_expectGuard);
-                                         if (g_curlyCount>0 || g_defName!=g_lastGuardName || !g_expectGuard)
+                                         //    yyextra->defName.data(),yyextra->lastGuardName.data(),yyextra->expectGuard);
+                                         if (yyextra->curlyCount>0 || yyextra->defName!=yyextra->lastGuardName || !yyextra->expectGuard)
                                          { // define may appear in the output
-                                           QCString tmp=(QCString)"#define "+g_defName;
-                                           outputArray(tmp.data(),tmp.length());
-                                           g_quoteArg=FALSE;
-                                           g_insideComment=FALSE;
-                                           if (g_insideCS) g_defText="1"; // for C#, use "1" as define text
+                                           QCString tmp=(QCString)"#define "+yyextra->defName;
+                                           outputArray(yyscanner,tmp.data(),tmp.length());
+                                           yyextra->quoteArg=FALSE;
+                                           yyextra->insideComment=FALSE;
+                                           if (yyextra->insideCS) yyextra->defText="1"; // for C#, use "1" as define text
                                            BEGIN(DefineText);
                                          }
                                          else // define is a guard => hide
                                          {
                                            //printf("Found a guard %s\n",yytext);
-                                           g_guardName = yytext;
-                                           g_lastGuardName.resize(0);
+                                           yyextra->guardName = yytext;
+                                           yyextra->lastGuardName.resize(0);
                                            BEGIN(Start);
                                          }
-                                         g_expectGuard=FALSE;
+                                         yyextra->expectGuard=FALSE;
                                        }
 <DefName>{ID}/{B}*                     { // define with content
                                          //printf("Define '%s'\n",yytext);
-                                         delete g_argDict; g_argDict=0;
-                                         g_defArgs = -1;
-                                          g_defArgsStr.resize(0);
-                                         g_defText.resize(0);
-                                         g_defLitText.resize(0);
-                                         g_defName = yytext;
-                                         g_defVarArgs = FALSE;
-                                         QCString tmp=(QCString)"#define "+g_defName+g_defArgsStr;
-                                         outputArray(tmp.data(),tmp.length());
-                                         g_quoteArg=FALSE;
-                                         g_insideComment=FALSE;
+                                         delete yyextra->argDict; yyextra->argDict=0;
+                                         yyextra->defArgs = -1;
+                                          yyextra->defArgsStr.resize(0);
+                                         yyextra->defText.resize(0);
+                                         yyextra->defLitText.resize(0);
+                                         yyextra->defName = yytext;
+                                         yyextra->defVarArgs = FALSE;
+                                         QCString tmp=(QCString)"#define "+yyextra->defName+yyextra->defArgsStr;
+                                         outputArray(yyscanner,tmp.data(),tmp.length());
+                                         yyextra->quoteArg=FALSE;
+                                         yyextra->insideComment=FALSE;
                                          BEGIN(DefineText); 
                                        }
 <DefineArg>"\\\n"                       {
-                                         g_defExtraSpacing+="\n";
-                                         g_yyLineNr++;
+                                         yyextra->defExtraSpacing+="\n";
+                                         yyextra->yyLineNr++;
                                         }
-<DefineArg>","{B}*                     { g_defArgsStr+=yytext; }
-<DefineArg>"("{B}*                      { g_defArgsStr+=yytext; }
+<DefineArg>","{B}*                     { yyextra->defArgsStr+=yytext; }
+<DefineArg>"("{B}*                      { yyextra->defArgsStr+=yytext; }
 <DefineArg>{B}*")"{B}*                 {
-                                          g_defArgsStr+=yytext; 
-                                         QCString tmp=(QCString)"#define "+g_defName+g_defArgsStr+g_defExtraSpacing;
-                                         outputArray(tmp.data(),tmp.length());
-                                         g_quoteArg=FALSE;
-                                         g_insideComment=FALSE;
+                                          yyextra->defArgsStr+=yytext; 
+                                         QCString tmp=(QCString)"#define "+yyextra->defName+yyextra->defArgsStr+yyextra->defExtraSpacing;
+                                         outputArray(yyscanner,tmp.data(),tmp.length());
+                                         yyextra->quoteArg=FALSE;
+                                         yyextra->insideComment=FALSE;
                                          BEGIN(DefineText);
                                        }
 <DefineArg>"..."                       { // Variadic macro
-                                         g_defVarArgs = TRUE;
-                                         g_defArgsStr+=yytext;
-                                         g_argDict->insert("__VA_ARGS__",new int(g_defArgs));
-                                         g_defArgs++;
+                                         yyextra->defVarArgs = TRUE;
+                                         yyextra->defArgsStr+=yytext;
+                                         yyextra->argDict->insert("__VA_ARGS__",new int(yyextra->defArgs));
+                                         yyextra->defArgs++;
                                        }
 <DefineArg>{ID}{B}*("..."?)            {
                                          //printf("Define addArg(%s)\n",yytext);
                                          QCString argName=yytext;
-                                         g_defVarArgs = yytext[yyleng-1]=='.';
-                                         if (g_defVarArgs) // strip ellipsis
+                                         yyextra->defVarArgs = yytext[yyleng-1]=='.';
+                                         if (yyextra->defVarArgs) // strip ellipsis
                                          {
                                            argName=argName.left(argName.length()-3);
                                          }
                                          argName = argName.stripWhiteSpace();
-                                          g_defArgsStr+=yytext;
-                                         g_argDict->insert(argName,new int(g_defArgs)); 
-                                         g_defArgs++;
+                                          yyextra->defArgsStr+=yytext;
+                                         yyextra->argDict->insert(argName,new int(yyextra->defArgs)); 
+                                         yyextra->defArgs++;
                                        }
   /*
 <DefineText>"/ **"|"/ *!"                      {
-                                         g_defText+=yytext;
-                                         g_defLitText+=yytext;
-                                         g_insideComment=TRUE;
+                                         yyextra->defText+=yytext;
+                                         yyextra->defLitText+=yytext;
+                                         yyextra->insideComment=TRUE;
                                        }
 <DefineText>"* /"                      {
-                                         g_defText+=yytext;
-                                         g_defLitText+=yytext;
-                                         g_insideComment=FALSE;
+                                         yyextra->defText+=yytext;
+                                         yyextra->defLitText+=yytext;
+                                         yyextra->insideComment=FALSE;
                                        }
   */
 <DefineText>"/*"[!*]?                  {
-                                         g_defText+=yytext;
-                                         g_defLitText+=yytext;
-                                         g_lastCContext=YY_START;
-                                         g_commentCount=1;
+                                         yyextra->defText+=yytext;
+                                         yyextra->defLitText+=yytext;
+                                         yyextra->lastCContext=YY_START;
+                                         yyextra->commentCount=1;
                                          BEGIN(CopyCComment);
                                        }
 <DefineText>"//"[!/]?                  {
-                                         outputArray(yytext,(int)yyleng);
-                                         g_lastCPPContext=YY_START;
-                                         g_defLitText+=' ';
+                                         outputArray(yyscanner,yytext,(int)yyleng);
+                                         yyextra->lastCPPContext=YY_START;
+                                         yyextra->defLitText+=' ';
                                          BEGIN(SkipCPPComment);
                                        }
 <SkipCComment>[/]?"*/"                 {
-                                         if (yytext[0]=='/') outputChar('/');
-                                         outputChar('*');outputChar('/');
-                                         if (--g_commentCount<=0)
+                                         if (yytext[0]=='/') outputChar(yyscanner,'/');
+                                         outputChar(yyscanner,'*');outputChar(yyscanner,'/');
+                                         if (--yyextra->commentCount<=0)
                                          {
-                                           if (g_lastCContext==Start) 
+                                           if (yyextra->lastCContext==Start) 
                                              // small hack to make sure that ^... rule will
                                              // match when going to Start... Example: "/*...*/ some stuff..."
                                            {
                                              YY_CURRENT_BUFFER->yy_at_bol=1;
                                            }
-                                           BEGIN(g_lastCContext);  
+                                           BEGIN(yyextra->lastCContext);  
                                          }
                                        }
 <SkipCComment>"//"("/")*               {
-                                         outputArray(yytext,(int)yyleng);
+                                         outputArray(yyscanner,yytext,(int)yyleng);
                                        }
 <SkipCComment>"/*"                     {
-                                         outputChar('/');outputChar('*');
-                                         //g_commentCount++;
+                                         outputChar(yyscanner,'/');outputChar(yyscanner,'*');
+                                         //yyextra->commentCount++;
                                        }
 <SkipCComment>[\\@][\\@]("f{"|"f$"|"f[") {
-                                         outputArray(yytext,(int)yyleng);
+                                         outputArray(yyscanner,yytext,(int)yyleng);
                                        }
 <SkipCComment>^({B}*"*"+)?{B}{0,3}"~~~"[~]*   {
-                                          static bool markdownSupport = Config_getBool(MARKDOWN_SUPPORT);
+                                          bool markdownSupport = Config_getBool(MARKDOWN_SUPPORT);
                                           if (!markdownSupport)
                                           {
                                             REJECT;
                                           }
                                           else
                                           {
-                                           outputArray(yytext,(int)yyleng);
-                                            g_fenceSize=yyleng;
+                                           outputArray(yyscanner,yytext,(int)yyleng);
+                                            yyextra->fenceSize=yyleng;
                                             BEGIN(SkipVerbatim);
                                           }
                                         }
 <SkipCComment>^({B}*"*"+)?{B}{0,3}"```"[`]*            {
-                                          static bool markdownSupport = Config_getBool(MARKDOWN_SUPPORT);
+                                          bool markdownSupport = Config_getBool(MARKDOWN_SUPPORT);
                                           if (!markdownSupport)
                                           {
                                             REJECT;
                                           }
                                           else
                                           {
-                                           outputArray(yytext,(int)yyleng);
-                                            g_fenceSize=yyleng;
+                                           outputArray(yyscanner,yytext,(int)yyleng);
+                                            yyextra->fenceSize=yyleng;
                                             BEGIN(SkipVerbatim);
                                           }
                                         }
 <SkipCComment>[\\@][\\@]("verbatim"|"latexonly"|"htmlonly"|"xmlonly"|"docbookonly"|"rtfonly"|"manonly"|"dot"|"code"("{"[^}]*"}")?){BN}+ {
-                                         outputArray(yytext,(int)yyleng);
-                                         g_yyLineNr+=QCString(yytext).contains('\n');
+                                         outputArray(yyscanner,yytext,(int)yyleng);
+                                         yyextra->yyLineNr+=QCString(yytext).contains('\n');
                                        }
 <SkipCComment>[\\@]("verbatim"|"latexonly"|"htmlonly"|"xmlonly"|"docbookonly"|"rtfonly"|"manonly"|"dot"|"code"("{"[^}]*"}")?){BN}+     {
-                                         outputArray(yytext,(int)yyleng);
-                                         g_yyLineNr+=QCString(yytext).contains('\n');
-                                          g_fenceSize=0;
+                                         outputArray(yyscanner,yytext,(int)yyleng);
+                                         yyextra->yyLineNr+=QCString(yytext).contains('\n');
+                                          yyextra->fenceSize=0;
                                          if (yytext[1]=='f')
                                          {
-                                           g_blockName="f";
+                                           yyextra->blockName="f";
                                          }
                                          else
                                          {
                                             QCString bn=&yytext[1];
                                             int i = bn.find('{'); // for \code{.c}
                                             if (i!=-1) bn=bn.left(i);
-                                           g_blockName=bn.stripWhiteSpace();
+                                           yyextra->blockName=bn.stripWhiteSpace();
                                          }
                                          BEGIN(SkipVerbatim);
                                        }
 <SkipCComment,SkipCPPComment>[\\@][\\@]"cond"[ \t]+ { // escaped @cond
-                                         outputArray(yytext,(int)yyleng);
+                                         outputArray(yyscanner,yytext,(int)yyleng);
                                         }
 <SkipCPPComment>[\\@]"cond"[ \t]+      { // conditional section
-                                          g_ccomment=TRUE;  
-                                          g_condCtx=YY_START;
+                                          yyextra->ccomment=TRUE;  
+                                          yyextra->condCtx=YY_START;
                                          BEGIN(CondLineCpp);
                                        }
 <SkipCComment>[\\@]"cond"[ \t]+        { // conditional section
-                                          g_ccomment=FALSE;  
-                                          g_condCtx=YY_START;
+                                          yyextra->ccomment=FALSE;  
+                                          yyextra->condCtx=YY_START;
                                          BEGIN(CondLineC);
                                        }
 <CondLineC,CondLineCpp>[!()&| \ta-z_A-Z0-9\x80-\xFF.\-]+      {
-                                         startCondSection(yytext);
-                                          if (g_skip)
+                                         startCondSection(yyscanner,yytext);
+                                          if (yyextra->skip)
                                           {
                                             if (YY_START==CondLineC)
                                             {
                                               // end C comment
-                                             outputArray("*/",2);
-                                              g_ccomment=TRUE;
+                                             outputArray(yyscanner,"*/",2);
+                                              yyextra->ccomment=TRUE;
                                             }
                                             else
                                             {
-                                              g_ccomment=FALSE;
+                                              yyextra->ccomment=FALSE;
                                             }
                                             BEGIN(SkipCond);
                                           }
                                           else
                                           {
-                                           BEGIN(g_condCtx);
+                                           BEGIN(yyextra->condCtx);
                                           }
                                        }
 <CondLineC,CondLineCpp>.               { // non-guard character
                                          unput(*yytext);
-                                         startCondSection(" ");
-                                          if (g_skip)
+                                         startCondSection(yyscanner," ");
+                                          if (yyextra->skip)
                                           {
                                             if (YY_START==CondLineC)
                                             {
                                               // end C comment
-                                             outputArray("*/",2);
-                                              g_ccomment=TRUE;
+                                             outputArray(yyscanner,"*/",2);
+                                              yyextra->ccomment=TRUE;
                                             }
                                             else
                                             {
-                                              g_ccomment=FALSE;
+                                              yyextra->ccomment=FALSE;
                                             }
                                             BEGIN(SkipCond);
                                           }
                                           else
                                           {
-                                           BEGIN(g_condCtx);
+                                           BEGIN(yyextra->condCtx);
                                           }
                                        }
 <SkipCComment,SkipCPPComment>[\\@]"cond"[ \t\r]*/\n { // no guard
                                           if (YY_START==SkipCComment)
                                           {
-                                            g_ccomment=TRUE;
+                                            yyextra->ccomment=TRUE;
                                             // end C comment
-                                           outputArray("*/",2);
+                                           outputArray(yyscanner,"*/",2);
                                           }
                                           else
                                           {
-                                            g_ccomment=FALSE;
+                                            yyextra->ccomment=FALSE;
                                           }
-                                          g_condCtx=YY_START;
-                                          startCondSection(" ");
+                                          yyextra->condCtx=YY_START;
+                                          startCondSection(yyscanner," ");
                                           BEGIN(SkipCond);
                                        }
-<SkipCond>\n                            { g_yyLineNr++; outputChar('\n'); }
+<SkipCond>\n                            { yyextra->yyLineNr++; outputChar(yyscanner,'\n'); }
 <SkipCond>.                             { }
 <SkipCond>[^\/\!*\\@\n]+                { }
-<SkipCond>"//"[/!]                      { g_ccomment=FALSE; }
-<SkipCond>"/*"[*!]                      { g_ccomment=TRUE; }
+<SkipCond>"//"[/!]                      { yyextra->ccomment=FALSE; }
+<SkipCond>"/*"[*!]                      { yyextra->ccomment=TRUE; }
 <SkipCond,SkipCComment,SkipCPPComment>[\\@][\\@]"endcond"/[^a-z_A-Z0-9\x80-\xFF] {
-                                          if (!g_skip)
+                                          if (!yyextra->skip)
                                           {
-                                           outputArray(yytext,(int)yyleng);
+                                           outputArray(yyscanner,yytext,(int)yyleng);
                                           }
                                         }
 <SkipCond>[\\@]"endcond"/[^a-z_A-Z0-9\x80-\xFF]  { 
-                                          bool oldSkip = g_skip;
-                                          endCondSection(); 
-                                          if (oldSkip && !g_skip)
+                                          bool oldSkip = yyextra->skip;
+                                          endCondSection(yyscanner);
+                                          if (oldSkip && !yyextra->skip)
                                           {
-                                            if (g_ccomment)
+                                            if (yyextra->ccomment)
                                             {
-                                              outputArray("/** ",4);
+                                              outputArray(yyscanner,"/** ",4);
                                             }
-                                            BEGIN(g_condCtx);
+                                            BEGIN(yyextra->condCtx);
                                           }
                                         }
 <SkipCComment,SkipCPPComment>[\\@]"endcond"/[^a-z_A-Z0-9\x80-\xFF] {
-                                          bool oldSkip = g_skip;
-                                         endCondSection();
-                                          if (oldSkip && !g_skip) 
+                                          bool oldSkip = yyextra->skip;
+                                         endCondSection(yyscanner);
+                                          if (oldSkip && !yyextra->skip) 
                                           {
-                                            BEGIN(g_condCtx);
+                                            BEGIN(yyextra->condCtx);
                                           }
                                        }
 <SkipVerbatim>[\\@]("endverbatim"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endrtfonly"|"endmanonly"|"enddot"|"endcode"|"f$"|"f]"|"f}") { /* end of verbatim block */
-                                         outputArray(yytext,(int)yyleng);
-                                         if (yytext[1]=='f' && g_blockName=="f")
+                                         outputArray(yyscanner,yytext,(int)yyleng);
+                                         if (yytext[1]=='f' && yyextra->blockName=="f")
                                          {
                                            BEGIN(SkipCComment);
                                          }
-                                         else if (&yytext[4]==g_blockName)
+                                         else if (&yytext[4]==yyextra->blockName)
                                          {
                                            BEGIN(SkipCComment);
                                          }
                                        }
 <SkipVerbatim>^({B}*"*"+)?{B}{0,3}"~~~"[~]*                 {
-                                         outputArray(yytext,(int)yyleng);
-                                          if (g_fenceSize==yyleng)
+                                         outputArray(yyscanner,yytext,(int)yyleng);
+                                          if (yyextra->fenceSize==yyleng)
                                           {
                                             BEGIN(SkipCComment);
                                           }
                                         }
 <SkipVerbatim>^({B}*"*"+)?{B}{0,3}"```"[`]*                 {
-                                         outputArray(yytext,(int)yyleng);
-                                          if (g_fenceSize==yyleng)
+                                         outputArray(yyscanner,yytext,(int)yyleng);
+                                          if (yyextra->fenceSize==yyleng)
                                           {
                                             BEGIN(SkipCComment);
                                           }
                                         }
 <SkipVerbatim>"*/"|"/*"                        {
-                                         outputArray(yytext,(int)yyleng);
+                                         outputArray(yyscanner,yytext,(int)yyleng);
                                        }
 <SkipCComment,SkipVerbatim>[^*\\@\x06~`\n\/]+ {
-                                         outputArray(yytext,(int)yyleng);
+                                         outputArray(yyscanner,yytext,(int)yyleng);
                                        }
 <SkipCComment,SkipVerbatim>\n          { 
-                                         g_yyLineNr++;
-                                         outputChar('\n');
+                                         yyextra->yyLineNr++;
+                                         outputChar(yyscanner,'\n');
                                        }
 <SkipCComment,SkipVerbatim>.           {
-                                         outputChar(*yytext);
+                                         outputChar(yyscanner,*yytext);
                                        }
 <CopyCComment>[^*a-z_A-Z\x80-\xFF\n]*[^*a-z_A-Z\x80-\xFF\\\n] {
-                                         g_defLitText+=yytext;
-                                         g_defText+=escapeAt(yytext);
+                                         yyextra->defLitText+=yytext;
+                                         yyextra->defText+=escapeAt(yytext);
                                        }
 <CopyCComment>\\[\r]?\n                 {
-                                          g_defLitText+=yytext;
-                                          outputChar('\n');
-                                          g_defText+=" ";
-                                          g_yyLineNr++;
-                                          g_yyMLines++;
+                                          yyextra->defLitText+=yytext;
+                                          yyextra->defText+=" ";
+                                          yyextra->yyLineNr++;
+                                          yyextra->yyMLines++;
                                         }
 <CopyCComment>"*/"                     {
-                                         g_defLitText+=yytext;
-                                         g_defText+=yytext;
-                                         BEGIN(g_lastCContext);
+                                         yyextra->defLitText+=yytext;
+                                         yyextra->defText+=yytext;
+                                         BEGIN(yyextra->lastCContext);
                                        }
 <CopyCComment>\n                       { 
-                                         g_yyLineNr++;
-                                         outputChar('\n');
-                                         g_defLitText+=yytext;
-                                         g_defText+=' ';
+                                         yyextra->yyLineNr++;
+                                         yyextra->defLitText+=yytext;
+                                         yyextra->defText+=' ';
                                        }
 <RemoveCComment>"*/"{B}*"#"            { // see bug 594021 for a usecase for this rule
-                                          if (g_lastCContext==SkipCPPBlock)
+                                          if (yyextra->lastCContext==SkipCPPBlock)
                                          {
                                            BEGIN(SkipCommand);
                                          }
@@ -2770,246 +1444,1673 @@ CHARLIT   (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
                                            REJECT;
                                          }
                                        }
-<RemoveCComment>"*/"                   { BEGIN(g_lastCContext); }
+<RemoveCComment>"*/"                   { BEGIN(yyextra->lastCContext); }
 <RemoveCComment>"//"                   
 <RemoveCComment>"/*"
 <RemoveCComment>[^*\x06\n]+
-<RemoveCComment>\n                     { g_yyLineNr++; outputChar('\n'); }
+<RemoveCComment>\n                     { yyextra->yyLineNr++; outputChar(yyscanner,'\n'); }
 <RemoveCComment>.                      
 <SkipCPPComment>[^\n\/\\@]+            {
-                                         outputArray(yytext,(int)yyleng);
+                                         outputArray(yyscanner,yytext,(int)yyleng);
                                        }
 <SkipCPPComment,RemoveCPPComment>\n    {
                                          unput(*yytext);
-                                         BEGIN(g_lastCPPContext);
+                                         BEGIN(yyextra->lastCPPContext);
                                        }
 <SkipCPPComment>"/*"                   {
-                                         outputChar('/');outputChar('*');
+                                         outputChar(yyscanner,'/');outputChar(yyscanner,'*');
                                        }
 <SkipCPPComment>"//"                   {
-                                         outputChar('/');outputChar('/');
+                                         outputChar(yyscanner,'/');outputChar(yyscanner,'/');
                                        }
 <SkipCPPComment>[^\x06\@\\\n]+         {
-                                         outputArray(yytext,(int)yyleng);
+                                         outputArray(yyscanner,yytext,(int)yyleng);
                                        }
 <SkipCPPComment>.                      {
-                                         outputChar(*yytext);
+                                         outputChar(yyscanner,*yytext);
                                        }
 <RemoveCPPComment>"/*"
 <RemoveCPPComment>"//"
 <RemoveCPPComment>[^\x06\n]+
 <RemoveCPPComment>.
 <DefineText>"#"                                {
-                                         g_quoteArg=TRUE;
-                                         g_defLitText+=yytext;
+                                         yyextra->quoteArg=TRUE;
+                                         yyextra->defLitText+=yytext;
                                        }
 <DefineText,CopyCComment>{ID}          {
-                                         g_defLitText+=yytext;
-                                         if (g_quoteArg)
+                                         yyextra->defLitText+=yytext;
+                                         if (yyextra->quoteArg)
                                          {
-                                           g_defText+="\"";
+                                           yyextra->defText+="\"";
                                          }
-                                         if (g_defArgs>0)
+                                         if (yyextra->defArgs>0)
                                          {
                                            int *n;
-                                           if ((n=(*g_argDict)[yytext]))
+                                           if ((n=(*yyextra->argDict)[yytext]))
                                            {
-                                             //if (!g_quoteArg) g_defText+=' ';
-                                             g_defText+='@';
+                                             //if (!yyextra->quoteArg) yyextra->defText+=' ';
+                                             yyextra->defText+='@';
                                              QCString numStr;
                                              numStr.sprintf("%d",*n);
-                                             g_defText+=numStr;
-                                             //if (!g_quoteArg) g_defText+=' ';
+                                             yyextra->defText+=numStr;
+                                             //if (!yyextra->quoteArg) yyextra->defText+=' ';
                                            }
                                            else
                                            {
-                                             g_defText+=yytext;
+                                             yyextra->defText+=yytext;
                                            }
                                          }
                                          else
                                          {
-                                           g_defText+=yytext;
+                                           yyextra->defText+=yytext;
                                          }
-                                         if (g_quoteArg)
+                                         if (yyextra->quoteArg)
                                          {
-                                           g_defText+="\"";
+                                           yyextra->defText+="\"";
                                          }
-                                         g_quoteArg=FALSE;
+                                         yyextra->quoteArg=FALSE;
                                        }
 <CopyCComment>.                                {
-                                         g_defLitText+=yytext;
-                                         g_defText+=yytext;
+                                         yyextra->defLitText+=yytext;
+                                         yyextra->defText+=yytext;
                                        }
 <DefineText>\\[\r]?\n                  {
-                                         g_defLitText+=yytext;
-                                         outputChar('\n');
-                                         g_defText += ' ';
-                                         g_yyLineNr++;
-                                         g_yyMLines++;
+                                         yyextra->defLitText+=yytext;
+                                         outputChar(yyscanner,'\n');
+                                         yyextra->defText += ' ';
+                                         yyextra->yyLineNr++;
+                                         yyextra->yyMLines++;
                                        }
 <DefineText>\n                         {
-                                         QCString comment=extractTrailingComment(g_defLitText);
-                                         g_defLitText+=yytext;
+                                         QCString comment=extractTrailingComment(yyextra->defLitText);
+                                         yyextra->defLitText+=yytext;
                                          if (!comment.isEmpty())
                                          {
-                                           outputArray(comment,comment.length());
-                                           g_defLitText=g_defLitText.left(g_defLitText.length()-comment.length()-1);
+                                           outputArray(yyscanner,comment,comment.length());
+                                           yyextra->defLitText=yyextra->defLitText.left(yyextra->defLitText.length()-comment.length()-1);
                                          }
-                                         outputChar('\n');
+                                         outputChar(yyscanner,'\n');
                                          Define *def=0;
-                                         //printf("Define name='%s' text='%s' litTexti='%s'\n",g_defName.data(),g_defText.data(),g_defLitText.data());
-                                         if (g_includeStack.isEmpty() || g_curlyCount>0) 
+                                         //printf("Define name='%s' text='%s' litTexti='%s'\n",yyextra->defName.data(),yyextra->defText.data(),yyextra->defLitText.data());
+                                         if (yyextra->includeStack.isEmpty() || yyextra->curlyCount>0) 
                                          {
-                                           addDefine();
+                                           addDefine(yyscanner);
                                          }
-                                         def=DefineManager::instance().isDefined(g_defName);
+                                         def=yyextra->defineManager.isDefined(yyextra->defName);
                                          if (def==0) // new define
                                          {
-                                           //printf("new define '%s'!\n",g_defName.data());
-                                           Define *nd = newDefine();
-                                           DefineManager::instance().addDefine(g_yyFileName,nd);
+                                           //printf("new define '%s'!\n",yyextra->defName.data());
+                                           Define *nd = newDefine(yyscanner);
+                                           yyextra->defineManager.addDefine(yyextra->yyFileName,nd);
+
+                                           // also add it to the local file list if it is a source file
+                                           //if (yyextra->isSource && yyextra->includeStack.isEmpty())
+                                           //{
+                                           //  yyextra->fileDefineDict->insert(yyextra->defName,nd);
+                                           //}
+                                         }
+                                         else if (def /*&& macroIsAccessible(def)*/)
+                                              // name already exists
+                                         {
+                                           //printf("existing define!\n");
+                                           //printf("define found\n");
+                                           if (def->undef) // undefined name
+                                           {
+                                             def->undef = FALSE;
+                                             def->name = yyextra->defName;
+                                             def->definition = yyextra->defText.stripWhiteSpace();
+                                             def->nargs = yyextra->defArgs;
+                                             def->fileName = yyextra->yyFileName.copy(); 
+                                             def->lineNr = yyextra->yyLineNr-yyextra->yyMLines;
+                                             def->columnNr = yyextra->yyColNr;
+                                           }
+                                           else
+                                           {
+                                             //printf("error: define %s is defined more than once!\n",yyextra->defName.data());
+                                           }
+                                         }
+                                         delete yyextra->argDict; yyextra->argDict=0;
+                                         yyextra->yyLineNr++;
+                                         yyextra->yyColNr=1;
+                                         yyextra->lastGuardName.resize(0);
+                                         BEGIN(Start);
+                                       }
+<DefineText>{B}*                       { yyextra->defText += ' '; yyextra->defLitText+=yytext; }
+<DefineText>{B}*"##"{B}*               { yyextra->defText += "##"; yyextra->defLitText+=yytext; }
+<DefineText>"@"                                { yyextra->defText += "@@"; yyextra->defLitText+=yytext; }
+<DefineText>\"                         { 
+                                          yyextra->defText += *yytext; 
+                                         yyextra->defLitText+=yytext; 
+                                         if (!yyextra->insideComment)
+                                         {
+                                           BEGIN(SkipDoubleQuote);
+                                         }
+                                       }
+<DefineText>\'                         { yyextra->defText += *yytext;
+                                         yyextra->defLitText+=yytext; 
+                                         if (!yyextra->insideComment)
+                                         {
+                                           BEGIN(SkipSingleQuote);
+                                         }
+                                       }
+<SkipDoubleQuote>"//"[/]?              { yyextra->defText += yytext; yyextra->defLitText+=yytext; }
+<SkipDoubleQuote>"/*"                  { yyextra->defText += yytext; yyextra->defLitText+=yytext; }
+<SkipDoubleQuote>\"                    {
+                                         yyextra->defText += *yytext; yyextra->defLitText+=yytext; 
+                                         BEGIN(DefineText);
+                                       }
+<SkipSingleQuote,SkipDoubleQuote>\\.   {
+                                         yyextra->defText += yytext; yyextra->defLitText+=yytext;
+                                       }
+<SkipSingleQuote>\'                    {
+                                         yyextra->defText += *yytext; yyextra->defLitText+=yytext;
+                                         BEGIN(DefineText);
+                                       }
+<SkipDoubleQuote>.                     { yyextra->defText += *yytext; yyextra->defLitText+=yytext; }
+<SkipSingleQuote>.                     { yyextra->defText += *yytext; yyextra->defLitText+=yytext; }
+<DefineText>.                          { yyextra->defText += *yytext; yyextra->defLitText+=yytext; }
+<<EOF>>                                        {
+                                          DBG_CTX((stderr,"End of include file\n"));
+                                         //printf("Include stack depth=%d\n",yyextra->includeStack.count());
+                                         if (yyextra->includeStack.isEmpty())
+                                         {
+                                           DBG_CTX((stderr,"Terminating scanner!\n"));
+                                           yyterminate();
+                                         }
+                                         else
+                                         {
+                                           FileState *fs=yyextra->includeStack.pop();
+                                           //fileDefineCache->merge(yyextra->yyFileName,fs->fileName);
+                                           YY_BUFFER_STATE oldBuf = YY_CURRENT_BUFFER;
+                                           yy_switch_to_buffer( fs->bufState, yyscanner );
+                                           yy_delete_buffer( oldBuf, yyscanner );
+                                           yyextra->yyLineNr    = fs->lineNr;
+                                            //preYYin = fs->oldYYin;
+                                            yyextra->inputBuf    = fs->oldFileBuf;
+                                           yyextra->inputBufPos = fs->oldFileBufPos;
+                                            yyextra->curlyCount = fs->curlyCount;
+                                           setFileName(yyscanner,fs->fileName);
+                                           DBG_CTX((stderr,"######## FileName %s\n",yyextra->yyFileName.data()));
+                                           
+                                            // Deal with file changes due to 
+                                            // #include's within { .. } blocks
+                                            QCString lineStr(15+yyextra->yyFileName.length());
+                                            lineStr.sprintf("# %d \"%s\" 2",yyextra->yyLineNr,yyextra->yyFileName.data());
+                                            outputArray(yyscanner,lineStr.data(),lineStr.length());
+                                           
+                                           delete fs; fs=0;
+                                         }
+                                       }
+<*>"/*"/"*/"                           |
+<*>"/*"[*]?                            {
+                                          if (YY_START==SkipVerbatim || YY_START==SkipCond)
+                                          {
+                                            REJECT;
+                                          }
+                                          else
+                                          {
+                                           outputArray(yyscanner,yytext,(int)yyleng);
+                                           yyextra->lastCContext=YY_START;
+                                           yyextra->commentCount=1;
+                                           if (yyleng==3) yyextra->lastGuardName.resize(0); // reset guard in case the #define is documented!
+                                           BEGIN(SkipCComment);
+                                          }
+                                       }
+<*>"//"[/]?                            {
+                                          if (YY_START==SkipVerbatim || YY_START==SkipCond || getLanguageFromFileName(yyextra->yyFileName)==SrcLangExt_Fortran)
+                                          {
+                                            REJECT;
+                                          }
+                                          else
+                                          {
+                                           outputArray(yyscanner,yytext,(int)yyleng);
+                                           yyextra->lastCPPContext=YY_START;
+                                           if (yyleng==3) yyextra->lastGuardName.resize(0); // reset guard in case the #define is documented!
+                                           BEGIN(SkipCPPComment);
+                                          }
+                                       }
+<*>\n                                  { 
+                                         outputChar(yyscanner,'\n');
+                                         yyextra->yyLineNr++; 
+                                       }
+<*>.                                   {
+                                         yyextra->expectGuard = FALSE;
+                                         outputChar(yyscanner,*yytext);
+                                       }
+
+%%
+
+/////////////////////////////////////////////////////////////////////////////////////
+
+static int yyread(yyscan_t yyscanner,char *buf,int max_size)
+{
+  YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
+  int bytesInBuf = state->inputBuf->curPos()-state->inputBufPos;
+  int bytesToCopy = QMIN(max_size,bytesInBuf);
+  memcpy(buf,state->inputBuf->data()+state->inputBufPos,bytesToCopy);
+  state->inputBufPos+=bytesToCopy;
+  return bytesToCopy;
+}
+
+static void setFileName(yyscan_t yyscanner,const char *name)
+{
+  YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
+  bool ambig;
+  QFileInfo fi(name);
+  state->yyFileName=fi.absFilePath().utf8();
+  state->yyFileDef=findFileDef(Doxygen::inputNameDict,state->yyFileName,ambig);
+  if (state->yyFileDef==0) // if this is not an input file check if it is an
+                      // include file
+  {
+    state->yyFileDef=findFileDef(Doxygen::includeNameDict,state->yyFileName,ambig);
+  }
+  //printf("setFileName(%s) state->yyFileName=%s state->yyFileDef=%p\n",
+  //    name,state->yyFileName.data(),state->yyFileDef);
+  if (state->yyFileDef && state->yyFileDef->isReference()) state->yyFileDef=0;
+  state->insideCS = getLanguageFromFileName(state->yyFileName)==SrcLangExt_CSharp;
+  state->isSource = guessSection(state->yyFileName);
+}
+
+static void incrLevel(yyscan_t yyscanner)
+{
+  YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
+  state->level++;
+  state->levelGuard.resize(state->level);
+  state->levelGuard[state->level-1]=FALSE;
+  //printf("%s line %d: incrLevel %d\n",yyextra->yyFileName.data(),yyextra->yyLineNr,yyextra->level);
+}
+
+static void decrLevel(yyscan_t yyscanner)
+{
+  YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
+  //printf("%s line %d: decrLevel %d\n",state->yyFileName.data(),state->yyLineNr,state->level);
+  if (state->level > 0)
+  {
+    state->level--;
+    state->levelGuard.resize(state->level);
+  }
+  else
+  {
+    warn(state->yyFileName,state->yyLineNr,"More #endif's than #if's found.\n");
+  }
+}
+
+static bool otherCaseDone(yyscan_t yyscanner)
+{
+  YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
+  if (state->level==0)
+  {
+    warn(state->yyFileName,state->yyLineNr,"Found an #else without a preceding #if.\n");
+    return TRUE;
+  }
+  else
+  {
+    return state->levelGuard[state->level-1];
+  }
+}
+
+static void setCaseDone(yyscan_t yyscanner,bool value)
+{
+  YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
+  state->levelGuard[state->level-1]=value;
+}
+
+
+static FileState *checkAndOpenFile(yyscan_t yyscanner,const QCString &fileName,bool &alreadyIncluded)
+{
+  YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
+  alreadyIncluded = FALSE;
+  FileState *fs = 0;
+  //printf("checkAndOpenFile(%s)\n",fileName.data());
+  QFileInfo fi(fileName);
+  if (fi.exists() && fi.isFile())
+  {
+    const QStrList &exclPatterns = Config_getList(EXCLUDE_PATTERNS);
+    if (patternMatch(fi,&exclPatterns)) return 0;
+
+    QCString absName = fi.absFilePath().utf8();
+
+    // global guard
+    if (state->curlyCount==0) // not #include inside { ... }
+    {
+      if (state->allIncludes.find(absName)!=0)
+      {
+        alreadyIncluded = TRUE;
+        //printf("  already included 1\n");
+        return 0; // already done
+      }
+      state->allIncludes.insert(absName,(void *)0x8);
+    }
+    // check include stack for absName
+
+    QStack<FileState> tmpStack;
+    state->includeStack.setAutoDelete(FALSE);
+    while ((fs=state->includeStack.pop()))
+    {
+      if (fs->fileName==absName) alreadyIncluded=TRUE;
+      tmpStack.push(fs);
+    }
+    while ((fs=tmpStack.pop()))
+    {
+      state->includeStack.push(fs);
+    }
+    state->includeStack.setAutoDelete(TRUE);
+
+    if (alreadyIncluded)
+    {
+      //printf("  already included 2\n");
+      return 0;
+    }
+    //printf("#include %s\n",absName.data());
+
+    fs = new FileState(fi.size()+4096);
+    alreadyIncluded = FALSE;
+    if (!readInputFile(absName,fs->fileBuf))
+    { // error
+      //printf("  error reading\n");
+      delete fs;
+      fs=0;
+    }
+    else
+    {
+      fs->oldFileBuf    = state->inputBuf;
+      fs->oldFileBufPos = state->inputBufPos;
+    }
+  }
+  return fs;
+}
+
+static FileState *findFile(yyscan_t yyscanner, const char *fileName,bool localInclude,bool &alreadyIncluded)
+{
+  YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
+  //printf("** findFile(%s,%d) state->yyFileName=%s\n",fileName,localInclude,state->yyFileName.data());
+  if (Portable::isAbsolutePath(fileName))
+  {
+    FileState *fs = checkAndOpenFile(yyscanner,fileName,alreadyIncluded);
+    if (fs)
+    {
+      setFileName(yyscanner,fileName);
+      state->yyLineNr=1;
+      return fs;
+    }
+    else if (alreadyIncluded)
+    {
+      return 0;
+    }
+  }
+  if (localInclude && !state->yyFileName.isEmpty())
+  {
+    QFileInfo fi(state->yyFileName);
+    if (fi.exists())
+    {
+      QCString absName = QCString(fi.dirPath(TRUE).data())+"/"+fileName;
+      FileState *fs = checkAndOpenFile(yyscanner,absName,alreadyIncluded);
+      if (fs)
+      {
+       setFileName(yyscanner,absName);
+       state->yyLineNr=1;
+       return fs;
+      }
+      else if (alreadyIncluded)
+      {
+       return 0;
+      }
+    }
+  }
+  if (state->pathList==0) 
+  {
+    return 0;
+  }
+  char *s=state->pathList->first();
+  while (s)
+  {
+    QCString absName = (QCString)s+"/"+fileName;
+    //printf("  Looking for %s in %s\n",fileName,s);
+    FileState *fs = checkAndOpenFile(yyscanner,absName,alreadyIncluded);
+    if (fs)
+    {
+      setFileName(yyscanner,absName);
+      state->yyLineNr=1;
+      //printf("  -> found it\n");
+      return fs;
+    }
+    else if (alreadyIncluded)
+    {
+      return 0;
+    }
+
+    s=state->pathList->next();
+  } 
+  return 0;
+}
+
+static QCString extractTrailingComment(const char *s)
+{
+  if (s==0) return "";
+  int i=strlen(s)-1;
+  while (i>=0)
+  {
+    char c=s[i];
+    switch (c)
+    {
+      case '/':
+       {
+         i--;
+         if (i>=0 && s[i]=='*') // end of a comment block
+         {
+           i--;
+           while (i>0 && !(s[i-1]=='/' && s[i]=='*')) i--;
+           if (i==0) 
+           {
+             i++;
+           }
+           // only /*!< or /**< are treated as a comment for the macro name,
+           // otherwise the comment is treated as part of the macro definition
+           return ((s[i+1]=='*' || s[i+1]=='!') && s[i+2]=='<') ? &s[i-1] : ""; 
+         }
+         else
+         {
+           return "";
+         }
+       } 
+       break;
+       // whitespace or line-continuation
+      case ' ':
+      case '\t': 
+      case '\r':
+      case '\n':
+      case '\\':
+       break;
+      default:
+       return "";
+    }
+    i--;
+  }
+  return "";
+}
+
+static int getNextChar(yyscan_t yyscanner,const QCString &expr,QCString *rest,uint &pos);
+static int getCurrentChar(yyscan_t yyscanner,const QCString &expr,QCString *rest,uint pos);
+static void unputChar(yyscan_t yyscanner,const QCString &expr,QCString *rest,uint &pos,char c);
+static bool expandExpression(yyscan_t yyscanner,QCString &expr,QCString *rest,int pos,int level);
+
+static QCString stringize(const QCString &s)
+{
+  QCString result;
+  uint i=0;
+  bool inString=FALSE;
+  bool inChar=FALSE;
+  char c,pc;
+  while (i<s.length())
+  {
+    if (!inString && !inChar)
+    {
+      while (i<s.length() && !inString && !inChar)
+      {
+       c=s.at(i++);
+       if (c=='"')
+       {
+         result+="\\\"";
+         inString=TRUE;
+       }
+       else if (c=='\'')
+       {
+         result+=c;
+         inChar=TRUE;
+       }
+       else
+       {
+         result+=c;
+       }
+      }
+    }
+    else if (inChar)
+    {
+      while (i<s.length() && inChar)
+      {
+       c=s.at(i++);
+       if (c=='\'')
+       {
+         result+='\'';
+         inChar=FALSE;
+       }
+       else if (c=='\\')
+       {
+         result+="\\\\";
+       }
+       else
+       {
+         result+=c;
+       }
+      }
+    }
+    else
+    {
+      pc=0;
+      while (i<s.length() && inString)
+      {
+       char c=s.at(i++);
+       if (c=='"') 
+       {
+         result+="\\\"";
+         inString= pc=='\\';
+       }
+       else if (c=='\\')
+         result+="\\\\";
+       else
+         result+=c;
+       pc=c;
+      }
+    }
+  }
+  //printf("stringize '%s'->'%s'\n",s.data(),result.data());
+  return result;
+}
+
+/*! Execute all ## operators in expr. 
+ * If the macro name before or after the operator contains a no-rescan 
+ * marker (@-) then this is removed (before the concatenated macro name
+ * may be expanded again.
+ */
+static void processConcatOperators(QCString &expr)
+{
+  //printf("processConcatOperators: in='%s'\n",expr.data());
+  QRegExp r("[ \\t\\n]*##[ \\t\\n]*"); 
+  int l,n,i=0;
+  if (expr.isEmpty()) return;
+  while ((n=r.match(expr,i,&l))!=-1)
+  {
+    //printf("Match: '%s'\n",expr.data()+i);
+    if (n+l+1<(int)expr.length() && expr.at(n+l)=='@' && expr.at(n+l+1)=='-')
+    {
+      // remove no-rescan marker after ID
+      l+=2;
+    }
+    //printf("found '%s'\n",expr.mid(n,l).data());
+    // remove the ## operator and the surrounding whitespace
+    expr=expr.left(n)+expr.right(expr.length()-n-l);
+    int k=n-1;
+    while (k>=0 && isId(expr.at(k))) k--; 
+    if (k>0 && expr.at(k)=='-' && expr.at(k-1)=='@')
+    {
+      // remove no-rescan marker before ID
+      expr=expr.left(k-1)+expr.right(expr.length()-k-1);
+      n-=2;
+    }
+    i=n;
+  }
+  //printf("processConcatOperators: out='%s'\n",expr.data());
+}
+
+static void returnCharToStream(yyscan_t yyscanner,char c)
+{
+  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+  unput(c);
+}
+
+static inline void addTillEndOfString(yyscan_t yyscanner,const QCString &expr,QCString *rest,
+                                       uint &pos,char term,QCString &arg)
+{
+  int cc;
+  while ((cc=getNextChar(yyscanner,expr,rest,pos))!=EOF && cc!=0)
+  {
+    if (cc=='\\') arg+=(char)cc,cc=getNextChar(yyscanner,expr,rest,pos);
+    else if (cc==term) return;
+    arg+=(char)cc;
+  }
+}
+
+/*! replaces the function macro \a def whose argument list starts at
+ * \a pos in expression \a expr. 
+ * Notice that this routine may scan beyond the \a expr string if needed.
+ * In that case the characters will be read from the input file.
+ * The replacement string will be returned in \a result and the 
+ * length of the (unexpanded) argument list is stored in \a len.
+ */ 
+static bool replaceFunctionMacro(yyscan_t yyscanner,const QCString &expr,QCString *rest,int pos,int &len,const Define *def,QCString &result,int level)
+{
+  YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
+  //printf(">replaceFunctionMacro(expr='%s',rest='%s',pos=%d,def='%s') level=%d\n",expr.data(),rest ? rest->data() : 0,pos,def->name.data(),state->level);
+  uint j=pos;
+  len=0;
+  result.resize(0);
+  int cc;
+  while ((cc=getCurrentChar(yyscanner,expr,rest,j))!=EOF && isspace(cc)) 
+  { 
+    len++; 
+    getNextChar(yyscanner,expr,rest,j); 
+  }
+  if (cc!='(') 
+  { 
+    unputChar(yyscanner,expr,rest,j,cc); 
+    return FALSE; 
+  }
+  getNextChar(yyscanner,expr,rest,j); // eat the '(' character
+
+  QDict<QCString> argTable;  // list of arguments
+  argTable.setAutoDelete(TRUE);
+  QCString arg;
+  int argCount=0;
+  bool done=FALSE;
+  
+  // PHASE 1: read the macro arguments
+  if (def->nargs==0)
+  {
+    while ((cc=getNextChar(yyscanner,expr,rest,j))!=EOF && cc!=0)
+    {
+      char c = (char)cc;
+      if (c==')') break;
+    }
+  }
+  else
+  {
+    while (!done && (argCount<def->nargs || def->varArgs) && 
+       ((cc=getNextChar(yyscanner,expr,rest,j))!=EOF && cc!=0)
+         )
+    {
+      char c=(char)cc;
+      if (c=='(') // argument is a function => search for matching )
+      {
+       int level=1;
+       arg+=c;
+       //char term='\0';
+       while ((cc=getNextChar(yyscanner,expr,rest,j))!=EOF && cc!=0)
+       {
+         char c=(char)cc;
+         //printf("processing %c: term=%c (%d)\n",c,term,term);
+         if (c=='\'' || c=='\"') // skip ('s and )'s inside strings
+         {
+           arg+=c;
+           addTillEndOfString(yyscanner,expr,rest,j,c,arg);
+         }
+         if (c==')')
+         {
+           level--;
+           arg+=c;
+           if (level==0) break;
+         }
+         else if (c=='(')
+         {
+           level++;
+           arg+=c;
+         }
+         else
+           arg+=c;
+       }
+      }
+      else if (c==')' || c==',') // last or next argument found
+      {
+       if (c==',' && argCount==def->nargs-1 && def->varArgs)
+       {
+         arg=arg.stripWhiteSpace();
+         arg+=',';
+       }
+       else
+       {
+         QCString argKey;
+         argKey.sprintf("@%d",argCount++); // key name
+         arg=arg.stripWhiteSpace();
+         // add argument to the lookup table
+         argTable.insert(argKey, new QCString(arg));
+         arg.resize(0);
+         if (c==')') // end of the argument list
+         {
+           done=TRUE;
+         }
+       }
+      } 
+      else if (c=='\"') // append literal strings
+      {
+       arg+=c; 
+       bool found=FALSE;
+       while (!found && (cc=getNextChar(yyscanner,expr,rest,j))!=EOF && cc!=0)
+       {
+         found = cc=='"';
+         if (cc=='\\')
+         {
+           c=(char)cc;   
+           arg+=c;
+           if ((cc=getNextChar(yyscanner,expr,rest,j))==EOF || cc==0) break;
+         }
+         c=(char)cc;     
+         arg+=c;
+       }
+      }
+      else if (c=='\'') // append literal characters
+      {
+       arg+=c;
+       bool found=FALSE;
+       while (!found && (cc=getNextChar(yyscanner,expr,rest,j))!=EOF && cc!=0)
+       {
+         found = cc=='\'';
+         if (cc=='\\')
+         {
+           c=(char)cc;   
+           arg+=c;
+           if ((cc=getNextChar(yyscanner,expr,rest,j))==EOF || cc==0) break;
+         }
+         c=(char)cc;
+         arg+=c;
+       }
+      }            
+      else if (c=='/') // possible start of a comment
+      {
+        char prevChar = '\0';
+        arg+=c;
+        if ((cc=getCurrentChar(yyscanner,expr,rest,j)) == '*') // we have a comment
+        {
+          while ((cc=getNextChar(yyscanner,expr,rest,j))!=EOF && cc!=0)
+          {
+            c=(char)cc;
+            arg+=c;
+            if (c == '/' && prevChar == '*') break; // we have an end of comment
+            prevChar = c;
+          }
+        }
+      }
+      else // append other characters
+      {
+       arg+=c;
+      }
+    }
+  }
+
+  // PHASE 2: apply the macro function
+  if (argCount==def->nargs || // same number of arguments
+      (argCount>=def->nargs-1 && def->varArgs)) // variadic macro with at least as many
+                                                // params as the non-variadic part (see bug731985)
+  {
+    uint k=0;
+    // substitution of all formal arguments
+    QCString resExpr;
+    const QCString d=def->definition.stripWhiteSpace();
+    //printf("Macro definition: '%s'\n",d.data());
+    bool inString=FALSE;
+    while (k<d.length())
+    {
+      if (d.at(k)=='@') // maybe a marker, otherwise an escaped @
+      {
+       if (d.at(k+1)=='@') // escaped @ => copy it (is unescaped later)
+       {
+         k+=2;
+         resExpr+="@@"; // we unescape these later
+       }
+       else if (d.at(k+1)=='-') // no-rescan marker
+       {
+         k+=2;
+         resExpr+="@-";
+       }
+       else // argument marker => read the argument number
+       {
+         QCString key="@";
+         QCString *subst=0;
+         bool hash=FALSE;
+         int l=k-1;
+         // search for ## backward
+         if (l>=0 && d.at(l)=='"') l--;
+         while (l>=0 && d.at(l)==' ') l--;
+         if (l>0 && d.at(l)=='#' && d.at(l-1)=='#') hash=TRUE;
+         k++;
+         // scan the number
+         while (k<d.length() && d.at(k)>='0' && d.at(k)<='9') key+=d.at(k++);
+         if (!hash) 
+         {
+           // search for ## forward
+           l=k;
+           if (l<(int)d.length() && d.at(l)=='"') l++;
+           while (l<(int)d.length() && d.at(l)==' ') l++;
+           if (l<(int)d.length()-1 && d.at(l)=='#' && d.at(l+1)=='#') hash=TRUE;
+         }
+         //printf("request key %s result %s\n",key.data(),argTable[key]->data());
+         if (key.length()>1 && (subst=argTable[key])) 
+         {
+           QCString substArg=*subst;
+           //printf("substArg='%s'\n",substArg.data());
+           // only if no ## operator is before or after the argument
+           // marker we do macro expansion.
+           if (!hash)
+            {
+              expandExpression(yyscanner,substArg,0,0,level+1);
+            }
+           if (inString)
+           {
+             //printf("'%s'=stringize('%s')\n",stringize(*subst).data(),subst->data());
+
+             // if the marker is inside a string (because a # was put 
+             // before the macro name) we must escape " and \ characters
+             resExpr+=stringize(substArg);
+           }
+           else
+           {
+             if (hash && substArg.isEmpty())
+             {
+               resExpr+="@E"; // empty argument will be remove later on
+             }
+             else if (state->nospaces)
+             {
+               resExpr+=substArg;
+             }
+             else
+             {
+               resExpr+=" "+substArg+" ";
+             }
+           }
+         }
+       }
+      }
+      else // no marker, just copy
+      {
+       if (!inString && d.at(k)=='\"') 
+       {
+         inString=TRUE; // entering a literal string
+       }
+       else if (inString && d.at(k)=='\"' && (d.at(k-1)!='\\' || d.at(k-2)=='\\'))
+       {
+         inString=FALSE; // leaving a literal string
+       }
+       resExpr+=d.at(k++);
+      }
+    }
+    len=j-pos;
+    result=resExpr;
+    //printf("<replaceFunctionMacro(expr='%s',rest='%s',pos=%d,def='%s',result='%s') level=%d return=TRUE\n",expr.data(),rest ? rest->data() : 0,pos,def->name.data(),result.data(),state->level);
+    return TRUE;
+  }
+  //printf("<replaceFunctionMacro(expr='%s',rest='%s',pos=%d,def='%s',result='%s') level=%d return=FALSE\n",expr.data(),rest ? rest->data() : 0,pos,def->name.data(),result.data(),state->level);
+  return FALSE;
+}
+
+
+/*! returns the next identifier in string \a expr by starting at position \a p.
+ * The position of the identifier is returned (or -1 if nothing is found)
+ * and \a l is its length. Any quoted strings are skipping during the search.
+ */
+static int getNextId(const QCString &expr,int p,int *l)
+{
+  int n;
+  while (p<(int)expr.length())
+  {
+    char c=expr.at(p++);
+    if (isdigit(c)) // skip number
+    {
+      while (p<(int)expr.length() && isId(expr.at(p))) p++;
+    }
+    else if (isalpha(c) || c=='_') // read id
+    {
+      n=p-1;
+      while (p<(int)expr.length() && isId(expr.at(p))) p++;
+      *l=p-n;
+      return n; 
+    }
+    else if (c=='"') // skip string
+    {
+      char ppc=0,pc=c;
+      if (p<(int)expr.length()) c=expr.at(p);
+      while (p<(int)expr.length() && (c!='"' || (pc=='\\' && ppc!='\\'))) 
+       // continue as long as no " is found, but ignoring \", but not \\"
+      {
+       ppc=pc;
+       pc=c;
+       c=expr.at(p);
+       p++;
+      }
+      if (p<(int)expr.length()) ++p; // skip closing quote
+    }
+    else if (c=='/') // skip C Comment
+    {
+      //printf("Found C comment at p=%d\n",p);
+      char pc=c;
+      if (p<(int)expr.length()) 
+      {
+       c=expr.at(p);
+        if (c=='*')  // Start of C comment
+        { 
+         p++;
+         while (p<(int)expr.length() && !(pc=='*' && c=='/'))
+         {
+           pc=c;
+           c=expr.at(p++);
+         }
+        }
+      }
+      //printf("Found end of C comment at p=%d\n",p);
+    }
+  }
+  return -1;
+}
+
+/*! performs recursive macro expansion on the string \a expr
+ *  starting at position \a pos.
+ *  May read additional characters from the input while re-scanning!
+ */
+static bool expandExpression(yyscan_t yyscanner,QCString &expr,QCString *rest,int pos,int level)
+{
+  YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
+  //printf(">expandExpression(expr='%s',rest='%s',pos=%d,level=%d)\n",expr.data(),rest ? rest->data() : "", pos, level);
+  if (expr.isEmpty())
+  {
+    //printf("<expandExpression: empty\n");
+    return TRUE;
+  }
+  if (state->expansionDict.find(expr)!=0) // check for recursive expansions
+  {
+    //printf("<expandExpression: already expanded expr='%s'\n",expr.data());
+    return FALSE;
+  }
+  else
+  {
+    state->expansionDict.insert(expr,(void*)0x8);
+  }
+  QCString macroName;
+  QCString expMacro;
+  bool definedTest=FALSE;
+  int i=pos,l,p,len;
+  while ((p=getNextId(expr,i,&l))!=-1) // search for an macro name
+  {
+    bool replaced=FALSE;
+    macroName=expr.mid(p,l);
+    //printf(" p=%d macroName=%s\n",p,macroName.data());
+    if (p<2 || !(expr.at(p-2)=='@' && expr.at(p-1)=='-')) // no-rescan marker?
+    {
+      if (state->expandedDict->find(macroName)==0) // expand macro
+      {
+       Define *def=state->defineManager.isDefined(macroName);
+        if (macroName=="defined")
+        {
+         //printf("found defined inside macro definition '%s'\n",expr.right(expr.length()-p).data());
+         definedTest=TRUE;
+        }
+       else if (definedTest) // macro name was found after defined 
+       {
+         if (def) expMacro = " 1 "; else expMacro = " 0 ";
+         replaced=TRUE;
+         len=l;
+         definedTest=FALSE;
+       }
+       else if (def && def->nargs==-1) // simple macro
+       {
+         // substitute the definition of the macro
+         //printf("macro '%s'->'%s'\n",macroName.data(),def->definition.data());
+         if (state->nospaces)
+         {
+           expMacro=def->definition.stripWhiteSpace();
+         }
+         else
+         {
+           expMacro=" "+def->definition.stripWhiteSpace()+" ";
+         }
+         //expMacro=def->definition.stripWhiteSpace();
+         replaced=TRUE;
+         len=l;
+         //printf("simple macro expansion='%s'->'%s'\n",macroName.data(),expMacro.data());
+       }
+       else if (def && def->nargs>=0) // function macro
+       {
+          //printf(" >>>> call replaceFunctionMacro\n");
+         replaced=replaceFunctionMacro(yyscanner,expr,rest,p+l,len,def,expMacro,level);
+          //printf(" <<<< call replaceFunctionMacro: replaced=%d\n",replaced);
+         len+=l;
+       }
+        //printf(" macroName='%s' expMacro='%s' replaced=%d\n",macroName.data(),expMacro.data(),replaced);
+
+       if (replaced) // expand the macro and rescan the expression
+       {
+         //printf(" replacing '%s'->'%s'\n",expr.mid(p,len).data(),expMacro.data());
+         QCString resultExpr=expMacro;
+         QCString restExpr=expr.right(expr.length()-len-p);
+         processConcatOperators(resultExpr);
+          //printf(" macroName=%s restExpr='%s' def->nonRecursive=%d\n",macroName.data(),restExpr.data(),def->nonRecursive);
+          bool expanded=false;
+         if (def && !def->nonRecursive)
+         {
+           state->expandedDict->insert(macroName,def);
+           expanded = expandExpression(yyscanner,resultExpr,&restExpr,0,level+1);
+           state->expandedDict->remove(macroName);
+         }
+          if (expanded)
+          {
+           expr=expr.left(p)+resultExpr+restExpr;
+           //printf(" new expression: '%s' old i=%d new i=%d\n",expr.data(),i,p);
+           i=p;
+          }
+          else
+          {
+           expr=expr.left(p)+"@-"+expr.right(expr.length()-p);
+            i=p+l+2;
+          }
+       }
+       else // move to the next macro name
+       {
+         //printf(" moving to the next macro old i=%d new i=%d\n",i,p+l);
+         i=p+l;
+       }
+      }
+      else // move to the next macro name
+      {
+       expr=expr.left(p)+"@-"+expr.right(expr.length()-p);
+       //printf("macro already expanded, moving to the next macro expr=%s\n",expr.data());
+       i=p+l+2;
+       //i=p+l;
+      }
+    }
+    else // no re-scan marker found, skip the macro name
+    {
+      //printf("skipping marked macro\n");
+      i=p+l;
+    }
+  }
+  //printf("<expandExpression(expr='%s',rest='%s',pos=%d,level=%d)\n",expr.data(),rest ? rest->data() : 0, pos,level);
+  return TRUE;
+}
+
+/*! @brief Process string or character literal.
+ *
+ * \a inputStr should point to the start of a string or character literal.
+ * the routine will return a pointer to just after the end of the literal
+ * the character making up the literal will be added to \a result.
+ */
+static const char *processUntilMatchingTerminator(const char *inputStr,QCString &result)
+{
+  if (inputStr==0) return inputStr;
+  char term = *inputStr; // capture start character of the literal
+  if (term!='\'' && term!='"') return inputStr; // not a valid literal
+  char c=term;
+  // output start character
+  result+=c;
+  inputStr++;
+  while ((c=*inputStr)) // while inside the literal
+  {
+    if (c==term) // found end marker of the literal
+    {
+      // output end character and stop
+      result+=c;
+      inputStr++;
+      break;
+    }
+    else if (c=='\\') // escaped character, process next character
+                      // as well without checking for end marker.
+    {
+      result+=c;
+      inputStr++;
+      c=*inputStr;
+      if (c==0) break; // unexpected end of string after escape character
+    }
+    result+=c;
+    inputStr++;
+  }
+  return inputStr;
+}
+
+/*! replaces all occurrences of @@@@ in \a s by @@
+ *  and removes all occurrences of @@E.
+ *  All identifiers found are replaced by 0L
+ */
+static QCString removeIdsAndMarkers(const char *s)
+{
+  //printf("removeIdsAndMarkers(%s)\n",s);
+  const char *p=s;
+  char c;
+  bool inNum=FALSE;
+  QCString result;
+  if (p)
+  {
+    while ((c=*p))
+    {
+      if (c=='@') // replace @@ with @ and remove @E
+      {
+       if (*(p+1)=='@')
+       {
+         result+=c; 
+       }
+       else if (*(p+1)=='E')
+       {
+         // skip
+       }
+       p+=2;
+      }
+      else if (isdigit(c)) // number
+      {
+       result+=c;
+       p++;
+        inNum=TRUE;    
+      }
+      else if (c=='\'') // quoted character
+      {
+        p = processUntilMatchingTerminator(p,result);
+      }
+      else if (c=='d' && !inNum) // identifier starting with a 'd'
+      {
+       if (qstrncmp(p,"defined ",8)==0 || qstrncmp(p,"defined(",8)==0) 
+                  // defined keyword
+       {
+         p+=7; // skip defined
+       }
+       else
+       {
+         result+="0L";
+         p++;
+         while ((c=*p) && isId(c)) p++;
+       }
+      }
+      else if ((isalpha(c) || c=='_') && !inNum) // replace identifier with 0L
+      {
+       result+="0L";
+       p++;
+       while ((c=*p) && isId(c)) p++;
+       while ((c=*p) && isspace((uchar)c)) p++;
+       if (*p=='(') // undefined function macro
+       {
+         p++;
+         int count=1;
+         while ((c=*p++))
+         {
+           if (c=='(') count++;
+           else if (c==')')
+           {
+             count--;
+             if (count==0) break;
+           }
+           else if (c=='/')
+           {
+             char pc=c;
+             c=*++p;
+             if (c=='*') // start of C comment
+             {
+               while (*p && !(pc=='*' && c=='/')) // search end of comment
+               {
+                 pc=c;
+                 c=*++p;
+               }
+               p++;
+             }
+           }
+         }
+       }
+      }
+      else if (c=='/') // skip C comments
+      {
+       char pc=c;
+       c=*++p;
+       if (c=='*') // start of C comment
+       { 
+         while (*p && !(pc=='*' && c=='/')) // search end of comment
+         {
+           pc=c;
+           c=*++p;
+         }
+         p++;
+       }
+       else // oops, not comment but division
+       {
+         result+=pc;
+         goto nextChar;
+       }
+      }
+      else 
+      {
+nextChar:
+       result+=c;
+       char lc=tolower(c);
+       if (!isId(lc) && lc!='.' /*&& lc!='-' && lc!='+'*/) inNum=FALSE;
+       p++;
+      }
+    }
+  }
+  //printf("removeIdsAndMarkers(%s)=%s\n",s,result.data());
+  return result;
+}
+
+/*! replaces all occurrences of @@ in \a s by @
+ *  \par assumption: 
+ *   \a s only contains pairs of @@'s
+ */
+static QCString removeMarkers(const char *s)
+{
+  const char *p=s;
+  char c;
+  QCString result;
+  if (p)
+  {
+    while ((c=*p))
+    {
+      switch(c)
+      {
+       case '@': // replace @@ with @
+         {
+           if (*(p+1)=='@')
+           {
+             result+=c; 
+           }
+           p+=2;
+         }
+         break;
+       case '/': // skip C comments
+         {
+           result+=c;
+           char pc=c;
+           c=*++p;
+           if (c=='*') // start of C comment
+           { 
+             while (*p && !(pc=='*' && c=='/')) // search end of comment
+             {
+               if (*p=='@' && *(p+1)=='@') 
+                 result+=c,p++;
+               else 
+                 result+=c;
+               pc=c;
+               c=*++p;
+             }
+             if (*p) result+=c,p++;
+           }
+         }
+         break;
+       case '"': // skip string literals
+       case '\'': // skip char literals
+          p = processUntilMatchingTerminator(p,result);
+         break;
+       default:
+         {
+           result+=c;
+           p++;
+         }
+         break;
+      }
+    }
+  }
+  //printf("RemoveMarkers(%s)=%s\n",s,result.data());
+  return result;
+}
+
+/*! compute the value of the expression in string \a expr.
+ *  If needed the function may read additional characters from the input.
+ */
+
+static bool computeExpression(yyscan_t yyscanner,const QCString &expr)
+{
+  YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
+  QCString e=expr;
+  state->expansionDict.clear();
+  expandExpression(yyscanner,e,0,0,0);
+  //printf("after expansion '%s'\n",e.data());
+  e = removeIdsAndMarkers(e);
+  if (e.isEmpty()) return FALSE;
+  //printf("parsing '%s'\n",e.data());
+  return state->constExpParser.parse(state->yyFileName,state->yyLineNr,e);
+}
+
+/*! expands the macro definition in \a name
+ *  If needed the function may read additional characters from the input
+ */
+
+static QCString expandMacro(yyscan_t yyscanner,const QCString &name)
+{
+  YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
+  QCString n=name;
+  state->expansionDict.clear();
+  expandExpression(yyscanner,n,0,0,0);
+  n=removeMarkers(n);
+  //printf("expandMacro '%s'->'%s'\n",name.data(),n.data());
+  return n;
+}
+
+static Define *newDefine(yyscan_t yyscanner)
+{
+  YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
+  Define *def=new Define;
+  def->name       = state->defName;
+  def->definition = state->defText.stripWhiteSpace();
+  def->nargs      = state->defArgs;
+  def->fileName   = state->yyFileName; 
+  def->fileDef    = state->yyFileDef;
+  def->lineNr     = state->yyLineNr-state->yyMLines;
+  def->columnNr   = state->yyColNr;
+  def->varArgs    = state->defVarArgs;
+  //printf("newDefine: %s %s file: %s\n",def->name.data(),def->definition.data(),
+  //    def->fileDef ? def->fileDef->name().data() : def->fileName.data());
+  //printf("newDefine: '%s'->'%s'\n",def->name.data(),def->definition.data());
+  if (!def->name.isEmpty() && Doxygen::expandAsDefinedDict[def->name])
+  {
+    def->isPredefined=TRUE;
+  }
+  return def;
+}
+
+static void addDefine(yyscan_t yyscanner)
+{
+  YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
+  if (state->skip) return; // do not add this define as it is inside a 
+                      // conditional section (cond command) that is disabled.
+  if (!Doxygen::gatherDefines) return;
+
+  //printf("addDefine '%s' '%s'\n",state->defName.data(),state->defArgsStr.data());
+  //ArgumentList *al = new ArgumentList;
+  //stringToArgumentList(state->defArgsStr,al);
+  MemberDef *md=createMemberDef(
+      state->yyFileName,state->yyLineNr-state->yyMLines,state->yyColNr,
+      "#define",state->defName,state->defArgsStr,0,
+      Public,Normal,FALSE,Member,MemberType_Define,ArgumentList(),ArgumentList(),"");
+  if (!state->defArgsStr.isEmpty())
+  {
+    ArgumentList argList;
+    //printf("addDefine() state->defName='%s' state->defArgsStr='%s'\n",state->defName.data(),state->defArgsStr.data());
+    stringToArgumentList(SrcLangExt_Cpp, state->defArgsStr,argList);
+    md->setArgumentList(argList);
+  }
+  //printf("Setting initializer for '%s' to '%s'\n",state->defName.data(),state->defText.data());
+  int l=state->defLitText.find('\n');
+  if (l>0 && state->defLitText.left(l).stripWhiteSpace()=="\\")
+  {
+    // strip first line if it only contains a slash
+    state->defLitText = state->defLitText.right(state->defLitText.length()-l-1);
+  }
+  else if (l>0)
+  {
+    // align the items on the first line with the items on the second line
+    int k=l+1;
+    const char *p=state->defLitText.data()+k;
+    char c;
+    while ((c=*p++) && (c==' ' || c=='\t')) k++;
+    state->defLitText=state->defLitText.mid(l+1,k-l-1)+state->defLitText.stripWhiteSpace();
+  }
+  QCString defLitTextStripped = state->defLitText.stripWhiteSpace();
+  if (defLitTextStripped.contains('\n')>=1)
+  {
+    md->setInitializer(state->defLitText);
+  }
+  else
+  {
+    md->setInitializer(defLitTextStripped);
+  }
+
+  //printf("pre.l: md->setFileDef(%p)\n",state->inputFileDef);
+  md->setFileDef(state->inputFileDef);
+  md->setDefinition("#define "+state->defName);
+
+  MemberName *mn=Doxygen::functionNameSDict->find(state->defName);
+  if (mn==0)
+  {
+    mn = new MemberName(state->defName);
+    Doxygen::functionNameSDict->append(state->defName,mn);
+  }
+  mn->append(md);
+  if (state->yyFileDef) 
+  {
+    state->yyFileDef->insertMember(md);
+  }
+
+  //Define *d;
+  //if ((d=defineDict[state->defName])==0) defineDict.insert(state->defName,newDefine()); 
+}
+
+static inline void outputChar(yyscan_t yyscanner,char c)
+{
+  YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
+  if (state->includeStack.isEmpty() || state->curlyCount>0) state->outputBuf->addChar(c);
+}
+
+static inline void outputArray(yyscan_t yyscanner,const char *a,int len)
+{
+  YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
+  if (state->includeStack.isEmpty() || state->curlyCount>0) state->outputBuf->addArray(a,len);
+}
+
+static void readIncludeFile(yyscan_t yyscanner,const QCString &inc)
+{
+  YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
+  static bool searchIncludes = Config_getBool(SEARCH_INCLUDES);
+  uint i=0;
+
+  // find the start of the include file name
+  while (i<inc.length() &&
+         (inc.at(i)==' ' || inc.at(i)=='"' || inc.at(i)=='<')
+        ) i++;
+  uint s=i;
+
+  // was it a local include?
+  bool localInclude = s>0 && inc.at(s-1)=='"';
+
+  // find the end of the include file name
+  while (i<inc.length() && inc.at(i)!='"' && inc.at(i)!='>') i++;
+
+  if (s<inc.length() && i>s) // valid include file name found
+  {
+    // extract include path+name
+    QCString incFileName=inc.mid(s,i-s).stripWhiteSpace();
+
+    QCString dosExt = incFileName.right(4);
+    if (dosExt==".exe" || dosExt==".dll" || dosExt==".tlb")
+    {
+      // skip imported binary files (e.g. M$ type libraries)
+      return;
+    }
+
+    QCString oldFileName = state->yyFileName;
+    FileDef *oldFileDef  = state->yyFileDef;
+    int oldLineNr        = state->yyLineNr;
+    //printf("Searching for '%s'\n",incFileName.data());
+
+    // absIncFileName avoids difficulties for incFileName starting with "../" (bug 641336)
+    QCString absIncFileName = incFileName;
+    {
+      QFileInfo fi(state->yyFileName);
+      if (fi.exists())
+      {
+       QCString absName = QCString(fi.dirPath(TRUE).data())+"/"+incFileName;
+        QFileInfo fi2(absName);
+        if (fi2.exists())
+        {
+         absIncFileName=fi2.absFilePath().utf8();
+       }
+       else if (searchIncludes) // search in INCLUDE_PATH as well
+       {
+         QStrList &includePath = Config_getList(INCLUDE_PATH);
+         char *s=includePath.first();
+         while (s)
+         {
+           QFileInfo fi(s);
+           if (fi.exists() && fi.isDir())
+           {
+             QCString absName = QCString(fi.absFilePath().utf8())+"/"+incFileName;
+             //printf("trying absName=%s\n",absName.data());
+             QFileInfo fi2(absName);
+             if (fi2.exists())
+             {
+               absIncFileName=fi2.absFilePath().utf8();
+               break;
+             }
+             //printf( "absIncFileName = %s\n", absIncFileName.data() );
+           }
+           s=includePath.next();
+         }
+       }
+       //printf( "absIncFileName = %s\n", absIncFileName.data() );
+      }
+    }
+    state->defineManager.addInclude(state->yyFileName,absIncFileName);
+    state->defineManager.addFileToContext(absIncFileName);
 
-                                           // also add it to the local file list if it is a source file
-                                           //if (g_isSource && g_includeStack.isEmpty())
-                                           //{
-                                           //  g_fileDefineDict->insert(g_defName,nd);
-                                           //}
-                                         }
-                                         else if (def /*&& macroIsAccessible(def)*/)
-                                              // name already exists
-                                         {
-                                           //printf("existing define!\n");
-                                           //printf("define found\n");
-                                           if (def->undef) // undefined name
-                                           {
-                                             def->undef = FALSE;
-                                             def->name = g_defName;
-                                             def->definition = g_defText.stripWhiteSpace();
-                                             def->nargs = g_defArgs;
-                                             def->fileName = g_yyFileName.copy(); 
-                                             def->lineNr = g_yyLineNr-g_yyMLines;
-                                             def->columnNr = g_yyColNr;
-                                           }
-                                           else
-                                           {
-                                             //printf("error: define %s is defined more than once!\n",g_defName.data());
-                                           }
-                                         }
-                                         delete g_argDict; g_argDict=0;
-                                         g_yyLineNr++;
-                                         g_yyColNr=1;
-                                         g_lastGuardName.resize(0);
-                                         BEGIN(Start);
-                                       }
-<DefineText>{B}*                       { g_defText += ' '; g_defLitText+=yytext; }
-<DefineText>{B}*"##"{B}*               { g_defText += "##"; g_defLitText+=yytext; }
-<DefineText>"@"                                { g_defText += "@@"; g_defLitText+=yytext; }
-<DefineText>\"                         { 
-                                          g_defText += *yytext; 
-                                         g_defLitText+=yytext; 
-                                         if (!g_insideComment)
-                                         {
-                                           BEGIN(SkipDoubleQuote);
-                                         }
-                                       }
-<DefineText>\'                         { g_defText += *yytext;
-                                         g_defLitText+=yytext; 
-                                         if (!g_insideComment)
-                                         {
-                                           BEGIN(SkipSingleQuote);
-                                         }
-                                       }
-<SkipDoubleQuote>"//"[/]?              { g_defText += yytext; g_defLitText+=yytext; }
-<SkipDoubleQuote>"/*"                  { g_defText += yytext; g_defLitText+=yytext; }
-<SkipDoubleQuote>\"                    {
-                                         g_defText += *yytext; g_defLitText+=yytext; 
-                                         BEGIN(DefineText);
-                                       }
-<SkipSingleQuote,SkipDoubleQuote>\\.   {
-                                         g_defText += yytext; g_defLitText+=yytext;
-                                       }
-<SkipSingleQuote>\'                    {
-                                         g_defText += *yytext; g_defLitText+=yytext;
-                                         BEGIN(DefineText);
-                                       }
-<SkipDoubleQuote>.                     { g_defText += *yytext; g_defLitText+=yytext; }
-<SkipSingleQuote>.                     { g_defText += *yytext; g_defLitText+=yytext; }
-<DefineText>.                          { g_defText += *yytext; g_defLitText+=yytext; }
-<<EOF>>                                        {
-                                          DBG_CTX((stderr,"End of include file\n"));
-                                         //printf("Include stack depth=%d\n",g_includeStack.count());
-                                         if (g_includeStack.isEmpty())
-                                         {
-                                           DBG_CTX((stderr,"Terminating scanner!\n"));
-                                           yyterminate();
-                                         }
-                                         else
-                                         {
-                                           FileState *fs=g_includeStack.pop();
-                                           //fileDefineCache->merge(g_yyFileName,fs->fileName);
-                                           YY_BUFFER_STATE oldBuf = YY_CURRENT_BUFFER;
-                                           yy_switch_to_buffer( fs->bufState );
-                                           yy_delete_buffer( oldBuf );
-                                           g_yyLineNr    = fs->lineNr;
-                                            //preYYin = fs->oldYYin;
-                                            g_inputBuf    = fs->oldFileBuf;
-                                           g_inputBufPos = fs->oldFileBufPos;
-                                            g_curlyCount = fs->curlyCount;
-                                           setFileName(fs->fileName);
-                                           DBG_CTX((stderr,"######## FileName %s\n",g_yyFileName.data()));
-                                           
-                                            // Deal with file changes due to 
-                                            // #include's within { .. } blocks
-                                            QCString lineStr(15+g_yyFileName.length());
-                                            lineStr.sprintf("# %d \"%s\" 2",g_yyLineNr,g_yyFileName.data());
-                                            outputArray(lineStr.data(),lineStr.length());
-                                           
-                                           delete fs; fs=0;
-                                         }
-                                       }
-<*>"/*"/"*/"                           |
-<*>"/*"[*]?                            {
-                                          if (YY_START==SkipVerbatim || YY_START==SkipCond)
-                                          {
-                                            REJECT;
-                                          }
-                                          else
-                                          {
-                                           outputArray(yytext,(int)yyleng);
-                                           g_lastCContext=YY_START;
-                                           g_commentCount=1;
-                                           if (yyleng==3) g_lastGuardName.resize(0); // reset guard in case the #define is documented!
-                                           BEGIN(SkipCComment);
-                                          }
-                                       }
-<*>"//"[/]?                            {
-                                          if (YY_START==SkipVerbatim || YY_START==SkipCond || getLanguageFromFileName(g_yyFileName)==SrcLangExt_Fortran)
-                                          {
-                                            REJECT;
-                                          }
-                                          else
-                                          {
-                                           outputArray(yytext,(int)yyleng);
-                                           g_lastCPPContext=YY_START;
-                                           if (yyleng==3) g_lastGuardName.resize(0); // reset guard in case the #define is documented!
-                                           BEGIN(SkipCPPComment);
-                                          }
-                                       }
-<*>\n                                  { 
-                                         outputChar('\n');
-                                         g_yyLineNr++; 
-                                       }
-<*>.                                   {
-                                         g_expectGuard = FALSE;
-                                         outputChar(*yytext);
-                                       }
+    // findFile will overwrite state->yyFileDef if found
+    FileState *fs;
+    bool alreadyIncluded = FALSE;
+    //printf("calling findFile(%s)\n",incFileName.data());
+    if ((fs=findFile(yyscanner,incFileName,localInclude,alreadyIncluded))) // see if the include file can be found
+    {
+      //printf("Found include file!\n");
+      if (Debug::isFlagSet(Debug::Preprocessor))
+      {
+        for (i=0;i<state->includeStack.count();i++) 
+        {
+          Debug::print(Debug::Preprocessor,0,"  ");
+        }
+        //msg("#include %s: parsing...\n",incFileName.data());
+      }
+      if (oldFileDef)
+      {
+        // add include dependency to the file in which the #include was found
+       bool ambig;
+       // change to absolute name for bug 641336 
+        FileDef *incFd = findFileDef(Doxygen::inputNameDict,absIncFileName,ambig);
+        oldFileDef->addIncludeDependency(ambig ? 0 : incFd,incFileName,localInclude,state->isImported,FALSE);
+        // add included by dependency
+        if (state->yyFileDef)
+        {
+          //printf("Adding include dependency %s->%s\n",oldFileDef->name().data(),incFileName.data());
+          state->yyFileDef->addIncludedByDependency(oldFileDef,oldFileDef->docName(),localInclude,state->isImported);
+        }
+      }
+      else if (state->inputFileDef)
+      {
+        state->inputFileDef->addIncludeDependency(0,absIncFileName,localInclude,state->isImported,TRUE);
+      }
+      struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+      fs->bufState = YY_CURRENT_BUFFER;
+      fs->lineNr   = oldLineNr;
+      fs->fileName = oldFileName;
+      fs->curlyCount = state->curlyCount;
+      state->curlyCount = 0;
+      // push the state on the stack
+      state->includeStack.push(fs);
+      // set the scanner to the include file
 
-%%
+      // Deal with file changes due to 
+      // #include's within { .. } blocks
+      QCString lineStr(state->yyFileName.length()+20);
+      lineStr.sprintf("# 1 \"%s\" 1\n",state->yyFileName.data());
+      outputArray(yyscanner,lineStr.data(),lineStr.length());
+
+      DBG_CTX((stderr,"Switching to include file %s\n",incFileName.data()));
+      state->expectGuard=TRUE;
+      state->inputBuf   = &fs->fileBuf;
+      state->inputBufPos=0;
+      yy_switch_to_buffer(yy_create_buffer(0, YY_BUF_SIZE, yyscanner),yyscanner);
+    }
+    else
+    {
+      //printf("  calling findFile(%s) alreadyInc=%d\n",incFileName.data(),alreadyIncluded);
+      if (oldFileDef)
+      {
+       bool ambig;
+       //QCString absPath = incFileName;
+       //if (QDir::isRelativePath(incFileName))
+       //{
+       //  absPath = QDir::cleanDirPath(oldFileDef->getPath()+"/"+incFileName);
+       //  //printf("%s + %s -> resolved path %s\n",oldFileDef->getPath().data(),incFileName.data(),absPath.data());
+       //}
+
+       // change to absolute name for bug 641336 
+       FileDef *fd = findFileDef(Doxygen::inputNameDict,absIncFileName,ambig);
+       //printf("%s::findFileDef(%s)=%p\n",oldFileDef->name().data(),incFileName.data(),fd);
+       // add include dependency to the file in which the #include was found
+       oldFileDef->addIncludeDependency(ambig ? 0 : fd,incFileName,localInclude,state->isImported,FALSE);
+       // add included by dependency
+        if (fd)
+        {
+          //printf("Adding include dependency (2) %s->%s ambig=%d\n",oldFileDef->name().data(),fd->name().data(),ambig);
+          fd->addIncludedByDependency(oldFileDef,oldFileDef->docName(),localInclude,state->isImported);
+        }
+      }
+      else if (state->inputFileDef)
+      {
+        state->inputFileDef->addIncludeDependency(0,absIncFileName,localInclude,state->isImported,TRUE);
+      }
+      if (Debug::isFlagSet(Debug::Preprocessor))
+      {
+       if (alreadyIncluded)
+       {
+          Debug::print(Debug::Preprocessor,0,"#include %s: already included! skipping...\n",qPrint(incFileName));
+       }
+       else
+       {
+          Debug::print(Debug::Preprocessor,0,"#include %s: not found! skipping...\n",qPrint(incFileName));
+       }
+        //printf("error: include file %s not found\n",yytext);
+      }
+      if (state->curlyCount>0 && !alreadyIncluded) // failed to find #include inside { ... }
+      {
+       warn(state->yyFileName,state->yyLineNr,"include file %s not found, perhaps you forgot to add its directory to INCLUDE_PATH?",incFileName.data());
+      }
+    }
+  }
+}
+
+/* ----------------------------------------------------------------- */
+
+static void startCondSection(yyscan_t yyscanner,const char *sectId)
+{
+  YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
+  //printf("startCondSection: skip=%d stack=%d\n",state->skip,state->condStack.count());
+  CondParser prs;
+  bool expResult = prs.parse(state->yyFileName,state->yyLineNr,sectId);
+  state->condStack.push(new CondCtx(state->yyLineNr,sectId,state->skip));
+  if (!expResult)
+  {
+    state->skip=TRUE;
+  }
+  //printf("  expResult=%d skip=%d\n",expResult,state->skip);
+}
+
+static void endCondSection(yyscan_t yyscanner)
+{
+  YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
+  if (state->condStack.isEmpty())
+  {
+    state->skip=FALSE;
+  }
+  else
+  {
+    CondCtx *ctx = state->condStack.pop();
+    state->skip=ctx->skip;
+    delete ctx;
+  }
+  //printf("endCondSection: skip=%d stack=%d\n",state->skip,state->condStack.count());
+}
+
+static void forceEndCondSection(yyscan_t yyscanner)
+{
+  YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
+  while (!state->condStack.isEmpty())
+  {
+    delete state->condStack.pop();
+  }
+  state->skip=FALSE;
+}
+
+static QCString escapeAt(const char *text)
+{
+  QCString result;
+  if (text)
+  {
+    char c;
+    const char *p=text;
+    while ((c=*p++))
+    {
+      if (c=='@') result+="@@"; else result+=c;
+    }
+  }
+  return result;
+}
+
+static char resolveTrigraph(char c)
+{
+  switch (c)
+  {
+    case '=': return '#';
+    case '/': return '\\';
+    case '\'': return '^';
+    case '(': return '[';
+    case ')': return ']';
+    case '!': return '|';
+    case '<': return '{';
+    case '>': return '}';
+    case '-': return '~';
+  }
+  return '?';
+}
 
 /*@ ----------------------------------------------------------------------------
  */
 
-static int getNextChar(const QCString &expr,QCString *rest,uint &pos)
+static int getNextChar(yyscan_t yyscanner,const QCString &expr,QCString *rest,uint &pos)
 {
   //printf("getNextChar(%s,%s,%d)\n",expr.data(),rest ? rest->data() : 0,pos);
   if (pos<expr.length())
@@ -3026,13 +3127,13 @@ static int getNextChar(const QCString &expr,QCString *rest,uint &pos)
   }
   else
   {
-    int cc=yyinput();
+    int cc=yyinput(yyscanner);
     //printf("%d=yyinput() %d\n",cc,EOF);
     return cc;
   }
 }
  
-static int getCurrentChar(const QCString &expr,QCString *rest,uint pos)
+static int getCurrentChar(yyscan_t yyscanner,const QCString &expr,QCString *rest,uint pos)
 {
   //printf("getCurrentChar(%s,%s,%d)\n",expr.data(),rest ? rest->data() : 0,pos);
   if (pos<expr.length())
@@ -3048,15 +3149,15 @@ static int getCurrentChar(const QCString &expr,QCString *rest,uint pos)
   }
   else
   {
-    int cc=yyinput();
-    returnCharToStream(cc);
+    int cc=yyinput(yyscanner);
+    returnCharToStream(yyscanner,cc);
     //unput((char)cc);
     //printf("%c=yyinput()\n",cc);
     return cc;
   }
 }
 
-static void unputChar(const QCString &expr,QCString *rest,uint &pos,char c)
+static void unputChar(yyscan_t yyscanner,const QCString &expr,QCString *rest,uint &pos,char c)
 {
   //printf("unputChar(%s,%s,%d,%c)\n",expr.data(),rest ? rest->data() : 0,pos,c);
   if (pos<expr.length())
@@ -3072,61 +3173,85 @@ static void unputChar(const QCString &expr,QCString *rest,uint &pos,char c)
   else
   {
     //unput(c);
-    returnCharToStream(c);
+    returnCharToStream(yyscanner,c);
   }
   //printf("result: unputChar(%s,%s,%d,%c)\n",expr.data(),rest ? rest->data() : 0,pos,c);
 }
 
-void addSearchDir(const char *dir)
+///////////////////////////////////////////////////////////////////////////////////////////////
+
+struct Preprocessor::Private
 {
+  yyscan_t yyscanner;
+  preYY_state state;
+  bool firstTime = FALSE;
+};
+
+void Preprocessor::addSearchDir(const char *dir)
+{
+  YY_EXTRA_TYPE state = preYYget_extra(p->yyscanner);
   QFileInfo fi(dir);
-  if (fi.isDir()) g_pathList->append(fi.absFilePath().utf8());
+  if (fi.isDir()) state->pathList->append(fi.absFilePath().utf8());
 } 
 
-void initPreprocessor()
+Preprocessor::Preprocessor()
 {
-  g_pathList = new QStrList;
+  p = new Private;
+  preYYlex_init_extra(&p->state,&p->yyscanner);
+  YY_EXTRA_TYPE state = preYYget_extra(p->yyscanner);
+  state->pathList = new QStrList;
   addSearchDir(".");
-  g_expandedDict = new DefineDict(17);
+  state->expandedDict = new DefineDict(17);
 }
 
-void cleanUpPreprocessor()
+Preprocessor::~Preprocessor()
 {
-  delete g_expandedDict; g_expandedDict=0;
-  delete g_pathList; g_pathList=0;
-  DefineManager::deleteInstance();
+  YY_EXTRA_TYPE state = preYYget_extra(p->yyscanner);
+  delete state->expandedDict; 
+  state->expandedDict=0;
+  delete state->pathList; 
+  state->pathList=0;
+  preYYlex_destroy(p->yyscanner);
+  delete p;
 }
 
-
-void preprocessFile(const char *fileName,BufStr &input,BufStr &output)
+void Preprocessor::processFile(const char *fileName,BufStr &input,BufStr &output)
 {
+  yyscan_t yyscanner = p->yyscanner;
+  YY_EXTRA_TYPE state = preYYget_extra(p->yyscanner);
+  struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
+
+#ifdef FLEX_DEBUG
+  preYYset_debug(1,yyscanner);
+#endif
+
   printlex(yy_flex_debug, TRUE, __FILE__, fileName);
   uint orgOffset=output.curPos();
   //printf("##########################\n%s\n####################\n",
   //    input.data());
 
-  g_macroExpansion = Config_getBool(MACRO_EXPANSION);
-  g_expandOnlyPredef = Config_getBool(EXPAND_ONLY_PREDEF);
-  g_skip=FALSE;
-  g_curlyCount=0;
-  g_nospaces=FALSE;
-  g_inputBuf=&input;
-  g_inputBufPos=0;
-  g_outputBuf=&output;
-  g_includeStack.setAutoDelete(TRUE);
-  g_includeStack.clear();
-  g_expandedDict->setAutoDelete(FALSE);
-  g_expandedDict->clear();
-  g_condStack.setAutoDelete(TRUE);
-  g_condStack.clear();
-  //g_fileDefineDict->clear();
-
-  setFileName(fileName);
-  g_inputFileDef = g_yyFileDef;
-  DefineManager::instance().startContext(g_yyFileName);
+  state->macroExpansion = Config_getBool(MACRO_EXPANSION);
+  state->expandOnlyPredef = Config_getBool(EXPAND_ONLY_PREDEF);
+  state->skip=FALSE;
+  state->curlyCount=0;
+  state->nospaces=FALSE;
+  state->inputBuf=&input;
+  state->inputBufPos=0;
+  state->outputBuf=&output;
+  state->includeStack.setAutoDelete(TRUE);
+  state->includeStack.clear();
+  state->expandedDict->setAutoDelete(FALSE);
+  state->expandedDict->clear();
+  state->condStack.setAutoDelete(TRUE);
+  state->condStack.clear();
+  //state->fileDefineDict->clear();
+
+  setFileName(yyscanner,fileName);
+  state->inputFileDef = state->yyFileDef;
+  state->defineManager.startContext(state->yyFileName);
   
-  static bool firstTime=TRUE;
-  if (firstTime)
+  p->firstTime=TRUE;
+  if (p->firstTime)
   {
     // add predefined macros
     char *defStr;
@@ -3140,7 +3265,10 @@ void preprocessFile(const char *fileName,BufStr &input,BufStr &output)
       int i_cbrace=ds.find(')');
       bool nonRecursive = i_equals>0 && ds.at(i_equals-1)==':';
 
-      if (i_obrace==0) continue; // no define name
+      if ((i_obrace==0) || (i_equals==0) || (i_equals==1 && ds.at(i_equals-1)==':'))
+      {
+         continue; // no define name
+      }
 
       if (i_obrace<i_equals && i_cbrace<i_equals && 
          i_obrace!=-1      && i_cbrace!=-1      && 
@@ -3199,13 +3327,14 @@ void preprocessFile(const char *fileName,BufStr &input,BufStr &output)
          def->nargs        = count;
          def->isPredefined = TRUE;
          def->nonRecursive = nonRecursive;
-         def->fileDef      = g_yyFileDef;
+         def->fileDef      = state->yyFileDef;
          def->fileName     = fileName;
-         DefineManager::instance().addDefine(g_yyFileName,def);
+         state->defineManager.addDefine(state->yyFileName,def);
+
+         //printf("#define '%s' '%s' #nargs=%d\n",
+         //  def->name.data(),def->definition.data(),def->nargs);
        }
 
-       //printf("#define '%s' '%s' #nargs=%d\n",
-       //  def->name.data(),def->definition.data(),def->nargs);
       }
       else if ((i_obrace==-1 || i_obrace>i_equals) &&
          (i_cbrace==-1 || i_cbrace>i_equals) &&
@@ -3230,9 +3359,9 @@ void preprocessFile(const char *fileName,BufStr &input,BufStr &output)
          def->nargs = -1;
          def->isPredefined = TRUE;
          def->nonRecursive = nonRecursive;
-         def->fileDef      = g_yyFileDef;
+         def->fileDef      = state->yyFileDef;
          def->fileName     = fileName;
-         DefineManager::instance().addDefine(g_yyFileName,def);
+         state->defineManager.addDefine(state->yyFileName,def);
        }
        else
        {
@@ -3246,24 +3375,23 @@ void preprocessFile(const char *fileName,BufStr &input,BufStr &output)
     //firstTime=FALSE;
   }
  
-  g_yyLineNr = 1;
-  g_yyColNr  = 1;
-  g_level    = 0;
-  g_ifcount  = 0;
+  state->yyLineNr = 1;
+  state->yyColNr  = 1;
+  state->level    = 0;
+  state->ifcount  = 0;
 
   BEGIN( Start );
   
-  g_expectGuard = guessSection(fileName)==Entry::HEADER_SEC;
-  g_guardName.resize(0);
-  g_lastGuardName.resize(0);
-  g_guardExpr.resize(0);
+  state->expectGuard = guessSection(fileName)==Entry::HEADER_SEC;
+  state->guardName.resize(0);
+  state->lastGuardName.resize(0);
+  state->guardExpr.resize(0);
   
-  preYYlex();
-  g_lexInit=TRUE;
+  preYYlex(yyscanner);
 
-  while (!g_condStack.isEmpty())
+  while (!state->condStack.isEmpty())
   {
-    CondCtx *ctx = g_condStack.pop();
+    CondCtx *ctx = state->condStack.pop();
     QCString sectionInfo = " ";
     if (ctx->sectionId!=" ") sectionInfo.sprintf(" with label '%s' ",ctx->sectionId.stripWhiteSpace().data());
     warn(fileName,ctx->lineNr,"Conditional section%sdoes not have "
@@ -3271,18 +3399,18 @@ void preprocessFile(const char *fileName,BufStr &input,BufStr &output)
     delete ctx;
   }
   // make sure we don't extend a \cond with missing \endcond over multiple files (see bug 624829)
-  forceEndCondSection();
+  forceEndCondSection(yyscanner);
 
   // remove locally defined macros so they can be redefined in another source file
-  //if (g_fileDefineDict->count()>0)
+  //if (state->fileDefineDict->count()>0)
   //{
-  //  QDictIterator<Define> di(*g_fileDefineDict);
+  //  QDictIterator<Define> di(*state->fileDefineDict);
   //  Define *d;
   //  for (di.toFirst();(d=di.current());++di)
   //  {
-  //    g_globalDefineDict->remove(di.currentKey());
+  //    state->globalDefineDict->remove(di.currentKey());
   //  }
-  //  g_fileDefineDict->clear();
+  //  state->fileDefineDict->clear();
   //}
 
   if (Debug::isFlagSet(Debug::Preprocessor))
@@ -3299,11 +3427,11 @@ void preprocessFile(const char *fileName,BufStr &input,BufStr &output)
       orgPos++;
     }
     Debug::print(Debug::Preprocessor,0,"\n---------\n");
-    if (DefineManager::instance().defineContext().count()>0)
+    if (state->defineManager.defineContext().count()>0)
     {
       Debug::print(Debug::Preprocessor,0,"Macros accessible in this file:\n");
       Debug::print(Debug::Preprocessor,0,"---------\n");
-      QDictIterator<Define> di(DefineManager::instance().defineContext());
+      QDictIterator<Define> di(state->defineManager.defineContext());
       Define *def;
       for (di.toFirst();(def=di.current());++di)
       {
@@ -3316,24 +3444,9 @@ void preprocessFile(const char *fileName,BufStr &input,BufStr &output)
       Debug::print(Debug::Preprocessor,0,"No macros accessible in this file.\n");
     }
   }
-  DefineManager::instance().endContext();
+  state->defineManager.endContext();
   printlex(yy_flex_debug, FALSE, __FILE__, fileName);
 }
 
-void preFreeScanner()
-{
-#if defined(YY_FLEX_SUBMINOR_VERSION) 
-  if (g_lexInit)
-  {
-    preYYlex_destroy();
-  }
-#endif
-}
-
-#if !defined(YY_FLEX_SUBMINOR_VERSION) 
-extern "C" { // some bogus code to keep the compiler happy
-//  int  preYYwrap() { return 1 ; }
-  void preYYdummy() { yy_flex_realloc(0,0); } 
-}
-#endif
 
+#include "pre.l.h"
index 6b9bd75..ed4e76b 100644 (file)
@@ -105,6 +105,9 @@ class PrintDocVisitor : public DocVisitor
         case DocStyleChange::Bold:
           if (s->enable()) printf("<bold>"); else printf("</bold>");
           break;
+        case DocStyleChange::S:
+          if (s->enable()) printf("<s>"); else printf("</s>");
+          break;
         case DocStyleChange::Strike:
           if (s->enable()) printf("<strike>"); else printf("</strike>");
           break;
index de0a8a9..e3a01b4 100644 (file)
@@ -25,7 +25,7 @@
 #ifndef PYCODE_H
 #define PYCODE_H
 
-#include "types.h"
+#include "parserintf.h"
 
 class CodeOutputInterface;
 class FileDef;
@@ -33,11 +33,26 @@ class MemberDef;
 class QCString;
 class Definition;
 
-extern void parsePythonCode(CodeOutputInterface &,const char *,const QCString &,
-             bool ,const char *,FileDef *fd,
-            int startLine,int endLine,bool inlineFragment,
-             const MemberDef *memberDef,bool showLineNumbers,const Definition *searchCtx,
-             bool collectXRefs);
-extern void resetPythonCodeParserState();
+class PythonCodeParser : public CodeParserInterface
+{
+  public:
+    void parseCode(CodeOutputInterface &codeOutIntf,
+                   const char *scopeName,
+                   const QCString &input,
+                   SrcLangExt lang,
+                   bool isExampleBlock,
+                   const char *exampleName=0,
+                   FileDef *fileDef=0,
+                   int startLine=-1,
+                   int endLine=-1,
+                   bool inlineFragment=FALSE,
+                   const MemberDef *memberDef=0,
+                   bool showLineNumbers=TRUE,
+                   const Definition *searchCtx=0,
+                   bool collectXrefs=TRUE
+                  );
+    void resetCodeParserState();
+};
+
 
 #endif
index 0f04baa..f7e255f 100644 (file)
@@ -97,6 +97,7 @@ static bool          g_endComment;
 
 static void endFontClass();
 static void adjustScopesAndSuites(unsigned indentLength);
+static const char *stateToString(int state);
 
 
 /*! Represents a stack of variable to class mappings as found in the
@@ -1275,7 +1276,7 @@ TARGET           ({IDENTIFIER}|"("{TARGET_LIST}")"|"["{TARGET_LIST}"]"|{ATTRIBUT
 
     {BB}/({NONEMPTY}|{EXPCHAR}) {
                                  // This implements poor
-                                // indendation-tracking;
+                                // indentation-tracking;
                                  // should be improved.
                                 // (translate tabs to space, etc)
                                 codifyLines(yytext);
@@ -1315,7 +1316,7 @@ TARGET           ({IDENTIFIER}|"("{TARGET_LIST}")"|"["{TARGET_LIST}"]"|{ATTRIBUT
     \\{B}\n                    { // line continuation
                                 codifyLines(yytext);
                                }
-    \\.                               { // espaced char
+    \\.                               { // escaped char
                                 codify(yytext);
                                }
     {STRINGPREFIX}?{TRIDOUBLEQUOTE} { // triple double quotes
@@ -1338,7 +1339,7 @@ TARGET           ({IDENTIFIER}|"("{TARGET_LIST}")"|"["{TARGET_LIST}"]"|{ATTRIBUT
     \\{B}\n                    { // line continuation
                                 codifyLines(yytext);
                                }
-    \\.                               { // espaced char
+    \\.                               { // escaped char
                                 codify(yytext);
                                }
     {STRINGPREFIX}?{TRISINGLEQUOTE} { // triple single quotes
@@ -1637,12 +1638,33 @@ void parsePythonCode(CodeOutputInterface &od,const char * /*className*/,
   return;
 }
 
+//----------------------------------------------------------------------------
+
+void PythonCodeParser::parseCode(CodeOutputInterface &codeOutIntf,
+    const char *scopeName,
+    const QCString &input,
+    SrcLangExt /*lang*/,
+    bool isExampleBlock,
+    const char *exampleName,
+    FileDef *fileDef,
+    int startLine,
+    int endLine,
+    bool inlineFragment,
+    const MemberDef *memberDef,
+    bool showLineNumbers,
+    const Definition *searchCtx,
+    bool collectXRefs
+    )
+{
+  ::parsePythonCode(codeOutIntf,scopeName,input,isExampleBlock,exampleName,
+                    fileDef,startLine,endLine,inlineFragment,memberDef,
+                    showLineNumbers,searchCtx,collectXRefs);
+}
 
-#if !defined(YY_FLEX_SUBMINOR_VERSION) 
-extern "C" { // some bogus code to keep the compiler happy
-  void pycodeYYdummy() { yy_flex_realloc(0,0); } 
+void PythonCodeParser::resetCodeParserState()
+{
+  ::resetPythonCodeParserState();
 }
-#elif YY_FLEX_MAJOR_VERSION<=2 && YY_FLEX_MINOR_VERSION<=5 && YY_FLEX_SUBMINOR_VERSION<33
-#error "You seem to be using a version of flex newer than 2.5.4. These are currently incompatible with 2.5.4, and do NOT work with doxygen! Please use version 2.5.4 or expect things to be parsed wrongly! A bug report has been submitted (#732132)."
-#endif
 
+
+#include "pycode.l.h"
index 01235ee..6cfadf6 100644 (file)
  *
  * This is the Python language parser for doxygen.
  */
-class PythonLanguageScanner : public ParserInterface
+class PythonOutlineParser : public OutlineParserInterface
 {
   public:
-    virtual ~PythonLanguageScanner() {}
     void startTranslationUnit(const char *) {}
     void finishTranslationUnit() {}
     void parseInput(const char * fileName, 
                     const char *fileBuf, 
-                    Entry *root,
+                    const std::shared_ptr<Entry> &root,
                     bool sameTranslationUnit,
                     QStrList &filesInSameTranslationUnit);
-    bool needsPreprocessing(const QCString &extension);
-    void parseCode(CodeOutputInterface &codeOutIntf,
-                   const char *scopeName,
-                   const QCString &input,
-                   SrcLangExt lang,
-                   bool isExampleBlock,
-                   const char *exampleName=0,
-                   FileDef *fileDef=0,
-                   int startLine=-1,
-                   int endLine=-1,
-                   bool inlineFragment=FALSE,
-                   const MemberDef *memberDef=0,
-                   bool showLineNumbers=TRUE,
-                   const Definition *searchCtx=0,
-                   bool collectXrefs=TRUE
-                  );
-    void resetCodeParserState();
+    bool needsPreprocessing(const QCString &extension) const;
     void parsePrototype(const char *text);
 };
 
index 3fe66f2..efdc943 100644 (file)
  */
 
   
-static ParserInterface *g_thisParser;
+static OutlineParserInterface *g_thisParser;
 static const char *     inputString;
 static int             inputPosition;
 static QFile            inputFile;
 
 static Protection      protection;
 
-static Entry*          current_root = 0 ;
-static Entry*          current      = 0 ;
-static Entry*          previous     = 0 ;
-static Entry*          bodyEntry    = 0 ;
+static std::shared_ptr<Entry> current_root;
+static std::shared_ptr<Entry> current;
+static std::shared_ptr<Entry> previous;
+static std::shared_ptr<Entry> bodyEntry;
 static int             yyLineNr     = 1 ;
 static QCString                yyFileName;
 static MethodTypes     mtype;
@@ -123,6 +123,7 @@ static int              g_search_count = 0;
 static QCString         g_argType = "";
 static bool             g_funcParamsEnd;
 //-----------------------------------------------------------------------------
+static const char *stateToString(int state);
 
 
 static void initParser()
@@ -144,16 +145,14 @@ static void initEntry()
   current->virt       = virt;
   current->stat       = gstat;
   current->lang       = SrcLangExt_Python; 
-  current->setParent(current_root);
-  Doxygen::docGroup.initGroupInfo(current);
+  Doxygen::docGroup.initGroupInfo(current.get());
   gstat = FALSE;
 }
 
 static void newEntry()
 {
   previous = current;
-  current_root->addSubEntry(current);
-  current = new Entry ;
+  current_root->moveToSubEntryAndRefresh(current);
   initEntry();
 }
 
@@ -239,8 +238,7 @@ static void addFrom(bool all)
   current->fileName = yyFileName; 
   //printf("Adding using declaration: found:%s:%d name=%s\n",yyFileName.data(),yyLineNr,current->name.data());
   current->section=all ? Entry::USINGDIR_SEC : Entry::USINGDECL_SEC;
-  current_root->addSubEntry(current);
-  current = new Entry ;
+  current_root->moveToSubEntryAndRefresh(current);
   initEntry();
 }
 //-----------------------------------------------------------------------------
@@ -260,43 +258,6 @@ static void incLineNr()
   yyLineNr++;
 }
 
-#if 0
-// Appends the current-name to current-type;
-// Destroys current-name.
-// Destroys current->args and current->argList
-static void addType( Entry* current )
-{
-    uint tl=current->type.length();
-    if ( tl>0 && !current->name.isEmpty() && current->type.at(tl-1)!='.') 
-    {
-      current->type += ' ' ;
-    }
-    current->type += current->name ;
-    current->name.resize(0) ;
-    tl=current->type.length();
-    if ( tl>0 && !current->args.isEmpty() && current->type.at(tl-1)!='.') 
-    {
-      current->type += ' ' ;
-    }
-    current->type += current->args ;
-    current->args.resize(0) ;
-    current->argList->clear();
-}
-
-static QCString stripQuotes(const char *s)
-{
-  QCString name;
-  if (s==0 || *s==0) return name;
-  name=s;
-  if (name.at(0)=='"' && name.at(name.length()-1)=='"')
-  {
-    name=name.mid(1,name.length()-2);
-  }
-  return name;
-}
-#endif
-//-----------------------------------------------------------------
-
 //-----------------------------------------------------------------
 static void startCommentBlock(bool brief)
 {
@@ -312,15 +273,6 @@ static void startCommentBlock(bool brief)
   }
 }
 
-/*
-static void appendDocBlock() {
-  previous = current;
-  current_root->addSubEntry(current);
-  current = new Entry;
-  initEntry();
-}
-*/
-
 static void handleCommentBlock(const QCString &doc,bool brief)
 {
   //printf("handleCommentBlock(doc=[%s] brief=%d docBlockInBody=%d docBlockJavaStyle=%d\n",
@@ -340,7 +292,7 @@ static void handleCommentBlock(const QCString &doc,bool brief)
   QCString processedDoc = preprocessCommentBlock(doc,yyFileName,lineNr);
   while (parseCommentBlock(
        g_thisParser,
-       (docBlockInBody && previous) ? previous : current,
+       (docBlockInBody && previous) ? previous.get() : current.get(),
        processedDoc, // text
        yyFileName,   // file
        lineNr,
@@ -426,7 +378,7 @@ static void searchFoundDef()
   current->type.resize(0);
   current->name.resize(0);
   current->args.resize(0);
-  current->argList->clear();
+  current->argList.clear();
   g_packageCommentAllowed = FALSE;
   gstat=FALSE;
   //printf("searchFoundDef at=%d\n",yyLineNr);
@@ -435,7 +387,7 @@ static void searchFoundDef()
 static void searchFoundClass()
 {
   current->section = Entry::CLASS_SEC;
-  current->argList->clear();
+  current->argList.clear();
   current->type += "class" ;
   current->fileName  = yyFileName;
   current->startLine  = yyLineNr;
@@ -764,8 +716,7 @@ STARTDOCSYMS      "##"
                        current->fileName = yyFileName; 
                        //printf("Adding using declaration: found:%s:%d name=%s\n",yyFileName.data(),yyLineNr,current->name.data());
                        current->section=Entry::USINGDECL_SEC;
-                       current_root->addSubEntry(current);
-                       current = new Entry ;
+                       current_root->moveToSubEntryAndRefresh(current);
                        initEntry();
                        BEGIN(Search);
                       }
@@ -977,6 +928,10 @@ STARTDOCSYMS      "##"
                              BEGIN(FunctionParams);
                            }
     ")"                     { // end of parameter list
+                              if (current->argList.empty())
+                              {
+                                current->argList.noParameters=TRUE;
+                              }
                              current->args = argListToString(current->argList);
                              g_funcParamsEnd = TRUE;
                             }
@@ -991,10 +946,10 @@ STARTDOCSYMS      "##"
                         }
     {IDENTIFIER}        { // Name of parameter
                          lineCount();
-                         Argument *a = new Argument;
-                         current->argList->append(a);
-                         current->argList->getLast()->name = QCString(yytext).stripWhiteSpace();
-                         current->argList->getLast()->type = g_argType;
+                         Argument a;
+                         a.name = QCString(yytext).stripWhiteSpace();
+                         a.type = g_argType;
+                         current->argList.push_back(a);
                           g_argType = "";
                         }
     "="                        { // default value
@@ -1081,8 +1036,8 @@ STARTDOCSYMS      "##"
      ","               {
                          if (g_braceCount == 0)
                          {
-                           if (current->argList->getLast())
-                             current->argList->getLast()->type += g_defVal.data();
+                           if (!current->argList.empty())
+                             current->argList.back().type += g_defVal;
                            if (*yytext != ',')
                              unput(*yytext);
                            BEGIN(FunctionParams);
@@ -1131,8 +1086,8 @@ STARTDOCSYMS      "##"
      ","               {
                          if (g_braceCount == 0)
                          {
-                           if (current->argList->getLast())
-                             current->argList->getLast()->defval=QCString(g_defVal.data()).stripWhiteSpace();
+                           if (!current->argList.empty())
+                             current->argList.back().defval=QCString(g_defVal).stripWhiteSpace();
                            if (*yytext == ')')
                              unput(*yytext);
                            BEGIN(FunctionParams);
@@ -1290,8 +1245,8 @@ STARTDOCSYMS      "##"
                        }
 
     {SCOPE}            {
-                         current->extends->append(
-                                             new BaseInfo(substitute(yytext,".","::"),Public,Normal)
+                         current->extends.push_back(
+                                             BaseInfo(substitute(yytext,".","::"),Public,Normal)
                                            );
                          //Has base class-do stuff
                        }
@@ -1451,9 +1406,10 @@ STARTDOCSYMS      "##"
                        // do something based on the type of the IDENTIFIER
                        if (current->type.isEmpty())
                         {
-                          QListIterator<Entry> eli(*(current_root->children()));
-                          Entry *child;
-                          for (eli.toFirst();(child=eli.current());++eli)
+                          //QListIterator<Entry> eli(*(current_root->children()));
+                          //Entry *child;
+                          //for (eli.toFirst();(child=eli.current());++eli)
+                          for (const auto &child : current_root->children())
                           {
                             if (child->name == QCString(yytext))
                             {
@@ -1618,7 +1574,7 @@ STARTDOCSYMS      "##"
                          incLineNr();
                          docBlock += yytext;
                        }
-    \\.                        { // espaced char
+    \\.                        { // escaped char
                          docBlock += yytext;
                        }
     .                  {
@@ -1653,7 +1609,7 @@ STARTDOCSYMS      "##"
                                 addToString(yytext);
                                 incLineNr();
                                }
-    \\.                               { // espaced char
+    \\.                               { // escaped char
                                 addToString(yytext);
                                }
     "\"\"\""                  { // triple double quotes
@@ -1676,7 +1632,7 @@ STARTDOCSYMS      "##"
                                 addToString(yytext);
                                 incLineNr();
                                }
-    \\.                               { // espaced char
+    \\.                               { // escaped char
                                 addToString(yytext);
                                }
     "'''"                     { // triple single quotes
@@ -1750,13 +1706,12 @@ STARTDOCSYMS      "##"
 
 //----------------------------------------------------------------------------
 
-static void parseCompounds(Entry *rt)
+static void parseCompounds(std::shared_ptr<Entry> rt)
 {
   //printf("parseCompounds(%s)\n",rt->name.data());
-  EntryListIterator eli(*rt->children());
-  Entry *ce;
-  for (;(ce=eli.current());++eli)
+  for (int i=0; i<rt->children().size(); ++i)
   {
+    std::shared_ptr<Entry> ce = rt->children()[i];
     if (!ce->program.isEmpty())
     {
       //printf("-- %s ---------\n%s\n---------------\n",
@@ -1767,30 +1722,29 @@ static void parseCompounds(Entry *rt)
       pyscannerYYrestart( pyscannerYYin ) ;
       if (ce->section&Entry::COMPOUND_MASK)
       {
-        current_root = ce ;
+        current_root = ce;
         BEGIN( Search );
       }
       else if (ce->parent())
       {
-        current_root = ce->parent();
+        current_root = rt;
        //printf("Searching for member variables in %s parent=%s\n",
        //    ce->name.data(),ce->parent->name.data());
        BEGIN( SearchMemVars );
       }
       yyFileName = ce->fileName;
       yyLineNr   = ce->bodyLine ;
-      if (current) delete current;
-      current = new Entry;
+      current = std::make_shared<Entry>();
       initEntry();
 
-      Doxygen::docGroup.enterCompound(yyFileName,yyLineNr,ce->name);
-      
+      QCString name = ce->name;
+      Doxygen::docGroup.enterCompound(yyFileName,yyLineNr,name);
+
       pyscannerYYlex() ;
       g_lexInit=TRUE;
-      delete current; current=0;
       ce->program.resize(0);
 
-      Doxygen::docGroup.leaveCompound(yyFileName,yyLineNr,ce->name);
+      Doxygen::docGroup.leaveCompound(yyFileName,yyLineNr,name);
 
     }
     parseCompounds(ce);
@@ -1800,7 +1754,7 @@ static void parseCompounds(Entry *rt)
 //----------------------------------------------------------------------------
 
 
-static void parseMain(const char *fileName,const char *fileBuf,Entry *rt)
+static void parseMain(const char *fileName,const char *fileBuf,const std::shared_ptr<Entry> &rt)
 {
   initParser();
 
@@ -1835,7 +1789,7 @@ static void parseMain(const char *fileName,const char *fileBuf,Entry *rt)
       g_moduleScope+=baseName;
     }
 
-    current            = new Entry;
+    current            = std::make_shared<Entry>();
     initEntry();
     current->name      = g_moduleScope;
     current->section   = Entry::NAMESPACE_SEC;
@@ -1844,11 +1798,11 @@ static void parseMain(const char *fileName,const char *fileBuf,Entry *rt)
     current->startLine = yyLineNr;
     current->bodyLine  = yyLineNr;
 
-    rt->addSubEntry(current);
+    current_root  = current;
+
+    rt->moveToSubEntryAndRefresh(current);
 
-    current_root  = current ;
     initParser();
-    current       = new Entry;
 
     Doxygen::docGroup.enterFile(yyFileName,yyLineNr);
     
@@ -1862,7 +1816,6 @@ static void parseMain(const char *fileName,const char *fileBuf,Entry *rt)
     Doxygen::docGroup.leaveFile(yyFileName,yyLineNr);
 
     current_root->program.resize(0);
-    delete current; current=0;
 
     parseCompounds(current_root);
 
@@ -1933,9 +1886,9 @@ void pyscanFreeScanner()
 
 //----------------------------------------------------------------------------
 
-void PythonLanguageScanner::parseInput(const char *fileName,
+void PythonOutlineParser::parseInput(const char *fileName,
                                        const char *fileBuf,
-                                       Entry *root,
+                                       const std::shared_ptr<Entry> &root,
                                        bool /*sameTranslationUnit*/,
                                        QStrList & /*filesInSameTranslationUnit*/)
 {
@@ -1948,49 +1901,17 @@ void PythonLanguageScanner::parseInput(const char *fileName,
   // printAST(global_root);
 }
 
-bool PythonLanguageScanner::needsPreprocessing(const QCString &)
+bool PythonOutlineParser::needsPreprocessing(const QCString &) const
 {
   return FALSE;
 }
 
-void PythonLanguageScanner::parseCode(CodeOutputInterface &codeOutIntf,
-    const char *scopeName,
-    const QCString &input,
-    SrcLangExt /*lang*/,
-    bool isExampleBlock,
-    const char *exampleName,
-    FileDef *fileDef,
-    int startLine,
-    int endLine,
-    bool inlineFragment,
-    const MemberDef *memberDef,
-    bool showLineNumbers,
-    const Definition *searchCtx,
-    bool collectXRefs
-    )
-{
-  ::parsePythonCode(codeOutIntf,scopeName,input,isExampleBlock,exampleName,
-                    fileDef,startLine,endLine,inlineFragment,memberDef,
-                    showLineNumbers,searchCtx,collectXRefs);
-}
-
-void PythonLanguageScanner::parsePrototype(const char *text)
+void PythonOutlineParser::parsePrototype(const char *text)
 {
   ::parsePrototype(text);
 
 }
 
-void PythonLanguageScanner::resetCodeParserState()
-{
-  ::resetPythonCodeParserState();
-}
-
 //----------------------------------------------------------------------------
 
-#if !defined(YY_FLEX_SUBMINOR_VERSION) 
-//----------------------------------------------------------------------------
-extern "C" { // some bogus code to keep the compiler happy
-  void pyscannerYYdummy() { yy_flex_realloc(0,0); } 
-}
-#endif
-
+#include "pyscanner.l.h"
index 6260d09..50f43ff 100644 (file)
@@ -168,8 +168,7 @@ void Qhp::finalize()
   QFile file(fileName);
   if (!file.open(IO_WriteOnly))
   {
-    err("Could not open file %s for writing\n", fileName.data());
-    exit(1);
+    term("Could not open file %s for writing\n", fileName.data());
   }
   m_doc.dumpTo(file);
 }
index 6f2a763..016ef49 100644 (file)
@@ -206,6 +206,6 @@ void RefList::generatePage()
   }
   doc += "</dl>\n";
   //printf("generatePage('%s')\n",doc.data());
-  addRelatedPage(m_listName,m_pageTitle,doc,0,m_fileName,1,0,0,0);
+  addRelatedPage(m_listName,m_pageTitle,doc,m_fileName,1,std::vector<ListItemInfo>(),0,0,TRUE);
 }
 
index 43ac362..471cf85 100644 (file)
@@ -235,6 +235,7 @@ void RTFDocVisitor::visit(DocStyleChange *s)
     case DocStyleChange::Bold:
       if (s->enable()) m_t << "{\\b ";      else m_t << "} ";
       break;
+    case DocStyleChange::S:
     case DocStyleChange::Strike:
     case DocStyleChange::Del:
       if (s->enable()) m_t << "{\\strike ";      else m_t << "} ";
@@ -305,8 +306,8 @@ void RTFDocVisitor::visit(DocVerbatim *s)
       m_t << "{" << endl;
       m_t << "\\par" << endl;
       m_t << rtf_Style_Reset << getStyle("CodeExample");
-      Doxygen::parserManager->getParser(lang)
-                            ->parseCode(m_ci,s->context(),s->text(),langExt,
+      Doxygen::parserManager->getCodeParser(lang)
+                             .parseCode(m_ci,s->context(),s->text(),langExt,
                                         s->isExample(),s->exampleFile());
       //m_t << "\\par" << endl; 
       m_t << "}" << endl;
@@ -432,8 +433,8 @@ void RTFDocVisitor::visit(DocInclude *inc)
          m_t << rtf_Style_Reset << getStyle("CodeExample");
          QFileInfo cfi( inc->file() );
          FileDef *fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
-         Doxygen::parserManager->getParser(inc->extension())
-                               ->parseCode(m_ci,inc->context(),
+         Doxygen::parserManager->getCodeParser(inc->extension())
+                                .parseCode(m_ci,inc->context(),
                                            inc->text(),
                                            langExt,
                                            inc->isExample(),
@@ -454,8 +455,8 @@ void RTFDocVisitor::visit(DocInclude *inc)
       m_t << "{" << endl;
       m_t << "\\par" << endl;
       m_t << rtf_Style_Reset << getStyle("CodeExample");
-      Doxygen::parserManager->getParser(inc->extension())
-                            ->parseCode(m_ci,inc->context(),
+      Doxygen::parserManager->getCodeParser(inc->extension())
+                             .parseCode(m_ci,inc->context(),
                                         inc->text(),langExt,inc->isExample(),
                                         inc->exampleFile(),
                                         0,     // fileDef
@@ -485,8 +486,8 @@ void RTFDocVisitor::visit(DocInclude *inc)
       m_t << "{" << endl;
       if (!m_lastIsPara) m_t << "\\par" << endl;
       m_t << rtf_Style_Reset << getStyle("CodeExample");
-      Doxygen::parserManager->getParser(inc->extension())
-                            ->parseCode(m_ci,
+      Doxygen::parserManager->getCodeParser(inc->extension())
+                             .parseCode(m_ci,
                                         inc->context(),
                                         extractBlock(inc->text(),inc->blockId()),
                                         langExt,
@@ -502,8 +503,8 @@ void RTFDocVisitor::visit(DocInclude *inc)
          m_t << "{" << endl;
          if (!m_lastIsPara) m_t << "\\par" << endl;
          m_t << rtf_Style_Reset << getStyle("CodeExample");
-         Doxygen::parserManager->getParser(inc->extension())
-                               ->parseCode(m_ci,
+         Doxygen::parserManager->getCodeParser(inc->extension())
+                                .parseCode(m_ci,
                                            inc->context(),
                                            extractBlock(inc->text(),inc->blockId()),
                                            langExt,
@@ -560,8 +561,8 @@ void RTFDocVisitor::visit(DocIncOperator *op)
         fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
       }
 
-      Doxygen::parserManager->getParser(locLangExt)
-                            ->parseCode(m_ci,op->context(),op->text(),langExt,
+      Doxygen::parserManager->getCodeParser(locLangExt)
+                             .parseCode(m_ci,op->context(),op->text(),langExt,
                                         op->isExample(),op->exampleFile(),
                                         fd,     // fileDef
                                         op->line(),    // startLine
@@ -1005,11 +1006,14 @@ void RTFDocVisitor::visitPost(DocHtmlTable *)
 void RTFDocVisitor::visitPre(DocHtmlCaption *)
 {
   DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlCaption)}\n");
+  m_t << "\\pard \\qc \\b";
+  m_t << "{Table \\field\\flddirty{\\*\\fldinst { SEQ Table \\\\*Arabic }}{\\fldrslt {\\noproof 1}} ";
 }
 
 void RTFDocVisitor::visitPost(DocHtmlCaption *) 
 {
   DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlCaption)}\n");
+  m_t << "}\n\\par" << endl;
 }
 
 void RTFDocVisitor::visitPre(DocHtmlRow *r)
index 229a817..79411c6 100644 (file)
@@ -65,8 +65,8 @@ static QCString dateToRTFDateString()
 
 RTFGenerator::RTFGenerator() : OutputGenerator()
 {
-  dir=Config_getString(RTF_OUTPUT);
-  col=0;
+  m_dir=Config_getString(RTF_OUTPUT);
+  m_col=0;
   //insideTabbing=FALSE;
   m_listLevel = 0;
   m_bstartedBody = FALSE;
@@ -79,26 +79,6 @@ RTFGenerator::~RTFGenerator()
 {
 }
 
-//void RTFGenerator::append(const OutputGenerator *g)
-//{
-//  t << g->getContents();
-//  col+=((RTFGenerator *)g)->col;
-//  //insideTabbing=insideTabbing || ((RTFGenerator *)g)->insideTabbing;
-//  m_listLevel=((RTFGenerator *)g)->m_listLevel;
-//  m_omitParagraph=((RTFGenerator *)g)->m_omitParagraph;
-//  //printf("RTFGenerator::append(%s) insideTabbing=%s\n", g->getContents().data(),
-//  //    insideTabbing ? "TRUE" : "FALSE" );
-//}
-
-//OutputGenerator *RTFGenerator::copy()
-//{
-//  RTFGenerator *result = new RTFGenerator;
-//  //result->insideTabbing=insideTabbing;
-//  result->m_listLevel=m_listLevel;
-//  result->m_omitParagraph=m_omitParagraph;
-//  return result;
-//}
-
 void RTFGenerator::writeStyleSheetFile(QFile &file)
 {
   FTextStream t(&file);
@@ -175,8 +155,7 @@ void RTFGenerator::init()
   QDir d(dir);
   if (!d.exists() && !d.mkdir(dir))
   {
-    err("Could not create output directory %s\n",dir.data());
-    exit(1);
+    term("Could not create output directory %s\n",dir.data());
   }
   rtf_Style.setAutoDelete(TRUE);
 
@@ -376,7 +355,7 @@ void RTFGenerator::startFile(const char *name,const char *,const char *)
 {
   //setEncoding(QCString().sprintf("CP%s",theTranslator->trRTFansicp()));
   QCString fileName=name;
-  relPath = relativePathToRoot(fileName);
+  m_relPath = relativePathToRoot(fileName);
 
   if (fileName.right(4)!=".rtf" ) fileName+=".rtf";
   startPlainFile(fileName);
@@ -1848,17 +1827,17 @@ void RTFGenerator::codify(const char *str)
 
       switch(c)
       {
-        case '\t':  spacesToNextTabStop = Config_getInt(TAB_SIZE) - (col%Config_getInt(TAB_SIZE));
+        case '\t':  spacesToNextTabStop = Config_getInt(TAB_SIZE) - (m_col%Config_getInt(TAB_SIZE));
                     t << Doxygen::spaces.left(spacesToNextTabStop);
-                    col+=spacesToNextTabStop;
+                    m_col+=spacesToNextTabStop;
                     break;
         case '\n':  newParagraph();
-                    t << '\n'; col=0;
+                    t << '\n'; m_col=0;
                     break;
-        case '{':   t << "\\{"; col++;          break;
-        case '}':   t << "\\}"; col++;          break;
-        case '\\':  t << "\\\\"; col++;         break;
-        default:    p=(const unsigned char *)writeUtf8Char(t,(const char *)p-1); col++; break;
+        case '{':   t << "\\{"; m_col++;          break;
+        case '}':   t << "\\}"; m_col++;          break;
+        case '\\':  t << "\\\\"; m_col++;         break;
+        default:    p=(const unsigned char *)writeUtf8Char(t,(const char *)p-1); m_col++; break;
       }
     }
   }
@@ -1883,7 +1862,7 @@ void RTFGenerator::endClassDiagram(const ClassDiagram &d,
   newParagraph();
 
   // create a png file
-  d.writeImage(t,dir,relPath,fileName,FALSE);
+  d.writeImage(t,m_dir,m_relPath,fileName,FALSE);
 
   // display the file
   t << "{" << endl;
@@ -1952,7 +1931,7 @@ void RTFGenerator::endCodeFragment()
 {
   //newParagraph();
   //styleStack.pop();
-  //printf("RTFGenerator::endCodeFrament() top=%s\n",styleStack.top());
+  //printf("RTFGenerator::endCodeFragment() top=%s\n",styleStack.top());
   //t << rtf_Style_Reset << styleStack.top() << endl;
   //endCodeLine checks is there is still an open code line, if so closes it.
   endCodeLine();
@@ -2511,7 +2490,7 @@ void RTFGenerator::endDotGraph(DotClassGraph &g)
   newParagraph();
 
   QCString fn =
-    g.writeGraph(t,GOF_BITMAP,EOF_Rtf,Config_getString(RTF_OUTPUT),fileName,relPath,TRUE,FALSE);
+    g.writeGraph(t,GOF_BITMAP,EOF_Rtf,Config_getString(RTF_OUTPUT),m_fileName,m_relPath,TRUE,FALSE);
 
   // display the file
   t << "{" << endl;
@@ -2535,7 +2514,7 @@ void RTFGenerator::endInclDepGraph(DotInclDepGraph &g)
   newParagraph();
 
   QCString fn = g.writeGraph(t,GOF_BITMAP,EOF_Rtf,Config_getString(RTF_OUTPUT),
-                         fileName,relPath,FALSE);
+                         m_fileName,m_relPath,FALSE);
 
   // display the file
   t << "{" << endl;
@@ -2566,7 +2545,7 @@ void RTFGenerator::endCallGraph(DotCallGraph &g)
   newParagraph();
 
   QCString fn = g.writeGraph(t,GOF_BITMAP,EOF_Rtf,Config_getString(RTF_OUTPUT),
-                        fileName,relPath,FALSE);
+                        m_fileName,m_relPath,FALSE);
 
   // display the file
   t << "{" << endl;
@@ -2589,7 +2568,7 @@ void RTFGenerator::endDirDepGraph(DotDirDeps &g)
   newParagraph();
 
   QCString fn = g.writeGraph(t,GOF_BITMAP,EOF_Rtf,Config_getString(RTF_OUTPUT),
-                        fileName,relPath,FALSE);
+                        m_fileName,m_relPath,FALSE);
 
   // display the file
   t << "{" << endl;
@@ -3049,12 +3028,15 @@ void RTFGenerator::endInlineMemberDoc()
 void RTFGenerator::writeLineNumber(const char *,const char *,const char *,int l)
 {
   DoxyCodeLineOpen = TRUE;
-  t << QString("%1").arg(l,5) << " ";
+  QCString lineNumber;
+  lineNumber.sprintf("%05d",l);
+  t << lineNumber << " ";
+  m_col=0;
 }
 void RTFGenerator::startCodeLine(bool)
 {
   DoxyCodeLineOpen = TRUE;
-  col=0;
+  m_col=0;
 }
 void RTFGenerator::endCodeLine()
 {
index b5f06f0..c6cb76b 100644 (file)
@@ -33,12 +33,12 @@ class RTFGenerator : public OutputGenerator
     static void writeExtensionsFile(QFile &file);
 
     void enable() 
-    { if (genStack->top()) active=*genStack->top(); else active=TRUE; }
-    void disable() { active=FALSE; }
+    { if (m_genStack->top()) m_active=*m_genStack->top(); else m_active=TRUE; }
+    void disable() { m_active=FALSE; }
     void enableIf(OutputType o)  { if (o==RTF) enable();  }
     void disableIf(OutputType o) { if (o==RTF) disable(); }
     void disableIfNot(OutputType o) { if (o!=RTF) disable(); }
-    bool isEnabled(OutputType o) { return (o==RTF && active); } 
+    bool isEnabled(OutputType o) { return (o==RTF && m_active); } 
     OutputGenerator *get(OutputType o) { return (o==RTF) ? this : 0; }
 
     void writeDoc(DocNode *,const Definition *,const MemberDef *);
@@ -279,14 +279,14 @@ class RTFGenerator : public OutputGenerator
     const char *rtf_Code_DepthStyle();
     void incrementIndentLevel();
     void decrementIndentLevel();
-    int  col;
+    int  m_col;
     bool m_prettyCode;
 
     bool m_bstartedBody;  // has startbody been called yet?
-    int  m_listLevel; // // RTF does not really have a addative indent...manually set list level.
+    int  m_listLevel; // // RTF does not really have a additive indent...manually set list level.
     bool m_omitParagraph; // should a the next paragraph command be ignored?
     int  m_numCols; // number of columns in a table
-    QCString relPath;
+    QCString m_relPath;
 
     void beginRTFDocument();
     void beginRTFChapter();
diff --git a/src/scan_states.py b/src/scan_states.py
new file mode 100644 (file)
index 0000000..e3924e0
--- /dev/null
@@ -0,0 +1,49 @@
+#!/usr/bin/python
+# python script to generate an overview of the staes based on the input lex file.
+#
+# Copyright (C) 1997-2019 by Dimitri van Heesch.
+#
+# Permission to use, copy, modify, and distribute this software and its
+# documentation under the terms of the GNU General Public License is hereby
+# granted. No representations are made about the suitability of this software
+# for any purpose. It is provided "as is" without express or implied warranty.
+# See the GNU General Public License for more details.
+#
+# Documents produced by Doxygen are derivative works derived from the
+# input used in their production; they are not affected by this license.
+#
+import sys
+import os
+import re
+
+
+def main():
+    if len(sys.argv)!=2:
+        sys.exit('Usage: %s <lex_file>' % sys.argv[0])
+
+    lex_file = sys.argv[1]
+    if (os.path.exists(lex_file)):
+        #write preamble
+        print("static const char *stateToString(int state)")
+        print("{")
+        print("  switch(state)")
+        print("  {")
+        print("    case INITIAL: return \"INITIAL\";")
+
+        with open(lex_file) as f:
+            for line in f:
+                if re.search(r'^%x', line) or  re.search(r'^%s', line):
+                    state = line.split()[1]
+                    print("    case %s: return \"%s\";" % (state,state))
+                elif re.search(r'^%%', line):
+                    break
+                else:
+                    pass
+            f.close()
+        #write post
+        print("  }")
+        print("  return \"Unknown\";")
+        print("}")
+
+if __name__ == '__main__':
+    main()
index c0d3dff..70df660 100644 (file)
  *  supports C++ and various languages that are closely related to C++, 
  *  such as C, C#, Objective-C, Java, PHP, and IDL.
  */
-class CLanguageScanner : public ParserInterface
+class COutlineParser : public OutlineParserInterface
 {
   public:
-    virtual ~CLanguageScanner() {}
+    COutlineParser();
+    virtual ~COutlineParser();
     void startTranslationUnit(const char *fileName);
     void finishTranslationUnit();
     void parseInput(const char *fileName,
                     const char *fileBuf,
-                    Entry *root,
+                    const std::shared_ptr<Entry> &root,
                     bool sameTranslationUnit,
                     QStrList &filesInSameTranslationUnit);
-    bool needsPreprocessing(const QCString &extension);
-    void parseCode(CodeOutputInterface &codeOutIntf,
-                   const char *scopeName,
-                   const QCString &input,
-                   SrcLangExt lang,
-                   bool isExampleBlock,
-                   const char *exampleName=0,
-                   FileDef *fileDef=0,
-                   int startLine=-1,
-                   int endLine=-1,
-                   bool inlineFragment=FALSE,
-                   const MemberDef *memberDef=0,
-                   bool showLineNumbers=TRUE,
-                   const Definition *searchCtx=0,
-                   bool collectXRefs=TRUE
-                  );
-    void resetCodeParserState();
+    bool needsPreprocessing(const QCString &extension) const;
     void parsePrototype(const char *text);
+  private:
+    struct Private;
+    std::unique_ptr<Private> p;
 };
 
-void scanFreeScanner();
 
 #endif
index 970b1e8..7b24d39 100644 (file)
  */
 %option never-interactive
 %option prefix="scannerYY"
+%option reentrant
+%option extra-type="struct scannerYY_state *"
 
 %{
 
 /*
  *     includes
  */
+
+#include <algorithm>
+#include <vector>
+#include <utility>
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <assert.h>
 #define YY_NO_INPUT 1
 #define YY_NO_UNISTD_H 1
 
-/* -----------------------------------------------------------------
- *
- *     statics
- */
-static ParserInterface *g_thisParser;
-static const char *     inputString;
-static int             inputPosition;
-static QFile            inputFile;
-static int             lastContext;
-static int             lastCContext;
-static int              lastDocContext;
-static int              lastCPPContext;
-static int              lastSkipSharpContext;
-static int              lastSkipRoundContext;
-static int              lastStringContext;
-static int              lastCurlyContext;
-static int              lastRoundContext;
-static int              lastSquareContext;
-static int              lastInitializerContext;
-static int              lastClassTemplSpecContext;
-static int              lastPreLineCtrlContext;
-static int              lastSkipVerbStringContext;
-static int              lastCommentInArgContext;
-static int              lastRawStringContext;
-static int              lastCSConstraint;
-static int              lastHereDocContext;
-static int              lastDefineContext;
-static int              lastAlignAsContext;
-static int              lastC11AttributeContext;
-static int              lastModifierContext;
-static Protection      protection;
-static Protection      baseProt;
-static int             sharpCount   = 0 ;
-static int             roundCount   = 0 ;
-static int             curlyCount   = 0 ;
-static int             squareCount  = 0 ;
-static int              padCount     = 0 ;
-static Entry*          current_root = 0 ;
-static Entry*          global_root  = 0 ;
-static Entry*          current      = 0 ;
-static Entry*          previous     = 0 ;
-static Entry*          tempEntry    = 0 ;
-static Entry*          firstTypedefEntry = 0 ;
-static Entry*          memspecEntry = 0 ;
-static int             yyLineNr     = 1 ;
-static int             yyBegLineNr  = yyLineNr ;
-static int             yyColNr      = 1 ;
-static int             yyBegColNr   = yyColNr ;
-static int              anonCount    = 0 ;        
-static int              anonNSCount  = 0 ;        
-static QCString                yyFileName;
-static MethodTypes     mtype;
-static bool                    gstat;
-static bool             removeSlashes;
-static Specifier       virt;
-static Specifier       baseVirt;
-static QCString         msType,msName,msArgs;
-static bool             isTypedef;
-static int              tmpDocType;
-static QCString         sectionLabel;
-static QCString                sectionTitle;
-static QCString         funcPtrType;
-static QCString         templateStr;
-static QCString         aliasName;
-static QCString         baseName;
-static QCString*        specName;
-static QCString         formulaText;
-static bool             useOverrideCommands = FALSE;
-
-static SrcLangExt       language;
-static bool             insideIDL   = FALSE;           //!< processing IDL code?
-static bool             insideJava  = FALSE;           //!< processing Java code?
-static bool             insideCS    = FALSE;           //!< processing C# code?
-static bool             insideD     = FALSE;           //!< processing D code?
-static bool             insidePHP   = FALSE;           //!< processing PHP code?
-static bool             insideObjC  = FALSE;            //!< processing Objective C code?
-static bool             insideCli   = FALSE;            //!< processing C++/CLI code?
-static bool             insideJS    = FALSE;            //!< processing JavaScript code?
-static bool             insideSlice = FALSE;            //!< processing Slice code?
-static bool             insideCpp   = TRUE;             //!< processing C/C++ code
-
-static bool             sliceOpt = FALSE;
-
-static bool             insideCppQuote = FALSE;
-static bool             insideProtocolList = FALSE;
-
-static int              argRoundCount;
-static int              argSharpCount;
-static int              currentArgumentContext;
-static int              lastCopyArgStringContext;
-static int              lastCopyArgContext;
-static QCString         *copyArgString;
-static QCString         fullArgString;
-
-static ArgumentList     *currentArgumentList;
-static char             lastCopyArgChar;
-
-static QCString         *pCopyQuotedString;
-static QCString         *pCopyRoundString;
-static QCString         *pCopyCurlyString;
-static QCString         *pCopyRawString;
-
-static QGString         *pCopyCurlyGString;
-static QGString         *pCopyRoundGString;
-static QGString         *pCopySquareGString;
-static QGString         *pCopyQuotedGString;
-static QGString         *pCopyHereDocGString;
-static QGString         *pCopyRawGString;
-static QGString         *pSkipVerbString;
-static QStack<Grouping> autoGroupStack;
-
-static bool             insideFormula;
-static bool            insideTryBlock=FALSE;
-static bool             insideCode;
-static bool             needsSemi;
-
-//static int              depthIf;
-static int             initBracketCount;
-
-static QCString         oldStyleArgType;
-static QCString         docBackup;
-static QCString         briefBackup;
-
-static int              docBlockContext;
-static QGString         docBlock;
-static QCString         docBlockName;
-static bool             docBlockInBody;
-static bool             docBlockAutoBrief;
-static char             docBlockTerm;
-
-static QCString         idlAttr;
-static QCString         idlProp;
-static bool             odlProp;
-
-static bool             g_lexInit = FALSE;
-static bool             externC;
-
-static QCString         g_delimiter;
-
-static int              g_column;
-
-static int              g_fencedSize=0;
-static bool             g_nestedComment=0;
-
-//-----------------------------------------------------------------------------
-
-// forward declarations
-//static void handleGroupStartCommand(const char *header);
-//static void handleGroupEndCommand();
-
-//-----------------------------------------------------------------------------
-
-static void initParser()
-{
-  sectionLabel.resize(0);
-  sectionTitle.resize(0);
-  baseName.resize(0);
-  formulaText.resize(0);
-  protection = Public;
-  baseProt = Public;
-  sharpCount = 0;
-  roundCount = 0;
-  curlyCount = 0;
-  mtype = Method;
-  gstat = FALSE;
-  virt = Normal;
-  baseVirt = Normal;
-  isTypedef = FALSE;
-  autoGroupStack.clear();
-  insideTryBlock = FALSE;
-  autoGroupStack.setAutoDelete(TRUE);
-  insideFormula = FALSE;
-  insideCode=FALSE;
-  insideCli=Config_getBool(CPP_CLI_SUPPORT);
-  sliceOpt=Config_getBool(OPTIMIZE_OUTPUT_SLICE);
-  previous = 0;
-  firstTypedefEntry = 0;
-  tempEntry = 0;
-  memspecEntry =0;
-}
-
-static void initEntry()
-{
-  if (insideJava) 
-  {
-    protection = (current_root->spec & (Entry::Interface|Entry::Enum)) ?  Public : Package;
-  }
-  current->protection = protection ;
-  current->mtype      = mtype;
-  current->virt       = virt;
-  current->stat       = gstat;
-  current->lang       = language;
-  //printf("*** initEntry() language=%d\n",language);
-  //if (!autoGroupStack.isEmpty())
-  //{
-  //  //printf("Appending group %s\n",autoGroupStack.top()->groupname.data());
-  //  current->groups->append(new Grouping(*autoGroupStack.top()));
-  //}
-  Doxygen::docGroup.initGroupInfo(current);
-  isTypedef=FALSE;
-}
-
-
-//-----------------------------------------------------------------------------
-
-///// remove any automatic grouping and add new one (if given)
-//static void setCurrentGroup( QCString *newgroup, Grouping::GroupPri_t pri )
-//{
-//   /* remove auto group name from current entry and discard it */
-//   Grouping *g = current->groups->first();
-//   int i=0; 
-//   while (g)
-//   {
-//     if (g->pri <= Grouping::GROUPING_AUTO_DEF)
-//     {
-//       current->groups->remove(i);
-//       i--;
-//     }
-//     g=current->groups->next();
-//     i++;
-//   }
-//
-//   /* use new group name instead? */
-//   if ( newgroup )
-//   {
-//      current->groups->append(new Grouping(*newgroup, pri));
-//   } 
-//}
-//
-//static int newMemberGroupId()
-//{
-//  static int curGroupId=0;
-//  return curGroupId++;
-//}
-//
-// forward declarations
-//static void startGroupInDoc();
-//static void endGroup();
-
-//-----------------------------------------------------------------------------
-
-static void lineCount()
-{
-  static int tabSize = Config_getInt(TAB_SIZE);
-  const char *p;
-  for (p = yytext ; *p ; ++p )
-  {
-    if (*p=='\n') 
-    {
-      yyLineNr++,g_column=0,yyColNr=1;
-    }
-    else if (*p=='\t') 
-    {
-      g_column+=tabSize - (g_column%tabSize);
-    }
-    else 
-    {
-      g_column++,yyColNr++;
-    }
-  }
-  //printf("lineCount()=%d\n",g_column);
-}
-
-static inline int computeIndent(const char *s,int startIndent)
-{
-  int col=startIndent;
-  static int tabSize=Config_getInt(TAB_SIZE);
-  const char *p=s;
-  char c;
-  while ((c=*p++))
-  {
-    if (c=='\t') col+=tabSize-(col%tabSize);
-    else if (c=='\n') col=0;
-    else col++;
-  }
-  return col;
-}
-
-static void addType( Entry* current )
-{
-    uint tl=current->type.length();
-    if( tl>0 && !current->name.isEmpty() && current->type.at(tl-1)!='.') 
-    {
-      current->type += ' ' ;
-    }
-    current->type += current->name ;
-    current->name.resize(0) ;
-    tl=current->type.length();
-    if( tl>0 && !current->args.isEmpty() && current->type.at(tl-1)!='.') 
-    {
-      current->type += ' ' ;
-    }
-    current->type += current->args ;
-    current->args.resize(0) ;
-    current->argList->clear();
-}
-
-
-static QCString stripQuotes(const char *s)
-{
-  QCString name;
-  if (s==0 || *s==0) return name;
-  name=s;
-  if (name.at(0)=='"' && name.at(name.length()-1)=='"')
-  {
-    name=name.mid(1,name.length()-2);
-  }
-  return name;
-}
-
-//-----------------------------------------------------------------
-
-static void startCommentBlock(bool);
-static void handleCommentBlock(const QCString &doc,bool brief);
-static void handleParametersCommentBlocks(ArgumentList *al);
-
-//-----------------------------------------------------------------
-
-static bool nameIsOperator(QCString &name)
+struct scannerYY_state
 {
-  int i=name.find("operator");
-  if (i==-1) return FALSE;
-  if (i==0 && !isId(name.at(8))) return TRUE; // case operator ::X
-  if (i>0 && !isId(name.at(i-1)) && !isId(name.at(i+8))) return TRUE; // case X::operator
-  return FALSE; // case TEXToperatorTEXT
-}
-
+  OutlineParserInterface *thisParser;
+  const char *     inputString = 0;
+  int              inputPosition = 0;
+  int              lastContext = 0;
+  int              lastCContext = 0;
+  int              lastDocContext = 0;
+  int              lastCPPContext = 0;
+  int              lastSkipSharpContext = 0;
+  int              lastSkipRoundContext = 0;
+  int              lastStringContext = 0;
+  int              lastCurlyContext = 0;
+  int              lastRoundContext = 0;
+  int              lastSquareContext = 0;
+  int              lastInitializerContext = 0;
+  int              lastClassTemplSpecContext = 0;
+  int              lastPreLineCtrlContext = 0;
+  int              lastSkipVerbStringContext = 0;
+  int              lastCommentInArgContext = 0;
+  int              lastRawStringContext = 0;
+  int              lastCSConstraint = 0;
+  int              lastHereDocContext = 0;
+  int              lastDefineContext = 0;
+  int              lastAlignAsContext = 0;
+  int              lastC11AttributeContext = 0;
+  int              lastModifierContext = 0;
+  Protection       protection = Public;
+  Protection       baseProt = Public;
+  int              sharpCount   = 0 ;
+  int              roundCount   = 0 ;
+  int              curlyCount   = 0 ;
+  int              squareCount  = 0 ;
+  int              padCount     = 0 ;
+  std::shared_ptr<Entry> current;
+  std::shared_ptr<Entry> current_root;
+  std::shared_ptr<Entry> previous;
+  std::shared_ptr<Entry> tempEntry;
+  std::shared_ptr<Entry> firstTypedefEntry;
+  std::shared_ptr<Entry> memspecEntry;
+  int              yyLineNr     = 1 ;
+  int              yyBegLineNr  = 1 ;
+  int              yyColNr      = 1 ;
+  int              yyBegColNr   = 1 ;
+  int              anonCount    = 0 ;
+  int              anonNSCount  = 0 ;
+  QCString         yyFileName;
+  MethodTypes      mtype = Method;
+  bool             stat = false;
+  Specifier        virt = Normal;
+  Specifier        baseVirt = Normal;
+  QCString         msType;
+  QCString         msName;
+  QCString         msArgs;
+  bool             isTypedef = false;
+  QCString         funcPtrType;
+  QCString         templateStr;
+  QCString         aliasName;
+  QCString         baseName;
+  QCString*        specName = 0;
+
+  SrcLangExt       language = SrcLangExt_Unknown;
+  bool             insideIDL   = false;                //!< processing IDL code?
+  bool             insideJava  = false;                //!< processing Java code?
+  bool             insideCS    = false;                //!< processing C# code?
+  bool             insideD     = false;                //!< processing D code?
+  bool             insidePHP   = false;                //!< processing PHP code?
+  bool             insideObjC  = false;            //!< processing Objective C code?
+  bool             insideCli   = false;            //!< processing C++/CLI code?
+  bool             insideJS    = false;            //!< processing JavaScript code?
+  bool             insideSlice = false;            //!< processing Slice code?
+  bool             insideCpp   = true;             //!< processing C/C++ code
+
+  bool             insideCppQuote = false;
+  bool             insideProtocolList = false;
+
+  int              argRoundCount = 0;
+  int              argSharpCount = 0;
+  int              currentArgumentContext = 0;
+  int              lastCopyArgStringContext = 0;
+  int              lastCopyArgContext = 0;
+  QCString        *copyArgString = 0;
+  QCString         fullArgString;
+  QCString         dummyRawString;
+
+  ArgumentList    *currentArgumentList = 0;
+  char             lastCopyArgChar = '\0';
+
+  QCString        *pCopyQuotedString = 0;
+  QCString        *pCopyRoundString = 0;
+  QCString        *pCopyCurlyString = 0;
+  QCString        *pCopyRawString = 0;
+  QGString        *pCopyCurlyGString = 0;
+  QGString        *pCopyRoundGString = 0;
+  QGString        *pCopySquareGString = 0;
+  QGString        *pCopyQuotedGString = 0;
+  QGString        *pCopyHereDocGString = 0;
+  QGString        *pCopyRawGString = 0;
+  QGString        *pSkipVerbString = 0;
+  QStack<Grouping> autoGroupStack;
+
+  bool             insideFormula = false;
+  bool             insideTryBlock = false;
+  bool             insideCode = false;
+  bool             needsSemi = false;
+
+  int              initBracketCount = 0;
+
+  QCString         oldStyleArgType;
+  QCString         docBackup;
+  QCString         briefBackup;
+
+  int              docBlockContext = 0;
+  QGString         docBlock;
+  QCString         docBlockName;
+  bool             docBlockInBody = false;
+  bool             docBlockAutoBrief = false;
+  char             docBlockTerm = '\0';
+
+  QCString         idlAttr;
+  QCString         idlProp;
+  bool             odlProp = false;
+
+  bool             lexInit = false;
+  bool             externC = false;
+
+  QCString         delimiter;
+
+  int              column = 0;
+
+  int              fencedSize = 0;
+  bool             nestedComment = false;
+  std::vector< std::pair<Entry*,std::shared_ptr<Entry> > > outerScopeEntries;
+};
+
+static const char *stateToString(int state);
 //-----------------------------------------------------------------------------
 
-static void setContext()
-{
-  QCString fileName = yyFileName;
-  language    = getLanguageFromFileName(fileName);
-  insideIDL   = language==SrcLangExt_IDL;
-  insideJava  = language==SrcLangExt_Java;
-  insideCS    = language==SrcLangExt_CSharp; 
-  insideD     = language==SrcLangExt_D;
-  insidePHP   = language==SrcLangExt_PHP;
-  insideObjC  = language==SrcLangExt_ObjC;
-  insideJS    = language==SrcLangExt_JS;
-  insideSlice = language==SrcLangExt_Slice;
-  insideCpp   = language==SrcLangExt_Cpp;
-  if ( insidePHP )
-  {
-    useOverrideCommands = TRUE;
-  }
-  //printf("setContext(%s) insideIDL=%d insideJava=%d insideCS=%d "
-  //       "insideD=%d insidePHP=%d insideObjC=%d\n",
-  //       yyFileName.data(),insideIDL,insideJava,insideCS,insideD,insidePHP,insideObjC
-  //   );
-}
+// forward declarations for stateless functions
+static inline int computeIndent(const char *s,int startIndent);
+static QCString stripQuotes(const char *s);
+static bool nameIsOperator(QCString &name);
+void fixArgumentListForJavaScript(ArgumentList &al);
+
+// forward declarations for statefull functions
+static void initParser(yyscan_t yyscanner);
+static void initEntry(yyscan_t yyscanner);
+static void lineCount(yyscan_t yyscanner);
+static void addType(yyscan_t yyscanner);
+static void setContext(yyscan_t yyscanner);
+static void prependScope(yyscan_t yyscanner);
+static void startCommentBlock(yyscan_t yyscanner,bool);
+static void handleCommentBlock(yyscan_t yyscanner,const QCString &doc,bool brief);
+static void handleParametersCommentBlocks(yyscan_t yyscanner,ArgumentList &al);
+static bool checkForKnRstyleC(yyscan_t yyscanner);
+static void splitKnRArg(yyscan_t yyscanner,QCString &oldStyleArgPtr,QCString &oldStyleArgName);
+static void addKnRArgInfo(yyscan_t yyscanner,const QCString &type,const QCString &name,
+                          const QCString &brief,const QCString &docs);
+static int yyread(yyscan_t yyscanner,char *buf,int max_size);
 
-//-----------------------------------------------------------------------------
-
-static void prependScope()
-{
-  if (current_root->section & Entry::SCOPE_MASK)
-  {
-    //printf("--- prependScope %s to %s\n",current_root->name.data(),current->name.data());
-    current->name.prepend(current_root->name+"::");
-    if (current_root->tArgLists)
-    {
-      if (current->tArgLists==0)
-      {
-       current->tArgLists = new QList<ArgumentList>;
-       current->tArgLists->setAutoDelete(TRUE);
-      }
-      //printf("prependScope #=%d #current=%d\n",current_root->tArgLists->count(),current->tArgLists->count());
-      QListIterator<ArgumentList> talsi(*current_root->tArgLists);
-      ArgumentList *srcAl=0;
-      for (talsi.toLast();(srcAl=talsi.current());--talsi)
-      {
-        ArgumentList *dstAl = new ArgumentList;
-       QListIterator<Argument> tali(*srcAl);
-        Argument *a;
-        for (;(a=tali.current());++tali)
-        {
-          dstAl->append(new Argument(*a));
-        //printf("appending argument %s %s\n",a->type.data(),a->name.data());
-        }        
-        current->tArgLists->insert(0,dstAl);   
-      }
-    }
-  }
-}
-
-//-----------------------------------------------------------------------------
-
-/*! Returns TRUE iff the current entry could be a K&R style C function */
-static bool checkForKnRstyleC()
-{
-  if (((QCString)yyFileName).right(2).lower()!=".c") return FALSE; // must be a C file
-  if (!current->argList) return FALSE; // must have arguments
-  ArgumentListIterator ali(*current->argList);
-  Argument *a;
-  for (ali.toFirst();(a=ali.current());++ali)
-  {
-    // in K&R style argument do not have a type, but doxygen expects a type
-    // so it will think the argument has no name
-    if (a->type.isEmpty() || !a->name.isEmpty()) return FALSE;
-  }
-  return TRUE;
-}
-
-//-----------------------------------------------------------------------------
-
-static void splitKnRArg(QCString &oldStyleArgPtr,QCString &oldStyleArgName)
-{
-  int si = current->args.length();
-  if (oldStyleArgType.isEmpty()) // new argument
-  {
-    static QRegExp re("([^)]*)");
-    int bi1 = current->args.findRev(re);
-    int bi2 = bi1!=-1 ? current->args.findRev(re,bi1-1) : -1; 
-    char c;
-    if (bi1!=-1 && bi2!=-1) // found something like "int (*func)(int arg)"
-    {
-      int s=bi2+1;
-      oldStyleArgType = current->args.left(s);
-      int i=s;
-      while (i<si && ((c=current->args.at(i))=='*' || isspace((uchar)c))) i++;
-      oldStyleArgType += current->args.mid(s,i-s);
-      s=i;
-      while (i<si && isId(current->args.at(i))) i++;
-      oldStyleArgName = current->args.mid(s,i-s);
-      oldStyleArgType+=current->args.mid(i);
-    }
-    else if (bi1!=-1) // redundant braces like in "int (*var)"
-    {
-      int s=bi1;
-      oldStyleArgType = current->args.left(s);
-      s++;
-      int i=s+1;
-      while (i<si && ((c=current->args.at(i))=='*' || isspace((uchar)c))) i++;
-      oldStyleArgType += current->args.mid(s,i-s);
-      s=i;
-      while (i<si && isId(current->args.at(i))) i++;
-      oldStyleArgName = current->args.mid(s,i-s);
-    }
-    else // normal "int *var"
-    {
-      int l=si,i=l-1,j;
-      char c;
-      // look for start of name in "type *name"
-      while (i>=0 && isId(current->args.at(i))) i--;
-      j=i+1;
-      // look for start of *'s
-      while (i>=0 && ((c=current->args.at(i))=='*' || isspace((uchar)c))) i--;
-      i++;
-      if (i!=l)
-      {
-       oldStyleArgType=current->args.left(i);
-       oldStyleArgPtr=current->args.mid(i,j-i);
-       oldStyleArgName=current->args.mid(j).stripWhiteSpace();
-      }
-      else
-      {
-       oldStyleArgName=current->args.copy().stripWhiteSpace();
-      }
-    }
-  }
-  else // continuation like *arg2 in "int *args,*arg2"
-  {
-    int l=si,j=0;
-    char c;
-    while (j<l && ((c=current->args.at(j))=='*' || isspace((uchar)c))) j++;
-    if (j>0)
-    {
-      oldStyleArgPtr=current->args.left(j);
-      oldStyleArgName=current->args.mid(j).stripWhiteSpace();
-    }
-    else
-    {
-      oldStyleArgName=current->args.copy().stripWhiteSpace();
-    }
-  }
-}
-
-//-----------------------------------------------------------------------------
-
-/*! Update the argument \a name with additional \a type info. For K&R style
- *  function the type is found \e after the argument list, so this routine
- *  in needed to fix up.
- */
-static void addKnRArgInfo(const QCString &type,const QCString &name,
-                          const QCString &brief,const QCString &docs)
-{
-  if (current->argList==0) return;
-  ArgumentListIterator ali(*current->argList);
-  Argument *a;
-  for (ali.toFirst();(a=ali.current());++ali)
-  {
-    if (a->type==name)
-    {
-      a->type=type.stripWhiteSpace();
-      if (a->type.left(9)=="register ") // strip keyword
-      {
-       a->type=a->type.mid(9);
-      }
-      a->name=name.stripWhiteSpace();
-      if (!brief.isEmpty() && !docs.isEmpty())
-      {
-        a->docs=brief+"\n\n"+docs;
-      }
-      else if (!brief.isEmpty())
-      {
-        a->docs=brief;
-      }
-      else
-      {
-       a->docs=docs;
-      }
-    }
-  }
-}
-
-//-----------------------------------------------------------------------------
-
-
-void fixArgumentListForJavaScript(ArgumentList *al)
-{
-  if (al==0) return;
-  ArgumentListIterator ali(*al);
-  Argument *a;
-  for (ali.toFirst();(a=ali.current());++ali)
-  {
-    if (!a->type.isEmpty() && a->name.isEmpty())
-    { // a->type is actually the (typeless) parameter name, so move it
-      a->name=a->type;
-      a->type.resize(0);
-    }
-  }
-}
 
 /* ----------------------------------------------------------------- */
 #undef YY_INPUT
-#define        YY_INPUT(buf,result,max_size) result=yyread(buf,max_size);
-
-static int yyread(char *buf,int max_size)
-{
-    int c=0;
-    while( c < max_size && inputString[inputPosition] )
-    {
-      *buf = inputString[inputPosition++] ;
-      //printf("%d (%c)\n",*buf,*buf);
-      c++; buf++;
-    }
-    return c;
-}
+#define        YY_INPUT(buf,result,max_size) result=yyread(yyscanner,buf,max_size);
 
 %}
 
@@ -742,6 +364,8 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
 %x     GCopyCurly
 %x     SkipUnionSwitch
 %x     Specialization
+%x     SpecializationSingleQuote
+%x     SpecializationDoubleQuote
 %x     FuncPtrInit
 %x     FuncFunc
 %x     FuncFuncEnd
@@ -792,32 +416,32 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
 %%
 
 <NextSemi>"{"                          {
-                                         curlyCount=0;
-                                         needsSemi = TRUE;
+                                         yyextra->curlyCount=0;
+                                         yyextra->needsSemi = TRUE;
                                          BEGIN(SkipCurlyBlock); 
                                        }
 <NextSemi>"("                          {
-                                         roundCount=0;
+                                         yyextra->roundCount=0;
                                          BEGIN(SkipRoundBlock);
                                        }
 <SkipRoundBlock>"("                    {
-                                         ++roundCount;
+                                         ++yyextra->roundCount;
                                        }
 <SkipRoundBlock>")"                    {
-                                         if (roundCount )
-                                           --roundCount ;
+                                         if (yyextra->roundCount )
+                                           --yyextra->roundCount ;
                                          else
                                            BEGIN( NextSemi ) ;
                                        }
 <SkipCurlyBlock>"{"                    {
-                                         ++curlyCount ; 
+                                         ++yyextra->curlyCount ; 
                                        }
 <SkipCurlyBlock>"}"                    { 
-                                         if( curlyCount )
+                                         if( yyextra->curlyCount )
                                          {
-                                           --curlyCount ;
+                                           --yyextra->curlyCount ;
                                          }
-                                         else if (needsSemi)
+                                         else if (yyextra->needsSemi)
                                          {
                                            BEGIN( NextSemi );
                                          }
@@ -827,15 +451,15 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                          }
                                        }
 <NextSemi>\'                           {
-                                         if (insidePHP)
+                                         if (yyextra->insidePHP)
                                          {
-                                           lastStringContext=NextSemi;
+                                           yyextra->lastStringContext=NextSemi;
                                            BEGIN(SkipPHPString);
                                          }
                                        }
-<NextSemi>{CHARLIT}                    { if (insidePHP) REJECT; }
+<NextSemi>{CHARLIT}                    { if (yyextra->insidePHP) REJECT; }
 <NextSemi>\"                           {
-                                         lastStringContext=NextSemi;
+                                         yyextra->lastStringContext=NextSemi;
                                          BEGIN(SkipString);
                                        }
 <NextSemi>[;,]                         { 
@@ -847,117 +471,123 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                          BEGIN( FindMembers );
                                        }
 <EnumBaseType>[{;,]                     {
-                                          current->args = current->args.simplifyWhiteSpace();
+                                          yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
                                          unput(*yytext);
                                          BEGIN( ClassVar );
                                         }
 <FindMembers>"<?php"                   { // PHP code with unsupported extension?
-                                          insidePHP = TRUE;
+                                          yyextra->insidePHP = TRUE;
                                        }
 <FindMembersPHP>"<?"("php"?)            { // PHP code start
                                            BEGIN( FindMembers );
                                        }
 <FindMembersPHP>"<script"{BN}+"language"{BN}*"="{BN}*['"]?"php"['"]?{BN}*">" { // PHP code start
-                                         lineCount() ;
+                                         lineCount(yyscanner) ;
                                           BEGIN( FindMembers );
                                        }
+<FindMembers>"?>"|"</script>"           { // PHP code end
+                                         if (yyextra->insidePHP)
+                                           BEGIN( FindMembersPHP );
+                                         else
+                                           REJECT;
+                                        }
 <FindMembersPHP>[^\n<]+                 { // Non-PHP code text, ignore
                                        }
 <FindMembersPHP>\n                      { // Non-PHP code text, ignore
-                                          lineCount();
+                                          lineCount(yyscanner);
                                        }
 <FindMembersPHP>.                       { // Non-PHP code text, ignore
                                        }
-<FindMembers>{PHPKW}                   { if (insidePHP)
+<FindMembers>{PHPKW}                   { if (yyextra->insidePHP)
                                            BEGIN( NextSemi );
                                          else
                                            REJECT;
                                        }
 <FindMembers>"%{"[^\n]*                        { // Mozilla XPIDL lang-specific block
-                                         if (!insideIDL)
+                                         if (!yyextra->insideIDL)
                                            REJECT;
                                        }
 <FindMembers>"%}"                      { // Mozilla XPIDL lang-specific block end
-                                         if (!insideIDL)
+                                         if (!yyextra->insideIDL)
                                            REJECT;
                                        }
 <FindMembers>{B}*("properties"){BN}*":"{BN}*  { // IDL or Borland C++ builder property 
-                                         current->mtype = mtype = Property;
-                                         current->protection = protection = Public ;
-                                         current->type.resize(0); 
-                                         current->name.resize(0); 
-                                         current->args.resize(0);
-                                         current->argList->clear();
-                                         lineCount() ;
+                                         yyextra->current->mtype = yyextra->mtype = Property;
+                                         yyextra->current->protection = yyextra->protection = Public ;
+                                         yyextra->current->type.resize(0); 
+                                         yyextra->current->name.resize(0); 
+                                         yyextra->current->args.resize(0);
+                                         yyextra->current->argList.clear();
+                                         lineCount(yyscanner) ;
                                        }
 
-<FindMembers>{B}*"k_dcop"{BN}*":"{BN}*  { current->mtype = mtype = DCOP;
-                                         current->protection = protection = Public ;
-                                         current->type.resize(0); 
-                                         current->name.resize(0); 
-                                         current->args.resize(0);
-                                         current->argList->clear();
-                                         lineCount() ;
+<FindMembers>{B}*"k_dcop"{BN}*":"{BN}*  { yyextra->current->mtype = yyextra->mtype = DCOP;
+                                         yyextra->current->protection = yyextra->protection = Public ;
+                                         yyextra->current->type.resize(0); 
+                                         yyextra->current->name.resize(0); 
+                                         yyextra->current->args.resize(0);
+                                         yyextra->current->argList.clear();
+                                         lineCount(yyscanner) ;
                                        }
 
-<FindMembers>{B}*("signals"|"Q_SIGNALS"){BN}*":"{BN}* { current->mtype = mtype = Signal;
+<FindMembers>{B}*("signals"|"Q_SIGNALS"){BN}*":"{BN}* { yyextra->current->mtype = yyextra->mtype = Signal;
   
-                                         current->protection = protection = Public ;
-                                         current->type.resize(0); 
-                                         current->name.resize(0); 
-                                         current->args.resize(0);
-                                         current->argList->clear();
-                                         lineCount() ;
+                                         yyextra->current->protection = yyextra->protection = Public ;
+                                         yyextra->current->type.resize(0); 
+                                         yyextra->current->name.resize(0); 
+                                         yyextra->current->args.resize(0);
+                                         yyextra->current->argList.clear();
+                                         lineCount(yyscanner) ;
                                        }
 
 <FindMembers>{B}*"public"{BN}*("slots"|"Q_SLOTS"){BN}*":"{BN}* {
-                                         current->protection = protection = Public ;
-                                         current->mtype = mtype = Slot;
-                                         current->type.resize(0); 
-                                         current->name.resize(0); 
-                                         current->args.resize(0);
-                                         current->argList->clear();
-                                         lineCount();
+                                         yyextra->current->protection = yyextra->protection = Public ;
+                                         yyextra->current->mtype = yyextra->mtype = Slot;
+                                         yyextra->current->type.resize(0); 
+                                         yyextra->current->name.resize(0); 
+                                         yyextra->current->args.resize(0);
+                                         yyextra->current->argList.clear();
+                                         lineCount(yyscanner);
                                        }
 
 <FindMembers>{B}*"protected"{BN}*("slots"|"Q_SLOTS"){BN}*":"{BN}* {
-                                         current->protection = protection = Protected ;
-                                         current->mtype = mtype = Slot;
-                                         current->type.resize(0); 
-                                         current->name.resize(0); 
-                                         current->args.resize(0);
-                                         current->argList->clear();
-                                         lineCount();
+                                         yyextra->current->protection = yyextra->protection = Protected ;
+                                         yyextra->current->mtype = yyextra->mtype = Slot;
+                                         yyextra->current->type.resize(0); 
+                                         yyextra->current->name.resize(0); 
+                                         yyextra->current->args.resize(0);
+                                         yyextra->current->argList.clear();
+                                         lineCount(yyscanner);
                                        }
 
 <FindMembers>{B}*"private"{BN}*("slots"|"Q_SLOTS"){BN}*":"{BN}* {
-                                         current->protection = protection = Private ;
-                                         current->mtype = mtype = Slot;
-                                         current->type.resize(0); 
-                                         current->name.resize(0); 
-                                         current->args.resize(0);
-                                         current->argList->clear();
-                                         lineCount();
+                                         yyextra->current->protection = yyextra->protection = Private ;
+                                         yyextra->current->mtype = yyextra->mtype = Slot;
+                                         yyextra->current->type.resize(0); 
+                                         yyextra->current->name.resize(0); 
+                                         yyextra->current->args.resize(0);
+                                         yyextra->current->argList.clear();
+                                         lineCount(yyscanner);
                                        }
 <FindMembers>{B}*("public"|"methods"|"__published"){BN}*":"{BN}* { 
-                                         current->protection = protection = Public ;
-                                         current->mtype = mtype = Method;
-                                         current->type.resize(0); 
-                                         current->name.resize(0); 
-                                         current->args.resize(0);
-                                         current->argList->clear();
-                                         lineCount() ;
+                                         yyextra->current->protection = yyextra->protection = Public ;
+                                         yyextra->current->mtype = yyextra->mtype = Method;
+                                         yyextra->current->type.resize(0); 
+                                         yyextra->current->name.resize(0); 
+                                         yyextra->current->args.resize(0);
+                                         yyextra->current->argList.clear();
+                                         lineCount(yyscanner) ;
                                        }
 <FindMembers>{B}*"internal"{BN}*":"{BN}* {  // for now treat C++/CLI's internal as package...
-                                         if (insideCli)
+                                         if (yyextra->insideCli)
                                          {
-                                           current->protection = protection = Package ;
-                                           current->mtype = mtype = Method;
-                                           current->type.resize(0); 
-                                           current->name.resize(0); 
-                                           current->args.resize(0);
-                                           current->argList->clear();
-                                           lineCount() ;
+                                           yyextra->current->protection = yyextra->protection = Package ;
+                                           yyextra->current->mtype = yyextra->mtype = Method;
+                                           yyextra->current->type.resize(0); 
+                                           yyextra->current->name.resize(0); 
+                                           yyextra->current->args.resize(0);
+                                           yyextra->current->argList.clear();
+                                           lineCount(yyscanner) ;
                                          }
                                          else
                                          {
@@ -965,38 +595,38 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                          }
                                        }
 <FindMembers>{B}*"protected"{BN}*":"{BN}* {  
-                                         current->protection = protection = Protected ;
-                                         current->mtype = mtype = Method;
-                                         current->type.resize(0); 
-                                         current->name.resize(0); 
-                                         current->args.resize(0);
-                                         current->argList->clear();
-                                         lineCount() ;
+                                         yyextra->current->protection = yyextra->protection = Protected ;
+                                         yyextra->current->mtype = yyextra->mtype = Method;
+                                         yyextra->current->type.resize(0); 
+                                         yyextra->current->name.resize(0); 
+                                         yyextra->current->args.resize(0);
+                                         yyextra->current->argList.clear();
+                                         lineCount(yyscanner) ;
                                        }
 <FindMembers>{B}*"private"{BN}*":"{BN}*        { 
-                                         current->protection = protection = Private ;
-                                         current->mtype = mtype = Method;
-                                         current->type.resize(0); 
-                                         current->name.resize(0); 
-                                         current->args.resize(0);
-                                         current->argList->clear();
-                                         lineCount() ;
+                                         yyextra->current->protection = yyextra->protection = Private ;
+                                         yyextra->current->mtype = yyextra->mtype = Method;
+                                         yyextra->current->type.resize(0); 
+                                         yyextra->current->name.resize(0); 
+                                         yyextra->current->args.resize(0);
+                                         yyextra->current->argList.clear();
+                                         lineCount(yyscanner) ;
                                        }
 <FindMembers>{B}*"event"{BN}+           { 
-                                         if (insideCli)
+                                         if (yyextra->insideCli)
                                          {
                                            // C++/CLI event
-                                           lineCount() ;
-                                           current->mtype = mtype = Event;
-                                           current->bodyLine = yyLineNr;
-                                           curlyCount=0;
+                                           lineCount(yyscanner) ;
+                                           yyextra->current->mtype = yyextra->mtype = Event;
+                                           yyextra->current->bodyLine = yyextra->yyLineNr;
+                                           yyextra->curlyCount=0;
                                            BEGIN( CliPropertyType );
                                          }
-                                         else if (insideCS)
+                                         else if (yyextra->insideCS)
                                          {
-                                           lineCount() ;
-                                           current->mtype = Event;
-                                           current->bodyLine = yyLineNr;
+                                           lineCount(yyscanner) ;
+                                           yyextra->current->mtype = Event;
+                                           yyextra->current->bodyLine = yyextra->yyLineNr;
                                          }
                                          else
                                          {
@@ -1004,13 +634,13 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                          }
                                         }
 <FindMembers>{B}*"property"{BN}+       {
-                                          if (insideCli)
+                                          if (yyextra->insideCli)
                                           {
                                             // C++/CLI property
-                                            lineCount() ;
-                                            current->mtype = mtype = Property;
-                                            current->bodyLine = yyLineNr;
-                                            curlyCount=0;
+                                            lineCount(yyscanner) ;
+                                            yyextra->current->mtype = yyextra->mtype = Property;
+                                            yyextra->current->bodyLine = yyextra->yyLineNr;
+                                            yyextra->curlyCount=0;
                                             BEGIN( CliPropertyType );
                                           }
                                           else
@@ -1019,16 +649,16 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                           }
                                        }
 <CliPropertyType>{ID}                  {
-                                         addType( current );
-                                         current->name = yytext;
+                                         addType(yyscanner);
+                                         yyextra->current->name = yytext;
                                        }
 <CliPropertyType>"["                   { // C++/CLI indexed property
-                                         current->args = "[";
+                                         yyextra->current->args = "[";
                                          BEGIN( CliPropertyIndex );
                                        }
 <CliPropertyType>"{"                   {
-                                         curlyCount=0;
-                                         //printf("event: '%s' '%s'\n",current->type.data(),current->name.data());
+                                         yyextra->curlyCount=0;
+                                         //printf("event: '%s' '%s'\n",yyextra->current->type.data(),yyextra->current->name.data());
                                          BEGIN( CSAccessorDecl );
                                        }
 <CliPropertyType>";"                   {
@@ -1036,84 +666,84 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                          BEGIN( FindMembers );
                                        }
 <CliPropertyType>\n                    {
-                                          lineCount();
+                                          lineCount(yyscanner);
                                        }
 <CliPropertyType>{B}*                  {
                                        }
 <CliPropertyType>.                     {
-                                         addType( current );
-                                         current->type += yytext;
+                                         addType(yyscanner);
+                                         yyextra->current->type += yytext;
                                        }
 <CliPropertyIndex>"]"                  {
                                           BEGIN( CliPropertyType );
-                                         current->args+=yytext;
+                                         yyextra->current->args+=yytext;
                                        }
 <CliPropertyIndex>.                    {
-                                         current->args+=yytext;
+                                         yyextra->current->args+=yytext;
                                        }
   /*
 <FindMembers>{B}*"property"{BN}+        { 
-                                          if (!current->type.isEmpty())
+                                          if (!yyextra->current->type.isEmpty())
                                          {
                                            REJECT;
                                           }
                                          else
                                          { 
-                                            current->mtype = mtype = Property;
-                                            lineCount();
+                                            yyextra->current->mtype = yyextra->mtype = Property;
+                                            lineCount(yyscanner);
                                          }
                                         }
   */
 <FindMembers>{B}*"@private"{BN}+       {
-                                         current->protection = protection = Private ;
-                                         current->mtype = mtype = Method;
-                                         current->type.resize(0); 
-                                         current->name.resize(0); 
-                                         current->args.resize(0);
-                                         current->argList->clear();
-                                         lineCount() ;
+                                         yyextra->current->protection = yyextra->protection = Private ;
+                                         yyextra->current->mtype = yyextra->mtype = Method;
+                                         yyextra->current->type.resize(0); 
+                                         yyextra->current->name.resize(0); 
+                                         yyextra->current->args.resize(0);
+                                         yyextra->current->argList.clear();
+                                         lineCount(yyscanner) ;
                                        }
 <FindMembers>{B}*"@protected"{BN}+     {
-                                         current->protection = protection = Protected ;
-                                         current->mtype = mtype = Method;
-                                         current->type.resize(0); 
-                                         current->name.resize(0); 
-                                         current->args.resize(0);
-                                         current->argList->clear();
-                                         lineCount() ;
+                                         yyextra->current->protection = yyextra->protection = Protected ;
+                                         yyextra->current->mtype = yyextra->mtype = Method;
+                                         yyextra->current->type.resize(0); 
+                                         yyextra->current->name.resize(0); 
+                                         yyextra->current->args.resize(0);
+                                         yyextra->current->argList.clear();
+                                         lineCount(yyscanner) ;
                                        }
 <FindMembers>{B}*"@public"{BN}+        {
-                                         current->protection = protection = Public ;
-                                         current->mtype = mtype = Method;
-                                         current->type.resize(0); 
-                                         current->name.resize(0); 
-                                         current->args.resize(0);
-                                         current->argList->clear();
-                                         lineCount() ;
+                                         yyextra->current->protection = yyextra->protection = Public ;
+                                         yyextra->current->mtype = yyextra->mtype = Method;
+                                         yyextra->current->type.resize(0); 
+                                         yyextra->current->name.resize(0); 
+                                         yyextra->current->args.resize(0);
+                                         yyextra->current->argList.clear();
+                                         lineCount(yyscanner) ;
                                        }
 <FindMembers>[\-+]{BN}*                        {
-                                         if (!insideObjC) 
+                                         if (!yyextra->insideObjC) 
                                          {
                                            REJECT;
                                          }
                                          else
                                          {
-                                           lineCount();
-                                           current->fileName  = yyFileName;
-                                           current->startLine = yyLineNr;
-                                           current->startColumn = yyColNr;
-                                           current->bodyLine  = yyLineNr;
-                                           current->section = Entry::FUNCTION_SEC;
-                                           current->protection = protection = Public ;
-                                           language = current->lang = SrcLangExt_ObjC;
-                                           insideObjC = TRUE;
-                                           current->virt = Virtual;
-                                           current->stat=yytext[0]=='+';
-                                           current->mtype = mtype = Method;
-                                           current->type.resize(0); 
-                                           current->name.resize(0); 
-                                           current->args.resize(0);
-                                           current->argList->clear();
+                                           lineCount(yyscanner);
+                                           yyextra->current->fileName  = yyextra->yyFileName;
+                                           yyextra->current->startLine = yyextra->yyLineNr;
+                                           yyextra->current->startColumn = yyextra->yyColNr;
+                                           yyextra->current->bodyLine  = yyextra->yyLineNr;
+                                           yyextra->current->section = Entry::FUNCTION_SEC;
+                                           yyextra->current->protection = yyextra->protection = Public ;
+                                           yyextra->language = yyextra->current->lang = SrcLangExt_ObjC;
+                                           yyextra->insideObjC = TRUE;
+                                           yyextra->current->virt = Virtual;
+                                           yyextra->current->stat=yytext[0]=='+';
+                                           yyextra->current->mtype = yyextra->mtype = Method;
+                                           yyextra->current->type.resize(0); 
+                                           yyextra->current->name.resize(0); 
+                                           yyextra->current->args.resize(0);
+                                           yyextra->current->argList.clear();
                                            BEGIN( ObjCMethod );
                                          }
                                        }
@@ -1121,24 +751,24 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                          BEGIN( ObjCReturnType );
                                        }
 <ObjCMethod>{ID}                       { // found method name
-                                         if (current->type.isEmpty())
+                                         if (yyextra->current->type.isEmpty())
                                          {
-                                           current->type = "id";
+                                           yyextra->current->type = "id";
                                          }
-                                         current->name = yytext;
-                                          if (insideCpp || insideObjC) 
+                                         yyextra->current->name = yytext;
+                                          if (yyextra->insideCpp || yyextra->insideObjC) 
                                           {
-                                            current->id = ClangParser::instance()->lookup(yyLineNr,yytext);
+                                            yyextra->current->id = ClangParser::instance()->lookup(yyextra->yyLineNr,yytext);
                                           }
                                        }
 <ObjCMethod>":"{B}*                    { // start of parameter list
-                                         current->name += ':';
-                                         Argument *a = new Argument;
-                                         current->argList->append(a);
+                                         yyextra->current->name += ':';
+                                         Argument a;
+                                         yyextra->current->argList.push_back(a);
                                          BEGIN( ObjCParams );
                                        }
 <ObjCReturnType>[^)]*                  { // TODO: check if nested braches are possible.
-                                         current->type = yytext;
+                                         yyextra->current->type = yytext;
                                        }
 <ObjCReturnType>")"                    {
                                          BEGIN( ObjCMethod );
@@ -1148,132 +778,140 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                          keyw=keyw.left(keyw.length()-1).stripWhiteSpace(); // strip :
                                          if (keyw.isEmpty())
                                          {
-                                           current->name += " :";
+                                           yyextra->current->name += " :";
                                          }
                                          else
                                          {
-                                           current->name += keyw+":";
+                                           yyextra->current->name += keyw+":";
                                          }
-                                         if (current->argList->getLast()->type.isEmpty())
+                                         if (yyextra->current->argList.back().type.isEmpty())
                                          {
-                                           current->argList->getLast()->type="id";
+                                           yyextra->current->argList.back().type="id";
                                          }
-                                         Argument *a = new Argument;
-                                         a->attrib=(QCString)"["+keyw+"]";
-                                         current->argList->append(a);
+                                         Argument a;
+                                         a.attrib=(QCString)"["+keyw+"]";
+                                         yyextra->current->argList.push_back(a);
                                        }
 <ObjCParams>{ID}{BN}*                  { // name of parameter
-                                         lineCount();
-                                         current->argList->getLast()->name=QCString(yytext).stripWhiteSpace();
+                                         lineCount(yyscanner);
+                                         yyextra->current->argList.back().name=QCString(yytext).stripWhiteSpace();
                                        }
 <ObjCParams>","{BN}*"..."              { // name of parameter
-                                         lineCount();
+                                         lineCount(yyscanner);
                                          // do we want the comma as part of the name?
-                                         //current->name += ",";
-                                         Argument *a = new Argument;
-                                         a->attrib="[,]";
-                                         a->type="...";
-                                         current->argList->append(a);
+                                         //yyextra->current->name += ",";
+                                         Argument a;
+                                         a.attrib="[,]";
+                                         a.type="...";
+                                         yyextra->current->argList.push_back(a);
                                        }
    /*
 <ObjCParams>":"                                { 
-                                         current->name += ':';
+                                         yyextra->current->name += ':';
                                        }
    */
 <ObjCParams>"("                                {
-                                         roundCount=0;
-                                         current->argList->getLast()->type.resize(0);
+                                         yyextra->roundCount=0;
+                                         yyextra->current->argList.back().type.resize(0);
                                          BEGIN( ObjCParamType );
                                        }
 <ObjCParamType>"("                      {
-                                          roundCount++;
-                                         current->argList->getLast()->type+=yytext;
+                                          yyextra->roundCount++;
+                                         yyextra->current->argList.back().type+=yytext;
                                         }
 <ObjCParamType>")"/{B}*                        {
-                                          if (roundCount<=0)
+                                          if (yyextra->roundCount<=0)
                                           {
                                             BEGIN( ObjCParams );
                                           }
                                           else
                                           {
-                                            current->argList->getLast()->type+=yytext;
-                                            roundCount--;
+                                            yyextra->current->argList.back().type+=yytext;
+                                            yyextra->roundCount--;
                                           }
                                        }
 <ObjCParamType>[^()]*                  {
-                                         current->argList->getLast()->type+=QCString(yytext).stripWhiteSpace();
+                                         yyextra->current->argList.back().type+=QCString(yytext).stripWhiteSpace();
                                        }
 <ObjCMethod,ObjCParams>";"             { // end of method declaration
-                                         if (current->argList->getLast() && current->argList->getLast()->type.isEmpty())
+                                         if (!yyextra->current->argList.empty() && yyextra->current->argList.back().type.isEmpty())
                                          {
-                                           current->argList->getLast()->type="id";
+                                           yyextra->current->argList.back().type="id";
                                          }
-                                         current->args = argListToString(current->argList);
-                                         //printf("argList=%s\n",current->args.data());
+                                          if (yyextra->current->argList.empty()) // method without parameters
+                                          {
+                                            yyextra->current->argList.noParameters = TRUE;
+                                          }
+                                         yyextra->current->args = argListToString(yyextra->current->argList);
+                                         //printf("argList=%s\n",yyextra->current->args.data());
                                          unput(';');
                                          BEGIN( Function );
                                         }
 <ObjCMethod,ObjCParams>(";"{BN}+)?"{"  { // start of a method body
-                                         lineCount();
+                                         lineCount(yyscanner);
                                           //printf("Type=%s Name=%s args=%s\n",
-                                         //    current->type.data(),current->name.data(),argListToString(current->argList).data()
+                                         //    yyextra->current->type.data(),yyextra->current->name.data(),argListToString(yyextra->current->argList).data()
                                          //    );
-                                         if (current->argList->getLast() && current->argList->getLast()->type.isEmpty())
+                                         if (!yyextra->current->argList.empty() && yyextra->current->argList.back().type.isEmpty())
                                          {
-                                           current->argList->getLast()->type="id";
+                                           yyextra->current->argList.back().type="id";
                                          }
-                                         current->args = argListToString(current->argList);
+                                          if (yyextra->current->argList.empty()) // method without parameters
+                                          {
+                                            yyextra->current->argList.noParameters = TRUE;
+                                          }
+                                         yyextra->current->args = argListToString(yyextra->current->argList);
                                           unput('{');
                                          BEGIN( Function );
                                        }
 <FindMembers>{B}*"sequence"{BN}*"<"{BN}* {
-                                         if (insideSlice)
-                                         {
-                                            lineCount();
-                                           current->bodyLine = yyLineNr;
-                                            current->fileName = yyFileName ;
-                                           current->startLine = yyLineNr ;
-                                           current->startColumn = yyColNr;
-                                            current->args.resize(0);
-                                           current->section = Entry::TYPEDEF_SEC ;
-                                            isTypedef = TRUE;
+                                         if (yyextra->insideSlice)
+                                         {
+                                            lineCount(yyscanner);
+                                           yyextra->current->bodyLine = yyextra->yyLineNr;
+                                            yyextra->current->fileName = yyextra->yyFileName ;
+                                           yyextra->current->startLine = yyextra->yyLineNr ;
+                                           yyextra->current->startColumn = yyextra->yyColNr;
+                                            yyextra->current->args.resize(0);
+                                           yyextra->current->section = Entry::TYPEDEF_SEC ;
+                                            yyextra->isTypedef = TRUE;
                                            BEGIN( SliceSequence );
                                          }
                                          else
                                            REJECT;
                                        }
 <FindMembers>{B}*"dictionary"{BN}*"<"{BN}* {
-                                         if (insideSlice)
-                                         {
-                                            lineCount();
-                                           current->bodyLine = yyLineNr;
-                                            current->fileName = yyFileName ;
-                                           current->startLine = yyLineNr ;
-                                           current->startColumn = yyColNr;
-                                            current->args.resize(0);
-                                           current->section = Entry::TYPEDEF_SEC ;
-                                            isTypedef = TRUE;
+                                         if (yyextra->insideSlice)
+                                         {
+                                            lineCount(yyscanner);
+                                           yyextra->current->bodyLine = yyextra->yyLineNr;
+                                            yyextra->current->fileName = yyextra->yyFileName ;
+                                           yyextra->current->startLine = yyextra->yyLineNr ;
+                                           yyextra->current->startColumn = yyextra->yyColNr;
+                                            yyextra->current->args.resize(0);
+                                           yyextra->current->section = Entry::TYPEDEF_SEC ;
+                                            yyextra->isTypedef = TRUE;
                                            BEGIN( SliceDictionary );
                                          }
                                          else
                                            REJECT;
                                        }
 <FindMembers>{BN}{1,80}                        {
-                                         lineCount();
+                                         lineCount(yyscanner);
                                        }
 <FindMembers>"@"({ID}".")*{ID}{BN}*"(" {
-                                         if (insideJava) // Java annotation
+                                         if (yyextra->insideJava) // Java annotation
                                          {
-                                           lineCount();
-                                           lastSkipRoundContext = YY_START;
-                                           roundCount=0;
+                                           lineCount(yyscanner);
+                                           yyextra->lastSkipRoundContext = YY_START;
+                                           yyextra->roundCount=0;
                                            BEGIN( SkipRound );
                                          }
                                          else if (qstrncmp(yytext,"@property",9)==0) // ObjC 2.0 property
                                          {
-                                           current->mtype = mtype = Property;
-                                           current->spec|=Entry::Readable | Entry::Writable | Entry::Assign;
-                                           current->protection = Public ;
+                                           yyextra->current->mtype = yyextra->mtype = Property;
+                                           yyextra->current->spec|=Entry::Readable | Entry::Writable | Entry::Assign;
+                                           yyextra->current->protection = Public ;
                                            unput('(');
                                            BEGIN( ObjCPropAttr );
                                          }
@@ -1283,54 +921,54 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                          }
                                         }
 <ObjCPropAttr>"getter="{ID}            { 
-                                          current->read = yytext+7;
+                                          yyextra->current->read = yytext+7;
                                        }
 <ObjCPropAttr>"setter="{ID}            { 
-                                          current->write = yytext+7;
+                                          yyextra->current->write = yytext+7;
                                        }
 <ObjCPropAttr>"readonly"               {
-                                         current->spec&=~Entry::Writable;
+                                         yyextra->current->spec&=~Entry::Writable;
                                        }
 <ObjCPropAttr>"readwrite"              { // default
                                        }
 <ObjCPropAttr>"assign"                 { // default
                                        }
 <ObjCPropAttr>"unsafe_unretained"       {
-                                         current->spec&=~Entry::Assign;
-                                         current->spec|=Entry::Unretained;
+                                         yyextra->current->spec&=~Entry::Assign;
+                                         yyextra->current->spec|=Entry::Unretained;
                                         }
 <ObjCPropAttr>"retain"                 {
-                                         current->spec&=~Entry::Assign;
-                                         current->spec|=Entry::Retain;
+                                         yyextra->current->spec&=~Entry::Assign;
+                                         yyextra->current->spec|=Entry::Retain;
                                        }
 <ObjCPropAttr>"copy"                   {
-                                         current->spec&=~Entry::Assign;
-                                         current->spec|=Entry::Copy;
+                                         yyextra->current->spec&=~Entry::Assign;
+                                         yyextra->current->spec|=Entry::Copy;
                                        }
 <ObjCPropAttr>"weak"                    {
-                                         current->spec&=~Entry::Assign;
-                                         current->spec|=Entry::Weak;
+                                         yyextra->current->spec&=~Entry::Assign;
+                                         yyextra->current->spec|=Entry::Weak;
                                         }
 <ObjCPropAttr>"strong"                  {
-                                         current->spec&=~Entry::Assign;
-                                         current->spec|=Entry::Strong;
+                                         yyextra->current->spec&=~Entry::Assign;
+                                         yyextra->current->spec|=Entry::Strong;
                                         }
 <ObjCPropAttr>"nonatomic"              {
-                                         current->spec|=Entry::NonAtomic;
+                                         yyextra->current->spec|=Entry::NonAtomic;
                                        }
 <ObjCPropAttr>")"                      {
                                          BEGIN(FindMembers);
                                        }
 <FindMembers>"@"{ID}                   {
-                                         if (insideJava) // Java annotation
+                                         if (yyextra->insideJava) // Java annotation
                                          {
                                            // skip annotation
                                          }
                                          else if (qstrcmp(yytext,"@property")==0) // ObjC 2.0 property
                                          {
-                                           current->mtype = mtype = Property;
-                                           current->spec|=Entry::Writable | Entry::Readable;
-                                           current->protection = Public ;
+                                           yyextra->current->mtype = yyextra->mtype = Property;
+                                           yyextra->current->spec|=Entry::Writable | Entry::Readable;
+                                           yyextra->current->protection = Public ;
                                          }
                                          else if (qstrcmp(yytext,"@synthesize")==0)
                                          {
@@ -1349,58 +987,58 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                          BEGIN(FindMembers);
                                        }
 <PackageName>{ID}(("."|"\\"){ID})*     {
-                                         isTypedef=FALSE;
-                                         //printf("Found namespace %s lang=%d\n",yytext,current->lang);
-                                         current->name = yytext;
-                                         current->name = substitute(current->name,".","::");
-                                         current->name = substitute(current->name,"\\","::");
-                                         current->section = Entry::NAMESPACE_SEC;
-                                         current->type = "namespace" ;
-                                         current->fileName  = yyFileName;
-                                         current->startLine = yyLineNr;
-                                         current->startColumn = yyColNr;
-                                         current->bodyLine  = yyLineNr;
-                                         lineCount();
+                                         yyextra->isTypedef=FALSE;
+                                         //printf("Found namespace %s lang=%d\n",yytext,yyextra->current->lang);
+                                         yyextra->current->name = yytext;
+                                         yyextra->current->name = substitute(yyextra->current->name,".","::");
+                                         yyextra->current->name = substitute(yyextra->current->name,"\\","::");
+                                         yyextra->current->section = Entry::NAMESPACE_SEC;
+                                         yyextra->current->type = "namespace" ;
+                                         yyextra->current->fileName  = yyextra->yyFileName;
+                                         yyextra->current->startLine = yyextra->yyLineNr;
+                                         yyextra->current->startColumn = yyextra->yyColNr;
+                                         yyextra->current->bodyLine  = yyextra->yyLineNr;
+                                         lineCount(yyscanner);
                                        }
 <PackageName>";"                       {
-                                         current_root->addSubEntry(current);
-                                          current_root = current ;
-                                         current = new Entry ;
-                                         initEntry();
+                                          std::shared_ptr<Entry> tmp = yyextra->current;
+                                         yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
+                                          yyextra->current_root = tmp;
+                                         initEntry(yyscanner);
                                          BEGIN(FindMembers);
                                        }
 <PackageName>"{"                       {
-                                         curlyCount=0;
+                                         yyextra->curlyCount=0;
                                          BEGIN( ReadNSBody );
                                        }
 <FindMembers>{B}*"initonly"{BN}+       {
-                                         current->type += " initonly ";
-                                         if (insideCli) current->spec |= Entry::Initonly;
-                                         lineCount();
+                                         yyextra->current->type += " initonly ";
+                                         if (yyextra->insideCli) yyextra->current->spec |= Entry::Initonly;
+                                         lineCount(yyscanner);
                                        }
-<FindMembers>{B}*"static"{BN}+         { current->type += " static ";
-                                         current->stat = TRUE;
-                                         lineCount();
+<FindMembers>{B}*"static"{BN}+         { yyextra->current->type += " static ";
+                                         yyextra->current->stat = TRUE;
+                                         lineCount(yyscanner);
                                        }
 <FindMembers>{B}*"extern"{BN}+         {
-                                         current->stat = FALSE;
-                                         current->explicitExternal = TRUE;
-                                         lineCount();
+                                         yyextra->current->stat = FALSE;
+                                         yyextra->current->explicitExternal = TRUE;
+                                         lineCount(yyscanner);
                                        }
-<FindMembers>{B}*"const"{BN}+          { current->type += " const ";
-                                         if (insideCS) current->stat = TRUE;
-                                         lineCount();
+<FindMembers>{B}*"const"{BN}+          { yyextra->current->type += " const ";
+                                         if (yyextra->insideCS) yyextra->current->stat = TRUE;
+                                         lineCount(yyscanner);
                                        }
-<FindMembers>{B}*"virtual"{BN}+        { current->type += " virtual ";
-                                         current->virt = Virtual;
-                                         lineCount();
+<FindMembers>{B}*"virtual"{BN}+        { yyextra->current->type += " virtual ";
+                                         yyextra->current->virt = Virtual;
+                                         lineCount(yyscanner);
                                        }
 <FindMembers>{B}*"constexpr"{BN}+      { 
-                                          if (insideCpp)
+                                          if (yyextra->insideCpp)
                                           {
-                                            current->type += " constexpr ";
-                                            current->spec |= Entry::ConstExpr;
-                                            lineCount();
+                                            yyextra->current->type += " constexpr ";
+                                            yyextra->current->spec |= Entry::ConstExpr;
+                                            lineCount(yyscanner);
                                           }
                                           else
                                           {
@@ -1408,10 +1046,10 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                           }
                                        }
 <FindMembers>{B}*"published"{BN}+      { // UNO IDL published keyword
-                                         if (insideIDL)
+                                         if (yyextra->insideIDL)
                                          {
-                                           lineCount();
-                                           current->spec |= Entry::Published;
+                                           lineCount(yyscanner);
+                                           yyextra->current->spec |= Entry::Published;
                                          }
                                          else
                                          {
@@ -1419,60 +1057,60 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                          }
                                        }
 <FindMembers>{B}*"abstract"{BN}+       { 
-                                          if (!insidePHP) 
+                                          if (!yyextra->insidePHP) 
                                          {
-                                           current->type += " abstract ";
-                                           if (!insideJava)
+                                           yyextra->current->type += " abstract ";
+                                           if (!yyextra->insideJava)
                                            {
-                                              current->virt = Pure;
+                                              yyextra->current->virt = Pure;
                                            }
                                            else
                                            {
-                                              current->spec|=Entry::Abstract;
+                                              yyextra->current->spec|=Entry::Abstract;
                                            }
                                          }
                                          else
                                          {
-                                           current->spec|=Entry::Abstract;
+                                           yyextra->current->spec|=Entry::Abstract;
                                          }
-                                         lineCount();
+                                         lineCount(yyscanner);
                                        }
-<FindMembers>{B}*"inline"{BN}+         { current->spec|=Entry::Inline;
-                                          lineCount(); 
+<FindMembers>{B}*"inline"{BN}+         { yyextra->current->spec|=Entry::Inline;
+                                          lineCount(yyscanner); 
                                         }
-<FindMembers>{B}*"mutable"{BN}+                { current->spec|=Entry::Mutable;
-                                          lineCount(); 
+<FindMembers>{B}*"mutable"{BN}+                { yyextra->current->spec|=Entry::Mutable;
+                                          lineCount(yyscanner); 
                                         }
-<FindMembers>{B}*"explicit"{BN}+       { current->spec|=Entry::Explicit;
-                                          lineCount(); 
+<FindMembers>{B}*"explicit"{BN}+       { yyextra->current->spec|=Entry::Explicit;
+                                          lineCount(yyscanner); 
                                         }
-<FindMembers>{B}*"local"{BN}+          { current->spec|=Entry::Local;
-                                          lineCount(); 
+<FindMembers>{B}*"local"{BN}+          { yyextra->current->spec|=Entry::Local;
+                                          lineCount(yyscanner); 
                                         }
 <FindMembers>{B}*"@required"{BN}+      { // Objective C 2.0 protocol required section
-                                          current->spec=(current->spec & ~Entry::Optional) | Entry::Required;
-                                          lineCount(); 
+                                          yyextra->current->spec=(yyextra->current->spec & ~Entry::Optional) | Entry::Required;
+                                          lineCount(yyscanner); 
                                         }
 <FindMembers>{B}*"@optional"{BN}+      {  // Objective C 2.0 protocol optional section
-                                          current->spec=(current->spec & ~Entry::Required) | Entry::Optional;
-                                          lineCount(); 
+                                          yyextra->current->spec=(yyextra->current->spec & ~Entry::Required) | Entry::Optional;
+                                          lineCount(yyscanner); 
                                         }
   /*
 <FindMembers>{B}*"import"{BN}+         { // IDL import keyword
                                          BEGIN( NextSemi );
                                        }
   */
-<FindMembers>{B}*"typename"{BN}+       { lineCount(); }
+<FindMembers>{B}*"typename"{BN}+       { lineCount(yyscanner); }
 <FindMembers>{B}*"namespace"{BN}*/[^a-z_A-Z0-9]        { 
-                                         isTypedef=FALSE;
-                                         current->section = Entry::NAMESPACE_SEC;
-                                         current->type = "namespace" ;
-                                         current->fileName  = yyFileName;
-                                         current->startLine = yyLineNr;
-                                         current->startColumn = yyColNr;
-                                         current->bodyLine  = yyLineNr;
-                                         lineCount();
-                                         if (insidePHP)
+                                         yyextra->isTypedef=FALSE;
+                                         yyextra->current->section = Entry::NAMESPACE_SEC;
+                                         yyextra->current->type = "namespace" ;
+                                         yyextra->current->fileName  = yyextra->yyFileName;
+                                         yyextra->current->startLine = yyextra->yyLineNr;
+                                         yyextra->current->startColumn = yyextra->yyColNr;
+                                         yyextra->current->bodyLine  = yyextra->yyLineNr;
+                                         lineCount(yyscanner);
+                                         if (yyextra->insidePHP)
                                          {
                                            BEGIN( PackageName );
                                          }
@@ -1482,449 +1120,449 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                          }
                                        }
 <FindMembers>{B}*"module"{BN}+         { 
-                                         lineCount();
-                                          if (insideIDL || insideSlice)
-                                         {
-                                           isTypedef=FALSE;
-                                           current->section = Entry::NAMESPACE_SEC;
-                                           current->type = "module" ;
-                                           current->fileName  = yyFileName;
-                                           current->startLine = yyLineNr;
-                                           current->startColumn = yyColNr;
-                                           current->bodyLine  = yyLineNr;
+                                         lineCount(yyscanner);
+                                          if (yyextra->insideIDL || yyextra->insideSlice)
+                                         {
+                                           yyextra->isTypedef=FALSE;
+                                           yyextra->current->section = Entry::NAMESPACE_SEC;
+                                           yyextra->current->type = "module" ;
+                                           yyextra->current->fileName  = yyextra->yyFileName;
+                                           yyextra->current->startLine = yyextra->yyLineNr;
+                                           yyextra->current->startColumn = yyextra->yyColNr;
+                                           yyextra->current->bodyLine  = yyextra->yyLineNr;
                                            BEGIN( CompoundName ); 
                                          }
-                                         else if (insideD)
+                                         else if (yyextra->insideD)
                                          {
-                                           lineCount();
+                                           lineCount(yyscanner);
                                            BEGIN(PackageName);
                                          }
                                          else
                                          {
-                                           addType( current ) ;
-                                           current->name = QCString(yytext).stripWhiteSpace();
+                                           addType(yyscanner);
+                                           yyextra->current->name = QCString(yytext).stripWhiteSpace();
                                          }
                                        }
 <FindMembers>{B}*"library"{BN}+                { 
-                                         lineCount();
-                                          if (insideIDL)
-                                         {
-                                           isTypedef=FALSE;
-                                           current->section = Entry::NAMESPACE_SEC;
-                                           current->type = "library" ;
-                                           current->fileName  = yyFileName;
-                                           current->startLine = yyLineNr;
-                                           current->startColumn = yyColNr;
-                                           current->bodyLine  = yyLineNr;
+                                         lineCount(yyscanner);
+                                          if (yyextra->insideIDL)
+                                         {
+                                           yyextra->isTypedef=FALSE;
+                                           yyextra->current->section = Entry::NAMESPACE_SEC;
+                                           yyextra->current->type = "library" ;
+                                           yyextra->current->fileName  = yyextra->yyFileName;
+                                           yyextra->current->startLine = yyextra->yyLineNr;
+                                           yyextra->current->startColumn = yyextra->yyColNr;
+                                           yyextra->current->bodyLine  = yyextra->yyLineNr;
                                            BEGIN( CompoundName ); 
                                          }
                                          else
                                          {
-                                           addType( current ) ;
-                                           current->name = QCString(yytext).stripWhiteSpace();
+                                           addType(yyscanner);
+                                           yyextra->current->name = QCString(yytext).stripWhiteSpace();
                                          }
                                        }
 <FindMembers>{B}*"constants"{BN}+      {  // UNO IDL constant group
-                                         lineCount();
-                                         if (insideIDL)
-                                         {
-                                           isTypedef=FALSE;
-                                           current->section = Entry::NAMESPACE_SEC;
-                                           current->type = "constants";
-                                           current->fileName  = yyFileName;
-                                           current->startLine = yyLineNr;
-                                           current->startColumn = yyColNr;
-                                           current->bodyLine  = yyLineNr;
+                                         lineCount(yyscanner);
+                                         if (yyextra->insideIDL)
+                                         {
+                                           yyextra->isTypedef=FALSE;
+                                           yyextra->current->section = Entry::NAMESPACE_SEC;
+                                           yyextra->current->type = "constants";
+                                           yyextra->current->fileName  = yyextra->yyFileName;
+                                           yyextra->current->startLine = yyextra->yyLineNr;
+                                           yyextra->current->startColumn = yyextra->yyColNr;
+                                           yyextra->current->bodyLine  = yyextra->yyLineNr;
                                            BEGIN( CompoundName );
                                          }
                                          else
                                          {
-                                           addType( current ) ;
-                                           current->name = QCString(yytext).stripWhiteSpace();
+                                           addType(yyscanner);
+                                           yyextra->current->name = QCString(yytext).stripWhiteSpace();
                                          }
                                        }
 <FindMembers>{BN}*("service"){BN}+     { // UNO IDL service
-                                         lineCount();
-                                         if (insideIDL)
+                                         lineCount(yyscanner);
+                                         if (yyextra->insideIDL)
                                          {
-                                           isTypedef=FALSE;
-                                           current->section = Entry::CLASS_SEC;
-                                           current->spec = Entry::Service |
+                                           yyextra->isTypedef=FALSE;
+                                           yyextra->current->section = Entry::CLASS_SEC;
+                                           yyextra->current->spec = Entry::Service |
                                              // preserve UNO IDL [optional] or published
-                                             (current->spec & (Entry::Optional|Entry::Published));
-                                           addType( current ) ;
-                                           current->type += " service " ;
-                                           current->fileName  = yyFileName;
-                                           current->startLine = yyLineNr;
-                                           current->bodyLine  = yyLineNr;
+                                             (yyextra->current->spec & (Entry::Optional|Entry::Published));
+                                           addType(yyscanner);
+                                           yyextra->current->type += " service " ;
+                                           yyextra->current->fileName  = yyextra->yyFileName;
+                                           yyextra->current->startLine = yyextra->yyLineNr;
+                                           yyextra->current->bodyLine  = yyextra->yyLineNr;
                                            BEGIN( CompoundName );
                                          }
                                          else // TODO is addType right? just copy/pasted
                                          {
-                                           addType( current ) ;
-                                           current->name = QCString(yytext).stripWhiteSpace();
+                                           addType(yyscanner);
+                                           yyextra->current->name = QCString(yytext).stripWhiteSpace();
                                          }
                                        }
 <FindMembers>{BN}*("singleton"){BN}+   { // UNO IDL singleton
-                                         lineCount();
-                                         if (insideIDL)
-                                         {
-                                           isTypedef=FALSE;
-                                           current->section = Entry::CLASS_SEC;
-                                           current->spec = Entry::Singleton |
-                                             (current->spec & Entry::Published); // preserve
-                                           addType( current ) ;
-                                           current->type += " singleton " ;
-                                           current->fileName  = yyFileName;
-                                           current->startLine = yyLineNr;
-                                           current->bodyLine  = yyLineNr;
+                                         lineCount(yyscanner);
+                                         if (yyextra->insideIDL)
+                                         {
+                                           yyextra->isTypedef=FALSE;
+                                           yyextra->current->section = Entry::CLASS_SEC;
+                                           yyextra->current->spec = Entry::Singleton |
+                                             (yyextra->current->spec & Entry::Published); // preserve
+                                           addType(yyscanner);
+                                           yyextra->current->type += " singleton " ;
+                                           yyextra->current->fileName  = yyextra->yyFileName;
+                                           yyextra->current->startLine = yyextra->yyLineNr;
+                                           yyextra->current->bodyLine  = yyextra->yyLineNr;
                                            BEGIN( CompoundName );
                                          }
                                          else // TODO is addType right? just copy/pasted
                                          {
-                                           addType( current ) ;
-                                           current->name = QCString(yytext).stripWhiteSpace();
+                                           addType(yyscanner);
+                                           yyextra->current->name = QCString(yytext).stripWhiteSpace();
                                          }
                                        }
 <FindMembers>{BN}*((("disp")?"interface")|"valuetype"){BN}+    { // M$/Corba/UNO IDL/Java/Slice interface
-                                         lineCount();
-                                          if (insideIDL || insideJava || insideCS || insideD || insidePHP || insideSlice)
+                                         lineCount(yyscanner);
+                                          if (yyextra->insideIDL || yyextra->insideJava || yyextra->insideCS || yyextra->insideD || yyextra->insidePHP || yyextra->insideSlice)
                                          {
-                                           isTypedef=FALSE;
-                                           current->section = Entry::CLASS_SEC;
-                                           current->spec = Entry::Interface |
+                                           yyextra->isTypedef=FALSE;
+                                           yyextra->current->section = Entry::CLASS_SEC;
+                                           yyextra->current->spec = Entry::Interface |
                                                 // preserve UNO IDL [optional], published, Slice local
-                                                (current->spec & (Entry::Optional|Entry::Published|Entry::Local));
-                                           addType( current ) ;
-                                           current->type += " interface" ;
-                                           current->fileName  = yyFileName;
-                                           current->startLine = yyLineNr;
-                                           current->startColumn = yyColNr;
-                                           current->bodyLine  = yyLineNr;
+                                                (yyextra->current->spec & (Entry::Optional|Entry::Published|Entry::Local));
+                                           addType(yyscanner);
+                                           yyextra->current->type += " interface" ;
+                                           yyextra->current->fileName  = yyextra->yyFileName;
+                                           yyextra->current->startLine = yyextra->yyLineNr;
+                                           yyextra->current->startColumn = yyextra->yyColNr;
+                                           yyextra->current->bodyLine  = yyextra->yyLineNr;
                                            BEGIN( CompoundName );
                                          }
                                          else
                                          {
-                                           addType( current ) ;
-                                           current->name = QCString(yytext).stripWhiteSpace();
+                                           addType(yyscanner);
+                                           yyextra->current->name = QCString(yytext).stripWhiteSpace();
                                          }
                                        }
 <FindMembers>{B}*"@implementation"{BN}+        { // Objective-C class implementation
-                                         lineCount();
-                                         isTypedef=FALSE;
-                                         current->section = Entry::OBJCIMPL_SEC;
-                                         language = current->lang = SrcLangExt_ObjC;
-                                         insideObjC = TRUE;
-                                         current->protection = protection = Public ;
-                                         addType( current ) ;
-                                         current->type += " implementation" ;
-                                         current->fileName  = yyFileName;
-                                         current->startLine = yyLineNr;
-                                         current->bodyLine  = yyLineNr;
+                                         lineCount(yyscanner);
+                                         yyextra->isTypedef=FALSE;
+                                         yyextra->current->section = Entry::OBJCIMPL_SEC;
+                                         yyextra->language = yyextra->current->lang = SrcLangExt_ObjC;
+                                         yyextra->insideObjC = TRUE;
+                                         yyextra->current->protection = yyextra->protection = Public ;
+                                         addType(yyscanner);
+                                         yyextra->current->type += " implementation" ;
+                                         yyextra->current->fileName  = yyextra->yyFileName;
+                                         yyextra->current->startLine = yyextra->yyLineNr;
+                                         yyextra->current->bodyLine  = yyextra->yyLineNr;
                                          BEGIN( CompoundName );
                                        }
 <FindMembers>{B}*"@interface"{BN}+     { // Objective-C class interface, or Java attribute
-                                         lineCount();
-                                         isTypedef=FALSE;
-                                         current->section = Entry::CLASS_SEC;
-                                          current->spec = Entry::Interface;
-                                         if (!insideJava)
-                                         {
-                                           language = current->lang = SrcLangExt_ObjC;
-                                           insideObjC = TRUE;
-                                         }
-                                         current->protection = protection = Public ;
-                                         addType( current ) ;
-                                         current->type += " interface" ;
-                                         current->fileName  = yyFileName;
-                                         current->startLine = yyLineNr;
-                                         current->startColumn = yyColNr;
-                                         current->bodyLine  = yyLineNr;
+                                         lineCount(yyscanner);
+                                         yyextra->isTypedef=FALSE;
+                                         yyextra->current->section = Entry::CLASS_SEC;
+                                          yyextra->current->spec = Entry::Interface;
+                                         if (!yyextra->insideJava)
+                                         {
+                                           yyextra->language = yyextra->current->lang = SrcLangExt_ObjC;
+                                           yyextra->insideObjC = TRUE;
+                                         }
+                                         yyextra->current->protection = yyextra->protection = Public ;
+                                         addType(yyscanner);
+                                         yyextra->current->type += " interface" ;
+                                         yyextra->current->fileName  = yyextra->yyFileName;
+                                         yyextra->current->startLine = yyextra->yyLineNr;
+                                         yyextra->current->startColumn = yyextra->yyColNr;
+                                         yyextra->current->bodyLine  = yyextra->yyLineNr;
                                          BEGIN( CompoundName );
                                        }
 <FindMembers>{B}*"@protocol"{BN}+      { // Objective-C protocol definition
-                                         lineCount();
-                                         isTypedef=FALSE;
-                                         current->section = Entry::CLASS_SEC;
-                                          current->spec = Entry::Protocol;
-                                         language = current->lang = SrcLangExt_ObjC;
-                                         insideObjC = TRUE;
-                                         current->protection = protection = Public ;
-                                         addType( current ) ;
-                                         current->type += " protocol" ;
-                                         current->fileName  = yyFileName;
-                                         current->startLine = yyLineNr;
-                                         current->startColumn = yyColNr;
-                                         current->bodyLine  = yyLineNr;
+                                         lineCount(yyscanner);
+                                         yyextra->isTypedef=FALSE;
+                                         yyextra->current->section = Entry::CLASS_SEC;
+                                          yyextra->current->spec = Entry::Protocol;
+                                         yyextra->language = yyextra->current->lang = SrcLangExt_ObjC;
+                                         yyextra->insideObjC = TRUE;
+                                         yyextra->current->protection = yyextra->protection = Public ;
+                                         addType(yyscanner);
+                                         yyextra->current->type += " protocol" ;
+                                         yyextra->current->fileName  = yyextra->yyFileName;
+                                         yyextra->current->startLine = yyextra->yyLineNr;
+                                         yyextra->current->startColumn = yyextra->yyColNr;
+                                         yyextra->current->bodyLine  = yyextra->yyLineNr;
                                          BEGIN( CompoundName );
                                        }
 <FindMembers>{B}*"exception"{BN}+      { // Corba IDL/Slice exception
-                                         isTypedef=FALSE;
-                                         current->section = Entry::CLASS_SEC;
+                                         yyextra->isTypedef=FALSE;
+                                         yyextra->current->section = Entry::CLASS_SEC;
                                           // preserve UNO IDL, Slice local
-                                         current->spec    = Entry::Exception |
-                                           (current->spec & Entry::Published) |
-                                           (current->spec & Entry::Local);
-                                         addType( current ) ;
-                                         current->type += " exception" ;
-                                         current->fileName  = yyFileName;
-                                         current->startLine = yyLineNr;
-                                         current->startColumn = yyColNr;
-                                         current->bodyLine  = yyLineNr;
-                                         lineCount();
+                                         yyextra->current->spec    = Entry::Exception |
+                                           (yyextra->current->spec & Entry::Published) |
+                                           (yyextra->current->spec & Entry::Local);
+                                         addType(yyscanner);
+                                         yyextra->current->type += " exception" ;
+                                         yyextra->current->fileName  = yyextra->yyFileName;
+                                         yyextra->current->startLine = yyextra->yyLineNr;
+                                         yyextra->current->startColumn = yyextra->yyColNr;
+                                         yyextra->current->bodyLine  = yyextra->yyLineNr;
+                                         lineCount(yyscanner);
                                          BEGIN( CompoundName );
                                        }
 <FindMembers>"@class" | // for Objective C class declarations
 <FindMembers>{B}*{TYPEDEFPREFIX}"class{" |
 <FindMembers>{B}*{TYPEDEFPREFIX}"class"{BN}+ { 
                                           QCString decl = yytext;
-                                         isTypedef=decl.find("typedef")!=-1;
+                                         yyextra->isTypedef=decl.find("typedef")!=-1;
                                           bool isConst=decl.find("const")!=-1;
                                           bool isVolatile=decl.find("volatile")!=-1;
-                                         current->section = Entry::CLASS_SEC;
-                                         addType( current ) ;
-                                          uint64 spec = current->spec;
-                                         if (insidePHP && current->spec&Entry::Abstract)
+                                         yyextra->current->section = Entry::CLASS_SEC;
+                                         addType(yyscanner);
+                                          uint64 spec = yyextra->current->spec;
+                                         if (yyextra->insidePHP && yyextra->current->spec&Entry::Abstract)
                                          {
                                            // convert Abstract to AbstractClass
-                                           current->spec=(current->spec&~Entry::Abstract)|Entry::AbstractClass;
+                                           yyextra->current->spec=(yyextra->current->spec&~Entry::Abstract)|Entry::AbstractClass;
                                          }
-                                          if (insideSlice && spec&Entry::Local)
+                                          if (yyextra->insideSlice && spec&Entry::Local)
                                           {
-                                            current->spec|=Entry::Local;
+                                            yyextra->current->spec|=Entry::Local;
                                           }
                                           if (isConst)
                                           {
-                                            current->type += " const";
+                                            yyextra->current->type += " const";
                                           }
                                           else if (isVolatile)
                                           {
-                                            current->type += " volatile";
+                                            yyextra->current->type += " volatile";
                                           }
-                                         current->type += " class" ;
-                                         current->fileName  = yyFileName;
-                                         current->startLine = yyLineNr;
-                                         current->startColumn = yyColNr;
-                                         current->bodyLine  = yyLineNr;
+                                         yyextra->current->type += " class" ;
+                                         yyextra->current->fileName  = yyextra->yyFileName;
+                                         yyextra->current->startLine = yyextra->yyLineNr;
+                                         yyextra->current->startColumn = yyextra->yyColNr;
+                                         yyextra->current->bodyLine  = yyextra->yyLineNr;
                                          if (yytext[0]=='@')
                                          {
-                                           language = current->lang = SrcLangExt_ObjC;
-                                           insideObjC = TRUE;
+                                           yyextra->language = yyextra->current->lang = SrcLangExt_ObjC;
+                                           yyextra->insideObjC = TRUE;
                                          }
-                                         lineCount() ;
+                                         lineCount(yyscanner) ;
                                          if (yytext[yyleng-1]=='{') unput('{');
                                          BEGIN( CompoundName ) ;
                                        }
 <FindMembers>{B}*"value class{" |         // C++/CLI extension
 <FindMembers>{B}*"value class"{BN}+     {
-                                         isTypedef=FALSE;
-                                         current->section = Entry::CLASS_SEC;
-                                          current->spec = Entry::Value;
-                                         addType( current ) ;
-                                         current->type += " value class" ;
-                                         current->fileName  = yyFileName;
-                                         current->startLine = yyLineNr;
-                                         current->startColumn = yyColNr;
-                                         current->bodyLine  = yyLineNr;
-                                         lineCount() ;
+                                         yyextra->isTypedef=FALSE;
+                                         yyextra->current->section = Entry::CLASS_SEC;
+                                          yyextra->current->spec = Entry::Value;
+                                         addType(yyscanner);
+                                         yyextra->current->type += " value class" ;
+                                         yyextra->current->fileName  = yyextra->yyFileName;
+                                         yyextra->current->startLine = yyextra->yyLineNr;
+                                         yyextra->current->startColumn = yyextra->yyColNr;
+                                         yyextra->current->bodyLine  = yyextra->yyLineNr;
+                                         lineCount(yyscanner) ;
                                          if (yytext[yyleng-1]=='{') unput('{');
                                          BEGIN( CompoundName ) ;
                                        }
 <FindMembers>{B}*"ref class{" |          // C++/CLI extension
 <FindMembers>{B}*"ref class"{BN}+       {
-                                         isTypedef=FALSE;
-                                         current->section = Entry::CLASS_SEC;
-                                          current->spec = Entry::Ref;
-                                         addType( current ) ;
-                                         current->type += " ref class" ;
-                                         current->fileName  = yyFileName;
-                                         current->startLine = yyLineNr;
-                                         current->startColumn = yyColNr;
-                                         current->bodyLine  = yyLineNr;
-                                         lineCount() ;
+                                         yyextra->isTypedef=FALSE;
+                                         yyextra->current->section = Entry::CLASS_SEC;
+                                          yyextra->current->spec = Entry::Ref;
+                                         addType(yyscanner);
+                                         yyextra->current->type += " ref class" ;
+                                         yyextra->current->fileName  = yyextra->yyFileName;
+                                         yyextra->current->startLine = yyextra->yyLineNr;
+                                         yyextra->current->startColumn = yyextra->yyColNr;
+                                         yyextra->current->bodyLine  = yyextra->yyLineNr;
+                                         lineCount(yyscanner) ;
                                          if (yytext[yyleng-1]=='{') unput('{');
                                          BEGIN( CompoundName ) ;
                                        }
 <FindMembers>{B}*"interface class{" |     // C++/CLI extension
 <FindMembers>{B}*"interface class"{BN}+ {
-                                         isTypedef=FALSE;
-                                         current->section = Entry::CLASS_SEC;
-                                          current->spec = Entry::Interface;
-                                         addType( current ) ;
-                                         current->type += " interface class" ;
-                                         current->fileName  = yyFileName;
-                                         current->startLine = yyLineNr;
-                                         current->startColumn = yyColNr;
-                                         current->bodyLine  = yyLineNr;
-                                         lineCount() ;
+                                         yyextra->isTypedef=FALSE;
+                                         yyextra->current->section = Entry::CLASS_SEC;
+                                          yyextra->current->spec = Entry::Interface;
+                                         addType(yyscanner);
+                                         yyextra->current->type += " interface class" ;
+                                         yyextra->current->fileName  = yyextra->yyFileName;
+                                         yyextra->current->startLine = yyextra->yyLineNr;
+                                         yyextra->current->startColumn = yyextra->yyColNr;
+                                         yyextra->current->bodyLine  = yyextra->yyLineNr;
+                                         lineCount(yyscanner) ;
                                          if (yytext[yyleng-1]=='{') unput('{');
                                          BEGIN( CompoundName ) ;
                                        }
 <FindMembers>{B}*"coclass"{BN}+                {
-                                         if (insideIDL)
-                                         {
-                                           isTypedef=FALSE;
-                                           current->section = Entry::CLASS_SEC;
-                                           addType( current ) ;
-                                           current->type += " coclass" ;
-                                           current->fileName  = yyFileName;
-                                           current->startLine = yyLineNr;
-                                           current->startColumn = yyColNr;
-                                           current->bodyLine  = yyLineNr;
-                                           lineCount() ;
+                                         if (yyextra->insideIDL)
+                                         {
+                                           yyextra->isTypedef=FALSE;
+                                           yyextra->current->section = Entry::CLASS_SEC;
+                                           addType(yyscanner);
+                                           yyextra->current->type += " coclass" ;
+                                           yyextra->current->fileName  = yyextra->yyFileName;
+                                           yyextra->current->startLine = yyextra->yyLineNr;
+                                           yyextra->current->startColumn = yyextra->yyColNr;
+                                           yyextra->current->bodyLine  = yyextra->yyLineNr;
+                                           lineCount(yyscanner) ;
                                            BEGIN( CompoundName ) ;
                                          }
                                          else
                                          {
-                                           addType(current);
-                                           current->name = yytext;
-                                           current->name = current->name.stripWhiteSpace();
-                                           lineCount();
+                                           addType(yyscanner);
+                                           yyextra->current->name = yytext;
+                                           yyextra->current->name = yyextra->current->name.stripWhiteSpace();
+                                           lineCount(yyscanner);
                                          }
                                        }
 <FindMembers>{B}*{TYPEDEFPREFIX}"struct{" | 
 <FindMembers>{B}*{TYPEDEFPREFIX}"struct"/{BN}+ { 
                                           QCString decl = yytext;
-                                         isTypedef=decl.find("typedef")!=-1;
+                                         yyextra->isTypedef=decl.find("typedef")!=-1;
                                           bool isConst=decl.find("const")!=-1;
                                           bool isVolatile=decl.find("volatile")!=-1;
-                                          uint64 spec = current->spec;
-                                         current->section = Entry::CLASS_SEC ;
+                                          uint64 spec = yyextra->current->spec;
+                                         yyextra->current->section = Entry::CLASS_SEC ;
                                           // preserve UNO IDL & Inline attributes, Slice local
-                                         current->spec    = Entry::Struct |
-                                           (current->spec & Entry::Published) |
-                                            (current->spec & Entry::Inline) |
-                                            (current->spec & Entry::Local); 
-                                         // bug 582676: can be a struct nested in an interface so keep insideObjC state
-                                         //current->objc    = insideObjC = FALSE;
-                                         addType( current ) ;
+                                         yyextra->current->spec    = Entry::Struct |
+                                           (yyextra->current->spec & Entry::Published) |
+                                            (yyextra->current->spec & Entry::Inline) |
+                                            (yyextra->current->spec & Entry::Local); 
+                                         // bug 582676: can be a struct nested in an interface so keep yyextra->insideObjC state
+                                         //yyextra->current->objc    = yyextra->insideObjC = FALSE;
+                                         addType(yyscanner);
                                           if (isConst)
                                           {
-                                            current->type += " const";
+                                            yyextra->current->type += " const";
                                           }
                                           else if (isVolatile)
                                           {
-                                            current->type += " volatile";
+                                            yyextra->current->type += " volatile";
                                           }
-                                         current->type += " struct" ;
-                                         current->fileName  = yyFileName;
-                                         current->startLine = yyLineNr;
-                                         current->startColumn = yyColNr;
-                                         current->bodyLine  = yyLineNr;
-                                         lineCount() ;
+                                         yyextra->current->type += " struct" ;
+                                         yyextra->current->fileName  = yyextra->yyFileName;
+                                         yyextra->current->startLine = yyextra->yyLineNr;
+                                         yyextra->current->startColumn = yyextra->yyColNr;
+                                         yyextra->current->bodyLine  = yyextra->yyLineNr;
+                                         lineCount(yyscanner) ;
                                          if (yytext[yyleng-1]=='{') unput('{');
                                          BEGIN( CompoundName ) ;
                                        }
 <FindMembers>{B}*"value struct{" |      // C++/CLI extension
 <FindMembers>{B}*"value struct"{BN}+     {
-                                         isTypedef=FALSE;
-                                         current->section = Entry::CLASS_SEC;
-                                          current->spec    = Entry::Struct | Entry::Value;
-                                         addType( current ) ;
-                                         current->type += " value struct" ;
-                                         current->fileName  = yyFileName;
-                                         current->startLine = yyLineNr;
-                                         current->startColumn = yyColNr;
-                                         current->bodyLine  = yyLineNr;
-                                         lineCount() ;
+                                         yyextra->isTypedef=FALSE;
+                                         yyextra->current->section = Entry::CLASS_SEC;
+                                          yyextra->current->spec    = Entry::Struct | Entry::Value;
+                                         addType(yyscanner);
+                                         yyextra->current->type += " value struct" ;
+                                         yyextra->current->fileName  = yyextra->yyFileName;
+                                         yyextra->current->startLine = yyextra->yyLineNr;
+                                         yyextra->current->startColumn = yyextra->yyColNr;
+                                         yyextra->current->bodyLine  = yyextra->yyLineNr;
+                                         lineCount(yyscanner) ;
                                          if (yytext[yyleng-1]=='{') unput('{');
                                          BEGIN( CompoundName ) ;
                                        }
 <FindMembers>{B}*"ref struct{" |       // C++/CLI extension
 <FindMembers>{B}*"ref struct"{BN}+     {
-                                         isTypedef=FALSE;
-                                         current->section = Entry::CLASS_SEC;
-                                          current->spec    = Entry::Struct | Entry::Ref;
-                                         addType( current ) ;
-                                         current->type += " ref struct" ;
-                                         current->fileName  = yyFileName;
-                                         current->startLine = yyLineNr;
-                                         current->startColumn = yyColNr;
-                                         current->bodyLine  = yyLineNr;
-                                         lineCount() ;
+                                         yyextra->isTypedef=FALSE;
+                                         yyextra->current->section = Entry::CLASS_SEC;
+                                          yyextra->current->spec    = Entry::Struct | Entry::Ref;
+                                         addType(yyscanner);
+                                         yyextra->current->type += " ref struct" ;
+                                         yyextra->current->fileName  = yyextra->yyFileName;
+                                         yyextra->current->startLine = yyextra->yyLineNr;
+                                         yyextra->current->startColumn = yyextra->yyColNr;
+                                         yyextra->current->bodyLine  = yyextra->yyLineNr;
+                                         lineCount(yyscanner) ;
                                          if (yytext[yyleng-1]=='{') unput('{');
                                          BEGIN( CompoundName ) ;
                                        }
 <FindMembers>{B}*"interface struct{" |     // C++/CLI extension
 <FindMembers>{B}*"interface struct"{BN}+ {
-                                         isTypedef=FALSE;
-                                         current->section = Entry::CLASS_SEC;
-                                          current->spec    = Entry::Struct | Entry::Interface;
-                                         addType( current ) ;
-                                         current->type += " interface struct";
-                                         current->fileName  = yyFileName;
-                                         current->startLine = yyLineNr;
-                                         current->startColumn = yyColNr;
-                                         current->bodyLine  = yyLineNr;
-                                         lineCount() ;
+                                         yyextra->isTypedef=FALSE;
+                                         yyextra->current->section = Entry::CLASS_SEC;
+                                          yyextra->current->spec    = Entry::Struct | Entry::Interface;
+                                         addType(yyscanner);
+                                         yyextra->current->type += " interface struct";
+                                         yyextra->current->fileName  = yyextra->yyFileName;
+                                         yyextra->current->startLine = yyextra->yyLineNr;
+                                         yyextra->current->startColumn = yyextra->yyColNr;
+                                         yyextra->current->bodyLine  = yyextra->yyLineNr;
+                                         lineCount(yyscanner) ;
                                          if (yytext[yyleng-1]=='{') unput('{');
                                          BEGIN( CompoundName ) ;
                                        }
 <FindMembers>{B}*{TYPEDEFPREFIX}"union{" |
 <FindMembers>{B}*{TYPEDEFPREFIX}"union"{BN}+ { 
                                           QCString decl=yytext;
-                                         isTypedef=decl.find("typedef")!=-1;
+                                         yyextra->isTypedef=decl.find("typedef")!=-1;
                                           bool isConst=decl.find("const")!=-1;
                                           bool isVolatile=decl.find("volatile")!=-1;
-                                         current->section = Entry::CLASS_SEC;
-                                          current->spec    = Entry::Union;
-                                         // bug 582676: can be a struct nested in an interface so keep insideObjC state
-                                         //current->objc    = insideObjC = FALSE;
-                                         addType( current ) ;
+                                         yyextra->current->section = Entry::CLASS_SEC;
+                                          yyextra->current->spec    = Entry::Union;
+                                         // bug 582676: can be a struct nested in an interface so keep yyextra->insideObjC state
+                                         //yyextra->current->objc    = yyextra->insideObjC = FALSE;
+                                         addType(yyscanner);
                                           if (isConst)
                                           {
-                                            current->type += " const";
+                                            yyextra->current->type += " const";
                                           }
                                           else if (isVolatile)
                                           {
-                                            current->type += " volatile";
+                                            yyextra->current->type += " volatile";
                                           }
-                                         current->type += " union" ;
-                                         current->fileName  = yyFileName;
-                                         current->startLine = yyLineNr;
-                                         current->startColumn = yyColNr;
-                                         current->bodyLine  = yyLineNr;
-                                         lineCount() ;
+                                         yyextra->current->type += " union" ;
+                                         yyextra->current->fileName  = yyextra->yyFileName;
+                                         yyextra->current->startLine = yyextra->yyLineNr;
+                                         yyextra->current->startColumn = yyextra->yyColNr;
+                                         yyextra->current->bodyLine  = yyextra->yyLineNr;
+                                         lineCount(yyscanner) ;
                                          if (yytext[yyleng-1]=='{') unput('{');
                                          BEGIN( CompoundName ) ;
                                        }
 <FindMembers>{B}*{TYPEDEFPREFIX}{IDLATTR}?"enum"({BN}+("class"|"struct"))?"{" |
 <FindMembers>{B}*{TYPEDEFPREFIX}{IDLATTR}?"enum"({BN}+("class"|"struct"))?{BN}+ { // for IDL: typedef [something] enum
                                           QCString text=yytext;
-                                         isTypedef    = text.find("typedef")!=-1;
-                                          bool isStrongEnum = text.find("struct")!=-1 || text.find("class")!=-1 || insideCS;
-                                         if (insideJava)
+                                         yyextra->isTypedef    = text.find("typedef")!=-1;
+                                          bool isStrongEnum = text.find("struct")!=-1 || text.find("class")!=-1 || yyextra->insideCS;
+                                         if (yyextra->insideJava)
                                          {
-                                           current->section = Entry::CLASS_SEC;
-                                           current->spec    = Entry::Enum;
+                                           yyextra->current->section = Entry::CLASS_SEC;
+                                           yyextra->current->spec    = Entry::Enum;
                                          }
                                          else
                                          {
-                                           current->section = Entry::ENUM_SEC ;
+                                           yyextra->current->section = Entry::ENUM_SEC ;
                                          }
-                                         addType( current ) ;
-                                         current->type += " enum";
+                                         addType(yyscanner);
+                                         yyextra->current->type += " enum";
                                           if (isStrongEnum)
                                           {
-                                            current->spec |= Entry::Strong;
+                                            yyextra->current->spec |= Entry::Strong;
                                           }
-                                         current->fileName  = yyFileName;
-                                         current->startLine = yyLineNr;
-                                         current->startColumn = yyColNr;
-                                         current->bodyLine  = yyLineNr;
-                                         lineCount() ;
+                                         yyextra->current->fileName  = yyextra->yyFileName;
+                                         yyextra->current->startLine = yyextra->yyLineNr;
+                                         yyextra->current->startColumn = yyextra->yyColNr;
+                                         yyextra->current->bodyLine  = yyextra->yyLineNr;
+                                         lineCount(yyscanner) ;
                                          if (yytext[yyleng-1]=='{') unput('{');
                                          BEGIN( CompoundName ) ;
                                        }
 <Operator>"("{BN}*")"({BN}*"<"[^>]*">"){BN}*/"("  {  // A::operator()<int>(int arg)
-                                         lineCount();
-                                         current->name += "()";
+                                         lineCount(yyscanner);
+                                         yyextra->current->name += "()";
                                          BEGIN( FindMembers );
                                        }
 <Operator>"("{BN}*")"{BN}*/"("         {
-                                         lineCount();
-                                         current->name += yytext ;
-                                         current->name = current->name.simplifyWhiteSpace();
+                                         lineCount(yyscanner);
+                                         yyextra->current->name += yytext ;
+                                         yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
                                          BEGIN( FindMembers ) ;
                                        }
 <Operator>";"                          { // can occur when importing members
@@ -1932,92 +1570,85 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                          BEGIN( FindMembers ) ;
                                        }
 <Operator>[^(]                         { 
-                                         lineCount();
-                                         current->name += *yytext ;
+                                         lineCount(yyscanner);
+                                         yyextra->current->name += *yytext ;
                                        }
 <Operator>"<>"                         { /* skip guided templ specifiers */ }
 <Operator>"("                          {
-                                         current->name = current->name.simplifyWhiteSpace();
+                                         yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
                                          unput(*yytext);
                                          BEGIN( FindMembers ) ;
                                        }
 <FindMembers>("template"|"generic")({BN}*)"<"/[>]?     {  // generic is a C++/CLI extension
-                                         lineCount();
-                                         if (current->tArgLists==0)
-                                         {
-                                           current->tArgLists = new QList<ArgumentList>;
-                                           current->tArgLists->setAutoDelete(TRUE);
-                                         }
-                                         ArgumentList *al = new ArgumentList;
-                                         //current->spec |= (yytext[0]=='g') ? Entry::Generic : Entry::Template;
-                                         current->tArgLists->append(al);
-                                         currentArgumentList = al;
-                                         templateStr="<";
-                                         fullArgString = templateStr;
-                                         copyArgString = &templateStr;
-                                         currentArgumentContext = FindMembers;
+                                         lineCount(yyscanner);
+                                         ArgumentList al;
+                                         //yyextra->current->spec |= (yytext[0]=='g') ? Entry::Generic : Entry::Template;
+                                         yyextra->current->tArgLists.push_back(al);
+                                         yyextra->currentArgumentList = &yyextra->current->tArgLists.back();
+                                         yyextra->templateStr="<";
+                                         yyextra->fullArgString = yyextra->templateStr;
+                                         yyextra->copyArgString = &yyextra->templateStr;
+                                         yyextra->currentArgumentContext = FindMembers;
                                          BEGIN( ReadTempArgs );
                                        }
 <FindMembers>"namespace"{BN}+/{ID}{BN}*"=" { // namespace alias
-                                          lineCount(); 
+                                          lineCount(yyscanner); 
                                          BEGIN( NSAliasName );
                                        }
 <NSAliasName>{ID}                      {
-                                         aliasName = yytext;
+                                         yyextra->aliasName = yytext;
                                          BEGIN( NSAliasArg );
                                        }
 <NSAliasArg>({ID}"::")*{ID}            {
-                                         //printf("Inserting namespace alias %s::%s->%s\n",current_root->name.data(),aliasName.data(),yytext);
-                                         //if (current_root->name.isEmpty())
+                                         //printf("Inserting namespace alias %s::%s->%s\n",yyextra->current_root->name.data(),yyextra->aliasName.data(),yytext);
+                                         //if (yyextra->current_root->name.isEmpty())
                                          //{
                                           // TODO: namespace aliases are now treated as global entities
                                           // while they should be aware of the scope they are in
-                                            Doxygen::namespaceAliasDict.insert(aliasName,new QCString(yytext));
+                                            Doxygen::namespaceAliasDict.insert(yyextra->aliasName,new QCString(yytext));
                                          //}
                                          //else
                                          //{
-                                          //  Doxygen::namespaceAliasDict.insert(current_root->name+"::"+aliasName,
-                                         //    new QCString(current_root->name+"::"+yytext));
+                                          //  Doxygen::namespaceAliasDict.insert(yyextra->current_root->name+"::"+yyextra->aliasName,
+                                         //    new QCString(yyextra->current_root->name+"::"+yytext));
                                          //}
                                        }
 <NSAliasArg>";"                                {
                                          BEGIN( FindMembers );
                                        }
 <PHPUse>({ID}{BN}*"\\"{BN}*)*{ID}/{BN}+"as"  {
-                                         lineCount();
-                                         aliasName=yytext;
+                                         lineCount(yyscanner);
+                                         yyextra->aliasName=yytext;
                                          BEGIN(PHPUseAs);
                                        }
 <PHPUse>({ID}{BN}*"\\"{BN}*)*{ID}      {
-                                         lineCount();
-                                         current->name=removeRedundantWhiteSpace(substitute(yytext,"\\","::"));
-                                         //printf("PHP: adding use relation: %s\n",current->name.data());
-                                          current->fileName = yyFileName; 
-                                          // add a using declaraton
-                                         current->section=Entry::USINGDECL_SEC;
-                                         current_root->addSubEntry(current);
-                                         current = new Entry(*current);
+                                         lineCount(yyscanner);
+                                         yyextra->current->name=removeRedundantWhiteSpace(substitute(yytext,"\\","::"));
+                                         //printf("PHP: adding use relation: %s\n",yyextra->current->name.data());
+                                          yyextra->current->fileName = yyextra->yyFileName; 
+                                          // add a using declaration
+                                         yyextra->current->section=Entry::USINGDECL_SEC;
+                                         yyextra->current_root->copyToSubEntry(yyextra->current);
                                           // also add it as a using directive
-                                         current->section=Entry::USINGDIR_SEC;
-                                         current_root->addSubEntry(current);
-                                         current = new Entry ;
-                                         initEntry();
-                                         aliasName.resize(0);
+                                         yyextra->current->section=Entry::USINGDIR_SEC;
+                                         yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
+                                         initEntry(yyscanner);
+                                         yyextra->aliasName.resize(0);
                                        }
 <PHPUseAs>{BN}+"as"{BN}+               {
-                                         lineCount();
+                                         lineCount(yyscanner);
                                        }
 <PHPUseAs>{PHPUSEKW}                    {
                                         }
 <PHPUseAs>{ID}                         {
-                                         //printf("PHP: adding use as relation: %s->%s\n",yytext,aliasName.data());
-                                          if (!aliasName.isEmpty())
+                                         //printf("PHP: adding use as relation: %s->%s\n",yytext,yyextra->aliasName.data());
+                                          if (!yyextra->aliasName.isEmpty())
                                           {
                                             Doxygen::namespaceAliasDict.insert(yytext,
                                                 new QCString(removeRedundantWhiteSpace(
-                                                  substitute(aliasName,"\\","::"))));
+                                                  substitute(yyextra->aliasName,"\\","::"))));
                                           }
-                                         aliasName.resize(0);
+                                         yyextra->aliasName.resize(0);
                                        }
 <PHPUse,PHPUseAs>[,;]                  {
                                          if (*yytext==',')
@@ -2030,186 +1661,182 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                          }
                                        }
 <JavaImport>({ID}{BN}*"."{BN}*)+"*"    { // package import => add as a using directive
-                                         lineCount();
+                                         lineCount(yyscanner);
                                          QCString scope=yytext;
-                                         current->name=removeRedundantWhiteSpace(substitute(scope.left(scope.length()-1),".","::"));
-                                          current->fileName = yyFileName; 
-                                         current->section=Entry::USINGDIR_SEC;
-                                         current_root->addSubEntry(current);
-                                         current = new Entry;
-                                         initEntry();
+                                         yyextra->current->name=removeRedundantWhiteSpace(substitute(scope.left(scope.length()-1),".","::"));
+                                          yyextra->current->fileName = yyextra->yyFileName; 
+                                         yyextra->current->section=Entry::USINGDIR_SEC;
+                                         yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
+                                         initEntry(yyscanner);
                                          BEGIN(Using);
                                        }
 <JavaImport>({ID}{BN}*"."{BN}*)+{ID}   { // class import => add as a using declaration
-                                          lineCount();
+                                          lineCount(yyscanner);
                                          QCString scope=yytext;
-                                         current->name=removeRedundantWhiteSpace(substitute(scope,".","::"));
-                                         current->fileName = yyFileName; 
-                                         if (insideD) 
+                                         yyextra->current->name=removeRedundantWhiteSpace(substitute(scope,".","::"));
+                                         yyextra->current->fileName = yyextra->yyFileName; 
+                                         if (yyextra->insideD) 
                                          {
-                                           current->section=Entry::USINGDIR_SEC;
+                                           yyextra->current->section=Entry::USINGDIR_SEC;
                                          }
                                          else
                                          {
-                                           //printf("import name = %s -> %s\n",yytext,current->name.data());
-                                           current->section=Entry::USINGDECL_SEC;
+                                           //printf("import name = %s -> %s\n",yytext,yyextra->current->name.data());
+                                           yyextra->current->section=Entry::USINGDECL_SEC;
                                          }
-                                         current_root->addSubEntry(current);
-                                          previous = current;
-                                         current = new Entry ;
-                                         initEntry();
+                                          yyextra->previous = yyextra->current;
+                                         yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
+                                         initEntry(yyscanner);
                                          BEGIN(Using);
                                        }
 <FindMembers>"using"{BN}+              { 
-                                         current->startLine=yyLineNr; 
-                                         current->startColumn = yyColNr;
-                                          lineCount(); 
+                                         yyextra->current->startLine=yyextra->yyLineNr; 
+                                         yyextra->current->startColumn = yyextra->yyColNr;
+                                          lineCount(yyscanner); 
                                           BEGIN(Using); 
                                         }
-<Using>"namespace"{BN}+                        { lineCount(); BEGIN(UsingDirective); }
+<Using>"namespace"{BN}+                        { lineCount(yyscanner); BEGIN(UsingDirective); }
 <Using>({ID}{BN}*("::"|"."){BN}*)*({ID}|{OPERATOR}) {
-                                          lineCount();
-                                         current->name=yytext;
-                                          current->fileName = yyFileName; 
-                                         current->section=Entry::USINGDECL_SEC;
-                                          current->startLine = yyLineNr;
-                                         current_root->addSubEntry(current);
-                                          previous = current;
-                                         current             = new Entry ;
-                                         if (insideCS) /* Hack: in C# a using declaration and 
+                                          lineCount(yyscanner);
+                                         yyextra->current->name=yytext;
+                                          yyextra->current->fileName = yyextra->yyFileName; 
+                                         yyextra->current->section=Entry::USINGDECL_SEC;
+                                          yyextra->current->startLine = yyextra->yyLineNr;
+                                          yyextra->previous = yyextra->current;
+                                         yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
+                                         initEntry(yyscanner);
+                                         if (yyextra->insideCS) /* Hack: in C# a using declaration and 
                                                           directive have the same syntax, so we
                                                           also add it as a using directive here
                                                         */
                                          {
-                                           current->name=yytext;
-                                           current->fileName = yyFileName; 
-                                           current->startLine = yyLineNr;
-                                           current->startColumn = yyColNr;
-                                           current->section=Entry::USINGDIR_SEC;
-                                           current_root->addSubEntry(current);
-                                           current             = new Entry ;
+                                           yyextra->current->name=yytext;
+                                           yyextra->current->fileName = yyextra->yyFileName; 
+                                           yyextra->current->startLine = yyextra->yyLineNr;
+                                           yyextra->current->startColumn = yyextra->yyColNr;
+                                           yyextra->current->section=Entry::USINGDIR_SEC;
+                                           yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
+                                           initEntry(yyscanner);
                                          }
-                                         initEntry();
                                          BEGIN(Using);
                                        }
 <Using>"="                              { // C++11 style template alias?
                                           BEGIN(UsingAlias);
                                         }
 <UsingAlias>";"                         { 
-                                          previous->section=Entry::VARIABLE_SEC;
-                                          previous->type = "typedef "+previous->args;
-                                         previous->type=previous->type.simplifyWhiteSpace();
-                                          previous->args.resize(0);
-                                         previous->name=previous->name.stripWhiteSpace();
-                                         previous->bodyLine = yyLineNr;
-                                          previous->spec |= Entry::Alias;
+                                          yyextra->previous->section=Entry::VARIABLE_SEC;
+                                          yyextra->previous->type = "typedef "+yyextra->previous->args;
+                                         yyextra->previous->type=yyextra->previous->type.simplifyWhiteSpace();
+                                          yyextra->previous->args.resize(0);
+                                         yyextra->previous->name=yyextra->previous->name.stripWhiteSpace();
+                                         yyextra->previous->bodyLine = yyextra->yyLineNr;
+                                          yyextra->previous->spec |= Entry::Alias;
                                           BEGIN(FindMembers); 
                                         }
 <UsingAlias>";"{BN}*("/**"|"//!"|"/*!"|"///")"<" {
-                                         docBlockContext   = UsingAliasEnd;
-                                         docBlockInBody    = FALSE;
-                                         docBlockAutoBrief = ( yytext[yyleng-2]=='*' && Config_getBool(JAVADOC_AUTOBRIEF) ) ||
+                                         yyextra->docBlockContext   = UsingAliasEnd;
+                                         yyextra->docBlockInBody    = FALSE;
+                                         yyextra->docBlockAutoBrief = ( yytext[yyleng-2]=='*' && Config_getBool(JAVADOC_AUTOBRIEF) ) ||
                                                              ( yytext[yyleng-2]=='!' && Config_getBool(QT_AUTOBRIEF) );
                                           QCString indent;
-                                          indent.fill(' ',computeIndent(yytext,g_column));
-                                          docBlock=indent;
-                                         lineCount();
+                                          indent.fill(' ',computeIndent(yytext,yyextra->column));
+                                          yyextra->docBlock=indent;
+                                         lineCount(yyscanner);
 
-                                         docBlockTerm = ';';
+                                         yyextra->docBlockTerm = ';';
                                          if (yytext[yyleng-3]=='/')
                                          {
-                                           startCommentBlock(TRUE);
+                                           startCommentBlock(yyscanner,TRUE);
                                            BEGIN( DocLine );
                                          }
                                          else
                                          {
-                                           startCommentBlock(FALSE);
+                                           startCommentBlock(yyscanner,FALSE);
                                            BEGIN( DocBlock );
                                          }
                                        }
 <UsingAlias>">>"                        {
-                                          previous->args+="> >"; // see bug769552
+                                          yyextra->previous->args+="> >"; // see bug769552
                                         }
 <UsingAlias>.                           {
-                                          previous->args+=yytext;
+                                          yyextra->previous->args+=yytext;
                                         }
 <UsingAlias>\n                          {
-                                          previous->args+=yytext;
-                                          lineCount();
+                                          yyextra->previous->args+=yytext;
+                                          lineCount(yyscanner);
                                         }
 <UsingAliasEnd>";"                      {
-                                          previous->doc   = current->doc;
-                                          previous->brief = current->brief;
-                                          current->doc.resize(0);
-                                          current->brief.resize(0);
+                                          yyextra->previous->doc   = yyextra->current->doc;
+                                          yyextra->previous->brief = yyextra->current->brief;
+                                          yyextra->current->doc.resize(0);
+                                          yyextra->current->brief.resize(0);
                                           unput(';');
                                           BEGIN(UsingAlias);
                                         }
-<UsingDirective>{SCOPENAME}            { current->name=removeRedundantWhiteSpace(yytext);
-                                          current->fileName = yyFileName; 
-                                         current->section=Entry::USINGDIR_SEC;
-                                         current_root->addSubEntry(current);
-                                         current             = new Entry ;
-                                         initEntry();
+<UsingDirective>{SCOPENAME}            { yyextra->current->name=removeRedundantWhiteSpace(yytext);
+                                          yyextra->current->fileName = yyextra->yyFileName; 
+                                         yyextra->current->section=Entry::USINGDIR_SEC;
+                                         yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
+                                         initEntry(yyscanner);
                                          BEGIN(Using);
                                        }
 <Using>";"                             { BEGIN(FindMembers); }
 <FindMembers>{SCOPENAME}{BN}*"<>"      { // guided template decl
                                          QCString n=yytext;
-                                         addType( current );
-                                         current->name=n.left(n.length()-2);
+                                         addType(yyscanner);
+                                         yyextra->current->name=n.left(n.length()-2);
                                        }
 <FindMembers>{SCOPENAME}{BN}*/"<"      { // Note: this could be a return type!
-                                          roundCount=0;
-                                         sharpCount=0;
-                                         lineCount();
-                                         addType( current );
-                                         current->name=yytext;
-                                         current->name=current->name.stripWhiteSpace();
-                                         //current->scopeSpec.resize(0);
-                                         // currentTemplateSpec = &current->scopeSpec;
-                                         if (nameIsOperator(current->name))
+                                          yyextra->roundCount=0;
+                                         yyextra->sharpCount=0;
+                                         lineCount(yyscanner);
+                                         addType(yyscanner);
+                                         yyextra->current->name=yytext;
+                                         yyextra->current->name=yyextra->current->name.stripWhiteSpace();
+                                         //yyextra->current->scopeSpec.resize(0);
+                                         // yyextra->currentTemplateSpec = &yyextra->current->scopeSpec;
+                                         if (nameIsOperator(yyextra->current->name))
                                            BEGIN( Operator );
                                          else
                                            BEGIN( EndTemplate );
                                        }
 <FindMemberName>{SCOPENAME}{BN}*/"<"   {
-                                         sharpCount=0;
-                                         roundCount=0;
-                                         lineCount();
-                                         current->name+=((QCString)yytext).stripWhiteSpace();
-                                         //current->memberSpec.resize(0);
-                                         // currentTemplateSpec = &current->memberSpec;
-                                         if (nameIsOperator(current->name))
+                                         yyextra->sharpCount=0;
+                                         yyextra->roundCount=0;
+                                         lineCount(yyscanner);
+                                         yyextra->current->name+=((QCString)yytext).stripWhiteSpace();
+                                         //yyextra->current->memberSpec.resize(0);
+                                         // yyextra->currentTemplateSpec = &yyextra->current->memberSpec;
+                                         if (nameIsOperator(yyextra->current->name))
                                            BEGIN( Operator );
                                          else
                                            BEGIN( EndTemplate );
                                        }
 <EndTemplate>"<<<"                     {
-                                         if (!insidePHP) 
+                                         if (!yyextra->insidePHP) 
                                          {
                                            REJECT;
                                          }
                                          else
                                          {
-                                            lastHereDocContext = YY_START;
+                                            yyextra->lastHereDocContext = YY_START;
                                            BEGIN(HereDoc);
                                          }
                                        }
 <ClassTemplSpec,EndTemplate>"<<"       {
-                                         current->name+=yytext;
-                                         // *currentTemplateSpec+=yytext; 
+                                         yyextra->current->name+=yytext;
+                                         // *yyextra->currentTemplateSpec+=yytext; 
                                        }
 <EndTemplate>"<"                       { 
-                                          if (roundCount==0)
+                                          if (yyextra->roundCount==0)
                                           {
-                                           // *currentTemplateSpec+='<'; 
-                                           sharpCount++; 
+                                           // *yyextra->currentTemplateSpec+='<'; 
+                                           yyextra->sharpCount++; 
                                           }
-                                         current->name+=yytext;
+                                         yyextra->current->name+=yytext;
                                        }
 <ClassTemplSpec,EndTemplate>">>"       {
-                                         if (insideJava || insideCS || insideCli || roundCount==0)
+                                         if (yyextra->insideJava || yyextra->insideCS || yyextra->insideCli || yyextra->roundCount==0)
                                          {
                                            unput('>');
                                            unput(' ');
@@ -2217,117 +1844,118 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                          }
                                          else
                                          {
-                                           current->name+=yytext;
+                                           yyextra->current->name+=yytext;
                                          }
-                                         // *currentTemplateSpec+=yytext; 
+                                         // *yyextra->currentTemplateSpec+=yytext; 
                                        }
 <EndTemplate>">"                       {
-                                         current->name+='>';
-                                         // *currentTemplateSpec+='>';
-                                         if (roundCount==0 && --sharpCount<=0)
+                                         yyextra->current->name+='>';
+                                         // *yyextra->currentTemplateSpec+='>';
+                                         if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
                                          {  
-                                           //printf("Found %s\n",current->name.data());
+                                           //printf("Found %s\n",yyextra->current->name.data());
                                            BEGIN(FindMembers);
                                          }
                                        }
 <EndTemplate>">"{BN}*"("               { 
-                                         lineCount();
-                                         current->name+='>';
-                                         // *currentTemplateSpec+='>';
-                                         if (roundCount==0 && --sharpCount<=0)
-                                         {
-                                           current->bodyLine = yyLineNr;
-                                           current->args = "(";
-                                           currentArgumentContext = FuncQual;
-                                           fullArgString = current->args.copy();
-                                           copyArgString = &current->args;
-                                           //printf("Found %s\n",current->name.data());
+                                         lineCount(yyscanner);
+                                         yyextra->current->name+='>';
+                                         // *yyextra->currentTemplateSpec+='>';
+                                         if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
+                                         {
+                                           yyextra->current->bodyLine = yyextra->yyLineNr;
+                                           yyextra->current->args = "(";
+                                           yyextra->currentArgumentContext = FuncQual;
+                                           yyextra->fullArgString = yyextra->current->args.copy();
+                                           yyextra->copyArgString = &yyextra->current->args;
+                                           //printf("Found %s\n",yyextra->current->name.data());
                                            BEGIN( ReadFuncArgType ) ;
                                          }
                                        }
 <EndTemplate>">"{BN}*/"("({BN}*{ID}{BN}*"::")*({BN}*"*"{BN}*)+ { // function pointer returning a template instance
-                                         lineCount();
-                                         current->name+='>';
-                                          if (roundCount==0)
+                                         lineCount(yyscanner);
+                                         yyextra->current->name+='>';
+                                          if (yyextra->roundCount==0)
                                           {
                                            BEGIN(FindMembers);
                                           }
                                        }
 <EndTemplate>">"{BN}*/"::"             {
-                                         lineCount();
-                                         current->name+='>';
-                                         // *currentTemplateSpec+='>';
-                                         if (roundCount==0 && --sharpCount<=0)
+                                         lineCount(yyscanner);
+                                         yyextra->current->name+='>';
+                                         // *yyextra->currentTemplateSpec+='>';
+                                         if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
                                          {
                                            BEGIN(FindMemberName);
                                          }
                                        }
-<ClassTemplSpec,EndTemplate>"("         { current->name+=*yytext;
-                                          roundCount++; 
+<ClassTemplSpec,EndTemplate>"("         { yyextra->current->name+=*yytext;
+                                          yyextra->roundCount++; 
                                         }
-<ClassTemplSpec,EndTemplate>")"         { current->name+=*yytext;
-                                          if (roundCount>0) roundCount--; 
+<ClassTemplSpec,EndTemplate>")"         { yyextra->current->name+=*yytext;
+                                          if (yyextra->roundCount>0) yyextra->roundCount--; 
                                         }
 <EndTemplate>.                         { 
-                                         current->name+=*yytext;
-                                         // *currentTemplateSpec+=*yytext; 
+                                         yyextra->current->name+=*yytext;
+                                         // *yyextra->currentTemplateSpec+=*yytext; 
                                        }
 <FindMembers>"define"{BN}*"("{BN}*["'] {
-                                         if (insidePHP)
+                                         if (yyextra->insidePHP)
                                          {
-                                           current->bodyLine = yyLineNr;
+                                           yyextra->current->bodyLine = yyextra->yyLineNr;
                                            BEGIN( DefinePHP );
                                          }
                                          else
                                            REJECT;
                                        }
 <CopyHereDoc>{ID}                       { // PHP heredoc
-                                         g_delimiter = yytext;
-                                          *pCopyHereDocGString += yytext;
+                                         yyextra->delimiter = yytext;
+                                          *yyextra->pCopyHereDocGString += yytext;
                                          BEGIN(CopyHereDocEnd);
                                         }
 <CopyHereDoc>"'"{ID}/"'"               { // PHP nowdoc
-                                         g_delimiter = &yytext[1];
-                                          *pCopyHereDocGString += yytext;
+                                         yyextra->delimiter = &yytext[1];
+                                          *yyextra->pCopyHereDocGString += yytext;
                                          BEGIN(CopyHereDocEnd);
                                         }
 <HereDoc>{ID}                          { // PHP heredoc
-                                         g_delimiter = yytext;
+                                         yyextra->delimiter = yytext;
                                          BEGIN(HereDocEnd);
                                        }
 <HereDoc>"'"{ID}/"'"                   { // PHP nowdoc
-                                         g_delimiter = &yytext[1];
+                                         yyextra->delimiter = &yytext[1];
                                          BEGIN(HereDocEnd);
                                        }
 <HereDocEnd>^{ID}                      { // id at start of the line could mark the end of the block
-                                         if (g_delimiter==yytext) // it is the end marker
+                                         if (yyextra->delimiter==yytext) // it is the end marker
                                          {
-                                           BEGIN(lastHereDocContext);
+                                           BEGIN(yyextra->lastHereDocContext);
                                          }
                                        }
 <HereDocEnd>.                          { }
 <CopyHereDocEnd>^{ID}                  { // id at start of the line could mark the end of the block
-                                          *pCopyHereDocGString += yytext;
-                                         if (g_delimiter==yytext) // it is the end marker
+                                          *yyextra->pCopyHereDocGString += yytext;
+                                         if (yyextra->delimiter==yytext) // it is the end marker
                                          {
-                                           BEGIN(lastHereDocContext);
+                                           BEGIN(yyextra->lastHereDocContext);
                                          }
                                        }
 <CopyHereDocEnd>\n                     { 
-                                          *pCopyHereDocGString += yytext;
+                                          lineCount(yyscanner);
+                                          *yyextra->pCopyHereDocGString += yytext;
                                         }
 <CopyHereDocEnd>{ID}                   { 
-                                          *pCopyHereDocGString += yytext;
+                                          *yyextra->pCopyHereDocGString += yytext;
                                         }
 <CopyHereDocEnd>.                      { 
-                                          *pCopyHereDocGString += yytext;
+                                          *yyextra->pCopyHereDocGString += yytext;
                                         }
 <FindMembers>"Q_OBJECT"                        { // Qt object macro
                                        }
 <FindMembers>"Q_PROPERTY"              { // Qt property declaration
-                                         current->protection = Public ; // see bug734245 & bug735462
-                                         current->mtype = mtype = Property;
-                                         current->type.resize(0);
+                                         yyextra->current->protection = Public ; // see bug734245 & bug735462
+                                         yyextra->current->mtype = yyextra->mtype = Property;
+                                         yyextra->current->type.resize(0);
                                          BEGIN(QtPropType);
                                        }
 <QtPropType>"("                                { // start of property arguments
@@ -2337,25 +1965,25 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                          BEGIN(FindMembers);
                                        }
 <QtPropType>"const"|"volatile"|"unsigned"|"signed"|"long"|"short" {
-                                         current->type+=yytext;
+                                         yyextra->current->type+=yytext;
                                        }
 <QtPropType>{B}+                       {
-                                         current->type+=yytext;
+                                         yyextra->current->type+=yytext;
                                        }
 <QtPropType>({TSCOPE}"::")*{TSCOPE}    {
-                                         current->type+=yytext;
+                                         yyextra->current->type+=yytext;
                                           BEGIN(QtPropName);
                                        }
 <QtPropName>{ID}                       {
-                                         current->name=yytext;
+                                         yyextra->current->name=yytext;
                                          BEGIN(QtPropAttr);
                                        }
 <QtPropAttr>"READ"                     {
-                                         current->spec |= Entry::Readable;
+                                         yyextra->current->spec |= Entry::Readable;
                                          BEGIN(QtPropRead);
                                        }
 <QtPropAttr>"WRITE"                    {
-                                         current->spec |= Entry::Writable;
+                                         yyextra->current->spec |= Entry::Writable;
                                          BEGIN(QtPropWrite);
                                        }
 <QtPropAttr>"RESET"{B}+{ID}            { // reset method => not supported yet
@@ -2365,163 +1993,163 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
 <QtPropAttr>"DESIGNABLE"{B}+{ID}       { // designable property => not supported yet
                                        }
 <QtPropRead>{ID}                       {
-                                         current->read = yytext;
+                                         yyextra->current->read = yytext;
                                          BEGIN(QtPropAttr);
                                        }
 <QtPropWrite>{ID}                      {
-                                         current->write = yytext;
+                                         yyextra->current->write = yytext;
                                          BEGIN(QtPropAttr);
                                        }
 <FindMembers>"friend"{BN}+("class"|"union"|"struct"){BN}+ {
-                                         current->name=yytext;
+                                         yyextra->current->name=yytext;
                                          BEGIN(FindMembers);
                                        }
 <FindMembers,FindMemberName>{SCOPENAME}        {
-                                          if (insideCpp || insideObjC) 
+                                          if (yyextra->insideCpp || yyextra->insideObjC) 
                                           {
-                                            current->id = ClangParser::instance()->lookup(yyLineNr,yytext);
+                                            yyextra->current->id = ClangParser::instance()->lookup(yyextra->yyLineNr,yytext);
                                           }
-                                         yyBegColNr=yyColNr;
-                                         yyBegLineNr=yyLineNr;
-                                         lineCount();
-                                          if (insideIDL && yyleng==9 && qstrcmp(yytext,"cpp_quote")==0)
+                                         yyextra->yyBegColNr=yyextra->yyColNr;
+                                         yyextra->yyBegLineNr=yyextra->yyLineNr;
+                                         lineCount(yyscanner);
+                                          if (yyextra->insideIDL && yyleng==9 && qstrcmp(yytext,"cpp_quote")==0)
                                          {
                                            BEGIN(CppQuote);
                                          }
-                                         else if ((insideIDL || insideJava || insideD) && yyleng==6 && qstrcmp(yytext,"import")==0)
+                                         else if ((yyextra->insideIDL || yyextra->insideJava || yyextra->insideD) && yyleng==6 && qstrcmp(yytext,"import")==0)
                                          {
-                                           if (insideIDL)
+                                           if (yyextra->insideIDL)
                                              BEGIN(NextSemi);
-                                           else // insideJava or insideD
+                                           else // yyextra->insideJava or yyextra->insideD
                                              BEGIN(JavaImport);
                                          }
-                                         else if (insidePHP && qstrcmp(yytext,"use")==0)
+                                         else if (yyextra->insidePHP && qstrcmp(yytext,"use")==0)
                                          {
                                            BEGIN(PHPUse);
                                          }
-                                         else if (insideJava && qstrcmp(yytext,"package")==0)
+                                         else if (yyextra->insideJava && qstrcmp(yytext,"package")==0)
                                          {
-                                           lineCount();
+                                           lineCount(yyscanner);
                                            BEGIN(PackageName);
                                          }
-                                         else if (insideIDL && qstrcmp(yytext,"case")==0)
+                                         else if (yyextra->insideIDL && qstrcmp(yytext,"case")==0)
                                          {
                                            BEGIN(IDLUnionCase);
                                          }
-                                         else if (insideTryBlock && qstrcmp(yytext,"catch")==0)
+                                         else if (yyextra->insideTryBlock && qstrcmp(yytext,"catch")==0)
                                          {
-                                           insideTryBlock=FALSE;
+                                           yyextra->insideTryBlock=FALSE;
                                            BEGIN(TryFunctionBlock);
                                          }
-                                          else if (insideCpp && qstrcmp(yytext,"alignas")==0)
+                                          else if (yyextra->insideCpp && qstrcmp(yytext,"alignas")==0)
                                           {
-                                            lastAlignAsContext = YY_START;
+                                            yyextra->lastAlignAsContext = YY_START;
                                             BEGIN(AlignAs);
                                           }
-                                         else if (insideJS && qstrcmp(yytext,"var")==0)
+                                         else if (yyextra->insideJS && qstrcmp(yytext,"var")==0)
                                          { // javascript variable
-                                           current->type="var";
+                                           yyextra->current->type="var";
                                          }
-                                         else if (insideJS && qstrcmp(yytext,"function")==0)
+                                         else if (yyextra->insideJS && qstrcmp(yytext,"function")==0)
                                          { // javascript function
-                                           current->type="function";
+                                           yyextra->current->type="function";
                                          }
-                                         else if (insideCS && qstrcmp(yytext,"this")==0)
+                                         else if (yyextra->insideCS && qstrcmp(yytext,"this")==0)
                                          {
                                            // C# indexer
-                                           addType( current ) ;
-                                           current->name="this";
+                                           addType(yyscanner);
+                                           yyextra->current->name="this";
                                            BEGIN(CSIndexer);
                                          }
-                                          else if (insideCpp && qstrcmp(yytext,"static_assert")==0)
+                                          else if (yyextra->insideCpp && qstrcmp(yytext,"static_assert")==0)
                                           {
                                             // C++11 static_assert
                                             BEGIN(StaticAssert);
                                           }
-                                          else if (insideCpp && qstrcmp(yytext,"decltype")==0)
+                                          else if (yyextra->insideCpp && qstrcmp(yytext,"decltype")==0)
                                           {
                                             // C++11 decltype(x)
-                                           current->type+=yytext;
+                                           yyextra->current->type+=yytext;
                                             BEGIN(DeclType);
                                           }
-                                          else if (insideSlice && qstrcmp(yytext,"optional")==0)
+                                          else if (yyextra->insideSlice && qstrcmp(yytext,"optional")==0)
                                           {
-                                            if (current->type.isEmpty())
+                                            if (yyextra->current->type.isEmpty())
                                             {
-                                              current->type = "optional";
+                                              yyextra->current->type = "optional";
                                             }
                                             else
                                             {
-                                              current->type += " optional";
+                                              yyextra->current->type += " optional";
                                             }
-                                            lastModifierContext = YY_START;
+                                            yyextra->lastModifierContext = YY_START;
                                             BEGIN(SliceOptional);
                                           }
                                          else
                                          {
                                            if (YY_START==FindMembers)
                                            {
-                                             addType( current ) ;
+                                             addType(yyscanner);
                                            }
-                                           bool javaLike = insideJava || insideCS || insideD || insidePHP || insideJS;
+                                           bool javaLike = yyextra->insideJava || yyextra->insideCS || yyextra->insideD || yyextra->insidePHP || yyextra->insideJS;
                                            if (javaLike && qstrcmp(yytext,"public")==0)
                                            {
-                                             current->protection = Public;
+                                             yyextra->current->protection = Public;
                                            }
                                            else if (javaLike && qstrcmp(yytext,"protected")==0)
                                            {
-                                             current->protection = Protected;
+                                             yyextra->current->protection = Protected;
                                            }
-                                           else if ((insideCS || insideD || insidePHP || insideJS) && qstrcmp(yytext,"internal")==0)
+                                           else if ((yyextra->insideCS || yyextra->insideD || yyextra->insidePHP || yyextra->insideJS) && qstrcmp(yytext,"internal")==0)
                                            {
-                                             current->protection = Package;
+                                             yyextra->current->protection = Package;
                                            }
                                            else if (javaLike && qstrcmp(yytext,"private")==0)
                                            {
-                                             current->protection = Private;
+                                             yyextra->current->protection = Private;
                                            }
                                            else if (javaLike && qstrcmp(yytext,"static")==0)
                                            {
                                              if (YY_START==FindMembers)
-                                               current->name  = yytext;
+                                               yyextra->current->name  = yytext;
                                              else
-                                               current->name += yytext;
-                                             current->stat = TRUE;
+                                               yyextra->current->name += yytext;
+                                             yyextra->current->stat = TRUE;
                                            }
                                            else
                                            {
                                              if (YY_START==FindMembers)
-                                               current->name  = yytext;
+                                               yyextra->current->name  = yytext;
                                              else
-                                               current->name += yytext;
-                                             if (current->name.left(7)=="static ")
+                                               yyextra->current->name += yytext;
+                                             if (yyextra->current->name.left(7)=="static ")
                                              {
-                                               current->stat = TRUE;
-                                               current->name= current->name.mid(7);
+                                               yyextra->current->stat = TRUE;
+                                               yyextra->current->name= yyextra->current->name.mid(7);
                                              }
-                                             else if (current->name.left(7)=="inline ")
+                                             else if (yyextra->current->name.left(7)=="inline ")
                                              {
-                                               if (current->type.isEmpty())
+                                               if (yyextra->current->type.isEmpty())
                                                {
-                                                 current->type="inline";
+                                                 yyextra->current->type="inline";
                                                }
                                                else
                                                {
-                                                 current->type+="inline ";
+                                                 yyextra->current->type+="inline ";
                                                }
-                                               current->name= current->name.mid(7);
+                                               yyextra->current->name= yyextra->current->name.mid(7);
                                              }
-                                             else if (current->name.left(6)=="const ")
+                                             else if (yyextra->current->name.left(6)=="const ")
                                              {
-                                               if (current->type.isEmpty())
+                                               if (yyextra->current->type.isEmpty())
                                                {
-                                                 current->type="const";
+                                                 yyextra->current->type="const";
                                                }
                                                else
                                                {
-                                                 current->type+="const ";
+                                                 yyextra->current->type+="const ";
                                                }
-                                               current->name=current->name.mid(6);
+                                               yyextra->current->name=yyextra->current->name.mid(6);
                                              }
                                            }
                                            QCString tmp=yytext;
@@ -2531,64 +2159,64 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                             }
                                            else
                                             {
-                                             externC=FALSE; // see bug759247
+                                             yyextra->externC=FALSE; // see bug759247
                                              BEGIN(FindMembers);
                                             }
                                          }
                                        }
 <StaticAssert>"("                       {
-                                         lastSkipRoundContext = FindMembers;
-                                         roundCount=0;
+                                         yyextra->lastSkipRoundContext = FindMembers;
+                                         yyextra->roundCount=0;
                                           BEGIN(SkipRound);
                                         }
-<StaticAssert>{BN}+                     { lineCount(); }
+<StaticAssert>{BN}+                     { lineCount(yyscanner); }
 <StaticAssert>.                         { // variable with static_assert as name?
                                           unput(*yytext);
                                           BEGIN(FindMembers);
                                         }
 <DeclType>"("                           {
-                                         current->type+=yytext;
-                                         lastRoundContext=FindMembers;
-                                         pCopyRoundString=&current->type;
-                                         roundCount=0;
+                                         yyextra->current->type+=yytext;
+                                         yyextra->lastRoundContext=FindMembers;
+                                         yyextra->pCopyRoundString=&yyextra->current->type;
+                                         yyextra->roundCount=0;
                                           BEGIN(CopyRound);
                                         }
-<DeclType>{BN}+                         { lineCount(); }
+<DeclType>{BN}+                         { lineCount(yyscanner); }
 <DeclType>.                             {
                                           unput(*yytext);
                                           BEGIN(FindMembers);
                                         }
 <CSIndexer>"["[^\n\]]*"]"              {
-                                         current->name+=removeRedundantWhiteSpace(yytext);
+                                         yyextra->current->name+=removeRedundantWhiteSpace(yytext);
                                          BEGIN(FindMembers);
                                        }
 <FindMembers>[0-9]{ID}                 { // some number where we did not expect one
                                        }
 <FindMembers>"."                       {
-                                         if (insideJava || insideCS || insideD)
+                                         if (yyextra->insideJava || yyextra->insideCS || yyextra->insideD)
                                          {
-                                           current->name+=".";
+                                           yyextra->current->name+=".";
                                          }
                                        }
 <FindMembers>"::"                      {
-                                         current->name+=yytext;
+                                         yyextra->current->name+=yytext;
                                        }
 <CppQuote>"("{B}*"\""                  {
-                                         insideCppQuote=TRUE;
+                                         yyextra->insideCppQuote=TRUE;
                                          BEGIN(FindMembers);
                                        }
 <IDLUnionCase>"::"
 <IDLUnionCase>":"                      { BEGIN(FindMembers); }
-<IDLUnionCase>\n                       { lineCount(); }
+<IDLUnionCase>\n                       { lineCount(yyscanner); }
 <IDLUnionCase>.
-<TryFunctionBlock>\n                   { lineCount(); }
+<TryFunctionBlock>\n                   { lineCount(yyscanner); }
 <TryFunctionBlock>"{"                  { 
-                                         curlyCount=0;
-                                         lastCurlyContext = TryFunctionBlockEnd ;
+                                         yyextra->curlyCount=0;
+                                         yyextra->lastCurlyContext = TryFunctionBlockEnd ;
                                          BEGIN( SkipCurly );
                                        }
 <TryFunctionBlock>.
-<TryFunctionBlockEnd>{BN}*"catch"      { lineCount(); BEGIN(TryFunctionBlock); // {BN}* added to fix bug 611193
+<TryFunctionBlockEnd>{BN}*"catch"      { lineCount(yyscanner); BEGIN(TryFunctionBlock); // {BN}* added to fix bug 611193
                                        }
 <TryFunctionBlockEnd>\n                        { unput(*yytext); // rule added to fix bug id 601138
                                          BEGIN( FindMembers );
@@ -2597,161 +2225,159 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                          BEGIN( FindMembers );
                                        }
 <EndCppQuote>")"                       {
-                                         insideCppQuote=FALSE;
+                                         yyextra->insideCppQuote=FALSE;
                                          BEGIN(FindMembers);
                                        }
-<FindMembers,FindFields>{B}*"#"                { if (insidePHP)
+<FindMembers,FindFields>{B}*"#"                { if (yyextra->insidePHP)
                                            REJECT;
-                                         lastCPPContext = YY_START;
+                                         yyextra->lastCPPContext = YY_START;
                                          BEGIN( SkipCPP ) ;
                                        }
 <FindMembers,FindFields>{B}*"#"{B}*("cmake")?"define"  {
-                                         if (insidePHP)
+                                         if (yyextra->insidePHP)
                                            REJECT;
-                                         current->bodyLine = yyLineNr;
-                                          lastDefineContext = YY_START;
+                                         yyextra->current->bodyLine = yyextra->yyLineNr;
+                                          yyextra->lastDefineContext = YY_START;
                                          BEGIN( Define );
                                        }
 <FindMembers,ReadBody,ReadNSBody,ReadBodyIntf,SkipCurly,SkipCurlyCpp>{B}*"#"{B}+[0-9]+{B}+/"\""        { /* line control directive */
-                                          yyLineNr = atoi(&yytext[1]);
-                                         //printf("setting line number to %d\n",yyLineNr);
-                                         lastPreLineCtrlContext = YY_START;
+                                          yyextra->yyLineNr = atoi(&yytext[1]);
+                                         //printf("setting line number to %d\n",yyextra->yyLineNr);
+                                         yyextra->lastPreLineCtrlContext = YY_START;
                                          if (YY_START==ReadBody || 
                                              YY_START==ReadNSBody ||
                                              YY_START==ReadBodyIntf)
                                          {
-                                           current->program+=yytext;
+                                           yyextra->current->program+=yytext;
                                          }
                                          BEGIN( PreLineCtrl );
                                        }
 <PreLineCtrl>"\""[^\n\"]*"\""          {
-                                         yyFileName = stripQuotes(yytext);
-                                         if (lastPreLineCtrlContext==ReadBody || 
-                                             lastPreLineCtrlContext==ReadNSBody ||
-                                             lastPreLineCtrlContext==ReadBodyIntf)
+                                         yyextra->yyFileName = stripQuotes(yytext);
+                                         if (yyextra->lastPreLineCtrlContext==ReadBody || 
+                                             yyextra->lastPreLineCtrlContext==ReadNSBody ||
+                                             yyextra->lastPreLineCtrlContext==ReadBodyIntf)
                                          {
-                                           current->program+=yytext;
+                                           yyextra->current->program+=yytext;
                                          }
                                        }
 <PreLineCtrl>.                         {
-                                         if (lastPreLineCtrlContext==ReadBody || 
-                                             lastPreLineCtrlContext==ReadNSBody ||
-                                             lastPreLineCtrlContext==ReadBodyIntf)
+                                         if (yyextra->lastPreLineCtrlContext==ReadBody || 
+                                             yyextra->lastPreLineCtrlContext==ReadNSBody ||
+                                             yyextra->lastPreLineCtrlContext==ReadBodyIntf)
                                          {
-                                           current->program+=yytext;
+                                           yyextra->current->program+=yytext;
                                          }
                                         }
 <PreLineCtrl>\n                                {
-                                         if (lastPreLineCtrlContext==ReadBody || 
-                                             lastPreLineCtrlContext==ReadNSBody ||
-                                             lastPreLineCtrlContext==ReadBodyIntf)
+                                         if (yyextra->lastPreLineCtrlContext==ReadBody || 
+                                             yyextra->lastPreLineCtrlContext==ReadNSBody ||
+                                             yyextra->lastPreLineCtrlContext==ReadBodyIntf)
                                          {
-                                           current->program+=yytext;
+                                           yyextra->current->program+=yytext;
                                          }
-                                          lineCount();
-                                         BEGIN( lastPreLineCtrlContext );
+                                          lineCount(yyscanner);
+                                         BEGIN( yyextra->lastPreLineCtrlContext );
                                        }
 <SkipCPP>.
-<SkipCPP>\\[\r]*"\n"[\r]*              { lineCount(); }
-<SkipCPP>[\r]*\n[\r]*                  { lineCount();
-                                         BEGIN( lastCPPContext) ;
+<SkipCPP>\\[\r]*"\n"[\r]*              { lineCount(yyscanner); }
+<SkipCPP>[\r]*\n[\r]*                  { lineCount(yyscanner);
+                                         BEGIN( yyextra->lastCPPContext) ;
                                        }
 <Define>{ID}{B}*"("                    {
-                                         current->name = yytext;
-                                         current->name = current->name.left(current->name.length()-1).stripWhiteSpace();
-                                         current->args = "(";
-                                         current->bodyLine = yyLineNr;
-                                         currentArgumentContext = DefineEnd;
-                                         fullArgString=current->args.copy();
-                                         copyArgString=&current->args;
+                                         yyextra->current->name = yytext;
+                                         yyextra->current->name = yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
+                                         yyextra->current->args = "(";
+                                         yyextra->current->bodyLine = yyextra->yyLineNr;
+                                         yyextra->currentArgumentContext = DefineEnd;
+                                         yyextra->fullArgString=yyextra->current->args.copy();
+                                         yyextra->copyArgString=&yyextra->current->args;
                                          BEGIN( ReadFuncArgType ) ;
                                        }
  /*
 <DefineArg>")"                         {
                                          //printf("Define with args\n");
-                                         current->args += ')';
+                                         yyextra->current->args += ')';
                                          BEGIN( DefineEnd );
                                        }
 <DefineArg>.                           {
-                                         current->args += *yytext;
+                                         yyextra->current->args += *yytext;
                                        }
   */
 <Define>{ID}                           {
                                          //printf("Define '%s' without args\n",yytext);
-                                          if (insideCpp || insideObjC) 
+                                          if (yyextra->insideCpp || yyextra->insideObjC) 
                                           {
-                                            current->id = ClangParser::instance()->lookup(yyLineNr,yytext);
+                                            yyextra->current->id = ClangParser::instance()->lookup(yyextra->yyLineNr,yytext);
                                           }
-                                         current->bodyLine = yyLineNr;
-                                         current->name = yytext;
+                                         yyextra->current->bodyLine = yyextra->yyLineNr;
+                                         yyextra->current->name = yytext;
                                          BEGIN(DefineEnd);
                                        }
 <DefineEnd>\n                          {
-                                         //printf("End define: doc=%s docFile=%s docLine=%d\n",current->doc.data(),current->docFile.data(),current->docLine);
-                                          lineCount();
-                                         current->fileName   = yyFileName;
-                                         current->startLine  = yyLineNr;
-                                         current->startColumn = yyColNr;
-                                         current->type.resize(0);
-                                         current->args       = current->args.simplifyWhiteSpace();
-                                         current->name       = current->name.stripWhiteSpace();
-                                         current->section    = Entry::DEFINE_SEC;
-                                         current_root->addSubEntry(current);
-                                         current             = new Entry ;
-                                         initEntry();
-                                         BEGIN(lastDefineContext);
+                                         //printf("End define: doc=%s docFile=%s docLine=%d\n",yyextra->current->doc.data(),yyextra->current->docFile.data(),yyextra->current->docLine);
+                                          lineCount(yyscanner);
+                                         yyextra->current->fileName   = yyextra->yyFileName;
+                                         yyextra->current->startLine  = yyextra->yyLineNr;
+                                         yyextra->current->startColumn = yyextra->yyColNr;
+                                         yyextra->current->type.resize(0);
+                                         yyextra->current->args       = yyextra->current->args.simplifyWhiteSpace();
+                                         yyextra->current->name       = yyextra->current->name.stripWhiteSpace();
+                                         yyextra->current->section    = Entry::DEFINE_SEC;
+                                         yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
+                                         initEntry(yyscanner);
+                                         BEGIN(yyextra->lastDefineContext);
                                        }
 <DefinePHPEnd>";"                      {
                                          //printf("End define\n");
-                                         current->fileName   = yyFileName;
-                                         current->startLine  = yyLineNr;
-                                         current->startColumn = yyColNr;
-                                         current->type.resize(0);
-                                          current->type       = "const";
-                                          QCString init = current->initializer.data();
+                                         yyextra->current->fileName   = yyextra->yyFileName;
+                                         yyextra->current->startLine  = yyextra->yyLineNr;
+                                         yyextra->current->startColumn = yyextra->yyColNr;
+                                         yyextra->current->type.resize(0);
+                                          yyextra->current->type       = "const";
+                                          QCString init = yyextra->current->initializer.data();
                                          init = init.simplifyWhiteSpace();
                                          init = init.left(init.length()-1);
-                                          current->initializer = init;
-                                         current->name       = current->name.stripWhiteSpace();
-                                         current->section    = Entry::VARIABLE_SEC; 
-                                         current_root->addSubEntry(current);
-                                         current             = new Entry ;
-                                         initEntry();
+                                          yyextra->current->initializer = init;
+                                         yyextra->current->name       = yyextra->current->name.stripWhiteSpace();
+                                         yyextra->current->section    = Entry::VARIABLE_SEC; 
+                                         yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
+                                         initEntry(yyscanner);
                                          BEGIN(FindMembers);
                                        }
 <DefinePHPEnd>.
 <DefineEnd>\\[\r]?\n                   {
-                                          lineCount();
+                                          lineCount(yyscanner);
                                        }
 <DefineEnd>\"                          {
-                                         if (insideIDL && insideCppQuote)
+                                         if (yyextra->insideIDL && yyextra->insideCppQuote)
                                          {
                                            BEGIN(EndCppQuote);
                                          }
                                          else
                                          {
-                                           lastStringContext=DefineEnd;
+                                           yyextra->lastStringContext=DefineEnd;
                                            BEGIN(SkipString);
                                          }
                                        }
 <DefineEnd>.                           
 <DefinePHP>{ID}["']{BN}*","{BN}*       {
-                                         current->name = yytext;
-                                         current->name = current->name.stripWhiteSpace();
-                                         current->name = current->name.left(current->name.length()-1).stripWhiteSpace();
-                                         current->name = current->name.left(current->name.length()-1);
-                                         current->bodyLine = yyLineNr;
-                                         lastRoundContext = DefinePHPEnd;
-                                         pCopyRoundGString = &current->initializer;
-                                         roundCount = 0;
+                                         yyextra->current->name = yytext;
+                                         yyextra->current->name = yyextra->current->name.stripWhiteSpace();
+                                         yyextra->current->name = yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
+                                         yyextra->current->name = yyextra->current->name.left(yyextra->current->name.length()-1);
+                                         yyextra->current->bodyLine = yyextra->yyLineNr;
+                                         yyextra->lastRoundContext = DefinePHPEnd;
+                                         yyextra->pCopyRoundGString = &yyextra->current->initializer;
+                                         yyextra->roundCount = 0;
                                          BEGIN( GCopyRound );
                                        }
 
 <FindMembers>[\^%]                     {  // ^ and % are C++/CLI extensions
-                                         if (insideCli)
+                                         if (yyextra->insideCli)
                                          {
-                                           addType( current );
-                                            current->name = yytext ; 
+                                           addType(yyscanner);
+                                            yyextra->current->name = yytext ; 
                                          }
                                          else
                                          {
@@ -2759,128 +2385,128 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                          }
                                        }
 <FindMembers>[*&]+                     { 
-                                          current->name += yytext ;  
-                                         addType( current );
+                                          yyextra->current->name += yytext ;  
+                                         addType(yyscanner);
                                        }
-<FindMembers,MemberSpec,Function,NextSemi,EnumBaseType,BitFields,ReadInitializer,OldStyleArgs>";"{BN}*("/**"|"//!"|"/*!"|"///")"<" {
-                                         if (current->bodyLine==-1)
+<FindMembers,MemberSpec,Function,NextSemi,EnumBaseType,BitFields,ReadInitializer,OldStyleArgs,DefinePHPEnd>";"{BN}*("/**"|"//!"|"/*!"|"///")"<" {
+                                         if (yyextra->current->bodyLine==-1)
                                          {
-                                           current->bodyLine=yyLineNr;
+                                           yyextra->current->bodyLine=yyextra->yyLineNr;
                                          }
-                                         docBlockContext   = YY_START;
-                                         docBlockInBody    = FALSE;
-                                         docBlockAutoBrief = ( yytext[yyleng-2]=='*' && Config_getBool(JAVADOC_AUTOBRIEF) ) ||
+                                         yyextra->docBlockContext   = YY_START;
+                                         yyextra->docBlockInBody    = FALSE;
+                                         yyextra->docBlockAutoBrief = ( yytext[yyleng-2]=='*' && Config_getBool(JAVADOC_AUTOBRIEF) ) ||
                                                              ( yytext[yyleng-2]=='!' && Config_getBool(QT_AUTOBRIEF) );
 
                                           QCString indent;
-                                          indent.fill(' ',computeIndent(yytext,g_column));
-                                          docBlock=indent;
-                                          //printf("indent=%d\n",computeIndent(yytext+1,g_column));
-                                         lineCount();
+                                          indent.fill(' ',computeIndent(yytext,yyextra->column));
+                                          yyextra->docBlock=indent;
+                                          //printf("indent=%d\n",computeIndent(yytext+1,yyextra->column));
+                                         lineCount(yyscanner);
 
-                                         docBlockTerm = ';';
-                                          if (YY_START==EnumBaseType && current->section==Entry::ENUM_SEC)
+                                         yyextra->docBlockTerm = ';';
+                                          if (YY_START==EnumBaseType && yyextra->current->section==Entry::ENUM_SEC)
                                           {
-                                            current->bitfields = ":"+current->args;
-                                            current->args.resize(0);
-                                            current->section=Entry::VARIABLE_SEC;
+                                            yyextra->current->bitfields = ":"+yyextra->current->args;
+                                            yyextra->current->args.resize(0);
+                                            yyextra->current->section=Entry::VARIABLE_SEC;
                                           }
                                          if (yytext[yyleng-3]=='/')
                                          {
-                                           startCommentBlock(TRUE);
+                                           startCommentBlock(yyscanner,TRUE);
                                            BEGIN( DocLine );
                                          }
                                          else
                                          {
-                                           startCommentBlock(FALSE);
+                                           startCommentBlock(yyscanner,FALSE);
                                            BEGIN( DocBlock );
                                          }
                                        }
 <MemberSpec,FindFields,FindMembers,NextSemi,EnumBaseType,BitFields,ReadInitializer,OldStyleArgs>","{BN}*("/**"|"//!"|"/*!"|"///")"<" {
-                                         docBlockContext   = YY_START;
-                                         docBlockInBody    = FALSE;
-                                         docBlockAutoBrief = ( yytext[yyleng-2]=='*' && Config_getBool(JAVADOC_AUTOBRIEF) ) ||
+                                         yyextra->docBlockContext   = YY_START;
+                                         yyextra->docBlockInBody    = FALSE;
+                                         yyextra->docBlockAutoBrief = ( yytext[yyleng-2]=='*' && Config_getBool(JAVADOC_AUTOBRIEF) ) ||
                                                              ( yytext[yyleng-2]=='!' && Config_getBool(QT_AUTOBRIEF) );
 
                                           QCString indent;
-                                          indent.fill(' ',computeIndent(yytext,g_column));
-                                          docBlock=indent;
-                                         lineCount();
+                                          indent.fill(' ',computeIndent(yytext,yyextra->column));
+                                          yyextra->docBlock=indent;
+                                         lineCount(yyscanner);
 
-                                         docBlockTerm = ',';
-                                          if (YY_START==EnumBaseType && current->section==Entry::ENUM_SEC)
+                                         yyextra->docBlockTerm = ',';
+                                          if (YY_START==EnumBaseType && yyextra->current->section==Entry::ENUM_SEC)
                                           {
-                                            current->bitfields = ":"+current->args;
-                                            current->args.resize(0);
-                                            current->section=Entry::VARIABLE_SEC;
+                                            yyextra->current->bitfields = ":"+yyextra->current->args;
+                                            yyextra->current->args.resize(0);
+                                            yyextra->current->section=Entry::VARIABLE_SEC;
                                           }
                                          if (yytext[yyleng-3]=='/')
                                          {
-                                           startCommentBlock(TRUE);
+                                           startCommentBlock(yyscanner,TRUE);
                                            BEGIN( DocLine );
                                          }
                                          else
                                          {
-                                           startCommentBlock(FALSE);
+                                           startCommentBlock(yyscanner,FALSE);
                                            BEGIN( DocBlock );
                                          }
                                        }
 <DefineEnd,FindFields,FindFieldArg,ReadInitializer,OldStyleArgs>{BN}*("/**"|"//!"|"/*!"|"///")"<" {
-                                         if (current->bodyLine==-1)
+                                         if (yyextra->current->bodyLine==-1)
                                          {
-                                           current->bodyLine=yyLineNr;
+                                           yyextra->current->bodyLine=yyextra->yyLineNr;
                                          }
-                                         docBlockContext   = YY_START;
-                                         docBlockInBody    = FALSE;
-                                         docBlockAutoBrief = ( yytext[yyleng-2]=='*' && Config_getBool(JAVADOC_AUTOBRIEF) ) ||
+                                         yyextra->docBlockContext   = YY_START;
+                                         yyextra->docBlockInBody    = FALSE;
+                                         yyextra->docBlockAutoBrief = ( yytext[yyleng-2]=='*' && Config_getBool(JAVADOC_AUTOBRIEF) ) ||
                                                              ( yytext[yyleng-2]=='!' && Config_getBool(QT_AUTOBRIEF) );
                                           QCString indent;
-                                          indent.fill(' ',computeIndent(yytext,g_column));
-                                          docBlock=indent;
-                                         lineCount();
+                                          indent.fill(' ',computeIndent(yytext,yyextra->column));
+                                          yyextra->docBlock=indent;
+                                         lineCount(yyscanner);
 
-                                         docBlockTerm = 0;
+                                         yyextra->docBlockTerm = 0;
                                          if (yytext[yyleng-3]=='/')
                                          {
-                                           startCommentBlock(TRUE);
+                                           startCommentBlock(yyscanner,TRUE);
                                            BEGIN( DocLine );
                                          }
                                          else
                                          {
-                                           startCommentBlock(FALSE);
+                                           startCommentBlock(yyscanner,FALSE);
                                            BEGIN( DocBlock );
                                          }
                                        }
    
 <FindMembers,FindFields>("//"([!/]){B}*{CMD}"{")|("/*"([!*]){B}*{CMD}"{")      {
-                                         //handleGroupStartCommand(current->name);
-                                          if (previous && previous->section==Entry::GROUPDOC_SEC)
+                                         //handleGroupStartCommand(yyextra->current->name);
+                                          if (yyextra->previous && yyextra->previous->section==Entry::GROUPDOC_SEC)
                                          {
-                                           // link open command to the group defined in the previous entry
-                                           Doxygen::docGroup.open(previous,yyFileName,yyLineNr);
+                                           // link open command to the group defined in the yyextra->previous entry
+                                           Doxygen::docGroup.open(yyextra->previous.get(),yyextra->yyFileName,yyextra->yyLineNr);
                                          }
                                          else
                                          {
-                                           // link open command to the current entry
-                                           Doxygen::docGroup.open(current,yyFileName,yyLineNr);
+                                           // link open command to the yyextra->current entry
+                                           Doxygen::docGroup.open(yyextra->current.get(),yyextra->yyFileName,yyextra->yyLineNr);
                                          }
-                                         //current = tmp;
-                                         initEntry();
+                                         //yyextra->current = tmp;
+                                         initEntry(yyscanner);
                                          if (yytext[1]=='/')
                                          {
                                            if (yytext[2]=='!' || yytext[2]=='/')
                                            {
-                                             docBlockContext   = YY_START;
-                                             docBlockInBody    = FALSE;
-                                             docBlockAutoBrief = FALSE;
-                                             docBlock.resize(0);
-                                             docBlockTerm = 0;
-                                             startCommentBlock(TRUE);
+                                             yyextra->docBlockContext   = YY_START;
+                                             yyextra->docBlockInBody    = FALSE;
+                                             yyextra->docBlockAutoBrief = FALSE;
+                                             yyextra->docBlock.resize(0);
+                                             yyextra->docBlockTerm = 0;
+                                             startCommentBlock(yyscanner,TRUE);
                                              BEGIN(DocLine);
                                            }
                                            else
                                            {
-                                             lastCContext=YY_START;
+                                             yyextra->lastCContext=YY_START;
                                              BEGIN(SkipCxxComment);
                                            }
                                          }
@@ -2888,498 +2514,498 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                          {
                                            if (yytext[2]=='!' || yytext[2]=='*')
                                            {
-                                             docBlockContext   = YY_START;
-                                             docBlockInBody    = FALSE;
-                                             docBlock.resize(0);
-                                             docBlockAutoBrief = ( yytext[yyleng-2]=='*' && Config_getBool(JAVADOC_AUTOBRIEF) ) ||
+                                             yyextra->docBlockContext   = YY_START;
+                                             yyextra->docBlockInBody    = FALSE;
+                                             yyextra->docBlock.resize(0);
+                                             yyextra->docBlockAutoBrief = ( yytext[yyleng-2]=='*' && Config_getBool(JAVADOC_AUTOBRIEF) ) ||
                                                                  ( yytext[yyleng-2]=='!' && Config_getBool(QT_AUTOBRIEF) );
-                                             docBlockTerm = 0;
-                                             startCommentBlock(FALSE);
+                                             yyextra->docBlockTerm = 0;
+                                             startCommentBlock(yyscanner,FALSE);
                                              BEGIN(DocBlock);
                                            }
                                            else
                                            {
-                                             lastCContext=YY_START;
+                                             yyextra->lastCContext=YY_START;
                                              BEGIN(SkipComment);
                                            }
                                          }
                                        }
 <FindMembers,FindFields,ReadInitializer>"//"([!/]){B}*{CMD}"}".*|"/*"([!*]){B}*{CMD}"}"[^*]*"*/"       {
-                                          bool insideEnum = YY_START==FindFields || (YY_START==ReadInitializer && lastInitializerContext==FindFields); // see bug746226
-                                         Doxygen::docGroup.close(current,yyFileName,yyLineNr,insideEnum);
+                                          bool insideEnum = YY_START==FindFields || (YY_START==ReadInitializer && yyextra->lastInitializerContext==FindFields); // see bug746226
+                                         Doxygen::docGroup.close(yyextra->current.get(),yyextra->yyFileName,yyextra->yyLineNr,insideEnum);
+                                         lineCount(yyscanner);
                                        }
 <FindMembers>"="                       { // in PHP code this could also be due to "<?="
-                                         current->bodyLine = yyLineNr;
-                                          current->initializer = yytext;
-                                         lastInitializerContext = YY_START;
-                                         initBracketCount=0;
+                                         yyextra->current->bodyLine = yyextra->yyLineNr;
+                                          yyextra->current->initializer = yytext;
+                                         yyextra->lastInitializerContext = YY_START;
+                                         yyextra->initBracketCount=0;
                                          BEGIN(ReadInitializer);
                                        }
 <UNOIDLAttributeBlock>{BN}*[gs]"et"{BN}+"raises"{BN}*"("{BN}*{SCOPENAME}{BN}*(","{BN}*{SCOPENAME}{BN}*)*")"{BN}*";"    {
-                                         lineCount();
-                                         current->exception += " ";
-                                         current->exception += removeRedundantWhiteSpace(yytext);
+                                         lineCount(yyscanner);
+                                         yyextra->current->exception += " ";
+                                         yyextra->current->exception += removeRedundantWhiteSpace(yytext);
                                        }
 <UNOIDLAttributeBlock>"}"              {
-                                         current->exception += " }";
+                                         yyextra->current->exception += " }";
                                          BEGIN(FindMembers);
                                        }
   /* Read initializer rules */
 <ReadInitializer>"("                   {
-                                         lastRoundContext=YY_START;
-                                         pCopyRoundGString=&current->initializer;
-                                         roundCount=0;
-                                         current->initializer+=*yytext; 
+                                         yyextra->lastRoundContext=YY_START;
+                                         yyextra->pCopyRoundGString=&yyextra->current->initializer;
+                                         yyextra->roundCount=0;
+                                         yyextra->current->initializer+=*yytext; 
                                          BEGIN(GCopyRound);
                                        }
 <ReadInitializer>"["                    {
-                                          if (!insidePHP) REJECT;
-                                          lastSquareContext=YY_START;
-                                          pCopySquareGString=&current->initializer;
-                                          squareCount=0;
-                                          current->initializer+=*yytext; 
+                                          if (!yyextra->insidePHP) REJECT;
+                                          yyextra->lastSquareContext=YY_START;
+                                          yyextra->pCopySquareGString=&yyextra->current->initializer;
+                                          yyextra->squareCount=0;
+                                          yyextra->current->initializer+=*yytext; 
                                           BEGIN(GCopySquare);
                                         }
 <ReadInitializer>"{"                   {
-                                         lastCurlyContext=YY_START;
-                                         pCopyCurlyGString=&current->initializer;
-                                         curlyCount=0;
-                                         current->initializer+=*yytext; 
+                                         yyextra->lastCurlyContext=YY_START;
+                                         yyextra->pCopyCurlyGString=&yyextra->current->initializer;
+                                         yyextra->curlyCount=0;
+                                         yyextra->current->initializer+=*yytext; 
                                          BEGIN(GCopyCurly);
                                        }
 <ReadInitializer>[;,]                  {
-                                         //printf(">> initializer '%s' <<\n",current->initializer.data());
-                                          if (*yytext==';' && (current_root->spec&Entry::Enum))
-                                         {
-                                           current->fileName   = yyFileName;
-                                           current->startLine  = yyLineNr;
-                                           current->startColumn = yyColNr;
-                                           current->args       = current->args.simplifyWhiteSpace();
-                                           current->name       = current->name.stripWhiteSpace();
-                                           current->section    = Entry::VARIABLE_SEC;
-                                           current_root->addSubEntry(current);
-                                           current = new Entry;
-                                           initEntry();
+                                         //printf(">> initializer '%s' <<\n",yyextra->current->initializer.data());
+                                          if (*yytext==';' && (yyextra->current_root->spec&Entry::Enum))
+                                         {
+                                           yyextra->current->fileName   = yyextra->yyFileName;
+                                           yyextra->current->startLine  = yyextra->yyLineNr;
+                                           yyextra->current->startColumn = yyextra->yyColNr;
+                                           yyextra->current->args       = yyextra->current->args.simplifyWhiteSpace();
+                                           yyextra->current->name       = yyextra->current->name.stripWhiteSpace();
+                                           yyextra->current->section    = Entry::VARIABLE_SEC;
+                                           yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
+                                           initEntry(yyscanner);
                                            BEGIN(FindMembers);
                                          }
-                                         else if (*yytext==';' || (lastInitializerContext==FindFields && initBracketCount==0)) // initBracketCount==0 was added for bug 665778
+                                         else if (*yytext==';' || (yyextra->lastInitializerContext==FindFields && yyextra->initBracketCount==0)) // yyextra->initBracketCount==0 was added for bug 665778
                                          {
                                            unput(*yytext);
-                                           BEGIN(lastInitializerContext);
+                                           BEGIN(yyextra->lastInitializerContext);
                                          }
-                                         else if (*yytext==',' && initBracketCount==0) // for "int a=0,b=0"
+                                         else if (*yytext==',' && yyextra->initBracketCount==0) // for "int a=0,b=0"
                                          {
                                            unput(*yytext);
-                                           BEGIN(lastInitializerContext);
+                                           BEGIN(yyextra->lastInitializerContext);
                                          }
                                          else
                                          {
-                                           current->initializer+=*yytext; 
+                                           yyextra->current->initializer+=*yytext; 
                                          }
                                        }
 <ReadInitializer>{RAWBEGIN}             { // C++11 raw string
-                                          if (!insideCpp)
+                                          if (!yyextra->insideCpp)
                                           { 
                                             REJECT;
                                           }
                                           else
                                           {
                                             QCString text=yytext;
-                                            current->initializer+=text;
+                                            yyextra->current->initializer+=text;
                                             int i=text.find('"');
-                                            g_delimiter = yytext+i+1;
-                                            g_delimiter=g_delimiter.left(g_delimiter.length()-1);
-                                            lastRawStringContext = YY_START;
-                                            pCopyRawGString = &current->initializer;
+                                            yyextra->delimiter = yytext+i+1;
+                                            yyextra->delimiter=yyextra->delimiter.left(yyextra->delimiter.length()-1);
+                                            yyextra->lastRawStringContext = YY_START;
+                                            yyextra->pCopyRawGString = &yyextra->current->initializer;
                                             BEGIN(RawGString);
                                             //printf("RawGString delimiter='%s'\n",delimiter.data());
                                           }
                                         }
 <RawGString>{RAWEND}                    {
-                                          *pCopyRawGString+=yytext;
+                                          *yyextra->pCopyRawGString+=yytext;
                                           QCString delimiter = yytext+1;
                                           delimiter=delimiter.left(delimiter.length()-1);
-                                          if (delimiter==g_delimiter)
+                                          if (delimiter==yyextra->delimiter)
                                           {
-                                            BEGIN(lastRawStringContext);
+                                            BEGIN(yyextra->lastRawStringContext);
                                           }
                                         }
 <RawGString>[^)\n]+                     {
-                                          *pCopyRawGString+=yytext;
+                                          *yyextra->pCopyRawGString+=yytext;
                                         }
 <RawGString>.                           {
-                                          *pCopyRawGString+=yytext;
+                                          *yyextra->pCopyRawGString+=yytext;
                                         }
 <RawGString>\n                          {
-                                          *pCopyRawGString+=yytext;
-                                          lineCount();
+                                          *yyextra->pCopyRawGString+=yytext;
+                                          lineCount(yyscanner);
                                         }
 <RawString>{RAWEND}                     {
-                                          *pCopyRawString+=yytext;
-                                         fullArgString+=yytext;
+                                          *yyextra->pCopyRawString+=yytext;
+                                         yyextra->fullArgString+=yytext;
                                           QCString delimiter = yytext+1;
                                           delimiter=delimiter.left(delimiter.length()-1);
-                                          if (delimiter==g_delimiter)
+                                          if (delimiter==yyextra->delimiter)
                                           {
-                                            BEGIN(lastRawStringContext);
+                                            BEGIN(yyextra->lastRawStringContext);
                                           }
                                         }
 <RawString>[^)]+                        {
-                                          *pCopyRawString+=yytext;
-                                         fullArgString+=yytext;
+                                          *yyextra->pCopyRawString+=yytext;
+                                         yyextra->fullArgString+=yytext;
                                         }
 <RawString>.                            {
-                                          *pCopyRawString+=yytext;
-                                         fullArgString+=yytext;
+                                          *yyextra->pCopyRawString+=yytext;
+                                         yyextra->fullArgString+=yytext;
                                         }
 <RawString>\n                           {
-                                          *pCopyRawString+=yytext;
-                                         fullArgString+=yytext;
-                                          lineCount();
+                                          *yyextra->pCopyRawString+=yytext;
+                                         yyextra->fullArgString+=yytext;
+                                          lineCount(yyscanner);
                                         }
 <ReadInitializer>\"                    {
-                                         if (insideIDL && insideCppQuote)
+                                         if (yyextra->insideIDL && yyextra->insideCppQuote)
                                          {
                                            BEGIN(EndCppQuote);
                                          }
                                          else
                                          {
-                                            lastStringContext=YY_START;
-                                           current->initializer+=yytext; 
-                                           pCopyQuotedGString=&current->initializer;
+                                            yyextra->lastStringContext=YY_START;
+                                           yyextra->current->initializer+=yytext; 
+                                           yyextra->pCopyQuotedGString=&yyextra->current->initializer;
                                            BEGIN(CopyGString);
                                          }
                                        }
 <ReadInitializer>"->"                  {
-                                         current->initializer+=yytext; 
+                                         yyextra->current->initializer+=yytext; 
                                        }
 <ReadInitializer>"<<"                  {
-                                         current->initializer+=yytext; 
+                                         yyextra->current->initializer+=yytext; 
                                        }
 <ReadInitializer>">>"                  {
-                                         current->initializer+=yytext; 
+                                         yyextra->current->initializer+=yytext; 
                                        }
 <ReadInitializer>[<\[{(]               {
-                                         initBracketCount++;
-                                         current->initializer+=*yytext; 
+                                         yyextra->initBracketCount++;
+                                         yyextra->current->initializer+=*yytext; 
                                        }
 <ReadInitializer>[>\]})]               {
-                                         initBracketCount--;
-                                         current->initializer+=*yytext; 
+                                         yyextra->initBracketCount--;
+                                         yyextra->current->initializer+=*yytext; 
                                        }
 <ReadInitializer>\'                    {       
-                                         if (insidePHP)
+                                         if (yyextra->insidePHP)
                                          {
-                                           current->initializer+=yytext; 
-                                            pCopyQuotedGString = &current->initializer;
-                                            lastStringContext=YY_START;
+                                           yyextra->current->initializer+=yytext; 
+                                            yyextra->pCopyQuotedGString = &yyextra->current->initializer;
+                                            yyextra->lastStringContext=YY_START;
                                            BEGIN(CopyPHPGString);
                                          }
                                          else
                                          {
-                                           current->initializer+=yytext; 
+                                           yyextra->current->initializer+=yytext; 
                                          }
                                        }
 <ReadInitializer>{CHARLIT}              { 
-                                          if (insidePHP) 
+                                          if (yyextra->insidePHP) 
                                          {
                                            REJECT;
                                          }
                                          else
                                          {  
-                                           current->initializer+=yytext; 
+                                           yyextra->current->initializer+=yytext; 
                                          }
                                         } 
 <ReadInitializer>\n                    {
-                                         current->initializer+=*yytext;
-                                          lineCount();
+                                         yyextra->current->initializer+=*yytext;
+                                          lineCount(yyscanner);
                                        }
 <ReadInitializer>"@\""                 { 
-                                         //printf("insideCS=%d\n",insideCS);
-                                         current->initializer+=yytext;
-                                          if (!insideCS && !insideObjC) 
+                                         //printf("yyextra->insideCS=%d\n",yyextra->insideCS);
+                                         yyextra->current->initializer+=yytext;
+                                          if (!yyextra->insideCS && !yyextra->insideObjC) 
                                          {
                                            REJECT;
                                          }
                                          else
                                          {
                                            // C#/ObjC verbatim string
-                                           lastSkipVerbStringContext=YY_START;
-                                           pSkipVerbString=&current->initializer;
+                                           yyextra->lastSkipVerbStringContext=YY_START;
+                                           yyextra->pSkipVerbString=&yyextra->current->initializer;
                                            BEGIN(SkipVerbString);
                                          }
                                        }
 <SkipVerbString>[^\n"]+                        {
-                                         *pSkipVerbString+=yytext;
+                                         *yyextra->pSkipVerbString+=yytext;
                                        }
 <SkipVerbString>"\"\""                 { // quote escape
-                                         *pSkipVerbString+=yytext;
+                                         *yyextra->pSkipVerbString+=yytext;
                                        }
 <SkipVerbString>"\""                   {
-                                         *pSkipVerbString+=*yytext;
-                                         BEGIN(lastSkipVerbStringContext);
+                                         *yyextra->pSkipVerbString+=*yytext;
+                                         BEGIN(yyextra->lastSkipVerbStringContext);
                                        }
 <SkipVerbString>\n                     {
-                                         *pSkipVerbString+=*yytext;
-                                          lineCount();
+                                         *yyextra->pSkipVerbString+=*yytext;
+                                          lineCount(yyscanner);
                                        }
 <SkipVerbString>.                      {
-                                         *pSkipVerbString+=*yytext;
+                                         *yyextra->pSkipVerbString+=*yytext;
                                        }
 <ReadInitializer>"?>"                  {
-                                         if (insidePHP)
+                                         if (yyextra->insidePHP)
                                            BEGIN( FindMembersPHP );
                                          else
-                                           current->initializer+=yytext;
+                                           yyextra->current->initializer+=yytext;
                                        }
 <ReadInitializer>.                     { 
-                                         current->initializer+=*yytext; 
+                                         yyextra->current->initializer+=*yytext; 
                                        }
 
   /* generic quoted string copy rules */
 <CopyString,CopyPHPString>\\.          {
-                                         *pCopyQuotedString+=yytext;
+                                         *yyextra->pCopyQuotedString+=yytext;
                                        }
 <CopyString>\"                         { 
-                                         *pCopyQuotedString+=*yytext;
-                                         BEGIN( lastStringContext ); 
+                                         *yyextra->pCopyQuotedString+=*yytext;
+                                         BEGIN( yyextra->lastStringContext ); 
                                        }
 <CopyPHPString>\'                      { 
-                                         *pCopyQuotedString+=*yytext;
-                                         BEGIN( lastStringContext ); 
+                                         *yyextra->pCopyQuotedString+=*yytext;
+                                         BEGIN( yyextra->lastStringContext ); 
                                        }
 <CopyString,CopyPHPString>"/*"|"*/"|"//" {
-                                         *pCopyQuotedString+=yytext;
+                                         *yyextra->pCopyQuotedString+=yytext;
                                        }
 <CopyString,CopyPHPString>\n           {
-                                         *pCopyQuotedString+=*yytext;
-                                          lineCount();
+                                         *yyextra->pCopyQuotedString+=*yytext;
+                                          lineCount(yyscanner);
                                        }
 <CopyString,CopyPHPString>.            {
-                                         *pCopyQuotedString+=*yytext;
+                                         *yyextra->pCopyQuotedString+=*yytext;
                                        }
 
   /* generic quoted growable string copy rules */
 <CopyGString,CopyPHPGString>\\.                {
-                                         *pCopyQuotedGString+=yytext;
+                                         *yyextra->pCopyQuotedGString+=yytext;
                                        }
 <CopyGString>\"                                { 
-                                         *pCopyQuotedGString+=*yytext;
-                                         BEGIN( lastStringContext ); 
+                                         *yyextra->pCopyQuotedGString+=*yytext;
+                                         BEGIN( yyextra->lastStringContext ); 
                                        }
 <CopyPHPGString>\'                     { 
-                                         *pCopyQuotedGString+=*yytext;
-                                         BEGIN( lastStringContext ); 
+                                         *yyextra->pCopyQuotedGString+=*yytext;
+                                         BEGIN( yyextra->lastStringContext ); 
                                        }
 <CopyGString,CopyPHPGString>"<?php"    { // we had an odd number of quotes.
-                                         *pCopyQuotedGString += yytext;
-                                         BEGIN( lastStringContext ); 
+                                         *yyextra->pCopyQuotedGString += yytext;
+                                         BEGIN( yyextra->lastStringContext ); 
                                        }
 <CopyGString,CopyPHPGString>"/*"|"*/"|"//" {
-                                         *pCopyQuotedGString+=yytext;
+                                         *yyextra->pCopyQuotedGString+=yytext;
                                        }
 <CopyGString,CopyPHPGString>\n         {
-                                         *pCopyQuotedGString+=*yytext;
-                                          lineCount();
+                                         *yyextra->pCopyQuotedGString+=*yytext;
+                                          lineCount(yyscanner);
                                        }
 <CopyGString,CopyPHPGString>.          {
-                                         *pCopyQuotedGString+=*yytext;
+                                         *yyextra->pCopyQuotedGString+=*yytext;
                                        }
 
   /* generic round bracket list copy rules */
 <CopyRound>\"                          {
-                                         *pCopyRoundString+=*yytext;
-                                         pCopyQuotedString=pCopyRoundString;
-                                         lastStringContext=YY_START;
+                                         *yyextra->pCopyRoundString+=*yytext;
+                                         yyextra->pCopyQuotedString=yyextra->pCopyRoundString;
+                                         yyextra->lastStringContext=YY_START;
                                          BEGIN(CopyString);
                                        }
 <CopyRound>"("                         {
-                                         *pCopyRoundString+=*yytext;
-                                         roundCount++;
+                                         *yyextra->pCopyRoundString+=*yytext;
+                                         yyextra->roundCount++;
                                        }
 <CopyRound>")"                         {
-                                         *pCopyRoundString+=*yytext;
-                                         if (--roundCount<0)
-                                           BEGIN(lastRoundContext);
+                                         *yyextra->pCopyRoundString+=*yytext;
+                                         if (--yyextra->roundCount<0)
+                                           BEGIN(yyextra->lastRoundContext);
                                        }
 <CopyRound>\n                          {
-                                          lineCount();
-                                         *pCopyRoundString+=*yytext;
+                                          lineCount(yyscanner);
+                                         *yyextra->pCopyRoundString+=*yytext;
                                        }
 <CopyRound>\'                          {
-                                         if (insidePHP)
+                                         if (yyextra->insidePHP)
                                          {
-                                           current->initializer+=yytext; 
-                                            pCopyQuotedString = pCopyRoundString;
-                                            lastStringContext=YY_START;
+                                           yyextra->current->initializer+=yytext; 
+                                            yyextra->pCopyQuotedString = yyextra->pCopyRoundString;
+                                            yyextra->lastStringContext=YY_START;
                                            BEGIN(CopyPHPString);
                                          }
                                          else
                                          {
-                                           *pCopyRoundString+=yytext;
+                                           *yyextra->pCopyRoundString+=yytext;
                                          }
                                        }
 <CopyRound>{CHARLIT}                   { 
-                                          if (insidePHP)
+                                          if (yyextra->insidePHP)
                                          {
                                            REJECT;
                                          }
                                          else
                                          {
-                                            *pCopyRoundString+=yytext; 
+                                            *yyextra->pCopyRoundString+=yytext; 
                                          }
                                         }
 <CopyRound>[^"'()\n]+                  {
-                                         *pCopyRoundString+=yytext;
+                                         *yyextra->pCopyRoundString+=yytext;
                                        }
 <CopyRound>.                           {
-                                         *pCopyRoundString+=*yytext;
+                                         *yyextra->pCopyRoundString+=*yytext;
                                        }
 
   /* generic round bracket list copy rules for growable strings */
 <GCopyRound>\"                         {
-                                         *pCopyRoundGString+=*yytext;
-                                         pCopyQuotedGString=pCopyRoundGString;
-                                         lastStringContext=YY_START;
+                                         *yyextra->pCopyRoundGString+=*yytext;
+                                         yyextra->pCopyQuotedGString=yyextra->pCopyRoundGString;
+                                         yyextra->lastStringContext=YY_START;
                                          BEGIN(CopyGString);
                                        }
 <GCopyRound>"("                                {
-                                         *pCopyRoundGString+=*yytext;
-                                         roundCount++;
+                                         *yyextra->pCopyRoundGString+=*yytext;
+                                         yyextra->roundCount++;
                                        }
 <GCopyRound>")"                                {
-                                         *pCopyRoundGString+=*yytext;
-                                         if (--roundCount<0)
-                                           BEGIN(lastRoundContext);
+                                         *yyextra->pCopyRoundGString+=*yytext;
+                                         if (--yyextra->roundCount<0)
+                                           BEGIN(yyextra->lastRoundContext);
                                        }
 <GCopyRound>\n                         {
-                                          lineCount();
-                                         *pCopyRoundGString+=*yytext;
+                                          lineCount(yyscanner);
+                                         *yyextra->pCopyRoundGString+=*yytext;
                                        }
 <GCopyRound>\'                         {
-                                         if (insidePHP)
+                                         if (yyextra->insidePHP)
                                          {
-                                           current->initializer+=yytext; 
-                                            pCopyQuotedGString = pCopyRoundGString;
-                                            lastStringContext=YY_START;
+                                           yyextra->current->initializer+=yytext; 
+                                            yyextra->pCopyQuotedGString = yyextra->pCopyRoundGString;
+                                            yyextra->lastStringContext=YY_START;
                                            BEGIN(CopyPHPGString);
                                          }
                                          else
                                          {
-                                           *pCopyRoundGString+=yytext;
+                                           *yyextra->pCopyRoundGString+=yytext;
                                          }
                                        }
 <GCopyRound>{CHARLIT}                  { 
-                                          if (insidePHP)
+                                          if (yyextra->insidePHP)
                                          {
                                            REJECT;
                                          }
                                          else
                                          {
-                                            *pCopyRoundGString+=yytext; 
+                                            *yyextra->pCopyRoundGString+=yytext; 
                                          }
                                         }
 <GCopyRound>[^"'()\n/]+                        {
-                                         *pCopyRoundGString+=yytext;
+                                         *yyextra->pCopyRoundGString+=yytext;
                                        }
 <GCopyRound>.                          {
-                                         *pCopyRoundGString+=*yytext;
+                                         *yyextra->pCopyRoundGString+=*yytext;
                                        }
 
-  /* generic square bracket list copy rules for growable strings, we should only enter here in case of php, left the test part as in GCopyRound to keep it compatible with te round bracket version */
+  /* generic square bracket list copy rules for growable strings, we should only enter here in case of php, left the test part as in GCopyRound to keep it compatible with the round bracket version */
 <GCopySquare>\"                         {
-                                          *pCopySquareGString+=*yytext;
-                                            pCopyQuotedGString=pCopySquareGString;
-                                          lastStringContext=YY_START;
+                                          *yyextra->pCopySquareGString+=*yytext;
+                                            yyextra->pCopyQuotedGString=yyextra->pCopySquareGString;
+                                          yyextra->lastStringContext=YY_START;
                                           BEGIN(CopyGString);
                                         }
 <GCopySquare>"["                        {
-                                          *pCopySquareGString+=*yytext;
-                                          squareCount++;
+                                          *yyextra->pCopySquareGString+=*yytext;
+                                          yyextra->squareCount++;
                                         }
 <GCopySquare>"]"                        {
-                                          *pCopySquareGString+=*yytext;
-                                          if (--squareCount<0)
-                                          BEGIN(lastSquareContext);
+                                          *yyextra->pCopySquareGString+=*yytext;
+                                          if (--yyextra->squareCount<0)
+                                          BEGIN(yyextra->lastSquareContext);
                                         }
 <GCopySquare>\n                         {
-                                          lineCount();
-                                          *pCopySquareGString+=*yytext;
+                                          lineCount(yyscanner);
+                                          *yyextra->pCopySquareGString+=*yytext;
                                         }
 <GCopySquare>\'                         {
-                                          if (insidePHP)
+                                          if (yyextra->insidePHP)
                                           {
-                                            current->initializer+=yytext; 
-                                            pCopyQuotedGString = pCopySquareGString;
-                                            lastStringContext=YY_START;
+                                            yyextra->current->initializer+=yytext; 
+                                            yyextra->pCopyQuotedGString = yyextra->pCopySquareGString;
+                                            yyextra->lastStringContext=YY_START;
                                             BEGIN(CopyPHPGString);
                                           }
                                           else
                                           {
-                                            *pCopySquareGString+=yytext;
+                                            *yyextra->pCopySquareGString+=yytext;
                                           }
                                         }
 <GCopySquare>{CHARLIT}                  { 
-                                          if (insidePHP)
+                                          if (yyextra->insidePHP)
                                           {
                                             REJECT;
                                           }
                                           else
                                           {
-                                            *pCopySquareGString+=yytext; 
+                                            *yyextra->pCopySquareGString+=yytext; 
                                           }
                                         }
 <GCopySquare>[^"\[\]\n/]+               {
-                                          *pCopySquareGString+=yytext;
+                                          *yyextra->pCopySquareGString+=yytext;
                                         }
 <GCopySquare>.                          {
-                                          *pCopySquareGString+=*yytext;
+                                          *yyextra->pCopySquareGString+=*yytext;
                                         }
 
   /* generic curly bracket list copy rules */
 <CopyCurly>\"                          {
-                                         *pCopyCurlyString+=*yytext;
-                                         pCopyQuotedString=pCopyCurlyString;
-                                         lastStringContext=YY_START;
+                                         *yyextra->pCopyCurlyString+=*yytext;
+                                         yyextra->pCopyQuotedString=yyextra->pCopyCurlyString;
+                                         yyextra->lastStringContext=YY_START;
                                          BEGIN(CopyString);
                                        }
 <CopyCurly>\'                          {
-                                         *pCopyCurlyString+=*yytext;
-                                         if (insidePHP)
+                                         *yyextra->pCopyCurlyString+=*yytext;
+                                         if (yyextra->insidePHP)
                                          {
-                                           pCopyQuotedString=pCopyCurlyString;
-                                           lastStringContext=YY_START;
+                                           yyextra->pCopyQuotedString=yyextra->pCopyCurlyString;
+                                           yyextra->lastStringContext=YY_START;
                                            BEGIN(CopyPHPString);
                                          }
                                        }
 <CopyCurly>"{"                         {
-                                         *pCopyCurlyString+=*yytext;
-                                         curlyCount++;
+                                         *yyextra->pCopyCurlyString+=*yytext;
+                                         yyextra->curlyCount++;
                                        }
 <CopyCurly>"}"                         {
-                                         *pCopyCurlyString+=*yytext;
-                                         if (--curlyCount<0)
-                                           BEGIN(lastCurlyContext); 
+                                         *yyextra->pCopyCurlyString+=*yytext;
+                                         if (--yyextra->curlyCount<0)
+                                           BEGIN(yyextra->lastCurlyContext); 
                                        }
-<CopyCurly>{CHARLIT}                    { if (insidePHP) 
+<CopyCurly>{CHARLIT}                    { if (yyextra->insidePHP) 
                                           { 
                                            REJECT; 
                                          } 
                                          else 
                                          {
-                                           *pCopyCurlyString+=yytext; 
+                                           *yyextra->pCopyCurlyString+=yytext; 
                                          }
                                         }
 <CopyCurly>[^"'{}\/\n]+                        {
-                                         *pCopyCurlyString+=yytext;
+                                         *yyextra->pCopyCurlyString+=yytext;
                                        }
-<CopyCurly>"/"                         { *pCopyCurlyString+=yytext; }
+<CopyCurly>"/"                         { *yyextra->pCopyCurlyString+=yytext; }
 <CopyCurly>\n                          {
-                                          lineCount();
-                                         *pCopyCurlyString+=*yytext;
+                                          lineCount(yyscanner);
+                                         *yyextra->pCopyCurlyString+=*yytext;
                                        }
 <CopyCurly>.                           {
-                                         *pCopyCurlyString+=*yytext;
+                                         *yyextra->pCopyCurlyString+=*yytext;
                                        }
 
   /* generic curly bracket list copy rules for growable strings */
@@ -3389,459 +3015,444 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                          QCString line = QCString(yytext);
                                          int s = line.find(' ');
                                          int e = line.find('"',s);
-                                         yyLineNr = line.mid(s,e-s).toInt();
+                                         yyextra->yyLineNr = line.mid(s,e-s).toInt();
                                          if (yytext[yyleng-1]=='\n')
                                          {
-                                            lineCount();
-                                            g_column=0;
+                                            lineCount(yyscanner);
+                                            yyextra->column=0;
                                          }
                                        }
 <GCopyCurly>\"                         {
-                                         *pCopyCurlyGString+=*yytext;
-                                         pCopyQuotedGString=pCopyCurlyGString;
-                                         lastStringContext=YY_START;
+                                         *yyextra->pCopyCurlyGString+=*yytext;
+                                         yyextra->pCopyQuotedGString=yyextra->pCopyCurlyGString;
+                                         yyextra->lastStringContext=YY_START;
                                          BEGIN(CopyGString);
                                        }
 <GCopyCurly>\'                         {
-                                         *pCopyCurlyGString+=*yytext;
-                                         if (insidePHP)
+                                         *yyextra->pCopyCurlyGString+=*yytext;
+                                         if (yyextra->insidePHP)
                                          {
-                                           pCopyQuotedGString=pCopyCurlyGString;
-                                           lastStringContext=YY_START;
+                                           yyextra->pCopyQuotedGString=yyextra->pCopyCurlyGString;
+                                           yyextra->lastStringContext=YY_START;
                                            BEGIN(CopyPHPGString);
                                          }
                                        }
 <GCopyCurly>"{"                                {
-                                         *pCopyCurlyGString+=*yytext;
-                                         curlyCount++;
+                                         *yyextra->pCopyCurlyGString+=*yytext;
+                                         yyextra->curlyCount++;
                                        }
 <GCopyCurly>"}"                                {
-                                         *pCopyCurlyGString+=*yytext;
-                                         if (--curlyCount<0)
-                                           BEGIN(lastCurlyContext); 
+                                         *yyextra->pCopyCurlyGString+=*yytext;
+                                         if (--yyextra->curlyCount<0)
+                                           BEGIN(yyextra->lastCurlyContext); 
                                        }
-<GCopyCurly>{CHARLIT}                    { if (insidePHP) 
+<GCopyCurly>{CHARLIT}                    { if (yyextra->insidePHP) 
                                           { 
                                            REJECT; 
                                          } 
                                          else 
                                          {
-                                           *pCopyCurlyGString+=yytext; 
+                                           *yyextra->pCopyCurlyGString+=yytext; 
                                          }
                                         }
 <GCopyCurly>[^"'{}\/\n,]+              {
-                                         *pCopyCurlyGString+=yytext;
+                                         *yyextra->pCopyCurlyGString+=yytext;
                                        }
 <GCopyCurly>[,]+                       {
-                                         *pCopyCurlyGString+=yytext;
+                                         *yyextra->pCopyCurlyGString+=yytext;
                                        }
-<GCopyCurly>"/"                                { *pCopyCurlyGString+=yytext; }
+<GCopyCurly>"/"                                { *yyextra->pCopyCurlyGString+=yytext; }
 <GCopyCurly>\n                         {
-                                          lineCount();
-                                         *pCopyCurlyGString+=*yytext;
+                                          lineCount(yyscanner);
+                                         *yyextra->pCopyCurlyGString+=*yytext;
                                        }
 <GCopyCurly>.                          {
-                                         *pCopyCurlyGString+=*yytext;
+                                         *yyextra->pCopyCurlyGString+=*yytext;
                                        }
 
   /* ---------------------- */
 
 
 <FindMembers>":"                       {
-                                         if (current->type.isEmpty() &&
-                                              current->name=="enum") // see bug 69041, C++11 style anon enum: 'enum : unsigned int {...}'
+                                         if (yyextra->current->type.isEmpty() &&
+                                              yyextra->current->name=="enum") // see bug 69041, C++11 style anon enum: 'enum : unsigned int {...}'
                                          {
-                                            current->section=Entry::ENUM_SEC;
-                                           current->name.resize(0);
-                                            current->args.resize(0);
+                                            yyextra->current->section=Entry::ENUM_SEC;
+                                           yyextra->current->name.resize(0);
+                                            yyextra->current->args.resize(0);
                                            BEGIN(EnumBaseType);
                                          }
                                           else 
                                           {
-                                            if (current->type.isEmpty()) // anonymous padding field, e.g. "int :7;"
+                                            if (yyextra->current->type.isEmpty()) // anonymous padding field, e.g. "int :7;"
                                            {
-                                              addType(current);
-                                             current->name.sprintf("__pad%d__",padCount++);
+                                             addType(yyscanner);
+                                             yyextra->current->name.sprintf("__pad%d__",yyextra->padCount++);
                                            }
                                            BEGIN(BitFields);
-                                           current->bitfields+=":";
+                                           yyextra->current->bitfields+=":";
                                           }
                                        }
 <BitFields>.                           {
-                                         current->bitfields+=*yytext;
+                                         yyextra->current->bitfields+=*yytext;
                                        }
 <EnumBaseType>.                                {
-                                         current->args+=*yytext;
+                                         yyextra->current->args+=*yytext;
                                        }
 <EnumBaseType>\n                       {
-                                          lineCount();
-                                         current->args+=' ';
+                                          lineCount(yyscanner);
+                                         yyextra->current->args+=' ';
                                        }
 <FindMembers>[;,]                      { 
-                                         QCString oldType = current->type;
-                                         if (current->bodyLine==-1)
+                                         QCString oldType = yyextra->current->type;
+                                         if (yyextra->current->bodyLine==-1)
                                          {
-                                           current->bodyLine = yyLineNr;
+                                           yyextra->current->bodyLine = yyextra->yyLineNr;
                                          }
-                                          if ( insidePHP && current->type.left(3) == "var" )
+                                          if ( yyextra->insidePHP && yyextra->current->type.left(3) == "var" )
                                           {
-                                            current->type = current->type.mid(3);
+                                            yyextra->current->type = yyextra->current->type.mid(3);
                                           }
-                                         if (isTypedef && current->type.left(8)!="typedef ")
+                                         if (yyextra->isTypedef && yyextra->current->type.left(8)!="typedef ")
                                          {
-                                           current->type.prepend("typedef ");
+                                           yyextra->current->type.prepend("typedef ");
                                          }
-                                         bool needNewCurrent=FALSE;
-                                         if (!current->name.isEmpty() && current->section!=Entry::ENUM_SEC)
+                                         bool stat = yyextra->current->stat;
+                                         if (!yyextra->current->name.isEmpty() && yyextra->current->section!=Entry::ENUM_SEC)
                                          {
-                                           current->type=current->type.simplifyWhiteSpace();
-                                           current->args=removeRedundantWhiteSpace(current->args);
-                                           current->name=current->name.stripWhiteSpace();
-                                           if (current->section==Entry::CLASS_SEC) // remove spec for "struct Bla bla;"
+                                           yyextra->current->type=yyextra->current->type.simplifyWhiteSpace();
+                                           yyextra->current->args=removeRedundantWhiteSpace(yyextra->current->args);
+                                           yyextra->current->name=yyextra->current->name.stripWhiteSpace();
+                                           if (yyextra->current->section==Entry::CLASS_SEC) // remove spec for "struct Bla bla;"
                                            {
-                                               current->spec = 0;
+                                               yyextra->current->spec = 0;
                                            }
-                                           current->section = Entry::VARIABLE_SEC ;
-                                           current->fileName = yyFileName;
-                                           current->startLine = yyBegLineNr;
-                                           current->startColumn = yyBegColNr;
-                                           current_root->addSubEntry( current ) ;
-                                           needNewCurrent=TRUE;
+                                           yyextra->current->section = Entry::VARIABLE_SEC ;
+                                           yyextra->current->fileName = yyextra->yyFileName;
+                                           yyextra->current->startLine = yyextra->yyBegLineNr;
+                                           yyextra->current->startColumn = yyextra->yyBegColNr;
+                                           yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
+                                            initEntry(yyscanner);
                                          }
                                          if ( *yytext == ',')
                                          {
-                                           bool stat = current->stat;
-                                           if (needNewCurrent)
-                                           {
-                                             current = new Entry(*current);
-                                             initEntry();
-                                           }
-                                           current->stat = stat; // the static attribute holds for all variables
-                                           current->name.resize(0);
-                                           current->args.resize(0);
-                                           current->brief.resize(0);
-                                           current->doc.resize(0);
-                                           current->initializer.resize(0);
-                                           current->bitfields.resize(0);
+                                           yyextra->current->stat = stat; // the static attribute holds for all variables
+                                           yyextra->current->name.resize(0);
+                                           yyextra->current->args.resize(0);
+                                           yyextra->current->brief.resize(0);
+                                           yyextra->current->doc.resize(0);
+                                           yyextra->current->initializer.resize(0);
+                                           yyextra->current->bitfields.resize(0);
                                            int i=oldType.length(); 
                                            while (i>0 && (oldType[i-1]=='*' || oldType[i-1]=='&' || oldType[i-1]==' ')) i--;
-                                           current->type = oldType.left(i);
+                                           yyextra->current->type = oldType.left(i);
                                          }
                                          else
                                          {
-                                            mtype = Method;
-                                            virt = Normal;
-                                           if (needNewCurrent)
-                                           {
-                                             current = new Entry ;
-                                           }
-                                           else if (current->groups)
-                                           {
-                                             current->groups->clear();
-                                           }
-                                           initEntry();
+                                            yyextra->mtype = Method;
+                                            yyextra->virt = Normal;
+                                           yyextra->current->groups.clear();
+                                           initEntry(yyscanner);
                                          }
                                        }
 
 <FindMembers>"["                       { 
-                                          if (insideSlice)
+                                          if (yyextra->insideSlice)
                                           {
-                                           squareCount=1;
-                                            lastSquareContext = YY_START;
-                                            current->metaData += "[";
+                                           yyextra->squareCount=1;
+                                            yyextra->lastSquareContext = YY_START;
+                                            yyextra->current->metaData += "[";
                                             BEGIN( SliceMetadata );
                                           }
-                                          else if (!insideCS &&  
-                                             (current->name.isEmpty() || 
-                                              current->name=="typedef"
+                                          else if (!yyextra->insideCS &&  
+                                             (yyextra->current->name.isEmpty() || 
+                                              yyextra->current->name=="typedef"
                                              )
                                             ) // IDL function property
                                          {
-                                           squareCount=1;
-                                           lastSquareContext = YY_START;
-                                           idlAttr.resize(0);
-                                           idlProp.resize(0);
-                                           current->mtype = mtype;
+                                           yyextra->squareCount=1;
+                                           yyextra->lastSquareContext = YY_START;
+                                           yyextra->idlAttr.resize(0);
+                                           yyextra->idlProp.resize(0);
+                                           yyextra->current->mtype = yyextra->mtype;
 
                                            if (Config_getBool(IDL_PROPERTY_SUPPORT) &&
-                                                current->mtype == Property)
-                                           { // we are inside the properties section of a dispinterface
-                                             odlProp = true;
-                                             current->spec |= Entry::Gettable;
-                                             current->spec |= Entry::Settable;
+                                                yyextra->current->mtype == Property)
+                                           { // we are yyextra->inside the properties section of a dispinterface
+                                             yyextra->odlProp = true;
+                                             yyextra->current->spec |= Entry::Gettable;
+                                             yyextra->current->spec |= Entry::Settable;
                                            }
 
                                            BEGIN( IDLAttribute );
                                          }
-                                          else if (insideCS &&
-                                                  current->name.isEmpty())
+                                          else if (yyextra->insideCS &&
+                                                  yyextra->current->name.isEmpty())
                                           {
-                                            squareCount=1;
-                                            lastSquareContext = YY_START;
+                                            yyextra->squareCount=1;
+                                            yyextra->lastSquareContext = YY_START;
                                             // Skip the C# attribute
                                             // for this member
-                                            current->args.resize(0);
+                                            yyextra->current->args.resize(0);
                                             BEGIN( SkipSquare );
                                           }
                                          else
                                          {
-                                           current->args += yytext ;
-                                           squareCount=1;
-                                           externC=FALSE; // see bug759247
+                                           yyextra->current->args += yytext ;
+                                           yyextra->squareCount=1;
+                                           yyextra->externC=FALSE; // see bug759247
                                            BEGIN( Array ) ;
                                          }
                                        }
 <SliceMetadata>"["                      { // Global metadata.
-                                         squareCount++;
-                                          current->metaData += "[";
+                                         yyextra->squareCount++;
+                                          yyextra->current->metaData += "[";
                                         }
 <SliceMetadata>{BN}*                    {
-                                         lineCount();
+                                         lineCount(yyscanner);
                                         }
 <SliceMetadata>\"[^\"]*\"               {
-                                          current->metaData += yytext;
+                                          yyextra->current->metaData += yytext;
                                         }
 <SliceMetadata>","                      {
-                                          current->metaData += yytext;
+                                          yyextra->current->metaData += yytext;
                                         }
 <SliceMetadata>"]"                      {
-                                          current->metaData += yytext;
-                                          if (--squareCount<=0)
+                                          yyextra->current->metaData += yytext;
+                                          if (--yyextra->squareCount<=0)
                                           {
-                                            BEGIN (lastSquareContext);
+                                            BEGIN (yyextra->lastSquareContext);
                                           }
                                         }
 <SliceOptional>"("                      {
-                                          current->type += "(";
-                                          roundCount++;
+                                          yyextra->current->type += "(";
+                                          yyextra->roundCount++;
                                         }
 <SliceOptional>[0-9]+                   {
-                                          current->type += yytext;
+                                          yyextra->current->type += yytext;
                                         }
 <SliceOptional>")"                      {
-                                          current->type += ")";
-                                          if(--roundCount<=0)
+                                          yyextra->current->type += ")";
+                                          if(--yyextra->roundCount<=0)
                                           {
-                                            BEGIN (lastModifierContext);
+                                            BEGIN (yyextra->lastModifierContext);
                                           }
                                         }
 <IDLAttribute>"]"                      {
                                          // end of IDL function attribute
-                                         if (--squareCount<=0)
+                                         if (--yyextra->squareCount<=0)
                                          {
-                                           lineCount();
-                                           if (current->mtype == Property)
+                                           lineCount(yyscanner);
+                                           if (yyextra->current->mtype == Property)
                                              BEGIN( IDLPropName );
                                            else
-                                             BEGIN( lastSquareContext );
+                                             BEGIN( yyextra->lastSquareContext );
                                          }
                                        }
 <IDLAttribute>"propput"                        {
                                           if (Config_getBool(IDL_PROPERTY_SUPPORT))
                                          {
-                                           current->mtype = Property;
+                                           yyextra->current->mtype = Property;
                                          }
-                                         current->spec |= Entry::Settable;
+                                         yyextra->current->spec |= Entry::Settable;
                                        }
 <IDLAttribute>"propget"                {
                                           if (Config_getBool(IDL_PROPERTY_SUPPORT))
                                          {
-                                           current->mtype = Property;
+                                           yyextra->current->mtype = Property;
                                          }
-                                         current->spec |= Entry::Gettable;
+                                         yyextra->current->spec |= Entry::Gettable;
                                        }
 <IDLAttribute>"property" { // UNO IDL property
-                                         current->spec |= Entry::Property;
+                                         yyextra->current->spec |= Entry::Property;
                                        }
 <IDLAttribute>"attribute" { // UNO IDL attribute
-                                         current->spec |= Entry::Attribute;
+                                         yyextra->current->spec |= Entry::Attribute;
                                        }
 <IDLAttribute>"optional" { // on UNO IDL interface/service/attribute/property
-                           current->spec |= Entry::Optional;
+                           yyextra->current->spec |= Entry::Optional;
                          }
 <IDLAttribute>"readonly" { // on UNO IDL attribute or property
-                                         if (Config_getBool(IDL_PROPERTY_SUPPORT) && odlProp)
+                                         if (Config_getBool(IDL_PROPERTY_SUPPORT) && yyextra->odlProp)
                                          {
-                                           current->spec ^= Entry::Settable;
+                                           yyextra->current->spec ^= Entry::Settable;
                                          }
                                          else
                                          {
-                                           current->spec |= Entry::Readonly;
+                                           yyextra->current->spec |= Entry::Readonly;
                                          }
                                        }
 <IDLAttribute>"bound" { // on UNO IDL attribute or property
-                                         current->spec |= Entry::Bound;
+                                         yyextra->current->spec |= Entry::Bound;
                                        }
 <IDLAttribute>"removable" { // on UNO IDL property
-                                         current->spec |= Entry::Removable;
+                                         yyextra->current->spec |= Entry::Removable;
                                        }
 <IDLAttribute>"constrained" { // on UNO IDL property
-                                         current->spec |= Entry::Constrained;
+                                         yyextra->current->spec |= Entry::Constrained;
                                        }
 <IDLAttribute>"transient" { // on UNO IDL property
-                                         current->spec |= Entry::Transient;
+                                         yyextra->current->spec |= Entry::Transient;
                                        }
 <IDLAttribute>"maybevoid" { // on UNO IDL property
-                                         current->spec |= Entry::MaybeVoid;
+                                         yyextra->current->spec |= Entry::MaybeVoid;
                                        }
 <IDLAttribute>"maybedefault" { // on UNO IDL property
-                                         current->spec |= Entry::MaybeDefault;
+                                         yyextra->current->spec |= Entry::MaybeDefault;
                                        }
 <IDLAttribute>"maybeambiguous" { // on UNO IDL property
-                                         current->spec |= Entry::MaybeAmbiguous;
+                                         yyextra->current->spec |= Entry::MaybeAmbiguous;
                                        }
 <IDLAttribute>.                                {
                                        }
 <IDLPropName>{BN}*{ID}{BN}*            {
                                          // return type (probably HRESULT) - skip it
 
-                                         if (odlProp)
+                                         if (yyextra->odlProp)
                                          { // property type
-                                           idlProp = yytext;
+                                           yyextra->idlProp = yytext;
                                          }
                                        }
 <IDLPropName>{ID}{BN}*"("              {
-                                         current->name = yytext;
-                                         current->name = current->name.left(current->name.length()-1).stripWhiteSpace();
-                                         current->startLine = yyLineNr;
-                                         current->startColumn = yyColNr;
+                                         yyextra->current->name = yytext;
+                                         yyextra->current->name = yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
+                                         yyextra->current->startLine = yyextra->yyLineNr;
+                                         yyextra->current->startColumn = yyextra->yyColNr;
                                          BEGIN( IDLProp );
                                        }
 <IDLPropName>{BN}*"("{BN}*{ID}{BN}*")"{BN}*    {
-                                          if (odlProp)
+                                          if (yyextra->odlProp)
                                           {
-                                            idlProp += yytext;
+                                            yyextra->idlProp += yytext;
                                           }
                                        }
 <IDLPropName>{ID}{BN}*/";"             {
-                                          if (odlProp)
+                                          if (yyextra->odlProp)
                                           {
-                                            current->name = yytext;
-                                            idlProp = idlProp.stripWhiteSpace();
-                                            odlProp = false;
+                                            yyextra->current->name = yytext;
+                                            yyextra->idlProp = yyextra->idlProp.stripWhiteSpace();
+                                            yyextra->odlProp = false;
 
                                             BEGIN( IDLProp );
                                           }
                                        }
 <IDLProp>{BN}*"["[^\]]*"]"{BN}*                {  // attribute of a parameter
-                                          idlAttr = yytext;
-                                          idlAttr=idlAttr.stripWhiteSpace();
+                                          yyextra->idlAttr = yytext;
+                                          yyextra->idlAttr=yyextra->idlAttr.stripWhiteSpace();
                                        }
 <IDLProp>{ID}                          {  // property type
-                                          idlProp = yytext;
+                                          yyextra->idlProp = yytext;
                                        }
 <IDLProp>{BN}*{ID}{BN}*","             {  // Rare: Another parameter ([propput] HRESULT Item(int index, [in] Type theRealProperty);)
-                                         if (!current->args)
-                                           current->args = "(";
+                                         if (!yyextra->current->args)
+                                           yyextra->current->args = "(";
                                          else
-                                           current->args += ", ";
-                                         current->args += idlAttr;
-                                         current->args += " ";
-                                         current->args += idlProp;     // prop was actually type of extra parameter
-                                         current->args += " ";
-                                         current->args += yytext;
-                                         current->args = current->args.left(current->args.length() - 1);       // strip comma
-                                         idlProp.resize(0);
-                                         idlAttr.resize(0);
+                                           yyextra->current->args += ", ";
+                                         yyextra->current->args += yyextra->idlAttr;
+                                         yyextra->current->args += " ";
+                                         yyextra->current->args += yyextra->idlProp;   // prop was actually type of extra parameter
+                                         yyextra->current->args += " ";
+                                         yyextra->current->args += yytext;
+                                         yyextra->current->args = yyextra->current->args.left(yyextra->current->args.length() - 1);    // strip comma
+                                         yyextra->idlProp.resize(0);
+                                         yyextra->idlAttr.resize(0);
                                          BEGIN( IDLProp );
                                        }
 <IDLProp>{BN}*{ID}{BN}*")"{BN}*                {
                                          // the parameter name for the property - just skip.
                                        }
 <IDLProp>";"                           {
-                                         current->fileName   = yyFileName;
-                                         current->type         = idlProp;
-                                         current->args       = current->args.simplifyWhiteSpace();
-                                         if (current->args)
-                                           current->args += ")";
-                                         current->name       = current->name.stripWhiteSpace();
-                                         current->section    = Entry::VARIABLE_SEC;
-                                         current_root->addSubEntry(current);
-                                         current             = new Entry;
-                                         initEntry();
+                                         yyextra->current->fileName   = yyextra->yyFileName;
+                                         yyextra->current->type                = yyextra->idlProp;
+                                         yyextra->current->args       = yyextra->current->args.simplifyWhiteSpace();
+                                         if (yyextra->current->args)
+                                           yyextra->current->args += ")";
+                                         yyextra->current->name       = yyextra->current->name.stripWhiteSpace();
+                                         yyextra->current->section    = Entry::VARIABLE_SEC;
+                                         yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
+                                         initEntry(yyscanner);
                                          BEGIN( FindMembers );
                                        }
 <IDLProp>.                             { // spaces, *, or other stuff
-                                         //idlProp+=yytext;
+                                         //yyextra->idlProp+=yytext;
                                        }
-<Array>"]"                             { current->args += *yytext ;
-                                         if (--squareCount<=0)
+<Array>"]"                             { yyextra->current->args += *yytext ;
+                                         if (--yyextra->squareCount<=0)
                                             BEGIN( FindMembers ) ;
                                        }
-<FuncFuncArray>"]"                     { current->args += *yytext ;
-                                         if (--squareCount<=0)
+<FuncFuncArray>"]"                     { yyextra->current->args += *yytext ;
+                                         if (--yyextra->squareCount<=0)
                                             BEGIN( Function ) ;
                                        }
-<Array,FuncFuncArray>"["               { current->args += *yytext ;
-                                         squareCount++;        
+<Array,FuncFuncArray>"["               { yyextra->current->args += *yytext ;
+                                         yyextra->squareCount++;       
                                        }
-<Array,FuncFuncArray>.                 { current->args += *yytext ; }
-<SkipSquare>"["                                { squareCount++; }
+<Array,FuncFuncArray>.                 { yyextra->current->args += *yytext ; }
+<SkipSquare>"["                                { yyextra->squareCount++; }
 <SkipSquare>"]"                                {
-                                         if (--squareCount<=0)
-                                           BEGIN( lastSquareContext );
+                                         if (--yyextra->squareCount<=0)
+                                           BEGIN( yyextra->lastSquareContext );
                                        }
 <SkipSquare>\"                         {
-                                         lastStringContext=YY_START;
+                                         yyextra->lastStringContext=YY_START;
                                          BEGIN( SkipString ); 
                                        }
 <SkipSquare>[^\n\[\]\"]+
-<FindMembers>"<"                       { addType( current ) ;
-                                         current->type += yytext ;
+<FindMembers>"<"                       { addType(yyscanner);
+                                         yyextra->current->type += yytext ;
                                          BEGIN( Sharp ) ;
                                        }
-<Sharp>">"                             { current->type += *yytext ;
-                                         if (--sharpCount<=0)
+<Sharp>">"                             { yyextra->current->type += *yytext ;
+                                         if (--yyextra->sharpCount<=0)
                                             BEGIN( FindMembers ) ;
                                        }
-<Sharp>"<"                             { current->type += *yytext ;
-                                         sharpCount++; 
+<Sharp>"<"                             { yyextra->current->type += *yytext ;
+                                         yyextra->sharpCount++;        
                                        }
 <Sharp>{BN}+                           {
-                                          current->type += ' ';
-                                         lineCount();
+                                          yyextra->current->type += ' ';
+                                         lineCount(yyscanner);
                                        }
-<Sharp>.                               { current->type += *yytext ; }
+<Sharp>.                               { yyextra->current->type += *yytext ; }
 <FindFields>{ID}                       {
-                                          if (insideCpp || insideObjC) 
+                                          if (yyextra->insideCpp || yyextra->insideObjC) 
                                           {
-                                            current->id = ClangParser::instance()->lookup(yyLineNr,yytext);
+                                            yyextra->current->id = ClangParser::instance()->lookup(yyextra->yyLineNr,yytext);
                                           }
-                                         current->bodyLine = yyLineNr;
-                                         current->name     = yytext;
+                                         yyextra->current->bodyLine = yyextra->yyLineNr;
+                                         yyextra->current->name     = yytext;
                                        }
 <FindFields>"("                                {
                                          // Java enum initializer
                                          unput('(');
-                                         lastInitializerContext = YY_START;
-                                         initBracketCount=0;
-                                          current->initializer = "=";
+                                         yyextra->lastInitializerContext = YY_START;
+                                         yyextra->initBracketCount=0;
+                                          yyextra->current->initializer = "=";
                                          BEGIN(ReadInitializer);
                                        }
 <FindFields>"="                                {
-                                         lastInitializerContext = YY_START;
-                                         initBracketCount=0;
-                                          current->initializer = yytext;
+                                         yyextra->lastInitializerContext = YY_START;
+                                         yyextra->initBracketCount=0;
+                                          yyextra->current->initializer = yytext;
                                          BEGIN(ReadInitializer);
                                        }
 <FindFields>";"                         {
-                                         if (insideJava)  // last enum field in Java class
+                                         if (yyextra->insideJava)  // yyextra->last enum field in Java class
                                          {
-                                           if (!current->name.isEmpty())
+                                           if (!yyextra->current->name.isEmpty())
                                            {
-                                             current->fileName   = yyFileName;
-                                             current->startLine  = yyLineNr;
-                                             current->startColumn = yyColNr;
-                                             if (!(current_root->spec&Entry::Enum))
+                                             yyextra->current->fileName   = yyextra->yyFileName;
+                                             yyextra->current->startLine  = yyextra->yyLineNr;
+                                             yyextra->current->startColumn = yyextra->yyColNr;
+                                             if (!(yyextra->current_root->spec&Entry::Enum))
                                              {
-                                               current->type       = "@"; // enum marker
+                                               yyextra->current->type       = "@"; // enum marker
                                              }
-                                             current->args       = current->args.simplifyWhiteSpace();
-                                             current->name       = current->name.stripWhiteSpace();
-                                             current->section    = Entry::VARIABLE_SEC;
-                                             current_root->addSubEntry(current);
-                                             current             = new Entry ;
-                                             initEntry();
+                                             yyextra->current->args       = yyextra->current->args.simplifyWhiteSpace();
+                                             yyextra->current->name       = yyextra->current->name.stripWhiteSpace();
+                                             yyextra->current->section    = Entry::VARIABLE_SEC;
+                                             yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
+                                             initEntry(yyscanner);
                                            }
 
                                            BEGIN( FindMembers );
@@ -3852,70 +3463,70 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                          }
                                        }
 <SkipRemainder>\n                      { 
-                                          lineCount();
+                                          lineCount(yyscanner);
                                         }
 <SkipRemainder>[^\n]*
 <FindFields>","                                {
                                          //printf("adding '%s' '%s' '%s' to enum '%s' (mGrpId=%d)\n",
-                                         //     current->type.data(), current->name.data(),
-                                         //     current->args.data(), current_root->name.data(),current->mGrpId);
-                                         if (!current->name.isEmpty())
-                                         {
-                                           current->fileName   = yyFileName;
-                                           current->startLine  = yyLineNr;
-                                           current->startColumn = yyColNr;
-                                           if (!(current_root->spec&Entry::Enum))
+                                         //     yyextra->current->type.data(), yyextra->current->name.data(),
+                                         //     yyextra->current->args.data(), yyextra->current_root->name.data(),yyextra->current->mGrpId);
+                                         if (!yyextra->current->name.isEmpty())
+                                         {
+                                           yyextra->current->fileName   = yyextra->yyFileName;
+                                           yyextra->current->startLine  = yyextra->yyLineNr;
+                                           yyextra->current->startColumn = yyextra->yyColNr;
+                                           if (!(yyextra->current_root->spec&Entry::Enum))
                                            {
-                                             current->type       = "@"; // enum marker
+                                             yyextra->current->type       = "@"; // enum marker
                                            }
-                                           current->args       = current->args.simplifyWhiteSpace();
-                                           current->name       = current->name.stripWhiteSpace();
-                                           current->section    = Entry::VARIABLE_SEC;
+                                           yyextra->current->args       = yyextra->current->args.simplifyWhiteSpace();
+                                           yyextra->current->name       = yyextra->current->name.stripWhiteSpace();
+                                           yyextra->current->section    = Entry::VARIABLE_SEC;
                                            // add to the scope of the enum
-                                           current_root->addSubEntry(current);
-                                           if (!insideCS && !insideJava &&
-                                                !(current_root->spec&Entry::Strong)) 
+                                           if (!yyextra->insideCS && !yyextra->insideJava &&
+                                                !(yyextra->current_root->spec&Entry::Strong)) 
                                                 // for C# and Java 1.5+ enum values always have to be explicitly qualified,
                                                 // same for C++11 style enums (enum class Name {})
                                            {
-                                             current             = new Entry(*current);
                                              // add to the scope surrounding the enum (copy!)
-                                             current_root->parent()->addSubEntry(current);
+                                              // we cannot during it directly as that would invalidate the iterator in parseCompounds.
+                                              //printf("*** adding outer scope entry for %s\n",yyextra->current->name.data());
+                                              yyextra->outerScopeEntries.emplace_back(yyextra->current_root->parent(), std::make_shared<Entry>(*yyextra->current));
                                            }
-                                           current             = new Entry ;
-                                           initEntry();
+                                           yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
+                                           initEntry(yyscanner);
                                          }
                                          else // probably a redundant , 
                                          {
-                                           current->reset();
-                                           initEntry();
+                                           yyextra->current->reset();
+                                           initEntry(yyscanner);
                                          }
                                        }
 <FindFields>"["                                { // attribute list in IDL
-                                         squareCount=1;
-                                         lastSquareContext = YY_START;
+                                         yyextra->squareCount=1;
+                                         yyextra->lastSquareContext = YY_START;
                                          BEGIN(SkipSquare);
                                        }
   /*
 <FindFieldArg>","                      { unput(*yytext); BEGIN(FindFields); }
   */
-<ReadBody,ReadNSBody,ReadBodyIntf>[^\r\n\#{}"@'/<]*    { current->program += yytext ; }
-<ReadBody,ReadNSBody,ReadBodyIntf>"//".*               { current->program += yytext ; }
-<ReadBody,ReadNSBody,ReadBodyIntf>"#".*        { if (!insidePHP) 
+<ReadBody,ReadNSBody,ReadBodyIntf>[^\r\n\#{}"@'/<]*    { yyextra->current->program += yytext ; }
+<ReadBody,ReadNSBody,ReadBodyIntf>"//".*               { yyextra->current->program += yytext ; }
+<ReadBody,ReadNSBody,ReadBodyIntf>"#".*        { if (!yyextra->insidePHP) 
                                            REJECT;
                                          // append PHP comment.
-                                         current->program += yytext ;
+                                         yyextra->current->program += yytext ;
                                        }
-<ReadBody,ReadNSBody,ReadBodyIntf>@\"  { current->program += yytext ; 
-                                          pSkipVerbString = &current->program;
-                                          lastSkipVerbStringContext=YY_START;
+<ReadBody,ReadNSBody,ReadBodyIntf>@\"  { yyextra->current->program += yytext ; 
+                                          yyextra->pSkipVerbString = &yyextra->current->program;
+                                          yyextra->lastSkipVerbStringContext=YY_START;
                                           BEGIN( SkipVerbString );
                                        }
-<ReadBody,ReadNSBody,ReadBodyIntf>"<<<"        { if (insidePHP)
+<ReadBody,ReadNSBody,ReadBodyIntf>"<<<"        { if (yyextra->insidePHP)
                                           {
-                                            current->program += yytext ; 
-                                            pCopyHereDocGString = &current->program;
-                                            lastHereDocContext=YY_START;
+                                            yyextra->current->program += yytext ; 
+                                            yyextra->pCopyHereDocGString = &yyextra->current->program;
+                                            yyextra->lastHereDocContext=YY_START;
                                             BEGIN( CopyHereDoc );
                                           }
                                           else
@@ -3923,139 +3534,155 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                             REJECT;
                                           }
                                        }
-<ReadBody,ReadNSBody,ReadBodyIntf>\"   { current->program += yytext ; 
-                                          pCopyQuotedGString = &current->program;
-                                          lastStringContext=YY_START;
+<ReadBody,ReadNSBody,ReadBodyIntf>\"   { yyextra->current->program += yytext ; 
+                                          yyextra->pCopyQuotedGString = &yyextra->current->program;
+                                          yyextra->lastStringContext=YY_START;
                                           BEGIN( CopyGString );
                                        }
-<ReadBody,ReadNSBody,ReadBodyIntf>"/*"{B}*             { current->program += yytext ;
-                                         lastContext = YY_START ;
+<ReadBody,ReadNSBody,ReadBodyIntf>"/*"{B}*             { yyextra->current->program += yytext ;
+                                         yyextra->lastContext = YY_START ;
                                          BEGIN( Comment ) ;
                                        }
-<ReadBody,ReadNSBody,ReadBodyIntf>"/*"{BL}             { current->program += yytext ;
-                                         ++yyLineNr ;
-                                         lastContext = YY_START ;
+<ReadBody,ReadNSBody,ReadBodyIntf>"/*"{BL}             { yyextra->current->program += yytext ;
+                                         ++yyextra->yyLineNr ;
+                                         yyextra->lastContext = YY_START ;
                                          BEGIN( Comment ) ;
                                        }
 <ReadBody,ReadNSBody,ReadBodyIntf>"'"  {
-                                         if (!insidePHP)
+                                         if (!yyextra->insidePHP)
                                          {
-                                           current->program += yytext;
+                                           yyextra->current->program += yytext;
                                          }
                                          else
                                          { // begin of single quoted string
-                                           current->program += yytext;
-                                            pCopyQuotedGString = &current->program;
-                                            lastStringContext=YY_START;
+                                           yyextra->current->program += yytext;
+                                            yyextra->pCopyQuotedGString = &yyextra->current->program;
+                                            yyextra->lastStringContext=YY_START;
                                            BEGIN(CopyPHPGString);
                                          }
                                        }
 <ReadBody,ReadNSBody,ReadBodyIntf>{CHARLIT} { 
-                                              if (insidePHP) 
+                                              if (yyextra->insidePHP) 
                                              {
                                                REJECT; // for PHP code single quotes 
                                                        // are used for strings of arbitrary length
                                              }
                                              else
                                              {
-                                                current->program += yytext; 
+                                                yyextra->current->program += yytext; 
                                              }
                                             }
-<ReadBody,ReadNSBody,ReadBodyIntf>"{"   { current->program += yytext ;
-                                         ++curlyCount ;
+<ReadBody,ReadNSBody,ReadBodyIntf>"{"   { yyextra->current->program += yytext ;
+                                         ++yyextra->curlyCount ;
                                        }
 <ReadBodyIntf>"}"                      {
-                                         current->program += yytext ;
-                                         --curlyCount ;
+                                         yyextra->current->program += yytext ;
+                                         --yyextra->curlyCount ;
                                        }
-<ReadBody,ReadNSBody>"}"               { //err("ReadBody count=%d\n",curlyCount);
-                                         if ( curlyCount>0 )
+<ReadBody,ReadNSBody>"}"               { //err("ReadBody count=%d\n",yyextra->curlyCount);
+                                         if ( yyextra->curlyCount>0 )
                                          {
-                                           current->program += yytext ;
-                                           --curlyCount ;
+                                           yyextra->current->program += yytext ;
+                                           --yyextra->curlyCount ;
                                          }
                                          else
                                          {
-                                           current->endBodyLine = yyLineNr;
-                        Entry * original_root = current_root; // save root this namespace is in
-                                            if (current->section == Entry::NAMESPACE_SEC && current->type == "namespace")
+                                           yyextra->current->endBodyLine = yyextra->yyLineNr;
+                                            std::shared_ptr<Entry> original_root = yyextra->current_root; // save root this namespace is in
+                                            if (yyextra->current->section == Entry::NAMESPACE_SEC && yyextra->current->type == "namespace")
                                             {
                                               int split_point;
-                                              while ((split_point = current->name.find("::")) != -1)
+                                              // save documentation values
+                                              QCString doc       = yyextra->current->doc;
+                                              int      docLine   = yyextra->current->docLine;
+                                              QCString docFile   = yyextra->current->docFile;
+                                              QCString brief     = yyextra->current->brief;
+                                              int      briefLine = yyextra->current->briefLine;
+                                              QCString briefFile = yyextra->current->briefFile;
+                                              // reset documentation values
+                                              yyextra->current->doc       = "";
+                                              yyextra->current->docLine   = 0;
+                                              yyextra->current->docFile   = "";
+                                              yyextra->current->brief     = "";
+                                              yyextra->current->briefLine = 0;
+                                              yyextra->current->briefFile = "";
+                                              while ((split_point = yyextra->current->name.find("::")) != -1)
                                               {
-                                                Entry *new_current = new Entry(*current);
-                                                current->program = "";
-                                                new_current->doc = "";
-                                                new_current->docLine = 0;
-                                                new_current->docFile = "";
-                                                new_current->brief = "";
-                                                new_current->briefLine = 0;
-                                                new_current->briefFile = "";
-                                                new_current->name  = current->name.mid(split_point + 2);
-                                                current->name  = current->name.left(split_point);
-                                                if (!current_root->name.isEmpty()) current->name.prepend(current_root->name+"::");
-
-                                                current_root->addSubEntry(current);
-                                                current_root = current;
-                                                current = new_current;
+                                                std::shared_ptr<Entry> new_current = std::make_shared<Entry>(*yyextra->current);
+                                                yyextra->current->program = "";
+                                                new_current->name  = yyextra->current->name.mid(split_point + 2);
+                                                yyextra->current->name  = yyextra->current->name.left(split_point);
+                                                if (!yyextra->current_root->name.isEmpty()) yyextra->current->name.prepend(yyextra->current_root->name+"::");
+
+                                                std::shared_ptr<Entry> tmp = yyextra->current;
+                                                yyextra->current_root->moveToSubEntryAndKeep(yyextra->current);
+                                                yyextra->current_root = tmp;
+
+                                                yyextra->current = new_current;
                                               }
+                                              // restore documentation values
+                                              yyextra->current->doc       = doc;
+                                              yyextra->current->docLine   = docLine;
+                                              yyextra->current->docFile   = docFile;
+                                              yyextra->current->brief     = brief;
+                                              yyextra->current->briefLine = briefLine;
+                                              yyextra->current->briefFile = briefFile;
                                             }
-                                           QCString &cn = current->name;
-                                           QCString rn = current_root->name.copy();
-                                           //printf("cn='%s' rn='%s' isTypedef=%d\n",cn.data(),rn.data(),isTypedef);
+                                           QCString &cn = yyextra->current->name;
+                                           QCString rn = yyextra->current_root->name.copy();
+                                           //printf("cn='%s' rn='%s' yyextra->isTypedef=%d\n",cn.data(),rn.data(),yyextra->isTypedef);
                                            if (!cn.isEmpty() && !rn.isEmpty())
                                            {
-                                             prependScope();
+                                             prependScope(yyscanner);
                                            }
-                                           if (isTypedef && cn.isEmpty())
+                                           if (yyextra->isTypedef && cn.isEmpty())
                                            {
                                              //printf("Typedef Name\n");
                                              BEGIN( TypedefName );
                                            }
                                            else
                                            {
-                                             if ((current->section == Entry::ENUM_SEC) || (current->spec&Entry::Enum))
+                                             if ((yyextra->current->section == Entry::ENUM_SEC) || (yyextra->current->spec&Entry::Enum))
                                              {
-                                               current->program+=','; // add field terminator
+                                               yyextra->current->program+=','; // add field terminator
                                              }
                                              // add compound definition to the tree
-                                             current->args=removeRedundantWhiteSpace(current->args);
-                                                       // was: current->args.simplifyWhiteSpace();
-                                             current->type = current->type.simplifyWhiteSpace();
-                                             current->name = current->name.stripWhiteSpace();
-                                             //printf("adding '%s' '%s' '%s' brief=%s insideObjC=%d %x\n",current->type.data(),current->name.data(),current->args.data(),current->brief.data(),insideObjC,current->section);
-                                             if (insideObjC && 
-                                                 ((current->spec&Entry::Interface) || (current->spec==Entry::Category))
+                                             yyextra->current->args=removeRedundantWhiteSpace(yyextra->current->args);
+                                                       // was: yyextra->current->args.simplifyWhiteSpace();
+                                             yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
+                                             yyextra->current->name = yyextra->current->name.stripWhiteSpace();
+                                             //printf("adding '%s' '%s' '%s' brief=%s yyextra->insideObjC=%d %x\n",yyextra->current->type.data(),yyextra->current->name.data(),yyextra->current->args.data(),yyextra->current->brief.data(),yyextra->insideObjC,yyextra->current->section);
+                                             if (yyextra->insideObjC && 
+                                                 ((yyextra->current->spec&Entry::Interface) || (yyextra->current->spec==Entry::Category))
                                                 ) // method definition follows
                                              {
                                                BEGIN( ReadBodyIntf ) ;
                                              }
                                              else
                                              {
-                                               current_root->addSubEntry( current ) ;
-                                               memspecEntry = current;
-                                               current = new Entry(*current);
-                                               if (current->section==Entry::NAMESPACE_SEC || 
-                                                   (current->spec==Entry::Interface) ||
-                                                   insideJava || insidePHP || insideCS || insideD || insideJS ||
-                                                    insideSlice
+                                               yyextra->memspecEntry = yyextra->current;
+                                               yyextra->current_root->copyToSubEntry( yyextra->current ) ;
+                                               if (yyextra->current->section==Entry::NAMESPACE_SEC ||
+                                                   (yyextra->current->spec==Entry::Interface) ||
+                                                   yyextra->insideJava || yyextra->insidePHP || yyextra->insideCS || yyextra->insideD || yyextra->insideJS ||
+                                                    yyextra->insideSlice
                                                   )
                                                { // namespaces and interfaces and java classes ends with a closing bracket without semicolon
-                                                 current->reset();
-                          current_root = original_root; // restore scope from before namespace descent
-                                                 initEntry();
-                                                 memspecEntry = 0;
+                                                  yyextra->current->reset();
+                                                  yyextra->current_root = original_root; // restore scope from before namespace descent
+                                                 initEntry(yyscanner);
+                                                 yyextra->memspecEntry.reset();
                                                  BEGIN( FindMembers ) ;
                                                }
                                                else
                                                {
                                                   static QRegExp re("@[0-9]+$");
-                                                 if (!isTypedef && memspecEntry &&
-                                                      memspecEntry->name.find(re)==-1) // not typedef or anonymous type (see bug691071)
+                                                 if (!yyextra->isTypedef && yyextra->memspecEntry &&
+                                                      yyextra->memspecEntry->name.find(re)==-1) // not typedef or anonymous type (see bug691071)
                                                  {
                                                    // enabled the next two lines for bug 623424
-                                                   current->doc.resize(0);
-                                                   current->brief.resize(0);
+                                                   yyextra->current->doc.resize(0);
+                                                   yyextra->current->brief.resize(0);
                                                  }
                                                  BEGIN( MemberSpec ) ;
                                                }
@@ -4063,115 +3690,113 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                            }
                                          }
                                        }
-<ReadBody>"}"{BN}+"typedef"{BN}+       { //err("ReadBody count=%d\n",curlyCount);
-                                         lineCount();
-                                         if ( curlyCount>0 )
+<ReadBody>"}"{BN}+"typedef"{BN}+       { //err("ReadBody count=%d\n",yyextra->curlyCount);
+                                         lineCount(yyscanner);
+                                         if ( yyextra->curlyCount>0 )
                                          {
-                                           current->program += yytext ;
-                                           --curlyCount ;
+                                           yyextra->current->program += yytext ;
+                                           --yyextra->curlyCount ;
                                          }
                                          else
                                          {
-                                           isTypedef = TRUE;
-                                           current->endBodyLine = yyLineNr;
-                                           QCString &cn = current->name;
-                                           QCString rn = current_root->name.copy();
+                                           yyextra->isTypedef = TRUE;
+                                           yyextra->current->endBodyLine = yyextra->yyLineNr;
+                                           QCString &cn = yyextra->current->name;
+                                           QCString rn = yyextra->current_root->name.copy();
                                            if (!cn.isEmpty() && !rn.isEmpty())
                                            {
-                                             prependScope();
+                                             prependScope(yyscanner);
                                            }
                                            BEGIN( TypedefName );
                                          }
                                        }
 <TypedefName>("const"|"volatile"){BN}  { // late "const" or "volatile" keyword
-                                         lineCount();
-                                         current->type.prepend(yytext);
+                                         lineCount(yyscanner);
+                                         yyextra->current->type.prepend(yytext);
                                        }
 <TypedefName>{ID}                      {
-                                         if ((current->section == Entry::ENUM_SEC) || (current->spec&Entry::Enum))
+                                         if ((yyextra->current->section == Entry::ENUM_SEC) || (yyextra->current->spec&Entry::Enum))
                                          {
-                                           current->program+=","; // add field terminator
+                                           yyextra->current->program+=","; // add field terminator
                                          }
-                                         current->name=yytext;
-                                         prependScope();
-                                         current->args = current->args.simplifyWhiteSpace();
-                                         current->type = current->type.simplifyWhiteSpace();
-                                         //printf("Adding compound %s %s %s\n",current->type.data(),current->name.data(),current->args.data());
-                                         current_root->addSubEntry( current ) ;
-                                         if (!firstTypedefEntry)
+                                         yyextra->current->name=yytext;
+                                         prependScope(yyscanner);
+                                         yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
+                                         yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
+                                         //printf("Adding compound %s %s %s\n",yyextra->current->type.data(),yyextra->current->name.data(),yyextra->current->args.data());
+                                         if (!yyextra->firstTypedefEntry)
                                          {
-                                           firstTypedefEntry = current;
+                                           yyextra->firstTypedefEntry = yyextra->current;
                                          }
-                                         current = new Entry;
-                                         initEntry();
-                                         isTypedef=TRUE; // to undo reset by initEntry()
+                                         yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
+                                         initEntry(yyscanner);
+                                         yyextra->isTypedef=TRUE; // to undo reset by initEntry(yyscanner)
                                          BEGIN(MemberSpecSkip); 
                                        }
 <TypedefName>";"                       { /* typedef of anonymous type */
-                                         current->name.sprintf("@%d",anonCount++);
-                                         if ((current->section == Entry::ENUM_SEC) || (current->spec&Entry::Enum))
+                                         yyextra->current->name.sprintf("@%d",yyextra->anonCount++);
+                                         if ((yyextra->current->section == Entry::ENUM_SEC) || (yyextra->current->spec&Entry::Enum))
                                          {
-                                           current->program+=','; // add field terminator
+                                           yyextra->current->program+=','; // add field terminator
                                          }
                                          // add compound definition to the tree
-                                         current->args = current->args.simplifyWhiteSpace();
-                                         current->type = current->type.simplifyWhiteSpace();
-                                         current_root->addSubEntry( current ) ;
-                                         memspecEntry = current;
-                                         current = new Entry(*current);
-                                         initEntry();
+                                         yyextra->current->args = yyextra->current->args.simplifyWhiteSpace();
+                                         yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
+                                         yyextra->memspecEntry = yyextra->current;
+                                         yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
+                                         initEntry(yyscanner);
                                          unput(';');
                                          BEGIN( MemberSpec ) ;
                                        }
 <MemberSpec>([*&]*{BN}*)*{ID}{BN}*("["[^\]\n]*"]")* { // the [] part could be improved.
-                                         lineCount();
+                                         lineCount(yyscanner);
                                          int i=0,l=(int)yyleng,j;
                                          while (i<l && (!isId(yytext[i]))) i++;
-                                         msName = QCString(yytext).right(l-i).stripWhiteSpace();
-                                         j=msName.find("[");
+                                         yyextra->msName = QCString(yytext).right(l-i).stripWhiteSpace();
+                                         j=yyextra->msName.find("[");
                                          if (j!=-1) 
                                          {
-                                           msArgs=msName.right(msName.length()-j);
-                                           msName=msName.left(j);
+                                           yyextra->msArgs=yyextra->msName.right(yyextra->msName.length()-j);
+                                           yyextra->msName=yyextra->msName.left(j);
                                          }
-                                         msType=QCString(yytext).left(i);
+                                         yyextra->msType=QCString(yytext).left(i);
 
                                          // handle *pName in: typedef { ... } name, *pName;
-                                         if (firstTypedefEntry) 
+                                         if (yyextra->firstTypedefEntry) 
                                          {
-                                           if (firstTypedefEntry->spec&Entry::Struct)
+                                           if (yyextra->firstTypedefEntry->spec&Entry::Struct)
                                            {
-                                             msType.prepend("struct "+firstTypedefEntry->name);
+                                             yyextra->msType.prepend("struct "+yyextra->firstTypedefEntry->name);
                                            }
-                                           else if (firstTypedefEntry->spec&Entry::Union)
+                                           else if (yyextra->firstTypedefEntry->spec&Entry::Union)
                                            {
-                                             msType.prepend("union "+firstTypedefEntry->name);
+                                             yyextra->msType.prepend("union "+yyextra->firstTypedefEntry->name);
                                            }
-                                           else if (firstTypedefEntry->section==Entry::ENUM_SEC)
+                                           else if (yyextra->firstTypedefEntry->section==Entry::ENUM_SEC)
                                            {
-                                             msType.prepend("enum "+firstTypedefEntry->name);
+                                             yyextra->msType.prepend("enum "+yyextra->firstTypedefEntry->name);
                                            }
                                            else
                                            {
-                                             msType.prepend(firstTypedefEntry->name);
+                                             yyextra->msType.prepend(yyextra->firstTypedefEntry->name);
                                            }
                                          }
                                        }
 <MemberSpec>"("                                { // function with struct return type
-                                         addType(current);
-                                         current->name = msName;
-                                         current->spec = 0;
+                                         addType(yyscanner);
+                                         yyextra->current->name = yyextra->msName;
+                                         yyextra->current->spec = 0;
                                          unput('(');
                                          BEGIN(FindMembers);
                                        }
 <MemberSpec>[,;]                       {
-                                         if (msName.isEmpty() && !current->name.isEmpty())
+                                         if (yyextra->msName.isEmpty() && !yyextra->current->name.isEmpty())
                                          { 
-                                           // see if the compound does not have a name or is inside another
+                                           // see if the compound does not have a name or is yyextra->inside another
                                            // anonymous compound. If so we insert a 
                                            // special 'anonymous' variable.
-                                           //Entry *p=current_root;
-                                           Entry *p=current;
+                                           //Entry *p=yyextra->current_root;
+                                            const Entry *p=yyextra->current.get();
                                            while (p)
                                            {
                                              // only look for class scopes, not namespace scopes
@@ -4182,180 +3807,164 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                                int pi = (i==-1) ? 0 : i+2;
                                                if (p->name.at(pi)=='@')
                                                {
-                                                 // anonymous compound inside -> insert dummy variable name
+                                                 // anonymous compound yyextra->inside -> insert dummy variable name
                                                  //printf("Adding anonymous variable for scope %s\n",p->name.data());
-                                                 msName.sprintf("@%d",anonCount++); 
+                                                 yyextra->msName.sprintf("@%d",yyextra->anonCount++); 
                                                  break;
                                                }
                                              }
                                              //p=p->parent;
-                                             if (p==current) p=current_root; else p=p->parent();
+                                             if (p==yyextra->current.get()) p=yyextra->current_root.get(); else p=p->parent();
                                            }
                                          }
-                                         //printf("msName=%s current->name=%s\n",msName.data(),current->name.data());
-                                         if (!msName.isEmpty() 
-                                             /*&& msName!=current->name*/) // skip typedef T {} T;, removed due to bug608493
+                                         //printf("yyextra->msName=%s yyextra->current->name=%s\n",yyextra->msName.data(),yyextra->current->name.data());
+                                         if (!yyextra->msName.isEmpty() 
+                                             /*&& yyextra->msName!=yyextra->current->name*/) // skip typedef T {} T;, removed due to bug608493
                                          {
-                                           static bool typedefHidesStruct = Config_getBool(TYPEDEF_HIDES_STRUCT);
+                                           bool typedefHidesStruct = Config_getBool(TYPEDEF_HIDES_STRUCT);
                                            // case 1: typedef struct _S { ... } S_t; 
                                            // -> omit typedef and use S_t as the struct name
                                            if (typedefHidesStruct && 
-                                               isTypedef && 
-                                               ((current->spec&(Entry::Struct|Entry::Union)) ||
-                                                current->section==Entry::ENUM_SEC )&&
-                                               msType.stripWhiteSpace().isEmpty() && 
-                                               memspecEntry)
+                                               yyextra->isTypedef && 
+                                               ((yyextra->current->spec&(Entry::Struct|Entry::Union)) ||
+                                                yyextra->current->section==Entry::ENUM_SEC )&&
+                                               yyextra->msType.stripWhiteSpace().isEmpty() && 
+                                               yyextra->memspecEntry)
                                            {
-                                             memspecEntry->name=msName;
+                                             yyextra->memspecEntry->name=yyextra->msName;
                                            }
                                            else // case 2: create a typedef field
                                            {
-                                             Entry *varEntry=new Entry;
-                                             varEntry->lang = language;
-                                             varEntry->protection = current->protection ;
-                                             varEntry->mtype = current->mtype;
-                                             varEntry->virt = current->virt;
-                                             varEntry->stat = current->stat;
+                                              std::shared_ptr<Entry> varEntry=std::make_shared<Entry>();
+                                             varEntry->lang = yyextra->language;
+                                             varEntry->protection = yyextra->current->protection ;
+                                             varEntry->mtype = yyextra->current->mtype;
+                                             varEntry->virt = yyextra->current->virt;
+                                             varEntry->stat = yyextra->current->stat;
                                              varEntry->section = Entry::VARIABLE_SEC;
-                                             varEntry->name = msName.stripWhiteSpace();
-                                             varEntry->type = current->type.simplifyWhiteSpace()+" ";
-                                             varEntry->args = msArgs; 
-                                             if (isTypedef)
+                                             varEntry->name = yyextra->msName.stripWhiteSpace();
+                                             varEntry->type = yyextra->current->type.simplifyWhiteSpace()+" ";
+                                             varEntry->args = yyextra->msArgs; 
+                                             if (yyextra->isTypedef)
                                              {
                                                varEntry->type.prepend("typedef ");
-                                               //  //printf("current->name = %s %s\n",current->name.data(),msName.data());
+                                               //  //printf("yyextra->current->name = %s %s\n",yyextra->current->name.data(),yyextra->msName.data());
                                              }
                                              if (typedefHidesStruct &&
-                                                 isTypedef &&
-                                                 (current->spec&(Entry::Struct|Entry::Union)) &&
-                                                 memspecEntry
+                                                 yyextra->isTypedef &&
+                                                 (yyextra->current->spec&(Entry::Struct|Entry::Union)) &&
+                                                 yyextra->memspecEntry
                                                 ) // case 1: use S_t as type for pS_t in "typedef struct _S {} S_t, *pS_t;"
                                              {
-                                               varEntry->type+=memspecEntry->name+msType;
+                                               varEntry->type+=yyextra->memspecEntry->name+yyextra->msType;
                                              }
                                              else // case 2: use _S as type for for pS_t
                                              {
-                                               varEntry->type+=current->name+msType;
-                                             }
-                                             varEntry->fileName = yyFileName;
-                                             varEntry->startLine = yyLineNr;
-                                             varEntry->startColumn = yyColNr;
-                                             varEntry->doc = current->doc.copy();
-                                             varEntry->brief = current->brief.copy();
-                                             varEntry->mGrpId = current->mGrpId;
-                                              varEntry->initializer = current->initializer;
-
-                                             // deep copy group list
-                                             QListIterator<Grouping> gli(*current->groups);
-                                             Grouping *g;
-                                             for (;(g=gli.current());++gli)
-                                             {
-                                               varEntry->groups->append(new Grouping(*g));
-                                             }
-                                             if (current->sli) // copy special list items
-                                             {
-                                               QListIterator<ListItemInfo> li(*current->sli);
-                                               ListItemInfo *lii;
-                                               for (li.toFirst();(lii=li.current());++li)
-                                               {
-                                                 varEntry->addSpecialListItem(lii->type,lii->itemId);
-                                               }
+                                               varEntry->type+=yyextra->current->name+yyextra->msType;
                                              }
+                                             varEntry->fileName = yyextra->yyFileName;
+                                             varEntry->startLine = yyextra->yyLineNr;
+                                             varEntry->startColumn = yyextra->yyColNr;
+                                             varEntry->doc = yyextra->current->doc.copy();
+                                             varEntry->brief = yyextra->current->brief.copy();
+                                             varEntry->mGrpId = yyextra->current->mGrpId;
+                                              varEntry->initializer = yyextra->current->initializer;
+                                              varEntry->groups = yyextra->current->groups;
+                                              varEntry->sli = yyextra->current->sli;
 
                                              //printf("Add: type='%s',name='%s',args='%s' brief=%s doc=%s\n",
                                              //      varEntry->type.data(),varEntry->name.data(),
                                              //      varEntry->args.data(),varEntry->brief.data(),varEntry->doc.data());
-                                             current_root->addSubEntry(varEntry);
+                                             yyextra->current_root->moveToSubEntryAndKeep(varEntry);
                                            }
                                          }
                                          if (*yytext==';') // end of a struct/class ...
                                          {
-                                           if (!isTypedef && msName.isEmpty() && memspecEntry && (current->section&Entry::COMPOUND_MASK))
+                                           if (!yyextra->isTypedef && yyextra->msName.isEmpty() && yyextra->memspecEntry && (yyextra->current->section&Entry::COMPOUND_MASK))
                                            { // case where a class/struct has a doc block after it
-                                             if (!current->doc.isEmpty())
+                                             if (!yyextra->current->doc.isEmpty())
                                              {
-                                               memspecEntry->doc += current->doc;
+                                               yyextra->memspecEntry->doc += yyextra->current->doc;
                                              }
-                                             if (!current->brief.isEmpty())
+                                             if (!yyextra->current->brief.isEmpty())
                                              {
-                                               memspecEntry->brief += current->brief;
+                                               yyextra->memspecEntry->brief += yyextra->current->brief;
                                              }
                                            }
-                                           msType.resize(0);
-                                           msName.resize(0);
-                                           msArgs.resize(0);
-                                           isTypedef=FALSE;
-                                           firstTypedefEntry=0;
-                                           memspecEntry=0;
-                                           current->reset();
-                                           initEntry();
+                                           yyextra->msType.resize(0);
+                                           yyextra->msName.resize(0);
+                                           yyextra->msArgs.resize(0);
+                                           yyextra->isTypedef=FALSE;
+                                           yyextra->firstTypedefEntry.reset();
+                                           yyextra->memspecEntry.reset();
+                                           yyextra->current->reset();
+                                           initEntry(yyscanner);
                                            BEGIN( FindMembers );
                                          }
                                          else
                                          {
-                                           current->doc.resize(0);
-                                           current->brief.resize(0);
+                                           yyextra->current->doc.resize(0);
+                                           yyextra->current->brief.resize(0);
                                          }
 
                                        }
 <MemberSpec>"="                                { 
-                                         lastInitializerContext=YY_START;
-                                         initBracketCount=0;
-                                          current->initializer = yytext;
+                                         yyextra->lastInitializerContext=YY_START;
+                                         yyextra->initBracketCount=0;
+                                          yyextra->current->initializer = yytext;
                                          BEGIN(ReadInitializer);
                                          /* BEGIN(MemberSpecSkip); */
                                        }
   /*
 <MemberSpecSkip>"{"                    {
-                                         curlyCount=0;
-                                         lastCurlyContext = MemberSpecSkip;
-                                         previous = current;
+                                         yyextra->curlyCount=0;
+                                         yyextra->lastCurlyContext = MemberSpecSkip;
+                                         yyextra->previous = yyextra->current;
                                          BEGIN(SkipCurly);
                                        }
   */
 <MemberSpecSkip>","                    { BEGIN(MemberSpec); }
 <MemberSpecSkip>";"                    { unput(';'); BEGIN(MemberSpec); }
-<ReadBody,ReadNSBody,ReadBodyIntf>{BN}{1,80} { current->program += yytext ;
-                                         lineCount() ;
+<ReadBody,ReadNSBody,ReadBodyIntf>{BN}{1,80} { yyextra->current->program += yytext ;
+                                         lineCount(yyscanner) ;
                                        }
 <ReadBodyIntf>"@end"/[^a-z_A-Z0-9]     { // end of Objective C block
-                                         current_root->addSubEntry( current ) ;
-                                         current=new Entry;
-                                         initEntry();
-                                         language = current->lang = SrcLangExt_Cpp; // see bug746361
-                                         insideObjC=FALSE;
+                                         yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
+                                         initEntry(yyscanner);
+                                         yyextra->language = yyextra->current->lang = SrcLangExt_Cpp; // see bug746361
+                                         yyextra->insideObjC=FALSE;
                                          BEGIN( FindMembers ); 
                                        }
-<ReadBody,ReadNSBody,ReadBodyIntf>.    { current->program += yytext ; }
+<ReadBody,ReadNSBody,ReadBodyIntf>.    { yyextra->current->program += yytext ; }
 
 <FindMembers>"("/{BN}*"::"*{BN}*({TSCOPE}{BN}*"::")*{TSCOPE}{BN}*")"{BN}*"(" | /* typedef void (A<int>::func_t)(args...) */
 <FindMembers>("("({BN}*"::"*{BN}*{TSCOPE}{BN}*"::")*({BN}*[*&\^]{BN}*)+)+ {   /* typedef void (A::*ptr_t)(args...) or int (*func(int))[], the ^ is for Obj-C blocks */
-                                         if (insidePHP) // reference parameter
+                                         if (yyextra->insidePHP) // reference parameter
                                          {
                                            REJECT
                                          }
                                          else
                                          {
-                                           current->bodyLine = yyLineNr;
-                                           lineCount();
-                                           addType(current);
-                                           funcPtrType=yytext;
-                                           roundCount=0;
-                                           //current->type += yytext;
+                                           yyextra->current->bodyLine = yyextra->yyLineNr;
+                                           lineCount(yyscanner);
+                                           addType(yyscanner);
+                                           yyextra->funcPtrType=yytext;
+                                           yyextra->roundCount=0;
+                                           //yyextra->current->type += yytext;
                                            BEGIN( FuncPtr );
                                          }
                                        }
 <FuncPtr>{SCOPENAME}                   {
-                                         current->name = yytext;
-                                         if (nameIsOperator(current->name))
+                                         yyextra->current->name = yytext;
+                                         if (nameIsOperator(yyextra->current->name))
                                          {
                                            BEGIN( FuncPtrOperator );
                                          }
                                          else
                                          {
-                                           if (current->name=="const" || current->name=="volatile")
+                                           if (yyextra->current->name=="const" || yyextra->current->name=="volatile")
                                            {
-                                             funcPtrType += current->name;
+                                             yyextra->funcPtrType += yyextra->current->name;
                                            }
                                            else
                                            {
@@ -4364,213 +3973,213 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                          }
                                        }
 <FuncPtr>.                             {
-                                         //printf("error: FuncPtr '%c' unexpected at line %d of %s\n",*yytext,yyLineNr,yyFileName);
+                                         //printf("error: FuncPtr '%c' unexpected at line %d of %s\n",*yytext,yyextra->yyLineNr,yyextra->yyFileName);
                                        }
 <FuncPtrOperator>"("{BN}*")"{BN}*/"("  {
-                                         current->name += yytext;
-                                         current->name = current->name.simplifyWhiteSpace();
-                                         lineCount();
+                                         yyextra->current->name += yytext;
+                                         yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
+                                         lineCount(yyscanner);
                                        }
 <FuncPtrOperator>\n                    {
-                                          lineCount();
-                                         current->name += *yytext;
+                                          lineCount(yyscanner);
+                                         yyextra->current->name += *yytext;
                                        }
 <FuncPtrOperator>"("                   {
                                          unput(*yytext);
                                          BEGIN( EndFuncPtr );
                                         }
 <FuncPtrOperator>.                     {
-                                         current->name += *yytext;
+                                         yyextra->current->name += *yytext;
                                        }
 <EndFuncPtr>")"{BN}*/";"               { // a variable with extra braces
-                                         lineCount();
-                                         current->type+=funcPtrType.data()+1;
+                                         lineCount(yyscanner);
+                                         yyextra->current->type+=yyextra->funcPtrType.data()+1;
                                          BEGIN(FindMembers);
                                        }
 <EndFuncPtr>")"{BN}*/"("               { // a function pointer
-                                         lineCount();
-                                         current->type+=funcPtrType+")";
+                                         lineCount(yyscanner);
+                                         yyextra->current->type+=yyextra->funcPtrType+")";
                                          BEGIN(FindMembers);
                                        }
 <EndFuncPtr>")"{BN}*/"["               { // an array of variables
-                                         lineCount();
-                                         current->type+=funcPtrType.data();
-                                         current->args += ")";
+                                         lineCount(yyscanner);
+                                         yyextra->current->type+=yyextra->funcPtrType.data();
+                                         yyextra->current->args += ")";
                                          BEGIN(FindMembers);
                                        }
 <EndFuncPtr>"("                                { // a function returning a function or 
                                           // a function returning a pointer to an array
-                                         current->args += *yytext ;
-                                         //roundCount=0;
+                                         yyextra->current->args += *yytext ;
+                                         //yyextra->roundCount=0;
                                          //BEGIN( FuncFunc );
-                                         current->bodyLine = yyLineNr;
-                                         currentArgumentContext = FuncFuncEnd;
-                                         fullArgString=current->args.copy();
-                                         copyArgString=&current->args;
+                                         yyextra->current->bodyLine = yyextra->yyLineNr;
+                                         yyextra->currentArgumentContext = FuncFuncEnd;
+                                         yyextra->fullArgString=yyextra->current->args.copy();
+                                         yyextra->copyArgString=&yyextra->current->args;
                                          BEGIN( ReadFuncArgType ) ;
                                        }
 <EndFuncPtr>"["[^\n\]]*"]"             {
-                                         funcPtrType+=yytext;
+                                         yyextra->funcPtrType+=yytext;
                                        }
 <EndFuncPtr>")"                                {
                                          BEGIN(FindMembers);
                                        }
 <FuncFunc>"("                          {
-                                         current->args += *yytext ;
-                                         ++roundCount;
+                                         yyextra->current->args += *yytext ;
+                                         ++yyextra->roundCount;
                                        }
 <FuncFunc>")"                          {
-                                         current->args += *yytext ;
-                                         if ( roundCount )
-                                           --roundCount;
+                                         yyextra->current->args += *yytext ;
+                                         if ( yyextra->roundCount )
+                                           --yyextra->roundCount;
                                          else
                                          {
                                            BEGIN(FuncFuncEnd);
                                          }
                                        }
 <FuncFuncEnd>")"{BN}*"("               {
-                                         lineCount();
-                                         current->type+=funcPtrType+")(";
+                                         lineCount(yyscanner);
+                                         yyextra->current->type+=yyextra->funcPtrType+")(";
                                          BEGIN(FuncFuncType);
                                        }
 <FuncFuncEnd>")"{BN}*/[;{]             {
-                                         lineCount();
-                                         current->type+=funcPtrType.data()+1;
+                                         lineCount(yyscanner);
+                                         yyextra->current->type+=yyextra->funcPtrType.data()+1;
                                          BEGIN(Function);
                                        }
 <FuncFuncEnd>")"{BN}*/"["              { // function returning a pointer to an array
-                                          lineCount();
-                                         current->type+=funcPtrType;
-                                         current->args+=")";
+                                          lineCount(yyscanner);
+                                         yyextra->current->type+=yyextra->funcPtrType;
+                                         yyextra->current->args+=")";
                                          BEGIN(FuncFuncArray);
                                        }
 <FuncFuncEnd>.                         {
-                                         current->args += *yytext;
+                                         yyextra->current->args += *yytext;
                                        }
 <FuncFuncType>"("                      {
-                                         current->type += *yytext;
-                                         roundCount++;
+                                         yyextra->current->type += *yytext;
+                                         yyextra->roundCount++;
                                        }
 <FuncFuncType>")"                      {
-                                         current->type += *yytext;
-                                         if (roundCount)
-                                           --roundCount;
+                                         yyextra->current->type += *yytext;
+                                         if (yyextra->roundCount)
+                                           --yyextra->roundCount;
                                          else
                                            BEGIN(Function);
                                        }
-<FuncFuncType>{BN}*","{BN}*            { lineCount() ; current->type += ", " ; }
-<FuncFuncType>{BN}+                    { lineCount() ; current->type += ' ' ; }
+<FuncFuncType>{BN}*","{BN}*            { lineCount(yyscanner) ; yyextra->current->type += ", " ; }
+<FuncFuncType>{BN}+                    { lineCount(yyscanner) ; yyextra->current->type += ' ' ; }
 <FuncFuncType>.                                {
-                                         current->type += *yytext;
+                                         yyextra->current->type += *yytext;
                                        }
 <FindMembers>"("/{BN}*{ID}{BN}*"*"{BN}*{ID}*")"{BN}*"(" { // for catching typedef void (__stdcall *f)() like definitions
-                                          if (current->type.left(7)=="typedef" && current->bodyLine==-1) 
+                                          if (yyextra->current->type.left(7)=="typedef" && yyextra->current->bodyLine==-1) 
                                            // the bodyLine check is to prevent this guard to be true more than once
                                          {
-                                           current->bodyLine = yyLineNr;
+                                           yyextra->current->bodyLine = yyextra->yyLineNr;
                                            BEGIN( GetCallType );
                                          }
-                                         else if (!current->name.isEmpty()) // normal function
+                                         else if (!yyextra->current->name.isEmpty()) // normal function
                                          {
-                                           current->args = yytext;
-                                           current->bodyLine = yyLineNr;
-                                           currentArgumentContext = FuncQual;
-                                           fullArgString=current->args.copy();
-                                           copyArgString=&current->args;
+                                           yyextra->current->args = yytext;
+                                           yyextra->current->bodyLine = yyextra->yyLineNr;
+                                           yyextra->currentArgumentContext = FuncQual;
+                                           yyextra->fullArgString=yyextra->current->args.copy();
+                                           yyextra->copyArgString=&yyextra->current->args;
                                            BEGIN( ReadFuncArgType ) ;
                                            //printf(">>> Read function arguments!\n");
                                          }
                                        }
 <GetCallType>{BN}*{ID}{BN}*"*"         {
-                                         lineCount();
-                                         addType(current);
-                                         funcPtrType="(";
-                                         funcPtrType+=yytext;
-                                         roundCount=0;
+                                         lineCount(yyscanner);
+                                         addType(yyscanner);
+                                         yyextra->funcPtrType="(";
+                                         yyextra->funcPtrType+=yytext;
+                                         yyextra->roundCount=0;
                                          BEGIN( FuncPtr );
                                        }
 <FindMembers>"("                       { 
-                                          if (!current->name.isEmpty())
+                                          if (!yyextra->current->name.isEmpty())
                                          {
-                                           current->args = yytext;
-                                           current->bodyLine = yyLineNr;
-                                           currentArgumentContext = FuncQual;
-                                           fullArgString=current->args.copy();
-                                           copyArgString=&current->args;
+                                           yyextra->current->args = yytext;
+                                           yyextra->current->bodyLine = yyextra->yyLineNr;
+                                           yyextra->currentArgumentContext = FuncQual;
+                                           yyextra->fullArgString=yyextra->current->args.copy();
+                                           yyextra->copyArgString=&yyextra->current->args;
                                            BEGIN( ReadFuncArgType ) ;
-                                           //printf(">>> Read function arguments current->argList->count()=%d\n",current->argList->count());
+                                           //printf(">>> Read function arguments yyextra->current->argList.size()=%d\n",yyextra->current->argList.size());
                                          }
                                        }
   /*
 <FindMembers>"("{BN}*("void"{BN}*)?")" {
-                                         lineCount();
-                                         current->args = "()"; 
+                                         lineCount(yyscanner);
+                                         yyextra->current->args = "()"; 
                                          BEGIN( FuncQual );
                                        }
   */
 
   /*- Function argument reading rules ---------------------------------------*/
 
-<ReadFuncArgType>[^ \/\r\t\n\)\(\"\'#]+ { *copyArgString+=yytext; 
-                                         fullArgString+=yytext;
+<ReadFuncArgType>[^ \/\r\t\n\)\(\"\'#]+ { *yyextra->copyArgString+=yytext; 
+                                         yyextra->fullArgString+=yytext;
                                        }
-<CopyArgString,CopyArgPHPString>[^\n\\\"\']+           { *copyArgString+=yytext; 
-                                         fullArgString+=yytext;
+<CopyArgString,CopyArgPHPString>[^\n\\\"\']+           { *yyextra->copyArgString+=yytext; 
+                                         yyextra->fullArgString+=yytext;
                                        }
 <CopyArgRound>[^\/\n\)\(\"\']+         { 
-                                         *copyArgString+=yytext; 
-                                         fullArgString+=yytext;
+                                         *yyextra->copyArgString+=yytext; 
+                                         yyextra->fullArgString+=yytext;
                                        }
 <ReadFuncArgType,ReadTempArgs>{BN}*    {
-                                         *copyArgString+=" ";
-                                         fullArgString+=" ";
-                                         lineCount();
+                                         *yyextra->copyArgString+=" ";
+                                         yyextra->fullArgString+=" ";
+                                         lineCount(yyscanner);
                                        }
 <ReadFuncArgType,CopyArgRound,CopyArgSharp,ReadTempArgs>{RAWBEGIN}     {
-                                          g_delimiter = yytext+2;
-                                          g_delimiter=g_delimiter.left(g_delimiter.length()-1);
-                                          lastRawStringContext = YY_START;
-                                          pCopyRawString = copyArgString;
-                                          *pCopyRawString+=yytext;
-                                         fullArgString+=yytext;
+                                          yyextra->delimiter = yytext+2;
+                                          yyextra->delimiter=yyextra->delimiter.left(yyextra->delimiter.length()-1);
+                                          yyextra->lastRawStringContext = YY_START;
+                                          yyextra->pCopyRawString = yyextra->copyArgString;
+                                          *yyextra->pCopyRawString+=yytext;
+                                         yyextra->fullArgString+=yytext;
                                           BEGIN(RawString);
                                         }
 <ReadFuncArgType,CopyArgRound,CopyArgSharp,ReadTempArgs>\"     {
-                                         *copyArgString+=*yytext;
-                                         fullArgString+=*yytext;
-                                         lastCopyArgStringContext = YY_START;
+                                         *yyextra->copyArgString+=*yytext;
+                                         yyextra->fullArgString+=*yytext;
+                                         yyextra->lastCopyArgStringContext = YY_START;
                                          BEGIN( CopyArgString );
                                        }
 <ReadFuncArgType,ReadTempArgs>"("      {
-                                         *copyArgString+=*yytext;
-                                         fullArgString+=*yytext;
-                                         argRoundCount=0; 
-                                         lastCopyArgContext = YY_START;
+                                         *yyextra->copyArgString+=*yytext;
+                                         yyextra->fullArgString+=*yytext;
+                                         yyextra->argRoundCount=0; 
+                                         yyextra->lastCopyArgContext = YY_START;
                                          BEGIN( CopyArgRound ); 
                                        }
 <ReadFuncArgType>")"                   { 
-                                         *copyArgString+=*yytext;
-                                         fullArgString+=*yytext;
-                                         stringToArgumentList(fullArgString,current->argList);
-                                         if (insideJS)
+                                         *yyextra->copyArgString+=*yytext;
+                                         yyextra->fullArgString+=*yytext;
+                                         stringToArgumentList(yyextra->language, yyextra->fullArgString,yyextra->current->argList);
+                                         if (yyextra->insideJS)
                                          {
-                                           fixArgumentListForJavaScript(current->argList);
+                                           fixArgumentListForJavaScript(yyextra->current->argList);
                                          }
-                                          handleParametersCommentBlocks(current->argList);
+                                          handleParametersCommentBlocks(yyscanner,yyextra->current->argList);
 
-                                         /* remember the current documentation block, since
+                                         /* remember the yyextra->current documentation block, since
                                             we could overwrite it with the documentation of
                                             a function argument, which we then have to correct later
                                             on
                                           */
-                                         docBackup = current->doc;
-                                         briefBackup = current->brief;
+                                         yyextra->docBackup = yyextra->current->doc;
+                                         yyextra->briefBackup = yyextra->current->brief;
 
-                                         BEGIN( currentArgumentContext );
+                                         BEGIN( yyextra->currentArgumentContext );
                                        }
        /* a special comment */
 <ReadFuncArgType,ReadTempArgs>("/*"[*!]|"//"[/!])("<"?)        { 
-                                          if (currentArgumentContext==DefineEnd)
+                                          if (yyextra->currentArgumentContext==DefineEnd)
                                          {
                                            // for defines we interpret a comment
                                            // as documentation for the define 
@@ -4578,17 +4187,17 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                            {
                                              unput(yytext[i]);
                                            }
-                                           stringToArgumentList(fullArgString,current->argList);
-                                            handleParametersCommentBlocks(current->argList);
-                                           BEGIN( currentArgumentContext );
+                                           stringToArgumentList(yyextra->language, yyextra->fullArgString,yyextra->current->argList);
+                                            handleParametersCommentBlocks(yyscanner,yyextra->current->argList);
+                                           BEGIN( yyextra->currentArgumentContext );
                                          }
                                          else // not a define
                                          {
                                            // for functions we interpret a comment
                                            // as documentation for the argument
-                                           fullArgString+=yytext;
-                                           lastCopyArgChar=0;
-                                           lastCommentInArgContext=YY_START;
+                                           yyextra->fullArgString+=yytext;
+                                           yyextra->lastCopyArgChar=0;
+                                           yyextra->lastCommentInArgContext=YY_START;
                                            if (yytext[1]=='/')
                                              BEGIN( CopyArgCommentLine );
                                            else
@@ -4598,30 +4207,30 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
        /* a non-special comment */
 <ReadFuncArgType,ReadTempArgs>"/**/"   { /* empty comment */ }
 <ReadFuncArgType,ReadTempArgs>"/*"     {
-                                         lastCContext = YY_START;
+                                         yyextra->lastCContext = YY_START;
                                          BEGIN( SkipComment );
                                        }
 <ReadFuncArgType,ReadTempArgs>"//"     {
-                                         lastCContext = YY_START;
+                                         yyextra->lastCContext = YY_START;
                                          BEGIN( SkipCxxComment );
                                        }
   /*
-<ReadFuncArgType,ReadTempArgs>"'#"     { if (insidePHP)
+<ReadFuncArgType,ReadTempArgs>"'#"     { if (yyextra->insidePHP)
                                             REJECT;
-                                         *copyArgString+=yytext; 
-                                         fullArgString+=yytext; 
+                                         *yyextra->copyArgString+=yytext; 
+                                         yyextra->fullArgString+=yytext; 
                                        }
 <ReadFuncArgType,ReadTempArgs>"#"      {
-                                         if (!insidePHP)
+                                         if (!yyextra->insidePHP)
                                            REJECT;
-                                         lastCContext = YY_START;
+                                         yyextra->lastCContext = YY_START;
                                          BEGIN( SkipCxxComment );
                                        }
   */
        /* ')' followed by a special comment */
 <ReadFuncArgType>")"{BN}*("/*"[*!]|"//"[/!])"<"        {
-                                         lineCount();
-                                          if (currentArgumentContext==DefineEnd)
+                                         lineCount(yyscanner);
+                                          if (yyextra->currentArgumentContext==DefineEnd)
                                          {
                                            // for defines we interpret a comment
                                            // as documentation for the define 
@@ -4629,21 +4238,21 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                            {
                                              unput(yytext[i]);
                                            }
-                                           *copyArgString+=*yytext;
-                                           fullArgString+=*yytext;
-                                           stringToArgumentList(fullArgString,current->argList);
-                                            handleParametersCommentBlocks(current->argList);
-                                           BEGIN( currentArgumentContext );
+                                           *yyextra->copyArgString+=*yytext;
+                                           yyextra->fullArgString+=*yytext;
+                                           stringToArgumentList(yyextra->language, yyextra->fullArgString,yyextra->current->argList);
+                                            handleParametersCommentBlocks(yyscanner,yyextra->current->argList);
+                                           BEGIN( yyextra->currentArgumentContext );
                                          }
                                          else
                                          {
                                            // for functions we interpret a comment
-                                           // as documentation for the last argument
-                                           lastCopyArgChar=*yytext;
+                                           // as documentation for the yyextra->last argument
+                                           yyextra->lastCopyArgChar=*yytext;
                                            QCString text=&yytext[1];
                                            text=text.stripWhiteSpace();
-                                           lastCommentInArgContext=YY_START;
-                                           fullArgString+=text;
+                                           yyextra->lastCommentInArgContext=YY_START;
+                                           yyextra->fullArgString+=text;
                                            if (text.find("//")!=-1)
                                              BEGIN( CopyArgCommentLine );
                                            else
@@ -4651,152 +4260,152 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                          }
                                        }
 <CopyArgComment>^{B}*"*"+/{BN}+                
-<CopyArgComment>[^\n\\\@\*]+           { fullArgString+=yytext; }
-<CopyArgComment>"*/"                   { fullArgString+=yytext; 
-                                         if (lastCopyArgChar!=0)
-                                           unput(lastCopyArgChar); 
-                                          BEGIN( lastCommentInArgContext ); 
-                                       }
-<CopyArgCommentLine>\n                 { fullArgString+=yytext;
-                                          lineCount();
-                                         if (lastCopyArgChar!=0)
-                                           unput(lastCopyArgChar);
-                                         BEGIN( lastCommentInArgContext );
+<CopyArgComment>[^\n\\\@\*]+           { yyextra->fullArgString+=yytext; }
+<CopyArgComment>"*/"                   { yyextra->fullArgString+=yytext; 
+                                         if (yyextra->lastCopyArgChar!=0)
+                                           unput(yyextra->lastCopyArgChar); 
+                                          BEGIN( yyextra->lastCommentInArgContext ); 
+                                       }
+<CopyArgCommentLine>\n                 { yyextra->fullArgString+=yytext;
+                                          lineCount(yyscanner);
+                                         if (yyextra->lastCopyArgChar!=0)
+                                           unput(yyextra->lastCopyArgChar);
+                                         BEGIN( yyextra->lastCommentInArgContext );
                                        }
 <CopyArgCommentLine>{CMD}("verbatim"|"latexonly"|"htmlonly"|"xmlonly"|"manonly"|"dot"|"code")/[^a-z_A-Z0-9\-]  { // verbatim command (which could contain nested comments!)
-                                         docBlockName=&yytext[1];
-                                         fullArgString+=yytext;
+                                         yyextra->docBlockName=&yytext[1];
+                                         yyextra->fullArgString+=yytext;
                                          BEGIN(CopyArgVerbatim);
                                        }
 <CopyArgCommentLine>{CMD}("f$"|"f["|"f{")              {
-                                         docBlockName=&yytext[1];
-                                         if (docBlockName.at(1)=='[')
+                                         yyextra->docBlockName=&yytext[1];
+                                         if (yyextra->docBlockName.at(1)=='[')
                                          {
-                                           docBlockName.at(1)='}';
+                                           yyextra->docBlockName.at(1)='}';
                                          }
-                                         if (docBlockName.at(1)=='{')
+                                         if (yyextra->docBlockName.at(1)=='{')
                                          {
-                                           docBlockName.at(1)='}';
+                                           yyextra->docBlockName.at(1)='}';
                                          }
-                                         fullArgString+=yytext;
+                                         yyextra->fullArgString+=yytext;
                                          BEGIN(CopyArgVerbatim);
                                         }
 <CopyArgVerbatim>[\\@]("endverbatim"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"enddot"|"endcode"|"f$"|"f]"|"f}")/[^a-z_A-Z0-9\-] { // end of verbatim block
-                                         fullArgString+=yytext;
+                                         yyextra->fullArgString+=yytext;
                                          if (yytext[1]=='f') // end of formula
                                          {
                                            BEGIN(CopyArgCommentLine);
                                          }
-                                         if (&yytext[4]==docBlockName)
+                                         if (&yytext[4]==yyextra->docBlockName)
                                          {
                                            BEGIN(CopyArgCommentLine);
                                          }
                                        }
-<CopyArgCommentLine>[^\\\@\n]+         { fullArgString+=yytext; }
-<CopyArgCommentLine>.                  { fullArgString+=*yytext; }
-<CopyArgComment,CopyArgVerbatim>\n     { fullArgString+=*yytext; lineCount(); }
-<CopyArgComment,CopyArgVerbatim>.      { fullArgString+=*yytext; }
+<CopyArgCommentLine>[^\\\@\n]+         { yyextra->fullArgString+=yytext; }
+<CopyArgCommentLine>.                  { yyextra->fullArgString+=*yytext; }
+<CopyArgComment,CopyArgVerbatim>\n     { yyextra->fullArgString+=*yytext; lineCount(yyscanner); }
+<CopyArgComment,CopyArgVerbatim>.      { yyextra->fullArgString+=*yytext; }
 <CopyArgComment>{CMD}("brief"|"short"){B}+ {
-                                         warn(yyFileName,yyLineNr,
+                                         warn(yyextra->yyFileName,yyextra->yyLineNr,
                                              "Ignoring %cbrief command inside argument documentation",*yytext
                                             );
-                                          fullArgString+=' ';
+                                          yyextra->fullArgString+=' ';
                                         }
 <ReadTempArgs>"<"                      {
-                                         *copyArgString+=*yytext;
-                                         fullArgString+=*yytext;
-                                         argSharpCount=1;
+                                         *yyextra->copyArgString+=*yytext;
+                                         yyextra->fullArgString+=*yytext;
+                                         yyextra->argSharpCount=1;
                                          BEGIN( CopyArgSharp );
                                        }
 <ReadTempArgs>">"                      {
-                                         *copyArgString+=*yytext;
-                                         fullArgString+=*yytext;
-                                         //printf("end template list %s\n",copyArgString->data());
-                                         stringToArgumentList(fullArgString,currentArgumentList);
-                                         BEGIN( currentArgumentContext );
+                                         *yyextra->copyArgString+=*yytext;
+                                         yyextra->fullArgString+=*yytext;
+                                         //printf("end template list '%s'\n",yyextra->copyArgString->data());
+                                         stringToArgumentList(yyextra->language, yyextra->fullArgString,*yyextra->currentArgumentList);
+                                         BEGIN( yyextra->currentArgumentContext );
                                        }
 <CopyArgRound>"("                      {
-                                         argRoundCount++;
-                                         *copyArgString+=*yytext;
-                                         fullArgString+=*yytext;
+                                         yyextra->argRoundCount++;
+                                         *yyextra->copyArgString+=*yytext;
+                                         yyextra->fullArgString+=*yytext;
                                        }
 <CopyArgRound>")"                      {
-                                         *copyArgString+=*yytext;
-                                         fullArgString+=*yytext;
-                                         if (argRoundCount>0) 
-                                           argRoundCount--;
+                                         *yyextra->copyArgString+=*yytext;
+                                         yyextra->fullArgString+=*yytext;
+                                         if (yyextra->argRoundCount>0) 
+                                           yyextra->argRoundCount--;
                                          else 
-                                           BEGIN( lastCopyArgContext );
+                                           BEGIN( yyextra->lastCopyArgContext );
                                        }
 <CopyArgSharp>"("                       {
-                                         *copyArgString+=*yytext;
-                                         fullArgString+=*yytext;
-                                         argRoundCount=0; 
-                                         lastCopyArgContext = YY_START;
+                                         *yyextra->copyArgString+=*yytext;
+                                         yyextra->fullArgString+=*yytext;
+                                         yyextra->argRoundCount=0; 
+                                         yyextra->lastCopyArgContext = YY_START;
                                          BEGIN( CopyArgRound ); 
                                         }
 <CopyArgSharp>"<"                      {
-                                         argSharpCount++;
-                                         //printf("argSharpCount++=%d  copy\n",argSharpCount);
-                                         *copyArgString+=*yytext;
-                                         fullArgString+=*yytext;
+                                         yyextra->argSharpCount++;
+                                         //printf("yyextra->argSharpCount++=%d  copy\n",yyextra->argSharpCount);
+                                         *yyextra->copyArgString+=*yytext;
+                                         yyextra->fullArgString+=*yytext;
                                        }
 <CopyArgSharp>">"                      {
-                                         *copyArgString+=*yytext;
-                                         fullArgString+=*yytext;
-                                         argSharpCount--;
-                                         if (argSharpCount>0)
+                                         *yyextra->copyArgString+=*yytext;
+                                         yyextra->fullArgString+=*yytext;
+                                         yyextra->argSharpCount--;
+                                         if (yyextra->argSharpCount>0)
                                          {
-                                           //printf("argSharpCount--=%d copy\n",argSharpCount);
+                                           //printf("yyextra->argSharpCount--=%d copy\n",yyextra->argSharpCount);
                                          }
                                          else
                                          {
                                            BEGIN( ReadTempArgs );
-                                           //printf("end of argSharpCount\n");
+                                           //printf("end of yyextra->argSharpCount\n");
                                          }
                                        }
 <CopyArgString,CopyArgPHPString>\\.    {
-                                         *copyArgString+=yytext;
-                                         fullArgString+=yytext;
+                                         *yyextra->copyArgString+=yytext;
+                                         yyextra->fullArgString+=yytext;
                                        }
 <CopyArgString>\"                      {
-                                         *copyArgString+=*yytext;
-                                         fullArgString+=*yytext;
-                                         BEGIN( lastCopyArgStringContext );
+                                         *yyextra->copyArgString+=*yytext;
+                                         yyextra->fullArgString+=*yytext;
+                                         BEGIN( yyextra->lastCopyArgStringContext );
                                        }
 <CopyArgPHPString>\'                   {
-                                         *copyArgString+=*yytext;
-                                         fullArgString+=*yytext;
-                                         BEGIN( lastCopyArgStringContext );
+                                         *yyextra->copyArgString+=*yytext;
+                                         yyextra->fullArgString+=*yytext;
+                                         BEGIN( yyextra->lastCopyArgStringContext );
                                        }
 <ReadFuncArgType,ReadTempArgs,CopyArgRound,CopyArgSharp>{CHARLIT}     { 
-                                          if (insidePHP)
+                                          if (yyextra->insidePHP)
                                          {
                                            REJECT;
                                          }
                                          else
                                          {
-                                           *copyArgString+=yytext; 
-                                           fullArgString+=yytext; 
+                                           *yyextra->copyArgString+=yytext; 
+                                           yyextra->fullArgString+=yytext; 
                                          }
                                        }
 <ReadFuncArgType,ReadTempArgs,CopyArgRound,CopyArgSharp>\'     { 
-                                         *copyArgString+=yytext; 
-                                         fullArgString+=yytext; 
-                                         if (insidePHP)
+                                         *yyextra->copyArgString+=yytext; 
+                                         yyextra->fullArgString+=yytext; 
+                                         if (yyextra->insidePHP)
                                          {
-                                           lastCopyArgStringContext=YY_START;
+                                           yyextra->lastCopyArgStringContext=YY_START;
                                            BEGIN(CopyArgPHPString);
                                          }
                                        }
 <ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSharp>\n  { 
-                                          lineCount();
-                                         *copyArgString+=*yytext; 
-                                         fullArgString+=*yytext; 
+                                          lineCount(yyscanner);
+                                         *yyextra->copyArgString+=*yytext; 
+                                         yyextra->fullArgString+=*yytext; 
                                        }
 <ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSharp>.         { 
-                                         *copyArgString+=*yytext; 
-                                         fullArgString+=*yytext; 
+                                         *yyextra->copyArgString+=*yytext; 
+                                         yyextra->fullArgString+=*yytext; 
                                        }
 
 
@@ -4804,29 +4413,29 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
   /*------------------------------------------------------------------------*/
 
 
-<FuncRound>"("                         { current->args += *yytext ;
-                                         ++roundCount ;
+<FuncRound>"("                         { yyextra->current->args += *yytext ;
+                                         ++yyextra->roundCount ;
                                        }
-<FuncRound>")"                          { current->args += *yytext ; 
-                                         if ( roundCount )
-                                           --roundCount ;
+<FuncRound>")"                          { yyextra->current->args += *yytext ; 
+                                         if ( yyextra->roundCount )
+                                           --yyextra->roundCount ;
                                          else
                                            BEGIN( FuncQual ) ;
                                        }
   /*
-<FuncQual>"#"                          { if (insidePHP)
+<FuncQual>"#"                          { if (yyextra->insidePHP)
                                            REJECT;
-                                         lastCPPContext = YY_START;
+                                         yyextra->lastCPPContext = YY_START;
                                          BEGIN(SkipCPP);
                                        }
   */
 <FuncQual>[{:;,]                        {
                                           if ( qstrcmp(yytext,";")==0 && 
-                                              insidePHP && 
-                                              !containsWord(current->type,"function") )
+                                              yyextra->insidePHP && 
+                                              !containsWord(yyextra->current->type,"function") )
                                           {
-                                            current->reset();
-                                            initEntry();
+                                            yyextra->current->reset();
+                                            initEntry(yyscanner);
                                             BEGIN( FindMembers );
                                           }
                                           else
@@ -4835,89 +4444,89 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                           }
                                         }
 <FuncQual>{BN}*"abstract"{BN}*          { // pure virtual member function
-                                          lineCount() ; 
-                                          current->virt = Pure;
-                                          current->args += " override "; 
+                                          lineCount(yyscanner) ; 
+                                          yyextra->current->virt = Pure;
+                                          yyextra->current->args += " override "; 
                                         }
 <FuncQual,TrailingReturn>{BN}*"override"{BN}*          { // C++11 overridden virtual member function
-                                          lineCount() ; 
-                                          current->spec |= Entry::Override;
-                                          current->args += " override "; 
+                                          lineCount(yyscanner) ; 
+                                          yyextra->current->spec |= Entry::Override;
+                                          yyextra->current->args += " override "; 
                                           BEGIN(FuncQual);
                                         }
 <FuncQual,TrailingReturn>{BN}*"final"{BN}*             { // C++11 final method
-                                          lineCount() ; 
-                                          current->spec |= Entry::Final;
-                                          current->args += " final "; 
+                                          lineCount(yyscanner) ; 
+                                          yyextra->current->spec |= Entry::Final;
+                                          yyextra->current->args += " final "; 
                                           BEGIN(FuncQual);
                                         }
 <FuncQual>{BN}*"sealed"{BN}*            { // sealed member function
-                                          lineCount() ; 
-                                          current->spec |= Entry::Sealed;
-                                          current->args += " sealed "; 
+                                          lineCount(yyscanner) ; 
+                                          yyextra->current->spec |= Entry::Sealed;
+                                          yyextra->current->args += " sealed "; 
                                         }
 <FuncQual>{BN}*"new"{BN}*               { // new member function
-                                          lineCount() ; 
-                                          current->spec |= Entry::New;
-                                          current->args += " new "; 
+                                          lineCount(yyscanner) ; 
+                                          yyextra->current->spec |= Entry::New;
+                                          yyextra->current->args += " new "; 
                                         }
 <FuncQual>{BN}*"const"{BN}*            { // const member function
-                                         lineCount() ; 
-                                         current->args += " const "; 
-                                         current->argList->constSpecifier=TRUE;
+                                         lineCount(yyscanner) ; 
+                                         yyextra->current->args += " const "; 
+                                         yyextra->current->argList.constSpecifier=TRUE;
                                        }
 <FuncQual>{BN}*"volatile"{BN}*         { // volatile member function
-                                         lineCount() ; 
-                                         current->args += " volatile "; 
-                                         current->argList->volatileSpecifier=TRUE;
+                                         lineCount(yyscanner) ; 
+                                         yyextra->current->args += " volatile "; 
+                                         yyextra->current->argList.volatileSpecifier=TRUE;
                                        }
 <FuncQual>{BN}*"noexcept"{BN}*         { // noexcept qualifier
-                                         lineCount() ; 
-                                         current->args += " noexcept "; 
-                                         current->spec |= Entry::NoExcept;
+                                         lineCount(yyscanner) ; 
+                                         yyextra->current->args += " noexcept "; 
+                                         yyextra->current->spec |= Entry::NoExcept;
                                        }
 <FuncQual>{BN}*"noexcept"{BN}*"("      { // noexcept expression
-                                         lineCount() ; 
-                                         current->args += " noexcept("; 
-                                         current->spec |= Entry::NoExcept;
-                                         lastRoundContext=FuncQual;
-                                         pCopyRoundString=&current->args;
-                                         roundCount=0;
+                                         lineCount(yyscanner) ; 
+                                         yyextra->current->args += " noexcept("; 
+                                         yyextra->current->spec |= Entry::NoExcept;
+                                         yyextra->lastRoundContext=FuncQual;
+                                         yyextra->pCopyRoundString=&yyextra->current->args;
+                                         yyextra->roundCount=0;
                                           BEGIN(CopyRound);
                                         }
 <FuncQual>{BN}*"&"                      {
-                                          current->args += " &";
-                                          current->argList->refQualifier=RefQualifierLValue;
+                                          yyextra->current->args += " &";
+                                          yyextra->current->argList.refQualifier=RefQualifierLValue;
                                         }
 <FuncQual>{BN}*"&&"                     {
-                                          current->args += " &&";
-                                          current->argList->refQualifier=RefQualifierRValue;
+                                          yyextra->current->args += " &&";
+                                          yyextra->current->argList.refQualifier=RefQualifierRValue;
                                         }
 
 <FuncQual,TrailingReturn>{BN}*"="{BN}*"0"{BN}*         { // pure virtual member function
-                                         lineCount() ; 
-                                         current->args += " = 0"; 
-                                         current->virt = Pure; 
-                                         current->argList->pureSpecifier=TRUE;
+                                         lineCount(yyscanner) ; 
+                                         yyextra->current->args += " = 0"; 
+                                         yyextra->current->virt = Pure; 
+                                         yyextra->current->argList.pureSpecifier=TRUE;
                                           BEGIN(FuncQual);
                                        }
 <FuncQual,TrailingReturn>{BN}*"="{BN}*"delete"{BN}*     { // C++11 explicitly delete member
-                                          lineCount();
-                                          current->args += " = delete";
-                                         current->spec |= Entry::Delete;
-                                         current->argList->isDeleted=TRUE;
+                                          lineCount(yyscanner);
+                                          yyextra->current->args += " = delete";
+                                         yyextra->current->spec |= Entry::Delete;
+                                         yyextra->current->argList.isDeleted=TRUE;
                                           BEGIN(FuncQual);
                                         }
 <FuncQual,TrailingReturn>{BN}*"="{BN}*"default"{BN}*     { // C++11 explicitly defaulted constructor/assignment operator
-                                          lineCount();
-                                          current->args += " = default";
-                                         current->spec |= Entry::Default;
+                                          lineCount(yyscanner);
+                                          yyextra->current->args += " = default";
+                                         yyextra->current->spec |= Entry::Default;
                                           BEGIN(FuncQual);
                                         }
 <FuncQual>{BN}*"->"{BN}*                {
-                                          lineCount();
-                                          current->argList->trailingReturnType = " -> ";
-                                          current->args += " -> ";
+                                          lineCount(yyscanner);
+                                          yyextra->current->argList.trailingReturnType = " -> ";
+                                          yyextra->current->args += " -> ";
                                           BEGIN(TrailingReturn);
                                         }
 <TrailingReturn>[{;]                    {
@@ -4925,30 +4534,30 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                           BEGIN(FuncQual);
                                         }
 <TrailingReturn>.                       {
-                                          current->argList->trailingReturnType+=yytext;
-                                          current->args+=yytext;
+                                          yyextra->current->argList.trailingReturnType+=yytext;
+                                          yyextra->current->args+=yytext;
                                         }
 <TrailingReturn>\n                      {
-                                          lineCount();
-                                          current->argList->trailingReturnType+=yytext;
-                                          current->args+=' ';
+                                          lineCount(yyscanner);
+                                          yyextra->current->argList.trailingReturnType+=yytext;
+                                          yyextra->current->args+=' ';
                                         }
 <FuncRound,FuncFunc>{BN}*","{BN}*      { 
-                                         lineCount() ; 
-                                         current->args += ", " ; 
+                                         lineCount(yyscanner) ; 
+                                         yyextra->current->args += ", " ; 
                                        }
 <FuncQual,FuncRound,FuncFunc>{BN}+     { 
-                                         lineCount() ; 
-                                         current->args += ' ' ; 
+                                         lineCount(yyscanner) ; 
+                                         yyextra->current->args += ' ' ; 
                                        }
-<Function,FuncQual,FuncRound,FuncFunc>"#" { if (insidePHP)
+<Function,FuncQual,FuncRound,FuncFunc>"#" { if (yyextra->insidePHP)
                                            REJECT;
-                                         lastCPPContext = YY_START;
+                                         yyextra->lastCPPContext = YY_START;
                                          BEGIN(SkipCPP);
                                        }       
 <FuncQual>"="                          { 
-                                          if (insideCli && 
-                                             (current_root->section&Entry::COMPOUND_MASK) 
+                                          if (yyextra->insideCli && 
+                                             (yyextra->current_root->section&Entry::COMPOUND_MASK) 
                                             )
                                          {
                                            BEGIN(CliOverride);
@@ -4956,9 +4565,9 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                          else
                                          {
                                             // typically an initialized function pointer
-                                           lastInitializerContext=YY_START;
-                                           initBracketCount=0;
-                                            current->initializer = yytext;
+                                           yyextra->lastInitializerContext=YY_START;
+                                           yyextra->initBracketCount=0;
+                                            yyextra->current->initializer = yytext;
                                            BEGIN(ReadInitializer);
                                          }
                                        }
@@ -4969,7 +4578,7 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                          BEGIN(FuncQual);
                                        }
 <CliOverride>\n                                {
-                                          lineCount();
+                                          lineCount(yyscanner);
                                        }
 <CliOverride>.                         {
                                        }
@@ -4978,93 +4587,96 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                          BEGIN(FuncQual);
                                        }
 <FuncPtrInit>\"                                {
-                                          current->args += *yytext; 
-                                         pCopyQuotedString=&current->args;
-                                         lastStringContext=FuncPtrInit;
+                                          yyextra->current->args += *yytext; 
+                                         yyextra->pCopyQuotedString=&yyextra->current->args;
+                                         yyextra->lastStringContext=FuncPtrInit;
                                          BEGIN(CopyString);
                                        }
 <FuncPtrInit>\'                                {
-                                          current->args += *yytext; 
-                                         if (insidePHP)
+                                          yyextra->current->args += *yytext; 
+                                         if (yyextra->insidePHP)
                                          {
-                                           pCopyQuotedString=&current->args;
-                                           lastStringContext=FuncPtrInit;
+                                           yyextra->pCopyQuotedString=&yyextra->current->args;
+                                           yyextra->lastStringContext=FuncPtrInit;
                                            BEGIN(CopyPHPString);
                                          }
                                        }
 <FuncPtrInit>{CHARLIT}                 {
-                                          if (insidePHP)
+                                          if (yyextra->insidePHP)
                                          {
                                            REJECT;
                                          }
                                          else
                                          {
-                                            current->args += yytext; 
+                                            yyextra->current->args += yytext; 
                                          }
                                        }
 <FuncPtrInit>{ID}                      {
-                                          current->args += yytext; 
+                                          yyextra->current->args += yytext; 
                                        }
 <FuncPtrInit>.                         {
-                                          current->args += *yytext; 
+                                          yyextra->current->args += *yytext; 
                                        }
 <FuncPtrInit>\n                                {
-                                          current->args += *yytext; 
-                                          lineCount();
+                                          yyextra->current->args += *yytext; 
+                                          lineCount(yyscanner);
                                        }
 <FuncQual>{ID}                         { // typically a K&R style C function
-                                          if (insideCS && qstrcmp(yytext,"where")==0)
+                                          if (yyextra->insideCS && qstrcmp(yytext,"where")==0)
                                          { 
                                            // type constraint for a method
-                                            delete current->typeConstr;
-                                            current->typeConstr = new ArgumentList;
-                                           current->typeConstr->append(new Argument);
-                                           lastCSConstraint = YY_START;
+                                           yyextra->current->typeConstr.clear();
+                                           yyextra->current->typeConstr.push_back(Argument());
+                                           yyextra->lastCSConstraint = YY_START;
                                            BEGIN( CSConstraintName );
                                          }
-                                         else if (checkForKnRstyleC())
+                                         else if (checkForKnRstyleC(yyscanner))
                                          {
-                                            current->args = yytext; 
-                                           oldStyleArgType.resize(0);
+                                            yyextra->current->args = yytext; 
+                                           yyextra->oldStyleArgType.resize(0);
                                            BEGIN(OldStyleArgs);
                                          }
                                          else
                                          {
-                                            current->args += yytext; 
+                                            yyextra->current->args += yytext; 
                                          }
                                        }
 <OldStyleArgs>[,;]                     {
                                          QCString oldStyleArgPtr;
                                          QCString oldStyleArgName;
-                                         splitKnRArg(oldStyleArgPtr,oldStyleArgName);
+                                         splitKnRArg(yyscanner,oldStyleArgPtr,oldStyleArgName);
                                          QCString doc,brief;
-                                         if (current->doc!=docBackup)
+                                         if (yyextra->current->doc!=yyextra->docBackup)
                                          {
-                                            doc=current->doc.copy();
-                                           current->doc=docBackup;
+                                            doc=yyextra->current->doc.copy();
+                                           yyextra->current->doc=yyextra->docBackup;
                                          }
-                                         if (current->brief!=briefBackup)
+                                         if (yyextra->current->brief!=yyextra->briefBackup)
                                          {
-                                            brief=current->brief.copy();
-                                           current->brief=briefBackup;
+                                            brief=yyextra->current->brief.copy();
+                                           yyextra->current->brief=yyextra->briefBackup;
                                          }
-                                         addKnRArgInfo(oldStyleArgType+oldStyleArgPtr,
+                                         addKnRArgInfo(yyscanner,yyextra->oldStyleArgType+oldStyleArgPtr,
                                                        oldStyleArgName,brief,doc);
-                                         current->args.resize(0);
-                                         if (*yytext==';') oldStyleArgType.resize(0);
+                                         yyextra->current->args.resize(0);
+                                         if (*yytext==';') yyextra->oldStyleArgType.resize(0);
                                        }
-<OldStyleArgs>{ID}                     { current->args += yytext; }
+<OldStyleArgs>{ID}                     { yyextra->current->args += yytext; }
 <OldStyleArgs>"{"                      {
-                                         current->args = argListToString(current->argList);
+                                          if (yyextra->current->argList.empty())
+                                          {
+                                            yyextra->current->argList.noParameters=TRUE;
+                                          }
+                                         yyextra->current->args = argListToString(yyextra->current->argList);
                                          unput('{');
                                          BEGIN(FuncQual);
                                        }
-<OldStyleArgs>.                                { current->args += *yytext; }
-<FuncQual,FuncRound,FuncFunc>.         { current->args += *yytext; }
+<OldStyleArgs>.                                { yyextra->current->args += *yytext; }
+<FuncQual,FuncRound,FuncFunc>.         { yyextra->current->args += *yytext; }
 <FuncQual>{BN}*"try:"                  |
 <FuncQual>{BN}*"try"{BN}+              { /* try-function-block */ 
-                                         insideTryBlock=TRUE;
-                                         lineCount();
+                                         yyextra->insideTryBlock=TRUE;
+                                         lineCount(yyscanner);
                                          if (yytext[yyleng-1]==':')
                                          {
                                            unput(':');
@@ -5072,33 +4684,33 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                          }
                                        }
 <FuncQual>{BN}*"throw"{BN}*"("         { // C++ style throw clause
-                                         current->exception = " throw (" ;
-                                         roundCount=0;
-                                         lineCount() ;
+                                         yyextra->current->exception = " throw (" ;
+                                         yyextra->roundCount=0;
+                                         lineCount(yyscanner) ;
                                          BEGIN( ExcpRound ) ;
                                        }
 <FuncQual>{BN}*"raises"{BN}*"("         {
-                                         current->exception = " raises (" ;
-                                         lineCount() ;
-                                         roundCount=0;
+                                         yyextra->current->exception = " raises (" ;
+                                         lineCount(yyscanner) ;
+                                         yyextra->roundCount=0;
                                          BEGIN( ExcpRound ) ;
                                        }
 <FuncQual>{BN}*"throws"{BN}+           { // Java style throw clause
-                                         current->exception = " throws " ;
-                                         lineCount() ;
+                                         yyextra->current->exception = " throws " ;
+                                         lineCount(yyscanner) ;
                                          BEGIN( ExcpList );
                                        }
-<ExcpRound>"("                         { current->exception += *yytext ;
-                                         ++roundCount ;
+<ExcpRound>"("                         { yyextra->current->exception += *yytext ;
+                                         ++yyextra->roundCount ;
                                        }
-<ExcpRound>")"                          { current->exception += *yytext ; 
-                                         if ( roundCount )
-                                           --roundCount ;
+<ExcpRound>")"                          { yyextra->current->exception += *yytext ; 
+                                         if ( yyextra->roundCount )
+                                           --yyextra->roundCount ;
                                          else
                                            BEGIN( FuncQual ) ;
                                        }
 <ExcpRound>.                           {
-                                         current->exception += *yytext;
+                                         yyextra->current->exception += *yytext;
                                        }
 <ExcpList>"{"                          {
                                          unput('{'); BEGIN( FuncQual );
@@ -5107,101 +4719,101 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                          unput(';'); BEGIN( FuncQual );
                                        }
 <ExcpList>"\n"                         {
-                                         current->exception += ' ';
-                                          lineCount();
+                                         yyextra->current->exception += ' ';
+                                          lineCount(yyscanner);
                                        }
 <ExcpList>.                            {
-                                         current->exception += *yytext;
+                                         yyextra->current->exception += *yytext;
                                        }
-<Function>"("                          { current->type += current->name ;
-                                         current->name  = current->args ;
-                                         current->args  = yytext ;
-                                         roundCount=0;
+<Function>"("                          { yyextra->current->type += yyextra->current->name ;
+                                         yyextra->current->name  = yyextra->current->args ;
+                                         yyextra->current->args  = yytext ;
+                                         yyextra->roundCount=0;
                                          BEGIN( FuncRound ) ;
                                        }
 <Function>":"                          {
-                                         if (!insidePHP) BEGIN(SkipInits);
+                                         if (!yyextra->insidePHP) BEGIN(SkipInits);
                                        }
 <Function>[;{,]                                { 
-                                         current->name=current->name.simplifyWhiteSpace();
-                                         current->type=current->type.simplifyWhiteSpace();
-                                         current->args=removeRedundantWhiteSpace(current->args);
-                                                       // was: current->args.simplifyWhiteSpace();
-                                         current->fileName = yyFileName;
-                                         current->startLine = yyBegLineNr;
-                                         current->startColumn = yyBegColNr;
+                                         yyextra->current->name=yyextra->current->name.simplifyWhiteSpace();
+                                         yyextra->current->type=yyextra->current->type.simplifyWhiteSpace();
+                                         yyextra->current->args=removeRedundantWhiteSpace(yyextra->current->args);
+                                                       // was: yyextra->current->args.simplifyWhiteSpace();
+                                         yyextra->current->fileName = yyextra->yyFileName;
+                                         yyextra->current->startLine = yyextra->yyBegLineNr;
+                                         yyextra->current->startColumn = yyextra->yyBegColNr;
                                          static QRegExp re("([^)]*[*&][^)]*)"); // (...*...)
-                                         if (*yytext!=';' || (current_root->section&Entry::COMPOUND_MASK) )
+                                         if (*yytext!=';' || (yyextra->current_root->section&Entry::COMPOUND_MASK) )
                                          {
-                                           int tempArg=current->name.find('<');
-                                            int ts=current->type.find('<');
-                                            int te=current->type.findRev('>');
-                                            int ti=current->type.find(re,0);
+                                           int tempArg=yyextra->current->name.find('<');
+                                            int ts=yyextra->current->type.find('<');
+                                            int te=yyextra->current->type.findRev('>');
+                                            int ti=yyextra->current->type.find(re,0);
 
                                             // bug677315: A<int(void *, char *)> get(); is not a function pointer
                                             bool isFunction = ti==-1 || // not a (...*...) pattern
                                                               (ts!=-1 && ts<te && ts<ti && ti<te); // (...*...) is part of a template argument list
                                                               
                                             //printf("type=%s ts=%d te=%d ti=%d isFunction=%d\n",
-                                            //    current->type.data(),ts,te,ti,isFunction);
+                                            //    yyextra->current->type.data(),ts,te,ti,isFunction);
                                            QCString tempName;
-                                           if (tempArg==-1) tempName=current->name; else tempName=current->name.left(tempArg);
-                                           if (!current->type.isEmpty() &&
-                                               (!isFunction || current->type.left(8)=="typedef "))
+                                           if (tempArg==-1) tempName=yyextra->current->name; else tempName=yyextra->current->name.left(tempArg);
+                                           if (!yyextra->current->type.isEmpty() &&
+                                               (!isFunction || yyextra->current->type.left(8)=="typedef "))
                                            {
-                                             //printf("Scanner.l: found in class variable: '%s' '%s' '%s'\n", current->type.data(),current->name.data(),current->args.data());
-                                             if (isTypedef && current->type.left(8)!="typedef ")
+                                             //printf("Scanner.l: found in class variable: '%s' '%s' '%s'\n", yyextra->current->type.data(),yyextra->current->name.data(),yyextra->current->args.data());
+                                             if (yyextra->isTypedef && yyextra->current->type.left(8)!="typedef ")
                                              {
-                                               current->type.prepend("typedef ");
+                                               yyextra->current->type.prepend("typedef ");
                                              }
-                                             current->section = Entry::VARIABLE_SEC ;
+                                             yyextra->current->section = Entry::VARIABLE_SEC ;
                                            }
                                            else              
                                            {
-                                             //printf("Scanner.l: found in class function: '%s' '%s' '%s'\n", current->type.data(),current->name.data(),current->args.data());
-                                             current->section = Entry::FUNCTION_SEC ;
-                                             current->proto = *yytext==';';
+                                             //printf("Scanner.l: found in class function: '%s' '%s' '%s'\n", yyextra->current->type.data(),yyextra->current->name.data(),yyextra->current->args.data());
+                                             yyextra->current->section = Entry::FUNCTION_SEC ;
+                                             yyextra->current->proto = *yytext==';';
                                            }
                                          }
                                          else // a global function prototype or function variable
                                          {
-                                           //printf("Scanner.l: prototype? type='%s' name='%s' args='%s'\n",current->type.data(),current->name.data(),current->args.data());
-                                           if (!current->type.isEmpty() && 
-                                               (current->type.find(re,0)!=-1 || current->type.left(8)=="typedef "))
+                                           //printf("Scanner.l: prototype? type='%s' name='%s' args='%s'\n",yyextra->current->type.data(),yyextra->current->name.data(),yyextra->current->args.data());
+                                           if (!yyextra->current->type.isEmpty() && 
+                                               (yyextra->current->type.find(re,0)!=-1 || yyextra->current->type.left(8)=="typedef "))
                                            {
-                                             if (isTypedef && current->type.left(8)!="typedef ")
+                                             if (yyextra->isTypedef && yyextra->current->type.left(8)!="typedef ")
                                              {
-                                               current->type.prepend("typedef ");
+                                               yyextra->current->type.prepend("typedef ");
                                              }
                                              //printf("Scanner.l: found function variable!\n");
-                                             current->section = Entry::VARIABLE_SEC;
+                                             yyextra->current->section = Entry::VARIABLE_SEC;
                                            }
                                            else
                                            {
                                              //printf("Scanner.l: found prototype\n");
-                                             current->section = Entry::FUNCTION_SEC;
-                                             current->proto = TRUE;
+                                             yyextra->current->section = Entry::FUNCTION_SEC;
+                                             yyextra->current->proto = TRUE;
                                            }
                                          }
-                                         //printf("Adding entry '%s'\n",current->name.data());
-                                         if ( insidePHP)
+                                         //printf("Adding entry '%s'\n",yyextra->current->name.data());
+                                         if ( yyextra->insidePHP)
                                          {
-                                           if (findAndRemoveWord(current->type,"final"))
+                                           if (findAndRemoveWord(yyextra->current->type,"final"))
                                            {
-                                             current->spec |= Entry::Final;
+                                             yyextra->current->spec |= Entry::Final;
                                            }
-                                           if (findAndRemoveWord(current->type,"abstract"))
+                                           if (findAndRemoveWord(yyextra->current->type,"abstract"))
                                            {
-                                             current->spec |= Entry::Abstract;
+                                             yyextra->current->spec |= Entry::Abstract;
                                            }
                                          }
-                                         if ( insidePHP && !containsWord(current->type,"function"))
+                                         if ( yyextra->insidePHP && !containsWord(yyextra->current->type,"function"))
                                          {
-                                           initEntry();
+                                           initEntry(yyscanner);
                                            if ( *yytext == '{' )
                                            {
-                                             lastCurlyContext = FindMembers;
-                                             curlyCount=0;
+                                             yyextra->lastCurlyContext = FindMembers;
+                                             yyextra->curlyCount=0;
                                              BEGIN( SkipCurly );
                                            }
                                            else
@@ -5211,67 +4823,66 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                          }
                                          else
                                          {
-                                           if ( insidePHP)
+                                           if ( yyextra->insidePHP)
                                            {
-                                             findAndRemoveWord(current->type,"function");
+                                             findAndRemoveWord(yyextra->current->type,"function");
                                            }
-                                           previous = current;
-                                           current_root->addSubEntry(current);
-                                           current = new Entry ;
-                                           initEntry();
+                                           yyextra->previous = yyextra->current;
+                                           yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
+                                           initEntry(yyscanner);
                                            // Objective C 2.0: Required/Optional section
-                                           if (previous->spec & (Entry::Optional | Entry::Required))
+                                           if (yyextra->previous->spec & (Entry::Optional | Entry::Required))
                                            {
-                                             current->spec |= previous->spec & (Entry::Optional|Entry::Required);
+                                             yyextra->current->spec |= yyextra->previous->spec & (Entry::Optional|Entry::Required);
                                            }
-                                           lastCurlyContext = FindMembers;
+                                           yyextra->lastCurlyContext = FindMembers;
                                            if ( *yytext == ',' )
                                            {
-                                             current->type = previous->type;
+                                             yyextra->current->type = yyextra->previous->type;
                                              // we need to strip any trailing * and & (see bugs 623023 and 649103 for test cases)
-                                             int i=current->type.length(); 
-                                             while (i>0 && (current->type[i-1]=='*' || current->type[i-1]=='&' || current->type[i-1]==' ')) i--;
-                                             current->type = current->type.left(i);
+                                             int i=yyextra->current->type.length(); 
+                                             while (i>0 && (yyextra->current->type[i-1]=='*' || yyextra->current->type[i-1]=='&' || yyextra->current->type[i-1]==' ')) i--;
+                                             yyextra->current->type = yyextra->current->type.left(i);
                                            }
                                            if ( *yytext == '{' )
                                            {
-                                             if ( !insidePHP && (current_root->section & Entry::COMPOUND_MASK) )
+                                             if ( !yyextra->insidePHP && (yyextra->current_root->section & Entry::COMPOUND_MASK) )
                                              {
-                                               previous->spec |= Entry::Inline;
+                                               yyextra->previous->spec |= Entry::Inline;
                                              }
                                              //addToBody(yytext);
-                                             curlyCount=0;
+                                             yyextra->curlyCount=0;
                                              BEGIN( SkipCurly ) ;
                                            }
                                            else
                                            {
-                                             if (previous->section!=Entry::VARIABLE_SEC)
-                                               previous->bodyLine=-1; // a function/member declaration
+                                             if (yyextra->previous->section!=Entry::VARIABLE_SEC)
+                                               yyextra->previous->bodyLine=-1; // a function/member declaration
                                              BEGIN( FindMembers ) ;
                                            }
                                          }
                                         }
 <SkipInits>">"{BN}*"{"                  { // C++11 style initializer (see bug 790788)
-                                          lineCount();
-                                          curlyCount=1;
+                                          lineCount(yyscanner);
+                                          yyextra->curlyCount=1;
                                           BEGIN(SkipC11Inits);
                                         }
 <SkipInits>{ID}{BN}*"{"                 { // C++11 style initializer (see bug 688647)
-                                          lineCount();
-                                          curlyCount=1;
+                                          lineCount(yyscanner);
+                                          yyextra->curlyCount=1;
                                           BEGIN(SkipC11Inits);
                                         }
 <SkipC11Inits>"{"                       {
-                                          ++curlyCount;
+                                          ++yyextra->curlyCount;
                                         }
 <SkipC11Inits>"}"                       {
-                                         if ( --curlyCount<=0 )
+                                         if ( --yyextra->curlyCount<=0 )
                                           {
                                             BEGIN(SkipInits);
                                           }
                                         }
 <SkipC11Attribute>"]]"                 {
-                                          BEGIN(lastC11AttributeContext);
+                                          BEGIN(yyextra->lastC11AttributeContext);
                                         }
 <SkipInits>"{"                         { // C++11 style initializer
                                          unput('{');
@@ -5279,193 +4890,197 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                        }
 <SkipCurly>"{"                         { 
                                          //addToBody(yytext);
-                                         ++curlyCount ; 
+                                         ++yyextra->curlyCount ; 
                                        }
 <SkipCurly>"}"/{BN}*("/*!"|"/**"|"//!"|"///")"<!--" | /* see bug710917 */
 <SkipCurly>"}"                         { 
                                          //addToBody(yytext);
-                                         if( curlyCount )
+                                         if( yyextra->curlyCount )
                                          {
-                                           --curlyCount ;
+                                           --yyextra->curlyCount ;
                                          }
                                          else
                                          {
-                                           if (current->sli && previous) // copy special list items
+                                           if (!yyextra->current->sli.empty() && yyextra->previous) // copy special list items
                                            {
-                                             QListIterator<ListItemInfo> li(*current->sli);
-                                             ListItemInfo *lii;
-                                             for (li.toFirst();(lii=li.current());++li)
-                                             {
-                                               previous->addSpecialListItem(lii->type,lii->itemId);
-                                             }
-                                             delete current->sli;
-                                             current->sli = 0;
+                                              yyextra->previous->sli = yyextra->current->sli;
+                                             yyextra->current->sli.clear();
                                            }
-                                           if (previous) previous->endBodyLine=yyLineNr;
-                                           BEGIN( lastCurlyContext ) ;
+                                           if (yyextra->previous) yyextra->previous->endBodyLine=yyextra->yyLineNr;
+                                           BEGIN( yyextra->lastCurlyContext ) ;
                                          }
                                        }
 <SkipCurly>"}"{BN}*("/*!"|"/**"|"//!"|"///")"<" { 
-                                         lineCount();
-                                         if ( curlyCount )
+                                         lineCount(yyscanner);
+                                         if ( yyextra->curlyCount )
                                          {
                                            //addToBody(yytext);
-                                           --curlyCount ;
+                                           --yyextra->curlyCount ;
                                          }
                                          else
                                          {
-                                           current->endBodyLine=yyLineNr;
-
-                                           tempEntry = current; // temporarily switch to the previous entry
-                                           current = previous;
-                                           previous = 0;
+                                           yyextra->current->endBodyLine=yyextra->yyLineNr;
+                                            // take yyextra->previous out of yyextra->current_root and move it into yyextra->current
+                                           yyextra->tempEntry = yyextra->current; // remember yyextra->current
+                                            yyextra->current_root->moveFromSubEntry(yyextra->previous.get(),yyextra->current);
+                                           yyextra->previous.reset();
 
-                                           docBlockContext   = SkipCurlyEndDoc;
-                                           docBlockInBody    = FALSE;
-                                           docBlockAutoBrief = ( yytext[yyleng-2]=='*' && Config_getBool(JAVADOC_AUTOBRIEF) ) ||
+                                           yyextra->docBlockContext   = SkipCurlyEndDoc;
+                                           yyextra->docBlockInBody    = FALSE;
+                                           yyextra->docBlockAutoBrief = ( yytext[yyleng-2]=='*' && Config_getBool(JAVADOC_AUTOBRIEF) ) ||
                                                                ( yytext[yyleng-2]=='!' && Config_getBool(QT_AUTOBRIEF) );
-                                           docBlock.resize(0);
-                                           docBlockTerm = '}';
+                                           yyextra->docBlock.resize(0);
+                                           yyextra->docBlockTerm = '}';
                                            if (yytext[yyleng-3]=='/')
                                            {
-                                             startCommentBlock(TRUE);
+                                             startCommentBlock(yyscanner,TRUE);
                                              BEGIN( DocLine );
                                            }
                                            else
                                            {
-                                             startCommentBlock(FALSE);
+                                             startCommentBlock(yyscanner,FALSE);
                                              BEGIN( DocBlock );
                                            }
                                          }
                                        }
 <SkipCurlyEndDoc>"}"{BN}*("/*!"|"/**"|"//!"|"///")"<" { // desc is followed by another one
-                                         docBlockContext   = SkipCurlyEndDoc;
-                                         docBlockInBody    = FALSE;
-                                         docBlockAutoBrief = ( yytext[yyleng-2]=='*' && Config_getBool(JAVADOC_AUTOBRIEF) ) ||
+                                         yyextra->docBlockContext   = SkipCurlyEndDoc;
+                                         yyextra->docBlockInBody    = FALSE;
+                                         yyextra->docBlockAutoBrief = ( yytext[yyleng-2]=='*' && Config_getBool(JAVADOC_AUTOBRIEF) ) ||
                                                              ( yytext[yyleng-2]=='!' && Config_getBool(QT_AUTOBRIEF) );
-                                         docBlock.resize(0);
-                                         docBlockTerm = '}';
+                                         yyextra->docBlock.resize(0);
+                                         yyextra->docBlockTerm = '}';
                                          if (yytext[yyleng-3]=='/')
                                          {
-                                           startCommentBlock(TRUE);
+                                           startCommentBlock(yyscanner,TRUE);
                                            BEGIN( DocLine );
                                          }
                                          else
                                          {
-                                           startCommentBlock(FALSE);
+                                           startCommentBlock(yyscanner,FALSE);
                                            BEGIN( DocBlock );
                                          }
                                        }
 <SkipCurlyEndDoc>"}"                   {
                                          //addToBody("}");
-                                          if (tempEntry) // we can only switch back to current if no new item was created
+                                          if (yyextra->tempEntry) // we can only switch back to yyextra->current if no new item was created
                                          {
-                                           current = tempEntry;
-                                           tempEntry = 0;
+                                           yyextra->current = yyextra->tempEntry;
+                                           yyextra->tempEntry.reset();
                                          }
-                                         BEGIN( lastCurlyContext );
+                                         BEGIN( yyextra->lastCurlyContext );
                                        }
 <SkipCurly>\"                          { 
                                          //addToBody(yytext);
-                                         lastStringContext=SkipCurly;
+                                         yyextra->lastStringContext=SkipCurly;
                                          BEGIN( SkipString ); 
                                        }
 <SkipCurly>^{B}*"#"                    { 
-                                         if (insidePHP)
+                                         if (yyextra->insidePHP)
                                            REJECT;
                                          //addToBody(yytext);
                                          BEGIN( SkipCurlyCpp );
                                        }
 <SkipCurly,SkipC11Inits,SkipInits,SkipC11Attribute>\n  {
-                                          lineCount();
+                                          lineCount(yyscanner);
                                          //addToBody(yytext);
                                        }
 <SkipCurly,SkipCurlyCpp,ReadInitializer>"<<<"          {
-                                         if (!insidePHP) 
+                                         if (!yyextra->insidePHP) 
                                          {
                                            REJECT;
                                          }
                                          else
                                          {
-                                            lastHereDocContext = YY_START;
+                                            yyextra->lastHereDocContext = YY_START;
                                            BEGIN(HereDoc);
                                          }
                                        }
+<SkipCurly,SkipCurlyCpp>{B}*{RAWBEGIN}  {
+                                          QCString raw=QCString(yytext).stripWhiteSpace();
+                                          yyextra->delimiter = raw.data()+2;
+                                          yyextra->delimiter=yyextra->delimiter.left(yyextra->delimiter.length()-1);
+                                          yyextra->lastRawStringContext = YY_START;
+                                          yyextra->dummyRawString.resize(0);
+                                          yyextra->pCopyRawString = &yyextra->dummyRawString;
+                                          *yyextra->pCopyRawString+=yytext;
+                                          BEGIN(RawString);
+                                        }
 <SkipCurly,SkipCurlyCpp>[^\n#"'@\\/{}<]+ {
-                                          lineCount();  // for g_column updates
+                                          lineCount(yyscanner);  // for yyextra->column updates
                                          //addToBody(yytext);
                                        }
 <SkipCurlyCpp>\n                       { 
                                          //addToBody(yytext);
-                                          lineCount();
-                                         lastCurlyContext = FindMembers;
+                                          lineCount(yyscanner);
+                                         yyextra->lastCurlyContext = FindMembers;
                                          BEGIN( SkipCurly ); 
                                        }
 <SkipCurlyCpp>\\[\r]*"\n"[\r]*         { 
                                          //addToBody(yytext);
-                                          lineCount();
+                                          lineCount(yyscanner);
                                        }
 <SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp,SkipC11Attribute>"/*"   {
                                          //addToBody(yytext);
-                                         lastCContext = YY_START;
+                                         yyextra->lastCContext = YY_START;
                                          BEGIN(SkipComment);
                                        }
 <SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp,SkipC11Attribute>"//"  {
                                          //addToBody(yytext);
-                                         lastCContext = YY_START;
+                                         yyextra->lastCContext = YY_START;
                                          BEGIN(SkipCxxComment);
                                        }
 <SkipInits,SkipC11Inits,SkipC11Attribute>"("             {
-                                          roundCount=0;
-                                          lastSkipRoundContext=YY_START;
+                                          yyextra->roundCount=0;
+                                          yyextra->lastSkipRoundContext=YY_START;
                                           BEGIN(SkipRound);
                                         }
 <SkipInits,SkipC11Inits,SkipC11Attribute>\"            {
-                                         lastStringContext=YY_START;
+                                         yyextra->lastStringContext=YY_START;
                                          BEGIN( SkipString ); 
                                        }
 <SkipInits>;                           {
-                                         warn(yyFileName,yyLineNr,
+                                         warn(yyextra->yyFileName,yyextra->yyLineNr,
                                              "Found ';' while parsing initializer list! "
                                              "(doxygen could be confused by a macro call without semicolon)"
                                             );
                                          BEGIN( FindMembers );
                                        }
 <SkipInits,SkipCurly,SkipCurlyCpp>"#"   {
-                                         if (!insidePHP)
+                                         if (!yyextra->insidePHP)
                                            REJECT;
                                          //addToBody(yytext);
-                                         lastCContext = YY_START;
+                                         yyextra->lastCContext = YY_START;
                                          BEGIN(SkipCxxComment);
                                        }
 <SkipInits,SkipCurly,SkipCurlyCpp>@\"   {
-                                         if (!insideCS) REJECT;
+                                         if (!yyextra->insideCS) REJECT;
                                          // C# verbatim string
-                                         lastSkipVerbStringContext=YY_START;
-                                         pSkipVerbString=&current->initializer;
+                                         yyextra->lastSkipVerbStringContext=YY_START;
+                                         yyextra->pSkipVerbString=&yyextra->current->initializer;
                                          BEGIN(SkipVerbString);
                                        }
 <SkipInits,SkipCurly,SkipCurlyCpp>{CHARLIT}    {
-                                          if (insidePHP) REJECT;
+                                          if (yyextra->insidePHP) REJECT;
                                         }
 <SkipInits,SkipCurly,SkipCurlyCpp>\'   {
-                                         if (insidePHP)
+                                         if (yyextra->insidePHP)
                                          {
-                                           lastStringContext=YY_START;
+                                           yyextra->lastStringContext=YY_START;
                                            BEGIN(SkipPHPString);
                                          }
                                        }
 <SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp,SkipC11Attribute>.      { }
 <SkipString,SkipPHPString>\\.          { }
 <SkipString>\"                         { 
-                                         BEGIN( lastStringContext ); 
+                                         BEGIN( yyextra->lastStringContext ); 
                                        }
 <SkipPHPString>\'                      { 
-                                         BEGIN( lastStringContext ); 
+                                         BEGIN( yyextra->lastStringContext ); 
                                        }
 <SkipString,SkipPHPString>"/*"|"*/"|"//" { }
 <SkipString,SkipPHPString>\n           {
-                                          lineCount();
+                                          lineCount(yyscanner);
                                        }
 <SkipString,SkipPHPString>.            { }
 <CompoundName>":"                      { // for "class : public base {} var;" construct, see bug 608359
@@ -5473,250 +5088,243 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                          BEGIN(ClassVar);
                                        }
 <CompoundName>";"                      {
-                                         current->section = Entry::EMPTY_SEC ;
-                                         current->type.resize(0) ;
-                                         current->name.resize(0) ;
-                                         current->args.resize(0) ;
-                                         current->argList->clear();
+                                         yyextra->current->section = Entry::EMPTY_SEC ;
+                                         yyextra->current->type.resize(0) ;
+                                         yyextra->current->name.resize(0) ;
+                                         yyextra->current->args.resize(0) ;
+                                         yyextra->current->argList.clear();
                                          BEGIN( FindMembers ) ;
                                        }
 <Bases>";"                     {
-                                         if (insideIDL && (current->spec & (Entry::Singleton |
+                                         if (yyextra->insideIDL && (yyextra->current->spec & (Entry::Singleton |
                                                                             Entry::Service)))
                                          {
                                            // in UNO IDL a service or singleton may be defined
                                            // completely like this: "service Foo : XFoo;"
-                                           if (!current->name.isEmpty() && !current_root->name.isEmpty())
+                                           if (!yyextra->current->name.isEmpty() && !yyextra->current_root->name.isEmpty())
                                            {
-                                             prependScope();
+                                             prependScope(yyscanner);
                                            }
-                                           current->name = current->name.stripWhiteSpace();
+                                           yyextra->current->name = yyextra->current->name.stripWhiteSpace();
                                            // there can be only one base class here
-                                           if (!baseName.isEmpty())
+                                           if (!yyextra->baseName.isEmpty())
                                            {
-                                             current->extends->append(
-                                               new BaseInfo(baseName,Public,Normal));
-                                             baseName.resize(0);
+                                             yyextra->current->extends.push_back(
+                                               BaseInfo(yyextra->baseName,Public,Normal));
+                                             yyextra->baseName.resize(0);
                                            }
-                                           current_root->addSubEntry( current ) ;
-                                           current = new Entry;
+                                           yyextra->current_root->moveToSubEntryAndRefresh( yyextra->current ) ;
+                                            initEntry(yyscanner);
                                          }
                                          else
                                          {
-                                           current->section = Entry::EMPTY_SEC ;
-                                           current->type.resize(0) ;
-                                           current->name.resize(0) ;
-                                           current->args.resize(0) ;
-                                           current->argList->clear();
+                                           yyextra->current->section = Entry::EMPTY_SEC ;
+                                           yyextra->current->type.resize(0) ;
+                                           yyextra->current->name.resize(0) ;
+                                           yyextra->current->args.resize(0) ;
+                                           yyextra->current->argList.clear();
                                          }
                                          BEGIN( FindMembers ) ;
                                        }
 <CompoundName>{SCOPENAME}/{BN}*"<"     {
-                                         sharpCount = 0;
-                                         current->name = yytext ;
-                                         if (current->spec & Entry::Protocol)
+                                         yyextra->sharpCount = 0;
+                                         yyextra->current->name = yytext ;
+                                         if (yyextra->current->spec & Entry::Protocol)
                                          {
-                                           current->name+="-p";
+                                           yyextra->current->name+="-p";
                                          }
-                                         lineCount();
-                                         lastClassTemplSpecContext = ClassVar;
-                                         if (insideObjC) // protocol list
+                                         lineCount(yyscanner);
+                                         yyextra->lastClassTemplSpecContext = ClassVar;
+                                         if (yyextra->insideObjC) // protocol list
                                          {
                                            BEGIN( ObjCProtocolList );
                                          }
-                                         else if (insideCS) // C# generic class
+                                         else if (yyextra->insideCS) // C# generic class
                                          {
-                                            //current->name+="-g";
+                                            //yyextra->current->name+="-g";
                                            BEGIN( CSGeneric );
                                          }
                                          else // C++ template specialization
                                          {
-                                           roundCount=0;
+                                           yyextra->roundCount=0;
                                            BEGIN( ClassTemplSpec );
                                          }
                                        }
 <CSGeneric>"<"                         {
-                                         if (current->tArgLists==0)
-                                         {
-                                           current->tArgLists = new QList<ArgumentList>;
-                                           current->tArgLists->setAutoDelete(TRUE);
-                                         }
-                                         ArgumentList *al = new ArgumentList;
+                                         ArgumentList al;
                                          // check bug 612858 before enabling the next line
-                                         //current->spec |= Entry::Template;
-                                         current->tArgLists->append(al);
-                                         currentArgumentList = al;
-                                         templateStr="<";
-                                         current->name += "<";
-                                         fullArgString = templateStr;
-                                         copyArgString = &current->name;
-                                         //copyArgString = &templateStr;
-                                         currentArgumentContext = ClassVar;
+                                         //yyextra->current->spec |= Entry::Template;
+                                         yyextra->current->tArgLists.push_back(al);
+                                         yyextra->currentArgumentList = &yyextra->current->tArgLists.back();
+                                         yyextra->templateStr="<";
+                                         yyextra->current->name += "<";
+                                         yyextra->fullArgString = yyextra->templateStr;
+                                         yyextra->copyArgString = &yyextra->current->name;
+                                         //yyextra->copyArgString = &yyextra->templateStr;
+                                         yyextra->currentArgumentContext = ClassVar;
                                          BEGIN( ReadTempArgs );
                                        }
 <ObjCProtocolList>"<"                  {
-                                         insideProtocolList=TRUE;
+                                         yyextra->insideProtocolList=TRUE;
                                          BEGIN( Bases );
                                        }
 <ClassTemplSpec>">"({BN}*"::"{BN}*{SCOPENAME})?        {
-                                         current->name += yytext;
-                                         lineCount();
-                                         if (roundCount==0 && --sharpCount<=0)
+                                         yyextra->current->name += yytext;
+                                         lineCount(yyscanner);
+                                         if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
                                          {
-                                           current->name = removeRedundantWhiteSpace(current->name);
-                                           if (current->spec & Entry::Protocol)
+                                           yyextra->current->name = removeRedundantWhiteSpace(yyextra->current->name);
+                                           if (yyextra->current->spec & Entry::Protocol)
                                            { // Objective-C protocol
                                              unput('{'); // fake start of body
                                              BEGIN( ClassVar );
                                            }
                                            else
                                            {
-                                             BEGIN( lastClassTemplSpecContext );
+                                             BEGIN( yyextra->lastClassTemplSpecContext );
                                            }
                                          }
                                        }
 <ClassTemplSpec>"<"                    {
-                                         current->name += yytext;
-                                         if (roundCount==0) sharpCount++;
+                                         yyextra->current->name += yytext;
+                                         if (yyextra->roundCount==0) yyextra->sharpCount++;
                                        }
 <ClassTemplSpec>.                      {
-                                         current->name += yytext;
+                                         yyextra->current->name += yytext;
                                        }
 <CompoundName>{SCOPENAME}{BN}*";"      { // forward declaration
-                                          if (current->tArgLists && current->tArgLists->count()>0)
+                                          if (!yyextra->current->tArgLists.empty())
                                           {
                                             // found a forward template declaration, this has
                                             // a purpose of its own
-                                            current->name = yytext;
-                                            current->name=current->name.left(current->name.length()-1).stripWhiteSpace();
-                                            //printf("template class declaration for %s!\n",current->name.data());
-                                           QCString rn = current_root->name.copy();
-                                           //printf("cn='%s' rn='%s' isTypedef=%d\n",cn.data(),rn.data(),isTypedef);
-                                           if (!current->name.isEmpty() && !rn.isEmpty())
+                                            yyextra->current->name = yytext;
+                                            yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
+                                            //printf("template class declaration for %s!\n",yyextra->current->name.data());
+                                           QCString rn = yyextra->current_root->name.copy();
+                                           //printf("cn='%s' rn='%s' yyextra->isTypedef=%d\n",cn.data(),rn.data(),yyextra->isTypedef);
+                                           if (!yyextra->current->name.isEmpty() && !rn.isEmpty())
                                            {
-                                             prependScope();
+                                             prependScope(yyscanner);
                                            }
-                                            current->spec|=Entry::ForwardDecl;
-                                            current_root->addSubEntry(current);
-                                            current = new Entry;
+                                            yyextra->current->spec|=Entry::ForwardDecl;
+                                            yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
                                           }
-                                         else if (insideIDL &&
-                                                  (((current_root->spec & (Entry::Interface |
+                                         else if (yyextra->insideIDL &&
+                                                  (((yyextra->current_root->spec & (Entry::Interface |
                                                                            Entry::Service)) &&
-                                                    (current->spec & Entry::Interface)) ||
-                                                   ((current_root->spec & (Entry::Service |
+                                                    (yyextra->current->spec & Entry::Interface)) ||
+                                                   ((yyextra->current_root->spec & (Entry::Service |
                                                                            Entry::Singleton)) &&
-                                                    (current->spec & Entry::Service))))
+                                                    (yyextra->current->spec & Entry::Service))))
                                          {
-                                           // interface inside of UNO IDL service or interface
-                                           // service inside of UNO IDL service or singleton
+                                           // interface yyextra->inside of UNO IDL service or interface
+                                           // service yyextra->inside of UNO IDL service or singleton
                                            // there may be documentation on the member,
                                            // so do not throw it away...
-                                           current->name = yytext;
-                                           current->name=current->name.left(current->name.length()-1).stripWhiteSpace();
-                                           current->section = (current->spec & Entry::Interface)
+                                           yyextra->current->name = yytext;
+                                           yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-1).stripWhiteSpace();
+                                           yyextra->current->section = (yyextra->current->spec & Entry::Interface)
                                                ? Entry::EXPORTED_INTERFACE_SEC
                                                : Entry::INCLUDED_SERVICE_SEC;
-//                                         current->section = Entry::MEMBERDOC_SEC;
-                                           current->spec &= ~(Entry::Interface|Entry::Service); // FIXME: horrible: Interface == Gettable, so need to clear it - actually we're mixing values from different enums in this case... granted only Optional and Interface are actually valid in this context but urgh...
-                                           current_root->addSubEntry(current);
-                                           current = new Entry;
+//                                         yyextra->current->section = Entry::MEMBERDOC_SEC;
+                                           yyextra->current->spec &= ~(Entry::Interface|Entry::Service); // FIXME: horrible: Interface == Gettable, so need to clear it - actually we're mixing values from different enums in this case... granted only Optional and Interface are actually valid in this context but urgh...
+                                           yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
                                          }
 
                                          unput(';');
-                                         current->reset();
-                                         initEntry();
-                                          if (insideObjC) // see bug746361
+                                         yyextra->current->reset();
+                                         initEntry(yyscanner);
+                                          if (yyextra->insideObjC) // see bug746361
                                           {
-                                           language = current->lang = SrcLangExt_Cpp;
-                                            insideObjC = FALSE;
+                                           yyextra->language = yyextra->current->lang = SrcLangExt_Cpp;
+                                            yyextra->insideObjC = FALSE;
                                           }
-                                         if (isTypedef) // typedef of a class, put typedef keyword back
+                                         if (yyextra->isTypedef) // typedef of a class, put typedef keyword back
                                          {
-                                           current->type.prepend("typedef");
+                                           yyextra->current->type.prepend("typedef");
                                          }
                                          BEGIN( FindMembers );
                                        }
 <CompoundName>{SCOPENAME}/{BN}*"("     { 
-                                         current->name = yytext ;
-                                         lineCount();
-                                          if (insideCpp && current->name=="alignas") // C++11
+                                         yyextra->current->name = yytext ;
+                                         lineCount(yyscanner);
+                                          if (yyextra->insideCpp && yyextra->current->name=="alignas") // C++11
                                           {
-                                            lastAlignAsContext = YY_START;
+                                            yyextra->lastAlignAsContext = YY_START;
                                             BEGIN( AlignAs );
                                           }
                                           else
                                           {
-                                            if (current->spec & Entry::Protocol)
+                                            if (yyextra->current->spec & Entry::Protocol)
                                             {
-                                              current->name += "-p";
+                                              yyextra->current->name += "-p";
                                             }
                                             BEGIN( ClassVar );
                                           }
                                        }
-<AlignAs>"("                            { roundCount=0; 
+<AlignAs>"("                            { yyextra->roundCount=0; 
                                           BEGIN( AlignAsEnd ); 
                                         }
-<AlignAs>\n                             { lineCount(); }
+<AlignAs>\n                             { lineCount(yyscanner); }
 <AlignAs>.
-<AlignAsEnd>"("                         { roundCount++; }
-<AlignAsEnd>")"                         { if (--roundCount<0) 
+<AlignAsEnd>"("                         { yyextra->roundCount++; }
+<AlignAsEnd>")"                         { if (--yyextra->roundCount<0) 
                                           {
-                                            BEGIN( lastAlignAsContext ); 
+                                            BEGIN( yyextra->lastAlignAsContext ); 
                                           }
                                         }
-<AlignAsEnd>\n                          { lineCount(); }
+<AlignAsEnd>\n                          { lineCount(yyscanner); }
 <AlignAsEnd>.
 <CompoundName>{SCOPENAME}/{BN}*","     {  // multiple forward declarations on one line
                                            // e.g. @protocol A,B;
-                                         current->reset();
-                                         initEntry();
+                                         yyextra->current->reset();
+                                         initEntry(yyscanner);
                                        }
 <CompoundName>{SCOPENAME}              { 
-                                         current->name = yytext ;
-                                          if (insideCpp || insideObjC) 
+                                         yyextra->current->name = yytext ;
+                                          if (yyextra->insideCpp || yyextra->insideObjC) 
                                           {
-                                            current->id = ClangParser::instance()->lookup(yyLineNr,yytext);
+                                            yyextra->current->id = ClangParser::instance()->lookup(yyextra->yyLineNr,yytext);
                                           }
-                                         lineCount();
-                                         if (current->spec & Entry::Protocol)
+                                         lineCount(yyscanner);
+                                         if (yyextra->current->spec & Entry::Protocol)
                                          {
-                                           current->name += "-p";
+                                           yyextra->current->name += "-p";
                                          }
-                                         if ((current->spec & Entry::Protocol) ||
-                                             current->section == Entry::OBJCIMPL_SEC)
+                                         if ((yyextra->current->spec & Entry::Protocol) ||
+                                             yyextra->current->section == Entry::OBJCIMPL_SEC)
                                          {
                                            unput('{'); // fake start of body
                                          }
                                          BEGIN( ClassVar );
                                        }
 <CompoundName>{CSSCOPENAME}            { // C# style scope
-                                         current->name = substitute(yytext,".","::");
-                                         lineCount();
+                                         yyextra->current->name = substitute(yytext,".","::");
+                                         lineCount(yyscanner);
                                          BEGIN( ClassVar );
                                         }
 <ClassVar>{SCOPENAME}{BN}*/"("         {
-                                         if (insideIDL && qstrncmp(yytext,"switch",6)==0 && !isId(yytext[6]))
+                                         if (yyextra->insideIDL && qstrncmp(yytext,"switch",6)==0 && !isId(yytext[6]))
                                          {
                                            // Corba IDL style union
-                                           roundCount=0;
+                                           yyextra->roundCount=0;
                                            BEGIN(SkipUnionSwitch);
                                          }
                                          else
                                          {
-                                           addType(current);
-                                           current->name = yytext;
-                                           current->name = current->name.stripWhiteSpace();
-                                           lineCount();
+                                           addType(yyscanner);
+                                           yyextra->current->name = yytext;
+                                           yyextra->current->name = yyextra->current->name.stripWhiteSpace();
+                                           lineCount(yyscanner);
                                            BEGIN( FindMembers );
                                          }
                                        }
 <ClassVar>","                          {
-                                         if (isTypedef)
+                                         if (yyextra->isTypedef)
                                          {
                                            // multiple types in one typedef
                                            unput(',');
-                                           current->type.prepend("typedef ");
+                                           yyextra->current->type.prepend("typedef ");
                                            BEGIN(FindMembers);
                                          }
                                          else
@@ -5725,12 +5333,12 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                          }
                                        }
 <ClassVar>("sealed"|"abstract")/{BN}*(":"|"{") {
-                                         if (insideCli)
+                                         if (yyextra->insideCli)
                                          {
                                            if (yytext[0]=='s') // sealed
-                                             current->spec |= Entry::SealedClass;
+                                             yyextra->current->spec |= Entry::SealedClass;
                                            else // abstract
-                                             current->spec |= Entry::AbstractClass;
+                                             yyextra->current->spec |= Entry::AbstractClass;
                                            BEGIN( ClassVar ); 
                                          }
                                          else
@@ -5739,67 +5347,66 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                          }
                                        }
 <ClassVar>{ID}                         {
-                                          if (insideCpp || insideObjC) 
+                                          if (yyextra->insideCpp || yyextra->insideObjC) 
                                           {
-                                            current->id = ClangParser::instance()->lookup(yyLineNr,yytext);
+                                            yyextra->current->id = ClangParser::instance()->lookup(yyextra->yyLineNr,yytext);
                                           }
-                                         if (insideIDL && qstrcmp(yytext,"switch")==0)
+                                         if (yyextra->insideIDL && qstrcmp(yytext,"switch")==0)
                                          {
                                            // Corba IDL style union
-                                           roundCount=0;
+                                           yyextra->roundCount=0;
                                            BEGIN(SkipUnionSwitch);
                                          }
-                                         else if ((insideJava || insidePHP || insideJS || insideSlice) && (qstrcmp(yytext,"implements")==0 || qstrcmp(yytext,"extends")==0))
+                                         else if ((yyextra->insideJava || yyextra->insidePHP || yyextra->insideJS || yyextra->insideSlice) && (qstrcmp(yytext,"implements")==0 || qstrcmp(yytext,"extends")==0))
                                          {
-                                           current->type.resize(0);
-                                           baseProt=Public;
-                                            baseVirt=Normal;
-                                           baseName.resize(0);
+                                           yyextra->current->type.resize(0);
+                                           yyextra->baseProt=Public;
+                                            yyextra->baseVirt=Normal;
+                                           yyextra->baseName.resize(0);
                                            BEGIN( BasesProt ) ;
                                          }
-                                         else if (insideCS && qstrcmp(yytext,"where")==0) // C# type constraint
+                                         else if (yyextra->insideCS && qstrcmp(yytext,"where")==0) // C# type constraint
                                          {
-                                            delete current->typeConstr;
-                                            current->typeConstr = new ArgumentList;
-                                           current->typeConstr->append(new Argument);
-                                           lastCSConstraint = YY_START;
+                                            yyextra->current->typeConstr.clear();
+                                           yyextra->current->typeConstr.push_back(Argument());
+                                           yyextra->lastCSConstraint = YY_START;
                                            BEGIN( CSConstraintName );
                                          }
-                                         else if (insideCli &&  qstrcmp(yytext,"abstract")==0)
+                                         else if (yyextra->insideCli &&  qstrcmp(yytext,"abstract")==0)
                                          {
-                                           current->spec|=Entry::Abstract;
+                                           yyextra->current->spec|=Entry::Abstract;
                                          }
-                                         else if (insideCli &&  qstrcmp(yytext,"sealed")==0)
+                                         else if (yyextra->insideCli &&  qstrcmp(yytext,"sealed")==0)
                                          {
-                                           current->spec|=Entry::Sealed;
+                                           yyextra->current->spec|=Entry::Sealed;
                                          }
                                           else if (qstrcmp(yytext,"final")==0)
                                           {
-                                            current->spec|=Entry::Final;
+                                            yyextra->current->spec|=Entry::Final;
                                           }
                                          else
                                          {
-                                           if (current->section == Entry::ENUM_SEC)
+                                           if (yyextra->current->section == Entry::ENUM_SEC)
                                            { // found "enum a b" -> variable
-                                             current->section = Entry::VARIABLE_SEC ;
+                                             yyextra->current->section = Entry::VARIABLE_SEC ;
                                            }
-                                           current->type += ' ' ;
-                                           current->type += current->name ;
-                                           current->name = yytext ;
+                                           yyextra->current->type += ' ' ;
+                                           yyextra->current->type += yyextra->current->name ;
+                                           yyextra->current->name = yytext ;
                                            
-                                           if (nameIsOperator(current->name))
+                                           if (nameIsOperator(yyextra->current->name))
                                            {
                                              BEGIN( Operator );
                                            }
                                          }
                                        }
 <ClassVar>[(\[]                                {
-                                         if (insideObjC && *yytext=='(') // class category
+                                         if (yyextra->insideObjC && *yytext=='(') // class category
                                          {
-                                           current->name+='(';
-                                            //if (current->section!=Entry::OBJCIMPL_SEC)
+                                           yyextra->current->name+='(';
+                                            //if (yyextra->current->section!=Entry::OBJCIMPL_SEC)
                                             //{
-                                             current->spec|=Entry::Category;
+                                             yyextra->current->spec|=Entry::Category;
                                             //}
                                            BEGIN( ClassCategory );
                                          }
@@ -5812,73 +5419,73 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                        }
 <CSConstraintType,CSConstraintName>"/**/" { /* empty comment */ }
 <CSConstraintType,CSConstraintName>("/*"[*!]|"//"[/!])("<"?)   { // special comment
-                                          fullArgString.resize(0);
-                                         lastCopyArgChar='#'; // end marker
-                                         lastCommentInArgContext=YY_START;
+                                          yyextra->fullArgString.resize(0);
+                                         yyextra->lastCopyArgChar='#'; // end marker
+                                         yyextra->lastCommentInArgContext=YY_START;
                                          if (yytext[1]=='/')
                                            BEGIN( CopyArgCommentLine );
                                          else
                                            BEGIN( CopyArgComment );
                                        }
 <CSConstraintType,CSConstraintName>"#" { // artificially inserted token to signal end of comment block
-                                          current->typeConstr->getLast()->docs = fullArgString;
+                                          yyextra->current->typeConstr.back().docs = yyextra->fullArgString;
                                        }
 <CSConstraintType>"{"                  { // end of type constraint reached
                                           // parse documentation of the constraints
-                                          handleParametersCommentBlocks(current->typeConstr);
+                                          handleParametersCommentBlocks(yyscanner,yyextra->current->typeConstr);
                                          unput('{');
-                                         BEGIN( lastCSConstraint );
+                                         BEGIN( yyextra->lastCSConstraint );
                                        }
 <CSConstraintType,CSConstraintName>";"  {
-                                          handleParametersCommentBlocks(current->typeConstr);
+                                          handleParametersCommentBlocks(yyscanner,yyextra->current->typeConstr);
                                          unput(';');
-                                         BEGIN( lastCSConstraint );
+                                         BEGIN( yyextra->lastCSConstraint );
                                        }
 <CSConstraintName>":"                   {
                                           BEGIN( CSConstraintType );
                                         }
 <CSConstraintName>{ID}                  {
                                           // parameter name
-                                          current->typeConstr->getLast()->name=yytext;
+                                          yyextra->current->typeConstr.back().name=yytext;
                                         }
 <CSConstraintType>"where"              { // another constraint for a different param
-                                         current->typeConstr->append(new Argument);
+                                         yyextra->current->typeConstr.push_back(Argument());
                                           BEGIN( CSConstraintName );
                                        }
 <CSConstraintType>({ID}".")*{ID}("<"{ID}">")?("()")?  {
-                                          if (current->typeConstr->getLast()->type.isEmpty())
+                                          if (yyextra->current->typeConstr.back().type.isEmpty())
                                               // first type constraint for this parameter
                                           {
-                                            current->typeConstr->getLast()->type=yytext;
+                                            yyextra->current->typeConstr.back().type=yytext;
                                           }
                                           else // new type constraint for same parameter
                                           {
-                                            QCString name = current->typeConstr->getLast()->name;
-                                            current->typeConstr->append(new Argument);
-                                            current->typeConstr->getLast()->name=name;
-                                            current->typeConstr->getLast()->type=yytext;
+                                            QCString name = yyextra->current->typeConstr.back().name;
+                                            yyextra->current->typeConstr.push_back(Argument());
+                                            yyextra->current->typeConstr.back().name=name;
+                                            yyextra->current->typeConstr.back().type=yytext;
                                           }
                                         }
 <CSConstraintName,CSConstraintType>\n  {
-                                          lineCount();
+                                          lineCount(yyscanner);
                                        }
 <CSConstraintName,CSConstraintType>.   {
                                        }
 <ClassCategory>{ID}                    {
-                                         current->name+=yytext;
+                                         yyextra->current->name+=yytext;
                                        }
 <ClassCategory>")"/{BN}*"{"            {
-                                         current->name+=')';
+                                         yyextra->current->name+=')';
                                          BEGIN( ClassVar );
                                         }
 <ClassCategory>")"/{BN}*"<"            {
-                                         current->name+=')';
+                                         yyextra->current->name+=')';
                                          BEGIN( ObjCProtocolList );
                                         }
 <ClassCategory>")"                     {
-                                         current->name+=')';
-                                         if ((current->section & Entry::Protocol) ||
-                                             current->section == Entry::OBJCIMPL_SEC)
+                                         yyextra->current->name+=')';
+                                         if ((yyextra->current->section & Entry::Protocol) ||
+                                             yyextra->current->section == Entry::OBJCIMPL_SEC)
                                          {
                                            unput('{'); // fake start of body
                                          }
@@ -5890,61 +5497,61 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                          BEGIN( ClassVar );
                                        }
 <ClassVar>":"                          { 
-                                          if (current->section==Entry::VARIABLE_SEC) // enum A B:2, see bug 748208
+                                          if (yyextra->current->section==Entry::VARIABLE_SEC) // enum A B:2, see bug 748208
                                           {
-                                            current->bitfields+=":";
-                                            current->args.resize(0);
+                                            yyextra->current->bitfields+=":";
+                                            yyextra->current->args.resize(0);
                                             BEGIN(BitFields);
                                           }
-                                          else if (current->section==Entry::ENUM_SEC) // enum E:2, see bug 313527, 
+                                          else if (yyextra->current->section==Entry::ENUM_SEC) // enum E:2, see bug 313527, 
                                                                                  // or C++11 style enum: 'E : unsigned int {...}'
                                          {
-                                           current->args.resize(0);
+                                           yyextra->current->args.resize(0);
                                            BEGIN(EnumBaseType);
                                          }
                                          else
                                          {
-                                           current->type.resize(0);
-                                           if ((current->spec & Entry::Interface) || 
-                                               (current->spec & Entry::Struct)    || 
-                                               (current->spec & Entry::Ref)       || 
-                                               (current->spec & Entry::Value)     || 
-                                               insidePHP || insideCS || insideD || insideObjC || insideIDL
+                                           yyextra->current->type.resize(0);
+                                           if ((yyextra->current->spec & Entry::Interface) || 
+                                               (yyextra->current->spec & Entry::Struct)    || 
+                                               (yyextra->current->spec & Entry::Ref)       || 
+                                               (yyextra->current->spec & Entry::Value)     || 
+                                               yyextra->insidePHP || yyextra->insideCS || yyextra->insideD || yyextra->insideObjC || yyextra->insideIDL
                                               )
-                                             baseProt=Public;
+                                             yyextra->baseProt=Public;
                                            else
-                                             baseProt=Private;
-                                           baseVirt=Normal;
-                                           baseName.resize(0);
+                                             yyextra->baseProt=Private;
+                                           yyextra->baseVirt=Normal;
+                                           yyextra->baseName.resize(0);
                                            BEGIN( BasesProt ) ;
                                          }
                                        }
 <ClassVar>[;=*&]                       {
                                          unput(*yytext);
-                                         if (isTypedef) // typedef of a class, put typedef keyword back
+                                         if (yyextra->isTypedef) // typedef of a class, put typedef keyword back
                                          {
-                                           current->type.prepend("typedef");
+                                           yyextra->current->type.prepend("typedef");
                                          }
                                          if ((yytext[0]=='*' || yytext[0]=='&') && 
-                                             current->section == Entry::ENUM_SEC)
+                                             yyextra->current->section == Entry::ENUM_SEC)
                                          { // found "enum a *b" -> variable
-                                           current->section = Entry::VARIABLE_SEC ;
+                                           yyextra->current->section = Entry::VARIABLE_SEC ;
                                          }
                                          BEGIN( FindMembers );
                                        }
 <Bases,ClassVar>"///"/[^/]              {
-                                         if (!insideObjC)
+                                         if (!yyextra->insideObjC)
                                          {
                                            REJECT;
                                          }
                                          else
                                          {
-                                           lineCount();
-                                           current->program+=yytext;
-                                            current->fileName = yyFileName ;
-                                           current->startLine = yyLineNr ;
-                                           current->startColumn = yyColNr;
-                                           curlyCount=0;
+                                           lineCount(yyscanner);
+                                           yyextra->current->program+=yytext;
+                                            yyextra->current->fileName = yyextra->yyFileName ;
+                                           yyextra->current->startLine = yyextra->yyLineNr ;
+                                           yyextra->current->startColumn = yyextra->yyColNr;
+                                           yyextra->curlyCount=0;
                                            BEGIN( ReadBodyIntf );
                                          }
                                        }
@@ -5952,56 +5559,56 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
 <Bases,ClassVar>("//"{B}*)?"/*!"        |
 <Bases,ClassVar>"//!"                   |
 <Bases,ClassVar>[\-+]{BN}*             {
-                                         if (!insideObjC)
+                                         if (!yyextra->insideObjC)
                                          {
                                            REJECT;
                                          }
                                          else
                                          {
-                                           lineCount();
-                                           current->program+=yytext;
-                                            current->fileName = yyFileName ;
-                                           current->startLine = yyLineNr ;
-                                           current->startColumn = yyColNr;
-                                           curlyCount=0;
+                                           lineCount(yyscanner);
+                                           yyextra->current->program+=yytext;
+                                            yyextra->current->fileName = yyextra->yyFileName ;
+                                           yyextra->current->startLine = yyextra->yyLineNr ;
+                                           yyextra->current->startColumn = yyextra->yyColNr;
+                                           yyextra->curlyCount=0;
                                            BEGIN( ReadBodyIntf );
                                          }
                                        }
 <CompoundName,ClassVar>{B}*"{"{B}*     { 
-                                          current->fileName = yyFileName ;
-                                         current->startLine = yyLineNr ;
-                                         current->startColumn = yyColNr;
-                                         current->name = removeRedundantWhiteSpace(current->name);
-                                         if (current->name.isEmpty() && !isTypedef) // anonymous compound
+                                          yyextra->current->fileName = yyextra->yyFileName ;
+                                         yyextra->current->startLine = yyextra->yyLineNr ;
+                                         yyextra->current->startColumn = yyextra->yyColNr;
+                                         yyextra->current->name = removeRedundantWhiteSpace(yyextra->current->name);
+                                         if (yyextra->current->name.isEmpty() && !yyextra->isTypedef) // anonymous compound
                                          {
-                                           if (current->section==Entry::NAMESPACE_SEC) // allow reopening of anonymous namespaces
+                                           if (yyextra->current->section==Entry::NAMESPACE_SEC) // allow reopening of anonymous namespaces
                                            {
                                              if (Config_getBool(EXTRACT_ANON_NSPACES)) // use visible name
                                              {
-                                               current->name="anonymous_namespace{"+stripPath(current->fileName)+"}";
+                                               yyextra->current->name="anonymous_namespace{"+stripPath(yyextra->current->fileName)+"}";
                                              }
                                              else // use invisible name
                                              {
-                                               current->name.sprintf("@%d",anonNSCount);
+                                               yyextra->current->name.sprintf("@%d",yyextra->anonNSCount);
                                              }
                                            }
                                            else
                                            {
-                                             current->name.sprintf("@%d",anonCount++);
+                                             yyextra->current->name.sprintf("@%d",yyextra->anonCount++);
                                            }
                                          }
-                                         curlyCount=0;
-                                         if (current_root && // not a nested struct inside an @interface section
-                                             !(current_root->spec & Entry::Interface) &&
-                                             ((current->spec & (Entry::Interface | Entry::Protocol | Entry::Category) ||
-                                               current->section==Entry::OBJCIMPL_SEC)
+                                         yyextra->curlyCount=0;
+                                         if (yyextra->current_root && // not a nested struct yyextra->inside an @interface section
+                                             !(yyextra->current_root->spec & Entry::Interface) &&
+                                             ((yyextra->current->spec & (Entry::Interface | Entry::Protocol | Entry::Category) ||
+                                               yyextra->current->section==Entry::OBJCIMPL_SEC)
                                              ) &&
-                                             insideObjC
+                                             yyextra->insideObjC
                                             )
                                          { // ObjC body that ends with @end
                                            BEGIN( ReadBodyIntf );
                                          }
-                                         else if (current->section==Entry::NAMESPACE_SEC)
+                                         else if (yyextra->current->section==Entry::NAMESPACE_SEC)
                                          { // namespace body
                                            BEGIN( ReadNSBody );
                                          }
@@ -6010,61 +5617,60 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                            BEGIN( ReadBody ) ;
                                          }
                                        }
-<BasesProt>"virtual"{BN}+               { lineCount(); baseVirt = Virtual; }
-<BasesProt>"public"{BN}+                { lineCount(); baseProt = Public; }
-<BasesProt>"protected"{BN}+             { lineCount(); baseProt = Protected; }
-<BasesProt>"internal"{BN}+              { if (!insideCli) REJECT ; lineCount(); baseProt = Package; }
-<BasesProt>"private"{BN}+               { lineCount(); baseProt = Private; }
-<BasesProt>{BN}                                { lineCount(); }
+<BasesProt>"virtual"{BN}+               { lineCount(yyscanner); yyextra->baseVirt = Virtual; }
+<BasesProt>"public"{BN}+                { lineCount(yyscanner); yyextra->baseProt = Public; }
+<BasesProt>"protected"{BN}+             { lineCount(yyscanner); yyextra->baseProt = Protected; }
+<BasesProt>"internal"{BN}+              { if (!yyextra->insideCli) REJECT ; lineCount(yyscanner); yyextra->baseProt = Package; }
+<BasesProt>"private"{BN}+               { lineCount(yyscanner); yyextra->baseProt = Private; }
+<BasesProt>{BN}                                { lineCount(yyscanner); }
 <BasesProt>.                           { unput(*yytext); BEGIN(Bases); }
 <Bases>("\\")?({ID}"\\")*{ID}          { // PHP namespace token, not sure if interspacing is allowed but it gives problems (see bug 640847)
-                                          if (!insidePHP)
+                                          if (!yyextra->insidePHP)
                                          {
                                            REJECT;
                                          }
                                          else // PHP base class of the form \Ns\Cl or Ns\Cl
                                          {
-                                           lineCount();
+                                           lineCount(yyscanner);
                                            QCString bn=yytext;
                                            bn = substitute(bn,"\\","::");
-                                           baseName += bn;
-                                           current->args += ' ';
-                                           current->args += yytext;
+                                           yyextra->baseName += bn;
+                                           yyextra->current->args += ' ';
+                                           yyextra->current->args += yytext;
                                          }
                                         }
 <Bases>("::")?{BN}*({ID}{BN}*"::"{BN}*)*{ID}   { 
-                                         lineCount();
+                                         lineCount(yyscanner);
                                           QCString baseScope = yytext;
-                                          if (insideCS && baseScope.stripWhiteSpace()=="where")
+                                          if (yyextra->insideCS && baseScope.stripWhiteSpace()=="where")
                                          { 
                                            // type constraint for a class
-                                            delete current->typeConstr;
-                                            current->typeConstr = new ArgumentList;
-                                           current->typeConstr->append(new Argument);
-                                           lastCSConstraint = YY_START;
+                                            yyextra->current->typeConstr.clear();
+                                           yyextra->current->typeConstr.push_back(Argument());
+                                           yyextra->lastCSConstraint = YY_START;
                                            BEGIN( CSConstraintName );
                                          }
                                          else
                                          {
-                                           baseName+=yytext;
-                                           current->args += ' ';
-                                           current->args += yytext;
+                                           yyextra->baseName+=yytext;
+                                           yyextra->current->args += ' ';
+                                           yyextra->current->args += yytext;
                                          }
                                        }
 <Bases>{BN}*{ID}("."{ID})*             { // Java style class
                                          QCString name = substitute(yytext,".","::");
-                                         baseName += name;
-                                         current->args += ' ';
-                                         current->args += name;
+                                         yyextra->baseName += name;
+                                         yyextra->current->args += ' ';
+                                         yyextra->current->args += name;
                                        }
 <ClassVar,Bases>\n/{BN}*[^{, \t\n]     {
-                                          if (!insideObjC) 
+                                          if (!yyextra->insideObjC) 
                                          {
                                            REJECT;
                                          }
                                          else
                                          {
-                                            lineCount();
+                                            lineCount(yyscanner);
                                            unput('{');
                                          }
                                        }
@@ -6076,53 +5682,53 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                          unput('}'); 
                                          unput('{');
                                        }
-<ClassVar>"<"                          { current->name += *yytext;
-                                         sharpCount=1; 
-                                         roundCount=0;
-                                         lastSkipSharpContext = YY_START;
-                                         specName = &current->name;
+<ClassVar>"<"                          { yyextra->current->name += *yytext;
+                                         yyextra->sharpCount=1; 
+                                         yyextra->roundCount=0;
+                                         yyextra->lastSkipSharpContext = YY_START;
+                                         yyextra->specName = &yyextra->current->name;
                                          BEGIN ( Specialization );
                                        }
 <Bases>{BN}*"<"                         {
-                                          lineCount();
-                                         sharpCount=1; 
-                                         roundCount=0;
-                                         lastSkipSharpContext = YY_START;
-                                         if (insideObjC) // start of protocol list
+                                          lineCount(yyscanner);
+                                         yyextra->sharpCount=1; 
+                                         yyextra->roundCount=0;
+                                         yyextra->lastSkipSharpContext = YY_START;
+                                         if (yyextra->insideObjC) // start of protocol list
                                          {
                                            unput(',');
                                          }
                                          else // template specialization
                                          {
-                                           //if (insideCS) // generic
+                                           //if (yyextra->insideCS) // generic
                                            //{
-                                           //  baseName+="-g";
+                                           //  yyextra->baseName+="-g";
                                            //}
-                                            templateStr = yytext;
-                                           specName = &templateStr;
+                                            yyextra->templateStr = yytext;
+                                           yyextra->specName = &yyextra->templateStr;
                                            BEGIN ( Specialization );
                                          }
                                        }
-<Specialization>"<"                    { *specName += *yytext;
-                                         if (roundCount==0) sharpCount++;
+<Specialization>"<"                    { *yyextra->specName += *yytext;
+                                         if (yyextra->roundCount==0) yyextra->sharpCount++;
                                        }
 <Specialization>">"                    {
-                                         *specName += *yytext;
-                                         if (roundCount==0 && --sharpCount<=0)
+                                         *yyextra->specName += *yytext;
+                                         if (yyextra->roundCount==0 && --yyextra->sharpCount<=0)
                                          {
-                                           baseName+=removeRedundantWhiteSpace(*specName);
-                                           BEGIN(lastSkipSharpContext);
+                                           yyextra->baseName+=removeRedundantWhiteSpace(*yyextra->specName);
+                                           BEGIN(yyextra->lastSkipSharpContext);
                                          }
                                        }
-<Specialization>{BN}+                  { lineCount(); *specName +=' '; }
-<Specialization>"<<"                   { *specName += yytext; }
+<Specialization>{BN}+                  { lineCount(yyscanner); *yyextra->specName +=' '; }
+<Specialization>"<<"                   { *yyextra->specName += yytext; }
 <Specialization>">>"/{B}*"::"          { // M$ C++ extension to allow >> to close a template...
                                          unput('>');
                                          unput(' ');
                                          unput('>');
                                         }
 <Specialization>">>"                   {
-                                          if (insideCS) // for C# >> ends a nested template
+                                          if (yyextra->insideCS) // for C# >> ends a nested template
                                          {
                                            REJECT;
                                          }
@@ -6132,9 +5738,9 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                               // We require the bitshift to be enclosed in braces.
                                               // See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html
                                          {
-                                           if (roundCount>0)
+                                           if (yyextra->roundCount>0)
                                            {
-                                              *specName += yytext; 
+                                              *yyextra->specName += yytext; 
                                            }
                                            else
                                            {
@@ -6144,51 +5750,64 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                            }
                                          }
                                         }
-<Specialization>"typename"{BN}+                { lineCount(); }
-<Specialization>"("                    { *specName += *yytext; roundCount++; }
-<Specialization>")"                    { *specName += *yytext; roundCount--; }
+<Specialization>"typename"{BN}+                { lineCount(yyscanner); }
+<Specialization>"("                    { *yyextra->specName += *yytext; yyextra->roundCount++; }
+<Specialization>")"                    { *yyextra->specName += *yytext; yyextra->roundCount--; }
+
+<Specialization>"\\\\"                 { *yyextra->specName += *yytext;}
+<Specialization>"\\'"                  { *yyextra->specName += *yytext;}
+<Specialization>"\\\""                 { *yyextra->specName += *yytext;}
+<Specialization>"'"                    { *yyextra->specName += *yytext;BEGIN(SpecializationSingleQuote);}
+<Specialization>"\""                   { *yyextra->specName += *yytext;BEGIN(SpecializationDoubleQuote);}
+<SpecializationSingleQuote,SpecializationDoubleQuote>"\\\\"       { *yyextra->specName += *yytext;}
+<SpecializationSingleQuote>"\\'"        { *yyextra->specName += *yytext;}
+<SpecializationSingleQuote>"'"          { *yyextra->specName += *yytext; BEGIN(Specialization);}
+<SpecializationDoubleQuote>"\\\""       { *yyextra->specName += *yytext;}
+<SpecializationDoubleQuote>"\""         { *yyextra->specName += *yytext; BEGIN(Specialization);}
+<SpecializationSingleQuote,SpecializationDoubleQuote>.          { *yyextra->specName += *yytext;}
+
 <Specialization>.                      {
-                                         *specName += *yytext;
+                                         *yyextra->specName += *yytext;
                                        }
-<SkipRound>"("                         { ++roundCount; }
-<SkipRound>")"                         { if (--roundCount<0)
-                                           BEGIN ( lastSkipRoundContext );
+<SkipRound>"("                         { ++yyextra->roundCount; }
+<SkipRound>")"                         { if (--yyextra->roundCount<0)
+                                           BEGIN ( yyextra->lastSkipRoundContext );
                                        }
 <SkipRound>\"                          {
-                                         lastStringContext=SkipRound;
+                                         yyextra->lastStringContext=SkipRound;
                                          BEGIN(SkipString);
                                        }
-<Bases>","|(">"({BN}*"{")?)|({BN}+"implements"{BN}*)   { lineCount();
-                                          if (insideProtocolList)
+<Bases>","|(">"({BN}*"{")?)|({BN}+"implements"{BN}*)   { lineCount(yyscanner);
+                                          if (yyextra->insideProtocolList)
                                          {
-                                           baseName+="-p";
+                                           yyextra->baseName+="-p";
                                          }
                                          else
                                          {
-                                            current->args += ',' ; 
+                                            yyextra->current->args += ',' ; 
                                          }
-                                         current->name = removeRedundantWhiteSpace(current->name);
-                                         if (!baseName.isEmpty())
+                                         yyextra->current->name = removeRedundantWhiteSpace(yyextra->current->name);
+                                         if (!yyextra->baseName.isEmpty())
                                          {
-                                           current->extends->append(
-                                             new BaseInfo(baseName,baseProt,baseVirt)
+                                           yyextra->current->extends.push_back(
+                                             BaseInfo(yyextra->baseName,yyextra->baseProt,yyextra->baseVirt)
                                            );
                                          }
-                                         if ((current->spec & (Entry::Interface|Entry::Struct)) || 
-                                             insideJava || insidePHP || insideCS || 
-                                             insideD || insideObjC || insideIDL || insideSlice)
+                                         if ((yyextra->current->spec & (Entry::Interface|Entry::Struct)) || 
+                                             yyextra->insideJava || yyextra->insidePHP || yyextra->insideCS || 
+                                             yyextra->insideD || yyextra->insideObjC || yyextra->insideIDL || yyextra->insideSlice)
                                          {
-                                           baseProt=Public;
+                                           yyextra->baseProt=Public;
                                          }
                                          else
                                          {
-                                           baseProt=Private;
+                                           yyextra->baseProt=Private;
                                          }
-                                         baseVirt=Normal;
-                                         baseName.resize(0);
+                                         yyextra->baseVirt=Normal;
+                                         yyextra->baseName.resize(0);
                                           if (*yytext=='>')
                                          { // end of a ObjC protocol list
-                                           insideProtocolList=FALSE;
+                                           yyextra->insideProtocolList=FALSE;
                                            if (yyleng==1)
                                            {
                                              unput('{'); // dummy start body
@@ -6200,23 +5819,23 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                          }
                                          else
                                          {
-                                           if (*yytext==',' && insideObjC) // Begin of protocol list
+                                           if (*yytext==',' && yyextra->insideObjC) // Begin of protocol list
                                            {
-                                             insideProtocolList=TRUE;
+                                             yyextra->insideProtocolList=TRUE;
                                            }
                                            BEGIN(BasesProt);
                                          }
                                        }
-<Bases>{B}*"{"{B}*                     { current->fileName = yyFileName ;
-                                         current->startLine = yyLineNr ;
-                                         current->startColumn = yyColNr;
-                                         current->name = removeRedundantWhiteSpace(current->name);
-                                         if (!baseName.isEmpty())
-                                           current->extends->append(
-                                             new BaseInfo(baseName,baseProt,baseVirt)
+<Bases>{B}*"{"{B}*                     { yyextra->current->fileName = yyextra->yyFileName ;
+                                         yyextra->current->startLine = yyextra->yyLineNr ;
+                                         yyextra->current->startColumn = yyextra->yyColNr;
+                                         yyextra->current->name = removeRedundantWhiteSpace(yyextra->current->name);
+                                         if (!yyextra->baseName.isEmpty())
+                                           yyextra->current->extends.push_back(
+                                              BaseInfo(yyextra->baseName,yyextra->baseProt,yyextra->baseVirt)
                                            );
-                                         curlyCount=0;
-                                         if (insideObjC)
+                                         yyextra->curlyCount=0;
+                                         if (yyextra->insideObjC)
                                          {
                                            BEGIN( ReadBodyIntf );
                                          }
@@ -6226,217 +5845,214 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                          }
                                        }
 <SkipUnionSwitch>{B}*"("               {
-                                         roundCount++;
+                                         yyextra->roundCount++;
                                        }
 <SkipUnionSwitch>")"                   {
-                                         if (--roundCount==0)
+                                         if (--yyextra->roundCount==0)
                                          {
                                            BEGIN(ClassVar);
                                          }
                                        }
-<SkipUnionSwitch>\n                    { lineCount(); }
+<SkipUnionSwitch>\n                    { lineCount(yyscanner); }
 <SkipUnionSwitch>.                     
-<Comment>{BN}+                         { current->program += yytext ;
-                                         lineCount() ;
+<Comment>{BN}+                         { yyextra->current->program += yytext ;
+                                         lineCount(yyscanner) ;
                                        }
-<Comment>"/*"                          { current->program += yytext ; } 
-<Comment>"//"                          { current->program += yytext ; }
+<Comment>"/*"                          { yyextra->current->program += yytext ; } 
+<Comment>"//"                          { yyextra->current->program += yytext ; }
 <Comment>{CMD}("code"|"verbatim")      {
-                                          insideCode=TRUE;
-                                         current->program += yytext ;
+                                          yyextra->insideCode=TRUE;
+                                         yyextra->current->program += yytext ;
                                        }
 <Comment>{CMD}("endcode"|"endverbatim")        {
-                                          insideCode=FALSE;
-                                         current->program += yytext ;
+                                          yyextra->insideCode=FALSE;
+                                         yyextra->current->program += yytext ;
                                        }
-<Comment>[^ \.\t\r\n\/\*]+             { current->program += yytext ; }
-<Comment>"*/"                          { current->program += yytext ;
-                                         if (!insideCode) BEGIN( lastContext ) ;
+<Comment>[^ \.\t\r\n\/\*]+             { yyextra->current->program += yytext ; }
+<Comment>"*/"                          { yyextra->current->program += yytext ;
+                                         if (!yyextra->insideCode) BEGIN( yyextra->lastContext ) ;
                                        }
-<Comment>.                             { current->program += *yytext ; }
+<Comment>.                             { yyextra->current->program += *yytext ; }
 
 <FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,SkipC11Inits,SkipC11Attribute,Bases,OldStyleArgs>("//"{B}*)?"/*!" { 
-                                         //printf("Start doc block at %d\n",yyLineNr);
-                                         removeSlashes=(yytext[1]=='/');
-                                         tmpDocType=-1;
-                                         if (!current->doc.isEmpty())
+                                         //printf("Start doc block at %d\n",yyextra->yyLineNr);
+                                         if (!yyextra->current->doc.isEmpty())
                                          {
-                                           current->doc+="\n\n";
+                                           yyextra->current->doc+="\n\n";
                                          }
                                          else
                                          {
-                                           current->docLine = yyLineNr;
-                                           current->docFile = yyFileName;
+                                           yyextra->current->docLine = yyextra->yyLineNr;
+                                           yyextra->current->docFile = yyextra->yyFileName;
                                          }
 
-                                         lastDocContext = YY_START;
-                                         if (current_root->section & Entry::SCOPE_MASK)
+                                         yyextra->lastDocContext = YY_START;
+                                         if (yyextra->current_root->section & Entry::SCOPE_MASK)
                                           {
-                                           current->inside = current_root->name+"::";
+                                           yyextra->current->inside = yyextra->current_root->name+"::";
                                           }
-                                         docBlockContext   = YY_START;
-                                         docBlockInBody    = YY_START==SkipCurly;
-                                         docBlockAutoBrief = Config_getBool(QT_AUTOBRIEF);
+                                         yyextra->docBlockContext   = YY_START;
+                                         yyextra->docBlockInBody    = YY_START==SkipCurly;
+                                         yyextra->docBlockAutoBrief = Config_getBool(QT_AUTOBRIEF);
 
                                           QCString indent;
-                                          indent.fill(' ',computeIndent(yytext,g_column));
-                                          docBlock=indent;
+                                          indent.fill(' ',computeIndent(yytext,yyextra->column));
+                                          yyextra->docBlock=indent;
 
-                                         if (docBlockAutoBrief)
+                                         if (yyextra->docBlockAutoBrief)
                                          {
-                                           current->briefLine = yyLineNr;
-                                           current->briefFile = yyFileName;
+                                           yyextra->current->briefLine = yyextra->yyLineNr;
+                                           yyextra->current->briefFile = yyextra->yyFileName;
                                          }
-                                         startCommentBlock(FALSE);
+                                         startCommentBlock(yyscanner,FALSE);
                                          BEGIN( DocBlock );
                                        }
 <FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,Bases,OldStyleArgs>"/**"[*]+{BL} {
+                                         bool javadocBanner = Config_getBool(JAVADOC_BANNER);
+                                          lineCount(yyscanner);
 
-                                         static bool javadocBanner = Config_getBool(JAVADOC_BANNER);
-
-                                         if( javadocBanner ) {
-                                                 lastDocContext = YY_START;
+                                         if( javadocBanner )
+                                          {
+                                            yyextra->lastDocContext = YY_START;
 
-                                                 //printf("Found comment banner at %s:%d\n",yyFileName,yyLineNr);
-                                                 if (current_root->section & Entry::SCOPE_MASK)
-                                                 {
-                                                   current->inside = current_root->name+"::";
-                                                 }
-                                                 current->docLine = yyLineNr;
-                                                 current->docFile = yyFileName;
-                                                 docBlockContext = YY_START;
-                                                 docBlockInBody  = YY_START==SkipCurly;
-                                                 static bool javadocAutoBrief = Config_getBool(JAVADOC_AUTOBRIEF);
-                                                 docBlockAutoBrief = javadocAutoBrief;
+                                            //printf("Found comment banner at %s:%d\n",yyextra->yyFileName,yyextra->yyLineNr);
+                                            if (yyextra->current_root->section & Entry::SCOPE_MASK)
+                                            {
+                                              yyextra->current->inside = yyextra->current_root->name+"::";
+                                            }
+                                            yyextra->current->docLine = yyextra->yyLineNr;
+                                            yyextra->current->docFile = yyextra->yyFileName;
+                                            yyextra->docBlockContext = YY_START;
+                                            yyextra->docBlockInBody  = YY_START==SkipCurly;
+                                            bool javadocAutoBrief = Config_getBool(JAVADOC_AUTOBRIEF);
+                                            yyextra->docBlockAutoBrief = javadocAutoBrief;
 
-                                                 QCString indent;
-                                                 indent.fill(' ',computeIndent(yytext,g_column));
-                                                 docBlock=indent;
+                                            QCString indent;
+                                            indent.fill(' ',computeIndent(yytext,yyextra->column));
+                                            yyextra->docBlock=indent;
 
-                                                 if (docBlockAutoBrief)
-                                                 {
-                                                   current->briefLine = yyLineNr;
-                                                   current->briefFile = yyFileName;
-                                                 }
-                                                 startCommentBlock(FALSE);
-                                                 BEGIN( DocBlock );
-                                         } else {
-                                                 current->program += yytext ;
-                                                 lastContext = YY_START ;
-                                                 BEGIN( Comment ) ;
+                                            if (yyextra->docBlockAutoBrief)
+                                            {
+                                              yyextra->current->briefLine = yyextra->yyLineNr;
+                                              yyextra->current->briefFile = yyextra->yyFileName;
+                                            }
+                                            startCommentBlock(yyscanner,FALSE);
+                                            BEGIN( DocBlock );
+                                          }
+                                          else
+                                          {
+                                           yyextra->current->program += yytext ;
+                                           yyextra->lastContext = YY_START ;
+                                           BEGIN( Comment ) ;
                                          }
-
                                        }
 <FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,Bases,OldStyleArgs>("//"{B}*)?"/**"/[^/*] {
-                                         removeSlashes=(yytext[1]=='/');
-                                         lastDocContext = YY_START;
+                                         yyextra->lastDocContext = YY_START;
 
-                                         //printf("Found comment block at %s:%d\n",yyFileName,yyLineNr);
-                                         if (current_root->section & Entry::SCOPE_MASK)
+                                         //printf("Found comment block at %s:%d\n",yyextra->yyFileName,yyextra->yyLineNr);
+                                         if (yyextra->current_root->section & Entry::SCOPE_MASK)
                                           {
-                                           current->inside = current_root->name+"::";
+                                           yyextra->current->inside = yyextra->current_root->name+"::";
                                           }
-                                         current->docLine = yyLineNr;
-                                         current->docFile = yyFileName;
-                                         docBlockContext = YY_START;
-                                         docBlockInBody  = YY_START==SkipCurly;
-                                          static bool javadocAutoBrief = Config_getBool(JAVADOC_AUTOBRIEF);
-                                         docBlockAutoBrief = javadocAutoBrief;
+                                         yyextra->current->docLine = yyextra->yyLineNr;
+                                         yyextra->current->docFile = yyextra->yyFileName;
+                                         yyextra->docBlockContext = YY_START;
+                                         yyextra->docBlockInBody  = YY_START==SkipCurly;
+                                          bool javadocAutoBrief = Config_getBool(JAVADOC_AUTOBRIEF);
+                                         yyextra->docBlockAutoBrief = javadocAutoBrief;
 
                                           QCString indent;
-                                          indent.fill(' ',computeIndent(yytext,g_column));
-                                          docBlock=indent;
+                                          indent.fill(' ',computeIndent(yytext,yyextra->column));
+                                          yyextra->docBlock=indent;
 
-                                         if (docBlockAutoBrief)
+                                         if (yyextra->docBlockAutoBrief)
                                          {
-                                           current->briefLine = yyLineNr;
-                                           current->briefFile = yyFileName;
+                                           yyextra->current->briefLine = yyextra->yyLineNr;
+                                           yyextra->current->briefFile = yyextra->yyFileName;
                                          }
-                                         startCommentBlock(FALSE);
+                                         startCommentBlock(yyscanner,FALSE);
                                          BEGIN( DocBlock );
                                        }
 <FindMembers,FindFields,MemberSpec,SkipCurly,FuncQual,Operator,ClassVar,Bases,OldStyleArgs>"//!" { 
-                                         tmpDocType=-1;
-                                         lastDocContext = YY_START;
-                                         if (current_root->section & Entry::SCOPE_MASK)
+                                         yyextra->lastDocContext = YY_START;
+                                         if (yyextra->current_root->section & Entry::SCOPE_MASK)
                                           {
-                                           current->inside = current_root->name+"::";
+                                           yyextra->current->inside = yyextra->current_root->name+"::";
                                           }
-                                         docBlockContext   = YY_START;
-                                         docBlockInBody    = YY_START==SkipCurly;
-                                         docBlockAutoBrief = FALSE;
+                                         yyextra->docBlockContext   = YY_START;
+                                         yyextra->docBlockInBody    = YY_START==SkipCurly;
+                                         yyextra->docBlockAutoBrief = FALSE;
 
                                           QCString indent;
-                                          indent.fill(' ',computeIndent(yytext,g_column));
-                                          docBlock=indent;
+                                          indent.fill(' ',computeIndent(yytext,yyextra->column));
+                                          yyextra->docBlock=indent;
 
-                                         startCommentBlock(current->brief.isEmpty());
+                                         startCommentBlock(yyscanner,yyextra->current->brief.isEmpty());
                                          BEGIN( DocLine );
                                        }
 <FindMembers,FindFields,MemberSpec,SkipCurly,FuncQual,Operator,ClassVar,Bases,OldStyleArgs>"///"/[^/] { 
-                                         tmpDocType=-1;
-                                         lastDocContext = YY_START;
-                                         if (current_root->section & Entry::SCOPE_MASK)
+                                         yyextra->lastDocContext = YY_START;
+                                         if (yyextra->current_root->section & Entry::SCOPE_MASK)
                                           {
-                                           current->inside = current_root->name+"::";
+                                           yyextra->current->inside = yyextra->current_root->name+"::";
                                           }
-                                         docBlockContext   = YY_START;
-                                         docBlockInBody    = YY_START==SkipCurly;
-                                         docBlockAutoBrief = FALSE;
+                                         yyextra->docBlockContext   = YY_START;
+                                         yyextra->docBlockInBody    = YY_START==SkipCurly;
+                                         yyextra->docBlockAutoBrief = FALSE;
                                           QCString indent;
-                                          indent.fill(' ',computeIndent(yytext,g_column));
-                                          docBlock=indent;
-                                         startCommentBlock(current->brief.isEmpty());
+                                          indent.fill(' ',computeIndent(yytext,yyextra->column));
+                                          yyextra->docBlock=indent;
+                                         startCommentBlock(yyscanner,yyextra->current->brief.isEmpty());
                                          BEGIN( DocLine );
                                        }
 <FindMembers>"extern"{BN}*"\"C"("++")?"\""{BN}*("{")?  {
-                                         lineCount();
-                                         externC=TRUE;
+                                         lineCount(yyscanner);
+                                         yyextra->externC=TRUE;
                                        }
 <FindMembers>"{"                       {
-                                          if (externC) 
+                                          if (yyextra->externC) 
                                          {
-                                           externC=FALSE;
+                                           yyextra->externC=FALSE;
                                          }
-                                          else if (insideCS &&    
-                                             !current->name.isEmpty() && 
-                                             !current->type.isEmpty())
+                                          else if (yyextra->insideCS &&    
+                                             !yyextra->current->name.isEmpty() && 
+                                             !yyextra->current->type.isEmpty())
                                          {
-                                           if (containsWord(current->type,"event")) // event
+                                           if (containsWord(yyextra->current->type,"event")) // event
                                            {
-                                             current->mtype = mtype = Event;
+                                             yyextra->current->mtype = yyextra->mtype = Event;
                                            }
                                            else // property
                                            {                           
-                                             current->mtype = mtype = Property;
+                                             yyextra->current->mtype = yyextra->mtype = Property;
                                            }
-                                           current->bodyLine = yyLineNr;
-                                           curlyCount=0;
+                                           yyextra->current->bodyLine = yyextra->yyLineNr;
+                                           yyextra->curlyCount=0;
                                            BEGIN( CSAccessorDecl );
                                          }
-                                         else if (insideIDL && (current->spec & Entry::Attribute))
+                                         else if (yyextra->insideIDL && (yyextra->current->spec & Entry::Attribute))
                                          {
                                            // UNO IDL: attributes may have setter and getter
                                            // exception specifications
-                                           current->exception = " {";
+                                           yyextra->current->exception = " {";
                                            BEGIN(UNOIDLAttributeBlock);
                                          }
                                          else
                                          {
-                                           if ((insideJava || insideCS || insideD) &&
-                                               current->name.isEmpty()
+                                           if ((yyextra->insideJava || yyextra->insideCS || yyextra->insideD) &&
+                                               yyextra->current->name.isEmpty()
                                               )
                                            {
                                              // static Java initializer
-                                             needsSemi = FALSE;
-                                             if (current->stat)
+                                             yyextra->needsSemi = FALSE;
+                                             if (yyextra->current->stat)
                                              {
-                                               current->name="[static initializer]";
-                                               current->type.resize(0);
+                                               yyextra->current->name="[static initializer]";
+                                               yyextra->current->type.resize(0);
                                              }
                                              else
                                              {
-                                               current->name="[instance initializer]";
+                                               yyextra->current->name="[instance initializer]";
                                              }
                                               unput(*yytext); 
                                              BEGIN( Function );
@@ -6444,124 +6060,122 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                            else
                                            {
                                              // pre C++11 code -> ignore the initializer
-                                              //needsSemi = TRUE;
-                                             //current->type.resize(0);
-                                             //current->name.resize(0);
-                                             //current->args.resize(0);
-                                             //current->argList->clear();
-                                             //curlyCount=0;
+                                              //yyextra->needsSemi = TRUE;
+                                             //yyextra->current->type.resize(0);
+                                             //yyextra->current->name.resize(0);
+                                             //yyextra->current->args.resize(0);
+                                             //yyextra->current->argList.clear();
+                                             //yyextra->curlyCount=0;
                                              //BEGIN( SkipCurlyBlock );
 
                                               // C++11 style initializer list
-                                             current->bodyLine = yyLineNr;
-                                              current->initializer = yytext;
-                                             lastInitializerContext = YY_START;
-                                             initBracketCount=1;
+                                             yyextra->current->bodyLine = yyextra->yyLineNr;
+                                              yyextra->current->initializer = yytext;
+                                             yyextra->lastInitializerContext = YY_START;
+                                             yyextra->initBracketCount=1;
                                              BEGIN(ReadInitializer);
                                            }
                                          }
                                        }
-<CSAccessorDecl>"{"                    { curlyCount++; }
+<CSAccessorDecl>"{"                    { yyextra->curlyCount++; }
 <CSAccessorDecl>"}"{B}*"="             {
                                          // fall back to next rule if it's not the right bracket
-                                         if (curlyCount != 0) REJECT;
-                                         current->initializer = "=";
-                                         current->endBodyLine=yyLineNr;
-                                         lastInitializerContext = FindMembers;
+                                         if (yyextra->curlyCount != 0) REJECT;
+                                         yyextra->current->initializer = "=";
+                                         yyextra->current->endBodyLine=yyextra->yyLineNr;
+                                         yyextra->lastInitializerContext = FindMembers;
                                          BEGIN(ReadInitializer);
                                        }
 <CSAccessorDecl>"}"                    { 
-                                          if (curlyCount) 
+                                          if (yyextra->curlyCount) 
                                           {
-                                            curlyCount--; 
+                                            yyextra->curlyCount--; 
                                          }
                                          else
                                          {
-                                           mtype = Method;
-                                            virt = Normal;
+                                           yyextra->mtype = Method;
+                                            yyextra->virt = Normal;
                                            // not really important, but while we are at it
-                                           current->endBodyLine=yyLineNr;
+                                           yyextra->current->endBodyLine=yyextra->yyLineNr;
                                             unput(';');
                                            BEGIN(FindMembers);
                                          }
                                         }
-<CSAccessorDecl>"private "{BN}*"set"   { if (curlyCount==0) current->spec |= Entry::PrivateSettable;   }
-<CSAccessorDecl>"protected "{BN}*"set" { if (curlyCount==0) current->spec |= Entry::ProtectedSettable; }
-<CSAccessorDecl>"private "{BN}*"get"   { if (curlyCount==0) current->spec |= Entry::PrivateGettable;   }
-<CSAccessorDecl>"protected "{BN}*"get" { if (curlyCount==0) current->spec |= Entry::ProtectedGettable; }
-<CSAccessorDecl>"set"                  { if (curlyCount==0) current->spec |= Entry::Settable;  }
-<CSAccessorDecl>"get"                  { if (curlyCount==0) current->spec |= Entry::Gettable;  }
-<CSAccessorDecl>"add"                  { if (curlyCount==0) current->spec |= Entry::Addable;   }
-<CSAccessorDecl>"remove"               { if (curlyCount==0) current->spec |= Entry::Removable; }
-<CSAccessorDecl>"raise"                        { if (curlyCount==0) current->spec |= Entry::Raisable;  }
+<CSAccessorDecl>"private "{BN}*"set"   { if (yyextra->curlyCount==0) yyextra->current->spec |= Entry::PrivateSettable;   }
+<CSAccessorDecl>"protected "{BN}*"set" { if (yyextra->curlyCount==0) yyextra->current->spec |= Entry::ProtectedSettable; }
+<CSAccessorDecl>"private "{BN}*"get"   { if (yyextra->curlyCount==0) yyextra->current->spec |= Entry::PrivateGettable;         }
+<CSAccessorDecl>"protected "{BN}*"get" { if (yyextra->curlyCount==0) yyextra->current->spec |= Entry::ProtectedGettable; }
+<CSAccessorDecl>"set"                  { if (yyextra->curlyCount==0) yyextra->current->spec |= Entry::Settable;  }
+<CSAccessorDecl>"get"                  { if (yyextra->curlyCount==0) yyextra->current->spec |= Entry::Gettable;  }
+<CSAccessorDecl>"add"                  { if (yyextra->curlyCount==0) yyextra->current->spec |= Entry::Addable;   }
+<CSAccessorDecl>"remove"               { if (yyextra->curlyCount==0) yyextra->current->spec |= Entry::Removable; }
+<CSAccessorDecl>"raise"                        { if (yyextra->curlyCount==0) yyextra->current->spec |= Entry::Raisable;  }
 <CSAccessorDecl>"\""                   { BEGIN(CSString);}
 <CSAccessorDecl>"."                    {}
-<CSAccessorDecl>\n                     { lineCount(); }
+<CSAccessorDecl>\n                     { lineCount(yyscanner); }
 <CSString>"\""                         { BEGIN(CSAccessorDecl);}
 <CSString>"//"                         {} // Otherwise the rule <*>"//" will kick in
 <CSString>"/*"                         {} // Otherwise the rule <*>"/*" will kick in
-<CSString>\n                           { lineCount(); }
+<CSString>\n                           { lineCount(yyscanner); }
 <CSString>"."                          {}
 
  /* ---- Slice-specific rules ------ */
 
 <SliceSequence>{SCOPENAME}              {
-                                          if (current->spec&Entry::Local)
+                                          if (yyextra->current->spec&Entry::Local)
                                           {
-                                            current->type = "local ";
+                                            yyextra->current->type = "local ";
                                           }
-                                          current->type += "sequence<";
-                                          current->type += yytext;
-                                          current->type += ">";
+                                          yyextra->current->type += "sequence<";
+                                          yyextra->current->type += yytext;
+                                          yyextra->current->type += ">";
                                         }
 
 <SliceSequence>{BN}*">"{BN}*            {
-                                          lineCount();
+                                          lineCount(yyscanner);
                                           BEGIN(SliceSequenceName);
                                         }
 
 <SliceSequenceName>{ID}{BN}*            {
-                                          lineCount();
-                                          current->name = yytext ;
-                                          current->name = current->name.stripWhiteSpace();
+                                          lineCount(yyscanner);
+                                          yyextra->current->name = yytext ;
+                                          yyextra->current->name = yyextra->current->name.stripWhiteSpace();
                                         }
 
 <SliceSequenceName>";"                  {
-                                          current->section = Entry::VARIABLE_SEC;
-                                          current_root->addSubEntry(current);
-                                          current = new Entry;
-                                          initEntry();
+                                          yyextra->current->section = Entry::VARIABLE_SEC;
+                                          yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
+                                          initEntry(yyscanner);
                                           BEGIN(FindMembers);
                                         }
 
 <SliceDictionary>{SCOPENAME}{BN}*","{BN}*{SCOPENAME} {
-                                          lineCount();
-                                          if (current->spec&Entry::Local)
+                                          lineCount(yyscanner);
+                                          if (yyextra->current->spec&Entry::Local)
                                           {
-                                            current->type = "local ";
+                                            yyextra->current->type = "local ";
                                           }
-                                          current->type += "dictionary<";
-                                          current->type += yytext;
-                                          current->type += ">";
-                                          current->type = current->type.simplifyWhiteSpace();
+                                          yyextra->current->type += "dictionary<";
+                                          yyextra->current->type += yytext;
+                                          yyextra->current->type += ">";
+                                          yyextra->current->type = yyextra->current->type.simplifyWhiteSpace();
                                         }
 
 <SliceDictionary>{BN}*">"{BN}*          {
-                                          lineCount();
+                                          lineCount(yyscanner);
                                           BEGIN(SliceDictionaryName);
                                         }
 
 <SliceDictionaryName>{ID}{BN}*          {
-                                          lineCount();
-                                          current->name = yytext ;
-                                          current->name = current->name.stripWhiteSpace();
+                                          lineCount(yyscanner);
+                                          yyextra->current->name = yytext ;
+                                          yyextra->current->name = yyextra->current->name.stripWhiteSpace();
                                         }
 
 <SliceDictionaryName>";"                {
-                                          current->section = Entry::VARIABLE_SEC;
-                                          current_root->addSubEntry(current);
-                                          current = new Entry;
-                                          initEntry();
+                                          yyextra->current->section = Entry::VARIABLE_SEC;
+                                          yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
+                                          initEntry(yyscanner);
                                           BEGIN(FindMembers);
                                         }
 
@@ -6571,100 +6185,103 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
 
  /* ---- Single line comments ------ */
 <DocLine>[^\n]*"\n"[ \t]*"//"[/!][<]?   { // continuation of multiline C++-style comment
-                                          docBlock+=yytext;
+                                          yyextra->docBlock+=yytext;
                                            int markerLen = yytext[yyleng-1]=='<' ? 4 : 3;
-                                          docBlock.resize(docBlock.length() - markerLen);
-                                           lineCount();
+                                          yyextra->docBlock.resize(yyextra->docBlock.length() - markerLen);
+                                           lineCount(yyscanner);
                                         }
 <DocLine>{B}*"///"[/]+{B}*/"\n"                { // ignore marker line (see bug700345)
-                                         handleCommentBlock(docBlock.data(),current->brief.isEmpty());
-                                         BEGIN( docBlockContext );
+                                         handleCommentBlock(yyscanner,yyextra->docBlock.data(),yyextra->current->brief.isEmpty());
+                                         BEGIN( yyextra->docBlockContext );
                                        }
 <DocLine>[^\n]*/"\n"{B}*"//"[!/]{B}*{CMD}"}"   { // next line is an end group marker, see bug 752712
-                                         docBlock+=yytext;
-                                         handleCommentBlock(docBlock.data(),current->brief.isEmpty());
-                                         BEGIN( docBlockContext );
+                                         yyextra->docBlock+=yytext;
+                                         handleCommentBlock(yyscanner,yyextra->docBlock.data(),yyextra->current->brief.isEmpty());
+                                         BEGIN( yyextra->docBlockContext );
                                        }
 <DocLine>[^\n]*/"\n"                   { // whole line
-                                         docBlock+=yytext;
-                                         handleCommentBlock(docBlock.data(),current->brief.isEmpty());
-                                         BEGIN( docBlockContext );
+                                         yyextra->docBlock+=yytext;
+                                         handleCommentBlock(yyscanner,yyextra->docBlock.data(),yyextra->current->brief.isEmpty());
+                                         BEGIN( yyextra->docBlockContext );
                                        }
 
  /* ---- Comments blocks ------ */
 
 <DocBlock>"*"*"*/"                     { // end of comment block
-                                         handleCommentBlock(docBlock.data(),FALSE);
-                                         BEGIN(docBlockContext);
+                                         handleCommentBlock(yyscanner,yyextra->docBlock.data(),FALSE);
+                                         BEGIN(yyextra->docBlockContext);
                                        }
 <DocBlock>^{B}*"*"+/[^/]               { 
 
                                           QCString indent;
-                                          indent.fill(' ',computeIndent(yytext,g_column));
-                                          docBlock+=indent;
+                                          indent.fill(' ',computeIndent(yytext,yyextra->column));
+                                          yyextra->docBlock+=indent;
                                        }
 <DocBlock>^{B}*("//")?{B}*"*"+/[^//a-z_A-Z0-9*]        { // start of a comment line
                                           QCString indent;
-                                          indent.fill(' ',computeIndent(yytext,g_column));
-                                          docBlock+=indent;
+                                          indent.fill(' ',computeIndent(yytext,yyextra->column));
+                                          yyextra->docBlock+=indent;
                                        }
 <DocBlock>^{B}*("//"){B}*              { // strip embedded C++ comments if at the start of a line
                                        }
 <DocBlock>"//"                         { // slashes in the middle of a comment block
-                                         docBlock+=yytext;
+                                         yyextra->docBlock+=yytext;
                                        }
 <DocBlock>"/*"                         { // start of a new comment in the 
                                           // middle of a comment block
-                                         docBlock+=yytext;
+                                         yyextra->docBlock+=yytext;
                                        }
 <DocBlock>({CMD}{CMD}){ID}/[^a-z_A-Z0-9] { // escaped command
-                                         docBlock+=yytext;
+                                         yyextra->docBlock+=yytext;
                                        }
 <DocBlock>{CMD}("f$"|"f["|"f{")                {
-                                          docBlock+=yytext;
-                                         docBlockName=&yytext[1];
-                                         if (docBlockName.at(1)=='{')
+                                          yyextra->docBlock+=yytext;
+                                         yyextra->docBlockName=&yytext[1];
+                                         if (yyextra->docBlockName.at(1)=='{')
                                          {
-                                           docBlockName.at(1)='}';
+                                           yyextra->docBlockName.at(1)='}';
                                          }
-                                          g_fencedSize=0;
-                                          g_nestedComment=FALSE;
+                                          yyextra->fencedSize=0;
+                                          yyextra->nestedComment=FALSE;
                                          BEGIN(DocCopyBlock);
                                         }
 <DocBlock>{B}*"<"{PRE}">"              {
-                                          docBlock+=yytext;
-                                         docBlockName="<pre>";
-                                          g_fencedSize=0;
-                                          g_nestedComment=FALSE;
+                                          yyextra->docBlock+=yytext;
+                                         yyextra->docBlockName="<pre>";
+                                          yyextra->fencedSize=0;
+                                          yyextra->nestedComment=FALSE;
                                          BEGIN(DocCopyBlock);
                                        }
 <DocBlock>{CMD}("verbatim"|"latexonly"|"htmlonly"|"xmlonly"|"manonly"|"dot"|"code")/[^a-z_A-Z0-9\-]    { // verbatim command (which could contain nested comments!)
-                                          docBlock+=yytext;
-                                         docBlockName=&yytext[1];
-                                          g_fencedSize=0;
-                                          g_nestedComment=FALSE;
+                                          yyextra->docBlock+=yytext;
+                                         yyextra->docBlockName=&yytext[1];
+                                          yyextra->fencedSize=0;
+                                          yyextra->nestedComment=FALSE;
                                          BEGIN(DocCopyBlock);
                                        }
 <DocBlock>^({B}*"*"+)?{B}{0,3}"~~~"[~]*                {
-                                          docBlock+=substitute(yytext,"*"," ");
-                                          docBlockName="~~~";
-                                          g_fencedSize=yyleng;
-                                          g_nestedComment=FALSE;
+
+                                          QCString pat = substitute(yytext,"*"," ");
+                                          yyextra->docBlock+=pat;
+                                          yyextra->docBlockName="~~~";
+                                          yyextra->fencedSize=pat.stripWhiteSpace().length();
+                                          yyextra->nestedComment=FALSE;
                                           BEGIN(DocCopyBlock);
                                         }
 <DocBlock>^({B}*"*"+)?{B}{0,3}"```"[`]*                {
-                                          docBlock+=substitute(yytext,"*"," ");
-                                          docBlockName="```";
-                                          g_fencedSize=yyleng;
-                                          g_nestedComment=FALSE;
+                                          QCString pat = substitute(yytext,"*"," ");
+                                          yyextra->docBlock+=pat;
+                                          yyextra->docBlockName="```";
+                                          yyextra->fencedSize=pat.stripWhiteSpace().length();
+                                          yyextra->nestedComment=FALSE;
                                           BEGIN(DocCopyBlock);
                                         }
 <DocBlock>{B}*"<code>"                  {
-                                         if (insideCS)
+                                         if (yyextra->insideCS)
                                          {
-                                           docBlock+=yytext;
-                                           docBlockName="<code>";
-                                            g_nestedComment=FALSE;
+                                           yyextra->docBlock+=yytext;
+                                           yyextra->docBlockName="<code>";
+                                            yyextra->nestedComment=FALSE;
                                            BEGIN(DocCopyBlock);
                                          }
                                          else
@@ -6673,49 +6290,49 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                          }
                                        }
 <DocBlock>[^@*~\/\\\n]+                        { // any character that isn't special
-                                         docBlock+=yytext;
+                                         yyextra->docBlock+=yytext;
                                        }
 <DocBlock>\n                           { // newline
-                                          lineCount();
-                                         docBlock+=*yytext;
+                                          lineCount(yyscanner);
+                                         yyextra->docBlock+=*yytext;
                                        }
 <DocBlock>.                            { // command block
-                                         docBlock+=*yytext;
+                                         yyextra->docBlock+=*yytext;
                                        }
 
  /* ---- Copy verbatim sections ------ */
 
 <DocCopyBlock>"</"{PRE}">"             { // end of a <pre> block
-                                         docBlock+=yytext;
-                                         if (docBlockName=="<pre>")
+                                         yyextra->docBlock+=yytext;
+                                         if (yyextra->docBlockName=="<pre>")
                                          {
                                            BEGIN(DocBlock);
                                          }
                                        }
 <DocCopyBlock>"</"{CODE}">"            { // end of a <code> block
-                                         docBlock+=yytext;
-                                         if (docBlockName=="<code>")
+                                         yyextra->docBlock+=yytext;
+                                         if (yyextra->docBlockName=="<code>")
                                          {
                                            BEGIN(DocBlock);
                                          }
                                        }
 <DocCopyBlock>[\\@]("f$"|"f]"|"f}")     {
-                                         docBlock+=yytext;
+                                         yyextra->docBlock+=yytext;
                                          BEGIN(DocBlock);
                                        }
 <DocCopyBlock>[\\@]("endverbatim"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"enddot"|"endcode")/[^a-z_A-Z0-9] { // end of verbatim block
-                                         docBlock+=yytext;
-                                         if (&yytext[4]==docBlockName)
+                                         yyextra->docBlock+=yytext;
+                                         if (&yytext[4]==yyextra->docBlockName)
                                          {
                                            BEGIN(DocBlock);
                                          }
                                        }
 <DocCopyBlock>^{B}*"*"+/{BN}+          { // start of a comment line
-                                         if (docBlockName=="verbatim")
+                                         if (yyextra->docBlockName=="verbatim")
                                          {
                                            REJECT;
                                          }
-                                         else if (docBlockName=="code")
+                                         else if (yyextra->docBlockName=="code")
                                          {
                                            REJECT;
                                          }
@@ -6723,15 +6340,15 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                           {
                                             QCString indent;
                                             indent.fill(' ',computeIndent(yytext,0));
-                                            docBlock+=indent;
+                                            yyextra->docBlock+=indent;
                                           }
                                        }
 <DocCopyBlock>^{B}*"*"+/{B}+"*"{BN}*   { // start of a comment line with two *'s
-                                         if (docBlockName=="code")
+                                         if (yyextra->docBlockName=="code")
                                           {
                                             QCString indent;
                                             indent.fill(' ',computeIndent(yytext,0));
-                                            docBlock+=indent;
+                                            yyextra->docBlock+=indent;
                                           }
                                           else
                                          {
@@ -6739,11 +6356,11 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                          }
                                        }
 <DocCopyBlock>^{B}*"*"+/({ID}|"(")     { // Assume *var or *(... is part of source code (see bug723516)
-                                         if (docBlockName=="code")
+                                         if (yyextra->docBlockName=="code")
                                           {
                                             QCString indent;
                                             indent.fill(' ',computeIndent(yytext,-1));
-                                            docBlock+=indent+"*";
+                                            yyextra->docBlock+=indent+"*";
                                           }
                                           else
                                           {
@@ -6751,18 +6368,18 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                           }
                                         }
 <DocCopyBlock>^{B}*"*"+/{BN}*          { // start of a comment line with one *
-                                         if (docBlockName=="code")
+                                         if (yyextra->docBlockName=="code")
                                           {
                                             QCString indent;
-                                            if (g_nestedComment) // keep * it is part of the code
+                                            if (yyextra->nestedComment) // keep * it is part of the code
                                             {
                                               indent.fill(' ',computeIndent(yytext,-1));
-                                              docBlock+=indent+"*";
+                                              yyextra->docBlock+=indent+"*";
                                             }
                                             else // remove * it is part of the comment block
                                             {
                                               indent.fill(' ',computeIndent(yytext,0));
-                                              docBlock+=indent;
+                                              yyextra->docBlock+=indent;
                                             }
                                           }
                                           else
@@ -6771,45 +6388,47 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
                                          }
                                        }
 <DocCopyBlock>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
-                                          docBlock+=substitute(yytext,"*"," ");
-                                          if (g_fencedSize==yyleng)
+                                          QCString pat = substitute(yytext,"*"," ");
+                                          yyextra->docBlock+=pat;
+                                          if (yyextra->fencedSize==pat.stripWhiteSpace().length())
                                           {
                                             BEGIN(DocBlock);
                                           }
                                         }
 <DocCopyBlock>^({B}*"*"+)?{B}{0,3}"```"[`]*                 {
-                                          docBlock+=substitute(yytext,"*"," ");
-                                          if (g_fencedSize==yyleng)
+                                          QCString pat = substitute(yytext,"*"," ");
+                                          yyextra->docBlock+=pat;
+                                          if (yyextra->fencedSize==pat.stripWhiteSpace().length())
                                           {
                                             BEGIN(DocBlock);
                                           }
                                         }
 <DocCopyBlock>[^\<@/*\]~\$\\\n]+       { // any character that is not special
-                                         docBlock+=yytext;
+                                         yyextra->docBlock+=yytext;
                                        }
 <DocCopyBlock>"/*"|"*/"|"//"           {
                                           if (yytext[1]=='*')
                                           {
-                                            g_nestedComment=TRUE;
+                                            yyextra->nestedComment=TRUE;
                                           }
                                           else if (yytext[0]=='*')
                                           {
-                                            g_nestedComment=FALSE;
+                                            yyextra->nestedComment=FALSE;
                                           }
-                                         docBlock+=yytext;
+                                         yyextra->docBlock+=yytext;
                                        }
 <DocCopyBlock>\n                       { // newline
-                                         docBlock+=*yytext;
-                                          lineCount();
+                                         yyextra->docBlock+=*yytext;
+                                          lineCount(yyscanner);
                                        }
 <DocCopyBlock>.                                { // any other character
-                                         docBlock+=*yytext;
+                                         yyextra->docBlock+=*yytext;
                                        }
 <DocCopyBlock><<EOF>>                  {
-                                         warn(yyFileName,yyLineNr,
+                                         warn(yyextra->yyFileName,yyextra->yyLineNr,
                                              "reached end of file while inside a '%s' block!\n"
                                              "The command that should end the block seems to be missing!\n",
-                                             docBlockName.data());
+                                             yyextra->docBlockName.data());
                                          yyterminate();
                                        }
 
@@ -6817,69 +6436,69 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
     /* ------------- Prototype parser -------------- */
 
 <Prototype>"operator"{B}*"("{B}*")"    {
-                                         current->name+=yytext;
+                                         yyextra->current->name+=yytext;
                                        }
 <Prototype>"("                        {
-                                         current->args+=*yytext;
-                                         currentArgumentContext = PrototypeQual;
-                                         fullArgString = current->args.copy();
-                                         copyArgString = &current->args;
+                                         yyextra->current->args+=*yytext;
+                                         yyextra->currentArgumentContext = PrototypeQual;
+                                         yyextra->fullArgString = yyextra->current->args.copy();
+                                         yyextra->copyArgString = &yyextra->current->args;
                                          BEGIN( ReadFuncArgType ) ;
                                        }
 <Prototype>"("({ID}"::")*({B}*[&*])+   {
-                                         current->type+=current->name+yytext;
-                                         current->name.resize(0);
+                                         yyextra->current->type+=yyextra->current->name+yytext;
+                                         yyextra->current->name.resize(0);
                                          BEGIN( PrototypePtr );
                                        }
 <PrototypePtr>{SCOPENAME}              {
-                                         current->name+=yytext;
+                                         yyextra->current->name+=yytext;
                                        }
 <PrototypePtr>"("                      {
-                                         current->args+=*yytext;
-                                         currentArgumentContext = PrototypeQual;
-                                         fullArgString = current->args.copy();
-                                         copyArgString = &current->args;
+                                         yyextra->current->args+=*yytext;
+                                         yyextra->currentArgumentContext = PrototypeQual;
+                                         yyextra->fullArgString = yyextra->current->args.copy();
+                                         yyextra->copyArgString = &yyextra->current->args;
                                          BEGIN( ReadFuncArgType ) ;
                                        }
 <PrototypePtr>")"                      {
-                                         current->type+=')';
+                                         yyextra->current->type+=')';
                                          BEGIN( Prototype );
                                        }
 <PrototypePtr>.                                {
-                                         current->name+=yytext;
+                                         yyextra->current->name+=yytext;
                                        }
 <PrototypeQual>"{"                     {
                                          BEGIN( PrototypeSkipLine);
                                        }
 <PrototypeQual>{B}*"const"{B}*         { 
-                                         current->args += " const "; 
-                                         current->argList->constSpecifier=TRUE;
+                                         yyextra->current->args += " const "; 
+                                         yyextra->current->argList.constSpecifier=TRUE;
                                        }
 <PrototypeQual>{B}*"volatile"{B}*      { 
-                                         current->args += " volatile "; 
-                                         current->argList->volatileSpecifier=TRUE;
+                                         yyextra->current->args += " volatile "; 
+                                         yyextra->current->argList.volatileSpecifier=TRUE;
                                        }
 <PrototypeQual>{B}*"="{B}*"0"{B}*      { 
-                                         current->args += " = 0"; 
-                                         current->virt = Pure; 
-                                         current->argList->pureSpecifier=TRUE;
+                                         yyextra->current->args += " = 0"; 
+                                         yyextra->current->virt = Pure; 
+                                         yyextra->current->argList.pureSpecifier=TRUE;
                                        }
 <PrototypeQual>"throw"{B}*"("          {
-                                         current->exception = "throw(";
+                                         yyextra->current->exception = "throw(";
                                          BEGIN(PrototypeExc);
                                        }
 <PrototypeExc>")"                      {
-                                         current->exception += ')';
+                                         yyextra->current->exception += ')';
                                          BEGIN(PrototypeQual);
                                        }
 <PrototypeExc>.                                {
-                                         current->exception += *yytext;
+                                         yyextra->current->exception += *yytext;
                                        }
 <PrototypeQual>.                       {
-                                         current->args += *yytext;
+                                         yyextra->current->args += *yytext;
                                        }
 <Prototype>.                           {
-                                         current->name += *yytext;
+                                         yyextra->current->name += *yytext;
                                        }
 <PrototypeSkipLine>.                   {
                                        }
@@ -6888,152 +6507,475 @@ OPERATOR  "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
 
 
 <SkipCxxComment>.*"\\\n"               {  // line continuation
-                                         if (insideCS) 
+                                         if (yyextra->insideCS) 
                                          {
                                            REJECT;
                                          }
                                          else 
                                          {
-                                            lineCount();
+                                            lineCount(yyscanner);
                                          }
                                        }
 <SkipCxxComment>.*/\n                  { 
-                                         BEGIN( lastCContext ) ;
+                                         BEGIN( yyextra->lastCContext ) ;
                                        }
 <SkipComment>[^\*\n]+
 
   /* ------------ Generic rules -------------- */
 
-<*>"?>"|"</script>"                     { // PHP code end
-                                         if (insidePHP)
-                                           BEGIN( FindMembersPHP );
-                                         else
-                                           REJECT;
-                                        }
-
 <*>"[["                                 { // C++11 attribute
-                                          if (!insideCpp) REJECT;
+                                          if (!yyextra->insideCpp) REJECT;
                                           if (YY_START == CopyGString || YY_START == CopyGString) REJECT;
-                                          lastC11AttributeContext = YY_START;
+                                          yyextra->lastC11AttributeContext = YY_START;
                                           BEGIN( SkipC11Attribute );
                                         }
 
-<*>\n                                  { lineCount(); }
+<*>\n                                  { lineCount(yyscanner); }
 <*>\"                                  {
-                                         if (insideIDL && insideCppQuote)
+                                         if (yyextra->insideIDL && yyextra->insideCppQuote)
                                          {
                                            BEGIN(EndCppQuote);
                                          }
                                        }
 <*>"#"                                 {       
-                                         if (!insidePHP)
+                                         if (!yyextra->insidePHP)
                                            REJECT;
-                                         lastCContext = YY_START ;
+                                         yyextra->lastCContext = YY_START ;
                                          BEGIN( SkipCxxComment ) ;
                                        }
 <*>\'                                  {
-                                         if (insidePHP)
+                                         if (yyextra->insidePHP)
                                          {
-                                           lastStringContext=YY_START;
+                                           yyextra->lastStringContext=YY_START;
                                            BEGIN(SkipPHPString);
                                          }
                                        }
 <*>\"                                  {
-                                         if (insidePHP)
+                                         if (yyextra->insidePHP)
                                          {
-                                           lastStringContext=YY_START;
+                                           yyextra->lastStringContext=YY_START;
                                            BEGIN(SkipString);
                                          }
                                        }
 <*>\?                                   {
-                                         if (insideCS
+                                         if (yyextra->insideCS && (YY_START != SkipRound)
                                          {
-                                           if (current->type.isEmpty())
+                                           if (yyextra->current->type.isEmpty())
                                            {
-                                             if (current->name.isEmpty())
-                                               current->name="?";
+                                             if (yyextra->current->name.isEmpty())
+                                               yyextra->current->name="?";
                                              else
-                                               current->name+="?";
+                                               yyextra->current->name+="?";
                                            }
                                            else
                                            {
-                                             current->type+="?";
+                                             yyextra->current->type+="?";
                                            }
                                          }
                                        }
 <*>.
 <SkipComment>"//"|"/*"
-<*>"/*"                                        { lastCContext = YY_START ;
+<*>"/*"                                        { yyextra->lastCContext = YY_START ;
                                          BEGIN( SkipComment ) ;
                                        }
-<SkipComment>{B}*"*/"                  { BEGIN( lastCContext ) ; }
+<SkipComment>{B}*"*/"                  { BEGIN( yyextra->lastCContext ) ; }
 <*>"//"                                        {       
-                                         lastCContext = YY_START ;
+                                         yyextra->lastCContext = YY_START ;
                                          BEGIN( SkipCxxComment ) ;
                                        }
 %%
 
 //----------------------------------------------------------------------------
+static int yyread(yyscan_t yyscanner,char *buf,int max_size)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  int c=0;
+  while( c < max_size && yyextra->inputString[yyextra->inputPosition] )
+  {
+    *buf = yyextra->inputString[yyextra->inputPosition++] ;
+    //printf("%d (%c)\n",*buf,*buf);
+    c++; buf++;
+  }
+  return c;
+}
+
+
+static void initParser(yyscan_t yyscanner)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  yyextra->outerScopeEntries.clear();
+  yyextra->baseName.resize(0);
+  yyextra->protection = Public;
+  yyextra->baseProt = Public;
+  yyextra->sharpCount = 0;
+  yyextra->roundCount = 0;
+  yyextra->curlyCount = 0;
+  yyextra->mtype = Method;
+  yyextra->stat = FALSE;
+  yyextra->virt = Normal;
+  yyextra->baseVirt = Normal;
+  yyextra->isTypedef = FALSE;
+  yyextra->autoGroupStack.clear();
+  yyextra->insideTryBlock = FALSE;
+  yyextra->autoGroupStack.setAutoDelete(TRUE);
+  yyextra->insideFormula = FALSE;
+  yyextra->insideCode=FALSE;
+  yyextra->insideCli=Config_getBool(CPP_CLI_SUPPORT);
+  yyextra->previous = 0;
+  yyextra->firstTypedefEntry.reset();
+  yyextra->memspecEntry.reset();
+}
+
+static void initEntry(yyscan_t yyscanner)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  if (yyextra->insideJava) 
+  {
+    yyextra->protection = (yyextra->current_root->spec & (Entry::Interface|Entry::Enum)) ?  Public : Package;
+  }
+  yyextra->current->protection = yyextra->protection ;
+  yyextra->current->mtype      = yyextra->mtype;
+  yyextra->current->virt       = yyextra->virt;
+  yyextra->current->stat       = yyextra->stat;
+  yyextra->current->lang       = yyextra->language;
+  //printf("*** initEntry(yyscanner) yyextra->language=%d\n",yyextra->language);
+  Doxygen::docGroup.initGroupInfo(yyextra->current.get());
+  yyextra->isTypedef=FALSE;
+}
+
+
+//-----------------------------------------------------------------------------
+
+static void lineCount(yyscan_t yyscanner)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  int tabSize = Config_getInt(TAB_SIZE);
+  const char *p;
+  for (p = yytext ; *p ; ++p )
+  {
+    if (*p=='\n') 
+    {
+      yyextra->yyLineNr++,yyextra->column=0,yyextra->yyColNr=1;
+    }
+    else if (*p=='\t') 
+    {
+      yyextra->column+=tabSize - (yyextra->column%tabSize);
+    }
+    else 
+    {
+      yyextra->column++,yyextra->yyColNr++;
+    }
+  }
+  //printf("lineCount()=%d\n",yyextra->column);
+}
+
+static inline int computeIndent(const char *s,int startIndent)
+{
+  int col=startIndent;
+  int tabSize=Config_getInt(TAB_SIZE);
+  const char *p=s;
+  char c;
+  while ((c=*p++))
+  {
+    if (c=='\t') col+=tabSize-(col%tabSize);
+    else if (c=='\n') col=0;
+    else col++;
+  }
+  return col;
+}
+
+static void addType(yyscan_t yyscanner)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  uint tl=yyextra->current->type.length();
+  if( tl>0 && !yyextra->current->name.isEmpty() && yyextra->current->type.at(tl-1)!='.') 
+  {
+    yyextra->current->type += ' ' ;
+  }
+  yyextra->current->type += yyextra->current->name ;
+  yyextra->current->name.resize(0) ;
+  tl=yyextra->current->type.length();
+  if( tl>0 && !yyextra->current->args.isEmpty() && yyextra->current->type.at(tl-1)!='.') 
+  {
+    yyextra->current->type += ' ' ;
+  }
+  yyextra->current->type += yyextra->current->args ;
+  yyextra->current->args.resize(0) ;
+  yyextra->current->argList.clear();
+}
+
 
-static void startCommentBlock(bool brief)
+static QCString stripQuotes(const char *s)
+{
+  QCString name;
+  if (s==0 || *s==0) return name;
+  name=s;
+  if (name.at(0)=='"' && name.at(name.length()-1)=='"')
+  {
+    name=name.mid(1,name.length()-2);
+  }
+  return name;
+}
+
+//-----------------------------------------------------------------
+
+static bool nameIsOperator(QCString &name)
+{
+  int i=name.find("operator");
+  if (i==-1) return FALSE;
+  if (i==0 && !isId(name.at(8))) return TRUE; // case operator ::X
+  if (i>0 && !isId(name.at(i-1)) && !isId(name.at(i+8))) return TRUE; // case X::operator
+  return FALSE; // case TEXToperatorTEXT
+}
+
+//-----------------------------------------------------------------------------
+
+static void setContext(yyscan_t yyscanner)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  yyextra->language    = getLanguageFromFileName(yyextra->yyFileName);
+  yyextra->insideIDL   = yyextra->language==SrcLangExt_IDL;
+  yyextra->insideJava  = yyextra->language==SrcLangExt_Java;
+  yyextra->insideCS    = yyextra->language==SrcLangExt_CSharp; 
+  yyextra->insideD     = yyextra->language==SrcLangExt_D;
+  yyextra->insidePHP   = yyextra->language==SrcLangExt_PHP;
+  yyextra->insideObjC  = yyextra->language==SrcLangExt_ObjC;
+  yyextra->insideJS    = yyextra->language==SrcLangExt_JS;
+  yyextra->insideSlice = yyextra->language==SrcLangExt_Slice;
+  yyextra->insideCpp   = yyextra->language==SrcLangExt_Cpp;
+  //printf("setContext(%s) yyextra->insideIDL=%d yyextra->insideJava=%d yyextra->insideCS=%d "
+  //       "yyextra->insideD=%d yyextra->insidePHP=%d yyextra->insideObjC=%d\n",
+  //       yyextra->yyFileName.data(),yyextra->insideIDL,yyextra->insideJava,yyextra->insideCS,yyextra->insideD,yyextra->insidePHP,yyextra->insideObjC
+  //   );
+}
+
+//-----------------------------------------------------------------------------
+
+static void prependScope(yyscan_t yyscanner)
 {
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  if (yyextra->current_root->section & Entry::SCOPE_MASK)
+  {
+    //printf("--- prependScope %s to %s\n",yyextra->current_root->name.data(),yyextra->current->name.data());
+    yyextra->current->name.prepend(yyextra->current_root->name+"::");
+    //printf("prependScope #=%d #yyextra->current=%d\n",yyextra->current_root->tArgLists->count(),yyextra->current->tArgLists->count());
+    for (const ArgumentList &srcAl : yyextra->current_root->tArgLists)
+    {
+      yyextra->current->tArgLists.insert(yyextra->current->tArgLists.begin(),srcAl);
+    }
+  }
+}
+
+//-----------------------------------------------------------------------------
+
+/*! Returns TRUE iff the yyextra->current entry could be a K&R style C function */
+static bool checkForKnRstyleC(yyscan_t yyscanner)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  if (((QCString)yyextra->yyFileName).right(2).lower()!=".c") return FALSE; // must be a C file
+  if (yyextra->current->argList.empty()) return FALSE; // must have arguments
+  for (const Argument &a : yyextra->current->argList)
+  {
+    // in K&R style argument do not have a type, but doxygen expects a type
+    // so it will think the argument has no name
+    if (a.type.isEmpty() || !a.name.isEmpty()) return FALSE;
+  }
+  return TRUE;
+}
+
+//-----------------------------------------------------------------------------
+
+static void splitKnRArg(yyscan_t yyscanner,QCString &oldStyleArgPtr,QCString &oldStyleArgName)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  int si = yyextra->current->args.length();
+  if (yyextra->oldStyleArgType.isEmpty()) // new argument
+  {
+    static QRegExp re("([^)]*)");
+    int bi1 = yyextra->current->args.findRev(re);
+    int bi2 = bi1!=-1 ? yyextra->current->args.findRev(re,bi1-1) : -1; 
+    char c;
+    if (bi1!=-1 && bi2!=-1) // found something like "int (*func)(int arg)"
+    {
+      int s=bi2+1;
+      yyextra->oldStyleArgType = yyextra->current->args.left(s);
+      int i=s;
+      while (i<si && ((c=yyextra->current->args.at(i))=='*' || isspace((uchar)c))) i++;
+      yyextra->oldStyleArgType += yyextra->current->args.mid(s,i-s);
+      s=i;
+      while (i<si && isId(yyextra->current->args.at(i))) i++;
+      oldStyleArgName = yyextra->current->args.mid(s,i-s);
+      yyextra->oldStyleArgType+=yyextra->current->args.mid(i);
+    }
+    else if (bi1!=-1) // redundant braces like in "int (*var)"
+    {
+      int s=bi1;
+      yyextra->oldStyleArgType = yyextra->current->args.left(s);
+      s++;
+      int i=s+1;
+      while (i<si && ((c=yyextra->current->args.at(i))=='*' || isspace((uchar)c))) i++;
+      yyextra->oldStyleArgType += yyextra->current->args.mid(s,i-s);
+      s=i;
+      while (i<si && isId(yyextra->current->args.at(i))) i++;
+      oldStyleArgName = yyextra->current->args.mid(s,i-s);
+    }
+    else // normal "int *var"
+    {
+      int l=si,i=l-1,j;
+      char c;
+      // look for start of name in "type *name"
+      while (i>=0 && isId(yyextra->current->args.at(i))) i--;
+      j=i+1;
+      // look for start of *'s
+      while (i>=0 && ((c=yyextra->current->args.at(i))=='*' || isspace((uchar)c))) i--;
+      i++;
+      if (i!=l)
+      {
+       yyextra->oldStyleArgType=yyextra->current->args.left(i);
+       oldStyleArgPtr=yyextra->current->args.mid(i,j-i);
+       oldStyleArgName=yyextra->current->args.mid(j).stripWhiteSpace();
+      }
+      else
+      {
+       oldStyleArgName=yyextra->current->args.copy().stripWhiteSpace();
+      }
+    }
+  }
+  else // continuation like *arg2 in "int *args,*arg2"
+  {
+    int l=si,j=0;
+    char c;
+    while (j<l && ((c=yyextra->current->args.at(j))=='*' || isspace((uchar)c))) j++;
+    if (j>0)
+    {
+      oldStyleArgPtr=yyextra->current->args.left(j);
+      oldStyleArgName=yyextra->current->args.mid(j).stripWhiteSpace();
+    }
+    else
+    {
+      oldStyleArgName=yyextra->current->args.copy().stripWhiteSpace();
+    }
+  }
+}
+
+//-----------------------------------------------------------------------------
+
+/*! Update the argument \a name with additional \a type info. For K&R style
+ *  function the type is found \e after the argument list, so this routine
+ *  in needed to fix up.
+ */
+static void addKnRArgInfo(yyscan_t yyscanner,const QCString &type,const QCString &name,
+                          const QCString &brief,const QCString &docs)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  for (Argument &a : yyextra->current->argList)
+  {
+    if (a.type==name)
+    {
+      a.type=type.stripWhiteSpace();
+      if (a.type.left(9)=="register ") // strip keyword
+      {
+       a.type=a.type.mid(9);
+      }
+      a.name=name.stripWhiteSpace();
+      if (!brief.isEmpty() && !docs.isEmpty())
+      {
+        a.docs=brief+"\n\n"+docs;
+      }
+      else if (!brief.isEmpty())
+      {
+        a.docs=brief;
+      }
+      else
+      {
+       a.docs=docs;
+      }
+    }
+  }
+}
+
+//-----------------------------------------------------------------------------
+
+
+void fixArgumentListForJavaScript(ArgumentList &al)
+{
+  for (Argument &a : al)
+  {
+    if (!a.type.isEmpty() && a.name.isEmpty())
+    { // a->type is actually the (typeless) parameter name, so move it
+      a.name=a.type;
+      a.type.resize(0);
+    }
+  }
+}
+
+
+static void startCommentBlock(yyscan_t yyscanner,bool brief)
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
   if (brief)
   {
-    current->briefFile = yyFileName;
-    current->briefLine = yyLineNr;
+    yyextra->current->briefFile = yyextra->yyFileName;
+    yyextra->current->briefLine = yyextra->yyLineNr;
   }
   else
   {
-    current->docFile = yyFileName;
-    current->docLine = yyLineNr;
+    yyextra->current->docFile = yyextra->yyFileName;
+    yyextra->current->docLine = yyextra->yyLineNr;
   }
 }
   
 //----------------------------------------------------------------------------
 
-static void newEntry()
+static void newEntry(yyscan_t yyscanner)
 {
-  if (tempEntry==0) // if temp entry is not 0, it holds current, 
-                    // and current is actually replaced by previous which was 
-                    // already added to current_root, so we should not add it again 
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  if (yyextra->tempEntry==0) // if temp entry is not 0, it holds yyextra->current, 
+                    // and yyextra->current is actually replaced by yyextra->previous which was 
+                    // already added to yyextra->current_root, so we should not add it again 
                     // (see bug723314)
   {
-    current_root->addSubEntry(current);
+    yyextra->previous = yyextra->current;
+    yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
+  }
+  else
+  {
+    yyextra->previous = yyextra->current;
+    yyextra->current  = yyextra->tempEntry;
+    yyextra->tempEntry.reset();
   }
-  tempEntry = 0;
-  previous = current;
-  current = new Entry ;
-  initEntry();
+  initEntry(yyscanner);
 }
 
-static void handleCommentBlock(const QCString &doc,bool brief)
+static void handleCommentBlock(yyscan_t yyscanner,const QCString &doc,bool brief)
 {
-  static bool hideInBodyDocs = Config_getBool(HIDE_IN_BODY_DOCS);
-  if (docBlockInBody && hideInBodyDocs) return;
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  bool hideInBodyDocs = Config_getBool(HIDE_IN_BODY_DOCS);
+  if (yyextra->docBlockInBody && hideInBodyDocs) return;
   //printf("parseCommentBlock [%s] brief=%d\n",doc.data(),brief);
-  int lineNr = brief ? current->briefLine : current->docLine;   // line of block start
+  int lineNr = brief ? yyextra->current->briefLine : yyextra->current->docLine;   // line of block start
 
   // fill in inbodyFile && inbodyLine the first time, see bug 633891
-  Entry *docEntry = docBlockInBody && previous ? previous : current;
-  if (docBlockInBody && docEntry && docEntry->inbodyLine==-1)
+  std::shared_ptr<Entry> docEntry = yyextra->docBlockInBody && yyextra->previous ? yyextra->previous : yyextra->current;
+  if (yyextra->docBlockInBody && docEntry && docEntry->inbodyLine==-1)
   {
-    docEntry->inbodyFile = yyFileName;
+    docEntry->inbodyFile = yyextra->yyFileName;
     docEntry->inbodyLine = lineNr;
   }
 
   int position=0;
   bool needsEntry=FALSE;
-  QCString processedDoc = preprocessCommentBlock(stripIndentation(doc),yyFileName,lineNr);
+  QCString processedDoc = preprocessCommentBlock(stripIndentation(doc),yyextra->yyFileName,lineNr);
   while (parseCommentBlock(
-       g_thisParser,
-       docBlockInBody && previous ? previous : current,
+       yyextra->thisParser,
+       yyextra->docBlockInBody && yyextra->previous ? yyextra->previous.get() : yyextra->current.get(),
        processedDoc, // text
-       yyFileName,   // file
+       yyextra->yyFileName,   // file
        lineNr,       // line of block start
-       docBlockInBody ? FALSE : brief,               // isBrief
-       docBlockInBody ? FALSE : docBlockAutoBrief,   // isJavaDocStyle
-       docBlockInBody,                               // isInBody
-       protection,
+       yyextra->docBlockInBody ? FALSE : brief,               // isBrief
+       yyextra->docBlockInBody ? FALSE : yyextra->docBlockAutoBrief,   // isJavaDocStyle
+       yyextra->docBlockInBody,                               // isInBody
+       yyextra->protection,
         position,
         needsEntry
         )
@@ -7042,77 +6984,76 @@ static void handleCommentBlock(const QCString &doc,bool brief)
     //printf("parseCommentBlock position=%d [%s]\n",position,doc.data()+position);
     if (needsEntry) 
     {
-      QCString docFile = current->docFile;
-      newEntry();
-      current->docFile = docFile;
-      current->docLine = lineNr;
+      QCString docFile = yyextra->current->docFile;
+      newEntry(yyscanner);
+      yyextra->current->docFile = docFile;
+      yyextra->current->docLine = lineNr;
     }
   }
   if (needsEntry)
   {
-    newEntry();
+    newEntry(yyscanner);
   }
 
-  if (docBlockTerm)
+  if (yyextra->docBlockTerm)
   {
-    unput(docBlockTerm);
-    docBlockTerm=0;
+    unput(yyextra->docBlockTerm);
+    yyextra->docBlockTerm=0;
   }
 }
 
-static void handleParametersCommentBlocks(ArgumentList *al)
+static void handleParametersCommentBlocks(yyscan_t yyscanner,ArgumentList &al)
 {
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
   //printf(">>>>>>> handleParametersCommentBlocks()\n");
-  ArgumentListIterator ali(*al);
-  Argument *a;
-  for (ali.toFirst();(a=ali.current());++ali)
+  for (Argument &a : al)
   {
     //printf("    Param %s docs=%s\n",a->name.data(),a->docs.data());
-    if (!a->docs.isEmpty())
+    if (!a.docs.isEmpty())
     {
-      if  (!a->name && a->type == "...") a->name= "...";
+      if  (!a.name && a.type == "...") a.name= "...";
       int position=0;
       bool needsEntry;
 
       // save context
-      QCString orgDoc   = current->doc;
-      QCString orgBrief = current->brief;
-      int orgDocLine    = current->docLine;
-      int orgBriefLine  = current->briefLine;
+      QCString orgDoc   = yyextra->current->doc;
+      QCString orgBrief = yyextra->current->brief;
+      int orgDocLine    = yyextra->current->docLine;
+      int orgBriefLine  = yyextra->current->briefLine;
 
-      current->doc.resize(0);
-      current->brief.resize(0);
+      yyextra->current->doc.resize(0);
+      yyextra->current->brief.resize(0);
 
       //printf("handleParametersCommentBlock [%s]\n",doc.data());
       while (parseCommentBlock(
-            g_thisParser,
-            current,
-            a->docs,            // text
-            yyFileName,         // file
-            current->docLine,   // line of block start
+            yyextra->thisParser,
+            yyextra->current.get(),
+            a.docs,             // text
+            yyextra->yyFileName,         // file
+            yyextra->current->docLine,   // line of block start
             FALSE, 
             FALSE,
             FALSE,
-            protection,
+            yyextra->protection,
             position,
             needsEntry
            )
          ) 
       {
        //printf("handleParametersCommentBlock position=%d [%s]\n",position,doc.data()+position);
-       if (needsEntry) newEntry();
+       if (needsEntry) newEntry(yyscanner);
       }
       if (needsEntry)
       {
-       newEntry();
+       newEntry(yyscanner);
       }
-      a->docs = current->doc;
+      a.docs = yyextra->current->doc;
 
       // restore context
-      current->doc       = orgDoc;
-      current->brief     = orgBrief;
-      current->docLine   = orgDocLine;
-      current->briefLine = orgBriefLine;
+      yyextra->current->doc       = orgDoc;
+      yyextra->current->brief     = orgBrief;
+      yyextra->current->docLine   = orgDocLine;
+      yyextra->current->briefLine = orgBriefLine;
     }
   }
 }
@@ -7120,237 +7061,222 @@ static void handleParametersCommentBlocks(ArgumentList *al)
 
 //----------------------------------------------------------------------------
 
-static void parseCompounds(Entry *rt)
+static void parseCompounds(yyscan_t yyscanner,const std::shared_ptr<Entry> &rt)
 {
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
   //printf("parseCompounds(%s)\n",rt->name.data());
-  EntryListIterator eli(*rt->children());
-  Entry *ce;
-  for (;(ce=eli.current());++eli)
+  for (const auto &ce : rt->children())
   {
     if (!ce->program.isEmpty())
     {
       //printf("-- %s ---------\n%s\n---------------\n",
       //  ce->name.data(),ce->program.data());
       // init scanner state
-      padCount=0;
+      yyextra->padCount=0;
       //depthIf = 0;
-      g_column=0;
-      inputString = ce->program;
-      inputPosition = 0;
-      scannerYYrestart( scannerYYin ) ;
+      yyextra->column=0;
+      yyextra->inputString = ce->program;
+      yyextra->inputPosition = 0;
       if (ce->section==Entry::ENUM_SEC || (ce->spec&Entry::Enum))
        BEGIN( FindFields ) ;
       else
        BEGIN( FindMembers ) ;
-      current_root = ce ;
-      yyFileName = ce->fileName;
+      yyextra->current_root = ce;
+      yyextra->yyFileName = ce->fileName;
       //setContext();
-      yyLineNr = ce->startLine ;
-      yyColNr = ce->startColumn ;
-      insideObjC = ce->lang==SrcLangExt_ObjC;
-      //printf("---> Inner block starts at line %d objC=%d\n",yyLineNr,insideObjC);
-      //current->reset();
-      if (current) delete current;
-      current = new Entry;
-      gstat = FALSE;
-      initEntry();
+      yyextra->yyLineNr = ce->startLine ;
+      yyextra->yyColNr = ce->startColumn ;
+      yyextra->insideObjC = ce->lang==SrcLangExt_ObjC;
+      //printf("---> Inner block starts at line %d objC=%d\n",yyextra->yyLineNr,yyextra->insideObjC);
+      yyextra->current = std::make_shared<Entry>();
+      yyextra->stat = FALSE;
+      initEntry(yyscanner);
 
       // deep copy group list from parent (see bug 727732)
-      static bool autoGroupNested = Config_getBool(GROUP_NESTED_COMPOUNDS);
-      if (autoGroupNested && rt->groups && ce->section!=Entry::ENUM_SEC && !(ce->spec&Entry::Enum))
+      bool autoGroupNested = Config_getBool(GROUP_NESTED_COMPOUNDS);
+      if (autoGroupNested && ce->section!=Entry::ENUM_SEC && !(ce->spec&Entry::Enum))
       {
-        QListIterator<Grouping> gli(*rt->groups);
-        Grouping *g;
-        for (;(g=gli.current());++gli)
-        {
-          ce->groups->append(new Grouping(*g));
-        }
+        ce->groups = rt->groups;
       }
 
       int ni=ce->name.findRev("::"); if (ni==-1) ni=0; else ni+=2;
       // set default protection based on the compound type
       if( ce->section==Entry::CLASS_SEC ) // class
       {
-        if (insidePHP || insideD || insideJS || insideIDL || insideSlice)
+        if (yyextra->insidePHP || yyextra->insideD || yyextra->insideJS || yyextra->insideIDL || yyextra->insideSlice)
        {
-          current->protection = protection = Public ; 
+          yyextra->current->protection = yyextra->protection = Public ; 
        }
-       else if (insideJava)
+       else if (yyextra->insideJava)
        {
-          current->protection = protection = (ce->spec & (Entry::Interface|Entry::Enum)) ?  Public : Package;
+          yyextra->current->protection = yyextra->protection = (ce->spec & (Entry::Interface|Entry::Enum)) ?  Public : Package;
        }
        else if (ce->spec&(Entry::Interface | Entry::Ref | Entry::Value | Entry::Struct | Entry::Union))
        {
          if (ce->lang==SrcLangExt_ObjC)
          {
-           current->protection = protection = Protected ;
+           yyextra->current->protection = yyextra->protection = Protected ;
          }
          else
          {
-           current->protection = protection = Public ;
+           yyextra->current->protection = yyextra->protection = Public ;
          }
        }
        else 
        {
-          current->protection = protection = Private ;
+          yyextra->current->protection = yyextra->protection = Private ;
        }
       }
       else if (ce->section == Entry::ENUM_SEC ) // enum
       {
-       current->protection = protection = ce->protection;
+       yyextra->current->protection = yyextra->protection = ce->protection;
       }
       else if (!ce->name.isEmpty() && ce->name.at(ni)=='@') // unnamed union or namespace
       {
        if (ce->section == Entry::NAMESPACE_SEC ) // unnamed namespace
        {
-          current->stat = gstat = TRUE;
+          yyextra->current->stat = yyextra->stat = TRUE;
        }
-       current->protection = protection = ce->protection;
+       yyextra->current->protection = yyextra->protection = ce->protection;
       }
       else // named struct, union, protocol, category
       {
-       current->protection = protection = Public ;
+       yyextra->current->protection = yyextra->protection = Public ;
       }
-      mtype = Method;
-      virt = Normal;
-      //printf("name=%s current->stat=%d gstat=%d\n",ce->name.data(),current->stat,gstat);
+      yyextra->mtype = Method;
+      yyextra->virt = Normal;
+      //printf("name=%s yyextra->current->stat=%d yyextra->stat=%d\n",ce->name.data(),yyextra->current->stat,yyextra->stat);
 
       //memberGroupId = DOX_NOGROUP;
       //memberGroupRelates.resize(0);
       //memberGroupInside.resize(0);
-      Doxygen::docGroup.enterCompound(yyFileName,yyLineNr,ce->name);
+      QCString name = ce->name;
+      Doxygen::docGroup.enterCompound(yyextra->yyFileName,yyextra->yyLineNr,name);
       
-      scannerYYlex(;
-      g_lexInit=TRUE;
+      scannerYYlex(yyscanner);
+      yyextra->lexInit=TRUE;
       //forceEndGroup();
 
-      Doxygen::docGroup.leaveCompound(yyFileName,yyLineNr,ce->name);
+      Doxygen::docGroup.leaveCompound(yyextra->yyFileName,yyextra->yyLineNr,name);
       
-      delete current; current=0;
       ce->program.resize(0);
 
 
       //if (depthIf>0)
       //{
-      //       warn(yyFileName,yyLineNr,"Documentation block ended in the middle of a conditional section!");
+      //       warn(yyextra->yyFileName,yyextra->yyLineNr,"Documentation block ended in the middle of a conditional section!");
       //}
     }
-    parseCompounds(ce);
+    parseCompounds(yyscanner,ce);
   }
 }
 
 //----------------------------------------------------------------------------
 
-static void parseMain(const char *fileName,
+static void parseMain(yyscan_t yyscanner,
+                      const char *fileName,
                       const char *fileBuf,
-                      Entry *rt,
+                      const std::shared_ptr<Entry> &rt,
                       bool sameTranslationUnit,
                       QStrList & filesInSameTranslationUnit)
 {
-  initParser();
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+  initParser(yyscanner);
 
-  inputString = fileBuf;
-  inputPosition = 0;
-  g_column = 0;
+  yyextra->inputString = fileBuf;
+  yyextra->inputPosition = 0;
+  yyextra->column = 0;
+  scannerYYrestart(0,yyscanner);
 
-  //anonCount     = 0;  // don't reset per file
+  //yyextra->anonCount     = 0;  // don't reset per file
   //depthIf       = 0;
-  protection    = Public;
-  mtype         = Method;
-  gstat         = FALSE;
-  virt          = Normal;
-  current_root  = rt;
-  global_root   = rt;
-  inputFile.setName(fileName);
-  if (inputFile.open(IO_ReadOnly))
+  yyextra->protection    = Public;
+  yyextra->mtype         = Method;
+  yyextra->stat          = FALSE;
+  yyextra->virt          = Normal;
+  yyextra->current_root  = rt;
+  yyextra->yyLineNr      = 1 ;
+  yyextra->yyBegLineNr   = 1;
+  yyextra->yyBegColNr    = 0;
+  yyextra->yyFileName = fileName;
+  setContext(yyscanner);
+  bool processWithClang = yyextra->insideCpp || yyextra->insideObjC;
+  if (processWithClang)
   {
-    yyLineNr= 1 ; 
-    yyFileName = fileName;
-    setContext();
-    bool processWithClang = insideCpp || insideObjC;
-    if (processWithClang)
+    if (!sameTranslationUnit) // new file
     {
-      if (!sameTranslationUnit) // new file
-      {
-        ClangParser::instance()->start(fileName,filesInSameTranslationUnit);
-      }
-      else
-      {
-        ClangParser::instance()->switchToFile(fileName);
-      }
-    }
-    rt->lang = language;
-    msg("Parsing file %s...\n",yyFileName.data());
-
-    current_root  = rt ;
-    initParser();
-    Doxygen::docGroup.enterFile(yyFileName,yyLineNr);
-    current       = new Entry;
-    //printf("current=%p current_root=%p\n",current,current_root);
-    int sec=guessSection(yyFileName);
-    if (sec)
-    {
-      current->name    = yyFileName;
-      current->section = sec;
-      current_root->addSubEntry(current);
-      current          = new Entry;
-    }
-    current->reset();
-    initEntry();
-    scannerYYrestart( scannerYYin );
-    if ( insidePHP )
-    {
-      BEGIN( FindMembersPHP );
+      ClangParser::instance()->start(fileName,filesInSameTranslationUnit);
     }
     else
     {
-      BEGIN( FindMembers );
-    }
-
-    scannerYYlex();
-    g_lexInit=TRUE;
-
-    if (YY_START==Comment)
-    {
-      warn(yyFileName,yyLineNr,"File ended in the middle of a comment block! Perhaps a missing \\endcode?");
+      ClangParser::instance()->switchToFile(fileName);
     }
+  }
+  rt->lang = yyextra->language;
+  msg("Parsing file %s...\n",yyextra->yyFileName.data());
+
+  yyextra->current_root  = rt;
+  initParser(yyscanner);
+  Doxygen::docGroup.enterFile(yyextra->yyFileName,yyextra->yyLineNr);
+  yyextra->current = std::make_shared<Entry>();
+  //printf("yyextra->current=%p yyextra->current_root=%p\n",yyextra->current,yyextra->current_root);
+  int sec=guessSection(yyextra->yyFileName);
+  if (sec)
+  {
+    yyextra->current->name    = yyextra->yyFileName;
+    yyextra->current->section = sec;
+    yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
+  }
+  yyextra->current->reset();
+  initEntry(yyscanner);
+  if ( yyextra->insidePHP )
+  {
+    BEGIN( FindMembersPHP );
+  }
+  else
+  {
+    BEGIN( FindMembers );
+  }
 
-    //forceEndGroup();
-    Doxygen::docGroup.leaveFile(yyFileName,yyLineNr);
+  scannerYYlex(yyscanner);
+  yyextra->lexInit=TRUE;
 
-    //if (depthIf>0)
-    //{
-    //  warn(yyFileName,yyLineNr,"Documentation block ended in the middle of a conditional section!");
-    //}
+  if (YY_START==Comment)
+  {
+    warn(yyextra->yyFileName,yyextra->yyLineNr,"File ended in the middle of a comment block! Perhaps a missing \\endcode?");
+  }
 
-    rt->program.resize(0);
-    if (rt->children()->contains(current)==0) 
-      // it could be that current is already added as a child to rt, so we
-      // only delete it if this is not the case. See bug 635317.
-    {
-      delete current; current=0;
-    }
+  //forceEndGroup();
+  Doxygen::docGroup.leaveFile(yyextra->yyFileName,yyextra->yyLineNr);
 
-    parseCompounds(rt);
+  rt->program.resize(0);
 
-    inputFile.close();
+  parseCompounds(yyscanner,rt);
 
-    anonNSCount++;
+  yyextra->anonNSCount++;
 
+  // add additional entries that were created during processing
+  for (auto &kv: yyextra->outerScopeEntries)
+  {
+    //printf(">>> adding '%s' to scope '%s'\n",kv.second->name.data(),kv.first->name.data());
+    kv.first->moveToSubEntryAndKeep(kv.second);
   }
+  yyextra->outerScopeEntries.clear();
+
 }
 
 //----------------------------------------------------------------------------
 
-static void parsePrototype(const QCString &text)
+static void parsePrototype(yyscan_t yyscanner,const QCString &text)
 {
+  struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
   //printf("**** parsePrototype(%s) begin\n",text.data());
   if (text.isEmpty()) 
   {
-    warn(yyFileName,yyLineNr,"Empty prototype found!");
+    warn(yyextra->yyFileName,yyextra->yyLineNr,"Empty prototype found!");
     return;
   }
-  if (!current) // nothing to store (see bug683516)
+  if (!yyextra->current) // nothing to store (see bug683516)
   {
     return;
   }
@@ -7361,41 +7287,32 @@ static void parsePrototype(const QCString &text)
   
   // save scanner state
   orgState = YY_CURRENT_BUFFER;
-  yy_switch_to_buffer(yy_create_buffer(scannerYYin, YY_BUF_SIZE));
-  orgInputString = inputString; 
-  orgInputPosition = inputPosition;
+  yy_switch_to_buffer(yy_create_buffer(0, YY_BUF_SIZE, yyscanner), yyscanner);
+  orgInputString = yyextra->inputString; 
+  orgInputPosition = yyextra->inputPosition;
 
   // set new string
-  inputString = text;
-  inputPosition = 0;
-  g_column = 0;
-  scannerYYrestart( scannerYYin );
+  yyextra->inputString = text;
+  yyextra->inputPosition = 0;
+  yyextra->column = 0;
+  scannerYYrestart(0, yyscanner);
   BEGIN(Prototype);
-  scannerYYlex();
-  g_lexInit=TRUE;
+  scannerYYlex(yyscanner);
+  yyextra->lexInit=TRUE;
 
-  current->name = current->name.stripWhiteSpace();
-  if (current->section == Entry::MEMBERDOC_SEC && current->args.isEmpty())
-    current->section = Entry::VARIABLEDOC_SEC;
+  yyextra->current->name = yyextra->current->name.stripWhiteSpace();
+  if (yyextra->current->section == Entry::MEMBERDOC_SEC && yyextra->current->args.isEmpty())
+    yyextra->current->section = Entry::VARIABLEDOC_SEC;
 
   // restore original scanner state
   YY_BUFFER_STATE tmpState = YY_CURRENT_BUFFER;
-  yy_switch_to_buffer(orgState);
-  yy_delete_buffer(tmpState);
-  inputString = orgInputString; 
-  inputPosition = orgInputPosition;
+  yy_switch_to_buffer(orgState, yyscanner);
+  yy_delete_buffer(tmpState, yyscanner);
+  yyextra->inputString = orgInputString; 
+  yyextra->inputPosition = orgInputPosition;
 
-  //printf("**** parsePrototype end\n");
-}
 
-void scanFreeScanner()
-{
-#if defined(YY_FLEX_SUBMINOR_VERSION)
-  if (g_lexInit)
-  {
-    scannerYYlex_destroy();
-  }
-#endif
+  //printf("**** parsePrototype end\n");
 }
 
 //static void handleGroupStartCommand(const char *header)
@@ -7407,62 +7324,63 @@ void scanFreeScanner()
 //static void handleGroupEndCommand()
 //{
 //  endGroup();
-//  previous=0;
+//  g_previous=0;
 //}
 
 //----------------------------------------------------------------------------
 
-void CLanguageScanner::startTranslationUnit(const char *)
+struct COutlineParser::Private
+{
+  yyscan_t yyscanner;
+  scannerYY_state state;
+};
+
+COutlineParser::COutlineParser() : p(std::make_unique<COutlineParser::Private>())
 {
+  scannerYYlex_init_extra(&p->state,&p->yyscanner);
+#ifdef FLEX_DEBUG
+  scannerYYset_debug(1,p->yyscanner);
+#endif
 }
 
-void CLanguageScanner::finishTranslationUnit()
+COutlineParser::~COutlineParser()
 {
-  bool processWithClang = insideCpp || insideObjC;
+  scannerYYlex_destroy(p->yyscanner);
+}
+
+void COutlineParser::startTranslationUnit(const char *)
+{
+}
+
+void COutlineParser::finishTranslationUnit()
+{
+  struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
+  bool processWithClang = yyextra->insideCpp || yyextra->insideObjC;
   if (processWithClang)
   {
     ClangParser::instance()->finish();
   }
 }
 
-void CLanguageScanner::parseInput(const char *fileName,
+void COutlineParser::parseInput(const char *fileName,
                                   const char *fileBuf,
-                                  Entry *root,
+                                  const std::shared_ptr<Entry> &root,
                                   bool sameTranslationUnit,
                                   QStrList & filesInSameTranslationUnit)
 {
-  g_thisParser = this;
+  struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
+  yyextra->thisParser = this;
 
   printlex(yy_flex_debug, TRUE, __FILE__, fileName);
 
-  ::parseMain(fileName,fileBuf,root,
+  ::parseMain(p->yyscanner, fileName,fileBuf,root,
               sameTranslationUnit,filesInSameTranslationUnit);
 
   printlex(yy_flex_debug, FALSE, __FILE__, fileName);
 }
 
-void CLanguageScanner::parseCode(CodeOutputInterface & codeOutIntf,
-                   const char * scopeName,
-                   const QCString & input,
-                   SrcLangExt lang,
-                   bool isExampleBlock,
-                   const char * exampleName,
-                   FileDef * fileDef,
-                   int startLine,
-                   int endLine,
-                   bool inlineFragment,
-                  const MemberDef *memberDef,
-                  bool showLineNumbers,
-                   const Definition *searchCtx,
-                   bool collectXRefs
-                  )
-{
-  ::parseCCode(codeOutIntf,scopeName,input,lang,isExampleBlock,exampleName,
-               fileDef,startLine,endLine,inlineFragment,memberDef,
-              showLineNumbers,searchCtx,collectXRefs);
-}
 
-bool CLanguageScanner::needsPreprocessing(const QCString &extension)
+bool COutlineParser::needsPreprocessing(const QCString &extension) const
 {
   QCString fe=extension.lower();
   SrcLangExt lang = getLanguageFromFileName(extension);
@@ -7472,22 +7390,11 @@ bool CLanguageScanner::needsPreprocessing(const QCString &extension)
     );
 }
 
-void CLanguageScanner::resetCodeParserState()
+void COutlineParser::parsePrototype(const char *text)
 {
-  ::resetCCodeParserState();
-}
-
-void CLanguageScanner::parsePrototype(const char *text)
-{
-  ::parsePrototype(text);
+  ::parsePrototype(p->yyscanner,text);
 }
 
 //----------------------------------------------------------------------------
 
-#if !defined(YY_FLEX_SUBMINOR_VERSION) 
-//----------------------------------------------------------------------------
-extern "C" { // some bogus code to keep the compiler happy
-  void scannerYYdummy() { yy_flex_realloc(0,0); } 
-}
-#endif
-
+#include "scanner.l.h"
index b21d587..eee1aa1 100644 (file)
@@ -426,7 +426,7 @@ struct SearchIndexExternal::Private
 {
   Private() : docEntries(12251) {}
   SDict<SearchDocEntry> docEntries;
-  SearchDocEntry *current;
+  SearchDocEntry *current = 0;
 };
 
 SearchIndexExternal::SearchIndexExternal() : SearchIndexIntf(External)
@@ -731,7 +731,7 @@ static QCString searchId(const QCString &s)
   return result;
 }
 
-void createJavascriptSearchIndex()
+void createJavaScriptSearchIndex()
 {
   bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
 
@@ -953,7 +953,7 @@ void createJavascriptSearchIndex()
   }
 }
 
-void writeJavascriptSearchIndex()
+void writeJavaScriptSearchIndex()
 {
   int i;
   int cnt = 0;
@@ -1372,7 +1372,7 @@ void initSearchIndexer()
   }
 }
 
-void finializeSearchIndexer()
+void finalizeSearchIndexer()
 {
   delete Doxygen::searchIndex;
 }
index 9a612ad..923973c 100644 (file)
@@ -34,7 +34,7 @@ class MemberDef;
 /*! Initialize the search indexer */
 void initSearchIndexer();
 /*! Cleanup the search indexer */
-void finializeSearchIndexer();
+void finalizeSearchIndexer();
 
 //------- server side search index ----------------------
 
@@ -165,8 +165,8 @@ struct SearchIndexInfo
   QCString text;
 };
 
-void createJavascriptSearchIndex();
-void writeJavascriptSearchIndex();
+void createJavaScriptSearchIndex();
+void writeJavaScriptSearchIndex();
 const SearchIndexInfo *getSearchIndices();
 
 #endif
index b6268a9..9e6c695 100644 (file)
@@ -26,33 +26,18 @@ class Definition;
 /** Class representing a section in a page */
 struct SectionInfo
 {
-  enum SectionType { Page          = 0, 
-                     Section       = 1, 
-                     Subsection    = 2, 
-                     Subsubsection = 3, 
-                     Paragraph     = 4, 
+  enum SectionType { Page          = 0,
+                     Section       = 1,
+                     Subsection    = 2,
+                     Subsubsection = 3,
+                     Paragraph     = 4,
                      Anchor        = 5,
                      Table         = 6
                    };
   SectionInfo(const char *f,const int lin,const char *l,const char *t,
               SectionType st,int lev,const char *r=0) :
     label(l), title(t), type(st), ref(r), definition(0),
-    fileName(f), lineNr(lin), generated(FALSE), level(lev)
-  {
-  }
-  SectionInfo(const SectionInfo &s)
-  {
-    label=s.label.copy();
-    title=s.title.copy();
-    type =s.type;
-    ref=s.ref.copy();
-    definition=s.definition;
-    fileName=s.fileName.copy();
-    lineNr=s.lineNr;
-    generated=s.generated;
-    level=s.level;
-  }
- ~SectionInfo() {}
+    fileName(f), lineNr(lin), generated(FALSE), level(lev) {}
   QCString label;
   QCString title;
   SectionType type;
index 4db330f..203ae5e 100644 (file)
@@ -128,7 +128,7 @@ class SDict
 
     /*! Appends an element to the dictionary. The element is owned by the
      *  dictionary.
-     *  \param key The unique key to use to quicky find the item later on.
+     *  \param key The unique key to use to quickly find the item later on.
      *  \param d The compound to add.
      *  \sa find()
      */
@@ -146,7 +146,7 @@ class SDict
 
     /*! Prepends an element to the dictionary. The element is owned by the
      *  dictionary.
-     *  \param key The unique key to use to quicky find the item later on.
+     *  \param key The unique key to use to quickly find the item later on.
      *  \param d The compound to add.
      *  \sa find()
      */
@@ -190,7 +190,7 @@ class SDict
       m_list->sort();
     }
     /*! Inserts a compound into the dictionary in a sorted way.
-     *  \param key The unique key to use to quicky find the item later on.
+     *  \param key The unique key to use to quickly find the item later on.
      *  \param d The compound to add.
      *  \sa find()
      */
@@ -237,10 +237,6 @@ class SDict
     {
       return m_dict->find(key);
     }
-    T *find(const QString &key)
-    {
-      return m_dict->find(key);
-    }
     int findAt(const QCString &key)
     {
       T *item = find(key);
@@ -248,7 +244,7 @@ class SDict
       return m_list->find(item);
     }
 
-    /*! Equavalent to find(). */
+    /*! Equivalent to find(). */
     T *operator[](const char *key) const
     {
       return m_dict->find(key);
@@ -474,7 +470,7 @@ class SIntDict
 
     /*! Appends a compound to the dictionary. The element is owned by the
      *  dictionary.
-     *  \param key The unique key to use to quicky find the item later on.
+     *  \param key The unique key to use to quickly find the item later on.
      *  \param d The compound to add.
      *  \sa find()
      */
@@ -492,7 +488,7 @@ class SIntDict
 
     /*! Prepend a compound to the dictionary. The element is owned by the
      *  dictionary.
-     *  \param key The unique key to use to quicky find the item later on.
+     *  \param key The unique key to use to quickly find the item later on.
      *  \param d The compound to add.
      *  \sa find()
      */
@@ -525,7 +521,7 @@ class SIntDict
     }
 
     /*! Inserts a compound into the dictionary in a sorted way.
-     *  \param key The unique key to use to quicky find the item later on.
+     *  \param key The unique key to use to quickly find the item later on.
      *  \param d The compound to add.
      *  \sa find()
      */
@@ -557,7 +553,7 @@ class SIntDict
       return m_dict->find(key);
     }
 
-    /*! Equavalent to find(). */
+    /*! Equivalent to find(). */
     T *operator[](int key) const
     {
       return m_dict->find(key);
index d8a09b7..20e20f7 100644 (file)
@@ -19,7 +19,7 @@
 #ifndef SQLCODE_H
 #define SQLCODE_H
 
-#include "types.h"
+#include "parserintf.h"
 
 class CodeOutputInterface;
 class FileDef;
@@ -27,11 +27,28 @@ class MemberDef;
 class QCString;
 class Definition;
 
-extern void parseSqlCode(CodeOutputInterface &,const char *,const QCString &,
-             bool ,const char *,FileDef *fd,
-            int startLine,int endLine,bool inlineFragment,
-             const MemberDef *memberDef,bool showLineNumbers,const Definition *searchCtx,
-             bool collectXRefs);
-extern void resetSqlCodeParserState();
+/** SQL scanner. Only support syntax highlighting of code at the moment.
+ */
+class SQLCodeParser : public CodeParserInterface
+{
+  public:
+    void parseCode(CodeOutputInterface &codeOutIntf,
+                   const char *scopeName,
+                   const QCString &input,
+                   SrcLangExt,
+                   bool isExampleBlock,
+                   const char *exampleName=0,
+                   FileDef *fileDef=0,
+                   int startLine=-1,
+                   int endLine=-1,
+                   bool inlineFragment=FALSE,
+                   const MemberDef *memberDef=0,
+                   bool showLineNumbers=TRUE,
+                   const Definition *searchCtx=0,
+                   bool collectXRefs=TRUE
+                  );
+    void resetCodeParserState();
+};
+
 
 #endif
index eec9732..02c2c14 100644 (file)
@@ -63,6 +63,7 @@ struct sqlcodeYY_state
 };
 
 static void codify(const char* text);
+static const char *stateToString(int state);
 static void setCurrentDoc(const QCString &anchor,yyscan_t yyscanner);
 static void startCodeLine(yyscan_t yyscanner);
 static void endFontClass(yyscan_t yyscanner);
@@ -382,7 +383,7 @@ void parseSqlCode(
   struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
 
 #ifdef FLEX_DEBUG
-  yyset_debug(1,yyscanner);
+  sqlcodeYYset_debug(1,yyscanner);
 #endif
 
   printlex(yy_flex_debug, TRUE, __FILE__, fd ? fd->fileName().data(): NULL);
@@ -453,11 +454,34 @@ void resetSqlCodeParserState()
   yyextra->currentMemberDef = 0;
 }
 
-#if !defined(YY_FLEX_SUBMINOR_VERSION) 
-extern "C" { // some bogus code to keep the compiler happy
-  void sqlcodeYYdummy() { yy_flex_realloc(0,0); } 
+//---------------------------------------------------------------------------------
+
+void SQLCodeParser::parseCode(CodeOutputInterface &codeOutIntf,
+               const char *scopeName,
+               const QCString &input,
+               SrcLangExt,
+               bool isExampleBlock,
+               const char *exampleName,
+               FileDef *fileDef,
+               int startLine,
+               int endLine,
+               bool inlineFragment,
+               const MemberDef *memberDef,
+               bool showLineNumbers,
+               const Definition *searchCtx,
+               bool collectXRefs
+              )
+{
+  parseSqlCode(codeOutIntf,scopeName,input,isExampleBlock,exampleName,
+                fileDef,startLine,endLine,inlineFragment,memberDef,
+                showLineNumbers,searchCtx,collectXRefs);
 }
-#elif YY_FLEX_MAJOR_VERSION<=2 && YY_FLEX_MINOR_VERSION<=5 && YY_FLEX_SUBMINOR_VERSION<33
-#error "You seem to be using a version of flex newer than 2.5.4. These are currently incompatible with 2.5.4, and do NOT work with doxygen! Please use version 2.5.4 or expect things to be parsed wrongly! A bug report has been submitted (#732132)."
-#endif
 
+void SQLCodeParser::resetCodeParserState()
+{
+  resetSqlCodeParserState();
+}
+
+//---------------------------------------------------------------------------------
+
+#include "sqlcode.l.h"
index 012a0c0..14a73d8 100644 (file)
@@ -127,7 +127,7 @@ const char * table_schema[][2] = {
    * I rolled this back when I had trouble getting a FileDef for all types
    * (PageDef in particular).
    *
-   * Note: all colums referencing path would need an update.
+   * Note: all columns referencing path would need an update.
    */
   { "path",
     "CREATE TABLE IF NOT EXISTS path (\n"
@@ -233,7 +233,7 @@ const char * table_schema[][2] = {
   },
   { "reimplements",
     "CREATE TABLE IF NOT EXISTS reimplements (\n"
-      "\t-- Inherited member reimplmentation relations.\n"
+      "\t-- Inherited member reimplementation relations.\n"
       "\trowid                  INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n"
       "\tmemberdef_rowid        INTEGER NOT NULL REFERENCES memberdef, -- reimplementing memberdef id.\n"
       "\treimplemented_rowid    INTEGER NOT NULL REFERENCES memberdef, -- reimplemented memberdef id.\n"
@@ -1015,26 +1015,34 @@ static void insertMemberReference(const MemberDef *src, const MemberDef *dst, co
 
 static void insertMemberFunctionParams(int memberdef_id, const MemberDef *md, const Definition *def)
 {
-  const ArgumentList *declAl = md->declArgumentList();
-  const ArgumentList *defAl = md->argumentList();
-  if (declAl!=0 && defAl!=0 && declAl->count()>0)
-  {
-    ArgumentListIterator declAli(*declAl);
-    ArgumentListIterator defAli(*defAl);
-    const Argument *a;
-    for (declAli.toFirst();(a=declAli.current());++declAli)
+  const ArgumentList &declAl = md->declArgumentList();
+  const ArgumentList &defAl = md->argumentList();
+  if (declAl.size()>0)
+  {
+//    ArgumentListIterator declAli(*declAl);
+//    ArgumentListIterator defAli(*defAl);
+//    const Argument *a;
+//    for (declAli.toFirst();(a=declAli.current());++declAli)
+    auto defIt = defAl.begin();
+    for (const Argument &a : declAl)
     {
-      const Argument *defArg = defAli.current();
+      //const Argument *defArg = defAli.current();
+      const Argument *defArg = 0;
+      if (defIt!=defAl.end())
+      {
+        defArg = &(*defIt);
+        ++defIt;
+      }
 
-      if (!a->attrib.isEmpty())
+      if (!a.attrib.isEmpty())
       {
-        bindTextParameter(param_select,":attributes",a->attrib);
-        bindTextParameter(param_insert,":attributes",a->attrib);
+        bindTextParameter(param_select,":attributes",a.attrib);
+        bindTextParameter(param_insert,":attributes",a.attrib);
       }
-      if (!a->type.isEmpty())
+      if (!a.type.isEmpty())
       {
         StringList l;
-        linkifyText(TextGeneratorSqlite3Impl(l),def,md->getBodyDef(),md,a->type);
+        linkifyText(TextGeneratorSqlite3Impl(l),def,md->getBodyDef(),md,a.type);
 
         StringListIterator li(l);
         QCString *s;
@@ -1046,32 +1054,31 @@ static void insertMemberFunctionParams(int memberdef_id, const MemberDef *md, co
           insertMemberReference(src_refid,dst_refid, "argument");
           ++li;
         }
-        bindTextParameter(param_select,":type",a->type);
-        bindTextParameter(param_insert,":type",a->type);
+        bindTextParameter(param_select,":type",a.type);
+        bindTextParameter(param_insert,":type",a.type);
       }
-      if (!a->name.isEmpty())
+      if (!a.name.isEmpty())
       {
-        bindTextParameter(param_select,":declname",a->name);
-        bindTextParameter(param_insert,":declname",a->name);
+        bindTextParameter(param_select,":declname",a.name);
+        bindTextParameter(param_insert,":declname",a.name);
       }
-      if (defArg && !defArg->name.isEmpty() && defArg->name!=a->name)
+      if (defArg && !defArg->name.isEmpty() && defArg->name!=a.name)
       {
         bindTextParameter(param_select,":defname",defArg->name);
         bindTextParameter(param_insert,":defname",defArg->name);
       }
-      if (!a->array.isEmpty())
+      if (!a.array.isEmpty())
       {
-        bindTextParameter(param_select,":array",a->array);
-        bindTextParameter(param_insert,":array",a->array);
+        bindTextParameter(param_select,":array",a.array);
+        bindTextParameter(param_insert,":array",a.array);
       }
-      if (!a->defval.isEmpty())
+      if (!a.defval.isEmpty())
       {
         StringList l;
-        linkifyText(TextGeneratorSqlite3Impl(l),def,md->getBodyDef(),md,a->defval);
-        bindTextParameter(param_select,":defval",a->defval);
-        bindTextParameter(param_insert,":defval",a->defval);
+        linkifyText(TextGeneratorSqlite3Impl(l),def,md->getBodyDef(),md,a.defval);
+        bindTextParameter(param_select,":defval",a.defval);
+        bindTextParameter(param_insert,":defval",a.defval);
       }
-      if (defArg) ++defAli;
 
       int param_id=step(param_select,TRUE,TRUE);
       if (param_id==0) {
@@ -1091,18 +1098,16 @@ static void insertMemberFunctionParams(int memberdef_id, const MemberDef *md, co
 
 static void insertMemberDefineParams(int memberdef_id,const MemberDef *md, const Definition *def)
 {
-    if (md->argumentList()->count()==0) // special case for "foo()" to
-                                        // disguish it from "foo".
+    if (md->argumentList().empty()) // special case for "foo()" to
+                                    // distinguish it from "foo".
     {
       DBG_CTX(("no params\n"));
     }
     else
     {
-      ArgumentListIterator ali(*md->argumentList());
-      Argument *a;
-      for (ali.toFirst();(a=ali.current());++ali)
+      for (const Argument &a : md->argumentList())
       {
-        bindTextParameter(param_insert,":defname",a->type);
+        bindTextParameter(param_insert,":defname",a.type);
         int param_id=step(param_insert,TRUE);
         if (param_id==-1) {
           continue;
@@ -1120,7 +1125,7 @@ static void associateMember(const MemberDef *md, struct Refid member_refid, stru
   // TODO: skip EnumValue only to guard against recording refids and member records
   // for enumvalues until we can support documenting them as entities.
   if (md->memberType()==MemberType_EnumValue) return;
-  if (md->name().at(0)!='@') // skip anonymous members
+  if (!md->isAnonymous()) // skip anonymous members
   {
     bindIntParameter(member_insert, ":scope_rowid", scope_refid.rowid);
     bindIntParameter(member_insert, ":memberdef_rowid", member_refid.rowid);
@@ -1271,7 +1276,7 @@ static void writeInnerClasses(const ClassSDict *cl, struct Refid outer_refid)
   const ClassDef *cd;
   for (cli.toFirst();(cd=cli.current());++cli)
   {
-    if (!cd->isHidden() && cd->name().find('@')==-1) // skip anonymous scopes
+    if (!cd->isHidden() && !cd->isAnonymous())
     {
       struct Refid inner_refid = insertRefid(cd->getOutputFileBase());
 
@@ -1360,7 +1365,7 @@ static void writeInnerNamespaces(const NamespaceSDict *nl, struct Refid outer_re
     const NamespaceDef *nd;
     for (nli.toFirst();(nd=nli.current());++nli)
     {
-      if (!nd->isHidden() && nd->name().find('@')==-1) // skip anonymous scopes
+      if (!nd->isHidden() && !nd->isAnonymous())
       {
         struct Refid inner_refid = insertRefid(nd->getOutputFileBase());
 
@@ -1373,48 +1378,39 @@ static void writeInnerNamespaces(const NamespaceSDict *nl, struct Refid outer_re
 }
 
 
-static void writeTemplateArgumentList(const ArgumentList al,
+static void writeTemplateArgumentList(const ArgumentList &al,
                                       const Definition * scope,
                                       const FileDef * fileScope)
 {
-  if (al)
+  for (const Argument &a : al)
   {
-    ArgumentListIterator ali(*al);
-    Argument *a;
-    for (ali.toFirst();(a=ali.current());++ali)
+    if (!a.type.isEmpty())
     {
-      if (!a->type.isEmpty())
-      {
-        #warning linkifyText(TextGeneratorXMLImpl(t),scope,fileScope,0,a->type);
-        bindTextParameter(param_select,":type",a->type);
-        bindTextParameter(param_insert,":type",a->type);
-      }
-      if (!a->name.isEmpty())
-      {
-        bindTextParameter(param_select,":declname",a->name);
-        bindTextParameter(param_insert,":declname",a->name);
-        bindTextParameter(param_select,":defname",a->name);
-        bindTextParameter(param_insert,":defname",a->name);
-      }
-      if (!a->defval.isEmpty())
-      {
-        #warning linkifyText(TextGeneratorXMLImpl(t),scope,fileScope,0,a->defval);
-        bindTextParameter(param_select,":defval",a->defval);
-        bindTextParameter(param_insert,":defval",a->defval);
-      }
-      if (!step(param_select,TRUE,TRUE))
-        step(param_insert);
+//#warning linkifyText(TextGeneratorXMLImpl(t),scope,fileScope,0,a.type);
+      bindTextParameter(param_select,":type",a.type);
+      bindTextParameter(param_insert,":type",a.type);
     }
+    if (!a.name.isEmpty())
+    {
+      bindTextParameter(param_select,":declname",a.name);
+      bindTextParameter(param_insert,":declname",a.name);
+      bindTextParameter(param_select,":defname",a.name);
+      bindTextParameter(param_insert,":defname",a.name);
+    }
+    if (!a.defval.isEmpty())
+    {
+//#warning linkifyText(TextGeneratorXMLImpl(t),scope,fileScope,0,a.defval);
+      bindTextParameter(param_select,":defval",a.defval);
+      bindTextParameter(param_insert,":defval",a.defval);
+    }
+    if (!step(param_select,TRUE,TRUE))
+      step(param_insert);
   }
 }
 
 static void writeMemberTemplateLists(const MemberDef *md)
 {
-  const ArgumentList *templMd = md->templateArguments();
-  if (templMd) // function template prefix
-  {
-    writeTemplateArgumentList(templMd,md->getClassDef(),md->getFileDef());
-  }
+  writeTemplateArgumentList(md->templateArguments(),md->getClassDef(),md->getFileDef());
 }
 static void writeTemplateList(const ClassDef *cd)
 {
@@ -1675,12 +1671,9 @@ static void generateSqlite3ForMember(const MemberDef *md, struct Refid scope_ref
 
   if (isFunc)
   {
-    const ArgumentList *al = md->argumentList();
-    if (al!=0)
-    {
-      bindIntParameter(memberdef_insert,":const",al->constSpecifier);
-      bindIntParameter(memberdef_insert,":volatile",al->volatileSpecifier);
-    }
+    const ArgumentList &al = md->argumentList();
+    bindIntParameter(memberdef_insert,":const",al.constSpecifier);
+    bindIntParameter(memberdef_insert,":volatile",al.volatileSpecifier);
     bindIntParameter(memberdef_insert,":explicit",md->isExplicit());
     bindIntParameter(memberdef_insert,":inline",md->isInline());
     bindIntParameter(memberdef_insert,":final",md->isFinal());
@@ -1961,7 +1954,7 @@ static void generateSqlite3ForClass(const ClassDef *cd)
 
   if (cd->isReference())        return; // skip external references.
   if (cd->isHidden())           return; // skip hidden classes.
-  if (cd->name().find('@')!=-1) return; // skip anonymous compounds.
+  if (cd->isAnonymous())        return; // skip anonymous compounds.
   if (cd->templateMaster()!=0)  return; // skip generated template instances.
 
   struct Refid refid = insertRefid(cd->getOutputFileBase());
diff --git a/src/sqlscanner.h b/src/sqlscanner.h
deleted file mode 100644 (file)
index 3ca6fe3..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/******************************************************************************
- *
- * Copyright (C) 1997-2015 by Dimitri van Heesch.
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation under the terms of the GNU General Public License is hereby 
- * granted. No representations are made about the suitability of this software 
- * for any purpose. It is provided "as is" without express or implied warranty.
- * See the GNU General Public License for more details.
- *
- * Documents produced by Doxygen are derivative works derived from the
- * input used in their production; they are not affected by this license.
- *
- */
-
-#ifndef SQLSCANNER_H
-#define SQLSCANNER_H
-
-#include "parserintf.h"
-#include "sqlcode.h"
-
-/** SQL scanner. Only support syntax highlighting of code at the moment.
- */
-class SQLScanner : public ParserInterface
-{
-public:
-    SQLScanner() {}
-    virtual ~SQLScanner() {}
-    void startTranslationUnit(const char *) {}
-    void finishTranslationUnit() {}
-    void parseInput(const char *, const char *, Entry *, bool , QStrList &) {}
-    bool needsPreprocessing(const QCString &) { return FALSE; }
-
-    void parseCode(CodeOutputInterface &codeOutIntf,
-                   const char *scopeName,
-                   const QCString &input,
-                   SrcLangExt,
-                   bool isExampleBlock,
-                   const char *exampleName=0,
-                   FileDef *fileDef=0,
-                   int startLine=-1,
-                   int endLine=-1,
-                   bool inlineFragment=FALSE,
-                   const MemberDef *memberDef=0,
-                   bool showLineNumbers=TRUE,
-                   const Definition *searchCtx=0,
-                   bool collectXRefs=TRUE
-                  )
-    {
-      parseSqlCode(codeOutIntf,scopeName,input,isExampleBlock,exampleName,
-                    fileDef,startLine,endLine,inlineFragment,memberDef,
-                    showLineNumbers,searchCtx,collectXRefs);
-    }
-
-    void resetCodeParserState()
-    {
-      resetSqlCodeParserState();
-    }
-
-    void parsePrototype(const char *) {}
-
-private:
-};
-
-#endif
diff --git a/src/stlsupport.cpp b/src/stlsupport.cpp
new file mode 100644 (file)
index 0000000..096291a
--- /dev/null
@@ -0,0 +1,270 @@
+/******************************************************************************
+ *
+ * Copyright (C) 1997-2019 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ * Documents produced by Doxygen are derivative works derived from the
+ * input used in their production; they are not affected by this license.
+ *
+ */
+
+#include "stlsupport.h"
+#include "entry.h"
+#include "config.h"
+
+/** A struct contained the data for an STL class */
+struct STLInfo
+{
+  const char *className;
+  const char *baseClass1;
+  const char *baseClass2;
+  const char *templType1;
+  const char *templName1;
+  const char *templType2;
+  const char *templName2;
+  bool virtualInheritance;
+  bool iterators;
+};
+
+static STLInfo g_stlinfo[] =
+{
+  // className              baseClass1                      baseClass2             templType1     templName1     templType2    templName2     virtInheritance  // iterators
+  { "allocator",            0,                              0,                     "T",           "elements",    0,            0,             FALSE,              FALSE },
+  { "auto_ptr",             0,                              0,                     "T",           "ptr",         0,            0,             FALSE,              FALSE }, // deprecated
+  { "smart_ptr",            0,                              0,                     "T",           "ptr",         0,            0,             FALSE,              FALSE }, // C++11
+  { "unique_ptr",           0,                              0,                     "T",           "ptr",         0,            0,             FALSE,              FALSE }, // C++11
+  { "shared_ptr",           0,                              0,                     "T",           "ptr",         0,            0,             FALSE,              FALSE }, // C++14
+  { "weak_ptr",             0,                              0,                     "T",           "ptr",         0,            0,             FALSE,              FALSE }, // C++11
+  { "atomic",               0,                              0,                     "T",           "ptr",         0,            0,             FALSE,              FALSE }, // C++11
+  { "atomic_ref",           0,                              0,                     "T",           "ptr",         0,            0,             FALSE,              FALSE }, // C++20
+  { "lock_guard",           0,                              0,                     "T",           "ptr",         0,            0,             FALSE,              FALSE }, // C++11
+  { "unique_lock",          0,                              0,                     "T",           "ptr",         0,            0,             FALSE,              FALSE }, // C++11
+  { "shared_lock",          0,                              0,                     "T",           "ptr",         0,            0,             FALSE,              FALSE }, // C++14
+  { "ios_base",             0,                              0,                     0,             0,             0,            0,             FALSE,              FALSE }, // C++11
+  { "error_code",           0,                              0,                     0,             0,             0,            0,             FALSE,              FALSE }, // C++11
+  { "error_category",       0,                              0,                     0,             0,             0,            0,             FALSE,              FALSE }, // C++11
+  { "system_error",         0,                              0,                     0,             0,             0,            0,             FALSE,              FALSE }, // C++11
+  { "error_condition",      0,                              0,                     0,             0,             0,            0,             FALSE,              FALSE }, // C++11
+  { "thread",               0,                              0,                     0,             0,             0,            0,             FALSE,              FALSE }, // C++11
+  { "jthread",              0,                              0,                     0,             0,             0,            0,             FALSE,              FALSE }, // C++11
+  { "mutex",                0,                              0,                     0,             0,             0,            0,             FALSE,              FALSE }, // C++11
+  { "timed_mutex",          0,                              0,                     0,             0,             0,            0,             FALSE,              FALSE }, // C++11
+  { "recursive_mutex",      0,                              0,                     0,             0,             0,            0,             FALSE,              FALSE }, // C++11
+  { "recursive_timed_mutex",0,                              0,                     0,             0,             0,            0,             FALSE,              FALSE }, // C++11
+  { "shared_mutex",         0,                              0,                     0,             0,             0,            0,             FALSE,              FALSE }, // C++17
+  { "shared_timed_mutex",   0,                              0,                     0,             0,             0,            0,             FALSE,              FALSE }, // C++14
+  { "basic_ios",            "ios_base",                     0,                     "Char",        0,             0,            0,             FALSE,              FALSE },
+  { "basic_istream",        "basic_ios<Char>",              0,                     "Char",        0,             0,            0,             TRUE,               FALSE },
+  { "basic_ostream",        "basic_ios<Char>",              0,                     "Char",        0,             0,            0,             TRUE,               FALSE },
+  { "basic_iostream",       "basic_istream<Char>",          "basic_ostream<Char>", "Char",        0,             0,            0,             FALSE,              FALSE },
+  { "basic_ifstream",       "basic_istream<Char>",          0,                     "Char",        0,             0,            0,             FALSE,              FALSE },
+  { "basic_ofstream",       "basic_ostream<Char>",          0,                     "Char",        0,             0,            0,             FALSE,              FALSE },
+  { "basic_fstream",        "basic_iostream<Char>",         0,                     "Char",        0,             0,            0,             FALSE,              FALSE },
+  { "basic_istringstream",  "basic_istream<Char>",          0,                     "Char",        0,             0,            0,             FALSE,              FALSE },
+  { "basic_ostringstream",  "basic_ostream<Char>",          0,                     "Char",        0,             0,            0,             FALSE,              FALSE },
+  { "basic_stringstream",   "basic_iostream<Char>",         0,                     "Char",        0,             0,            0,             FALSE,              FALSE },
+  { "ios",                  "basic_ios<char>",              0,                     0,             0,             0,            0,             FALSE,              FALSE },
+  { "wios",                 "basic_ios<wchar_t>",           0,                     0,             0,             0,            0,             FALSE,              FALSE },
+  { "istream",              "basic_istream<char>",          0,                     0,             0,             0,            0,             FALSE,              FALSE },
+  { "wistream",             "basic_istream<wchar_t>",       0,                     0,             0,             0,            0,             FALSE,              FALSE },
+  { "ostream",              "basic_ostream<char>",          0,                     0,             0,             0,            0,             FALSE,              FALSE },
+  { "wostream",             "basic_ostream<wchar_t>",       0,                     0,             0,             0,            0,             FALSE,              FALSE },
+  { "ifstream",             "basic_ifstream<char>",         0,                     0,             0,             0,            0,             FALSE,              FALSE },
+  { "wifstream",            "basic_ifstream<wchar_t>",      0,                     0,             0,             0,            0,             FALSE,              FALSE },
+  { "ofstream",             "basic_ofstream<char>",         0,                     0,             0,             0,            0,             FALSE,              FALSE },
+  { "wofstream",            "basic_ofstream<wchar_t>",      0,                     0,             0,             0,            0,             FALSE,              FALSE },
+  { "fstream",              "basic_fstream<char>",          0,                     0,             0,             0,            0,             FALSE,              FALSE },
+  { "wfstream",             "basic_fstream<wchar_t>",       0,                     0,             0,             0,            0,             FALSE,              FALSE },
+  { "istringstream",        "basic_istringstream<char>",    0,                     0,             0,             0,            0,             FALSE,              FALSE },
+  { "wistringstream",       "basic_istringstream<wchar_t>", 0,                     0,             0,             0,            0,             FALSE,              FALSE },
+  { "ostringstream",        "basic_ostringstream<char>",    0,                     0,             0,             0,            0,             FALSE,              FALSE },
+  { "wostringstream",       "basic_ostringstream<wchar_t>", 0,                     0,             0,             0,            0,             FALSE,              FALSE },
+  { "stringstream",         "basic_stringstream<char>",     0,                     0,             0,             0,            0,             FALSE,              FALSE },
+  { "wstringstream",        "basic_stringstream<wchar_t>",  0,                     0,             0,             0,            0,             FALSE,              FALSE },
+  { "basic_string",         0,                              0,                     "Char",        0,             0,            0,             FALSE,              TRUE  },
+  { "string",               "basic_string<char>",           0,                     0,             0,             0,            0,             FALSE,              TRUE  },
+  { "wstring",              "basic_string<wchar_t>",        0,                     0,             0,             0,            0,             FALSE,              TRUE  },
+  { "u8string",             "basic_string<char8_t>",        0,                     0,             0,             0,            0,             FALSE,              TRUE  }, // C++20
+  { "u16string",            "basic_string<char16_t>",       0,                     0,             0,             0,            0,             FALSE,              TRUE  }, // C++11
+  { "u32string",            "basic_string<char32_t>",       0,                     0,             0,             0,            0,             FALSE,              TRUE  }, // C++11
+  { "basic_string_view",    0,                              0,                     "Char",        0,             0,            0,             FALSE,              TRUE  },
+  { "string_view",          "basic_string_view<char>",      0,                     0,             0,             0,            0,             FALSE,              TRUE  }, // C++17
+  { "wstring_view",         "basic_string_view<wchar_t>",   0,                     0,             0,             0,            0,             FALSE,              TRUE  }, // C++17
+  { "u8string_view",        "basic_string_view<char8_t>",   0,                     0,             0,             0,            0,             FALSE,              TRUE  }, // C++20
+  { "u16string_view",       "basic_string_view<char16_t>",  0,                     0,             0,             0,            0,             FALSE,              TRUE  }, // C++17
+  { "u32string_view",       "basic_string_view<char32_t>",  0,                     0,             0,             0,            0,             FALSE,              TRUE  }, // C++17
+  { "complex",              0,                              0,                     0,             0,             0,            0,             FALSE,              FALSE },
+  { "bitset",               0,                              0,                     "Bits",        0,             0,            0,             FALSE,              FALSE },
+  { "deque",                0,                              0,                     "T",           "elements",    0,            0,             FALSE,              TRUE  },
+  { "list",                 0,                              0,                     "T",           "elements",    0,            0,             FALSE,              TRUE  },
+  { "forward_list",         0,                              0,                     "T",           "elements",    0,            0,             FALSE,              TRUE  }, // C++11
+  { "map",                  0,                              0,                     "K",           "keys",        "T",          "elements",    FALSE,              TRUE  },
+  { "unordered_map",        0,                              0,                     "K",           "keys",        "T",          "elements",    FALSE,              TRUE  }, // C++11
+  { "multimap",             0,                              0,                     "K",           "keys",        "T",          "elements",    FALSE,              TRUE  },
+  { "unordered_multimap",   0,                              0,                     "K",           "keys",        "T",          "elements",    FALSE,              TRUE  }, // C++11
+  { "set",                  0,                              0,                     "K",           "keys",        0,            0,             FALSE,              TRUE  },
+  { "unordered_set",        0,                              0,                     "K",           "keys",        0,            0,             FALSE,              TRUE  }, // C++11
+  { "multiset",             0,                              0,                     "K",           "keys",        0,            0,             FALSE,              TRUE  },
+  { "unordered_multiset",   0,                              0,                     "K",           "keys",        0,            0,             FALSE,              TRUE  }, // C++11
+  { "array",                0,                              0,                     "T",           "elements",    0,            0,             FALSE,              TRUE  }, // C++11
+  { "vector",               0,                              0,                     "T",           "elements",    0,            0,             FALSE,              TRUE  },
+  { "span",                 0,                              0,                     "T",           "elements",    0,            0,             FALSE,              TRUE  }, // C++20
+  { "queue",                0,                              0,                     "T",           "elements",    0,            0,             FALSE,              FALSE },
+  { "priority_queue",       0,                              0,                     "T",           "elements",    0,            0,             FALSE,              FALSE },
+  { "stack",                0,                              0,                     "T",           "elements",    0,            0,             FALSE,              FALSE },
+  { "valarray",             0,                              0,                     "T",           "elements",    0,            0,             FALSE,              FALSE },
+  { "exception",            0,                              0,                     0,             0,             0,            0,             FALSE,              FALSE },
+  { "bad_alloc",            "exception",                    0,                     0,             0,             0,            0,             FALSE,              FALSE },
+  { "bad_cast",             "exception",                    0,                     0,             0,             0,            0,             FALSE,              FALSE },
+  { "bad_typeid",           "exception",                    0,                     0,             0,             0,            0,             FALSE,              FALSE },
+  { "logic_error",          "exception",                    0,                     0,             0,             0,            0,             FALSE,              FALSE },
+  { "ios_base::failure",    "exception",                    0,                     0,             0,             0,            0,             FALSE,              FALSE },
+  { "runtime_error",        "exception",                    0,                     0,             0,             0,            0,             FALSE,              FALSE },
+  { "bad_exception",        "exception",                    0,                     0,             0,             0,            0,             FALSE,              FALSE },
+  { "domain_error",         "logic_error",                  0,                     0,             0,             0,            0,             FALSE,              FALSE },
+  { "invalid_argument",     "logic_error",                  0,                     0,             0,             0,            0,             FALSE,              FALSE },
+  { "length_error",         "logic_error",                  0,                     0,             0,             0,            0,             FALSE,              FALSE },
+  { "out_of_range",         "logic_error",                  0,                     0,             0,             0,            0,             FALSE,              FALSE },
+  { "range_error",          "runtime_error",                0,                     0,             0,             0,            0,             FALSE,              FALSE },
+  { "overflow_error",       "runtime_error",                0,                     0,             0,             0,            0,             FALSE,              FALSE },
+  { "underflow_error",      "runtime_error",                0,                     0,             0,             0,            0,             FALSE,              FALSE },
+  { 0,                      0,                              0,                     0,             0,             0,            0,             FALSE,              FALSE }
+};
+
+static void addSTLMember(const std::shared_ptr<Entry> &root,const char *type,const char *name)
+{
+  std::shared_ptr<Entry> memEntry = std::make_shared<Entry>();
+  memEntry->name       = name;
+  memEntry->type       = type;
+  memEntry->protection = Public;
+  memEntry->section    = Entry::VARIABLE_SEC;
+  memEntry->brief      = "STL member";
+  memEntry->hidden     = FALSE;
+  memEntry->artificial = TRUE;
+  root->moveToSubEntryAndKeep(memEntry);
+}
+
+static void addSTLIterator(const std::shared_ptr<Entry> &classEntry,const char *name)
+{
+  std::shared_ptr<Entry> iteratorClassEntry = std::make_shared<Entry>();
+  iteratorClassEntry->fileName  = "[STL]";
+  iteratorClassEntry->startLine = 1;
+  iteratorClassEntry->name      = name;
+  iteratorClassEntry->section   = Entry::CLASS_SEC;
+  iteratorClassEntry->brief     = "STL iterator class";
+  iteratorClassEntry->hidden    = FALSE;
+  iteratorClassEntry->artificial= TRUE;
+  classEntry->moveToSubEntryAndKeep(iteratorClassEntry);
+}
+
+static void addSTLClass(const std::shared_ptr<Entry> &root,const STLInfo *info)
+{
+  //printf("Adding STL class %s\n",info->className);
+  QCString fullName = info->className;
+  fullName.prepend("std::");
+
+  // add fake Entry for the class
+  std::shared_ptr<Entry> classEntry = std::make_shared<Entry>();
+  classEntry->fileName  = "[STL]";
+  classEntry->startLine = 1;
+  classEntry->name      = fullName;
+  classEntry->section   = Entry::CLASS_SEC;
+  classEntry->brief     = "STL class";
+  classEntry->hidden    = FALSE;
+  classEntry->artificial= TRUE;
+
+  // add template arguments to class
+  if (info->templType1)
+  {
+    ArgumentList al;
+    Argument a;
+    a.type="typename";
+    a.name=info->templType1;
+    al.push_back(a);
+    if (info->templType2) // another template argument
+    {
+      a.type="typename";
+      a.name=info->templType2;
+      al.push_back(a);
+    }
+    classEntry->tArgLists.push_back(al);
+  }
+  // add member variables
+  if (info->templName1)
+  {
+    addSTLMember(classEntry,info->templType1,info->templName1);
+  }
+  if (info->templName2)
+  {
+    addSTLMember(classEntry,info->templType2,info->templName2);
+  }
+  if (fullName=="std::auto_ptr" ||
+      fullName=="std::smart_ptr" ||
+      fullName=="std::shared_ptr" ||
+      fullName=="std::weak_ptr" ||
+      fullName=="std::unique_ptr")
+  {
+    std::shared_ptr<Entry> memEntry = std::make_shared<Entry>();
+    memEntry->name       = "operator->";
+    memEntry->args       = "()";
+    memEntry->type       = "T*";
+    memEntry->protection = Public;
+    memEntry->section    = Entry::FUNCTION_SEC;
+    memEntry->brief      = "STL member";
+    memEntry->hidden     = FALSE;
+    memEntry->artificial = FALSE;
+    classEntry->moveToSubEntryAndKeep(memEntry);
+  }
+  if (info->baseClass1)
+  {
+    classEntry->extends.push_back(BaseInfo(info->baseClass1,Public,info->virtualInheritance?Virtual:Normal));
+  }
+  if (info->baseClass2)
+  {
+    classEntry->extends.push_back(BaseInfo(info->baseClass2,Public,info->virtualInheritance?Virtual:Normal));
+  }
+  if (info->iterators)
+  {
+    // add iterator class
+    addSTLIterator(classEntry,fullName+"::iterator");
+    addSTLIterator(classEntry,fullName+"::const_iterator");
+    addSTLIterator(classEntry,fullName+"::reverse_iterator");
+    addSTLIterator(classEntry,fullName+"::const_reverse_iterator");
+  }
+  root->moveToSubEntryAndKeep(classEntry);
+}
+
+
+static void addSTLClasses(const std::shared_ptr<Entry> &root)
+{
+  std::shared_ptr<Entry> namespaceEntry = std::make_shared<Entry>();
+  namespaceEntry->fileName  = "[STL]";
+  namespaceEntry->startLine = 1;
+  namespaceEntry->name      = "std";
+  namespaceEntry->section   = Entry::NAMESPACE_SEC;
+  namespaceEntry->brief     = "STL namespace";
+  namespaceEntry->hidden    = FALSE;
+  namespaceEntry->artificial= TRUE;
+
+  STLInfo *info = g_stlinfo;
+  while (info->className)
+  {
+    addSTLClass(namespaceEntry,info);
+    info++;
+  }
+
+  root->moveToSubEntryAndKeep(namespaceEntry);
+}
+
+void addSTLSupport(std::shared_ptr<Entry> &root)
+{
+  if (Config_getBool(BUILTIN_STL_SUPPORT))
+  {
+    addSTLClasses(root);
+  }
+}
diff --git a/src/stlsupport.h b/src/stlsupport.h
new file mode 100644 (file)
index 0000000..6712332
--- /dev/null
@@ -0,0 +1,29 @@
+
+/******************************************************************************
+ *
+ * Copyright (C) 1997-2019 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ * Documents produced by Doxygen are derivative works derived from the
+ * input used in their production; they are not affected by this license.
+ *
+ */
+
+#ifndef STLSUPPORT_H
+#define STLSUPPORT_H
+
+#include <memory>
+
+class Entry;
+
+/** Add stub entries for the most used classes in the standard template library
+ *  @param root Root of the entry tree to add the entries to.
+ */
+void addSTLSupport(std::shared_ptr<Entry> &root);
+
+#endif
index 56dbe7d..3f9a7a1 100644 (file)
@@ -21,6 +21,8 @@
 #include <assert.h>
 #include <stdio.h>
 #include <stdarg.h>
+#include <algorithm>
+
 
 #include <qxml.h>
 #include <qstack.h>
@@ -98,14 +100,14 @@ class TagClassInfo
 {
   public:
     enum Kind { None=-1, Class, Struct, Union, Interface, Exception, Protocol, Category, Enum, Service, Singleton };
-    TagClassInfo() { bases=0, templateArguments=0; members.setAutoDelete(TRUE); isObjC=FALSE; kind = None; }
-   ~TagClassInfo() { delete bases; delete templateArguments; }
+    TagClassInfo() { templateArguments=0; members.setAutoDelete(TRUE); isObjC=FALSE; kind = None; }
+   ~TagClassInfo() { delete templateArguments; }
     QCString name;
     QCString filename;
     QCString clangId;
     QCString anchor;
     TagAnchorInfoList docAnchors;
-    QList<BaseInfo> *bases;
+    std::vector<BaseInfo> bases;
     QList<TagMemberInfo> members;
     QList<QCString> *templateArguments;
     QCStringList classList;
@@ -494,6 +496,23 @@ class TagFileParser : public QXmlDefaultHandler
 
     void endDocAnchor()
     {
+      // Check whether or not the tag is automatically generate, in that case ignore the tag.
+      switch(m_state)
+      {
+        case InClass:
+        case InFile:
+        case InNamespace:
+        case InGroup:
+        case InPage:
+        case InMember:
+        case InPackage:
+        case InDir:
+          if (QString(m_curString).startsWith("autotoc_md")) return;
+          break;
+        default:
+          warn("Unexpected tag 'docanchor' found");
+          return;
+      }
       switch(m_state)
       {
         case InClass:     m_curClass->docAnchors.append(new TagAnchorInfo(m_fileName,m_curString,m_title)); break;
@@ -504,7 +523,7 @@ class TagFileParser : public QXmlDefaultHandler
         case InMember:    m_curMember->docAnchors.append(new TagAnchorInfo(m_fileName,m_curString,m_title)); break;
         case InPackage:   m_curPackage->docAnchors.append(new TagAnchorInfo(m_fileName,m_curString,m_title)); break;
         case InDir:       m_curDir->docAnchors.append(new TagAnchorInfo(m_fileName,m_curString,m_title)); break;
-        default:   warn("Unexpected tag 'docanchor' found"); break; 
+        default: break; // will not be reached
       }
     }
 
@@ -621,12 +640,7 @@ class TagFileParser : public QXmlDefaultHandler
         {
           virt = Virtual;
         }
-        if (m_curClass->bases==0) 
-        {
-          m_curClass->bases = new QList<BaseInfo>;
-          m_curClass->bases->setAutoDelete(TRUE);
-        }
-        m_curClass->bases->append(new BaseInfo(m_curString,prot,virt));
+        m_curClass->bases.push_back(BaseInfo(m_curString,prot,virt));
       }
       else
       {
@@ -638,7 +652,7 @@ class TagFileParser : public QXmlDefaultHandler
     {
       if (m_state==InClass && m_curClass)
       {
-        m_curClass->bases->getLast()->name = m_curString;
+        m_curClass->bases.back().name = m_curString;
       }
       else
       {
@@ -912,12 +926,12 @@ class TagFileParser : public QXmlDefaultHandler
     }
 
     void dump();
-    void buildLists(Entry *root);
+    void buildLists(const std::shared_ptr<Entry> &root);
     void addIncludes();
     
   private:
-    void buildMemberList(Entry *ce,QList<TagMemberInfo> &members);
-    void addDocAnchors(Entry *e,const TagAnchorInfoList &l);
+    void buildMemberList(const std::shared_ptr<Entry> &ce,QList<TagMemberInfo> &members);
+    void addDocAnchors(const std::shared_ptr<Entry> &e,const TagAnchorInfoList &l);
     QList<TagClassInfo>        m_tagFileClasses;
     QList<TagFileInfo>         m_tagFileFiles;
     QList<TagNamespaceInfo>    m_tagFileNamespaces;
@@ -988,14 +1002,9 @@ void TagFileParser::dump()
   {
     msg("class '%s'\n",cd->name.data());
     msg("  filename '%s'\n",cd->filename.data());
-    if (cd->bases)
+    for (const BaseInfo &bi : cd->bases)
     {
-      QListIterator<BaseInfo> bii(*cd->bases);
-      BaseInfo *bi;
-      for ( bii.toFirst() ; (bi=bii.current()) ; ++bii) 
-      {
-        msg( "  base: %s \n", bi->name.data() );
-      }
+      msg( "  base: %s \n", bi.name.data() );
     }
 
     QListIterator<TagMemberInfo> mci(cd->members);
@@ -1147,7 +1156,7 @@ void TagFileParser::dump()
   }
 }
 
-void TagFileParser::addDocAnchors(Entry *e,const TagAnchorInfoList &l)
+void TagFileParser::addDocAnchors(const std::shared_ptr<Entry> &e,const TagAnchorInfoList &l)
 {
   QListIterator<TagAnchorInfo> tli(l);
   TagAnchorInfo *ta;
@@ -1160,7 +1169,7 @@ void TagFileParser::addDocAnchors(Entry *e,const TagAnchorInfoList &l)
       SectionInfo *si=new SectionInfo(ta->fileName,-1,ta->label,ta->title,
           SectionInfo::Anchor,0,m_tagName);
       Doxygen::sectionDict->append(ta->label,si);
-      e->anchors->append(si);
+      e->anchors.push_back(si);
     }
     else
     {
@@ -1169,21 +1178,19 @@ void TagFileParser::addDocAnchors(Entry *e,const TagAnchorInfoList &l)
   }
 }
 
-void TagFileParser::buildMemberList(Entry *ce,QList<TagMemberInfo> &members)
+void TagFileParser::buildMemberList(const std::shared_ptr<Entry> &ce,QList<TagMemberInfo> &members)
 {
   QListIterator<TagMemberInfo> mii(members);
   TagMemberInfo *tmi;
   for (;(tmi=mii.current());++mii)
   {
-    Entry *me      = new Entry;
+    std::shared_ptr<Entry> me = std::make_shared<Entry>();
     me->type       = tmi->type;
     me->name       = tmi->name;
     me->args       = tmi->arglist;
     if (!me->args.isEmpty())
     {
-      delete me->argList;
-      me->argList = new ArgumentList;
-      stringToArgumentList(me->args,me->argList);
+      stringToArgumentList(SrcLangExt_Cpp,me->args,me->argList);
     }
     if (tmi->enumValues.count()>0)
     {
@@ -1192,17 +1199,16 @@ void TagFileParser::buildMemberList(Entry *ce,QList<TagMemberInfo> &members)
       TagEnumValueInfo *evi;
       for (evii.toFirst();(evi=evii.current());++evii)
       {
-        Entry *ev      = new Entry;
+        std::shared_ptr<Entry> ev = std::make_shared<Entry>();
         ev->type       = "@";
         ev->name       = evi->name;
         ev->id         = evi->clangid;
         ev->section    = Entry::VARIABLE_SEC;
-        TagInfo *ti    = new TagInfo;
-        ti->tagName    = m_tagName;
-        ti->anchor     = evi->anchor;
-        ti->fileName   = evi->file;
-        ev->tagInfo    = ti;
-        me->addSubEntry(ev);
+        ev->tagInfoData.tagName    = m_tagName;
+        ev->tagInfoData.anchor     = evi->anchor;
+        ev->tagInfoData.fileName   = evi->file;
+        ev->hasTagInfo    = TRUE;
+        me->moveToSubEntryAndKeep(ev);
       }
     }
     me->protection = tmi->prot;
@@ -1212,14 +1218,13 @@ void TagFileParser::buildMemberList(Entry *ce,QList<TagMemberInfo> &members)
     me->id         = tmi->clangId;
     if (ce->section == Entry::GROUPDOC_SEC)
     {
-      me->groups->append(new Grouping(ce->name,Grouping::GROUPING_INGROUP));
+      me->groups.push_back(Grouping(ce->name,Grouping::GROUPING_INGROUP));
     }
     addDocAnchors(me,tmi->docAnchors);
-    TagInfo *ti    = new TagInfo;
-    ti->tagName    = m_tagName;
-    ti->anchor     = tmi->anchor;
-    ti->fileName   = tmi->anchorFile;
-    me->tagInfo    = ti;
+    me->tagInfoData.tagName    = m_tagName;
+    me->tagInfoData.anchor     = tmi->anchor;
+    me->tagInfoData.fileName   = tmi->anchorFile;
+    me->hasTagInfo    = TRUE;
     if (tmi->kind=="define")
     {
       me->type="#define";
@@ -1287,7 +1292,7 @@ void TagFileParser::buildMemberList(Entry *ce,QList<TagMemberInfo> &members)
       me->section = Entry::FUNCTION_SEC;
       me->mtype = Slot;
     }
-    ce->addSubEntry(me);
+    ce->moveToSubEntryAndKeep(me);
   }
 }
 
@@ -1308,14 +1313,14 @@ static QCString stripPath(const QCString &s)
  *  This tree contains the information extracted from the input in a 
  *  "unrelated" form.
  */
-void TagFileParser::buildLists(Entry *root)
+void TagFileParser::buildLists(const std::shared_ptr<Entry> &root)
 {
   // build class list
   QListIterator<TagClassInfo> cit(m_tagFileClasses);
   TagClassInfo *tci;
   for (cit.toFirst();(tci=cit.current());++cit)
   {
-    Entry *ce = new Entry;
+    std::shared_ptr<Entry> ce = std::make_shared<Entry>();
     ce->section = Entry::CLASS_SEC;
     switch (tci->kind)
     {
@@ -1339,42 +1344,32 @@ void TagFileParser::buildLists(Entry *root)
       ce->name+="-p";
     }
     addDocAnchors(ce,tci->docAnchors);
-    TagInfo *ti  = new TagInfo;
-    ti->tagName  = m_tagName;
-    ti->anchor   = tci->anchor;
-    ti->fileName = tci->filename;
+    ce->tagInfoData.tagName  = m_tagName;
+    ce->tagInfoData.anchor   = tci->anchor;
+    ce->tagInfoData.fileName = tci->filename;
+    ce->hasTagInfo  = TRUE;
     ce->id       = tci->clangId;
-    ce->tagInfo  = ti;
     ce->lang     = tci->isObjC ? SrcLangExt_ObjC : SrcLangExt_Unknown;
     // transfer base class list
-    if (tci->bases)
-    {
-      delete ce->extends;
-      ce->extends = tci->bases; tci->bases = 0;
-    }
+    ce->extends  = tci->bases;
+    tci->bases.clear();
     if (tci->templateArguments)
     {
-      if (ce->tArgLists==0)
-      {
-        ce->tArgLists = new QList<ArgumentList>;
-        ce->tArgLists->setAutoDelete(TRUE);
-      }
-      ArgumentList *al = new ArgumentList;
-      ce->tArgLists->append(al);
-
+      ArgumentList al;
       QListIterator<QCString> sli(*tci->templateArguments);
       QCString *argName;
       for (;(argName=sli.current());++sli)
       {
-        Argument *a = new Argument;
-        a->type = "class";
-        a->name = *argName;
-        al->append(a);
+        Argument a;
+        a.type = "class";
+        a.name = *argName;
+        al.push_back(a);
       }
+      ce->tArgLists.push_back(al);
     }
 
     buildMemberList(ce,tci->members);
-    root->addSubEntry(ce);
+    root->moveToSubEntryAndKeep(ce);
   }
 
   // build file list
@@ -1382,15 +1377,14 @@ void TagFileParser::buildLists(Entry *root)
   TagFileInfo *tfi;
   for (fit.toFirst();(tfi=fit.current());++fit)
   {
-    Entry *fe = new Entry;
+    std::shared_ptr<Entry> fe = std::make_shared<Entry>();
     fe->section = guessSection(tfi->name);
     fe->name     = tfi->name;
     addDocAnchors(fe,tfi->docAnchors);
-    TagInfo *ti  = new TagInfo;
-    ti->tagName  = m_tagName;
-    ti->fileName = tfi->filename;
-    fe->tagInfo  = ti;
-    
+    fe->tagInfoData.tagName  = m_tagName;
+    fe->tagInfoData.fileName = tfi->filename;
+    fe->hasTagInfo = TRUE;
+
     QCString fullName = m_tagName+":"+tfi->path+stripPath(tfi->name);
     fe->fileName = fullName;
     //printf("createFileDef() filename=%s\n",tfi->filename.data());
@@ -1411,7 +1405,7 @@ void TagFileParser::buildLists(Entry *root)
       Doxygen::inputNameDict->insert(tfi->name,mn);
     }
     buildMemberList(fe,tfi->members);
-    root->addSubEntry(fe);
+    root->moveToSubEntryAndKeep(fe);
   }
 
   // build namespace list
@@ -1419,18 +1413,17 @@ void TagFileParser::buildLists(Entry *root)
   TagNamespaceInfo *tni;
   for (nit.toFirst();(tni=nit.current());++nit)
   {
-    Entry *ne    = new Entry;
+    std::shared_ptr<Entry> ne = std::make_shared<Entry>();
     ne->section  = Entry::NAMESPACE_SEC;
     ne->name     = tni->name;
     addDocAnchors(ne,tni->docAnchors);
-    TagInfo *ti  = new TagInfo;
-    ti->tagName  = m_tagName;
-    ti->fileName = tni->filename;
+    ne->tagInfoData.tagName  = m_tagName;
+    ne->tagInfoData.fileName = tni->filename;
+    ne->hasTagInfo  = TRUE;
     ne->id       = tni->clangId;
-    ne->tagInfo  = ti;
 
     buildMemberList(ne,tni->members);
-    root->addSubEntry(ne);
+    root->moveToSubEntryAndKeep(ne);
   }
 
   // build package list
@@ -1438,17 +1431,16 @@ void TagFileParser::buildLists(Entry *root)
   TagPackageInfo *tpgi;
   for (pit.toFirst();(tpgi=pit.current());++pit)
   {
-    Entry *pe    = new Entry;
+    std::shared_ptr<Entry> pe = std::make_shared<Entry>();
     pe->section  = Entry::PACKAGE_SEC;
     pe->name     = tpgi->name;
     addDocAnchors(pe,tpgi->docAnchors);
-    TagInfo *ti  = new TagInfo;
-    ti->tagName  = m_tagName;
-    ti->fileName = tpgi->filename;
-    pe->tagInfo  = ti;
+    pe->tagInfoData.tagName  = m_tagName;
+    pe->tagInfoData.fileName = tpgi->filename;
+    pe->hasTagInfo  = TRUE;
 
     buildMemberList(pe,tpgi->members);
-    root->addSubEntry(pe);
+    root->moveToSubEntryAndKeep(pe);
   }
 
   // build group list
@@ -1456,18 +1448,17 @@ void TagFileParser::buildLists(Entry *root)
   TagGroupInfo *tgi;
   for (git.toFirst();(tgi=git.current());++git)
   {
-    Entry *ge    = new Entry;
+    std::shared_ptr<Entry> ge = std::make_shared<Entry>();
     ge->section  = Entry::GROUPDOC_SEC;
     ge->name     = tgi->name;
     ge->type     = tgi->title;
     addDocAnchors(ge,tgi->docAnchors);
-    TagInfo *ti  = new TagInfo;
-    ti->tagName  = m_tagName;
-    ti->fileName = tgi->filename;
-    ge->tagInfo  = ti;
+    ge->tagInfoData.tagName  = m_tagName;
+    ge->tagInfoData.fileName = tgi->filename;
+    ge->hasTagInfo  = TRUE;
 
     buildMemberList(ge,tgi->members);
-    root->addSubEntry(ge);
+    root->moveToSubEntryAndKeep(ge);
   }
 
   // set subgroup relations bug_774118
@@ -1476,13 +1467,16 @@ void TagFileParser::buildLists(Entry *root)
     QCStringList::Iterator it;
     for ( it = tgi->subgroupList.begin(); it != tgi->subgroupList.end(); ++it )
     {
-      QListIterator<Entry> eli(*(root->children()));
-      Entry *childNode;
-      for (eli.toFirst();(childNode=eli.current());++eli)
+      //QListIterator<Entry> eli(*(root->children()));
+      //Entry *childNode;
+      //for (eli.toFirst();(childNode=eli.current());++eli)
+      const auto &children = root->children();
+      auto i = std::find_if(children.begin(),children.end(),
+          [&](const std::shared_ptr<Entry> &e) { return e->name = *it; });
+      if (i!=children.end())
       {
-        if (childNode->name == (*it)) break;
+        (*i)->groups.push_back(Grouping(tgi->name,Grouping::GROUPING_INGROUP));
       }
-      childNode->groups->append(new Grouping(tgi->name,Grouping::GROUPING_INGROUP));
     }
   }
 
@@ -1491,16 +1485,15 @@ void TagFileParser::buildLists(Entry *root)
   TagPageInfo *tpi;
   for (pgit.toFirst();(tpi=pgit.current());++pgit)
   {
-    Entry *pe    = new Entry;
+    std::shared_ptr<Entry> pe = std::make_shared<Entry>();
     pe->section  = tpi->filename=="index" ? Entry::MAINPAGEDOC_SEC : Entry::PAGEDOC_SEC;
     pe->name     = tpi->name;
     pe->args     = tpi->title;
     addDocAnchors(pe,tpi->docAnchors);
-    TagInfo *ti  = new TagInfo;
-    ti->tagName  = m_tagName;
-    ti->fileName = tpi->filename;
-    pe->tagInfo  = ti;
-    root->addSubEntry(pe);
+    pe->tagInfoData.tagName  = m_tagName;
+    pe->tagInfoData.fileName = tpi->filename;
+    pe->hasTagInfo  = TRUE;
+    root->moveToSubEntryAndKeep(pe);
   }
 }
 
@@ -1551,7 +1544,7 @@ void TagFileParser::addIncludes()
   }
 }
 
-void parseTagFile(Entry *root,const char *fullName)
+void parseTagFile(const std::shared_ptr<Entry> &root,const char *fullName)
 {
   QFileInfo fi(fullName);
   if (!fi.exists()) return;
index 6ea2d81..454060b 100644 (file)
@@ -21,6 +21,8 @@
 
 class Entry;
 
-void parseTagFile(Entry *root,const char *fullPathName);
+#include <memory>
+
+void parseTagFile(const std::shared_ptr<Entry> &root,const char *fullPathName);
 
 #endif
index 0e56bdd..cdd56d8 100644 (file)
  *
  *  This is the Tcl language parser for doxygen.
  */
-class TclLanguageScanner : public ParserInterface
+class TclOutlineParser : public OutlineParserInterface
 {
   public:
-    virtual ~TclLanguageScanner() {}
     void startTranslationUnit(const char *) {}
     void finishTranslationUnit() {}
     void parseInput(const char *fileName,
                     const char *fileBuf,
-                    Entry *root,
+                    const std::shared_ptr<Entry> &root,
                     bool sameTranslationUnit,
                     QStrList &filesInSameTranslationUnit);
-    bool needsPreprocessing(const QCString &extension);
+    bool needsPreprocessing(const QCString &extension) const;
+    void parsePrototype(const char *text);
+};
+
+class TclCodeParser : public CodeParserInterface
+{
+  public:
     void parseCode(CodeOutputInterface &codeOutIntf,
                    const char *scopeName,
                    const QCString &input,
@@ -53,7 +58,6 @@ class TclLanguageScanner : public ParserInterface
                    bool collectXRefs=TRUE
                   );
     void resetCodeParserState();
-    void parsePrototype(const char *text);
 };
 
 #endif
index 88bd474..a4709ce 100644 (file)
@@ -59,6 +59,8 @@
 
 #define MAX_INCLUDE_DEPTH 10
 
+static const char *stateToString(int state);
+
 //! Application error.
 #define tcl_err \
   printf("Error %d %s() at line %d! ",__LINE__,tcl.file_name.data(),yylineno); \
@@ -423,11 +425,11 @@ static struct
   int code_linenumbers; // if true create line numbers in code
   const char *code_font; // used font to codify
   bool config_autobrief; // value of configuration option
-  QMap<QString,QString> config_subst; // map of configuration option values
+  QMap<QCString,QCString> config_subst; // map of configuration option values
   QCString input_string; // file contents
   int input_position; // position in file
   QCString file_name; // name of used file
-  ParserInterface *this_parser; // myself
+  OutlineParserInterface *this_parser; // myself
   int command; // true if command was found
   int comment; // set true if comment was scanned
   int brace_level; // bookkeeping of braces
@@ -462,7 +464,7 @@ static struct
 
 // scanner functions
 static int yyread(char *buf,int max_size);
-static tcl_scan *tcl_scan_start(char type, QString content, QCString ns, Entry *entry_cls, Entry *entry_fn);
+static tcl_scan *tcl_scan_start(char type, QCString content, QCString ns, Entry *entry_cls, Entry *entry_fn);
 static void tcl_scan_end();
 static void tcl_comment(int what,const char *text);
 static void tcl_word(int what,const char *text);
@@ -484,6 +486,8 @@ Entry* tcl_entry_new()
 //  myEntry->mtype      = Method;
 //  myEntry->virt       = Normal;
 //  myEntry->stat       = FALSE;
+  myEntry->docFile    = tcl.file_name;
+  myEntry->inbodyFile = tcl.file_name;
   myEntry->fileName   = tcl.file_name;
   myEntry->lang       = SrcLangExt_Tcl;
   Doxygen::docGroup.initGroupInfo(myEntry);
@@ -533,6 +537,13 @@ static void tcl_name(const QCString &ns0, const QCString &name0, QCString &ns, Q
     ns = "";
     name = myNm;
   }
+  else if (myNm.length()-myStart == 2)
+  {
+    // ending with :: so get name equal to last component
+    ns = myNm.mid(0,myStart);
+    myStart = ns.findRev("::");
+    name = myNm.mid(myStart+2);
+  }
   else
   {
     ns = myNm.mid(0,myStart);
@@ -576,7 +587,7 @@ Entry* tcl_entry_namespace(const QCString ns)
     myEntry = tcl_entry_new();
     myEntry->section    = Entry::NAMESPACE_SEC;
     myEntry->name       = ns;
-    tcl.entry_main->addSubEntry(myEntry);
+    tcl.entry_main->moveToSubEntryAndKeep(myEntry);
     tcl.ns.insert(ns,myEntry);
   }
   return myEntry;
@@ -595,7 +606,7 @@ Entry* tcl_entry_class(const QCString cl)
     myEntry = tcl_entry_new();
     myEntry->section    = Entry::CLASS_SEC;
     myEntry->name       = cl;
-    tcl.entry_main->addSubEntry(myEntry);
+    tcl.entry_main->moveToSubEntryAndKeep(myEntry);
     tcl.cl.insert(cl,myEntry);
   }
   return myEntry;
@@ -727,7 +738,7 @@ static void tcl_codify(const char *s,const char *str)
 }
 
 //! Codify 'str' with special font class 's'.
-static void tcl_codify(const char *s,const QString &str)
+static void tcl_codify(const char *s,const QCString &str)
 {
   if (tcl.code==NULL) return;
   tcl_codify(s,str);
 
 //! Start new scan context for given 'content'.
 // @return created new scan context.
-static tcl_scan *tcl_scan_start(char type, QString content, QCString ns, Entry *entry_cl, Entry *entry_fn)
+static tcl_scan *tcl_scan_start(char type, QCString content, QCString ns, Entry *entry_cl, Entry *entry_fn)
 {
   tcl_scan *myScan=tcl.scan.at(0);
-tcl_inf("line=%d type=%d '%s'\n",tcl.line_body0,type,content.ascii());
+tcl_inf("line=%d type=%d '%s'\n",tcl.line_body0,type,content.data());
 
   myScan->line1=yylineno;
   yy_push_state(TOP);
@@ -1165,7 +1176,7 @@ tcl_inf("line=%d type=%d '%s'\n",tcl.line_body0,type,content.ascii());
   myScan->entry_cl = entry_cl;
   myScan->entry_fn = entry_fn;
   myScan->entry_scan = tcl.entry_current;
-  myScan->buffer_state=yy_scan_string(content.ascii());
+  myScan->buffer_state=yy_scan_string(content.data());
   myScan->line0=tcl.line_body0;
   myScan->line1=tcl.line_body1;
   myScan->after.clear();
@@ -1492,7 +1503,7 @@ tcl_inf("-> %s\n",(const char *)tcl.string_comment);
     {
 tcl_inf("-> %s\n",(const char *)tcl.string_comment);
       int myPos=0;
-      bool myNew=0;
+      bool myNew=false;
       int myLine=tcl.line_comment;
       BufStr myI(1024);
       BufStr myO(1024);
@@ -1538,7 +1549,7 @@ tcl_inf("-> %s\n",(const char *)tcl.string_comment);
             processedDoc = preprocessCommentBlock(myDoc,tcl.file_name,myLine0);
             parseCommentBlock(tcl.this_parser, myEntry, processedDoc, tcl.file_name,
               myLine0, FALSE, tcl.config_autobrief, FALSE, myProt, myPos0, myNew);
-            tcl.entry_inside->addSubEntry(myEntry);
+            tcl.entry_inside->moveToSubEntryAndRefresh(myEntry);
           }
           else
           { // we can add to current entry in this case
@@ -1560,7 +1571,7 @@ tcl_inf("-> %s\n",(const char *)tcl.string_comment);
           processedDoc = preprocessCommentBlock(myDoc,tcl.file_name,myLine0);
           parseCommentBlock(tcl.this_parser, myEntry, processedDoc, tcl.file_name,
             myLine0, FALSE, tcl.config_autobrief, FALSE, myProt, myPos0, myNew);
-          tcl.entry_inside->addSubEntry(myEntry);
+          tcl.entry_inside->moveToSubEntryAndKeep(myEntry);
         }
         else
         { // we can add to current entry
@@ -1583,7 +1594,7 @@ tcl_inf("-> %s\n",(const char *)tcl.string_comment);
         {
           if (myNew)
           {
-            tcl.entry_inside->addSubEntry(tcl.entry_current);
+            tcl.entry_inside->moveToSubEntryAndKeep(tcl.entry_current);
             tcl.entry_current = tcl_entry_new();
           }
           else
@@ -1594,7 +1605,7 @@ tcl_inf("-> %s\n",(const char *)tcl.string_comment);
         }
         if (myNew)
         {
-          tcl.entry_inside->addSubEntry(tcl.entry_current);
+          tcl.entry_inside->moveToSubEntryAndKeep(tcl.entry_current);
           tcl.entry_current = tcl_entry_new();
         }
         else
@@ -1620,37 +1631,32 @@ tcl_inf("-> %s\n",(const char *)tcl.string_comment);
 static void tcl_command_ARGLIST(QCString &arglist)
 {
 D
-  Argument *myArg;
   QCStringList myArgs;
   QCString myArglist="";
 
-  if (!tcl.entry_current->argList)
-  {
-    tcl.entry_current->argList=new ArgumentList;
-  }
   tcl_split_list(arglist,myArgs);
   for (uint i=0;i<myArgs.count();i++)
   {
     QCStringList myArgs1;
-    myArg=new Argument;
+    Argument myArg;
 
     tcl_split_list(*myArgs.at(i),myArgs1);
     if (myArgs1.count()==2)
     {
-      myArg->name= (*myArgs1.at(0));
-      myArg->defval= (*myArgs1.at(1));
-      if (myArg->defval.isEmpty())
+      myArg.name= (*myArgs1.at(0));
+      myArg.defval= (*myArgs1.at(1));
+      if (myArg.defval.isEmpty())
       {
-        myArg->defval = " ";
+        myArg.defval = " ";
       }
-      myArglist += "?" + QCString(myArg->name) + "? ";
+      myArglist += "?" + QCString(myArg.name) + "? ";
     }
     else
     {
-      myArg->name= (*myArgs.at(i));
-      myArglist += myArg->name + " ";
+      myArg.name= (*myArgs.at(i));
+      myArglist += myArg.name + " ";
     }
-    tcl.entry_current->argList->append(myArg);
+    tcl.entry_current->argList.push_back(myArg);
   }
   arglist = myArglist;
   tcl.entry_current->args = arglist;
   tcl.entry_current->mtype = Method;
   tcl.entry_current->name = myName;
   tcl.entry_current->startLine = tcl.line_command;
+  tcl.entry_current->docLine = tcl.line_comment;
+  tcl.entry_current->inbodyLine = tcl.line_comment;
   tcl.entry_current->bodyLine = tcl.line_body0;
   tcl.entry_current->endBodyLine = tcl.line_body1;
   tcl_protection(tcl.entry_current);
   tcl_command_ARGLIST(*tcl.list_commandwords.at(4));
-  myEntryNs->addSubEntry(tcl.entry_current);
+  myEntryNs->moveToSubEntryAndKeep(tcl.entry_current);
   myEntry = tcl.entry_current;
   tcl.fn.insert(myName,myEntry);
   myScan = tcl_scan_start(tcl.word_is,*tcl.list_commandwords.at(6),
   tcl.entry_current->mtype = Method;
   tcl.entry_current->name = myName;
   tcl.entry_current->startLine = tcl.line_command;
+  tcl.entry_current->docLine = tcl.line_comment;
+  tcl.entry_current->inbodyLine = tcl.line_comment;
   tcl.entry_current->bodyLine = tcl.line_body0;
   tcl.entry_current->endBodyLine = tcl.line_body1;
   tcl_protection(tcl.entry_current);
   tcl_command_ARGLIST(*tcl.list_commandwords.at(4));
-  myEntryCl->addSubEntry(tcl.entry_current);
+  myEntryCl->moveToSubEntryAndKeep(tcl.entry_current);
   tcl.fn.insert(myName,tcl.entry_current);
   myEntry = tcl.entry_current;
   myScan = tcl_scan_start(tcl.word_is,*tcl.list_commandwords.at(6),
   tcl.entry_current->mtype = Method;
   tcl.entry_current->name = myName;
   tcl.entry_current->startLine = tcl.line_command;
+  tcl.entry_current->docLine = tcl.line_comment;
+  tcl.entry_current->inbodyLine = tcl.line_comment;
   tcl.entry_current->bodyLine = tcl.line_body0;
   tcl.entry_current->endBodyLine = tcl.line_body1;
   tcl_protection(tcl.entry_current);
   tcl_command_ARGLIST(*tcl.list_commandwords.at(2));
-  if (myEntryCl) myEntryCl->addSubEntry(tcl.entry_current);
+  if (myEntryCl) myEntryCl->moveToSubEntryAndKeep(tcl.entry_current);
   myEntry = tcl.entry_current;
   tcl.fn.insert(myName,myEntry);
   myScan = tcl_scan_start(tcl.word_is,*tcl.list_commandwords.at(4),
   tcl.entry_current->mtype = Method;
   tcl.entry_current->name = myName;
   tcl.entry_current->startLine = tcl.line_command;
+  tcl.entry_current->docLine = tcl.line_comment;
+  tcl.entry_current->inbodyLine = tcl.line_comment;
   tcl.entry_current->bodyLine = tcl.line_body0;
   tcl.entry_current->endBodyLine = tcl.line_body1;
   tcl_protection(tcl.entry_current);
-  myEntryCl->addSubEntry(tcl.entry_current);
+  myEntryCl->moveToSubEntryAndKeep(tcl.entry_current);
   myEntry = tcl.entry_current;
   tcl.fn.insert(myName,myEntry);
   myScan = tcl_scan_start(tcl.word_is,*tcl.list_commandwords.at(2),
@@ -2296,9 +2310,11 @@ D
   tcl.entry_current->section = Entry::NAMESPACE_SEC;
   tcl.entry_current->name = myName;
   tcl.entry_current->startLine = tcl.line_command;
+  tcl.entry_current->docLine = tcl.line_comment;
+  tcl.entry_current->inbodyLine = tcl.line_comment;
   tcl.entry_current->bodyLine = tcl.line_body0;
   tcl.entry_current->endBodyLine = tcl.line_body1;
-  tcl.entry_main->addSubEntry(tcl.entry_current);
+  tcl.entry_main->moveToSubEntryAndKeep(tcl.entry_current);
   tcl.ns.insert(myName,tcl.entry_current);
   //myEntryNs = tcl.entry_current;
   myStr = (*tcl.list_commandwords.at(6));
@@ -2334,9 +2350,11 @@ D
   tcl.entry_current->section = Entry::CLASS_SEC;
   tcl.entry_current->name = myName;
   tcl.entry_current->startLine = tcl.line_command;
+  tcl.entry_current->docLine = tcl.line_comment;
+  tcl.entry_current->inbodyLine = tcl.line_comment;
   tcl.entry_current->bodyLine = tcl.line_body0;
   tcl.entry_current->endBodyLine = tcl.line_body1;
-  tcl.entry_main->addSubEntry(tcl.entry_current);
+  tcl.entry_main->moveToSubEntryAndKeep(tcl.entry_current);
   tcl.cl.insert(myName,tcl.entry_current);
   myEntryCl = tcl.entry_current;
   myScan = tcl_scan_start(tcl.word_is,*tcl.list_commandwords.at(4),
@@ -2366,9 +2384,11 @@ D
   tcl.entry_current->section = Entry::CLASS_SEC;
   tcl.entry_current->name = myName;
   tcl.entry_current->startLine = tcl.line_command;
+  tcl.entry_current->docLine = tcl.line_comment;
+  tcl.entry_current->inbodyLine = tcl.line_comment;
   tcl.entry_current->bodyLine = tcl.line_body0;
   tcl.entry_current->endBodyLine = tcl.line_body1;
-  tcl.entry_main->addSubEntry(tcl.entry_current);
+  tcl.entry_main->moveToSubEntryAndKeep(tcl.entry_current);
   //myEntryNs = tcl_entry_namespace(myName);
   tcl.cl.insert(myName,tcl.entry_current);
   myEntryCl = tcl.entry_current;
@@ -2418,6 +2438,8 @@ D
     tcl.entry_current->mtype = Method;
     tcl.entry_current->name = myMethod;
     tcl.entry_current->startLine = tcl.line_command;
+    tcl.entry_current->docLine = tcl.line_comment;
+    tcl.entry_current->inbodyLine = tcl.line_comment;
     tcl.entry_current->bodyLine = tcl.line_body0;
     tcl.entry_current->endBodyLine = tcl.line_body1;
     tcl_protection(tcl.entry_current);
@@ -2429,7 +2451,7 @@ D
     {
       tcl_command_ARGLIST(*tcl.list_commandwords.at(6));
     }
-    if (myEntryCl) myEntryCl->addSubEntry(tcl.entry_current);
+    if (myEntryCl) myEntryCl->moveToSubEntryAndKeep(tcl.entry_current);
     tcl.fn.insert(myMethod,tcl.entry_current);
     myEntry = tcl.entry_current;
     myScan = tcl_scan_start('?',*tcl.list_commandwords.at(n-1),
   tcl.entry_current->section = Entry::VARIABLE_SEC;
   tcl.entry_current->name = myName;
   tcl.entry_current->startLine = tcl.line_command;
+  tcl.entry_current->docLine = tcl.line_comment;
+  tcl.entry_current->inbodyLine = tcl.line_comment;
   tcl.entry_current->bodyLine = tcl.line_body0;
   tcl.entry_current->endBodyLine = tcl.line_body1;
   tcl_protection(tcl.entry_current);
-  myEntry->addSubEntry(tcl.entry_current);
+  myEntry->moveToSubEntryAndKeep(tcl.entry_current);
   tcl.entry_current = tcl_entry_new();
 }
 
@@ -2560,7 +2584,7 @@ tcl_inf("->\n");
   if (myStr.left(2)=="::") myStr = myStr.mid(2);
   if (tcl.config_subst.contains(myStr))
   {
-    myStr=tcl.config_subst[myStr].utf8();
+    myStr=tcl.config_subst[myStr];
   }
   if (myStr=="private")
   {
@@ -2596,7 +2620,7 @@ tcl_inf("->\n");
     if (myStr.left(2)=="::") myStr = myStr.mid(2);
     if (tcl.config_subst.contains(myStr))
     {
-      myStr=tcl.config_subst[myStr].utf8();
+      myStr=tcl.config_subst[myStr];
     }
   }
   if (myStr=="proc")
@@ -2703,7 +2727,7 @@ tcl_inf("->\n");
     {
       for (unsigned int i = 2; i < tcl.list_commandwords.count(); i = i + 2)
       {
-        tcl.scan.at(0)->entry_cl->extends->append(new BaseInfo((*tcl.list_commandwords.at(i)),Public,Normal));
+        tcl.scan.at(0)->entry_cl->extends.push_back(BaseInfo((*tcl.list_commandwords.at(i)),Public,Normal));
       }
     }
     goto command_end;
@@ -2909,10 +2933,10 @@ static void tcl_parse(const QCString ns, const QCString cls)
   tcl.entry_file->name    = tcl.file_name;
   tcl.entry_file->section = Entry::SOURCE_SEC;
   tcl.entry_file->protection = Public;
-  tcl.entry_main->addSubEntry(tcl.entry_file);
+  tcl.entry_main->moveToSubEntryAndKeep(tcl.entry_file);
   Entry *myEntry=tcl_entry_new();
   myEntry->name="";
-  tcl.entry_main->addSubEntry(myEntry);
+  tcl.entry_main->moveToSubEntryAndKeep(myEntry);
   tcl.ns.insert("::",myEntry);
   tcl.entry_current = tcl_entry_new();
 
@@ -2940,9 +2964,9 @@ static void tcl_parse(const QCString ns, const QCString cls)
 }
 
 //! Parse text file and build up entry tree.
-void TclLanguageScanner::parseInput(const char *fileName,
+void TclOutlineParser::parseInput(const char *fileName,
                                     const char *input,
-                                    Entry *root,
+                                    const std::shared_ptr<Entry> &root,
                                     bool /*sameTranslationUnit*/,
                                     QStrList & /*filesInSameTranslationUnit*/)
 {
@@ -2963,7 +2987,7 @@ tcl_inf("%s\n",fileName);
   tcl.code = NULL;
   tcl.file_name = fileName;
   tcl.this_parser = this;
-  tcl.entry_main          = root; /* toplevel entry */
+  tcl.entry_main          = root.get(); /* toplevel entry */
   tcl_parse("","");
   Doxygen::docGroup.leaveFile(tcl.file_name,yylineno);
   root->program.resize(0);
@@ -2971,8 +2995,40 @@ tcl_inf("%s\n",fileName);
   printlex(yy_flex_debug, FALSE, __FILE__, fileName);
 }
 
+
+bool TclOutlineParser::needsPreprocessing(const QCString &extension) const
+{
+  (void)extension;
+  return FALSE;
+}
+
+void TclOutlineParser::parsePrototype(const char *text)
+{
+  (void)text;
+}
+
+static int yyread(char *buf,int max_size)
+{
+  int c=0;
+
+  *buf = '\0';
+  while ( c < max_size && tcl.input_string.at(tcl.input_position) )
+  {
+    *buf = tcl.input_string.at(tcl.input_position++) ;
+    c++; buf++;
+  }
+  //printf("Read from=%d size=%d max=%d c=%d\n",tcl.input_position,strlen(&tcl.input_string[tcl.input_position]),max_size,c);
+  return c;
+}
+
+//----------------------------------------------------------------------------
+
+void TclCodeParser::resetCodeParserState()
+{
+}
+
 //! Parse file and codify.
-void TclLanguageScanner::parseCode(CodeOutputInterface & codeOutIntf,
+void TclCodeParser::parseCode(CodeOutputInterface & codeOutIntf,
                    const char * scopeName,
                    const QCString & input,
                    SrcLangExt lang,
@@ -3016,7 +3072,7 @@ void TclLanguageScanner::parseCode(CodeOutputInterface & codeOutIntf,
     }
   }
 
-  QString myStr="Codifying..";
+  QCString myStr="Codifying..";
   if (scopeName)
   {
     myStr +=" scope=";
@@ -3039,7 +3095,7 @@ void TclLanguageScanner::parseCode(CodeOutputInterface & codeOutIntf,
     myStr+=" file=";
     myStr+=fileDef->fileName();
   }
-tcl_inf("%s (%d,%d) %d %d\n",myStr.ascii(),startLine,endLine,isExampleBlock,inlineFragment);
+tcl_inf("%s (%d,%d) %d %d\n",myStr.data(),startLine,endLine,isExampleBlock,inlineFragment);
 //tcl_inf("%s\n"input.data());
   tcl_init();
   tcl.collectXRefs = collectXRefs;
@@ -3076,36 +3132,6 @@ tcl_inf("%s (%d,%d) %d %d\n",myStr.ascii(),startLine,endLine,isExampleBlock,inli
   tcl.entry.clear();
   printlex(yy_flex_debug, FALSE, __FILE__, fileDef ? fileDef->fileName().data(): NULL);
 }
-
-bool TclLanguageScanner::needsPreprocessing(const QCString &extension)
-{
-  (void)extension;
-  return FALSE;
-}
-
-void TclLanguageScanner::resetCodeParserState()
-{
-}
-
-void TclLanguageScanner::parsePrototype(const char *text)
-{
-  (void)text;
-}
-
-static int yyread(char *buf,int max_size)
-{
-  int c=0;
-
-  *buf = '\0';
-  while ( c < max_size && tcl.input_string.at(tcl.input_position) )
-  {
-    *buf = tcl.input_string.at(tcl.input_position++) ;
-    c++; buf++;
-  }
-  //printf("Read from=%d size=%d max=%d c=%d\n",tcl.input_position,strlen(&tcl.input_string[tcl.input_position]),max_size,c);
-  return c;
-}
-
 //----------------------------------------------------------------------------
 
 // to avoid a warning
@@ -3114,10 +3140,4 @@ void tclDummy()
   yy_top_state();
 }
 
-#if !defined(YY_FLEX_SUBMINOR_VERSION) 
-//----------------------------------------------------------------------------
-extern "C" { // some bogus code to keep the compiler happy
-  void tclscannerYYdummy() { yy_flex_realloc(0,0); } 
-}
-#endif
-
+#include "tclscanner.l.h"
index 228da4d..ca28c73 100644 (file)
@@ -245,7 +245,7 @@ class TemplateStruct::Private
     Private() : fields(17), refCount(0)
     { fields.setAutoDelete(TRUE); }
     QDict<TemplateVariant> fields;
-    int refCount;
+    int refCount = 0;
 };
 
 TemplateStruct::TemplateStruct()
@@ -306,8 +306,8 @@ class TemplateList::Private
   public:
     Private() : index(-1), refCount(0) {}
     QValueList<TemplateVariant> elems;
-    int index;
-    int refCount;
+    int index = -1;
+    int refCount = 0;
 };
 
 
@@ -398,7 +398,7 @@ class TemplateListConstIterator : public TemplateListIntf::ConstIterator
   private:
     const TemplateList &m_list;
     QValueList<TemplateVariant>::ConstIterator m_it;
-    int m_index;
+    int m_index = 0;
 };
 
 TemplateListIntf::ConstIterator *TemplateList::createIterator() const
@@ -565,21 +565,21 @@ class TemplateContextImpl : public TemplateContext
     void addIndexEntry(const QCString &indexName,const QValueList<TemplateKeyValue> &arguments);
 
   private:
-    const TemplateEngine *m_engine;
+    const TemplateEngine *m_engine = 0;
     QCString m_templateName;
-    int m_line;
+    int m_line = 0;
     QCString m_outputDir;
     QList< QDict<TemplateVariant> > m_contextStack;
     TemplateBlockContext m_blockContext;
     QDict<TemplateEscapeIntf*> m_escapeIntfDict;
-    TemplateEscapeIntf *m_activeEscapeIntf;
-    TemplateSpacelessIntf *m_spacelessIntf;
-    bool m_spacelessEnabled;
-    bool m_tabbingEnabled;
+    TemplateEscapeIntf *m_activeEscapeIntf = 0;
+    TemplateSpacelessIntf *m_spacelessIntf = 0;
+    bool m_spacelessEnabled = false;
+    bool m_tabbingEnabled = false;
     TemplateAutoRef<TemplateStruct> m_indices;
     QDict< QStack<TemplateVariant> > m_indexStacks;
     QCString m_encoding;
-    void *m_fromUtf8;
+    void *m_fromUtf8 = 0;
 };
 
 //-----------------------------------------------------------------------------
@@ -1445,7 +1445,7 @@ class ExprAstNumber : public ExprAst
     int number() const { return m_number; }
     virtual TemplateVariant resolve(TemplateContext *) { return TemplateVariant(m_number); }
   private:
-    int m_number;
+    int m_number = 0;
 };
 
 /** @brief Class representing a variable in the AST */
@@ -1497,7 +1497,7 @@ class ExprAstFunctionVariable : public ExprAst
       return v;
     }
   private:
-    ExprAst *m_var;
+    ExprAst *m_var = 0;
     QList<ExprAst> m_args;
 };
 
@@ -1526,7 +1526,7 @@ class ExprAstFilter : public ExprAst
     }
   private:
     QCString m_name;
-    ExprAst *m_arg;
+    ExprAst *m_arg = 0;
 };
 
 /** @brief Class representing a filter applied to an expression in the AST */
@@ -1542,7 +1542,7 @@ class ExprAstFilterAppl : public ExprAst
       return m_filter->apply(m_expr->resolve(c),c);
     }
   private:
-    ExprAst *m_expr;
+    ExprAst *m_expr = 0;
     ExprAstFilter *m_filter;
 };
 
@@ -1568,7 +1568,7 @@ class ExprAstNegate : public ExprAst
     virtual TemplateVariant resolve(TemplateContext *c)
     { return TemplateVariant(!m_expr->resolve(c).toBool()); }
   private:
-    ExprAst *m_expr;
+    ExprAst *m_expr = 0;
 };
 
 class ExprAstUnary : public ExprAst
@@ -1589,8 +1589,8 @@ class ExprAstUnary : public ExprAst
       }
     }
   private:
-    Operator::Type m_operator;
-    ExprAst *m_exp;
+    Operator::Type m_operator = Operator::Or;
+    ExprAst *m_exp = 0;
 };
 
 /** @brief Class representing a binary operator in the AST */
@@ -1696,9 +1696,9 @@ class ExprAstBinary : public ExprAst
       }
     }
   private:
-    Operator::Type m_operator;
-    ExprAst *m_lhs;
-    ExprAst *m_rhs;
+    Operator::Type m_operator = Operator::Or;
+    ExprAst *m_lhs = 0;
+    ExprAst *m_rhs = 0;
 };
 
 //----------------------------------------------------------
@@ -1715,7 +1715,7 @@ class TemplateNode
     TemplateNode *parent() { return m_parent; }
 
   private:
-    TemplateNode *m_parent;
+    TemplateNode *m_parent = 0;
 };
 
 //----------------------------------------------------------
@@ -1736,7 +1736,7 @@ class TemplateParser
     QCString templateName() const { return m_templateName; }
     void warn(const char *fileName,int line,const char *fmt,...) const;
   private:
-    const TemplateEngine *m_engine;
+    const TemplateEngine *m_engine = 0;
     QCString m_templateName;
     QList<TemplateToken> &m_tokens;
 };
@@ -2282,9 +2282,9 @@ class ExpressionParser
       return TRUE;
     }
 
-    const TemplateParser *m_parser;
+    const TemplateParser *m_parser = 0;
     ExprToken m_curToken;
-    int m_line;
+    int m_line = 0;
     const char *m_tokenStream;
 };
 
@@ -2296,9 +2296,9 @@ class TemplateToken
   public:
     enum Type { Text, Variable, Block };
     TemplateToken(Type t,const char *d,int l) : type(t), data(d), line(l) {}
-    Type type;
+    Type type = Text;
     QCString data;
-    int line;
+    int line = 0;
 };
 
 //----------------------------------------------------------
@@ -2339,7 +2339,7 @@ class TemplateImpl : public TemplateNode, public Template
     TemplateBlockContext *blockContext() { return &m_blockContext; }
 
   private:
-    TemplateEngine *m_engine;
+    TemplateEngine *m_engine = 0;
     QCString m_name;
     TemplateNodeList m_nodes;
     TemplateBlockContext m_blockContext;
@@ -2358,8 +2358,8 @@ class TemplateStructWeakRef : public TemplateStructIntf
     virtual int addRef() { return ++m_refCount; }
     virtual int release() { int count=--m_refCount; if (count<=0) { delete this; } return count; }
   private:
-    TemplateStructIntf *m_ref;
-    int m_refCount;
+    TemplateStructIntf *m_ref = 0;
+    int m_refCount = 0;
 };
 
 //----------------------------------------------------------
@@ -2789,8 +2789,8 @@ class TemplateNodeVariable : public TemplateNode
 
   private:
     QCString m_templateName;
-    int m_line;
-    ExprAst *m_var;
+    int m_line = 0;
+    ExprAst *m_var = 0;
     QList<ExprAst> m_args;
 };
 
@@ -2853,7 +2853,7 @@ template<class T> class TemplateNodeCreator : public TemplateNode
       }
     }
     QCString m_templateName;
-    int m_line;
+    int m_line = 0;
 };
 
 //----------------------------------------------------------
@@ -2950,8 +2950,8 @@ class TemplateNodeIf : public TemplateNodeCreator<TemplateNodeIf>
     {
       GuardedNodes() : guardAst(0) {}
      ~GuardedNodes() { delete guardAst; }
-      int line;
-      ExprAst *guardAst;
+      int line = 0;
+      ExprAst *guardAst = 0;
       TemplateNodeList trueNodes;
     };
     QList<GuardedNodes> m_ifGuardedNodes;
@@ -3009,7 +3009,7 @@ class TemplateNodeRepeat : public TemplateNodeCreator<TemplateNodeRepeat>
     }
   private:
     TemplateNodeList m_repeatNodes;
-    ExprAst *m_expr;
+    ExprAst *m_expr = 0;
 };
 
 //----------------------------------------------------------
@@ -3175,9 +3175,9 @@ class TemplateNodeRange : public TemplateNodeCreator<TemplateNodeRange>
     }
 
   private:
-    bool m_down;
-    ExprAst *m_startExpr;
-    ExprAst *m_endExpr;
+    bool m_down = false;
+    ExprAst *m_startExpr = 0;
+    ExprAst *m_endExpr = 0;
     QCString m_var;
     TemplateNodeList m_loopNodes;
 };
@@ -3332,8 +3332,8 @@ class TemplateNodeFor : public TemplateNodeCreator<TemplateNodeFor>
     }
 
   private:
-    bool m_reversed;
-    ExprAst *m_expr;
+    bool m_reversed = false;
+    ExprAst *m_expr = 0;
     QValueList<QCString> m_vars;
     TemplateNodeList m_loopNodes;
     TemplateNodeList m_emptyNodes;
@@ -3534,7 +3534,7 @@ class TemplateNodeExtend : public TemplateNodeCreator<TemplateNodeExtend>
     }
 
   private:
-    ExprAst *m_extendExpr;
+    ExprAst *m_extendExpr = 0;
     TemplateNodeList m_nodes;
 };
 
@@ -3591,7 +3591,7 @@ class TemplateNodeInclude : public TemplateNodeCreator<TemplateNodeInclude>
     }
 
   private:
-    ExprAst *m_includeExpr;
+    ExprAst *m_includeExpr = 0;
 };
 
 //----------------------------------------------------------
@@ -3724,8 +3724,8 @@ class TemplateNodeCreate : public TemplateNodeCreator<TemplateNodeCreate>
     }
 
   private:
-    ExprAst *m_templateExpr;
-    ExprAst *m_fileExpr;
+    ExprAst *m_templateExpr = 0;
+    ExprAst *m_fileExpr = 0;
 };
 
 //----------------------------------------------------------
@@ -3839,7 +3839,7 @@ class TemplateNodeTree : public TemplateNodeCreator<TemplateNodeTree>
     }
 
   private:
-    ExprAst         *m_treeExpr;
+    ExprAst         *m_treeExpr = 0;
     TemplateNodeList m_treeNodes;
 };
 
@@ -3853,7 +3853,7 @@ class TemplateNodeIndexEntry : public TemplateNodeCreator<TemplateNodeIndexEntry
       Mapping(const QCString &n,ExprAst *e) : name(n), value(e) {}
      ~Mapping() { delete value; }
       QCString name;
-      ExprAst *value;
+      ExprAst *value = 0;
     };
   public:
     TemplateNodeIndexEntry(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data)
@@ -4128,7 +4128,7 @@ class TemplateNodeCycle : public TemplateNodeCreator<TemplateNodeCycle>
       }
     }
   private:
-    uint m_index;
+    uint m_index = 0;
     QList<ExprAst> m_args;
 };
 
@@ -4142,7 +4142,7 @@ class TemplateNodeSet : public TemplateNodeCreator<TemplateNodeSet>
       Mapping(const QCString &n,ExprAst *e) : name(n), value(e) {}
      ~Mapping() { delete value; }
       QCString name;
-      ExprAst *value;
+      ExprAst *value = 0;
     };
   public:
     TemplateNodeSet(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data)
@@ -4175,7 +4175,7 @@ class TemplateNodeSet : public TemplateNodeCreator<TemplateNodeSet>
       }
     }
   private:
-    Mapping *m_mapping;
+    Mapping *m_mapping = 0;
 };
 
 //----------------------------------------------------------
@@ -4323,8 +4323,8 @@ class TemplateNodeMarkers : public TemplateNodeCreator<TemplateNodeMarkers>
   private:
     TemplateNodeList m_nodes;
     QCString m_var;
-    ExprAst *m_listExpr;
-    ExprAst *m_patternExpr;
+    ExprAst *m_listExpr = 0;
+    ExprAst *m_patternExpr = 0;
 };
 
 //----------------------------------------------------------
@@ -4427,8 +4427,8 @@ class TemplateNodeResource : public TemplateNodeCreator<TemplateNodeResource>
       }
     }
   private:
-    ExprAst *m_resExpr;
-    ExprAst *m_asExpr;
+    ExprAst *m_resExpr = 0;
+    ExprAst *m_asExpr = 0;
 };
 
 //----------------------------------------------------------
@@ -4645,11 +4645,11 @@ class TemplateLexer
                   const char *data,int line,int startPos,int endPos,
                   TemplateToken::Type type);
     void reset();
-    const TemplateEngine *m_engine;
+    const TemplateEngine *m_engine = 0;
     QCString m_fileName;
     QCString m_data;
-    char m_openChar;
-    char m_closeChar;
+    char m_openChar = 0;
+    char m_closeChar = 0;
 };
 
 TemplateLexer::TemplateLexer(const TemplateEngine *engine,const QCString &fileName,const QCString &data) :
@@ -4693,7 +4693,7 @@ void TemplateLexer::tokenize(QList<TemplateToken> &tokens)
         {
           state=StateBeginTemplate;
         }
-        else if (c!=' ' && c!='\t' && c!='\n') // non-whitepace text
+        else if (c!=' ' && c!='\t' && c!='\n') // non-whitespace text
         {
           emptyOutputLine=FALSE;
         }
@@ -5070,10 +5070,10 @@ class TemplateEngine::Private
         int line() const { return m_line; }
 
       private:
-        Type m_type;
+        Type m_type = Template;
         QCString m_fileName;
         QCString m_blockName;
-        int m_line;
+        int m_line = 0;
     };
   public:
     Private(TemplateEngine *engine) : m_templateCache(17) /*, m_indent(0)*/, m_engine(engine)
@@ -5185,7 +5185,7 @@ class TemplateEngine::Private
   private:
     QDict<Template> m_templateCache;
     //mutable int m_indent;
-    TemplateEngine *m_engine;
+    TemplateEngine *m_engine = 0;
     QList<IncludeEntry> m_includeStack;
     QCString m_extension;
     QCString m_templateDirName;
index a30a85c..8cc1f87 100644 (file)
@@ -115,10 +115,9 @@ void TooltipManager::writeTooltips(CodeOutputInterface &ol)
     if (d->definitionType()==Definition::TypeMember)
     {
       MemberDef *md = dynamic_cast<MemberDef*>(d);
-      decl = md->declaration();
-      if (!decl.isEmpty() && decl.at(0)=='@') // hide enum values
+      if (!md->isAnonymous())
       {
-        decl.resize(0);
+        decl = md->declaration();
       }
     }
     ol.writeTooltip(di.currentKey(),                 // id
index ac55911..188b775 100644 (file)
@@ -51,12 +51,12 @@ class Translator
      */
     virtual QCString latexFontenc() { return "T1"; }
     /*!
-     * Sets the commands to be insered directly after the `\\begin{document}`
+     * Sets the commands to be inserted directly after the `\\begin{document}`
      * in the LaTeX document.
      */
     virtual QCString latexDocumentPre() { return ""; }
     /*!
-     * Sets the commands to be insered directly before the `\\end{document}`
+     * Sets the commands to be inserted directly before the `\\end{document}`
      * in the LaTeX document.
      */
     virtual QCString latexDocumentPost() { return ""; }
index 4d305b6..189a93d 100644 (file)
@@ -92,7 +92,6 @@ struct Grouping
   }
 
   Grouping( const char *gn, GroupPri_t p ) : groupname(gn), pri(p) {}
-  Grouping( const Grouping &g ) : groupname(g.groupname), pri(g.pri) {}
   QCString groupname;   //!< name of the group
   GroupPri_t pri;       //!< priority of this definition
 
index f5e43a4..abcd910 100644 (file)
@@ -540,7 +540,7 @@ const ClassDef *newResolveTypedef(const FileDef *fileScope,
                                   const MemberDef **pMemType,
                                   QCString *pTemplSpec,
                                   QCString *pResolvedType,
-                                  ArgumentList *actTemplParams)
+                                  const ArgumentList *actTemplParams)
 {
   //printf("newResolveTypedef(md=%p,cachedVal=%p)\n",md,md->getCachedTypedefVal());
   bool isCached = md->isTypedefValCached(); // value already cached
@@ -563,11 +563,11 @@ const ClassDef *newResolveTypedef(const FileDef *fileScope,
   
   const ClassDef *typeClass = md->getClassDef();
   QCString type = md->typeString(); // get the "value" of the typedef
-  if (typeClass && typeClass->isTemplate() && 
-      actTemplParams && actTemplParams->count()>0)
+  if (typeClass && typeClass->isTemplate() &&
+      actTemplParams && !actTemplParams->empty())
   {
     type = substituteTemplateArgumentsInString(type,
-            typeClass->templateArguments(),actTemplParams);
+            typeClass->templateArguments(),*actTemplParams);
   }
   QCString typedefValue = type;
   int tl=type.length();
@@ -955,7 +955,7 @@ class AccessStack
  */
 int isAccessibleFrom(const Definition *scope,const FileDef *fileScope,const Definition *item)
 {
-  //printf("<isAccesibleFrom(scope=%s,item=%s itemScope=%s)\n",
+  //printf("<isAccessibleFrom(scope=%s,item=%s itemScope=%s)\n",
   //    scope->name().data(),item->name().data(),item->getOuterScope()->name().data());
 
   static AccessStack accessStack;
@@ -1397,7 +1397,7 @@ static const ClassDef *getResolvedClassRec(const Definition *scope,
   ArgumentList actTemplParams;
   if (!strippedTemplateParams.isEmpty()) // template part that was stripped
   {
-    stringToArgumentList(strippedTemplateParams,&actTemplParams);
+    stringToArgumentList(scope->getLanguage(),strippedTemplateParams,actTemplParams);
   }
 
   int qualifierIndex = computeQualifiedIndex(name);
@@ -2260,17 +2260,15 @@ void writeExample(OutputList &ol,ExampleSDict *ed)
 }
 
 
-QCString argListToString(const ArgumentList *al,bool useCanonicalType,bool showDefVals)
+QCString argListToString(const ArgumentList &al,bool useCanonicalType,bool showDefVals)
 {
   QCString result;
-  if (al==0) return result;
-  ArgumentListIterator ali(*al);
-  const Argument *a=ali.current();
+  if (!al.hasParameters()) return result;
   result+="(";
-  while (a)
+  for (auto it = al.begin() ; it!=al.end() ;)
   {
-    QCString type1 = useCanonicalType && !a->canType.isEmpty() ?
-      a->canType : a->type;
+    Argument a = *it;
+    QCString type1 = useCanonicalType && !a.canType.isEmpty() ? a.canType : a.type;
     QCString type2;
     int i=type1.find(")("); // hack to deal with function pointers
     if (i!=-1)
@@ -2278,86 +2276,84 @@ QCString argListToString(const ArgumentList *al,bool useCanonicalType,bool showD
       type2=type1.mid(i);
       type1=type1.left(i);
     }
-    if (!a->attrib.isEmpty())
+    if (!a.attrib.isEmpty())
     {
-      result+=a->attrib+" ";
+      result+=a.attrib+" ";
     }
-    if (!a->name.isEmpty() || !a->array.isEmpty())
+    if (!a.name.isEmpty() || !a.array.isEmpty())
     {
-      result+= type1+" "+a->name+type2+a->array;
+      result+= type1+" "+a.name+type2+a.array;
     }
     else
     {
       result+= type1+type2;
     }
-    if (!a->defval.isEmpty() && showDefVals)
+    if (!a.defval.isEmpty() && showDefVals)
     {
-      result+="="+a->defval;
+      result+="="+a.defval;
     }
-    ++ali;
-    a = ali.current();
-    if (a) result+=", ";
+    ++it;
+    if (it!=al.end()) result+=", ";
   }
   result+=")";
-  if (al->constSpecifier) result+=" const";
-  if (al->volatileSpecifier) result+=" volatile";
-  if (al->refQualifier==RefQualifierLValue) result+=" &";
-  else if (al->refQualifier==RefQualifierRValue) result+=" &&";
-  if (!al->trailingReturnType.isEmpty()) result+=" -> "+al->trailingReturnType;
-  if (al->pureSpecifier) result+=" =0";
+  if (al.constSpecifier) result+=" const";
+  if (al.volatileSpecifier) result+=" volatile";
+  if (al.refQualifier==RefQualifierLValue) result+=" &";
+  else if (al.refQualifier==RefQualifierRValue) result+=" &&";
+  if (!al.trailingReturnType.isEmpty()) result+=" -> "+al.trailingReturnType;
+  if (al.pureSpecifier) result+=" =0";
   return removeRedundantWhiteSpace(result);
 }
 
-QCString tempArgListToString(const ArgumentList *al,SrcLangExt lang)
+QCString tempArgListToString(const ArgumentList &al,SrcLangExt lang)
 {
   QCString result;
-  if (al==0) return result;
+  if (al.empty()) return result;
   result="<";
-  ArgumentListIterator ali(*al);
-  const Argument *a=ali.current();
-  while (a)
+  auto it = al.begin();
+  while (it!=al.end())
   {
-    if (!a->name.isEmpty()) // add template argument name
+    Argument a = *it;
+    if (!a.name.isEmpty()) // add template argument name
     {
-      if (a->type.left(4)=="out") // C# covariance
+      if (a.type.left(4)=="out") // C# covariance
       {
         result+="out ";
       }
-      else if (a->type.left(3)=="in") // C# contravariance
+      else if (a.type.left(3)=="in") // C# contravariance
       {
         result+="in ";
       }
       if (lang==SrcLangExt_Java || lang==SrcLangExt_CSharp)
       {
-        result+=a->type+" ";
+        result+=a.type+" ";
       }
-      result+=a->name;
+      result+=a.name;
     }
     else // extract name from type
     {
-      int i=a->type.length()-1;
-      while (i>=0 && isId(a->type.at(i))) i--;
+      int i=a.type.length()-1;
+      while (i>=0 && isId(a.type.at(i))) i--;
       if (i>0)
       {
-        result+=a->type.right(a->type.length()-i-1);
-        if (a->type.find("...")!=-1)
+        result+=a.type.right(a.type.length()-i-1);
+        if (a.type.find("...")!=-1)
         {
           result+="...";
         }
       }
       else // nothing found -> take whole name
       {
-        result+=a->type;
+        result+=a.type;
       }
     }
-    if (!a->typeConstraint.isEmpty() && lang==SrcLangExt_Java)
+    if (!a.typeConstraint.isEmpty() && lang==SrcLangExt_Java)
     {
       result+=" extends "; // TODO: now Java specific, C# has where...
-      result+=a->typeConstraint;
+      result+=a.typeConstraint;
     }
-    ++ali;
-    a=ali.current();
-    if (a) result+=", ";
+    ++it;
+    if (it!=al.end()) result+=", ";
   }
   result+=">";
   return removeRedundantWhiteSpace(result);
@@ -2432,7 +2428,7 @@ static QCString getFilterFromList(const char *name,const QStrList &filterList,bo
     if (i_equals!=-1)
     {
       QCString filterPattern = fs.left(i_equals);
-      QRegExp fpat(filterPattern,portable_fileSystemIsCaseSensitive(),TRUE); 
+      QRegExp fpat(filterPattern,Portable::fileSystemIsCaseSensitive(),TRUE); 
       if (fpat.match(name)!=-1) 
       {
         // found a match!
@@ -2590,10 +2586,10 @@ QCString fileToString(const char *name,bool filter,bool isSourceCode)
   return "";
 }
 
-QCString dateToString(bool includeTime)
+static QDateTime getCurrentDateTime()
 {
   QDateTime current = QDateTime::currentDateTime();
-  QCString sourceDateEpoch = portable_getenv("SOURCE_DATE_EPOCH");
+  QCString sourceDateEpoch = Portable::getenv("SOURCE_DATE_EPOCH");
   if (!sourceDateEpoch.isEmpty())
   {
     bool ok;
@@ -2622,6 +2618,12 @@ QCString dateToString(bool includeTime)
       current.setTimeUtc_t((ulong)epoch); // TODO: add support for 64bit epoch value
     }
   }
+  return current;
+}
+
+QCString dateToString(bool includeTime)
+{
+  const QDateTime current = getCurrentDateTime();
   return theTranslator->trDateTime(current.date().year(),
                                    current.date().month(),
                                    current.date().day(),
@@ -2634,9 +2636,9 @@ QCString dateToString(bool includeTime)
 
 QCString yearToString()
 {
-  const QDate &d=QDate::currentDate();
+  const QDateTime current = getCurrentDateTime();
   QCString result;
-  result.sprintf("%d", d.year());
+  result.sprintf("%d", current.date().year());
   return result;
 }
 
@@ -2705,19 +2707,6 @@ exit:
   return prot;
 }
 
-//static void printArgList(ArgumentList *al)
-//{
-//  if (al==0) return;
-//  ArgumentListIterator ali(*al);
-//  Argument *a;
-//  printf("(");
-//  for (;(a=ali.current());++ali)
-//  {
-//    printf("t='%s' n='%s' v='%s' ",a->type.data(),!a->name.isEmpty()>0?a->name.data():"",!a->defval.isEmpty()>0?a->defval.data():""); 
-//  }
-//  printf(")");
-//}
-
 #ifndef NEWMATCH
 // strip any template specifiers that follow className in string s
 static QCString trimTemplateSpecifiers(
@@ -3311,138 +3300,6 @@ static bool matchArgument(const Argument *srcA,const Argument *dstA,
   return TRUE;
 }
 
-
-/*!
- * Matches the arguments list srcAl with the argument list dstAl
- * Returns TRUE if the argument lists are equal. Two argument list are 
- * considered equal if the number of arguments is equal and the types of all 
- * arguments are equal. Furthermore the const and volatile specifiers 
- * stored in the list should be equal.
- */
-bool matchArguments(ArgumentList *srcAl,ArgumentList *dstAl,
-    const char *cl,const char *ns,bool checkCV,
-    NamespaceSDict *usingNamespaces,
-    SDict<Definition> *usingClasses)
-{
-  QCString className=cl;
-  QCString namespaceName=ns;
-
-  // strip template specialization from class name if present
-  //int til=className.find('<'),tir=className.find('>');
-  //if (til!=-1 && tir!=-1 && tir>til) 
-  //{
-  //  className=className.left(til)+className.right(className.length()-tir-1);
-  //}
-
-  //printf("matchArguments(%s,%s) className=%s namespaceName=%s checkCV=%d usingNamespaces=%d usingClasses=%d\n",
-  //    srcAl ? argListToString(srcAl).data() : "",
-  //    dstAl ? argListToString(dstAl).data() : "",
-  //    cl,ns,checkCV,
-  //    usingNamespaces?usingNamespaces->count():0,
-  //    usingClasses?usingClasses->count():0
-  //    );
-
-  if (srcAl==0 || dstAl==0)
-  {
-    bool match = srcAl==dstAl; // at least one of the members is not a function
-    if (match)
-    {
-      MATCH
-      return TRUE;
-    }
-    else
-    {
-      NOMATCH
-      return FALSE;
-    }
-  }
-
-  // handle special case with void argument
-  if ( srcAl->count()==0 && dstAl->count()==1 && 
-      dstAl->getFirst()->type=="void" )
-  { // special case for finding match between func() and func(void)
-    Argument *a=new Argument;
-    a->type = "void";
-    srcAl->append(a);
-    MATCH
-    return TRUE;
-  }
-  if ( dstAl->count()==0 && srcAl->count()==1 &&
-      srcAl->getFirst()->type=="void" )
-  { // special case for finding match between func(void) and func()
-    Argument *a=new Argument;
-    a->type = "void";
-    dstAl->append(a);
-    MATCH
-    return TRUE;
-  }
-
-  if (srcAl->count() != dstAl->count())
-  {
-    NOMATCH
-    return FALSE; // different number of arguments -> no match
-  }
-
-  if (checkCV)
-  {
-    if (srcAl->constSpecifier != dstAl->constSpecifier) 
-    {
-      NOMATCH
-      return FALSE; // one member is const, the other not -> no match
-    }
-    if (srcAl->volatileSpecifier != dstAl->volatileSpecifier)
-    {
-      NOMATCH
-      return FALSE; // one member is volatile, the other not -> no match
-    }
-  }
-
-  if (srcAl->refQualifier != dstAl->refQualifier)
-  {
-    NOMATCH
-    return FALSE; // one member is has a different ref-qualifier than the other
-  }
-
-  // so far the argument list could match, so we need to compare the types of
-  // all arguments.
-  ArgumentListIterator srcAli(*srcAl),dstAli(*dstAl);
-  Argument *srcA,*dstA;
-  for (;(srcA=srcAli.current()) && (dstA=dstAli.current());++srcAli,++dstAli)
-  { 
-    if (!matchArgument(srcA,dstA,className,namespaceName,
-          usingNamespaces,usingClasses))
-    {
-      NOMATCH
-      return FALSE;
-    }
-  }
-  MATCH
-  return TRUE; // all arguments match 
-}
-
-#endif
-
-#if 0
-static QCString resolveSymbolName(FileDef *fs,Definition *symbol,QCString &templSpec)
-{
-  ASSERT(symbol!=0);
-  if (symbol->definitionType()==Definition::TypeMember && 
-      ((MemberDef*)symbol)->isTypedef()) // if symbol is a typedef then try
-    // to resolve it
-  {
-    MemberDef *md = 0;
-    ClassDef *cd = newResolveTypedef(fs,(MemberDef*)symbol,&md,&templSpec);
-    if (cd)
-    {
-      return cd->qualifiedName()+templSpec;
-    }
-    else if (md)
-    {
-      return md->qualifiedName();
-    }
-  }
-  return symbol->qualifiedName();
-}
 #endif
 
 static QCString stripDeclKeywords(const QCString &s)
@@ -3519,7 +3376,7 @@ static QCString getCanonicalTypeForIdentifier(
   if (cd && cd->isUsedOnly()) cd=0; // ignore types introduced by usage relations
 
   //printf("cd=%p mtype=%p\n",cd,mType);
-  //printf("  getCanonicalTypeForIdentifer: symbol=%s word=%s cd=%s d=%s fs=%s cd->isTemplate=%d\n",
+  //printf("  getCanonicalTypeForIdentifier: symbol=%s word=%s cd=%s d=%s fs=%s cd->isTemplate=%d\n",
   //    symName.data(),
   //    word.data(),
   //    cd?cd->name().data():"<none>",
@@ -3688,10 +3545,10 @@ static QCString extractCanonicalType(const Definition *d,const FileDef *fs,QCStr
   return removeRedundantWhiteSpace(canType);
 }
 
-static QCString extractCanonicalArgType(const Definition *d,const FileDef *fs,const Argument *arg)
+static QCString extractCanonicalArgType(const Definition *d,const FileDef *fs,const Argument &arg)
 {
-  QCString type = arg->type.stripWhiteSpace();
-  QCString name = arg->name;
+  QCString type = arg.type.stripWhiteSpace();
+  QCString name = arg.name;
   //printf("----- extractCanonicalArgType(type=%s,name=%s)\n",type.data(),name.data());
   if ((type=="const" || type=="volatile") && !name.isEmpty()) 
   { // name is part of type => correct
@@ -3703,17 +3560,17 @@ static QCString extractCanonicalArgType(const Definition *d,const FileDef *fs,co
     if (!type.isEmpty()) type+=" ";
     type+=name;
   }
-  if (!arg->array.isEmpty())
+  if (!arg.array.isEmpty())
   {
-    type+=arg->array;
+    type+=arg.array;
   }
 
   return extractCanonicalType(d,fs,type);
 }
 
 static bool matchArgument2(
-    const Definition *srcScope,const FileDef *srcFileScope,Argument *srcA,
-    const Definition *dstScope,const FileDef *dstFileScope,Argument *dstA
+    const Definition *srcScope,const FileDef *srcFileScope,Argument &srcA,
+    const Definition *dstScope,const FileDef *dstFileScope,Argument &dstA
     )
 {
   //printf(">> match argument: %s::'%s|%s' (%s) <-> %s::'%s|%s' (%s)\n",
@@ -3727,37 +3584,37 @@ static bool matchArgument2(
   //  NOMATCH
   //  return FALSE;
   //}
-  QCString sSrcName = " "+srcA->name;
-  QCString sDstName = " "+dstA->name;
-  QCString srcType  = srcA->type;
-  QCString dstType  = dstA->type;
+  QCString sSrcName = " "+srcA.name;
+  QCString sDstName = " "+dstA.name;
+  QCString srcType  = srcA.type;
+  QCString dstType  = dstA.type;
   stripIrrelevantConstVolatile(srcType);
   stripIrrelevantConstVolatile(dstType);
   //printf("'%s'<->'%s'\n",sSrcName.data(),dstType.right(sSrcName.length()).data());
   //printf("'%s'<->'%s'\n",sDstName.data(),srcType.right(sDstName.length()).data());
   if (sSrcName==dstType.right(sSrcName.length()))
   { // case "unsigned int" <-> "unsigned int i"
-    srcA->type+=sSrcName;
-    srcA->name="";
-    srcA->canType=""; // invalidate cached type value
+    srcA.type+=sSrcName;
+    srcA.name="";
+    srcA.canType=""; // invalidate cached type value
   }
   else if (sDstName==srcType.right(sDstName.length()))
   { // case "unsigned int i" <-> "unsigned int"
-    dstA->type+=sDstName;
-    dstA->name="";
-    dstA->canType=""; // invalidate cached type value
+    dstA.type+=sDstName;
+    dstA.name="";
+    dstA.canType=""; // invalidate cached type value
   }
 
-  if (srcA->canType.isEmpty())
+  if (srcA.canType.isEmpty())
   {
-    srcA->canType = extractCanonicalArgType(srcScope,srcFileScope,srcA);
+    srcA.canType = extractCanonicalArgType(srcScope,srcFileScope,srcA);
   }
-  if (dstA->canType.isEmpty())
+  if (dstA.canType.isEmpty())
   {
-    dstA->canType = extractCanonicalArgType(dstScope,dstFileScope,dstA);
+    dstA.canType = extractCanonicalArgType(dstScope,dstFileScope,dstA);
   }
 
-  if (srcA->canType==dstA->canType)
+  if (srcA.canType==dstA.canType)
   {
     MATCH
     return TRUE;
@@ -3773,49 +3630,34 @@ static bool matchArgument2(
 
 
 // new algorithm for argument matching
-bool matchArguments2(const Definition *srcScope,const FileDef *srcFileScope,const ArgumentList *srcAl,
-                     const Definition *dstScope,const FileDef *dstFileScope,const ArgumentList *dstAl,
+bool matchArguments2(const Definition *srcScope,const FileDef *srcFileScope,const ArgumentList &inSrcAl,
+                     const Definition *dstScope,const FileDef *dstFileScope,const ArgumentList &inDstAl,
                      bool checkCV)
 {
-  //printf("*** matchArguments2\n");
   ASSERT(srcScope!=0 && dstScope!=0);
 
-  if (srcAl==0 || dstAl==0)
-  {
-    bool match = srcAl==dstAl; // at least one of the members is not a function
-    if (match)
-    {
-      MATCH
-      return TRUE;
-    }
-    else
-    {
-      NOMATCH
-      return FALSE;
-    }
-  }
+  ArgumentList srcAl = inSrcAl;
+  ArgumentList dstAl = inDstAl;
 
   // handle special case with void argument
-  if ( srcAl->count()==0 && dstAl->count()==1 && 
-      dstAl->getFirst()->type=="void" )
+  if ( srcAl.empty() && dstAl.size()==1 && dstAl.front().type=="void" )
   { // special case for finding match between func() and func(void)
-    Argument *a=new Argument;
-    a->type = "void";
-    const_cast<ArgumentList*>(srcAl)->append(a);
+    Argument a;
+    a.type = "void";
+    srcAl.push_back(a);
     MATCH
     return TRUE;
   }
-  if ( dstAl->count()==0 && srcAl->count()==1 &&
-      srcAl->getFirst()->type=="void" )
+  if ( dstAl.empty() && srcAl.size()==1 && srcAl.front().type=="void" )
   { // special case for finding match between func(void) and func()
-    Argument *a=new Argument;
-    a->type = "void";
-    const_cast<ArgumentList*>(dstAl)->append(a);
+    Argument a;
+    a.type = "void";
+    dstAl.push_back(a);
     MATCH
     return TRUE;
   }
 
-  if (srcAl->count() != dstAl->count())
+  if (srcAl.size() != dstAl.size())
   {
     NOMATCH
     return FALSE; // different number of arguments -> no match
@@ -3823,19 +3665,19 @@ bool matchArguments2(const Definition *srcScope,const FileDef *srcFileScope,cons
 
   if (checkCV)
   {
-    if (srcAl->constSpecifier != dstAl->constSpecifier) 
+    if (srcAl.constSpecifier != dstAl.constSpecifier) 
     {
       NOMATCH
       return FALSE; // one member is const, the other not -> no match
     }
-    if (srcAl->volatileSpecifier != dstAl->volatileSpecifier)
+    if (srcAl.volatileSpecifier != dstAl.volatileSpecifier)
     {
       NOMATCH
       return FALSE; // one member is volatile, the other not -> no match
     }
   }
 
-  if (srcAl->refQualifier != dstAl->refQualifier)
+  if (srcAl.refQualifier != dstAl.refQualifier)
   {
     NOMATCH
     return FALSE; // one member is has a different ref-qualifier than the other
@@ -3843,10 +3685,12 @@ bool matchArguments2(const Definition *srcScope,const FileDef *srcFileScope,cons
 
   // so far the argument list could match, so we need to compare the types of
   // all arguments.
-  ArgumentListIterator srcAli(*srcAl),dstAli(*dstAl);
-  Argument *srcA,*dstA;
-  for (;(srcA=srcAli.current()) && (dstA=dstAli.current());++srcAli,++dstAli)
-  { 
+  auto srcIt = srcAl.begin();
+  auto dstIt = dstAl.begin();
+  for (;srcIt!=srcAl.end() && dstIt!=dstAl.end();++srcIt,++dstIt)
+  {
+    Argument &srcA = *srcIt;
+    Argument &dstA = *dstIt;
     if (!matchArgument2(srcScope,srcFileScope,srcA,
           dstScope,dstFileScope,dstA)
        )
@@ -3863,134 +3707,139 @@ bool matchArguments2(const Definition *srcScope,const FileDef *srcFileScope,cons
 
 // merges the initializer of two argument lists
 // pre:  the types of the arguments in the list should match.
-void mergeArguments(ArgumentList *srcAl,ArgumentList *dstAl,bool forceNameOverwrite)
+void mergeArguments(ArgumentList &srcAl,ArgumentList &dstAl,bool forceNameOverwrite)
 {
   //printf("mergeArguments '%s', '%s'\n",
   //    argListToString(srcAl).data(),argListToString(dstAl).data());
 
-  if (srcAl==0 || dstAl==0 || srcAl->count()!=dstAl->count())
+  if (srcAl.size()!=dstAl.size())
   {
     return; // invalid argument lists -> do not merge
   }
 
-  ArgumentListIterator srcAli(*srcAl),dstAli(*dstAl);
-  Argument *srcA,*dstA;
-  for (;(srcA=srcAli.current()) && (dstA=dstAli.current());++srcAli,++dstAli)
+  auto srcIt=srcAl.begin();
+  auto dstIt=dstAl.begin();
+  while (srcIt!=srcAl.end() && dstIt!=dstAl.end())
   {
-    if (srcA->defval.isEmpty() && !dstA->defval.isEmpty())
+    Argument &srcA = *srcIt;
+    Argument &dstA = *dstIt;
+
+    if (srcA.defval.isEmpty() && !dstA.defval.isEmpty())
     {
-      //printf("Defval changing '%s'->'%s'\n",srcA->defval.data(),dstA->defval.data());
-      srcA->defval=dstA->defval.copy();
+      //printf("Defval changing '%s'->'%s'\n",srcA.defval.data(),dstA.defval.data());
+      srcA.defval=dstA.defval;
     }
-    else if (!srcA->defval.isEmpty() && dstA->defval.isEmpty())
+    else if (!srcA.defval.isEmpty() && dstA.defval.isEmpty())
     {
-      //printf("Defval changing '%s'->'%s'\n",dstA->defval.data(),srcA->defval.data());
-      dstA->defval=srcA->defval.copy();
+      //printf("Defval changing '%s'->'%s'\n",dstA.defval.data(),srcA.defval.data());
+      dstA.defval=srcA.defval;
     }
 
     // fix wrongly detected const or volatile specifiers before merging.
     // example: "const A *const" is detected as type="const A *" name="const"
-    if (srcA->name=="const" || srcA->name=="volatile")
+    if (srcA.name=="const" || srcA.name=="volatile")
     {
-      srcA->type+=" "+srcA->name;
-      srcA->name.resize(0);
+      srcA.type+=" "+srcA.name;
+      srcA.name.resize(0);
     }
-    if (dstA->name=="const" || dstA->name=="volatile")
+    if (dstA.name=="const" || dstA.name=="volatile")
     {
-      dstA->type+=" "+dstA->name;
-      dstA->name.resize(0);
+      dstA.type+=" "+dstA.name;
+      dstA.name.resize(0);
     }
 
-    if (srcA->type==dstA->type)
+    if (srcA.type==dstA.type)
     {
-      //printf("1. merging %s:%s <-> %s:%s\n",srcA->type.data(),srcA->name.data(),dstA->type.data(),dstA->name.data());
-      if (srcA->name.isEmpty() && !dstA->name.isEmpty())
+      //printf("1. merging %s:%s <-> %s:%s\n",srcA.type.data(),srcA.name.data(),dstA.type.data(),dstA.name.data());
+      if (srcA.name.isEmpty() && !dstA.name.isEmpty())
       {
-        //printf("type: '%s':='%s'\n",srcA->type.data(),dstA->type.data());
-        //printf("name: '%s':='%s'\n",srcA->name.data(),dstA->name.data());
-        srcA->type = dstA->type.copy();
-        srcA->name = dstA->name.copy();
+        //printf("type: '%s':='%s'\n",srcA.type.data(),dstA.type.data());
+        //printf("name: '%s':='%s'\n",srcA.name.data(),dstA.name.data());
+        srcA.type = dstA.type;
+        srcA.name = dstA.name;
       }
-      else if (!srcA->name.isEmpty() && dstA->name.isEmpty())
+      else if (!srcA.name.isEmpty() && dstA.name.isEmpty())
       {
-        //printf("type: '%s':='%s'\n",dstA->type.data(),srcA->type.data());
-        //printf("name: '%s':='%s'\n",dstA->name.data(),srcA->name.data());
-        dstA->type = srcA->type.copy();
-        dstA->name = dstA->name.copy();
+        //printf("type: '%s':='%s'\n",dstA.type.data(),srcA.type.data());
+        //printf("name: '%s':='%s'\n",dstA.name.data(),srcA.name.data());
+        dstA.type = srcA.type;
+        dstA.name = dstA.name;
       }
-      else if (!srcA->name.isEmpty() && !dstA->name.isEmpty())
+      else if (!srcA.name.isEmpty() && !dstA.name.isEmpty())
       {
-        //printf("srcA->name=%s dstA->name=%s\n",srcA->name.data(),dstA->name.data());
+        //printf("srcA.name=%s dstA.name=%s\n",srcA.name.data(),dstA.name.data());
         if (forceNameOverwrite)
         {
-          srcA->name = dstA->name;
+          srcA.name = dstA.name;
         }
         else
         {
-          if (srcA->docs.isEmpty() && !dstA->docs.isEmpty())
+          if (srcA.docs.isEmpty() && !dstA.docs.isEmpty())
           {
-            srcA->name = dstA->name;
+            srcA.name = dstA.name;
           }
-          else if (!srcA->docs.isEmpty() && dstA->docs.isEmpty())
+          else if (!srcA.docs.isEmpty() && dstA.docs.isEmpty())
           {
-            dstA->name = srcA->name;
+            dstA.name = srcA.name;
           }
         }
       }
     }
     else
     {
-      //printf("2. merging '%s':'%s' <-> '%s':'%s'\n",srcA->type.data(),srcA->name.data(),dstA->type.data(),dstA->name.data());
-      srcA->type=srcA->type.stripWhiteSpace();
-      dstA->type=dstA->type.stripWhiteSpace();
-      if (srcA->type+" "+srcA->name==dstA->type) // "unsigned long:int" <-> "unsigned long int:bla"
+      //printf("2. merging '%s':'%s' <-> '%s':'%s'\n",srcA.type.data(),srcA.name.data(),dstA.type.data(),dstA.name.data());
+      srcA.type=srcA.type.stripWhiteSpace();
+      dstA.type=dstA.type.stripWhiteSpace();
+      if (srcA.type+" "+srcA.name==dstA.type) // "unsigned long:int" <-> "unsigned long int:bla"
       {
-        srcA->type+=" "+srcA->name;
-        srcA->name=dstA->name;
+        srcA.type+=" "+srcA.name;
+        srcA.name=dstA.name;
       }
-      else if (dstA->type+" "+dstA->name==srcA->type) // "unsigned long int bla" <-> "unsigned long int"
+      else if (dstA.type+" "+dstA.name==srcA.type) // "unsigned long int bla" <-> "unsigned long int"
       {
-        dstA->type+=" "+dstA->name;
-        dstA->name=srcA->name;
+        dstA.type+=" "+dstA.name;
+        dstA.name=srcA.name;
       }
-      else if (srcA->name.isEmpty() && !dstA->name.isEmpty())
+      else if (srcA.name.isEmpty() && !dstA.name.isEmpty())
       {
-        srcA->name = dstA->name;
+        srcA.name = dstA.name;
       }
-      else if (dstA->name.isEmpty() && !srcA->name.isEmpty())
+      else if (dstA.name.isEmpty() && !srcA.name.isEmpty())
       {
-        dstA->name = srcA->name;
+        dstA.name = srcA.name;
       }
     }
-    int i1=srcA->type.find("::"),
-        i2=dstA->type.find("::"),
-        j1=srcA->type.length()-i1-2,
-        j2=dstA->type.length()-i2-2;
-    if (i1!=-1 && i2==-1 && srcA->type.right(j1)==dstA->type)
+    int i1=srcA.type.find("::"),
+        i2=dstA.type.find("::"),
+        j1=srcA.type.length()-i1-2,
+        j2=dstA.type.length()-i2-2;
+    if (i1!=-1 && i2==-1 && srcA.type.right(j1)==dstA.type)
     {
-      //printf("type: '%s':='%s'\n",dstA->type.data(),srcA->type.data());
-      //printf("name: '%s':='%s'\n",dstA->name.data(),srcA->name.data());
-      dstA->type = srcA->type.left(i1+2)+dstA->type;
-      dstA->name = dstA->name.copy();
+      //printf("type: '%s':='%s'\n",dstA.type.data(),srcA.type.data());
+      //printf("name: '%s':='%s'\n",dstA.name.data(),srcA.name.data());
+      dstA.type = srcA.type.left(i1+2)+dstA.type;
+      dstA.name = dstA.name;
     }
-    else if (i1==-1 && i2!=-1 && dstA->type.right(j2)==srcA->type)
+    else if (i1==-1 && i2!=-1 && dstA.type.right(j2)==srcA.type)
     {
-      //printf("type: '%s':='%s'\n",srcA->type.data(),dstA->type.data());
-      //printf("name: '%s':='%s'\n",dstA->name.data(),srcA->name.data());
-      srcA->type = dstA->type.left(i2+2)+srcA->type;
-      srcA->name = dstA->name.copy();
+      //printf("type: '%s':='%s'\n",srcA.type.data(),dstA.type.data());
+      //printf("name: '%s':='%s'\n",dstA.name.data(),srcA.name.data());
+      srcA.type = dstA.type.left(i2+2)+srcA.type;
+      srcA.name = dstA.name;
     }
-    if (srcA->docs.isEmpty() && !dstA->docs.isEmpty())
+    if (srcA.docs.isEmpty() && !dstA.docs.isEmpty())
     {
-      srcA->docs = dstA->docs.copy();
+      srcA.docs = dstA.docs;
     }
-    else if (dstA->docs.isEmpty() && !srcA->docs.isEmpty())
+    else if (dstA.docs.isEmpty() && !srcA.docs.isEmpty())
     {
-      dstA->docs = srcA->docs.copy();
+      dstA.docs = srcA.docs;
     }
     //printf("Merge argument '%s|%s' '%s|%s'\n",
-    //  srcA->type.data(),srcA->name.data(),
-    //  dstA->type.data(),dstA->name.data());
+    //  srcA.type.data(),srcA.name.data(),
+    //  dstA.type.data(),dstA.name.data());
+    ++srcIt;
+    ++dstIt;
   }
 }
 
@@ -4023,14 +3872,13 @@ static void findMembersWithSpecificName(MemberName *mn,
       ArgumentList *argList=0;
       if (args && !md->isDefine() && qstrcmp(args,"()")!=0)
       {
-        argList=new ArgumentList;
-        const ArgumentList *mdAl = md->argumentList();
-        stringToArgumentList(args,argList);
+        const ArgumentList &mdAl = md->argumentList();
+        ArgumentList argList;
+        stringToArgumentList(md->getLanguage(),args,argList);
         match=matchArguments2(
             md->getOuterScope(),fd,mdAl,
             Doxygen::globalScope,fd,argList,
-            checkCV); 
-        delete argList; argList=0;
+            checkCV);
       }
       if (match && (forceTagFile==0 || md->getReference()==forceTagFile)) 
       {
@@ -4154,22 +4002,20 @@ bool getDefs(const QCString &scName,
         MemberNameIterator mmli(*mn);
         MemberDef *mmd;
         int mdist=maxInheritanceDepth; 
-        ArgumentList *argList=0;
+        ArgumentList argList;
         if (args)
         {
-          argList=new ArgumentList;
-          stringToArgumentList(args,argList);
+          stringToArgumentList(fcd->getLanguage(),args,argList);
         }
         for (mmli.toFirst();(mmd=mmli.current());++mmli)
         {
           if (!mmd->isStrongEnumValue())
           {
-            ArgumentList *mmdAl = mmd->argumentList();
-            bool match=args==0 || 
+            const ArgumentList &mmdAl = mmd->argumentList();
+            bool match=args==0 ||
               matchArguments2(mmd->getOuterScope(),mmd->getFileDef(),mmdAl,
-                  fcd,fcd->getFileDef(),argList,
-                  checkCV
-                  );  
+                             fcd,                  fcd->getFileDef(),argList,
+                             checkCV);
             //printf("match=%d\n",match);
             if (match)
             {
@@ -4187,10 +4033,6 @@ bool getDefs(const QCString &scName,
             }
           }
         }
-        if (argList)
-        {
-          delete argList; argList=0;
-        }
         if (mdist==maxInheritanceDepth && args && qstrcmp(args,"()")==0)
           // no exact match found, but if args="()" an arbitrary member will do
         {
@@ -4277,33 +4119,43 @@ bool getDefs(const QCString &scName,
     //printf("Global symbol\n");
     MemberNameIterator mmli(*mn);
     MemberDef *mmd, *fuzzy_mmd = 0;
-    ArgumentList *argList = 0;
+    ArgumentList argList;
     bool hasEmptyArgs = args && qstrcmp(args, "()") == 0;
 
     if (args)
-      stringToArgumentList(args, argList = new ArgumentList);
+    {
+      stringToArgumentList(SrcLangExt_Cpp, args, argList);
+    }
 
     for (mmli.toFirst(); (mmd = mmli.current()); ++mmli)
     {
       if (!mmd->isLinkable() || (!mmd->isRelated() && !mmd->isForeign()) ||
            !mmd->getClassDef())
+      {
         continue;
+      }
 
-      if (!args) break;
+      if (!args)
+      {
+        break;
+      }
 
-      ArgumentList *mmdAl = mmd->argumentList();
+      ArgumentList &mmdAl = mmd->argumentList();
       if (matchArguments2(mmd->getOuterScope(),mmd->getFileDef(),mmdAl,
             Doxygen::globalScope,mmd->getFileDef(),argList,
             checkCV
             )
-         ) break;
+         )
+      {
+        break;
+      }
 
       if (!fuzzy_mmd && hasEmptyArgs)
+      {
         fuzzy_mmd = mmd;
+      }
     }
 
-    if (argList) delete argList, argList = 0;
-
     mmd = mmd ? mmd : fuzzy_mmd;
 
     if (mmd && !mmd->isStrongEnumValue())
@@ -4371,16 +4223,15 @@ bool getDefs(const QCString &scName,
           else if (mmd->getOuterScope()==fnd /* && mmd->isLinkable() */ )
           { // namespace is found
             bool match=TRUE;
-            ArgumentList *argList=0;
+            ArgumentList argList;
             if (args && qstrcmp(args,"()")!=0)
             {
-              argList=new ArgumentList;
-              const ArgumentList *mmdAl = mmd->argumentList();
-              stringToArgumentList(args,argList);
+              const ArgumentList &mmdAl = mmd->argumentList();
+              stringToArgumentList(mmd->getLanguage(),args,argList);
               match=matchArguments2(
                   mmd->getOuterScope(),mmd->getFileDef(),mmdAl,
                   fnd,mmd->getFileDef(),argList,
-                  checkCV); 
+                  checkCV);
             }
             if (match)
             {
@@ -4388,10 +4239,6 @@ bool getDefs(const QCString &scName,
               md=mmd;
               found=TRUE;
             }
-            if (args)
-            {
-              delete argList; argList=0;
-            }
           }
         }
         if (!found && args && !qstrcmp(args,"()")) 
@@ -4436,7 +4283,7 @@ bool getDefs(const QCString &scName,
           int ni=namespaceName.findRev("::");
           //printf("namespaceName=%s ni=%d\n",namespaceName.data(),ni);
           bool notInNS = tmd && ni==-1 && tmd->getNamespaceDef()==0 && (mScope.isEmpty() || mScope==tmd->name());
-          bool sameNS  = tmd && tmd->getNamespaceDef() && namespaceName.left(ni)==tmd->getNamespaceDef()->name();
+          bool sameNS  = tmd && tmd->getNamespaceDef() && namespaceName.left(ni)==tmd->getNamespaceDef()->name() && namespaceName.mid(ni+2)==tmd->name();
           //printf("notInNS=%d sameNS=%d\n",notInNS,sameNS);
           if (tmd && tmd->isStrong() && // C++11 enum class
               (notInNS || sameNS) &&
@@ -5820,10 +5667,10 @@ QCString insertTemplateSpecifierInScope(const QCString &scope,const QCString &te
     int si,pi=0;
     ClassDef *cd=0;
     while (
-        (si=scope.find("::",pi))!=-1 && !getClass(scope.left(si)+templ) && 
-        ((cd=getClass(scope.left(si)))==0 || cd->templateArguments()==0) 
-        ) 
-    { 
+        (si=scope.find("::",pi))!=-1 && !getClass(scope.left(si)+templ) &&
+        ((cd=getClass(scope.left(si)))==0 || cd->templateArguments().empty())
+        )
+    {
       //printf("Tried '%s'\n",(scope.left(si)+templ).data()); 
       pi=si+2; 
     }
@@ -6119,7 +5966,7 @@ QCString convertToHtml(const char *s,bool keepEntities)
   static GrowBuf growBuf;
   growBuf.clear();
   if (s==0) return "";
-  growBuf.addStr(getHtmlDirEmbedingChar(getTextDirByConfig(s)));
+  growBuf.addStr(getHtmlDirEmbeddingChar(getTextDirByConfig(s)));
   const char *p=s;
   char c;
   while ((c=*p++))
@@ -6167,7 +6014,7 @@ QCString convertToJSString(const char *s, bool applyTextDir)
   growBuf.clear();
   if (s==0) return "";
   if (applyTextDir)
-    growBuf.addStr(getJsDirEmbedingChar(getTextDirByConfig(s)));
+    growBuf.addStr(getJsDirEmbeddingChar(getTextDirByConfig(s)));
   const char *p=s;
   char c;
   while ((c=*p++))
@@ -6183,6 +6030,26 @@ QCString convertToJSString(const char *s, bool applyTextDir)
   return convertCharEntitiesToUTF8(growBuf.get());
 }
 
+QCString convertToPSString(const char *s)
+{
+  static GrowBuf growBuf;
+  growBuf.clear();
+  if (s==0) return "";
+  const char *p=s;
+  char c;
+  while ((c=*p++))
+  {
+    switch (c)
+    {
+      case '(':  growBuf.addStr("\\("); break;
+      case ')': growBuf.addStr("\\)"); break;
+      default:   growBuf.addChar(c);   break;
+    }
+  }
+  growBuf.addChar(0);
+  return growBuf.get();
+}
+
 QCString convertToLaTeX(const QCString &s,bool insideTabbing,bool keepSpaces)
 {
   QGString result;
@@ -6276,7 +6143,6 @@ void addMembersToMemberGroup(MemberList *ml,
               if (mg==0)
               {
                 mg = new MemberGroup(
-                    context,
                     groupId,
                     info->header,
                     info->doc,
@@ -6309,7 +6175,6 @@ void addMembersToMemberGroup(MemberList *ml,
         if (mg==0)
         {
           mg = new MemberGroup(
-              context,
               groupId,
               info->header,
               info->doc,
@@ -6411,7 +6276,7 @@ int extractClassNameFromType(const QCString &type,int &pos,QCString &name,QCStri
 QCString normalizeNonTemplateArgumentsInString(
        const QCString &name,
        const Definition *context,
-       const ArgumentList formalArgs)
+       const ArgumentList &formalArgs)
 {
   // skip until <
   int p=name.find('<');
@@ -6427,16 +6292,12 @@ QCString normalizeNonTemplateArgumentsInString(
     result += name.mid(p,i-p);
     QCString n = name.mid(i,l);
     bool found=FALSE;
-    if (formalArgs) // check that n is not a formal template argument
+    for (const Argument formArg : formalArgs)
     {
-      ArgumentListIterator formAli(*formalArgs);
-      const Argument *formArg;
-      for (formAli.toFirst();
-          (formArg=formAli.current()) && !found;
-          ++formAli
-          )
+      if (formArg.name == n)
       {
-        found = formArg->name==n;
+        found=TRUE;
+        break;
       }
     }
     if (!found)
@@ -6472,12 +6333,12 @@ QCString normalizeNonTemplateArgumentsInString(
  */
 QCString substituteTemplateArgumentsInString(
     const QCString &name,
-    ArgumentList *formalArgs,
-    ArgumentList *actualArgs)
+    const ArgumentList &formalArgs,
+    const ArgumentList &actualArgs)
 {
   //printf("substituteTemplateArgumentsInString(name=%s formal=%s actualArg=%s)\n",
   //    name.data(),argListToString(formalArgs).data(),argListToString(actualArgs).data());
-  if (formalArgs==0) return name;
+  if (formalArgs.empty()) return name;
   QCString result;
   static QRegExp re("[a-z_A-Z\\x80-\\xFF][a-z_A-Z0-9\\x80-\\xFF]*");
   int p=0,l,i;
@@ -6486,82 +6347,89 @@ QCString substituteTemplateArgumentsInString(
   {
     result += name.mid(p,i-p);
     QCString n = name.mid(i,l);
-    ArgumentListIterator formAli(*formalArgs);
-    ArgumentListIterator actAli(*actualArgs);
-    Argument *formArg;
-    Argument *actArg;
+    auto formIt = formalArgs.begin();
+    auto actIt  = actualArgs.begin();
 
     // if n is a template argument, then we substitute it
     // for its template instance argument.
     bool found=FALSE;
-    for (formAli.toFirst();
-        (formArg=formAli.current()) && !found;
-        ++formAli,++actAli
+    for (auto formIt = formalArgs.begin();
+        formIt!=formalArgs.end() && !found;
+        ++formIt
         )
     {
-      actArg = actAli.current();
-      if (formArg->type.left(6)=="class " && formArg->name.isEmpty())
+      Argument formArg = *formIt;
+      Argument actArg;
+      if (actIt!=actualArgs.end())
+      {
+        actArg = *actIt;
+      }
+      if (formArg.type.left(6)=="class " && formArg.name.isEmpty())
       {
-        formArg->name = formArg->type.mid(6);
-        formArg->type = "class";
+        formArg.name = formArg.type.mid(6);
+        formArg.type = "class";
       }
-      if (formArg->type.left(9)=="typename " && formArg->name.isEmpty())
+      if (formArg.type.left(9)=="typename " && formArg.name.isEmpty())
       {
-        formArg->name = formArg->type.mid(9);
-        formArg->type = "typename";
+        formArg.name = formArg.type.mid(9);
+        formArg.type = "typename";
       }
-      if (formArg->type=="class" || formArg->type=="typename" || formArg->type.left(8)=="template")
+      if (formArg.type=="class" || formArg.type=="typename" || formArg.type.left(8)=="template")
       {
         //printf("n=%s formArg->type='%s' formArg->name='%s' formArg->defval='%s'\n",
         //  n.data(),formArg->type.data(),formArg->name.data(),formArg->defval.data());
         //printf(">> formArg->name='%s' actArg->type='%s' actArg->name='%s'\n",
         //    formArg->name.data(),actArg ? actArg->type.data() : "",actArg ? actArg->name.data() : ""
         //    );
-        if (formArg->name==n && actArg && !actArg->type.isEmpty()) // base class is a template argument
+        if (formArg.name==n && actIt!=actualArgs.end() && !actArg.type.isEmpty()) // base class is a template argument
         {
           // replace formal argument with the actual argument of the instance
-          if (!leftScopeMatch(actArg->type,n)) 
+          if (!leftScopeMatch(actArg.type,n)) 
             // the scope guard is to prevent recursive lockup for 
             // template<class A> class C : public<A::T>, 
             // where A::T would become A::T::T here, 
             // since n==A and actArg->type==A::T
             // see bug595833 for an example
           {
-            if (actArg->name.isEmpty())
+            if (actArg.name.isEmpty())
             {
-              result += actArg->type+" "; 
+              result += actArg.type+" "; 
               found=TRUE;
             }
             else 
               // for case where the actual arg is something like "unsigned int"
               // the "int" part is in actArg->name.
             {
-              result += actArg->type+" "+actArg->name+" "; 
+              result += actArg.type+" "+actArg.name+" "; 
               found=TRUE;
             }
           }
         }
-        else if (formArg->name==n && 
-                 actArg==0 && 
-                 !formArg->defval.isEmpty() &&
-                 formArg->defval!=name /* to prevent recursion */
+        else if (formArg.name==n &&
+                 actIt==actualArgs.end() &&
+                 !formArg.defval.isEmpty() &&
+                 formArg.defval!=name /* to prevent recursion */
             )
         {
-          result += substituteTemplateArgumentsInString(formArg->defval,formalArgs,actualArgs)+" ";
+          result += substituteTemplateArgumentsInString(formArg.defval,formalArgs,actualArgs)+" ";
           found=TRUE;
         }
       }
-      else if (formArg->name==n && 
-               actArg==0 && 
-               !formArg->defval.isEmpty() &&
-               formArg->defval!=name /* to prevent recursion */
+      else if (formArg.name==n &&
+               actIt==actualArgs.end() &&
+               !formArg.defval.isEmpty() &&
+               formArg.defval!=name /* to prevent recursion */
               )
       {
-        result += substituteTemplateArgumentsInString(formArg->defval,formalArgs,actualArgs)+" ";
+        result += substituteTemplateArgumentsInString(formArg.defval,formalArgs,actualArgs)+" ";
         found=TRUE;
       }
+      if (actIt!=actualArgs.end())
+      {
+        actIt++;
+      }
     }
-    if (!found) 
+    if (!found)
     {
       result += n;
     }
@@ -6573,6 +6441,7 @@ QCString substituteTemplateArgumentsInString(
   return result.stripWhiteSpace();
 }
 
+#if 0
 /*! Makes a deep copy of the list of argument lists \a srcLists. 
  *  Will allocate memory, that is owned by the caller.
  */
@@ -6589,6 +6458,7 @@ QList<ArgumentList> *copyArgumentLists(const QList<ArgumentList> *srcLists)
   }
   return dstLists;
 }
+#endif
 
 /*! Strips template specifiers from scope \a fullName, except those 
  *  that make up specialized classes. The switch \a parentOnly 
@@ -6742,11 +6612,11 @@ found:
 
 PageDef *addRelatedPage(const char *name,const QCString &ptitle,
     const QCString &doc,
-    const QList<SectionInfo> * /*anchors*/,
     const char *fileName,int startLine,
-    const QList<ListItemInfo> *sli,
+    const std::vector<ListItemInfo> &sli,
     GroupDef *gd,
-    TagInfo *tagInfo,
+    const TagInfo *tagInfo,
+    bool xref,
     SrcLangExt lang
     )
 {
@@ -6754,7 +6624,7 @@ PageDef *addRelatedPage(const char *name,const QCString &ptitle,
   //printf("addRelatedPage(name=%s gd=%p)\n",name,gd);
   if ((pd=Doxygen::pageSDict->find(name)) && !tagInfo)
   {
-    warn(fileName,startLine,"multiple use of page label '%s', (other occurrence: %s, line: %d)",
+    if (!xref) warn(fileName,startLine,"multiple use of page label '%s', (other occurrence: %s, line: %d)",
          name,pd->docFile().data(),pd->docLine());
     // append documentation block to the page.
     pd->setDocumentation(doc,fileName,startLine);
@@ -6831,30 +6701,28 @@ PageDef *addRelatedPage(const char *name,const QCString &ptitle,
 
 //----------------------------------------------------------------------------
 
-void addRefItem(const QList<ListItemInfo> *sli,
+void addRefItem(const std::vector<ListItemInfo> &sli,
     const char *key, 
     const char *prefix, const char *name,const char *title,const char *args,Definition *scope)
 {
   //printf("addRefItem(sli=%p,key=%s,prefix=%s,name=%s,title=%s,args=%s)\n",sli,key,prefix,name,title,args);
-  if (sli && key && key[0]!='@') // check for @ to skip anonymous stuff (see bug427012)
+  if (key && key[0]!='@') // check for @ to skip anonymous stuff (see bug427012)
   {
-    QListIterator<ListItemInfo> slii(*sli);
-    ListItemInfo *lii;
-    for (slii.toFirst();(lii=slii.current());++slii)
+    for (const ListItemInfo &lii : sli)
     {
-      RefList *refList = Doxygen::xrefLists->find(lii->type);
+      RefList *refList = Doxygen::xrefLists->find(lii.type);
       if (refList
           &&
           (
            // either not a built-in list or the list is enabled
-           (lii->type!="todo"       || Config_getBool(GENERATE_TODOLIST)) &&
-           (lii->type!="test"       || Config_getBool(GENERATE_TESTLIST)) &&
-           (lii->type!="bug"        || Config_getBool(GENERATE_BUGLIST))  &&
-           (lii->type!="deprecated" || Config_getBool(GENERATE_DEPRECATEDLIST))
+           (lii.type!="todo"       || Config_getBool(GENERATE_TODOLIST)) &&
+           (lii.type!="test"       || Config_getBool(GENERATE_TESTLIST)) &&
+           (lii.type!="bug"        || Config_getBool(GENERATE_BUGLIST))  &&
+           (lii.type!="deprecated" || Config_getBool(GENERATE_DEPRECATEDLIST))
           )
          )
       {
-        RefItem *item = refList->getRefItem(lii->itemId);
+        RefItem *item = refList->getRefItem(lii.itemId);
         ASSERT(item!=0);
 
         item->prefix = prefix;
@@ -6946,7 +6814,7 @@ void filterLatexString(FTextStream &t,const char *str,
         case '$':  t << "\\$"; break;
         case '-':  t << "-\\/"; break;
         case '^':  (usedTableLevels()>0) ? t << "\\string^" : t << (char)c;    break;
-        case '~':  (usedTableLevels()>0) ? t << "\\string~" : t << (char)c;    break;
+        case '~':  t << "\\string~";    break;
         case ' ':  if (keepSpaces) t << "~"; else t << ' ';
                    break;
         default:
@@ -7166,6 +7034,7 @@ QCString latexFilterURL(const char *s)
     {
       case '#':  t << "\\#"; break;
       case '%':  t << "\\%"; break;
+      case '\\':  t << "\\\\"; break;
       default:
         t << c;
         break;
@@ -7220,6 +7089,15 @@ bool checkExtension(const char *fName, const char *ext)
   return (QCString(fName).right(QCString(ext).length())==ext);
 }
 
+QCString addHtmlExtensionIfMissing(const char *fName)
+{
+  if (QFileInfo(fName).extension(FALSE).isEmpty())
+  {
+    return QCString(fName)+Doxygen::htmlFileExtension;
+  }
+  return fName;
+}
+
 QCString stripExtensionGeneral(const char *fName, const char *ext)
 {
   QCString result=fName;
@@ -7502,7 +7380,8 @@ void addCodeOnlyMappings()
 SrcLangExt getLanguageFromFileName(const QCString& fileName)
 {
   QFileInfo fi(fileName);
-  QCString extName = fi.extension().lower().data();
+  // we need only the part after the last ".", newer implementations of QFileInfo have 'suffix()' for this.
+  QCString extName = fi.extension(FALSE).lower().data();
   if (extName.isEmpty()) extName=".no_extension";
   if (extName.at(0)!='.') extName.prepend(".");
     int *pVal=g_extLookup.find(extName.data());
@@ -8024,22 +7903,20 @@ QCString expandAlias(const QCString &aliasName,const QCString &aliasValue)
   return result;
 }
 
-void writeTypeConstraints(OutputList &ol,const Definition *d,const ArgumentList *al)
+void writeTypeConstraints(OutputList &ol,const Definition *d,const ArgumentList &al)
 {
-  if (al==0) return;
+  if (al.empty()) return;
   ol.startConstraintList(theTranslator->trTypeConstraints()); 
-  ArgumentListIterator ali(*al);
-  const Argument *a;
-  for (;(a=ali.current());++ali)
+  for (const Argument &a : al)
   {
     ol.startConstraintParam();
-    ol.parseText(a->name);
+    ol.parseText(a.name);
     ol.endConstraintParam();
     ol.startConstraintType();
-    linkifyText(TextGeneratorOLImpl(ol),d,0,0,a->type);
+    linkifyText(TextGeneratorOLImpl(ol),d,0,0,a.type);
     ol.endConstraintType();
     ol.startConstraintDocs();
-    ol.generateDoc(d->docFile(),d->docLine(),d,0,a->docs,TRUE,FALSE);
+    ol.generateDoc(d->docFile(),d->docLine(),d,0,a.docs,TRUE,FALSE);
     ol.endConstraintDocs();
   }
   ol.endConstraintList();
@@ -8060,14 +7937,22 @@ void stackTrace()
     p += sprintf(p,"%p ", backtraceFrames[x]);
   }
   fprintf(stderr,"========== STACKTRACE START ==============\n");
-  if (FILE *fp = popen(cmd, "r"))
+  #if defined(_WIN32) && !defined(__CYGWIN__)
+  if (FILE *fp = _popen(cmd, "r"))
+  #else
+  if (FILE *fp = ::popen(cmd, "r"))
+  #endif
   {
     char resBuf[512];
     while (size_t len = fread(resBuf, 1, sizeof(resBuf), fp))
     {
       fwrite(resBuf, 1, len, stderr);
     }
-    pclose(fp);
+    #if defined(_WIN32) && !defined(__CYGWIN__)
+    _pclose(fp);
+    #else
+    ::pclose(fp);
+    #endif
   }
   fprintf(stderr,"============ STACKTRACE END ==============\n");
   //fprintf(stderr,"%s\n", frameStrings[x]);
@@ -8082,10 +7967,9 @@ static int transcodeCharacterBuffer(const char *fileName,BufStr &srcBuf,int size
   void *cd = portable_iconv_open(outputEncoding,inputEncoding);
   if (cd==(void *)(-1)) 
   {
-    err("unsupported character conversion: '%s'->'%s': %s\n"
+    term("unsupported character conversion: '%s'->'%s': %s\n"
         "Check the INPUT_ENCODING setting in the config file!\n",
         inputEncoding,outputEncoding,strerror(errno));
-    exit(1);
   }
   int tmpBufSize=size*4+1;
   BufStr tmpBuf(tmpBufSize);
@@ -8103,9 +7987,8 @@ static int transcodeCharacterBuffer(const char *fileName,BufStr &srcBuf,int size
   }
   else
   {
-    err("%s: failed to translate characters from %s to %s: check INPUT_ENCODING\n",
+    term("%s: failed to translate characters from %s to %s: check INPUT_ENCODING\n",
         fileName,inputEncoding,outputEncoding);
-    exit(1);
   }
   portable_iconv_close(cd);
   return newSize;
@@ -8143,7 +8026,7 @@ bool readInputFile(const char *fileName,BufStr &inBuf,bool filter,bool isSourceC
   {
     QCString cmd=filterName+" \""+fileName+"\"";
     Debug::print(Debug::ExtCmd,0,"Executing popen(`%s`)\n",qPrint(cmd));
-    FILE *f=portable_popen(cmd,"r");
+    FILE *f=Portable::popen(cmd,"r");
     if (!f)
     {
       err("could not execute filter %s\n",filterName.data());
@@ -8157,7 +8040,7 @@ bool readInputFile(const char *fileName,BufStr &inBuf,bool filter,bool isSourceC
       //printf(">>>>>>>>Reading %d bytes\n",numRead);
       inBuf.addArray(buf,numRead),size+=numRead;
     }
-    portable_pclose(f);
+    Portable::pclose(f);
     inBuf.at(inBuf.curPos()) ='\0';
     Debug::print(Debug::FilterOutput, 0, "Filter output\n");
     Debug::print(Debug::FilterOutput,0,"-------------\n%s\n-------------\n",qPrint(inBuf));
@@ -8165,13 +8048,18 @@ bool readInputFile(const char *fileName,BufStr &inBuf,bool filter,bool isSourceC
 
   int start=0;
   if (size>=2 &&
-      (((uchar)inBuf.at(0)==0xFF && (uchar)inBuf.at(1)==0xFE) || // Little endian BOM
-       ((uchar)inBuf.at(0)==0xFE && (uchar)inBuf.at(1)==0xFF)    // big endian BOM
-      )
-     ) // UCS-2 encoded file
+      ((uchar)inBuf.at(0)==0xFF && (uchar)inBuf.at(1)==0xFE) // Little endian BOM
+     ) // UCS-2LE encoded file
+  {
+    transcodeCharacterBuffer(fileName,inBuf,inBuf.curPos(),
+        "UCS-2LE","UTF-8");
+  }
+  else if (size>=2 &&
+           ((uchar)inBuf.at(0)==0xFE && (uchar)inBuf.at(1)==0xFF) // big endian BOM
+         ) // UCS-2BE encoded file
   {
     transcodeCharacterBuffer(fileName,inBuf,inBuf.curPos(),
-        "UCS-2","UTF-8");
+        "UCS-2BE","UTF-8");
   }
   else if (size>=3 &&
            (uchar)inBuf.at(0)==0xEF &&
@@ -8516,7 +8404,7 @@ QCString langToString(SrcLangExt lang)
     case SrcLangExt_PHP:      return "PHP";
     case SrcLangExt_ObjC:     return "Objective-C";
     case SrcLangExt_Cpp:      return "C++";
-    case SrcLangExt_JS:       return "Javascript";
+    case SrcLangExt_JS:       return "JavaScript";
     case SrcLangExt_Python:   return "Python";
     case SrcLangExt_Fortran:  return "Fortran";
     case SrcLangExt_VHDL:     return "VHDL";
@@ -8778,7 +8666,7 @@ bool namespaceHasVisibleChild(const NamespaceDef *nd,bool includeClasses,bool fi
     const NamespaceDef *cnd;
     for (cnli.toFirst();(cnd=cnli.current());++cnli)
     {
-      if (cnd->isLinkableInProject() && cnd->localName().find('@')==-1)
+      if (cnd->isLinkableInProject() && !cnd->isAnonymous())
       {
         return TRUE;
       }
@@ -9052,9 +8940,9 @@ bool mainPageHasTitle()
 
 QCString getDotImageExtension(void)
 {
-  QCString imgExt      = Config_getEnum(DOT_IMAGE_FORMAT);
-  imgExt = imgExt.replace( QRegExp(":.*"), "" );
-  return imgExt;
+  QCString imgExt = Config_getEnum(DOT_IMAGE_FORMAT);
+  int i= imgExt.find(':'); // strip renderer part when using e.g. 'png:cairo:gd' as format
+  return i==-1 ? imgExt : imgExt.left(i);
 }
 
 bool openOutputFile(const char *outFile,QFile &f)
index 8ff7e4d..76c0522 100644 (file)
@@ -186,12 +186,12 @@ void writePageRef(OutputDocInterface &od,const char *cn,const char *mn);
 
 QCString getCanonicalTemplateSpec(const Definition *d,const FileDef *fs,const QCString& spec);
 
-bool matchArguments2(const Definition *srcScope,const FileDef *srcFileScope,const ArgumentList *srcAl,
-                     const Definition *dstScope,const FileDef *dstFileScope,const ArgumentList *dstAl,
+bool matchArguments2(const Definition *srcScope,const FileDef *srcFileScope,const ArgumentList &srcAl,
+                     const Definition *dstScope,const FileDef *dstFileScope,const ArgumentList &dstAl,
                      bool checkCV
                     );
 
-void mergeArguments(ArgumentList *,ArgumentList *,bool forceNameOverwrite=FALSE);
+void mergeArguments(ArgumentList &,ArgumentList &,bool forceNameOverwrite=FALSE);
 
 QCString substituteClassNames(const QCString &s);
 
@@ -232,9 +232,9 @@ inline bool isId(int c)
 
 QCString removeRedundantWhiteSpace(const QCString &s);
 
-QCString argListToString(const ArgumentList *al,bool useCanonicalType=FALSE,bool showDefVals=TRUE);
+QCString argListToString(const ArgumentList &al,bool useCanonicalType=FALSE,bool showDefVals=TRUE);
 
-QCString tempArgListToString(const ArgumentList *al,SrcLangExt lang);
+QCString tempArgListToString(const ArgumentList &al,SrcLangExt lang);
 
 QCString generateMarker(int id);
 
@@ -291,6 +291,8 @@ QCString convertToDocBook(const char *s);
 
 QCString convertToJSString(const char *s, bool applyTextDir = true);
 
+QCString convertToPSString(const char *s);
+
 QCString getOverloadDocs();
 
 void addMembersToMemberGroup(/* in,out */ MemberList *ml,
@@ -303,14 +305,14 @@ int extractClassNameFromType(const QCString &type,int &pos,
 QCString normalizeNonTemplateArgumentsInString(
        const QCString &name,
        const Definition *context,
-       const ArgumentList *formalArgs);
+       const ArgumentList &formalArgs);
 
 QCString substituteTemplateArgumentsInString(
        const QCString &name,
-       ArgumentList *formalArgs,
-       ArgumentList *actualArgs);
+       const ArgumentList &formalArgs,
+       const ArgumentList &actualArgs);
 
-QList<ArgumentList> *copyArgumentLists(const QList<ArgumentList> *srcLists);
+//QList<ArgumentList> *copyArgumentLists(const QList<ArgumentList> *srcLists);
 
 QCString stripTemplateSpecifiersFromScope(const QCString &fullName,
                                           bool parentOnly=TRUE,
@@ -325,18 +327,18 @@ int getScopeFragment(const QCString &s,int p,int *l);
 
 int filterCRLF(char *buf,int len);
 
-void addRefItem(const QList<ListItemInfo> *sli,const char *prefix,
+void addRefItem(const std::vector<ListItemInfo> &sli,const char *prefix,
                 const char *key,
                 const char *name,const char *title,const char *args,Definition *scope);
 
 PageDef *addRelatedPage(const char *name,
                         const QCString &ptitle,
                         const QCString &doc,
-                        const QList<SectionInfo> *anchors,
                         const char *fileName,int startLine,
-                        const QList<ListItemInfo> *sli,
+                        const std::vector<ListItemInfo> &sli = std::vector<ListItemInfo>(),
                         GroupDef *gd=0,
-                        TagInfo *tagInfo=0,
+                        const TagInfo *tagInfo=0,
+                        bool xref=FALSE,
                         SrcLangExt lang=SrcLangExt_Unknown
                        );
 
@@ -362,6 +364,8 @@ QCString linkToText(SrcLangExt lang,const char *link,bool isFileName);
 
 bool checkExtension(const char *fName, const char *ext);
 
+QCString addHtmlExtensionIfMissing(const char *fName);
+
 QCString stripExtensionGeneral(const char *fName, const char *ext);
 
 QCString stripExtension(const char *fName);
@@ -404,7 +408,7 @@ const ClassDef *newResolveTypedef(const FileDef *fileScope,
                                   const MemberDef **pMemType=0,
                                   QCString *pTemplSpec=0,
                                   QCString *pResolvedType=0,
-                                  ArgumentList *actTemplParams=0);
+                                  const ArgumentList *actTemplParams=0);
 
 QCString parseCommentAsText(const Definition *scope,const MemberDef *member,const QCString &doc,const QCString &fileName,int lineNr);
 
@@ -421,7 +425,7 @@ int countAliasArguments(const QCString argList);
 QCString resolveAliasCmd(const QCString aliasCmd);
 QCString expandAlias(const QCString &aliasName,const QCString &aliasValue);
 
-void writeTypeConstraints(OutputList &ol,const Definition *d,const ArgumentList *al);
+void writeTypeConstraints(OutputList &ol,const Definition *d,const ArgumentList &al);
 
 QCString convertCharEntitiesToUTF8(const QCString &s);
 
index a7b4687..b79e2ab 100644 (file)
@@ -1,16 +1,35 @@
 #ifndef VHDLCODE_H
 #define VHDLCODE_H
 
+#include "parserintf.h"
+
 class CodeOutputInterface;
 class FileDef;
 class MemberDef;
 
-void parseVhdlCode(CodeOutputInterface &,const char *,const QCString &, 
-            bool ,const char *,FileDef *fd,
-            int startLine,int endLine,bool inlineFragment,
-            const MemberDef *memberDef,bool showLineNumbers,const Definition *searchCtx,
-            bool collectXRefs);
-void resetVhdlCodeParserState();
 void codeFreeVhdlScanner();
 
+class VHDLCodeParser : public CodeParserInterface
+{
+  public:
+    virtual ~VHDLCodeParser() {}
+    void parseCode(CodeOutputInterface &codeOutIntf,
+                   const char *scopeName,
+                   const QCString &input,
+                   SrcLangExt lang,
+                   bool isExampleBlock,
+                   const char *exampleName=0,
+                   FileDef *fileDef=0,
+                   int startLine=-1,
+                   int endLine=-1,
+                   bool inlineFragment=FALSE,
+                   const MemberDef *memberDef=0,
+                   bool showLineNumbers=TRUE,
+                   const Definition *searchCtx=0,
+                   bool collectXRefs=TRUE
+                  );
+    void resetCodeParserState() {}
+};
+
+
 #endif 
index 5f668c6..fe5a8d9 100644 (file)
@@ -33,6 +33,7 @@
 #include <qdir.h>
 #include <qcstringlist.h>
 
+#include "vhdlcode.h"
 #include "entry.h"
 #include "doxygen.h"
 #include "message.h"
@@ -112,6 +113,7 @@ static bool writeColoredWord(QCString& word );
 static void generateClassOrGlobalLink(CodeOutputInterface &ol,const char *clName, bool typeOnly=FALSE, const char *curr_class=0);
 static void endFontClass();
 static void startFontClass(const char *s);
+static const char *stateToString(int state);
 //-------------------------------------------------------------------
 
 
@@ -433,14 +435,10 @@ static void writeMultiLineCodeLink(CodeOutputInterface &ol,
 static void setParameterList(const MemberDef *md)
 {
   g_classScope = md->getClassDef() ? md->getClassDef()->name().data() : "";
-  const ArgumentList *al = md->argumentList();
-  if (al==0) return;
-  ArgumentListIterator ali(*al);
-  const Argument *a;
-  for (ali.toFirst();(a=ali.current());++ali)
+  for (const Argument &a: md->argumentList())
   {
-    g_parmName = a->name.copy();
-    g_parmType = a->type.copy();
+    g_parmName = a.name.copy();
+    g_parmType = a.type.copy();
     int i = g_parmType.find('*');
     if (i!=-1) g_parmType = g_parmType.left(i);
     i = g_parmType.find('&');
@@ -682,9 +680,8 @@ static void codifyMapLines(const char *text)
 
 static void writeFuncProto()
 {
-  QList<Argument> ql;
   QCString name,ret;
-  VhdlDocGen::parseFuncProto(g_FuncProto,ql,name,ret,FALSE);
+  VhdlDocGen::parseFuncProto(g_FuncProto,name,ret,FALSE);
 
   if (name.isEmpty())
   {
@@ -701,7 +698,7 @@ static void writeFuncProto()
   {
     temp.stripPrefix("_");// _{package body name}
   }
-  MemberDef *mdef=VhdlDocGen::findFunction(ql,name,temp,FALSE);
+  MemberDef *mdef=VhdlDocGen::findFunction(name,temp);
 
   if (mdef)
   {
@@ -1534,17 +1531,26 @@ XILINX      "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI
 /*@ ----------------------------------------------------------------------------
  */
 
-void resetVhdlCodeParserState()
+static void resetVhdlCodeParserState()
 {
   g_vhdlKeyDict.setAutoDelete(TRUE);
   g_vhdlKeyDict.clear();
 }
 
-void parseVhdlCode(CodeOutputInterface &od,const char *className,const QCString &s, 
-                  bool exBlock, const char *exName,FileDef *fd,
-                  int startLine,int endLine,bool inlineFragment,
-                  const MemberDef *memberDef,bool,const Definition *searchCtx,
-                  bool /* collectXRefs */)
+void VHDLCodeParser::parseCode(CodeOutputInterface &od,
+                               const char *className,
+                               const QCString &s, 
+                               SrcLangExt,
+                               bool exBlock,
+                               const char *exName,
+                               FileDef *fd,
+                               int startLine,
+                               int endLine,
+                               bool inlineFragment,
+                               const MemberDef *memberDef,
+                               bool,
+                               const Definition *searchCtx,
+                               bool /* collectXRefs */)
 {
   //printf("***parseCode() exBlock=%d exName=%s fd=%p\n",exBlock,exName,fd);
   if (s.isEmpty()) return;
@@ -1638,14 +1644,5 @@ void codeFreeVhdlScanner()
 #endif
 }
 
-#if !defined(YY_FLEX_SUBMINOR_VERSION) 
-extern "C" { // some bogus code to keep the compiler happy
-  void vhdlcodeYYdummy() { yy_flex_realloc(0,0); } 
-}
-#elif YY_FLEX_MAJOR_VERSION<=2 && YY_FLEX_MINOR_VERSION<=5 && YY_FLEX_SUBMINOR_VERSION<33
-#error "You seem to be using a version of flex newer than 2.5.4 but older than 2.5.33. These versions do NOT work with doxygen! Please use version <=2.5.4 or >=2.5.33 or expect things to be parsed wrongly!"
-#endif
-
-
-
+#include "vhdlcode.l.h"
 
index 38a80ef..3c30174 100644 (file)
@@ -71,7 +71,8 @@ static QDict<QCString> g_vhdlKeyDict3(17,FALSE);
 static void initUCF(Entry* root,const char* type,QCString &  qcs,int line,QCString & fileName,QCString & brief);
 static void writeUCFLink(const MemberDef* mdef,OutputList &ol);
 static void assignBinding(VhdlConfNode* conf);
-static void addInstance(ClassDef* entity, ClassDef* arch, ClassDef *inst,Entry *cur,ClassDef* archBind=NULL);
+static void addInstance(ClassDef* entity, ClassDef* arch, ClassDef *inst,
+                        const std::shared_ptr<Entry> &cur);
 
 //---------- create svg -------------------------------------------------------------
 static void createSVG();
@@ -81,7 +82,7 @@ static QList<MemberDef>* getPorts(ClassDef *cd);
 static void writeVhdlEntityToolTip(FTextStream& t,ClassDef *cd);
 static void endDot(FTextStream &t);
 static void writeTable(QList<MemberDef>* port,FTextStream & t);
-static void endTabel(FTextStream &t);
+static void endTable(FTextStream &t);
 static void writeClassToDot(FTextStream &t,ClassDef* cd);
 static void writeVhdlDotLink(FTextStream &t,const QCString &a,const QCString &b,const QCString &style);
 //static void writeVhdlPortToolTip(FTextStream& t,QList<MemberDef>* port,ClassDef *cd);
@@ -168,7 +169,7 @@ static void createSVG()
 
     QCString vlargs="-Tsvg \""+ov+"\" "+dir ;
 
-    if (portable_system(Config_getString(DOT_PATH) + "dot",vlargs)!=0)
+    if (Portable::system(Config_getString(DOT_PATH) + "dot",vlargs)!=0)
     {
       err("could not create dot file");
     }
@@ -227,7 +228,7 @@ void VhdlDocGen::writeOverview()
     startTable(t,cd->name());
     writeClassToDot(t,cd);
     writeTable(port,t);
-    endTabel(t);
+    endTable(t);
 
    // writeVhdlPortToolTip(t,port,cd);
     writeVhdlEntityToolTip(t,cd);
@@ -447,7 +448,7 @@ static void writeColumn(FTextStream &t,MemberDef *md,bool start)
   }
 }
 
-static void endTabel(FTextStream &t)
+static void endTable(FTextStream &t)
 {
   t << "</TABLE>>\n";
   t << "] \n";
@@ -716,7 +717,7 @@ static QMap<ClassDef*,QList<ClassDef> > packages;
 
 MemberDef* VhdlDocGen::findMember(const QCString& className, const QCString& memName)
 {
-  ClassDef* cd,*ecd;
+  ClassDef* cd,*ecd=0;
   MemberDef *mdef=0;
 
   cd=getClass(className);
@@ -792,9 +793,11 @@ MemberDef* VhdlDocGen::findMember(const QCString& className, const QCString& mem
     if (!packages.contains(ecd)) VhdlDocGen::findAllPackages(ecd);
   }
 
- QMap<ClassDef*,QList<ClassDef> >::Iterator cList=packages.find(ecd);
-      if (cList.key()!=0)
-         {
+  if (ecd)
+  {
+    QMap<ClassDef*,QList<ClassDef> >::Iterator cList=packages.find(ecd);
+    if (cList!=packages.end())
+    {
       QList<ClassDef> mlist=cList.data();
       for (uint j=0;j<mlist.count();j++)
       {
@@ -803,7 +806,8 @@ MemberDef* VhdlDocGen::findMember(const QCString& className, const QCString& mem
         mdef=VhdlDocGen::findMemberDef(mlist.at(j),memName,MemberListType_pubMethods);
         if (mdef) return mdef;
       }
-         }
+    }
+  }
   return 0;
 
 }//findMember
@@ -898,12 +902,9 @@ void VhdlDocGen::findAllPackages( ClassDef *cdef)
  * is called in vhdlcode.l
  */
 
-MemberDef* VhdlDocGen::findFunction(const QList<Argument> &ql,
-    const QCString& funcname,
-    const QCString& package, bool /*type*/)
+MemberDef* VhdlDocGen::findFunction(const QCString& funcname, const QCString& package)
 {
   MemberDef* mdef=0;
-  //int funcType;
   ClassDef *cdef=getClass(package.data());
   if (cdef==0) return 0;
 
@@ -917,40 +918,11 @@ MemberDef* VhdlDocGen::findFunction(const QList<Argument> &ql,
       QCString mname=mdef->name();
       if ((VhdlDocGen::isProcedure(mdef) || VhdlDocGen::isVhdlFunction(mdef)) && (compareString(funcname,mname)==0))
       {
-        ArgumentList *alp = mdef->argumentList();
-
-        //  ArgumentList* arg2=mdef->getArgumentList();
-        if (alp==0) break;
-        ArgumentListIterator ali(*alp);
-        ArgumentListIterator ali1(ql);
-
-        if (ali.count() != ali1.count()) break;
-
-        Argument *arg,*arg1;
-        int equ=0;
-
-        for (;(arg=ali.current()) && (arg1=ali1.current());++ali,++ali1)
-        {
-          equ+=abs(compareString(arg->type,arg1->type));
-
-          QCString s1=arg->type;
-          QCString s2=arg1->type;
-          VhdlDocGen::deleteAllChars(s1,' ');
-          VhdlDocGen::deleteAllChars(s2,' ');
-          equ+=abs(compareString(s1,s2));
-          s1=arg->attrib;
-          s2=arg1->attrib;
-          VhdlDocGen::deleteAllChars(s1,' ');
-          VhdlDocGen::deleteAllChars(s2,' ');
-          equ+=abs(compareString(s1,s2));
-          // printf("\n 1. type [%s] name [%s] attrib [%s]",arg->type,arg->name,arg->attrib);
-          // printf("\n 2. type [%s] name [%s] attrib [%s]",arg1->type,arg1->name,arg1->attrib);
-        } // for
-        if (equ==0) return mdef;
+        return mdef;
       }//if
     }//for
   }//if
-  return mdef;
+  return 0;
 } //findFunction
 
 
@@ -1152,15 +1124,12 @@ void VhdlDocGen::prepareComment(QCString& qcs)
 /*!
  * parses a function proto
  * @param text function string
- * @param qlist stores the function types
  * @param name points to the function name
  * @param ret Stores the return type
  * @param doc ???
  */
-void VhdlDocGen::parseFuncProto(const char* text,QList<Argument>& qlist,
-    QCString& name,QCString& ret,bool doc)
+void VhdlDocGen::parseFuncProto(const char* text,QCString& name,QCString& ret,bool doc)
 {
-  (void)qlist; //unused
   int index,end;
   QCString s1(text);
   QCString temp;
@@ -1449,44 +1418,43 @@ void VhdlDocGen::formatString(const QCString &s, OutputList& ol,const MemberDef*
  * writes a procedure prototype to the output
  */
 
-void VhdlDocGen::writeProcedureProto(OutputList& ol,const ArgumentListal,const MemberDef* mdef)
+void VhdlDocGen::writeProcedureProto(OutputList& ol,const ArgumentList &al,const MemberDef* mdef)
 {
-  ArgumentListIterator ali(*al);
-  Argument *arg;
   bool sem=FALSE;
-  int len=al->count();
+  int len=al.size();
   ol.docify("( ");
   if (len > 2)
   {
     ol.lineBreak();
   }
-  for (;(arg=ali.current());++ali)
+  for (const Argument &arg : al)
   {
     ol.startBold();
     if (sem && len <3)
       ol.writeChar(',');
 
-    QCString nn=arg->name;
+    QCString nn=arg.name;
     nn+=": ";
 
-    QCString *str=VhdlDocGen::findKeyWord(arg->defval);
-    arg->defval+=" ";
+    QCString defval = arg.defval;
+    QCString *str=VhdlDocGen::findKeyWord(defval);
+    defval+=" ";
     if (str)
     {
-      startFonts(arg->defval,str->data(),ol);
+      startFonts(defval,str->data(),ol);
     }
     else
     {
-      startFonts(arg->defval,"vhdlchar",ol); // write type (variable,constant etc.)
+      startFonts(defval,"vhdlchar",ol); // write type (variable,constant etc.)
     }
 
     startFonts(nn,"vhdlchar",ol); // write name
-    if (qstricmp(arg->attrib,arg->type) != 0)
+    if (qstricmp(arg.attrib,arg.type) != 0)
     {
-      startFonts(arg->attrib.lower(),"stringliteral",ol); // write in|out
+      startFonts(arg.attrib.lower(),"stringliteral",ol); // write in|out
     }
     ol.docify(" ");
-    VhdlDocGen::formatString(arg->type,ol,mdef);
+    VhdlDocGen::formatString(arg.type,ol,mdef);
     sem=TRUE;
     ol.endBold();
     if (len > 2)
@@ -1505,13 +1473,11 @@ void VhdlDocGen::writeProcedureProto(OutputList& ol,const ArgumentList* al,const
  * writes a function prototype to the output
  */
 
-void VhdlDocGen::writeFunctionProto(OutputList& ol,const ArgumentListal,const MemberDef* mdef)
+void VhdlDocGen::writeFunctionProto(OutputList& ol,const ArgumentList &al,const MemberDef* mdef)
 {
-  if (al==0) return;
-  ArgumentListIterator ali(*al);
-  Argument *arg;
+  if (!al.hasParameters()) return;
   bool sem=FALSE;
-  int len=al->count();
+  int len=al.size();
   ol.startBold();
   ol.docify(" ( ");
   ol.endBold();
@@ -1519,10 +1485,10 @@ void VhdlDocGen::writeFunctionProto(OutputList& ol,const ArgumentList* al,const
   {
     ol.lineBreak();
   }
-  for (;(arg=ali.current());++ali)
+  for (const Argument &arg : al)
   {
     ol.startBold();
-    QCString att=arg->defval;
+    QCString att=arg.defval;
     bool bGen=att.stripPrefix("gen!");
 
     if (sem && len < 3)
@@ -1544,9 +1510,9 @@ void VhdlDocGen::writeFunctionProto(OutputList& ol,const ArgumentList* al,const
         startFonts(att,"vhdlchar",ol);
     }
 
-    QCString nn=arg->name;
+    QCString nn=arg.name;
     nn+=": ";
-    QCString ss=arg->type.stripWhiteSpace(); //.lower();
+    QCString ss=arg.type.stripWhiteSpace(); //.lower();
     QCString w=ss.stripWhiteSpace();//.upper();
     startFonts(nn,"vhdlchar",ol);
     startFonts("in ","stringliteral",ol);
@@ -1556,9 +1522,8 @@ void VhdlDocGen::writeFunctionProto(OutputList& ol,const ArgumentList* al,const
     else
       startFonts(w,"vhdlchar",ol);
 
-    if (arg->attrib)
-      startFonts(arg->attrib,"vhdlchar",ol);
-
+    if (arg.attrib)
+      startFonts(arg.attrib,"vhdlchar",ol);
 
     sem=TRUE;
     ol.endBold();
@@ -1586,21 +1551,19 @@ void VhdlDocGen::writeFunctionProto(OutputList& ol,const ArgumentList* al,const
  * writes a process prototype to the output
  */
 
-void VhdlDocGen::writeProcessProto(OutputList& ol,const ArgumentListal,const MemberDef* mdef)
+void VhdlDocGen::writeProcessProto(OutputList& ol,const ArgumentList &al,const MemberDef* mdef)
 {
-  if (al==0) return;
-  ArgumentListIterator ali(*al);
-  Argument *arg;
+  if (!al.hasParameters()) return;
   bool sem=FALSE;
   ol.startBold();
   ol.docify(" ( ");
-  for (;(arg=ali.current());++ali)
+  for (const Argument &arg : al)
   {
     if (sem)
     {
       ol.docify(" , ");
     }
-    QCString nn=arg->name;
+    QCString nn=arg.name;
     // startFonts(nn,"vhdlchar",ol);
     VhdlDocGen::writeFormatString(nn,ol,mdef);
     sem=TRUE;
@@ -1617,15 +1580,13 @@ void VhdlDocGen::writeProcessProto(OutputList& ol,const ArgumentList* al,const M
 bool VhdlDocGen::writeFuncProcDocu(
     const MemberDef *md,
     OutputList& ol,
-    const ArgumentListal,
+    const ArgumentList &al,
     bool /*type*/)
 {
-  if (al==0) return FALSE;
   //bool sem=FALSE;
   ol.enableAll();
 
-  ArgumentListIterator ali(*al);
-  int index=ali.count();
+  int index=al.size();
   if (index==0)
   {
     ol.docify(" ( ) ");
@@ -1634,13 +1595,12 @@ bool VhdlDocGen::writeFuncProcDocu(
   ol.endMemberDocName();
   ol.startParameterList(TRUE);
   //ol.startParameterName(FALSE);
-  Argument *arg;
   bool first=TRUE;
-  for (;(arg=ali.current());++ali)
+  for (const Argument &arg : al)
   {
     ol.startParameterType(first,"");
     //   if (first) ol.writeChar('(');
-    QCString attl=arg->defval;
+    QCString attl=arg.defval;
     bool bGen=attl.stripPrefix("gen!");
     if (bGen)
       VhdlDocGen::writeFormatString(QCString("generic "),ol,md);
@@ -1648,17 +1608,17 @@ bool VhdlDocGen::writeFuncProcDocu(
 
     if (VhdlDocGen::isProcedure(md))
     {
-      startFonts(arg->defval,"keywordtype",ol);
+      startFonts(arg.defval,"keywordtype",ol);
       ol.docify(" ");
     }
     ol.endParameterType();
 
     ol.startParameterName(TRUE);
-    VhdlDocGen::writeFormatString(arg->name,ol,md);
+    VhdlDocGen::writeFormatString(arg.name,ol,md);
 
     if (VhdlDocGen::isProcedure(md))
     {
-      startFonts(arg->attrib,"stringliteral",ol);
+      startFonts(arg.attrib,"stringliteral",ol);
     }
     else if (VhdlDocGen::isVhdlFunction(md))
     {
@@ -1671,8 +1631,8 @@ bool VhdlDocGen::writeFuncProcDocu(
     ol.enable(OutputGenerator::Man);
     if (!VhdlDocGen::isProcess(md))
     {
-     // startFonts(arg->type,"vhdlkeyword",ol);
-               VhdlDocGen::writeFormatString(arg->type,ol,md);
+     // startFonts(arg.type,"vhdlkeyword",ol);
+               VhdlDocGen::writeFormatString(arg.type,ol,md);
     }
     ol.disable(OutputGenerator::Man);
     ol.endEmphasis();
@@ -1701,28 +1661,26 @@ bool VhdlDocGen::writeFuncProcDocu(
 
 
 
-QCString VhdlDocGen::convertArgumentListToString(const ArgumentListal,bool func)
+QCString VhdlDocGen::convertArgumentListToString(const ArgumentList &al,bool func)
 {
   QCString argString;
   bool sem=FALSE;
-  ArgumentListIterator ali(*al);
-  Argument *arg;
 
-  for (;(arg=ali.current());++ali)
+  for (const Argument &arg : al)
   {
     if (sem) argString.append(", ");
     if (func)
     {
-      argString+=arg->name;
+      argString+=arg.name;
       argString+=":";
-      argString+=arg->type;
+      argString+=arg.type;
     }
     else
     {
-      argString+=arg->defval+" ";
-      argString+=arg->name+" :";
-      argString+=arg->attrib+" ";
-      argString+=arg->type;
+      argString+=arg.defval+" ";
+      argString+=arg.name+" :";
+      argString+=arg.attrib+" ";
+      argString+=arg.type;
     }
     sem=TRUE;
   }
@@ -2002,7 +1960,7 @@ void VhdlDocGen::writeVHDLDeclaration(const MemberDef* mdef,OutputList &ol,
   QCString ltype(mdef->typeString());
   QCString largs(mdef->argsString());
   ClassDef *kl=0;
-  const ArgumentList *alp = mdef->argumentList();
+  const ArgumentList &al = mdef->argumentList();
   QCString nn;
   //VhdlDocGen::adjustRecordMember(mdef);
   if (gd) gd=0;
@@ -2020,11 +1978,11 @@ void VhdlDocGen::writeVHDLDeclaration(const MemberDef* mdef,OutputList &ol,
       ol.docify(" ");
 
       writeLink(mdef,ol);
-      if (alp!=0 && mm==VhdlDocGen::FUNCTION)
-        VhdlDocGen::writeFunctionProto(ol,alp,mdef);
+      if (al.hasParameters() && mm==VhdlDocGen::FUNCTION)
+        VhdlDocGen::writeFunctionProto(ol,al,mdef);
 
-      if (alp!=0 && mm==VhdlDocGen::PROCEDURE)
-        VhdlDocGen::writeProcedureProto(ol,alp,mdef);
+      if (al.hasParameters() && mm==VhdlDocGen::PROCEDURE)
+        VhdlDocGen::writeProcedureProto(ol,al,mdef);
 
       break;
     case VhdlDocGen::USE:
@@ -2089,7 +2047,7 @@ void VhdlDocGen::writeVHDLDeclaration(const MemberDef* mdef,OutputList &ol,
     case VhdlDocGen::PROCESS:
       writeLink(mdef,ol);
       ol.insertMemberAlign();
-      VhdlDocGen::writeProcessProto(ol,alp,mdef);
+      VhdlDocGen::writeProcessProto(ol,al,mdef);
       break;
     case VhdlDocGen::PACKAGE:
     case VhdlDocGen::ENTITY:
@@ -2421,7 +2379,7 @@ void VhdlDocGen::writeStringLink(const MemberDef *mdef,QCString mem, OutputList&
 
 void VhdlDocGen::writeSource(const MemberDef *mdef,OutputList& ol,const QCString & cname)
 {
-  ParserInterface *pIntf = Doxygen::parserManager->getParser(".vhd");
+  CodeParserInterface &intf = Doxygen::parserManager->getCodeParser(".vhd");
  // pIntf->resetCodeParserState();
 
   QCString codeFragment=mdef->documentation();
@@ -2447,7 +2405,7 @@ void VhdlDocGen::writeSource(const MemberDef *mdef,OutputList& ol,const QCString
   codeFragment.prepend("\n");
   ol.pushGeneratorState();
   ol.startCodeFragment();
-  pIntf->parseCode(ol,                   // codeOutIntf
+  intf.parseCode(      ol,               // codeOutIntf
                        0,                // scope
                        codeFragment,     // input
                        SrcLangExt_VHDL,  // lang
@@ -2577,7 +2535,7 @@ static void initUCF(Entry* root,const char*  type,QCString &  qcs,int line,QCStr
 
   qcs.stripPrefix("=");
 
-  Entry* current=new Entry;
+  std::shared_ptr<Entry> current = std::make_shared<Entry>();
   current->spec=VhdlDocGen::UCF_CONST;
   current->section=Entry::VARIABLE_SEC;
   current->bodyLine=line;
@@ -2604,7 +2562,7 @@ static void initUCF(Entry* root,const char*  type,QCString &  qcs,int line,QCStr
     brief.resize(0);
   }
 
-  root->addSubEntry(current);
+  root->moveToSubEntryAndKeep(current);
 }
 
 
@@ -2761,9 +2719,6 @@ QCString  VhdlDocGen::parseForBinding(QCString & entity,QCString & arch)
 
 void assignBinding(VhdlConfNode * conf)
 {
-  QList<Entry> instList=getVhdlInstList();
-  QListIterator<Entry> eli(instList);
-  Entry *cur=0;
   ClassDef *archClass=0,*entClass=0;
   QCString archName;
   QCString arcBind,entBind;
@@ -2826,7 +2781,7 @@ void assignBinding(VhdlConfNode * conf)
   all=allOt.lower()=="all" ;
   others= allOt.lower()=="others";
 
-  for (;(cur=eli.current());++eli)
+  for (const auto &cur : getVhdlInstList())
   {
     if (cur->exception.lower()==label || conf->isInlineConf)
     {
@@ -2909,11 +2864,7 @@ void VhdlDocGen::computeVhdlComponentRelations()
     assignBinding(conf);
   }
 
-  QList<Entry> qsl= getVhdlInstList();
-  QListIterator<Entry> eli(qsl);
-  Entry *cur;
-
-  for (eli.toFirst();(cur=eli.current());++eli)
+  for (const auto &cur : getVhdlInstList())
   {
     if (cur->stat ) //  was bind
     {
@@ -2949,7 +2900,7 @@ void VhdlDocGen::computeVhdlComponentRelations()
 }
 
 static void addInstance(ClassDef* classEntity, ClassDef* ar,
-                        ClassDef *cd , Entry *cur,ClassDef* /*archBind*/)
+                        ClassDef *cd , const std::shared_ptr<Entry> &cur)
 {
 
   QCString bName,n1;
@@ -2990,8 +2941,8 @@ ferr:
       n1,uu,uu, 0,
       Public, Normal, cur->stat,Member,
       MemberType_Variable,
-      0,
-      0,
+      ArgumentList(),
+      ArgumentList(),
       "");
 
   if (ar->getOutputFileBase())
@@ -3183,13 +3134,13 @@ void VhdlDocGen::createFlowChart(const MemberDef *mdef)
   bool b=readCodeFragment( fd->absFilePath().data(), actualStart,actualEnd,codeFragment);
   if (!b) return;
 
-  VHDLLanguageScanner *pIntf =(VHDLLanguageScanner*) Doxygen::parserManager->getParser(".vhd");
+  VHDLOutlineParser &intf =dynamic_cast<VHDLOutlineParser&>(Doxygen::parserManager->getOutlineParser(".vhd"));
   VhdlDocGen::setFlowMember(mdef);
-  Entry root;
+  std::shared_ptr<Entry> root = std::make_shared<Entry>();
   QStrList filesInSameTu;
-  pIntf->startTranslationUnit("");
-  pIntf->parseInput("",codeFragment.data(),&root,FALSE,filesInSameTu);
-  pIntf->finishTranslationUnit();
+  intf.startTranslationUnit("");
+  intf.parseInput("",codeFragment.data(),root,FALSE,filesInSameTu);
+  intf.finishTranslationUnit();
 }
 
 void VhdlDocGen::resetCodeVhdlParserState()
@@ -3845,7 +3796,7 @@ void FlowChart::createSVG()
 
   QCString vlargs="-Tsvg \""+ov+"\" "+dir ;
 
-  if (portable_system(Config_getString(DOT_PATH) + "dot",vlargs)!=0)
+  if (Portable::system(Config_getString(DOT_PATH) + "dot",vlargs)!=0)
   {
     err("could not create dot file");
   }
@@ -4061,34 +4012,30 @@ void FlowChart::writeEdge(FTextStream &t,int fl_from,int fl_to,int i,bool bFrom,
   t << "\n";
 }
 
-void FlowChart::alignFuncProc( QCString & q,const ArgumentListal,bool isFunc)
+void FlowChart::alignFuncProc( QCString & q,const ArgumentList &al,bool isFunc)
 {
-  if (al==0) return;
-
-  ArgumentListIterator ali(*al);
-  int index=ali.count();
+  int index=al.size();
   if (index==0) return;
 
   int len=q.length()+VhdlDocGen::getFlowMember()->name().length();
   QCString prev,temp;
   prev.fill(' ',len+1);
 
-  Argument *arg;
   q+="\n";
-  for (;(arg=ali.current());++ali)
+  for (const Argument &arg : al)
   {
-    QCString attl=arg->defval+" ";
-    attl+=arg->name+" ";
+    QCString attl=arg.defval+" ";
+    attl+=arg.name+" ";
 
     if (!isFunc)
     {
-      attl+=arg->attrib+" ";
+      attl+=arg.attrib+" ";
     }
     else
     {
       attl+=" in ";
     }
-    attl+=arg->type;
+    attl+=arg.type;
     if (--index) attl+=",\n"; else attl+="\n";
 
     attl.prepend(prev.data());
@@ -4365,42 +4312,3 @@ void FlowChart::writeFlowLinks(FTextStream &t)
 } //writeFlowLinks
 
 
-void VHDLLanguageScanner::parseCode(CodeOutputInterface &codeOutIntf,
-    const char *scopeName,
-    const QCString &input,
-    SrcLangExt, // lang
-    bool isExampleBlock,
-    const char *exampleName,
-    FileDef *fileDef,
-    int startLine,
-    int endLine,
-    bool inlineFragment,
-    const MemberDef *memberDef,
-    bool showLineNumbers,
-    const Definition *searchCtx,
-    bool collectXRefs
-    )
-{
-
-parseVhdlCode(codeOutIntf,
-                 scopeName,
-                  input,
-                  isExampleBlock,
-                  exampleName,
-                  fileDef,
-                  startLine,
-                  endLine,
-                  inlineFragment,
-                  memberDef,
-                  showLineNumbers,
-                  searchCtx,
-                  collectXRefs
-
-);
-
-
-
-
-
-
-}// class
index e2c843c..6203196 100644 (file)
@@ -95,7 +95,6 @@ class VhdlDocGen
     static bool     deleteCharRev(QCString &s,char c);
     static void     deleteAllChars(QCString &s,char c);
     static void     parseFuncProto(const char* text,
-                                   QList<Argument>& , 
                                    QCString& name,
                                    QCString& ret,
                                    bool doc=false);
@@ -113,9 +112,8 @@ class VhdlDocGen
                                 const QCString& key,
                                 MemberListType type);
     static ClassDef *getClass(const char *name);
-    static MemberDef* findFunction(const QList<Argument> &ql,
-                                   const QCString& name,
-                                   const QCString& package, bool type);
+    static MemberDef* findFunction(const QCString& name,
+                                   const QCString& package);
     static QCString getClassTitle(const ClassDef*);
     static void writeInlineClassLink(const ClassDef*,
                                      OutputList &ol);
@@ -155,11 +153,11 @@ class VhdlDocGen
     static void formatString(const QCString&,OutputList& ol,const MemberDef*);
 
     static void writeFormatString(const QCString&,OutputList& ol,const MemberDef*);
-    static void writeFunctionProto(OutputList& ol,const ArgumentList *al,const MemberDef*);
-    static void writeProcessProto(OutputList& ol,const ArgumentList *al,const MemberDef*);
-    static void writeProcedureProto(OutputList& ol, const ArgumentList *al,const MemberDef*);
-    static bool writeFuncProcDocu(const MemberDef *mdef, OutputList& ol,const ArgumentListal,bool type=false);
-    static void writeRecordProto(const MemberDef *mdef, OutputList& ol,const ArgumentList *al);
+    static void writeFunctionProto(OutputList& ol,const ArgumentList &al,const MemberDef*);
+    static void writeProcessProto(OutputList& ol,const ArgumentList &al,const MemberDef*);
+    static void writeProcedureProto(OutputList& ol, const ArgumentList &al,const MemberDef*);
+    static bool writeFuncProcDocu(const MemberDef *mdef, OutputList& ol,const ArgumentList &al,bool type=false);
+    static void writeRecordProto(const MemberDef *mdef, OutputList& ol,const ArgumentList &al);
 
     static bool writeVHDLTypeDocumentation(const MemberDef* mdef, const Definition* d, OutputList &ol);
 
@@ -179,7 +177,7 @@ class VhdlDocGen
 
     static bool writeClassType(const ClassDef *,OutputList &ol ,QCString & cname);
 
-    static QCString convertArgumentListToString(const ArgumentListal,bool f);
+    static QCString convertArgumentListToString(const ArgumentList &al,bool f);
     static QCString getProcessNumber();
     static QCString getRecordNumber();
    
@@ -196,7 +194,6 @@ class VhdlDocGen
     static void correctMemberProperties(MemberDef *md);
     
     static void writeSource(const MemberDef *mdef,OutputList& ol,const QCString & cname);
-    static void writeAlphbeticalClass(OutputList& ol,const ClassDef* cd,const QCString &);
 
     static QCString  parseForConfig(QCString & entity,QCString & arch);
     static QCString  parseForBinding(QCString & entity,QCString & arch);
@@ -225,7 +222,7 @@ class VhdlDocGen
 
   private:
     static void findAllArchitectures(QList<QCString>& ql,const ClassDef *cd);
-    static bool compareArgList(ArgumentList*,ArgumentList*);
+    static bool compareArgList(const ArgumentList &,const ArgumentList &);
     static void writeVhdlLink(const ClassDef* cdd ,OutputList& ol,QCString& type,QCString& name,QCString& beh);
     static void writeStringLink(const MemberDef *mdef,QCString mem,OutputList& ol);
     static void writeRecUnitDocu( const MemberDef *md, OutputList& ol,QCString largs);
@@ -294,7 +291,7 @@ class FlowChart
     static void moveToPrevLevel();
     static int getTimeStamp();
     static void writeFlowChart();
-    static void alignFuncProc(QCString & q,const ArgumentList*  al,bool isFunc);
+    static void alignFuncProc(QCString & q,const ArgumentList &al,bool isFunc);
     static QCString convertNameToFileName();
     static void printNode(const FlowChart* n);
     static void printFlowTree();
@@ -310,11 +307,11 @@ class FlowChart
     ~FlowChart();
 
 private:
-    int id;
-    int stamp;
-    int type;
+    int id = 0;
+    int stamp = 0;
+    int type = 0;
 
-    int line;
+    int line = 0;
 
     QCString label;
     QCString text;
index aeed048..5dfa9f6 100644 (file)
 #include "arguments.h"
 #include "types.h"
 #include "VhdlParserIF.h"
+#include "growbuf.h"
 
 using namespace vhdl::parser;
 using namespace std;
 
-static ParserInterface *g_thisParser;
+static OutlineParserInterface *g_thisParser;
 
 static QCString         yyFileName;
 static int              yyLineNr      = 1;
@@ -48,16 +49,15 @@ static Entry* oldEntry;
 static bool varr=FALSE;
 static QCString varName;
 
-static QList<Entry> instFiles;
-static QList<Entry> libUse;
-static QList<Entry> lineEntry;
+static std::vector< std::shared_ptr<Entry> > instFiles;
+static std::vector< std::shared_ptr<Entry> > libUse;
+static std::vector<Entry*> lineEntry;
 
-Entry*   VhdlParser::currentCompound=0;
 Entry*   VhdlParser::tempEntry=0;
 Entry*   VhdlParser::lastEntity=0  ;
 Entry*   VhdlParser::lastCompound=0  ;
-Entry*   VhdlParser::current=0;
 Entry*   VhdlParser::current_root  = 0;
+std::shared_ptr<Entry> VhdlParser::current=0;
 QCString VhdlParser::compSpec;
 QCString VhdlParser::currName;
 QCString VhdlParser::confName;
@@ -84,13 +84,13 @@ static QCString strComment;
 static int iCodeLen;
 static const char *vhdlFileName = 0;
 
-bool  checkMultiComment(QCString& qcs,int line);
-QList<Entry>* getEntryAtLine(const Entry* ce,int line);
+static bool checkMultiComment(QCString& qcs,int line);
+static void insertEntryAtLine(const Entry* ce,int line);
 
 //-------------------------------------
 
-QList<VhdlConfNode>& getVhdlConfiguration() { return  configL; }
-QList<Entry>& getVhdlInstList() { return  instFiles; }
+const QList<VhdlConfNode>& getVhdlConfiguration() { return  configL; }
+const std::vector<std::shared_ptr<Entry> > &getVhdlInstList() { return  instFiles; }
 
 Entry* getVhdlCompound()
 {
@@ -105,8 +105,8 @@ bool isConstraintFile(const QCString &fileName,const QCString &ext)
 }
 
 
-void VHDLLanguageScanner::parseInput(const char *fileName,const char *fileBuf,Entry *root,
-                          bool ,QStrList&)
+void VHDLOutlineParser::parseInput(const char *fileName,const char *fileBuf,
+                          const std::shared_ptr<Entry> &root, bool ,QStrList&)
 {
   g_thisParser=this;
   bool inLine=false;
@@ -128,34 +128,31 @@ void VHDLLanguageScanner::parseInput(const char *fileName,const char *fileBuf,En
 
   if (xilinx_ucf)
   {
-    VhdlDocGen::parseUCF(fileBuf,root,yyFileName,FALSE);
+    VhdlDocGen::parseUCF(fileBuf,root.get(),yyFileName,FALSE);
     return;
   }
   if (altera_qsf)
   {
-    VhdlDocGen::parseUCF(fileBuf,root,yyFileName,TRUE);
+    VhdlDocGen::parseUCF(fileBuf,root.get(),yyFileName,TRUE);
     return;
   }
-  libUse.setAutoDelete(true);
   yyLineNr=1;
-  VhdlParser::current_root=root;
+  VhdlParser::current_root=root.get();
   VhdlParser::lastCompound=0;
   VhdlParser::lastEntity=0;
-  VhdlParser::currentCompound=0;
   VhdlParser::lastEntity=0;
   oldEntry = 0;
-  VhdlParser::current=new Entry();
-  VhdlParser::initEntry(VhdlParser::current);
+  VhdlParser::current=std::make_shared<Entry>();
+  VhdlParser::initEntry(VhdlParser::current.get());
   Doxygen::docGroup.enterFile(fileName,yyLineNr);
   vhdlFileName = fileName;
   lineParse=new int[200]; // Dimitri: dangerous constant: should be bigger than largest token id in VhdlParserConstants.h
   VhdlParserIF::parseVhdlfile(fileBuf,inLine);
 
-  delete VhdlParser::current;
-  VhdlParser::current=0;
+  VhdlParser::current.reset();
 
   if (!inLine)
-  VhdlParser::mapLibPackage(root);
+  VhdlParser::mapLibPackage(root.get());
 
   delete[] lineParse;
   yyFileName.resize(0);
@@ -173,7 +170,7 @@ void VhdlParser::lineCount(const char* text)
 {
   for (const char* c=text ; *c ; ++c )
   {
-    yyLineNr += (*c == '\n') ;
+    if (*c == '\n') yyLineNr++;
   }
 }
 
@@ -198,34 +195,33 @@ void VhdlParser::initEntry(Entry *e)
 
 void VhdlParser::newEntry()
 {
+  previous = current.get();
   if (current->spec==VhdlDocGen::ENTITY ||
       current->spec==VhdlDocGen::PACKAGE ||
       current->spec==VhdlDocGen::ARCHITECTURE ||
       current->spec==VhdlDocGen::PACKAGE_BODY)
   {
-    current_root->addSubEntry(current);
+    current_root->moveToSubEntryAndRefresh(current);
   }
   else
   {
     if (lastCompound)
     {
-      lastCompound->addSubEntry(current);
+      lastCompound->moveToSubEntryAndRefresh(current);
     }
     else
     {
       if (lastEntity)
       {
-       lastEntity->addSubEntry(current);
+       lastEntity->moveToSubEntryAndRefresh(current);
       }
       else
       {
-       current_root->addSubEntry(current);
+       current_root->moveToSubEntryAndRefresh(current);
       }
     }
   }
-  previous = current;
-  current = new Entry ;
-  initEntry(current);
+  initEntry(current.get());
 }
 
 void VhdlParser::handleFlowComment(const char* doc)
@@ -259,7 +255,7 @@ void VhdlParser::handleCommentBlock(const char* doc1,bool brief)
 
   Protection protection=Public;
 
-  if (oldEntry==current)
+  if (oldEntry==current.get())
   {
     //printf("\n find pending message  < %s > at line: %d \n ",doc.data(),iDocLine);
     str_doc.doc=doc;
@@ -269,7 +265,7 @@ void VhdlParser::handleCommentBlock(const char* doc1,bool brief)
     return;
   }
 
-  oldEntry=current;
+  oldEntry=current.get();
 
   if (brief)
   {
@@ -293,7 +289,7 @@ void VhdlParser::handleCommentBlock(const char* doc1,bool brief)
   QCString processedDoc = preprocessCommentBlock(doc,yyFileName,iDocLine);
   while (parseCommentBlock(
         g_thisParser,
-        current,
+        current.get(),
         processedDoc, // text
         yyFileName, // file
         iDocLine,   // line of block start
@@ -324,7 +320,7 @@ void VhdlParser::handleCommentBlock(const char* doc1,bool brief)
   strComment.resize(0);
 }
 
-void VHDLLanguageScanner::parsePrototype(const char *text)
+void VHDLOutlineParser::parsePrototype(const char *text)
 {
   varName=text;
   varr=TRUE;
@@ -343,27 +339,25 @@ void VhdlParser::addCompInst(const char *n, const char* instName, const char* co
   {
     current->args=lastCompound->name;             // architecture name
   }
-  current->includeName=comp;                    // component/enity/configuration
+  current->includeName=comp;                    // component/entity/configuration
   int u=genLabels.find("|",1);
   if (u>0)
   {
     current->write=genLabels.right(genLabels.length()-u);
     current->read=genLabels.left(u);
   }
-  //printf  (" \n genlable: [%s]  inst: [%s]  name: [%s] %d\n",n,instName,comp,iLine);
+  //printf  (" \n genlabel: [%s]  inst: [%s]  name: [%s] %d\n",n,instName,comp,iLine);
 
   if (lastCompound)
   {
     current->args=lastCompound->name;
     if (true) // !findInstant(current->type))
     {
-      initEntry(current);
-      instFiles.append(new Entry(*current));
+      initEntry(current.get());
+      instFiles.emplace_back(std::make_shared<Entry>(*current));
     }
 
-    Entry *temp=current;  // hold  current pointer  (temp=oldEntry)
-    current=new Entry;     // (oldEntry != current)
-    delete  temp;
+    current=std::make_shared<Entry>();
   }
   else
   {
@@ -401,7 +395,7 @@ void VhdlParser::addVhdlType(const char *n,int startLine,int section,
 
     if (!lastCompound && (section==Entry::VARIABLE_SEC) &&  (spec == VhdlDocGen::USE || spec == VhdlDocGen::LIBRARY) )
     {
-      libUse.append(new Entry(*current));
+      libUse.emplace_back(std::make_shared<Entry>(*current));
       current->reset();
     }
     newEntry();
@@ -446,9 +440,9 @@ void VhdlParser::createFunction(const char *imp,uint64 spec,const char *fn)
       QCStringList q1=QCStringList::split(",",fname);
       for (uint ii=0;ii<q1.count();ii++)
       {
-        Argument *arg=new Argument;
-        arg->name=q1[ii];
-        current->argList->append(arg);
+        Argument arg;
+        arg.name=q1[ii];
+        current->argList.push_back(arg);
       }
     }
     return;
@@ -537,7 +531,7 @@ void VhdlParser::addConfigureNode(const char* a,const char*b, bool,bool isLeaf,b
 
 
 void VhdlParser::addProto(const char *s1,const char *s2,const char *s3,
-    const char *s4,const char *s5,const char *s6)
+                          const char *s4,const char *s5,const char *s6)
 {
   (void)s5; // avoid unused warning
   QCString name=s2;
@@ -545,21 +539,21 @@ void VhdlParser::addProto(const char *s1,const char *s2,const char *s3,
 
   for (uint u=0;u<ql.count();u++)
   {
-    Argument *arg=new Argument;
-    arg->name=ql[u];
+    Argument arg;
+    arg.name=ql[u];
     if (s3)
     {
-      arg->type=s3;
+      arg.type=s3;
     }
-    arg->type+=" ";
-    arg->type+=s4;
+    arg.type+=" ";
+    arg.type+=s4;
     if (s6)
     {
-      arg->type+=s6;
+      arg.type+=s6;
     }
     if (parse_sec==GEN_SEC && param_sec==0)
     {
-      arg->defval="gen!";
+      arg.defval="gen!";
     }
 
     if (parse_sec==PARAM_SEC)
@@ -567,10 +561,10 @@ void VhdlParser::addProto(const char *s1,const char *s2,const char *s3,
     //  assert(false);
     }
 
-    arg->defval+=s1;
-    arg->attrib="";//s6;
+    arg.defval+=s1;
+    arg.attrib="";//s6;
 
-    current->argList->append(arg);
+    current->argList.push_back(arg);
     current->args+=s2;
     current->args+=",";
   }
@@ -584,37 +578,36 @@ void VhdlParser::addProto(const char *s1,const char *s2,const char *s3,
  * .....
  * library
  * package
- * enity zzz
+ * entity zzz
  * .....
  * and so on..
  */
 void VhdlParser::mapLibPackage( Entry* root)
 {
-  QList<Entry> epp=libUse;
-  EntryListIterator eli(epp);
-  Entry *rt;
-  for (;(rt=eli.current());++eli)
+  //QList<Entry> epp=libUse;
+  //EntryListIterator eli(epp);
+  //Entry *rt;
+  //for (;(rt=eli.current());++eli)
+  for (const auto &rt : libUse)
   {
     if (addLibUseClause(rt->name))
     {
-      Entry *current;
-      EntryListIterator eLib(*root->children());
       bool bFound=FALSE;
-      for (eLib.toFirst();(current=eLib.current());++eLib)
+      for (const auto &current : root->children())
       {
-        if (VhdlDocGen::isVhdlClass(current))
+        if (VhdlDocGen::isVhdlClass(current.get()))
         {
           if (current->startLine > rt->startLine)
           {
             bFound=TRUE;
-            current->addSubEntry(new Entry(*rt));
+            current->copyToSubEntry(rt);
             break;
           }
         }
       }//for
       if (!bFound)
       {
-        root->addSubEntry(new Entry(*rt));
+        root->copyToSubEntry(rt);
       }
     } //if
   }// for
@@ -718,40 +711,69 @@ void VhdlParser::oneLineComment(QCString qcs)
 
 bool  checkMultiComment(QCString& qcs,int line)
 {
-  QList<Entry> *pTemp=getEntryAtLine(VhdlParser::current_root,line);
+  insertEntryAtLine(VhdlParser::current_root,line);
 
-  if (pTemp->isEmpty()) return false;
+  if (lineEntry.empty()) return false;
 
   VhdlDocGen::prepareComment(qcs);
-  while (!pTemp->isEmpty())
+  while (!lineEntry.empty())
   {
-    Entry *e=(Entry*)pTemp->getFirst();
+    Entry *e=lineEntry.back();
     e->briefLine=line;
     e->brief+=qcs;
 
-    pTemp->removeFirst();
+    lineEntry.pop_back();
   }
   return true;
 }
 
 // returns the vhdl parsed types at line xxx
-QList<Entry>* getEntryAtLine(const Entry* ce,int line)
+void insertEntryAtLine(const Entry* ce,int line)
 {
-  EntryListIterator eli(*ce->children());
-  Entry *rt;
-  for (;(rt=eli.current());++eli)
+  for (const auto &rt : ce->children())
   {
     if (rt->bodyLine==line)
     {
-      lineEntry.insert(0,rt);
+      lineEntry.push_back(rt.get());
     }
 
-    getEntryAtLine(rt,line);
+    insertEntryAtLine(rt.get(),line);
   }
-  return &lineEntry;
 }
 
 const char *getVhdlFileName(void)
 {
   return vhdlFileName;
 }
+
+QCString filter2008VhdlComment(const char *s)
+{
+  GrowBuf growBuf;
+  const char *p=s+3; // skip /*!
+  char c='\0';
+  while (*p == ' ' || *p == '\t') p++;
+  while ((c=*p++))
+  {
+    growBuf.addChar(c);
+    if (c == '\n')
+    {
+      // special handling of space followed by * at beginning of line
+      while (*p == ' ' || *p == '\t') p++;
+      while (*p == '*') p++;
+      // special attention in case character at end is /
+      if (*p == '/') p++;
+    }
+  }
+  // special attention in case */ at end of last line
+  int len = growBuf.getPos();
+  if (growBuf.at(len-1) == '/' && growBuf.at(len-2) == '*')
+  {
+    len -= 2;
+    while (growBuf.at(len-1) == '*') len--;
+    c = growBuf.at(len-1);
+    while ((c = growBuf.at(len-1)) == ' ' || c == '\t') len--;
+    growBuf.setPos(len);
+  }
+  growBuf.addChar(0);
+  return growBuf.get();
+}
index fffea47..f3e7d70 100644 (file)
@@ -1,6 +1,9 @@
 #ifndef VHDLJJPARSER_H
 #define VHDLJJPARSER_H
 
+#include <vector>
+#include <memory>
+
 #include "parserintf.h"
 #include <stdio.h>
 #include <stdlib.h>
@@ -27,7 +30,6 @@ void  parserVhdlfile(const char* inputBuffer);
 
 class Entry;
 class ClassSDict;
-class FileStorage;
 class ClassDef;
 class MemberDef;
 struct VhdlConfNode;
@@ -37,36 +39,20 @@ struct VhdlConfNode;
  *
  * This is the VHDL language parser for doxygen.
  */
-class VHDLLanguageScanner : public ParserInterface
+class VHDLOutlineParser : public OutlineParserInterface
 {
   public:
-    virtual ~VHDLLanguageScanner() {}
+    virtual ~VHDLOutlineParser() {}
     void startTranslationUnit(const char *) {}
     void finishTranslationUnit() {}
     void parseInput(const char * fileName,
                     const char *fileBuf,
-                    Entry *root,
+                    const std::shared_ptr<Entry> &root,
                     bool sameTranslationUnit,
                     QStrList &filesInSameTranslationUnit);
-  
- void parseCode(CodeOutputInterface &codeOutIntf,
-                   const char *scopeName,
-                   const QCString &input,
-                   SrcLangExt lang,
-                   bool isExampleBlock,
-                   const char *exampleName=0,
-                   FileDef *fileDef=0,
-                   int startLine=-1,
-                   int endLine=-1,
-                   bool inlineFragment=FALSE,
-                   const MemberDef *memberDef=0,
-                   bool showLineNumbers=TRUE,
-                   const Definition *searchCtx=0,
-                   bool collectXRefs=TRUE
-                                  );
-               bool needsPreprocessing(const QCString &) { return TRUE; }
-               void resetCodeParserState(){};
-           void parsePrototype(const char *text);
+
+    bool needsPreprocessing(const QCString &) const { return TRUE; }
+    void parsePrototype(const char *text);
 };
 
 struct VhdlConfNode
@@ -75,7 +61,7 @@ struct VhdlConfNode
   { 
     arch=a;              // architecture  e.g. for iobuffer
     arch=arch.lower();
-    binding=b;           // binding e.g.  use entiy work.xxx(bev)
+    binding=b;           // binding e.g.  use entity work.xxx(bev)
     binding=binding.lower();
     confVhdl=config;     // configuration foo is bar
     compSpec=cs;        
@@ -87,15 +73,15 @@ struct VhdlConfNode
   QCString arch;
   QCString binding;
   QCString compSpec;
-  int level;
-  bool isLeaf;
-  bool isInlineConf;
+  int level = 0;
+  bool isLeaf = false;
+  bool isInlineConf = false;
 
 };
 
 void vhdlscanFreeScanner();
 
-QList<VhdlConfNode>& getVhdlConfiguration();
-QList<Entry>& getVhdlInstList();
-
+const QList<VhdlConfNode>& getVhdlConfiguration();
+const std::vector<std::shared_ptr<Entry> >&getVhdlInstList();
+QCString filter2008VhdlComment(const char *s);
 #endif
index e463866..4cada9b 100644 (file)
@@ -19,7 +19,7 @@
 #ifndef XMLCODE_H
 #define XMLCODE_H
 
-#include "types.h"
+#include "parserintf.h"
 
 class CodeOutputInterface;
 class FileDef;
@@ -27,11 +27,28 @@ class MemberDef;
 class QCString;
 class Definition;
 
-extern void parseXmlCode(CodeOutputInterface &,const char *,const QCString &,
-             bool ,const char *,FileDef *fd,
-            int startLine,int endLine,bool inlineFragment,
-             const MemberDef *memberDef,bool showLineNumbers,const Definition *searchCtx,
-             bool collectXRefs);
-extern void resetXmlCodeParserState();
+/** XML scanner. Only support syntax highlighting of code at the moment.
+ */
+class XMLCodeParser : public CodeParserInterface
+{
+  public:
+    void parseCode(CodeOutputInterface &codeOutIntf,
+                   const char *scopeName,
+                   const QCString &input,
+                   SrcLangExt,
+                   bool isExampleBlock,
+                   const char *exampleName=0,
+                   FileDef *fileDef=0,
+                   int startLine=-1,
+                   int endLine=-1,
+                   bool inlineFragment=FALSE,
+                   const MemberDef *memberDef=0,
+                   bool showLineNumbers=TRUE,
+                   const Definition *searchCtx=0,
+                   bool collectXRefs=TRUE
+                  );
+    void resetCodeParserState();
+};
+
 
 #endif
index 42218b1..94548f8 100644 (file)
@@ -69,6 +69,8 @@ static MemberDef *   g_currentMemberDef;
 static bool          g_includeCodeFragment;
 static const char *  g_currentFontClass;
 
+static const char *stateToString(int state);
+
 static void codify(const char* text) 
 { 
   g_code->codify(text);
@@ -405,11 +407,32 @@ void resetXmlCodeParserState()
   g_currentMemberDef = 0;
 }
 
-#if !defined(YY_FLEX_SUBMINOR_VERSION) 
-extern "C" { // some bogus code to keep the compiler happy
-  void xmlcodeYYdummy() { yy_flex_realloc(0,0); } 
+//----------------------------------------------------------------------------
+
+void XMLCodeParser::parseCode(CodeOutputInterface &codeOutIntf,
+               const char *scopeName,
+               const QCString &input,
+               SrcLangExt,
+               bool isExampleBlock,
+               const char *exampleName,
+               FileDef *fileDef,
+               int startLine,
+               int endLine,
+               bool inlineFragment,
+               const MemberDef *memberDef,
+               bool showLineNumbers,
+               const Definition *searchCtx,
+               bool collectXRefs
+              )
+{
+  parseXmlCode(codeOutIntf,scopeName,input,isExampleBlock,exampleName,
+                fileDef,startLine,endLine,inlineFragment,memberDef,
+                showLineNumbers,searchCtx,collectXRefs);
+}
+
+void XMLCodeParser::resetCodeParserState()
+{
+  resetXmlCodeParserState();
 }
-#elif YY_FLEX_MAJOR_VERSION<=2 && YY_FLEX_MINOR_VERSION<=5 && YY_FLEX_SUBMINOR_VERSION<33
-#error "You seem to be using a version of flex newer than 2.5.4. These are currently incompatible with 2.5.4, and do NOT work with doxygen! Please use version 2.5.4 or expect things to be parsed wrongly! A bug report has been submitted (#732132)."
-#endif
 
+#include "xmlcode.l.h"
index a0afa9d..409c2fe 100644 (file)
@@ -187,6 +187,9 @@ void XmlDocVisitor::visit(DocStyleChange *s)
     case DocStyleChange::Bold:
       if (s->enable()) m_t << "<bold>";      else m_t << "</bold>";
       break;
+    case DocStyleChange::S:
+      if (s->enable()) m_t << "<s>";      else m_t << "</s>";
+      break;
     case DocStyleChange::Strike:
       if (s->enable()) m_t << "<strike>";      else m_t << "</strike>";
       break;
@@ -251,8 +254,8 @@ void XmlDocVisitor::visit(DocVerbatim *s)
           m_t << " filename=\"" << lang << "\">";
       else
           m_t << ">";
-      Doxygen::parserManager->getParser(lang)
-                            ->parseCode(m_ci,s->context(),s->text(),langExt,
+      Doxygen::parserManager->getCodeParser(lang)
+                             .parseCode(m_ci,s->context(),s->text(),langExt,
                                         s->isExample(),s->exampleFile());
       m_t << "</programlisting>"; 
       break;
@@ -306,8 +309,8 @@ void XmlDocVisitor::visit(DocInclude *inc)
          m_t << "<programlisting filename=\"" << inc->file() << "\">";
          QFileInfo cfi( inc->file() );
          FileDef *fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
-         Doxygen::parserManager->getParser(inc->extension())
-                               ->parseCode(m_ci,inc->context(),
+         Doxygen::parserManager->getCodeParser(inc->extension())
+                                .parseCode(m_ci,inc->context(),
                                            inc->text(),
                                            langExt,
                                            inc->isExample(),
@@ -325,8 +328,8 @@ void XmlDocVisitor::visit(DocInclude *inc)
       break;    
     case DocInclude::Include: 
       m_t << "<programlisting filename=\"" << inc->file() << "\">";
-      Doxygen::parserManager->getParser(inc->extension())
-                            ->parseCode(m_ci,inc->context(),
+      Doxygen::parserManager->getCodeParser(inc->extension())
+                             .parseCode(m_ci,inc->context(),
                                         inc->text(),
                                         langExt,
                                         inc->isExample(),
@@ -367,8 +370,8 @@ void XmlDocVisitor::visit(DocInclude *inc)
       break;
     case DocInclude::Snippet:
       m_t << "<programlisting filename=\"" << inc->file() << "\">";
-      Doxygen::parserManager->getParser(inc->extension())
-                            ->parseCode(m_ci,
+      Doxygen::parserManager->getCodeParser(inc->extension())
+                             .parseCode(m_ci,
                                         inc->context(),
                                         extractBlock(inc->text(),inc->blockId()),
                                         langExt,
@@ -382,8 +385,8 @@ void XmlDocVisitor::visit(DocInclude *inc)
          m_t << "<programlisting filename=\"" << inc->file() << "\">";
          QFileInfo cfi( inc->file() );
          FileDef *fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
-         Doxygen::parserManager->getParser(inc->extension())
-                               ->parseCode(m_ci,
+         Doxygen::parserManager->getCodeParser(inc->extension())
+                                .parseCode(m_ci,
                                            inc->context(),
                                            extractBlock(inc->text(),inc->blockId()),
                                            langExt,
@@ -436,8 +439,8 @@ void XmlDocVisitor::visit(DocIncOperator *op)
         fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() );
       }
 
-      Doxygen::parserManager->getParser(locLangExt)
-                            ->parseCode(m_ci,op->context(),
+      Doxygen::parserManager->getCodeParser(locLangExt)
+                             .parseCode(m_ci,op->context(),
                                         op->text(),langExt,op->isExample(),
                                         op->exampleFile(),
                                         fd,     // fileDef
index d05adf0..bf5af84 100644 (file)
@@ -338,43 +338,41 @@ void XMLCodeGenerator::finish()
   if (m_insideCodeLine) endCodeLine();
 }
 
-static void writeTemplateArgumentList(const ArgumentList *al,
-                                      FTextStream &t,
+static void writeTemplateArgumentList(FTextStream &t,
+                                      const ArgumentList &al,
                                       const Definition *scope,
                                       const FileDef *fileScope,
                                       int indent)
 {
   QCString indentStr;
   indentStr.fill(' ',indent);
-  if (al)
+  if (al.hasParameters())
   {
     t << indentStr << "<templateparamlist>" << endl;
-    ArgumentListIterator ali(*al);
-    const Argument *a;
-    for (ali.toFirst();(a=ali.current());++ali)
+    for (const Argument &a : al)
     {
       t << indentStr << "  <param>" << endl;
-      if (!a->type.isEmpty())
+      if (!a.type.isEmpty())
       {
         t << indentStr <<  "    <type>";
-        linkifyText(TextGeneratorXMLImpl(t),scope,fileScope,0,a->type);
+        linkifyText(TextGeneratorXMLImpl(t),scope,fileScope,0,a.type);
         t << "</type>" << endl;
       }
-      if (!a->name.isEmpty())
+      if (!a.name.isEmpty())
       {
-        t << indentStr <<  "    <declname>" << convertToXML(a->name) << "</declname>" << endl;
-        t << indentStr <<  "    <defname>" << convertToXML(a->name) << "</defname>" << endl;
+        t << indentStr <<  "    <declname>" << convertToXML(a.name) << "</declname>" << endl;
+        t << indentStr <<  "    <defname>" << convertToXML(a.name) << "</defname>" << endl;
       }
-      if (!a->defval.isEmpty())
+      if (!a.defval.isEmpty())
       {
         t << indentStr << "    <defval>";
-        linkifyText(TextGeneratorXMLImpl(t),scope,fileScope,0,a->defval);
+        linkifyText(TextGeneratorXMLImpl(t),scope,fileScope,0,a.defval);
         t << "</defval>" << endl;
       }
-      if (!a->typeConstraint.isEmpty())
+      if (!a.typeConstraint.isEmpty())
       {
         t << indentStr << "    <typeconstraint>";
-        linkifyText(TextGeneratorXMLImpl(t),scope,fileScope,0,a->typeConstraint);
+        linkifyText(TextGeneratorXMLImpl(t),scope,fileScope,0,a.typeConstraint);
         t << "</typeconstraint>" << endl;
       }
       t << indentStr << "  </param>" << endl;
@@ -385,16 +383,12 @@ static void writeTemplateArgumentList(const ArgumentList *al,
 
 static void writeMemberTemplateLists(const MemberDef *md,FTextStream &t)
 {
-  const ArgumentList *templMd = md->templateArguments();
-  if (templMd) // function template prefix
-  {
-    writeTemplateArgumentList(templMd,t,md->getClassDef(),md->getFileDef(),8);
-  }
+  writeTemplateArgumentList(t,md->templateArguments(),md->getClassDef(),md->getFileDef(),8);
 }
 
 static void writeTemplateList(const ClassDef *cd,FTextStream &t)
 {
-  writeTemplateArgumentList(cd->templateArguments(),t,cd,0,4);
+  writeTemplateArgumentList(t,cd->templateArguments(),cd,0,4);
 }
 
 static void writeXMLDocBlock(FTextStream &t,
@@ -423,11 +417,11 @@ static void writeXMLDocBlock(FTextStream &t,
 
 void writeXMLCodeBlock(FTextStream &t,FileDef *fd)
 {
-  ParserInterface *pIntf=Doxygen::parserManager->getParser(fd->getDefFileExtension());
+  CodeParserInterface &intf=Doxygen::parserManager->getCodeParser(fd->getDefFileExtension());
   SrcLangExt langExt = getLanguageFromFileName(fd->getDefFileExtension());
-  pIntf->resetCodeParserState();
+  intf.resetCodeParserState();
   XMLCodeGenerator *xmlGen = new XMLCodeGenerator(t);
-  pIntf->parseCode(*xmlGen,  // codeOutIntf
+  intf.parseCode(*xmlGen,    // codeOutIntf
                 0,           // scopeName
                 fileToString(fd->absFilePath(),Config_getBool(FILTER_SOURCE_FILES)),
                 langExt,     // lang
@@ -436,7 +430,7 @@ void writeXMLCodeBlock(FTextStream &t,FileDef *fd)
                 fd,          // fileDef
                 -1,          // startLine
                 -1,          // endLine
-                FALSE,       // inlineFragement
+                FALSE,       // inlineFragment
                 0,           // memberDef
                 TRUE         // showLineNumbers
                 );
@@ -520,7 +514,6 @@ static void generateXMLForMember(const MemberDef *md,FTextStream &ti,FTextStream
   // enum values are written as part of the enum
   if (md->memberType()==MemberType_EnumValue) return;
   if (md->isHidden()) return;
-  //if (md->name().at(0)=='@') return; // anonymous member
 
   // group members are only visible in their group
   //if (def->definitionType()!=Definition::TypeGroup && md->getGroupDef()) return;
@@ -591,9 +584,9 @@ static void generateXMLForMember(const MemberDef *md,FTextStream &ti,FTextStream
 
   if (isFunc)
   {
-    const ArgumentList *al = md->argumentList();
+    const ArgumentList &al = md->argumentList();
     t << " const=\"";
-    if (al!=0 && al->constSpecifier)    t << "yes"; else t << "no"; 
+    if (al.constSpecifier)    t << "yes"; else t << "no"; 
     t << "\"";
 
     t << " explicit=\"";
@@ -604,10 +597,10 @@ static void generateXMLForMember(const MemberDef *md,FTextStream &ti,FTextStream
     if (md->isInline()) t << "yes"; else t << "no";
     t << "\"";
 
-    if (al!=0 && al->refQualifier!=RefQualifierNone)
+    if (al.refQualifier!=RefQualifierNone)
     {
       t << " refqual=\"";
-      if (al->refQualifier==RefQualifierLValue) t << "lvalue"; else t << "rvalue";
+      if (al.refQualifier==RefQualifierLValue) t << "lvalue"; else t << "rvalue";
       t << "\"";
     }
 
@@ -641,7 +634,7 @@ static void generateXMLForMember(const MemberDef *md,FTextStream &ti,FTextStream
       t << " noexcept=\"yes\"";
     }
 
-    if (al && al->volatileSpecifier)
+    if (al.volatileSpecifier)
     {
       t << " volatile=\"yes\"";
     }
@@ -840,51 +833,55 @@ static void generateXMLForMember(const MemberDef *md,FTextStream &ti,FTextStream
 
   if (isFunc) //function
   {
-    const ArgumentList *declAl = md->declArgumentList();
-    const ArgumentList *defAl = md->argumentList();
-    if (declAl && defAl && declAl->count()>0)
+    const ArgumentList &declAl = md->declArgumentList();
+    const ArgumentList &defAl = md->argumentList();
+    if (declAl.hasParameters())
     {
-      ArgumentListIterator declAli(*declAl);
-      ArgumentListIterator defAli(*defAl);
-      const Argument *a;
-      for (declAli.toFirst();(a=declAli.current());++declAli)
+      auto defIt = defAl.begin();
+      for (const Argument &a : declAl)
       {
-        Argument *defArg = defAli.current();
+        //const Argument *defArg = defAli.current();
+        const Argument *defArg = 0;
+        if (defIt!=defAl.end())
+        {
+          defArg = &(*defIt);
+          ++defIt;
+        }
         t << "        <param>" << endl;
-        if (!a->attrib.isEmpty())
+        if (!a.attrib.isEmpty())
         {
           t << "          <attributes>";
-          writeXMLString(t,a->attrib);
+          writeXMLString(t,a.attrib);
           t << "</attributes>" << endl;
         }
-        if (!a->type.isEmpty())
+        if (!a.type.isEmpty())
         {
           t << "          <type>";
-          linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,a->type);
+          linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,a.type);
           t << "</type>" << endl;
         }
-        if (!a->name.isEmpty())
+        if (!a.name.isEmpty())
         {
           t << "          <declname>";
-          writeXMLString(t,a->name); 
+          writeXMLString(t,a.name); 
           t << "</declname>" << endl;
         }
-        if (defArg && !defArg->name.isEmpty() && defArg->name!=a->name)
+        if (defArg && !defArg->name.isEmpty() && defArg->name!=a.name)
         {
           t << "          <defname>";
           writeXMLString(t,defArg->name);
           t << "</defname>" << endl;
         }
-        if (!a->array.isEmpty())
+        if (!a.array.isEmpty())
         {
           t << "          <array>"; 
-          writeXMLString(t,a->array); 
+          writeXMLString(t,a.array); 
           t << "</array>" << endl;
         }
-        if (!a->defval.isEmpty())
+        if (!a.defval.isEmpty())
         {
           t << "          <defval>";
-          linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,a->defval);
+          linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,a.defval);
           t << "</defval>" << endl;
         }
         if (defArg && defArg->hasDocumentation())
@@ -895,25 +892,22 @@ static void generateXMLForMember(const MemberDef *md,FTextStream &ti,FTextStream
           t << "</briefdescription>" << endl;
         }
         t << "        </param>" << endl;
-        if (defArg) ++defAli;
       }
     }
   }
   else if (md->memberType()==MemberType_Define && 
           md->argsString()) // define
   {
-    if (md->argumentList()->count()==0) // special case for "foo()" to
-                                        // disguish it from "foo".
+    if (md->argumentList().empty())     // special case for "foo()" to
+                                        // distinguish it from "foo".
     {
       t << "        <param></param>" << endl;
     }
     else
     {
-      ArgumentListIterator ali(*md->argumentList());
-      const Argument *a;
-      for (ali.toFirst();(a=ali.current());++ali)
+      for (const Argument &a : md->argumentList())
       {
-        t << "        <param><defname>" << a->type << "</defname></param>" << endl;
+        t << "        <param><defname>" << a.type << "</defname></param>" << endl;
       }
     }
   }
@@ -986,7 +980,7 @@ static void generateXMLForMember(const MemberDef *md,FTextStream &ti,FTextStream
   if (md->getDefLine()!=-1)
   {
     t << "        <location file=\"" 
-      << stripFromPath(md->getDefFileName()) << "\" line=\"" 
+      << convertToXML(stripFromPath(md->getDefFileName())) << "\" line=\""
       << md->getDefLine() << "\" column=\"" 
       << md->getDefColumn() << "\"" ;
     if (md->getStartBodyLine()!=-1)
@@ -994,14 +988,14 @@ static void generateXMLForMember(const MemberDef *md,FTextStream &ti,FTextStream
       FileDef *bodyDef = md->getBodyDef();
       if (bodyDef)
       {
-        t << " bodyfile=\"" << stripFromPath(bodyDef->absFilePath()) << "\"";
+        t << " bodyfile=\"" << convertToXML(stripFromPath(bodyDef->absFilePath())) << "\"";
       }
       t << " bodystart=\"" << md->getStartBodyLine() << "\" bodyend=\"" 
         << md->getEndBodyLine() << "\"";
     }
     if (md->getDeclLine()!=-1)
     {
-      t << " declfile=\"" << stripFromPath(md->getDeclFileName()) << "\" declline=\""
+      t << " declfile=\"" << convertToXML(stripFromPath(md->getDeclFileName())) << "\" declline=\""
         << md->getDeclLine() << "\" declcolumn=\""
         << md->getDeclColumn() << "\"";
     }
@@ -1095,7 +1089,7 @@ static void writeListOfAllMembers(const ClassDef *cd,FTextStream &t)
       for (mii.toFirst();(mi=mii.current());++mii)
       {
         const MemberDef *md=mi->memberDef;
-        if (md->name().at(0)!='@') // skip anonymous members
+        if (!md->isAnonymous())
         {
           Protection prot = mi->prot;
           Specifier virt=md->virtualness();
@@ -1137,7 +1131,7 @@ static void writeInnerClasses(const ClassSDict *cl,FTextStream &t)
     const ClassDef *cd;
     for (cli.toFirst();(cd=cli.current());++cli)
     {
-      if (!cd->isHidden() && cd->name().find('@')==-1) // skip anonymous scopes
+      if (!cd->isHidden() && !cd->isAnonymous())
       {
         t << "    <innerclass refid=\"" << classOutputFileBase(cd)
           << "\" prot=\"";
@@ -1162,7 +1156,7 @@ static void writeInnerNamespaces(const NamespaceSDict *nl,FTextStream &t)
     const NamespaceDef *nd;
     for (nli.toFirst();(nd=nli.current());++nli)
     {
-      if (!nd->isHidden() && nd->name().find('@')==-1) // skip anonymous scopes
+      if (!nd->isHidden() && !nd->isAnonymous())
       {
         t << "    <innernamespace refid=\"" << nd->getOutputFileBase()
           << "\">" << convertToXML(nd->name()) << "</innernamespace>" << endl;
@@ -1252,7 +1246,7 @@ static void generateXMLForClass(const ClassDef *cd,FTextStream &ti)
 
   if (cd->isReference())        return; // skip external references.
   if (cd->isHidden())           return; // skip hidden classes.
-  if (cd->name().find('@')!=-1) return; // skip anonymous compounds.
+  if (cd->isAnonymous())        return; // skip anonymous compounds.
   if (cd->templateMaster()!=0)  return; // skip generated template instances.
   if (cd->isArtificial())       return; // skip artificially created classes
 
@@ -1424,7 +1418,7 @@ static void generateXMLForClass(const ClassDef *cd,FTextStream &ti)
     t << "    </collaborationgraph>" << endl;
   }
   t << "    <location file=\"" 
-    << stripFromPath(cd->getDefFileName()) << "\" line=\"" 
+    << convertToXML(stripFromPath(cd->getDefFileName())) << "\" line=\""
     << cd->getDefLine() << "\"" << " column=\"" 
     << cd->getDefColumn() << "\"" ;
     if (cd->getStartBodyLine()!=-1)
@@ -1432,7 +1426,7 @@ static void generateXMLForClass(const ClassDef *cd,FTextStream &ti)
       FileDef *bodyDef = cd->getBodyDef();
       if (bodyDef)
       {
-        t << " bodyfile=\"" << stripFromPath(bodyDef->absFilePath()) << "\"";
+        t << " bodyfile=\"" << convertToXML(stripFromPath(bodyDef->absFilePath())) << "\"";
       }
       t << " bodystart=\"" << cd->getStartBodyLine() << "\" bodyend=\"" 
         << cd->getEndBodyLine() << "\"";
@@ -1512,7 +1506,7 @@ static void generateXMLForNamespace(const NamespaceDef *nd,FTextStream &ti)
   writeXMLDocBlock(t,nd->docFile(),nd->docLine(),nd,0,nd->documentation());
   t << "    </detaileddescription>" << endl;
   t << "    <location file=\""
-    << stripFromPath(nd->getDefFileName()) << "\" line=\""
+    << convertToXML(stripFromPath(nd->getDefFileName())) << "\" line=\""
     << nd->getDefLine() << "\"" << " column=\""
     << nd->getDefColumn() << "\"/>" << endl ;
   t << "  </compounddef>" << endl;
@@ -1654,7 +1648,7 @@ static void generateXMLForFile(FileDef *fd,FTextStream &ti)
     writeXMLCodeBlock(t,fd);
     t << "    </programlisting>" << endl;
   }
-  t << "    <location file=\"" << stripFromPath(fd->getDefFileName()) << "\"/>" << endl;
+  t << "    <location file=\"" << convertToXML(stripFromPath(fd->getDefFileName())) << "\"/>" << endl;
   t << "  </compounddef>" << endl;
   t << "</doxygen>" << endl;
 
@@ -1768,7 +1762,7 @@ static void generateXMLForDir(DirDef *dd,FTextStream &ti)
   t << "    <detaileddescription>" << endl;
   writeXMLDocBlock(t,dd->docFile(),dd->docLine(),dd,0,dd->documentation());
   t << "    </detaileddescription>" << endl;
-  t << "    <location file=\"" << stripFromPath(dd->name()) << "\"/>" << endl; 
+  t << "    <location file=\"" << convertToXML(stripFromPath(dd->name())) << "\"/>" << endl;
   t << "  </compounddef>" << endl;
   t << "</doxygen>" << endl;
 
diff --git a/src/xmlscanner.h b/src/xmlscanner.h
deleted file mode 100644 (file)
index cb9792c..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/******************************************************************************
- *
- * Copyright (C) 1997-2015 by Dimitri van Heesch.
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation under the terms of the GNU General Public License is hereby 
- * granted. No representations are made about the suitability of this software 
- * for any purpose. It is provided "as is" without express or implied warranty.
- * See the GNU General Public License for more details.
- *
- * Documents produced by Doxygen are derivative works derived from the
- * input used in their production; they are not affected by this license.
- *
- */
-
-#ifndef XMLSCANNER_H
-#define XMLSCANNER_H
-
-#include "parserintf.h"
-#include "xmlcode.h"
-
-/** XML scanner. Only support syntax highlighting of code at the moment.
- */
-class XMLScanner : public ParserInterface
-{
-public:
-    XMLScanner() {}
-    virtual ~XMLScanner() {}
-    void startTranslationUnit(const char *) {}
-    void finishTranslationUnit() {}
-    void parseInput(const char *, const char *, Entry *, bool , QStrList &) {}
-    bool needsPreprocessing(const QCString &) { return FALSE; }
-
-    void parseCode(CodeOutputInterface &codeOutIntf,
-                   const char *scopeName,
-                   const QCString &input,
-                   SrcLangExt,
-                   bool isExampleBlock,
-                   const char *exampleName=0,
-                   FileDef *fileDef=0,
-                   int startLine=-1,
-                   int endLine=-1,
-                   bool inlineFragment=FALSE,
-                   const MemberDef *memberDef=0,
-                   bool showLineNumbers=TRUE,
-                   const Definition *searchCtx=0,
-                   bool collectXRefs=TRUE
-                  )
-    {
-      parseXmlCode(codeOutIntf,scopeName,input,isExampleBlock,exampleName,
-                    fileDef,startLine,endLine,inlineFragment,memberDef,
-                    showLineNumbers,searchCtx,collectXRefs);
-    }
-
-    void resetCodeParserState()
-    {
-      resetXmlCodeParserState();
-    }
-
-    void parsePrototype(const char *) {}
-
-private:
-};
-
-#endif
index 09b7aad..2c9dfd5 100644 (file)
@@ -66,6 +66,11 @@ p.startli, p.startdd {
        margin-top: 2px;
 }
 
+th p.starttd, p.intertd, p.endtd {
+        font-size: 100%;
+        font-weight: 700;
+}
+
 p.starttd {
        margin-top: 0px;
 }
@@ -535,7 +540,7 @@ table.memberdecls {
         white-space: nowrap;
 }
 
-.memItemRight {
+.memItemRight, .memTemplItemRight {
        width: 100%;
 }
 
index a40bdbc..b434d0c 100644 (file)
@@ -98,7 +98,7 @@
 {# write the file sources #}
 {% for compound in fileList %}
   {% with page=compound %}
-    {# TODO: to deal with clang optimisation, we need to write the sources in a different order! #}
+    {# TODO: to deal with clang optimization, we need to write the sources in a different order! #}
     {% if compound.hasSourceFile %}
       {% create compound.sourceFileName|append:config.HTML_FILE_EXTENSION from 'htmlsource.tpl' %}
     {% endif %}
index b5a8cd0..ccb3579 100644 (file)
@@ -1,6 +1,6 @@
 {# obj should be a class or member #}
 {% if obj.typeConstraints %}
-  <div class="typecontraint">
+  <div class="typeconstraint">
   <dl><dt><b>{{ tr.typeConstraints }}</b></dt>
   <dd><table border="0" cellspacing="2" cellpadding="0">
   {% for arg in obj.typeConstraints %}
index f5291d9..a0bb5f4 100644 (file)
@@ -91,6 +91,7 @@ function initResizable()
       }
       collapsedWidth=width;
     }
+    (document.getElementById(location.hash.slice(1))||document.body).scrollIntoView();
   }
 
   function collapseExpand()
index 1fc1544..1cad257 100644 (file)
@@ -23,7 +23,7 @@
  */
 /**
  * The code below is based on SVGPan Library 1.2 and was modified for doxygen
- * to support both zooming and panning via the mouse and via embedded bottons.
+ * to support both zooming and panning via the mouse and via embedded buttons.
  *
  * This code is licensed under the following BSD license:
  *
index bf19901..78a5254 100644 (file)
   \endgroup%
 }
 
-\newcommand{\DoxyHorRuler}{%
+\newcommand{\DoxyHorRuler}[1]{%
   \setlength{\parskip}{0ex plus 0ex minus 0ex}%
-  \hrule%
+  \ifthenelse{#1=0}%
+  {%
+    \hrule%
+  }%
+  {%
+    \hrulefilll%
+  }%
 }
 \newcommand{\DoxyLabelFont}{}
 \newcommand{\entrylabel}[1]{%
@@ -88,7 +94,7 @@
   \end{alltt}%
   \normalsize%
 }
-% Necessary for redefining not defined charcaters, i.e. "Replacement Character" in tex output.
+% Necessary for redefining not defined characters, i.e. "Replacement Character" in tex output.
 \newlength{\CodeWidthChar}
 \newlength{\CodeHeightChar}
 \settowidth{\CodeWidthChar}{?}
index f760aca..60fd7e8 100755 (executable)
@@ -18,7 +18,7 @@
 %% \r
 %%  tabu works in text and in math modes.\r
 %% \r
-%%  X columns: automatic width ajustment + horizontal and vertical alignment\r
+%%  X columns: automatic width adjustment + horizontal and vertical alignment\r
 %%  \begin{tabu}   { X[4c] X[1c] X[-2ml]  }\r
 %% \r
 %%  Horizontal lines and / or leaders:\r
@@ -78,7 +78,7 @@
 \TMP@EnsureCode 58 = 12 % : (for siunitx)\r
 \TMP@EnsureCode124 = 12 % |\r
 \TMP@EnsureCode 36 =  3 % $ = math shift\r
-\TMP@EnsureCode 38 =  4 % & = tab alignmment character\r
+\TMP@EnsureCode 38 =  4 % & = tab alignment character\r
 \TMP@EnsureCode 32 = 10 % space\r
 \TMP@EnsureCode 94 =  7 % ^\r
 \TMP@EnsureCode 95 =  8 % _\r
 }% \tabu@reset\r
 \def\tabu@setsave #1{\expandafter\tabu@sets@ve #1\@nil{#1}}\r
 \long\def\tabu@sets@ve #1\@nil #2{\@temptokena\expandafter{\the\@temptokena \def#2{#1}}}\r
-%% The Rewritting Process -------------------------------------------\r
+%% The Rewriting Process -------------------------------------------\r
 \def\tabu@newcolumntype #1{%\r
     \expandafter\tabu@new@columntype\r
         \csname NC@find@\string#1\expandafter\endcsname\r
    \else #2\tabucolX\r
    \fi\r
 }% \tabu@hsize\r
-%% \usetabu  and  \preamble: rewritting process ---------------------\r
+%% \usetabu  and  \preamble: rewriting process ---------------------\r
 \tabu@privatecolumntype \usetabu [1]{%\r
     \ifx\\#1\\\tabu@saveerr{}\else\r
         \@ifundefined{tabu@saved@\string#1}\r
             {\csname tabu@saved@\string#1\expandafter\endcsname\expandafter\z@}%\r
     \fi\r
 }% \NC@rewrite@\preamble\r
-%% Controlling the rewritting process -------------------------------\r
+%% Controlling the rewriting process -------------------------------\r
 \tabu@newcolumntype \tabu@rewritefirst{%\r
     \iftabu@long    \aftergroup \tabu@longpream  % <the whole implementation is here !>\r
     \else           \aftergroup \tabu@pream\r
     \ifcase \count@\r
         \global\let\tabu@elapsedtime \relax\r
         \tabu@seteverycr\r
-        \expandafter \tabuthepreamble       % vertical adjustment (inheritated from outer)\r
+        \expandafter \tabuthepreamble       % vertical adjustment (inherited from outer)\r
     \or      % exit in vertical measure + struts per cell because no X and outer in mode 3\r
         \tabu@evr{\tabu@verticalinit}\tabu@celllalign@def{\tabu@verticalmeasure}%\r
         \def\tabu@cellralign{\tabu@verticalspacing}%\r
 \newcommand*\savetabu[1]{\noalign{%\r
     \tabu@sanitizearg{#1}\tabu@temp\r
     \ifx \tabu@temp\@empty  \tabu@savewarn{}{The tabu will not be saved}\else\r
-        \@ifundefined{tabu@saved@\tabu@temp}{}{\tabu@savewarn{#1}{Overwritting}}%\r
+        \@ifundefined{tabu@saved@\tabu@temp}{}{\tabu@savewarn{#1}{Overwriting}}%\r
         \ifdefined\tabu@restored \expandafter\let\r
             \csname tabu@saved@\tabu@temp \endcsname \tabu@restored\r
         \else {\tabu@save}%\r
         \PackageWarning{tabu}\r
         {\string\@arrayright\space is missing from the\r
         \MessageBreak definition of \string\endarray.\r
-        \MessageBreak Comptability with delarray.sty is broken.}%\r
+        \MessageBreak Compatibility with delarray.sty is broken.}%\r
     \fi\fi\r
 }% \tabu@fix@arrayright\r
 \def\tabu@adl@xarraydashrule #1#2#3{%\r
                   Package cellspace has some limitations\r
     \MessageBreak And redefines some macros of array.sty.\r
     \MessageBreak Please use \string\tabulinesep\space to control\r
-    \MessageBreak vertical spacing of lines inside tabu environnement}%\r
+    \MessageBreak vertical spacing of lines inside tabu environment}%\r
 }% \tabu@warn@cellspace\r
 %% tabu Package initialisation\r
 \tabuscantokensfalse\r
index 6eb7e0a..ef1374f 100644 (file)
     <xsd:attribute name="readonly" type="DoxBool" use="optional"/>
     <xsd:attribute name="bound" type="DoxBool" use="optional"/>
     <xsd:attribute name="removable" type="DoxBool" use="optional"/>
-    <xsd:attribute name="contrained" type="DoxBool" use="optional"/>
+    <xsd:attribute name="constrained" type="DoxBool" use="optional"/>
     <xsd:attribute name="transient" type="DoxBool" use="optional"/>
     <xsd:attribute name="maybevoid" type="DoxBool" use="optional"/>
     <xsd:attribute name="maybedefault" type="DoxBool" use="optional"/>
     <xsd:choice>
       <xsd:element name="ulink" type="docURLLink" />
       <xsd:element name="bold" type="docMarkupType" />
+      <xsd:element name="s" type="docMarkupType" />
       <xsd:element name="strike" type="docMarkupType" />
       <xsd:element name="underline" type="docMarkupType" />
       <xsd:element name="emphasis" type="docMarkupType" />
       <xsd:element name="center" type="docMarkupType" />
       <xsd:element name="small" type="docMarkupType" />
       <xsd:element name="del" type="docMarkupType" />
-      <xsd:element name="inc" type="docMarkupType" />
+      <xsd:element name="ins" type="docMarkupType" />
       <xsd:element name="htmlonly" type="docHtmlOnlyType" />
       <xsd:element name="manonly" type="xsd:string" />
       <xsd:element name="xmlonly" type="xsd:string" />
       <xsd:enumeration value="PHP" />
       <xsd:enumeration value="Objective-C" />
       <xsd:enumeration value="C++" />
-      <xsd:enumeration value="Javascript" />
+      <xsd:enumeration value="JavaScript" />
       <xsd:enumeration value="Python" />
       <xsd:enumeration value="Fortran" />
       <xsd:enumeration value="VHDL" />
index 227e52c..3ee0fc8 100644 (file)
@@ -7,7 +7,7 @@
     </briefdescription>
     <detaileddescription>
       <para>See <ref refid="citelist_1CITEREF_knuth79" kindref="member">[3]</ref> for more info.</para>
-      <para>Oter references with crosreference see <ref refid="citelist_1CITEREF_Be09" kindref="member">[1]</ref> and <ref refid="citelist_1CITEREF_BertholdHeinzVigerske2009" kindref="member">[2]</ref> for more info. </para>
+      <para>Other references with cross references see <ref refid="citelist_1CITEREF_Be09" kindref="member">[1]</ref> and <ref refid="citelist_1CITEREF_BertholdHeinzVigerske2009" kindref="member">[2]</ref> for more info. </para>
     </detaileddescription>
   </compounddef>
 </doxygen>
index 4b5e40d..6cec0cf 100644 (file)
@@ -5,5 +5,5 @@
 /** \mainpage
  *  See \cite knuth79 for more info.
  *  
- *  Oter references with crosreference see \cite Be09 and \cite BertholdHeinzVigerske2009 for more info.
+ *  Other references with cross references see \cite Be09 and \cite BertholdHeinzVigerske2009 for more info.
  */
index 08c3667..02cffe1 100644 (file)
         <ref refid="class_test_1a64d85df31d518e39726467315a9b05e3" kindref="member">variadic template method</ref>
       </para>
       <para>Links to the variadic template function overloads: <itemizedlist><listitem><para><ref refid="069__link__variadic__template_8cpp_1aa7e4936a17759246bce60256cf224e16" kindref="member">First overload</ref></para></listitem><listitem><para><ref refid="069__link__variadic__template_8cpp_1ad6fc2d2a6cb8980f3e0eaacbd2ae41fe" kindref="member">Second overload</ref></para></listitem><listitem><para><ref refid="069__link__variadic__template_8cpp_1a708a5bf22646ed7233fe61b83182811a" kindref="member">Third overload</ref></para></listitem><listitem><para><ref refid="069__link__variadic__template_8cpp_1aed64c596fea5f4f5e719006539922f7c" kindref="member">Fourth overload</ref></para></listitem><listitem><para><ref refid="069__link__variadic__template_8cpp_1a0ad18d95a1dc2dbacee657c43f719187" kindref="member">Fifth overload</ref></para></listitem><listitem><para><ref refid="069__link__variadic__template_8cpp_1a2331eedd0a1db9da5de0ad0faef78a4e" kindref="member">Sixth overload</ref></para></listitem><listitem><para><ref refid="069__link__variadic__template_8cpp_1a72bd94e61df947347f98a2a6214e9342" kindref="member">Seventh overload</ref></para></listitem><listitem><para><ref refid="069__link__variadic__template_8cpp_1a0bd03c39aa36ae51d2b8d87e04cf7eab" kindref="member">Eighth overload</ref></para></listitem><listitem><para><ref refid="069__link__variadic__template_8cpp_1abb1e0338f72ae46a1240ada65d6a397c" kindref="member">Ninth overload</ref></para></listitem></itemizedlist>
-The followings are interpreted the same: <itemizedlist><listitem><para><ref refid="069__link__variadic__template_8cpp_1a708a5bf22646ed7233fe61b83182811a" kindref="member">without template argument</ref></para></listitem><listitem><para><ref refid="069__link__variadic__template_8cpp_1a708a5bf22646ed7233fe61b83182811a" kindref="member">with template argument</ref></para></listitem></itemizedlist>
+The following are interpreted the same: <itemizedlist><listitem><para><ref refid="069__link__variadic__template_8cpp_1a708a5bf22646ed7233fe61b83182811a" kindref="member">without template argument</ref></para></listitem><listitem><para><ref refid="069__link__variadic__template_8cpp_1a708a5bf22646ed7233fe61b83182811a" kindref="member">with template argument</ref></para></listitem></itemizedlist>
 See the <ref refid="class_test" kindref="compound">test</ref> class. </para>
     </detaileddescription>
     <location file="069_link_variadic_template.cpp"/>
index 89ab57c..fa4a08b 100644 (file)
@@ -28,7 +28,7 @@
  *    @li \link func(int,const Args**... args) Eighth overload\endlink
  *    @li \link func(int,Args...) Ninth overload\endlink
  *
- *  The followings are interpreted the same:
+ *  The following are interpreted the same:
  *    @li \link func(int,const Args&... args) without template argument\endlink
  *    @li \link func<Args...>(int,const Args&... args) with template argument\endlink
  *
index cebe079..828319c 100644 (file)
         <ref refid="class_test_1a64d85df31d518e39726467315a9b05e3" kindref="member">variadic template method</ref>
       </para>
       <para>References to the variadic template function overloads: <itemizedlist><listitem><para><ref refid="070__ref__variadic__template_8cpp_1aa7e4936a17759246bce60256cf224e16" kindref="member">First overload</ref></para></listitem><listitem><para><ref refid="070__ref__variadic__template_8cpp_1ad6fc2d2a6cb8980f3e0eaacbd2ae41fe" kindref="member">Second overload</ref></para></listitem><listitem><para><ref refid="070__ref__variadic__template_8cpp_1a708a5bf22646ed7233fe61b83182811a" kindref="member">Third overload</ref></para></listitem><listitem><para><ref refid="070__ref__variadic__template_8cpp_1aed64c596fea5f4f5e719006539922f7c" kindref="member">Fourth overload</ref></para></listitem><listitem><para><ref refid="070__ref__variadic__template_8cpp_1a0ad18d95a1dc2dbacee657c43f719187" kindref="member">Fifth overload</ref></para></listitem><listitem><para><ref refid="070__ref__variadic__template_8cpp_1a2331eedd0a1db9da5de0ad0faef78a4e" kindref="member">Sixth overload</ref></para></listitem><listitem><para><ref refid="070__ref__variadic__template_8cpp_1a72bd94e61df947347f98a2a6214e9342" kindref="member">Seventh overload</ref></para></listitem><listitem><para><ref refid="070__ref__variadic__template_8cpp_1a0bd03c39aa36ae51d2b8d87e04cf7eab" kindref="member">Eighth overload</ref></para></listitem><listitem><para><ref refid="070__ref__variadic__template_8cpp_1abb1e0338f72ae46a1240ada65d6a397c" kindref="member">Ninth overload</ref></para></listitem></itemizedlist>
-The followings are interpreted the same: <itemizedlist><listitem><para><ref refid="070__ref__variadic__template_8cpp_1a708a5bf22646ed7233fe61b83182811a" kindref="member">without template argument</ref></para></listitem><listitem><para><ref refid="070__ref__variadic__template_8cpp_1a708a5bf22646ed7233fe61b83182811a" kindref="member">with template argument</ref></para></listitem></itemizedlist>
+The following are interpreted the same: <itemizedlist><listitem><para><ref refid="070__ref__variadic__template_8cpp_1a708a5bf22646ed7233fe61b83182811a" kindref="member">without template argument</ref></para></listitem><listitem><para><ref refid="070__ref__variadic__template_8cpp_1a708a5bf22646ed7233fe61b83182811a" kindref="member">with template argument</ref></para></listitem></itemizedlist>
 See the <ref refid="class_test" kindref="compound">test</ref> class. </para>
     </detaileddescription>
     <location file="070_ref_variadic_template.cpp"/>
index 376cebe..fa558b7 100644 (file)
@@ -28,7 +28,7 @@
  *    @li \ref func(int,const Args**... args) "Eighth overload"
  *    @li \ref func(int,Args...) "Ninth overload"
  *
- *  The followings are interpreted the same:
+ *  The following are interpreted the same:
  *    @li \ref func(int,const Args&... args) "without template argument"
  *    @li \ref func<Args...>(int,const Args&... args) "with template argument"
  *
index 14f5a51..d439723 100644 (file)
@@ -3,24 +3,24 @@
   <compounddef id="namespace_a_namespace_1_1_0d0" kind="namespace" language="C++">
     <compoundname>ANamespace::@0</compoundname>
     <sectiondef kind="enum">
-      <memberdef kind="enum" id="071__enum__in__anon__ns_8cpp_1a96ab6574751fdf6a53ceec8a3896c45d" prot="public" static="no" strong="yes">
+      <memberdef kind="enum" id="namespace_a_namespace_1_1_0d0_1a96ab6574751fdf6a53ceec8a3896c45d" prot="public" static="no" strong="yes">
         <type/>
         <name>Boolean</name>
-        <enumvalue id="071__enum__in__anon__ns_8cpp_1a96ab6574751fdf6a53ceec8a3896c45daf8320b26d30ab433c5a54546d21f414c" prot="public">
+        <enumvalue id="namespace_a_namespace_1_1_0d0_1a96ab6574751fdf6a53ceec8a3896c45daf8320b26d30ab433c5a54546d21f414c" prot="public">
           <name>False</name>
           <briefdescription>
           </briefdescription>
           <detaileddescription>
           </detaileddescription>
         </enumvalue>
-        <enumvalue id="071__enum__in__anon__ns_8cpp_1a96ab6574751fdf6a53ceec8a3896c45daf827cf462f62848df37c5e1e94a4da74" prot="public">
+        <enumvalue id="namespace_a_namespace_1_1_0d0_1a96ab6574751fdf6a53ceec8a3896c45daf827cf462f62848df37c5e1e94a4da74" prot="public">
           <name>True</name>
           <briefdescription>
           </briefdescription>
           <detaileddescription>
           </detaileddescription>
         </enumvalue>
-        <enumvalue id="071__enum__in__anon__ns_8cpp_1a96ab6574751fdf6a53ceec8a3896c45da2767828026039e8ba7b38973cbb701f2" prot="public">
+        <enumvalue id="namespace_a_namespace_1_1_0d0_1a96ab6574751fdf6a53ceec8a3896c45da2767828026039e8ba7b38973cbb701f2" prot="public">
           <name>FileNotFound</name>
           <briefdescription>
           </briefdescription>
index ef57836..6dbc3c5 100644 (file)
@@ -1,4 +1,4 @@
-// objective: test for declation and definition order independence: decl first
+// objective: test for declaration and definition order independence: decl first
 // check: namespace_n.xml
 // config: INPUT = $INPUTDIR/decl_def.h $INPUTDIR/082_decl_def.cpp
 #include "test.h"
index 1241be6..64efc3e 100644 (file)
@@ -1,4 +1,4 @@
-// objective: test for declation and definition order independence: def first
+// objective: test for declaration and definition order independence: def first
 // check: namespace_n.xml
 // config: INPUT = $INPUTDIR/083_decl_def.cpp $INPUTDIR/decl_def.h
 #include "test.h"
index a1803da..5a21a9b 100644 (file)
@@ -5,7 +5,7 @@
     <briefdescription>
     </briefdescription>
     <detaileddescription>
-      <para>In the following the word tag has the style as indicated before it.<itemizedlist><listitem><para>This is a bold <bold>tag</bold>.</para></listitem><listitem><para>This is a <computeroutput>strong</computeroutput> bold <bold>tag</bold>.</para></listitem><listitem><para>This is an italic <emphasis>tag</emphasis>.</para></listitem><listitem><para>This is an <computeroutput>em</computeroutput> italic <emphasis>tag</emphasis>.</para></listitem><listitem><para>This is a strike through <strike>tag</strike>.</para></listitem><listitem><para>This is an underline <underline>tag</underline>.</para></listitem><listitem><para>This is an insterted <ins>tag</ins>.</para></listitem><listitem><para>This is a deleted <del>tag</del>.</para></listitem><listitem><para>This is a typewriter <computeroutput>tag</computeroutput>. </para></listitem></itemizedlist>
+      <para>In the following the word tag has the style as indicated before it.<itemizedlist><listitem><para>This is a bold <bold>tag</bold>.</para></listitem><listitem><para>This is a <computeroutput>strong</computeroutput> bold <bold>tag</bold>.</para></listitem><listitem><para>This is an italic <emphasis>tag</emphasis>.</para></listitem><listitem><para>This is an <computeroutput>em</computeroutput> italic <emphasis>tag</emphasis>.</para></listitem><listitem><para>This is a strike through <strike>tag</strike>.</para></listitem><listitem><para>This is a <computeroutput>s</computeroutput> strike through <s>tag</s>.</para></listitem><listitem><para>This is an underline <underline>tag</underline>.</para></listitem><listitem><para>This is an <computeroutput>ins</computeroutput> inserted <ins>tag</ins>.</para></listitem><listitem><para>This is a deleted <del>tag</del>.</para></listitem><listitem><para>This is a typewriter <computeroutput>tag</computeroutput>. </para></listitem></itemizedlist>
 </para>
     </detaileddescription>
     <location file="086_style_tags.h"/>
index 105adca..625e245 100644 (file)
@@ -9,8 +9,9 @@ In the following the word tag has the style as indicated before it.
 - This is an italic <i>tag</i>.
 - This is an `em` italic <em>tag</em>.
 - This is a strike through <strike>tag</strike>.
+- This is a `s` strike through <s>tag</s>.
 - This is an underline <u>tag</u>.
-- This is an insterted <ins>tag</ins>.
+- This is an `ins` inserted <ins>tag</ins>.
 - This is a deleted <del>tag</del>.
 - This is a typewriter <tt>tag</tt>.
 */
index fa3c186..a4118b8 100755 (executable)
@@ -2,9 +2,38 @@
 
 from __future__ import print_function
 import argparse, glob, itertools, re, shutil, os, sys
+import subprocess
 
 config_reg = re.compile('.*\/\/\s*(?P<name>\S+):\s*(?P<value>.*)$')
 
+
+def xopen(fname, mode='r', encoding='utf-8'):
+       '''Unified file opening for Python 2 an Python 3.
+
+       Python 2 does not have the encoding argument. Python 3 has one.
+       '''
+
+       if sys.version_info[0] == 2:
+               return open(fname, mode=mode) # Python 2 without encoding
+       else:
+               return open(fname, mode=mode, encoding=encoding) # Python 3 with encoding
+
+def xpopen(cmd, cmd1="",encoding='utf-8-sig', getStderr=False):
+       '''Unified file pipe opening for Python 2 an Python 3.
+
+       Python 2 does not have the encoding argument. Python 3 has one. and
+       '''
+
+       if sys.version_info[0] == 2:
+               return os.popen(cmd).read() # Python 2 without encoding
+       else:
+               if (getStderr):
+                       proc = subprocess.run(cmd1,encoding=encoding,capture_output=True) # Python 3 with encoding
+                       return proc.stderr
+               else:
+                       proc = subprocess.Popen(cmd,stdout=subprocess.PIPE,stderr=subprocess.PIPE,encoding=encoding) # Python 3 with encoding
+                       return proc.stdout.read()
+
 class Tester:
        def __init__(self,args,test):
                self.args      = args
@@ -25,7 +54,7 @@ class Tester:
                elif not os.path.isfile(expected_file):
                        return (True,'%s absent' % expected_file)
                else:
-                       diff = os.popen('diff -b -w -u %s %s' % (got_file,expected_file)).read()
+                       diff = xpopen('diff -b -w -u %s %s' % (got_file,expected_file))
                        if diff and not diff.startswith("No differences"):
                                return (True,'Difference between generated output and reference:\n%s' % diff)
                return (False,'')
@@ -67,7 +96,7 @@ class Tester:
 
        def get_config(self):
                config = {}
-               with open(self.args.inputdir+'/'+self.test,'r') as f:
+               with xopen(self.args.inputdir+'/'+self.test,'r') as f:
                        for line in f.readlines():
                                m = config_reg.match(line)
                                if m:
@@ -84,7 +113,7 @@ class Tester:
                shutil.rmtree(self.test_out,ignore_errors=True)
                os.mkdir(self.test_out)
                shutil.copy(self.args.inputdir+'/Doxyfile',self.test_out)
-               with open(self.test_out+'/Doxyfile','a') as f:
+               with xopen(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('EXAMPLE_PATH=%s' % self.args.inputdir, file=f)
@@ -113,6 +142,7 @@ class Tester:
                        print('HTML_FILE_EXTENSION=.xhtml', file=f)
                        if (self.args.pdf):
                                print('GENERATE_LATEX=YES', file=f)
+                               print('LATEX_BATCHMODE=YES', file=f)
                                print('LATEX_OUTPUT=%s/latex' % self.test_out, file=f)
                        if self.args.subdirs:
                                print('CREATE_SUBDIRS=YES', file=f)
@@ -154,7 +184,7 @@ class Tester:
                                        print('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()
+                               data = xpopen('%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')
@@ -162,7 +192,7 @@ class Tester:
                                        print('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:
+                               with xopen(out_file,'w') as f:
                                        print(data,file=f)
                shutil.rmtree(self.test_out+'/out',ignore_errors=True)
                os.remove(self.test_out+'/Doxyfile')
@@ -204,7 +234,7 @@ class Tester:
                                                else:
                                                        check_file = check_file[0]
                                        # convert output to canonical form
-                                       data = os.popen('%s --format --noblanks --nowarning %s' % (self.args.xmllint,check_file)).read()
+                                       data = xpopen('%s --format --noblanks --nowarning %s' % (self.args.xmllint,check_file))
                                        if data:
                                                # strip version
                                                data = re.sub(r'xsd" version="[0-9.-]+"','xsd" version=""',data).rstrip('\n')
@@ -212,7 +242,7 @@ class Tester:
                                                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:
+                                       with xopen(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)
@@ -235,10 +265,12 @@ class Tester:
                                index_xsd.append(glob.glob('%s/index.xsd' % (xmlxsd_output)))
                                index_xsd.append(glob.glob('%s/*/*/index.xsd' % (xmlxsd_output)))
                                index_xsd = ' '.join(list(itertools.chain.from_iterable(index_xsd))).replace(self.args.outputdir +'/','').replace('\\','/')
-                               exe_string = '%s --noout --schema %s %s %s' % (self.args.xmllint,index_xsd,index_xml,redirx)
+                               exe_string = '%s --noout --schema %s %s' % (self.args.xmllint,index_xsd,index_xml)
+                               exe_string1 = exe_string
+                               exe_string += ' %s' % (redirx)
                                exe_string += ' %s more "%s/temp"' % (separ,xmlxsd_output)
 
-                               xmllint_out = os.popen(exe_string).read()
+                               xmllint_out = xpopen(exe_string,exe_string1,getStderr=True)
                                if xmllint_out:
                                        xmllint_out = re.sub(r'.*validates','',xmllint_out).rstrip('\n')
                                else:
@@ -259,10 +291,12 @@ class Tester:
                                compound_xsd.append(glob.glob('%s/compound.xsd' % (xmlxsd_output)))
                                compound_xsd.append(glob.glob('%s/*/*/compound.xsd' % (xmlxsd_output)))
                                compound_xsd = ' '.join(list(itertools.chain.from_iterable(compound_xsd))).replace(self.args.outputdir +'/','').replace('\\','/')
-                               exe_string = '%s --noout --schema %s %s %s' % (self.args.xmllint,compound_xsd,compound_xml,redirx)
+                               exe_string = '%s --noout --schema %s %s' % (self.args.xmllint,compound_xsd,compound_xml)
+                               exe_string1 = exe_string
+                               exe_string += ' %s' % (redirx)
                                exe_string += ' %s more "%s/temp"' % (separ,xmlxsd_output)
 
-                               xmllint_out = os.popen(exe_string).read()
+                               xmllint_out = xpopen(exe_string,exe_string1,getStderr=True)
                                if xmllint_out:
                                        xmllint_out = re.sub(r'.*validates','',xmllint_out).rstrip('\n')
                                else:
@@ -292,11 +326,13 @@ class Tester:
                        tests.append(glob.glob('%s/*.xml' % (docbook_output)))
                        tests.append(glob.glob('%s/*/*/*.xml' % (docbook_output)))
                        tests = ' '.join(list(itertools.chain.from_iterable(tests))).replace(self.args.outputdir +'/','').replace('\\','/')
-                       exe_string = '%s --nonet --postvalid %s %s' % (self.args.xmllint,tests,redirx)
+                       exe_string = '%s --nonet --postvalid %s' % (self.args.xmllint,tests)
+                       exe_string1 = exe_string
+                       exe_string += ' %s' % (redirx)
                        exe_string += ' %s more "%s/temp"' % (separ,docbook_output)
 
                        failed_docbook=False
-                       xmllint_out = os.popen(exe_string).read()
+                       xmllint_out = xpopen(exe_string,exe_string1,getStderr=True)
                        xmllint_out = self.cleanup_xmllint_docbook(xmllint_out)
                        if xmllint_out:
                                msg += (xmllint_out,)
@@ -310,10 +346,12 @@ class Tester:
                                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)
+                       exe_string = '%s --path dtd --nonet --postvalid %s/*xhtml' % (self.args.xmllint,html_output)
+                       exe_string1 = exe_string
+                       exe_string += ' %s' % (redirx)
+                       exe_string += ' %s more "%s/temp"' % (separ,html_output)
                        failed_html=False
-                       xmllint_out = os.popen(exe_string).read()
+                       xmllint_out = xpopen(exe_string,exe_string1,getStderr=True)
                        xmllint_out = self.cleanup_xmllint(xmllint_out)
                        if xmllint_out:
                                msg += (xmllint_out,)
@@ -325,15 +363,25 @@ class Tester:
                        latex_output='%s/latex' % self.test_out
                        if (sys.platform == 'win32'):
                                redirl='>nul: 2>temp'
+                               mk='make.bat'
                        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()
+                               mk='make'
+                       cur_directory = os.getcwd()
+                       os.chdir(latex_output)
+                       exe_string = mk
+                       exe_string1 = exe_string
+                       exe_string += ' %s' % (redirl)
+                       exe_string += ' %s more temp' % (separ)
+                       latex_out = xpopen(exe_string,exe_string1,getStderr=True)
+                       os.chdir(cur_directory);
                        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:
+                       elif xopen(latex_output + "/refman.log",'r').read().find("Error")!= -1:
+                               msg += ("PDF generation failed\n  For a description of the problem see 'refman.log' in the latex directory of this test",)
+                               failed_html=True
+                       elif xopen(latex_output + "/refman.log",'r').read().find("Emergency stop")!= -1:
                                msg += ("PDF generation failed\n  For a description of the problem see 'refman.log' in the latex directory of this test",)
                                failed_html=True
                        elif not self.args.keep:
index e8ab16c..b4227b4 100755 (executable)
@@ -6,7 +6,7 @@ import sys
 import getopt
 
 # map XML attributes/elements to SQL rows
-# --POC: iterate through the children and attributes of the memberdef elelement
+# --POC: iterate through the children and attributes of the memberdef element
 #        and search it in doxygen_sqlite3.db
 
 g_conn=None
index f89008c..43dc74d 100644 (file)
@@ -1,3 +1,13 @@
+find_package(Javacc)
+if (JAVACC_FOUND)
+    add_custom_command(
+        COMMAND ${JAVACC_EXECUTABLE} ${JAVACC_FLAGS} -OUTPUT_DIRECTORY=${CMAKE_SOURCE_DIR}/vhdlparser ${CMAKE_SOURCE_DIR}/vhdlparser/vhdlparser.jj
+        DEPENDS ${CMAKE_SOURCE_DIR}/vhdlparser/vhdlparser.jj
+        OUTPUT ${CMAKE_SOURCE_DIR}/vhdlparser/CharStream.cc ${CMAKE_SOURCE_DIR}/vhdlparser/CharStream.h ${CMAKE_SOURCE_DIR}/vhdlparser/ErrorHandler.h ${CMAKE_SOURCE_DIR}/vhdlparser/JavaCC.h ${CMAKE_SOURCE_DIR}/vhdlparser/ParseException.cc ${CMAKE_SOURCE_DIR}/vhdlparser/ParseException.h ${CMAKE_SOURCE_DIR}/vhdlparser/Token.cc ${CMAKE_SOURCE_DIR}/vhdlparser/Token.h ${CMAKE_SOURCE_DIR}/vhdlparser/TokenManager.h ${CMAKE_SOURCE_DIR}/vhdlparser/TokenMgrError.cc ${CMAKE_SOURCE_DIR}/vhdlparser/TokenMgrError.h ${CMAKE_SOURCE_DIR}/vhdlparser/VhdlParser.cc ${CMAKE_SOURCE_DIR}/vhdlparser/VhdlParser.h ${CMAKE_SOURCE_DIR}/vhdlparser/VhdlParserConstants.h ${CMAKE_SOURCE_DIR}/vhdlparser/VhdlParserTokenManager.cc ${CMAKE_SOURCE_DIR}/vhdlparser/VhdlParserTokenManager.h
+    )
+
+endif()
+
 include_directories(${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/qtools ${GENERATED_SRC})
 add_library(vhdlparser STATIC
 CharStream.cc
index 8cc17c3..65179f5 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated By:JavaCC: Do not edit this line. CharStream.cc Version 6.0 */
+/* Generated By:JavaCC: Do not edit this line. CharStream.cc Version 6.2 */
 /* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
 #include "CharStream.h"
 
@@ -209,4 +209,4 @@ void CharStream::UpdateLineColumn(JAVACC_CHAR_TYPE c) {
 
 }
 }
-/* JavaCC - OriginalChecksum=e709b9ee1adf0fcb6b1c5e1641f10348 (do not edit this line) */
+/* JavaCC - OriginalChecksum=ade3c1b57a731a003629de593814ffa6 (do not edit this line) */
index 784b584..69b8ab5 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated By:JavaCC: Do not edit this line. CharStream.h Version 6.0 */
+/* Generated By:JavaCC: Do not edit this line. CharStream.h Version 6.2 */
 /* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
 #ifndef CHARSTREAM_H
 #define CHARSTREAM_H
@@ -28,44 +28,60 @@ namespace parser {
 
 
 class CharStream {
+public:
+          void setTabSize(int i) { tabSize = i; }
+          int  getTabSize(int i) { return tabSize; }
+ private:
+  int getBufcolumn(int pos) {
+    if (trackLineColumn && pos>=0) {
+      return bufcolumn[pos];
+    } else {
+      return -1;
+    }
+  }
+  int getBufline(int pos) {
+    if (trackLineColumn && pos>=0) {
+      return bufline[pos];
+    } else {
+      return -1;
+    }
+  }
  public:
-  void setTabSize(int i) { tabSize = i; }
-  int getTabSize(int i) { return tabSize; }
-  virtual int getColumn() { return trackLineColumn ? bufcolumn[bufpos] : -1; }
-  virtual int getLine() { return trackLineColumn ? bufline[bufpos] : -1; }
-  virtual int getEndColumn() { return trackLineColumn ? bufcolumn[bufpos] : -1; }
-  virtual int getEndLine() { return trackLineColumn ? bufline[bufpos] : -1; }
-  virtual int getBeginColumn() { return trackLineColumn ? bufcolumn[tokenBegin] : -1; }
-  virtual int getBeginLine() { return trackLineColumn ? bufline[tokenBegin] : -1; }
-
-  virtual bool getTrackLineColumn() { return trackLineColumn; }
+  virtual int getColumn() { return getBufcolumn(bufpos); }
+  virtual int getLine() { return getBufline(bufpos); }
+  virtual int getEndColumn() { return getBufcolumn(bufpos); }
+  virtual int getEndLine() { return getBufline(bufpos); }
+  virtual int getBeginColumn() { return getBufcolumn(tokenBegin); }
+  virtual int getBeginLine() { return getBufline(tokenBegin); }
+
+  virtual bool getTrackLineColumn()         { return trackLineColumn; }
   virtual void setTrackLineColumn(bool val) { trackLineColumn = val; }
 
 /**
  * Backs up the input stream by amount steps. Lexer calls this method if it
  * had already read some characters, but could not use them to match a
  * (longer) token. So, they will be used again as the prefix of the next
- * token and it is the implemetation's responsibility to do this right.
+ * token and it is the implementation's responsibility to do this right.
  */
-virtual inline void backup(int amount) {
-  inBuf += amount;
-  bufpos -= amount;
-  if (bufpos < 0) {
-    bufpos += bufsize;
+  virtual inline void backup(int amount) {
+    inBuf += amount;
+    bufpos -= amount;
+    if (bufpos < 0) {
+      bufpos += bufsize;
+    }
   }
-}
 
 /**
  * Returns the next character that marks the beginning of the next token.
  * All characters must remain in the buffer between two successive calls
  * to this method to implement backup correctly.
  */
-virtual inline JAVACC_CHAR_TYPE BeginToken() {
-  tokenBegin = -1;
-  JAVACC_CHAR_TYPE c = readChar();
-  tokenBegin = bufpos;
-  return c;
-}
+  virtual inline JAVACC_CHAR_TYPE BeginToken() {
+    tokenBegin = -1;
+    JAVACC_CHAR_TYPE c = readChar();
+    tokenBegin = bufpos;
+    return c;
+  }
 
 
 /**
@@ -73,31 +89,30 @@ virtual inline JAVACC_CHAR_TYPE BeginToken() {
  * of selecting the input is the responsibility of the class
  * implementing this class.
  */
-virtual inline JAVACC_CHAR_TYPE readChar() {
-  if (inBuf > 0) {
-    --inBuf;
-    ++bufpos;
-    if (bufpos == bufsize) {
-      bufpos = 0;
+  virtual inline JAVACC_CHAR_TYPE readChar() {
+    if (inBuf > 0) {
+      --inBuf;
+      ++bufpos;
+      if (bufpos == bufsize) {
+        bufpos = 0;
+      }
+      return buffer[bufpos];
     }
 
-    return buffer[bufpos];
-  }
+    ++bufpos;
+    if (bufpos >= maxNextCharInd) {
+      FillBuff();
+    }
 
-  ++bufpos;
-  if (bufpos >= maxNextCharInd) {
-    FillBuff();
-  }
+    JAVACC_CHAR_TYPE c = buffer[bufpos];
 
-  JAVACC_CHAR_TYPE c = buffer[bufpos];
+    if (trackLineColumn) {
+      UpdateLineColumn(c);
+    }
 
-  if (trackLineColumn) {
-    UpdateLineColumn(c);
+    return c;
   }
 
-  return c;
-}
-
 
   virtual void ExpandBuff(bool wrapAround);
   virtual void FillBuff();
@@ -112,8 +127,7 @@ virtual inline JAVACC_CHAR_TYPE readChar() {
     if (bufpos >= tokenBegin)
       return JAVACC_STRING_TYPE(buffer + tokenBegin, bufpos - tokenBegin + 1);
     else
-      return JAVACC_STRING_TYPE(buffer + tokenBegin, bufsize - tokenBegin)
-             .append(buffer, bufpos + 1);
+      return JAVACC_STRING_TYPE(buffer + tokenBegin, bufsize - tokenBegin).append(buffer, bufpos + 1);
   }
 
   /**
@@ -126,8 +140,7 @@ virtual inline JAVACC_CHAR_TYPE readChar() {
     if ((bufpos + 1) >= len) {
       return JAVACC_STRING_TYPE(buffer + bufpos - len + 1, len);
     }
-    return JAVACC_STRING_TYPE(buffer + bufsize - (len - bufpos - 1), len - bufpos - 1)
-           .append(buffer, bufpos + 1);
+    return JAVACC_STRING_TYPE(buffer + bufsize - (len - bufpos - 1), len - bufpos - 1).append(buffer, bufpos + 1);
   }
 
   /**
@@ -144,74 +157,71 @@ virtual inline JAVACC_CHAR_TYPE readChar() {
   }
 
   bool endOfInput() {
-    return inBuf == 0 && bufpos + 1 >= maxNextCharInd &&
-           inputStream->endOfInput();
+    return inBuf == 0 && bufpos + 1 >= maxNextCharInd && inputStream->endOfInput();
   }
 
   CharStream(const JAVACC_CHAR_TYPE *buf, int sz, int startline,
                       int startcolumn, int buffersize) :
-    bufline(NULL), bufcolumn(NULL), inputStream(NULL), deleteStream(false),
-    buffer(NULL), bufpos(0), bufsize(0), tokenBegin(0), column(0), line(0),
-    prevCharIsCR (false), prevCharIsLF (false), available(0), maxNextCharInd(0),
-    inBuf(0),tabSize(8), trackLineColumn(true) {
+    bufline(NULL), bufcolumn(NULL), buffer(NULL), bufpos(0), bufsize(0), 
+    tokenBegin(0), column(0), line(0), prevCharIsCR(false), prevCharIsLF(false),
+    available(0), maxNextCharInd(0), inBuf(0), tabSize(1), trackLineColumn(true),
+    inputStream(NULL), deleteStream(false) {
     ReInit(JAVACC_STRING_TYPE(buf, sz), startline, startcolumn, buffersize);
   }
 
   CharStream(const JAVACC_CHAR_TYPE *buf, int sz, int startline, int startcolumn) :
-    bufline(NULL), bufcolumn(NULL), inputStream(NULL), deleteStream(false),
-    buffer(NULL), bufpos(0), bufsize(0), tokenBegin(0), column(0), line(0),
-    prevCharIsCR (false), prevCharIsLF (false), available(0), maxNextCharInd(0),
-    inBuf(0),tabSize(8), trackLineColumn(true) {
+    bufline(NULL), bufcolumn(NULL), buffer(NULL), bufpos(0), bufsize(0), 
+    tokenBegin(0), column(0), line(0), prevCharIsCR(false), prevCharIsLF(false),
+    available(0), maxNextCharInd(0), inBuf(0), tabSize(1), trackLineColumn(true),
+    inputStream(NULL), deleteStream(false) {
     ReInit(JAVACC_STRING_TYPE(buf, sz), startline, startcolumn, INITIAL_BUFFER_SIZE);
   }
 
   CharStream(const JAVACC_STRING_TYPE& str, int startline,
                       int startcolumn, int buffersize) :
-    bufline(NULL), bufcolumn(NULL), inputStream(NULL), deleteStream(false),
-    buffer(NULL), bufpos(0), bufsize(0), tokenBegin(0), column(0), line(0),
-    prevCharIsCR (false), prevCharIsLF (false), available(0), maxNextCharInd(0),
-    inBuf(0),tabSize(8), trackLineColumn(true) {
+    bufline(NULL), bufcolumn(NULL), buffer(NULL), bufpos(0), bufsize(0), 
+    tokenBegin(0), column(0), line(0), prevCharIsCR(false), prevCharIsLF(false),
+    available(0), maxNextCharInd(0), inBuf(0), tabSize(1), trackLineColumn(true),
+    inputStream(NULL), deleteStream(false) {
     ReInit(str, startline, startcolumn, buffersize);
   }
 
   CharStream(const JAVACC_STRING_TYPE& str, int startline, int startcolumn) :
-    bufline(NULL), bufcolumn(NULL), inputStream(NULL), deleteStream(false),
-    buffer(NULL), bufpos(0), bufsize(0), tokenBegin(0), column(0), line(0),
-    prevCharIsCR (false), prevCharIsLF (false), available(0), maxNextCharInd(0),
-    inBuf(0) ,tabSize(8), trackLineColumn(true){
+    bufline(NULL), bufcolumn(NULL), buffer(NULL), bufpos(0), bufsize(0), 
+    tokenBegin(0), column(0), line(0), prevCharIsCR(false), prevCharIsLF(false),
+    available(0), maxNextCharInd(0), inBuf(0), tabSize(1), trackLineColumn(true),
+    inputStream(NULL), deleteStream(false) {
     ReInit(str, startline, startcolumn, INITIAL_BUFFER_SIZE);
   }
 
   CharStream(ReaderStream *input_stream, int startline,
              int startcolumn, int buffersize) :
-    bufline(NULL), bufcolumn(NULL), inputStream(NULL), deleteStream(false),
-    buffer(NULL), bufpos(0), bufsize(0), tokenBegin(0), column(0), line(0),
-    prevCharIsCR (false), prevCharIsLF (false), available(0), maxNextCharInd(0),
-    inBuf(0),tabSize(8), trackLineColumn(true) {
+    bufline(NULL), bufcolumn(NULL), buffer(NULL), bufpos(0), bufsize(0), 
+    tokenBegin(0), column(0), line(0), prevCharIsCR(false), prevCharIsLF(false),
+    available(0), maxNextCharInd(0), inBuf(0), tabSize(1), trackLineColumn(true),
+    inputStream(NULL), deleteStream(false) {
     ReInit(input_stream, startline, startcolumn, INITIAL_BUFFER_SIZE);
   }
 
   CharStream(ReaderStream *input_stream, int startline, int startcolumn) :
-    bufline(NULL), bufcolumn(NULL), inputStream(NULL), deleteStream(false),
-    buffer(NULL), bufpos(0), bufsize(0), tokenBegin(0), column(0), line(0),
-    prevCharIsCR (false), prevCharIsLF (false), available(0), maxNextCharInd(0),
-    inBuf(0),tabSize(8), trackLineColumn(true) {
+    bufline(NULL), bufcolumn(NULL), buffer(NULL), bufpos(0), bufsize(0), 
+    tokenBegin(0), column(0), line(0), prevCharIsCR(false), prevCharIsLF(false),
+    available(0), maxNextCharInd(0), inBuf(0), tabSize(1), trackLineColumn(true),
+    inputStream(NULL), deleteStream(false) {
     ReInit(input_stream, startline, startcolumn, INITIAL_BUFFER_SIZE);
   }
 
   CharStream(ReaderStream *input_stream) :
-    bufline(NULL), bufcolumn(NULL), inputStream(NULL), deleteStream(false),
-    buffer(NULL), bufpos(0), bufsize(0), tokenBegin(0), column(0), line(0),
-    prevCharIsCR (false), prevCharIsLF (false), available(0), maxNextCharInd(0),
-    inBuf(0),tabSize(8), trackLineColumn(true) {
+    bufline(NULL), bufcolumn(NULL), buffer(NULL), bufpos(0), bufsize(0), 
+    tokenBegin(0), column(0), line(0), prevCharIsCR(false), prevCharIsLF(false),
+    available(0), maxNextCharInd(0), inBuf(0), tabSize(1), trackLineColumn(true),
+    inputStream(NULL), deleteStream(false) {
     ReInit(input_stream, 1, 1, INITIAL_BUFFER_SIZE);
   }
 
-  virtual void ReInit(ReaderStream *input_stream, int startline, int startcolumn,
-                      int buffersize);
+  virtual void ReInit(ReaderStream *input_stream, int startline, int startcolumn, int buffersize);
 
-  virtual void ReInit(ReaderStream *input_stream, int startline,
-                      int startcolumn) {
+  virtual void ReInit(ReaderStream *input_stream, int startline, int startcolumn) {
     ReInit(input_stream, startline, startcolumn, INITIAL_BUFFER_SIZE);
   }
 
@@ -232,26 +242,26 @@ virtual inline JAVACC_CHAR_TYPE readChar() {
  protected:
   virtual void UpdateLineColumn(JAVACC_CHAR_TYPE c);
 
-  int *bufline;
-  int *bufcolumn;
-  ReaderStream *inputStream;
-  bool deleteStream;
-  JAVACC_CHAR_TYPE * buffer;
-  int bufpos;
-  int bufsize;
-  int tokenBegin;
-  int column;
-  int line;
-  bool prevCharIsCR ;
-  bool prevCharIsLF ;
-  int available;
-  int maxNextCharInd;
-  int inBuf ;
-  int tabSize ;
-  bool trackLineColumn;
+  int*               bufline;
+  int*               bufcolumn;
+  JAVACC_CHAR_TYPE*  buffer;
+  int                bufpos;
+  int                bufsize;
+  int                tokenBegin;
+  int                column;
+  int                line;
+  bool               prevCharIsCR;
+  bool               prevCharIsLF;
+  int                available;
+  int                maxNextCharInd;
+  int                inBuf;
+  int                tabSize;
+  bool               trackLineColumn;
+  ReaderStream*      inputStream;
+  bool               deleteStream;
 };
 
 }
 }
 #endif
-/* JavaCC - OriginalChecksum=5eaf75ef6a2c7859369c80cf6fd037e0 (do not edit this line) */
+/* JavaCC - OriginalChecksum=3f0e693d1617236429891c8c95713d73 (do not edit this line) */
index 7500a5f..224500e 100644 (file)
@@ -1,7 +1,8 @@
-/* Generated By:JavaCC: Do not edit this line. ErrorHandler.h Version 6.0 */
+/* Generated By:JavaCC: Do not edit this line. ErrorHandler.h Version 6.2 */
 /* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true,BUILD_PARSER=true,BUILD_TOKEN_MANAGER=true */
 #ifndef ERRORHANDLER_H
 #define ERRORHANDLER_H
+#include <stdio.h>
 #include <string>
 #include "JavaCC.h"
 #include "Token.h"
@@ -75,4 +76,4 @@ JAVACC_SIMPLE_STRING addUnicodeEscapes(JAVACC_STRING_TYPE str);
 }
 
 #endif
-/* JavaCC - OriginalChecksum=685d19cb4cd943b60089f599e45f23ad (do not edit this line) */
+/* JavaCC - OriginalChecksum=c18f1105ba178be8e21cc9f279f94496 (do not edit this line) */
index 224b2b5..2d34634 100644 (file)
@@ -1,31 +1,33 @@
-/* Generated By:JavaCC: Do not edit this line. JavaCC.h Version 6.2 */
+/* Generated By:JavaCC: Do not edit this line. JavaCC.h Version 7.0 */
 /* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
-#ifndef JAVACC_H_
-#define JAVACC_H_
-#include <stdio.h>
+#ifndef JAVACC_JAVACC_H_
+#define JAVACC_JAVACC_H_
+
 #include <string>
-#include <memory.h>
-#include <assert.h>
-#include "vhdlstring.h"
+#include <memory>
+#include <cassert>
+#include <functional>
 
 #ifndef JAVACC_CHAR_TYPE
 #define JAVACC_CHAR_TYPE char
 #endif
 
 #ifndef JAVACC_STRING_TYPE
-#define JAVACC_STRING_TYPE VhdlString
+#define JAVACC_STRING_TYPE std::basic_string<JAVACC_CHAR_TYPE>
 #endif
 
-#define JAVACC_SIMPLE_STRING VhdlString
+#define JAVACC_SIMPLE_STRING std::basic_string<char>
 
-typedef JAVACC_STRING_TYPE StringBuffer;
-typedef JAVACC_STRING_TYPE String;
+typedef JAVACC_CHAR_TYPE     JJChar;
+typedef JAVACC_STRING_TYPE   JJString;
+typedef JAVACC_STRING_TYPE   JJStringBuffer;
+typedef JAVACC_SIMPLE_STRING JJSimpleString;
 
 // Abstraction on stream classes to read a block of data into a buffer.
 class ReaderStream {
 public:
   // Read block of data into a buffer and return the actual number read.
-  virtual size_t read(JAVACC_CHAR_TYPE * /*bufptr*/, int /*offset*/, size_t /*len*/) { return 0; }
+  virtual size_t read(JAVACC_CHAR_TYPE *buffer, int offset, size_t len) { return 0; }
   virtual bool   endOfInput() { return true; }
   virtual ~ReaderStream() {}
 };
@@ -33,11 +35,26 @@ public:
 const JAVACC_CHAR_TYPE EMPTY[] = { 0 };
 
 #ifndef MAX
-#define MAX(a,b) ((a)>(b)?(a):(b))
+#define MAX(a,b) (a>=b?a:b)
 #endif
 #ifndef MIN
-#define MIN(a,b) ((a)<(b)?(a):(b))
+#define MIN(a,b) (a<=b?a:b)
 #endif
 
+template<typename T>
+struct JJEnter
+{
+    JJEnter(T f_) : f{f_} {f();}
+    ~JJEnter(){}
+    T f;
+};
+template<typename T>
+struct JJExit
+{
+    JJExit(T f_) : f{f_} {}
+    ~JJExit(){f();}
+    T f;
+};
+
 #endif
-/* JavaCC - OriginalChecksum=eb066370c81bb58bb68713327da9719f (do not edit this line) */
+/* JavaCC - OriginalChecksum=b719dd5e5f87efc5315d14df0b701850 (do not edit this line) */
index 99649af..375ff6c 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated By:JavaCC: Do not edit this line. ParseException.cc Version 6.0 */
+/* Generated By:JavaCC: Do not edit this line. ParseException.cc Version 6.2 */
 /* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
 #include "ParseException.h"
 
@@ -141,8 +141,6 @@ namespace parser {
       for (int i = 0; i < str.length(); i++) {
         switch (str.charAt(i))
         {
-           case 0 :
-              continue;
            case '\b':
               retval.append("\\b");
               continue;
@@ -183,4 +181,4 @@ namespace parser {
 
 }
 }
-/* JavaCC - OriginalChecksum=99d488e13335cf377284c90700f070ed (do not edit this line) */
+/* JavaCC - OriginalChecksum=9f6af8fd72f5fe3e4210cf02acbd8387 (do not edit this line) */
index b025912..4a22772 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated By:JavaCC: Do not edit this line. ParseException.h Version 6.0 */
+/* Generated By:JavaCC: Do not edit this line. ParseException.h Version 6.2 */
 /* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
 #ifndef _PARSE_EXCEPTION_H
 #define _PARSE_EXCEPTION_H
@@ -96,4 +96,4 @@ class ParseException {
 }
 }
 #endif
-/* JavaCC - OriginalChecksum=8c47c56fc2030f05b43e20cae6ca5d66 (do not edit this line) */
+/* JavaCC - OriginalChecksum=bd87c2fc11a4306bd2c2482fd1025b7c (do not edit this line) */
index 62a8169..735091d 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated By:JavaCC: Do not edit this line. Token.cc Version 6.0 */
+/* Generated By:JavaCC: Do not edit this line. Token.cc Version 6.2 */
 /* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true,TOKEN_INCLUDES=,TOKEN_EXTENDS= */
 #include "Token.h"
 
@@ -89,4 +89,4 @@ namespace parser {
 
 }
 }
-/* JavaCC - OriginalChecksum=9db9ca693072c4c37bb7cc933c0c5e35 (do not edit this line) */
+/* JavaCC - OriginalChecksum=dcb0f64486aa6455ae5af05d6bb539ec (do not edit this line) */
index 5fce69f..040899e 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated By:JavaCC: Do not edit this line. Token.h Version 6.0 */
+/* Generated By:JavaCC: Do not edit this line. Token.h Version 6.2 */
 /* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true,TOKEN_INCLUDES=,TOKEN_EXTENDS= */
 #ifndef TOKEN_H
 #define TOKEN_H
@@ -86,12 +86,13 @@ class Token
    */
   Token(int kind, JAVACC_STRING_TYPE image);
 
+  virtual ~Token();
+
   /**
    * Returns the image.
    */
   JAVACC_STRING_TYPE toString();
 
-  public: virtual ~Token();
 
   /**
    * Returns a new Token void *, by default. However, if you want, you
@@ -113,4 +114,4 @@ class Token
 }
 }
 #endif
-/* JavaCC - OriginalChecksum=2f5eb1c937adc983dfa2008c4fe383a7 (do not edit this line) */
+/* JavaCC - OriginalChecksum=4748c3d6443aa3445d3c95ab54f14c2a (do not edit this line) */
index df371d9..0c2caa6 100644 (file)
@@ -1,10 +1,12 @@
-/* Generated By:JavaCC: Do not edit this line. TokenManager.h Version 6.0 */
+/* Generated By:JavaCC: Do not edit this line. TokenManager.h Version 6.2 */
 /* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
 #ifndef TOKENMANAGER_H
 #define TOKENMANAGER_H
+#include <iostream>
 #include "JavaCC.h"
 #include "Token.h"
 
+using namespace std;
 
 namespace vhdl {
 namespace parser {
@@ -19,10 +21,10 @@ public:
   /** This gets the next token from the input stream.
    *  A token of kind 0 (<EOF>) should be returned on EOF.
    */
-  public: virtual Token *getNextToken() = 0;
-  public: virtual ~TokenManager() { }
-  public: virtual void lexicalError() {
-    fprintf(stderr, "Lexical error encountered.\n");
+  virtual       ~TokenManager() { }
+  virtual Token *getNextToken() = 0;
+  virtual void   lexicalError() {
+       cerr << "Lexical error encountered." << endl;
   }
 
 };
@@ -30,4 +32,4 @@ public:
 }
 }
 #endif
-/* JavaCC - OriginalChecksum=9e6cfa00cefe7e342b80eb59f1a114ff (do not edit this line) */
+/* JavaCC - OriginalChecksum=918e2eba53e028d6c4142283ce3f498f (do not edit this line) */
index 9093e6e..74908f0 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated By:JavaCC: Do not edit this line. TokenMgrError.cc Version 6.0 */
+/* Generated By:JavaCC: Do not edit this line. TokenMgrError.cc Version 6.2 */
 /* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
 #include "TokenMgrError.h"
 
@@ -64,7 +64,7 @@ namespace parser {
 // i < 16 - guaranteed
 char hexChar(int i) {
   if (i < 10) {
-    return i - '0';
+    return i + '0';
   }
   return 'a' + (i - 10);
 }
@@ -79,9 +79,6 @@ JAVACC_SIMPLE_STRING addUnicodeEscapes(JAVACC_STRING_TYPE str) {
     JAVACC_CHAR_TYPE ch = str[i];
     switch (ch)
     {
-      case 0 :
-        retval += EMPTY[0];
-        continue;
       case '\b':
         retval.append("\\b");
         continue;
@@ -118,4 +115,4 @@ JAVACC_SIMPLE_STRING addUnicodeEscapes(JAVACC_STRING_TYPE str) {
 
 }
 }
-/* JavaCC - OriginalChecksum=2bf63f131c8e60fd30c70d0b4f660016 (do not edit this line) */
+/* JavaCC - OriginalChecksum=72f292bc267bd0602e63291bf864f942 (do not edit this line) */
index 2702b29..abb305d 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated By:JavaCC: Do not edit this line. TokenMgrError.h Version 6.0 */
+/* Generated By:JavaCC: Do not edit this line. TokenMgrError.h Version 6.2 */
 /* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
 #ifndef _TOKENMGRERROR_H
 #define _TOKENMGRERROR_H
@@ -8,7 +8,7 @@
 namespace vhdl {
 namespace parser {
 
- enum LexerErrors {
+enum LexerErrors {
   /**
    * Lexical error occurred.
    */
@@ -28,11 +28,10 @@ namespace parser {
    * Detected (and bailed out of) an infinite loop in the token manager.
    */
   LOOP_DETECTED = 3,
-  };
+};
 
-class TokenMgrError
-{
-  public:
+class TokenMgrError {
+public:
   /*
    * Ordinals for various reasons why an Error of this type can be thrown.
    */
@@ -57,7 +56,8 @@ class TokenMgrError
    */
     JAVACC_STRING_TYPE LexicalError(bool EOFSeen, int lexState, int errorLine, int errorColumn, JAVACC_STRING_TYPE errorAfter, JAVACC_CHAR_TYPE curChar);
 
-  private: JAVACC_STRING_TYPE message;
+private:
+   JAVACC_STRING_TYPE message;
 
   /**
    * You can also modify the body of this method to customize your error messages.
@@ -68,6 +68,7 @@ class TokenMgrError
    *
    * from this method for such cases in the release version of your parser.
    */
+public:
   JAVACC_STRING_TYPE getMessage() ;
 
   /*
@@ -75,16 +76,16 @@ class TokenMgrError
    */
 
   /** No arg constructor. */
-  public: TokenMgrError() ;
+  TokenMgrError() ;
 
   /** Constructor with message and reason. */
-  public: TokenMgrError(JAVACC_STRING_TYPE message, int reason) ;
+  TokenMgrError(JAVACC_STRING_TYPE message, int reason) ;
 
   /** Full Constructor. */
-  public: TokenMgrError(bool EOFSeen, int lexState, int errorLine, int errorColumn, JAVACC_STRING_TYPE errorAfter, JAVACC_CHAR_TYPE curChar, int reason) ;
+  TokenMgrError(bool EOFSeen, int lexState, int errorLine, int errorColumn, JAVACC_STRING_TYPE errorAfter, JAVACC_CHAR_TYPE curChar, int reason) ;
 };
 
 }
 }
 #endif
-/* JavaCC - OriginalChecksum=c7d825cb4d037b031ae43569d383f738 (do not edit this line) */
+/* JavaCC - OriginalChecksum=c22a1b25630ec91deb47dcba22b6b39d (do not edit this line) */
index 4cf8ec0..b360217 100644 (file)
@@ -1,5 +1,6 @@
 /* VhdlParser.cc */
-#include "./VhdlParser.h"
+#include "VhdlParser.h"
+#include "TokenMgrError.h"
 namespace vhdl {
 namespace parser {
   unsigned int jj_la1_0[] = {
@@ -61,7 +62,7 @@ return tok->image.c_str();
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::access_type_definition() {Token *tok=0;QCString str,str1;if (!hasError) {
@@ -75,7 +76,7 @@ QCString VhdlParser::access_type_definition() {Token *tok=0;QCString str,str1;if
     
 str=tok->image.c_str(); return str+str1;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::actual_designator() {QCString str;Token *t=0;
@@ -117,7 +118,7 @@ return str;
       }
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::actual_parameter_part() {QCString s;if (!hasError) {
@@ -127,7 +128,7 @@ QCString VhdlParser::actual_parameter_part() {QCString s;if (!hasError) {
     
 return s;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::actual_part() {QCString s,s1;
@@ -186,7 +187,7 @@ s+="(";s+=s1+")";return s;
       }
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::adding_operator() {
@@ -230,7 +231,7 @@ return "&";
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::aggregate() {QCString s,s1,s2;if (!hasError) {
@@ -275,7 +276,7 @@ s+=","+s1;
     
 return "("+s+")";
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::alias_declaration() {QCString s,s1,s2;if (!hasError) {
@@ -357,7 +358,7 @@ addVhdlType(s2.data(),getLine(ALIAS_T),Entry::VARIABLE_SEC,VhdlDocGen::ALIAS,0,s
 
  return s2+" "+s+";";
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::alias_designator() {Token *tok=0;QCString s;
@@ -402,7 +403,7 @@ return s;
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 void VhdlParser::allocator() {
@@ -434,7 +435,7 @@ void VhdlParser::allocator() {
         errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
       }
     }
-  }
+}
 
 
 void VhdlParser::architecture_body() {QCString s,s1;if (!hasError) {
@@ -462,7 +463,7 @@ void VhdlParser::architecture_body() {QCString s,s1;if (!hasError) {
 QCString t=s1+"::"+s;
                   genLabels.resize(0);
                   pushLabel(genLabels,s1);
-                  lastCompound=current;
+                  lastCompound=current.get();
                   addVhdlType(t,getLine(ARCHITECTURE_T),Entry::CLASS_SEC,VhdlDocGen::ARCHITECTURE,0,0,Private);
     }
     if (!hasError) {
@@ -527,7 +528,7 @@ error_skipto(BEGIN_T);
     }
     
 lastEntity=0;lastCompound=0; genLabels.resize(0);
-  }
+}
 
 
 void VhdlParser::architecture_declarative_part() {if (!hasError) {
@@ -567,7 +568,7 @@ void VhdlParser::architecture_declarative_part() {if (!hasError) {
     end_label_2: ;
     }
     
-  }
+}
 
 
 void VhdlParser::architecture_statement_part() {if (!hasError) {
@@ -600,7 +601,7 @@ void VhdlParser::architecture_statement_part() {if (!hasError) {
     end_label_3: ;
     }
     
-  }
+}
 
 
 QCString VhdlParser::array_type_definition() {QCString s;
@@ -633,7 +634,7 @@ return s;
       }
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::assertion() {QCString s,s1,s2;Token *t=0;Token *t1=0;if (!hasError) {
@@ -688,7 +689,7 @@ s.prepend("assert ");
    if(t1) s2.prepend(" report ");
     return s+s1+s2;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::assertion_statement() {QCString s,s1,s2;Token *t=0;if (!hasError) {
@@ -723,7 +724,7 @@ QCString VhdlParser::assertion_statement() {QCString s,s1,s2;Token *t=0;if (!has
 if(t) s+=":";
     return s+s1+";";
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::association_element() {QCString s,s1;if (!hasError) {
@@ -748,7 +749,7 @@ QCString VhdlParser::association_element() {QCString s,s1;if (!hasError) {
     
 return s+" => "+s1;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::association_list() {QCString s,s1;if (!hasError) {
@@ -785,7 +786,7 @@ s+=","+s1;
     
 return s;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::attribute_declaration() {QCString s,s1;if (!hasError) {
@@ -812,7 +813,7 @@ QCString VhdlParser::attribute_declaration() {QCString s,s1;if (!hasError) {
 addVhdlType(s.data(),getLine(ATTRIBUTE_T),Entry::VARIABLE_SEC,VhdlDocGen::ATTRIBUTE,0,s1.data(),Public);
     return " attribute "+s+":"+s1+";";
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::attribute_designator() {QCString s;Token *tok=0;
@@ -846,7 +847,7 @@ return tok->image.c_str();
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::attribute_name() {QCString s,s1;if (!hasError) {
@@ -895,7 +896,7 @@ s+"("+s1+")";
     
 return s;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::attribute_specification() {QCString s,s1,s2;if (!hasError) {
@@ -931,7 +932,7 @@ QCString t= s1+" is "+s2;
    addVhdlType(s.data(),getLine(ATTRIBUTE_T),Entry::VARIABLE_SEC,VhdlDocGen::ATTRIBUTE,0,t.data(),Public);
    return " attribute "+s+" of "+s1+ " is "+s2+";";
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::base() {Token *tok=0;if (!hasError) {
@@ -941,7 +942,7 @@ QCString VhdlParser::base() {Token *tok=0;if (!hasError) {
     
 return tok->image.c_str();
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::base_specifier() {Token *tok=0;if (!hasError) {
@@ -951,7 +952,7 @@ QCString VhdlParser::base_specifier() {Token *tok=0;if (!hasError) {
     
 return tok->image.c_str();
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::base_unit_declaration() {QCString s;if (!hasError) {
@@ -961,7 +962,7 @@ QCString VhdlParser::base_unit_declaration() {QCString s;if (!hasError) {
     
 return s;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::based_integer() {Token *tok=0;if (!hasError) {
@@ -971,7 +972,7 @@ QCString VhdlParser::based_integer() {Token *tok=0;if (!hasError) {
     
 return tok->image.c_str();
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::based_literal() {Token *tok=0;if (!hasError) {
@@ -981,7 +982,7 @@ QCString VhdlParser::based_literal() {Token *tok=0;if (!hasError) {
     
 return tok->image.c_str();
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::basic_identifier() {Token *tok=0;if (!hasError) {
@@ -991,7 +992,7 @@ QCString VhdlParser::basic_identifier() {Token *tok=0;if (!hasError) {
     
 return tok->image.c_str();
 assert(false);
-  }
+}
 
 
 void VhdlParser::binding_indication() {if (!hasError) {
@@ -1044,7 +1045,7 @@ void VhdlParser::binding_indication() {if (!hasError) {
     }
     }
     
-  }
+}
 
 
 QCString VhdlParser::bit_string_literal() {Token *tok=0;if (!hasError) {
@@ -1054,7 +1055,7 @@ QCString VhdlParser::bit_string_literal() {Token *tok=0;if (!hasError) {
     
 return tok->image.c_str();
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::bit_value() {Token *tok=0;if (!hasError) {
@@ -1064,7 +1065,7 @@ QCString VhdlParser::bit_value() {Token *tok=0;if (!hasError) {
     
 return tok->image.c_str();
 assert(false);
-  }
+}
 
 
 void VhdlParser::block_configuration() {if (!hasError) {
@@ -1126,7 +1127,7 @@ void VhdlParser::block_configuration() {if (!hasError) {
     jj_consume_token(SEMI_T);
     }
     
-  }
+}
 
 
 void VhdlParser::block_declarative_item() {
@@ -1260,7 +1261,7 @@ void VhdlParser::block_declarative_item() {
         }
       }
     }
-  }
+}
 
 
 void VhdlParser::block_declarative_part() {if (!hasError) {
@@ -1300,7 +1301,7 @@ void VhdlParser::block_declarative_part() {if (!hasError) {
     end_label_7: ;
     }
     
-  }
+}
 
 
 void VhdlParser::block_header() {if (!hasError) {
@@ -1368,7 +1369,7 @@ void VhdlParser::block_header() {if (!hasError) {
     }
     }
     
-  }
+}
 
 
 void VhdlParser::block_specification() {if (!hasError) {
@@ -1399,7 +1400,7 @@ void VhdlParser::block_specification() {if (!hasError) {
     }
     }
     
-  }
+}
 
 
 void VhdlParser::block_statement() {QCString s;if (!hasError) {
@@ -1502,7 +1503,7 @@ pushLabel(genLabels,s);
     }
     
 genLabels=popLabel(genLabels);
-  }
+}
 
 
 void VhdlParser::block_statement_part() {if (!hasError) {
@@ -1535,7 +1536,7 @@ void VhdlParser::block_statement_part() {if (!hasError) {
     end_label_8: ;
     }
     
-  }
+}
 
 
 void VhdlParser::case_statement() {QCString s;if (!hasError) {
@@ -1629,7 +1630,7 @@ QCString ca="case "+s;
     
 FlowChart::moveToPrevLevel();
          FlowChart::addFlowChart(FlowChart::END_CASE,"end case",0);
-  }
+}
 
 
 void VhdlParser::case_statement_alternative() {QCString s;if (!hasError) {
@@ -1656,7 +1657,7 @@ QCString t="when ";
     }
     
 FlowChart::moveToPrevLevel();
-  }
+}
 
 
 QCString VhdlParser::character_literal() {Token *tok=0;if (!hasError) {
@@ -1666,7 +1667,7 @@ QCString VhdlParser::character_literal() {Token *tok=0;if (!hasError) {
     
 return tok->image.c_str();
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::choice() {QCString s;
@@ -1717,7 +1718,7 @@ return " others ";
       }
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::choices() {QCString s,s1;if (!hasError) {
@@ -1754,7 +1755,7 @@ s+="|";s+=s1;
     
 return s;
 assert(false);
-  }
+}
 
 
 void VhdlParser::component_configuration() {if (!hasError) {
@@ -1815,7 +1816,7 @@ void VhdlParser::component_configuration() {if (!hasError) {
     jj_consume_token(SEMI_T);
     }
     
-  }
+}
 
 
 void VhdlParser::component_declaration() {QCString s;if (!hasError) {
@@ -1909,7 +1910,7 @@ addVhdlType(s.data(),getLine(COMPONENT_T),Entry::VARIABLE_SEC,VhdlDocGen::COMPON
     jj_consume_token(SEMI_T);
     }
     
-  }
+}
 
 
 void VhdlParser::component_instantiation_statement() {QCString s,s1;if (!hasError) {
@@ -1965,7 +1966,7 @@ QCString s3;
     jj_consume_token(SEMI_T);
     }
     
-  }
+}
 
 
 void VhdlParser::component_specification() {if (!hasError) {
@@ -1981,7 +1982,7 @@ void VhdlParser::component_specification() {if (!hasError) {
     name();
     }
     
-  }
+}
 
 
 QCString VhdlParser::composite_type_definition() {QCString s,s1;
@@ -2014,7 +2015,7 @@ return s+"#";
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 void VhdlParser::concurrent_assertion_statement() {if (!hasError) {
@@ -2056,7 +2057,7 @@ void VhdlParser::concurrent_assertion_statement() {if (!hasError) {
     jj_consume_token(SEMI_T);
     }
     
-  }
+}
 
 
 void VhdlParser::concurrent_procedure_call_statement() {if (!hasError) {
@@ -2098,7 +2099,7 @@ void VhdlParser::concurrent_procedure_call_statement() {if (!hasError) {
     jj_consume_token(SEMI_T);
     }
     
-  }
+}
 
 
 void VhdlParser::concurrent_signal_assignment_statement() {if (!hasError) {
@@ -2155,7 +2156,7 @@ void VhdlParser::concurrent_signal_assignment_statement() {if (!hasError) {
     }
     }
     
-  }
+}
 
 
 void VhdlParser::concurrent_statement() {
@@ -2222,7 +2223,7 @@ void VhdlParser::concurrent_statement() {
         }
       }
     }
-  }
+}
 
 
 QCString VhdlParser::condition() {QCString s;if (!hasError) {
@@ -2232,7 +2233,7 @@ QCString VhdlParser::condition() {QCString s;if (!hasError) {
     
 return s;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::condition_clause() {QCString s;if (!hasError) {
@@ -2246,7 +2247,7 @@ QCString VhdlParser::condition_clause() {QCString s;if (!hasError) {
     
 return " until "+s;
 assert(false);
-  }
+}
 
 
 void VhdlParser::conditional_signal_assignment() {if (!hasError) {
@@ -2270,7 +2271,7 @@ void VhdlParser::conditional_signal_assignment() {if (!hasError) {
     jj_consume_token(SEMI_T);
     }
     
-  }
+}
 
 
 void VhdlParser::conditional_waveforms() {if (!hasError) {
@@ -2324,7 +2325,7 @@ void VhdlParser::conditional_waveforms() {if (!hasError) {
     }
     }
     
-  }
+}
 
 
 void VhdlParser::configuration_declaration() {QCString s,s1;if (!hasError) {
@@ -2403,7 +2404,7 @@ confName=s+"::"+s1;
     }
     
 genLabels.resize(0); confName="";
-  }
+}
 
 
 void VhdlParser::configuration_declarative_item() {
@@ -2434,7 +2435,7 @@ void VhdlParser::configuration_declarative_item() {
       jj_consume_token(-1);
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
-  }
+}
 
 
 void VhdlParser::configuration_declarative_part() {if (!hasError) {
@@ -2459,7 +2460,7 @@ void VhdlParser::configuration_declarative_part() {if (!hasError) {
     end_label_12: ;
     }
     
-  }
+}
 
 
 void VhdlParser::configuration_item() {
@@ -2483,7 +2484,7 @@ void VhdlParser::configuration_item() {
         errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
       }
     }
-  }
+}
 
 
 void VhdlParser::configuration_specification() {if (!hasError) {
@@ -2503,7 +2504,7 @@ void VhdlParser::configuration_specification() {if (!hasError) {
     jj_consume_token(SEMI_T);
     }
     
-  }
+}
 
 
 QCString VhdlParser::constant_declaration() {QCString s,s1,s2;Token *t=0;if (!hasError) {
@@ -2553,7 +2554,7 @@ if(t)
      it.prepend("constant ");
      return it;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::constraint_array_definition() {QCString s,s1;if (!hasError) {
@@ -2575,7 +2576,7 @@ QCString VhdlParser::constraint_array_definition() {QCString s,s1;if (!hasError)
     
 return s+" "+s1;
 assert(false);
-  }
+}
 
 
 void VhdlParser::context_clause() {if (!hasError) {
@@ -2599,7 +2600,7 @@ void VhdlParser::context_clause() {if (!hasError) {
     end_label_13: ;
     }
     
-  }
+}
 
 
 QCString VhdlParser::constraint() {QCString s;
@@ -2626,7 +2627,7 @@ return s;
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 void VhdlParser::context_item() {
@@ -2650,7 +2651,7 @@ void VhdlParser::context_item() {
       jj_consume_token(-1);
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
-  }
+}
 
 
 QCString VhdlParser::decimal_literal() {Token *tok=0;if (!hasError) {
@@ -2660,7 +2661,7 @@ QCString VhdlParser::decimal_literal() {Token *tok=0;if (!hasError) {
     
 return tok->image.c_str();
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::delay_mechanism() {QCString s;
@@ -2717,7 +2718,7 @@ return s+" inertial ";
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 void VhdlParser::design_file() {
@@ -2772,7 +2773,7 @@ void VhdlParser::design_file() {
       jj_consume_token(-1);
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
-  }
+}
 
 
 void VhdlParser::design_unit() {if (!hasError) {
@@ -2784,7 +2785,7 @@ void VhdlParser::design_unit() {if (!hasError) {
     library_unit();
     }
     
-  }
+}
 
 
 QCString VhdlParser::designator() {QCString s;
@@ -2818,7 +2819,7 @@ return s;
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::direction() {Token *tok=0;
@@ -2851,7 +2852,7 @@ return tok->image.c_str();
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 void VhdlParser::disconnection_specification() {if (!hasError) {
@@ -2875,7 +2876,7 @@ void VhdlParser::disconnection_specification() {if (!hasError) {
     jj_consume_token(SEMI_T);
     }
     
-  }
+}
 
 
 void VhdlParser::guarded_signal_specificatio() {if (!hasError) {
@@ -2891,7 +2892,7 @@ void VhdlParser::guarded_signal_specificatio() {if (!hasError) {
     name();
     }
     
-  }
+}
 
 
 QCString VhdlParser::discrete_range() {QCString s;
@@ -2918,7 +2919,7 @@ return s;
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::element_association() {QCString s,s1;if (!hasError) {
@@ -2945,7 +2946,7 @@ if(!s.isEmpty())
  return s+"=>"+s1;
 return s1;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::element_declaration() {QCString s,s1;if (!hasError) {
@@ -2969,7 +2970,7 @@ addVhdlType(s.data(),getLine(),Entry::VARIABLE_SEC,VhdlDocGen::RECORD,0,s1.data(
   //addVhdlType(s.data(),getLine(),Entry::VARIABLE_SEC,VhdlDocGen::VFILE,0,s1.data(),Public);
   return s+":"+s1;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::entity_aspect() {Token *tok=0;QCString s,s1;
@@ -3048,7 +3049,7 @@ return tok->image.c_str();
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::entity_class() {
@@ -3246,7 +3247,7 @@ return "file";
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::entity_class_entry() {QCString s;if (!hasError) {
@@ -3275,7 +3276,7 @@ s+="<>";
     
 return s;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::entity_class_entry_list() {QCString s,s1,s2;if (!hasError) {
@@ -3319,7 +3320,7 @@ s2+=",";s2+=s;
     
 return s1+s2;
 assert(false);
-  }
+}
 
 
 void VhdlParser::entity_declaration() {QCString s;if (!hasError) {
@@ -3336,7 +3337,7 @@ void VhdlParser::entity_declaration() {QCString s;if (!hasError) {
     }
     if (!hasError) {
     
-lastEntity=current;
+lastEntity=current.get();
                 lastCompound=0;
                 addVhdlType(s.data(),getLine(ENTITY_T),Entry::CLASS_SEC,VhdlDocGen::ENTITY,0,0,Public);
     }
@@ -3410,7 +3411,7 @@ lastEntity=current;
     }
     
 lastEntity=0;lastCompound=0; genLabels.resize(0);
-  }
+}
 
 
 void VhdlParser::entity_declarative_item() {
@@ -3555,7 +3556,7 @@ void VhdlParser::entity_declarative_item() {
         }
       }
     }
-  }
+}
 
 
 void VhdlParser::entity_declarative_part() {if (!hasError) {
@@ -3595,7 +3596,7 @@ void VhdlParser::entity_declarative_part() {if (!hasError) {
     end_label_16: ;
     }
     
-  }
+}
 
 
 QCString VhdlParser::entity_designator() {QCString s,s1;if (!hasError) {
@@ -3620,7 +3621,7 @@ QCString VhdlParser::entity_designator() {QCString s,s1;if (!hasError) {
     
 return s+s1;
 assert(false);
-  }
+}
 
 
 void VhdlParser::entity_header() {if (!hasError) {
@@ -3662,7 +3663,7 @@ currP=VhdlDocGen::PORT;
     }
     }
     
-  }
+}
 
 
 QCString VhdlParser::entity_name_list() {QCString s,s1;
@@ -3733,7 +3734,7 @@ return "all";
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::entity_specification() {QCString s,s1;if (!hasError) {
@@ -3751,7 +3752,7 @@ QCString VhdlParser::entity_specification() {QCString s,s1;if (!hasError) {
     
 return s+":"+s1;
 assert(false);
-  }
+}
 
 
 void VhdlParser::entity_statement() {
@@ -3784,7 +3785,7 @@ void VhdlParser::entity_statement() {
         errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
       }
     }
-  }
+}
 
 
 void VhdlParser::entity_statement_part() {if (!hasError) {
@@ -3813,7 +3814,7 @@ void VhdlParser::entity_statement_part() {if (!hasError) {
     end_label_18: ;
     }
     
-  }
+}
 
 
 QCString VhdlParser::entity_tag() {QCString s;
@@ -3849,7 +3850,7 @@ return s;
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::enumeration_literal() {QCString s;
@@ -3883,7 +3884,7 @@ return s;
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::enumeration_type_definition() {QCString s,s1;if (!hasError) {
@@ -3928,7 +3929,7 @@ s+=",";s+=s1;
     
 return "("+s+")";
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::exit_statement() {QCString s,s1,s2;Token *t=0;Token *t1=0;if (!hasError) {
@@ -4002,7 +4003,7 @@ lab.resize(0);
 
   return s+s1+s2+";";
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::expression() {QCString s,s1,s2;if (!hasError) {
@@ -4044,7 +4045,7 @@ s+=s1;s+=s2;
     
 return s;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::logop() {
@@ -4121,7 +4122,7 @@ return "or" ;
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::extended_identifier() {Token *t;if (!hasError) {
@@ -4131,7 +4132,7 @@ QCString VhdlParser::extended_identifier() {Token *t;if (!hasError) {
     
 return t->image.c_str();
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::factor() {QCString s,s1;
@@ -4217,7 +4218,7 @@ s1="not ";return s1+s;
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::file_declaration() {QCString s,s1,s2,s3;if (!hasError) {
@@ -4261,7 +4262,7 @@ QCString t1=s2+" "+s3;
    addVhdlType(s.data(),getLine(),Entry::VARIABLE_SEC,VhdlDocGen::VFILE,0,t1.data(),Public);
    return " file "+s+":"+s2+" "+s3+";";
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::file_logical_name() {QCString s;if (!hasError) {
@@ -4271,7 +4272,7 @@ QCString VhdlParser::file_logical_name() {QCString s;if (!hasError) {
     
 return s;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::file_open_information() {QCString s,s1,s2;if (!hasError) {
@@ -4304,7 +4305,7 @@ QCString VhdlParser::file_open_information() {QCString s,s1,s2;if (!hasError) {
     
 s2="open "+s+" is "+s1;  return s2;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::file_type_definition() {QCString s,s1;if (!hasError) {
@@ -4322,7 +4323,7 @@ QCString VhdlParser::file_type_definition() {QCString s,s1;if (!hasError) {
     
 s1=" file of "+s; return s1;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::floating_type_definition() {QCString s;if (!hasError) {
@@ -4332,7 +4333,7 @@ QCString VhdlParser::floating_type_definition() {QCString s;if (!hasError) {
     
 return s;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::formal_designator() {QCString s;Token *tok=0;
@@ -4368,7 +4369,7 @@ return tok->image.c_str();
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::formal_parameter_list() {QCString s;if (!hasError) {
@@ -4378,7 +4379,7 @@ QCString VhdlParser::formal_parameter_list() {QCString s;if (!hasError) {
     
 return s;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::formal_part() {QCString s,s1;if (!hasError) {
@@ -4415,7 +4416,7 @@ s+"("+s1+")";
     
 return s;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::full_type_declaration() {Entry *tmpEntry;QCString s,s1,s2;if (!hasError) {
@@ -4432,7 +4433,7 @@ QCString VhdlParser::full_type_declaration() {Entry *tmpEntry;QCString s,s1,s2;i
     }
     if (!hasError) {
     
-tmpEntry=current;
+tmpEntry=current.get();
   addVhdlType(s.data(),getLine(),Entry::VARIABLE_SEC,VhdlDocGen::RECORD,0,0,Public);
     }
     if (!hasError) {
@@ -4471,7 +4472,7 @@ if (s2.contains("#")) {
       tmpEntry=0;
       return "type "+s+" is "+s2+";";
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::function_call() {QCString s,s1;if (!hasError) {
@@ -4493,7 +4494,7 @@ QCString VhdlParser::function_call() {QCString s,s1;if (!hasError) {
     
 return s+"("+s1+")";
 assert(false);
-  }
+}
 
 
 void VhdlParser::generate_statement() {QCString s;if (!hasError) {
@@ -4557,7 +4558,7 @@ error_skipto(GENERATE_T);
     }
     
 genLabels=popLabel(genLabels);
-  }
+}
 
 
 void VhdlParser::generate_scheme() {
@@ -4589,7 +4590,7 @@ void VhdlParser::generate_scheme() {
       jj_consume_token(-1);
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
-  }
+}
 
 
 void VhdlParser::generic_clause() {QCString s;if (!hasError) {
@@ -4618,7 +4619,7 @@ parse_sec=GEN_SEC;
     }
     
 parse_sec=0;
-  }
+}
 
 
 QCString VhdlParser::generic_list() {QCString s;if (!hasError) {
@@ -4628,7 +4629,7 @@ QCString VhdlParser::generic_list() {QCString s;if (!hasError) {
     
 return s;
 assert(false);
-  }
+}
 
 
 void VhdlParser::generic_map_aspect() {if (!hasError) {
@@ -4652,7 +4653,7 @@ void VhdlParser::generic_map_aspect() {if (!hasError) {
     jj_consume_token(RPAREN_T);
     }
     
-  }
+}
 
 
 QCString VhdlParser::group_constituent() {QCString s;
@@ -4688,7 +4689,7 @@ return s;
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::group_constituent_list() {QCString s,s1,s2;if (!hasError) {
@@ -4728,7 +4729,7 @@ s2+=",";s2+=s1;
     
 return s+s2;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::group_declaration() {QCString s,s1,s2;if (!hasError) {
@@ -4766,7 +4767,7 @@ QCString VhdlParser::group_declaration() {QCString s,s1,s2;if (!hasError) {
     
 return "group "+s+":"+s1+"("+s2+");";
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::group_template_declaration() {QCString s,s1;if (!hasError) {
@@ -4800,7 +4801,7 @@ QCString VhdlParser::group_template_declaration() {QCString s,s1;if (!hasError)
     
 return "group "+s+ "is ("+s1+");";
 assert(false);
-  }
+}
 
 
 void VhdlParser::guarded_signal_specification() {if (!hasError) {
@@ -4816,7 +4817,7 @@ void VhdlParser::guarded_signal_specification() {if (!hasError) {
     type_mark();
     }
     
-  }
+}
 
 
 QCString VhdlParser::identifier() {Token *tok=0;
@@ -4849,7 +4850,7 @@ return tok->image.c_str();
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::identifier_list() {QCString str,str1;if (!hasError) {
@@ -4886,7 +4887,7 @@ str+=",";str+=str1;
     
 return str;
 assert(false);
-  }
+}
 
 
 void VhdlParser::if_statement() {QCString s,s1;if (!hasError) {
@@ -5020,7 +5021,7 @@ FlowChart::addFlowChart(FlowChart::ELSE_NO,0,0);
     
 FlowChart::moveToPrevLevel();
           FlowChart::addFlowChart(FlowChart::ENDIF_NO,0,0);
-  }
+}
 
 
 QCString VhdlParser::incomplete_type_declaration() {QCString s;if (!hasError) {
@@ -5038,7 +5039,7 @@ QCString VhdlParser::incomplete_type_declaration() {QCString s;if (!hasError) {
     
 return "type "+s+";";
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::index_constraint() {QCString s="("; QCString s1,s2;if (!hasError) {
@@ -5087,7 +5088,7 @@ s+=",";s+=s1;
     
 return s+")";
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::index_specification() {QCString s;
@@ -5135,7 +5136,7 @@ return s;
       }
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::index_subtype_definition() {QCString s;if (!hasError) {
@@ -5153,7 +5154,7 @@ QCString VhdlParser::index_subtype_definition() {QCString s;if (!hasError) {
     
 return s+" range <> ";
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::instantiation_unit() {QCString s,s1,s2;Token *tok;
@@ -5268,7 +5269,7 @@ s1="configuration ";return s;
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::instantiation_list() {QCString s;Token *tok=0;
@@ -5313,7 +5314,7 @@ return tok->image.c_str();
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::integer() {Token *t;if (!hasError) {
@@ -5323,7 +5324,7 @@ QCString VhdlParser::integer() {Token *t;if (!hasError) {
     
 return t->image.c_str();
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::integer_type_definition() {QCString s;if (!hasError) {
@@ -5333,7 +5334,7 @@ QCString VhdlParser::integer_type_definition() {QCString s;if (!hasError) {
     
 return s;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::interface_declaration() {QCString s,s1;
@@ -5422,7 +5423,7 @@ if (parse_sec==GEN_SEC)
       }
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::interface_element() {QCString s;if (!hasError) {
@@ -5432,7 +5433,7 @@ QCString VhdlParser::interface_element() {QCString s;if (!hasError) {
     
 return s;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::interface_file_declaration() {QCString s,s1;if (!hasError) {
@@ -5455,7 +5456,7 @@ QCString VhdlParser::interface_file_declaration() {QCString s,s1;if (!hasError)
 addVhdlType(s.data(),getLine(),Entry::VARIABLE_SEC,VhdlDocGen::VFILE,0,s1.data(),Public);
    return " file "+s+":"+s1;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::interface_list() {QCString s,s1,s2;if (!hasError) {
@@ -5492,7 +5493,7 @@ s2+=";";s2+=s1;
     
 return s+s2;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::interface_variable_declaration() {Token *tok=0;Token *tok1=0;Token *tok2=0;QCString s,s1,s2,s3,s4,s5;if (!hasError) {
@@ -5640,7 +5641,7 @@ if(tok)
                     } // if component
               return it;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::iteration_scheme() {QCString s;
@@ -5687,7 +5688,7 @@ QCString q=lab+" for "+s;
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::label() {QCString s;if (!hasError) {
@@ -5697,7 +5698,7 @@ QCString VhdlParser::label() {QCString s;if (!hasError) {
     
 return s;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::library_clause() {QCString s;if (!hasError) {
@@ -5723,7 +5724,7 @@ if ( parse_sec==0 && Config_getBool(SHOW_INCLUDE_FILES) )
                    QCString s1="library "+s;
                    return s1;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::library_unit() {QCString s;
@@ -5764,7 +5765,7 @@ return s;
       }
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::literal() {QCString s;
@@ -5826,7 +5827,7 @@ return "null";
       }
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::logical_operator() {QCString s;if (!hasError) {
@@ -5836,7 +5837,7 @@ QCString VhdlParser::logical_operator() {QCString s;if (!hasError) {
     
 return s;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::loop_statement() {QCString s,s1,s2,s3;if (!hasError) {
@@ -5927,7 +5928,7 @@ QCString q = s+" loop "+s2+" end loop" +s3;
          FlowChart::addFlowChart(FlowChart::END_LOOP,endLoop.data(),0);
         return q;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::miscellaneous_operator() {Token *t=0;
@@ -5971,7 +5972,7 @@ return "not";
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::mode() {Token *tok=0;
@@ -6037,7 +6038,7 @@ return "linkage";
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::multiplying_operation() {Token *tok=0;
@@ -6092,7 +6093,7 @@ return tok->image.c_str();
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::name() {QCString s,s1;if (!hasError) {
@@ -6144,7 +6145,7 @@ s+=s1;
     
 return s;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::name_ext1() {QCString s,s1,s2;if (!hasError) {
@@ -6173,13 +6174,26 @@ s+=s1;
     
 return s;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::name_ext() {QCString s,s1,s2;if (!hasError) {
     
     if (jj_2_49(2147483647)) {if (!hasError) {
       
+      jj_consume_token(APOSTROPHE_T);
+      }
+      if (!hasError) {
+      
+      jj_consume_token(SUBTYPE_T);
+      }
+      if (!hasError) {
+      
+s+="'subtype";
+      }
+      
+    } else if (jj_2_50(2147483647)) {if (!hasError) {
+      
       jj_consume_token(DOT_T);
       }
       if (!hasError) {
@@ -6191,7 +6205,7 @@ QCString VhdlParser::name_ext() {QCString s,s1,s2;if (!hasError) {
 s+=".";s+=s1;
       }
       
-    } else if (jj_2_50(2147483647)) {if (!hasError) {
+    } else if (jj_2_51(2147483647)) {if (!hasError) {
       
       s1 = test_att_name();
       }
@@ -6200,7 +6214,7 @@ s+=".";s+=s1;
 s+=s1;
       }
       
-    } else if (jj_2_51(2147483647)) {if (!hasError) {
+    } else if (jj_2_52(2147483647)) {if (!hasError) {
       
       jj_consume_token(LPAREN_T);
       }
@@ -6217,7 +6231,7 @@ s+=s1;
 s+="(";s+=s1;s+=")";
       }
       
-    } else if (jj_2_52(2147483647)) {if (!hasError) {
+    } else if (jj_2_53(2147483647)) {if (!hasError) {
       
       jj_consume_token(LPAREN_T);
       }
@@ -6273,12 +6287,12 @@ s+=")";
     
 return s;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::test_att_name() {QCString s,s1;if (!hasError) {
     
-    if (jj_2_53(2147483647)) {if (!hasError) {
+    if (jj_2_54(2147483647)) {if (!hasError) {
       
       s1 = signature();
       }
@@ -6333,7 +6347,7 @@ s+="(";s+=s1;s+=")";
     
 return s;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::indexed_name() {QCString s,s1,s2;if (!hasError) {
@@ -6386,7 +6400,7 @@ s+=",";s+=s1;
     
 return s+")";
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::next_statement() {QCString s,s1,s2;Token *t=0;Token *t1=0;if (!hasError) {
@@ -6459,7 +6473,7 @@ if(t) s+=":";
   if(t1) s2.prepend("when ");
   return s+s1+s2+";";
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::null_statement() {QCString s;if (!hasError) {
@@ -6497,11 +6511,11 @@ s+=":";
     
 return s+="null";
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::numeric_literal() {QCString s;
-    if (jj_2_54(2147483647)) {if (!hasError) {
+    if (jj_2_55(2147483647)) {if (!hasError) {
       
       s = physical_literal();
       }
@@ -6532,7 +6546,7 @@ return s;
       }
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::object_class() {
@@ -6613,7 +6627,7 @@ return "type";
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::operator_symbol() {Token *tok=0;if (!hasError) {
@@ -6623,7 +6637,7 @@ QCString VhdlParser::operator_symbol() {Token *tok=0;if (!hasError) {
     
 return tok->image.c_str();
 assert(false);
-  }
+}
 
 
 void VhdlParser::options() {if (!hasError) {
@@ -6659,7 +6673,7 @@ void VhdlParser::options() {if (!hasError) {
     }
     }
     
-  }
+}
 
 
 void VhdlParser::package_body() {QCString s;if (!hasError) {
@@ -6680,7 +6694,7 @@ void VhdlParser::package_body() {QCString s;if (!hasError) {
     }
     if (!hasError) {
     
-lastCompound=current;
+lastCompound=current.get();
                         s.prepend("_");
                         addVhdlType(s,getLine(),Entry::CLASS_SEC,VhdlDocGen::PACKAGE_BODY,0,0,Protected);
     }
@@ -6735,7 +6749,7 @@ lastCompound=current;
     }
     
 lastCompound=0; genLabels.resize(0);
-  }
+}
 
 
 void VhdlParser::package_body_declarative_item() {
@@ -6802,7 +6816,7 @@ void VhdlParser::package_body_declarative_item() {
       }
     default:
       jj_la1[152] = jj_gen;
-      if (jj_2_55(3)) {if (!hasError) {
+      if (jj_2_56(3)) {if (!hasError) {
         
         group_template_declaration();
         }
@@ -6823,7 +6837,7 @@ void VhdlParser::package_body_declarative_item() {
         }
       }
     }
-  }
+}
 
 
 void VhdlParser::package_body_declarative_part() {if (!hasError) {
@@ -6858,7 +6872,7 @@ void VhdlParser::package_body_declarative_part() {if (!hasError) {
     end_label_29: ;
     }
     
-  }
+}
 
 
 void VhdlParser::package_declaration() {QCString s;if (!hasError) {
@@ -6875,15 +6889,15 @@ void VhdlParser::package_declaration() {QCString s;if (!hasError) {
     }
     if (!hasError) {
     
-lastCompound=current;
-                          Entry *clone=new Entry(*current);
+lastCompound=current.get();
+                          std::shared_ptr<Entry> clone=std::make_shared<Entry>(*current);
                           clone->section=Entry::NAMESPACE_SEC;
                           clone->spec=VhdlDocGen::PACKAGE;
                           clone->name=s;
                           clone->startLine=getLine(PACKAGE_T);
                           clone->bodyLine=getLine(PACKAGE_T);
                           clone->protection=Package;
-                          current_root->addSubEntry(clone);
+                          current_root->moveToSubEntryAndKeep(clone);
                           addVhdlType(s,getLine(PACKAGE_T),Entry::CLASS_SEC,VhdlDocGen::PACKAGE,0,0,Package);
     }
     if (!hasError) {
@@ -6933,7 +6947,7 @@ lastCompound=current;
     }
     
 lastEntity=0;lastCompound=0; genLabels.resize(0);
-  }
+}
 
 
 void VhdlParser::geninter() {if (!hasError) {
@@ -6975,7 +6989,7 @@ void VhdlParser::geninter() {if (!hasError) {
     }
     }
     
-  }
+}
 
 
 void VhdlParser::package_declarative_item() {
@@ -7049,7 +7063,7 @@ void VhdlParser::package_declarative_item() {
       }
     default:
       jj_la1[159] = jj_gen;
-      if (jj_2_56(2147483647)) {if (!hasError) {
+      if (jj_2_57(2147483647)) {if (!hasError) {
         
         attribute_declaration();
         }
@@ -7079,7 +7093,7 @@ void VhdlParser::package_declarative_item() {
           }
         default:
           jj_la1[160] = jj_gen;
-          if (jj_2_57(3)) {if (!hasError) {
+          if (jj_2_58(3)) {if (!hasError) {
             
             group_template_declaration();
             }
@@ -7095,7 +7109,7 @@ void VhdlParser::package_declarative_item() {
               }
             default:
               jj_la1[161] = jj_gen;
-              if (jj_2_58(5)) {if (!hasError) {
+              if (jj_2_59(5)) {if (!hasError) {
                 
                 package_instantiation_declaration();
                 }
@@ -7120,7 +7134,7 @@ void VhdlParser::package_declarative_item() {
         }
       }
     }
-  }
+}
 
 
 void VhdlParser::package_declarative_part() {if (!hasError) {
@@ -7160,7 +7174,7 @@ void VhdlParser::package_declarative_part() {if (!hasError) {
     end_label_30: ;
     }
     
-  }
+}
 
 
 QCString VhdlParser::parameter_specification() {QCString s,s1;if (!hasError) {
@@ -7178,12 +7192,12 @@ QCString VhdlParser::parameter_specification() {QCString s,s1;if (!hasError) {
     
 return s+" in "+s1;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::physical_literal() {QCString s,s1;if (!hasError) {
     
-    if (jj_2_59(2147483647)) {if (!hasError) {
+    if (jj_2_60(2147483647)) {if (!hasError) {
       
       s = abstract_literal();
       }
@@ -7199,7 +7213,7 @@ QCString VhdlParser::physical_literal() {QCString s,s1;if (!hasError) {
     
 s+=" ";s+=s1;s.prepend(" "); return s;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::physical_type_definition() {QCString s,s1,s2;if (!hasError) {
@@ -7267,7 +7281,7 @@ addVhdlType(s.data(),getLine(),Entry::VARIABLE_SEC,VhdlDocGen::UNITS,0,0,Public)
     
 return s+"%";
 assert(false);
-  }
+}
 
 
 void VhdlParser::port_clause() {if (!hasError) {
@@ -7292,7 +7306,7 @@ void VhdlParser::port_clause() {if (!hasError) {
     }
     
 currP=0;
-  }
+}
 
 
 QCString VhdlParser::port_list() {QCString s;if (!hasError) {
@@ -7302,7 +7316,7 @@ QCString VhdlParser::port_list() {QCString s;if (!hasError) {
     
 return s;
 assert(false);
-  }
+}
 
 
 void VhdlParser::port_map_aspect() {if (!hasError) {
@@ -7326,11 +7340,11 @@ void VhdlParser::port_map_aspect() {if (!hasError) {
     jj_consume_token(RPAREN_T);
     }
     
-  }
+}
 
 
 QCString VhdlParser::primary() {QCString s,s1;
-    if (jj_2_60(2147483647)) {if (!hasError) {
+    if (jj_2_61(2147483647)) {if (!hasError) {
       
       s = function_call();
       }
@@ -7339,7 +7353,7 @@ QCString VhdlParser::primary() {QCString s,s1;
 return s;
       }
       
-    } else if (jj_2_61(2147483647)) {if (!hasError) {
+    } else if (jj_2_62(2147483647)) {if (!hasError) {
       
       jj_consume_token(LPAREN_T);
       }
@@ -7356,7 +7370,7 @@ return s;
 s="("+s1+")"; return s;
       }
       
-    } else if (jj_2_62(2147483647)) {if (!hasError) {
+    } else if (jj_2_63(2147483647)) {if (!hasError) {
       
       s = qualified_expression();
       }
@@ -7365,7 +7379,7 @@ s="("+s1+")"; return s;
 return s;
       }
       
-    } else if (jj_2_63(2147483647)) {if (!hasError) {
+    } else if (jj_2_64(2147483647)) {if (!hasError) {
       
       s = type_conversion();
       }
@@ -7374,7 +7388,7 @@ return s;
 return s;
       }
       
-    } else if (jj_2_64(2147483647)) {if (!hasError) {
+    } else if (jj_2_65(2147483647)) {if (!hasError) {
       
       s = literal();
       }
@@ -7383,7 +7397,7 @@ return s;
 s.prepend(" ");return s;
       }
       
-    } else if (jj_2_65(2147483647)) {if (!hasError) {
+    } else if (jj_2_66(2147483647)) {if (!hasError) {
       
       s = name();
       }
@@ -7423,7 +7437,7 @@ return s;
       }
     }
 assert(false);
-  }
+}
 
 
 void VhdlParser::primary_unit() {
@@ -7444,12 +7458,12 @@ void VhdlParser::primary_unit() {
       }
     default:
       jj_la1[167] = jj_gen;
-      if (jj_2_66(2147483647)) {if (!hasError) {
+      if (jj_2_67(2147483647)) {if (!hasError) {
         
         package_instantiation_declaration();
         }
         
-      } else if (jj_2_67(4)) {if (!hasError) {
+      } else if (jj_2_68(4)) {if (!hasError) {
         
         interface_package_declaration();
         }
@@ -7470,7 +7484,7 @@ void VhdlParser::primary_unit() {
         }
       }
     }
-  }
+}
 
 
 QCString VhdlParser::procedure_call() {QCString s,s1;if (!hasError) {
@@ -7507,12 +7521,12 @@ s1.prepend("("); s1.append(")");
     
 return s+s1;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::procedure_call_statement() {QCString s,s1;if (!hasError) {
     
-    if (jj_2_68(2)) {if (!hasError) {
+    if (jj_2_69(2)) {if (!hasError) {
       
       s = identifier();
       }
@@ -7540,7 +7554,7 @@ s+=":";
     
 return s+s1+";";
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::process_declarative_item() {QCString s;
@@ -7628,7 +7642,7 @@ return s;
       }
     default:
       jj_la1[170] = jj_gen;
-      if (jj_2_69(3)) {if (!hasError) {
+      if (jj_2_70(3)) {if (!hasError) {
         
         s = attribute_declaration();
         }
@@ -7663,7 +7677,7 @@ return s;
           }
         default:
           jj_la1[171] = jj_gen;
-          if (jj_2_70(3)) {if (!hasError) {
+          if (jj_2_71(3)) {if (!hasError) {
             
             s = group_template_declaration();
             }
@@ -7695,7 +7709,7 @@ return s;
       }
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::process_declarative_part() {QCString s,s1;if (!hasError) {
@@ -7737,7 +7751,7 @@ s+=s1;
     
 return s;
 assert(false);
-  }
+}
 
 
 void VhdlParser::process_statement() {QCString s,s1,s2;Token *tok=0;if (!hasError) {
@@ -7913,7 +7927,7 @@ if(s.isEmpty())
    currName=s;
 
    current->name=currName;
-   tempEntry=current;
+   tempEntry=current.get();
    current->endBodyLine=getLine();
    currP=0;
  if(tok)
@@ -7922,7 +7936,7 @@ if(s.isEmpty())
   createFlow();
    currName="";
    newEntry();
-  }
+}
 
 
 void VhdlParser::process_statement_part() {if (!hasError) {
@@ -7962,7 +7976,7 @@ void VhdlParser::process_statement_part() {if (!hasError) {
     end_label_33: ;
     }
     
-  }
+}
 
 
 QCString VhdlParser::qualified_expression() {QCString s,s1;if (!hasError) {
@@ -7979,7 +7993,7 @@ s=s1+"'";
     }
     if (!hasError) {
     
-    if (jj_2_71(2147483647)) {if (!hasError) {
+    if (jj_2_72(2147483647)) {if (!hasError) {
       
       s1 = aggregate();
       }
@@ -8019,11 +8033,11 @@ s+="(";s+=s1;s+=")";
     
 return s;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::range() {QCString s,s1,s2;
-    if (jj_2_72(2147483647)) {if (!hasError) {
+    if (jj_2_73(2147483647)) {if (!hasError) {
       
       s = simple_expression();
       }
@@ -8040,7 +8054,7 @@ QCString VhdlParser::range() {QCString s,s1,s2;
 return s+" "+s1+" "+s2;
       }
       
-    } else if (jj_2_73(2147483647)) {if (!hasError) {
+    } else if (jj_2_74(2147483647)) {if (!hasError) {
       
       s = attribute_name();
       }
@@ -8054,7 +8068,7 @@ return s;
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::range_constraint() {QCString s,s1;if (!hasError) {
@@ -8068,7 +8082,7 @@ QCString VhdlParser::range_constraint() {QCString s,s1;if (!hasError) {
     
 return " range "+s;
 assert(false);
-  }
+}
 
 
 void VhdlParser::record_type_definition() {if (!hasError) {
@@ -8122,7 +8136,7 @@ void VhdlParser::record_type_definition() {if (!hasError) {
     }
     }
     
-  }
+}
 
 
 QCString VhdlParser::relation() {QCString s,s1,s2;if (!hasError) {
@@ -8156,7 +8170,7 @@ QCString VhdlParser::relation() {QCString s,s1,s2;if (!hasError) {
     
 return s+s1+s2;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::relation_operator() {
@@ -8233,7 +8247,7 @@ return "/=";
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::report_statement() {Token *t=0;Token *t1=0;QCString s,s1,s2;if (!hasError) {
@@ -8293,7 +8307,7 @@ if(t) s.append(":");
         if(t1) s2.prepend(" severity ");
         return s+s1+s2+";";
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::return_statement() {QCString s,s1;if (!hasError) {
@@ -8361,7 +8375,7 @@ s+=":";
     
 return s+" return "+s1+";";
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::scalar_type_definition() {QCString s,s1;
@@ -8383,7 +8397,7 @@ return s;
       }
       if (!hasError) {
       
-      if (jj_2_74(2147483647)) {if (!hasError) {
+      if (jj_2_75(2147483647)) {if (!hasError) {
         
         s1 = physical_type_definition();
         }
@@ -8405,7 +8419,7 @@ return s+" "+s1+"%";
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 void VhdlParser::secondary_unit() {
@@ -8429,7 +8443,7 @@ void VhdlParser::secondary_unit() {
       jj_consume_token(-1);
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
-  }
+}
 
 
 QCString VhdlParser::secondary_unit_declaration() {QCString s,s1;if (!hasError) {
@@ -8454,7 +8468,7 @@ QCString VhdlParser::secondary_unit_declaration() {QCString s,s1;if (!hasError)
 
   return s+"="+s1;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::selected_name() {QCString s,s1;if (!hasError) {
@@ -8472,7 +8486,7 @@ QCString VhdlParser::selected_name() {QCString s,s1;if (!hasError) {
     
 return s+"."+s1;
 assert(false);
-  }
+}
 
 
 void VhdlParser::selected_signal_assignment() {if (!hasError) {
@@ -8508,7 +8522,7 @@ void VhdlParser::selected_signal_assignment() {if (!hasError) {
     jj_consume_token(SEMI_T);
     }
     
-  }
+}
 
 
 void VhdlParser::selected_waveforms() {if (!hasError) {
@@ -8555,7 +8569,7 @@ void VhdlParser::selected_waveforms() {if (!hasError) {
     end_label_35: ;
     }
     
-  }
+}
 
 
 QCString VhdlParser::sensitivity_clause() {QCString s;if (!hasError) {
@@ -8570,7 +8584,7 @@ QCString VhdlParser::sensitivity_clause() {QCString s;if (!hasError) {
 s.prepend(" on ");
   return s;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::sensitivity_list() {QCString s,s1;if (!hasError) {
@@ -8607,13 +8621,13 @@ s+=",";s+=s1;
     
 return s;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::sequence_of_statement() {QCString s,s1;if (!hasError) {
     
     while (!hasError) {
-      if (jj_2_75(3)) {
+      if (jj_2_76(3)) {
         ;
       } else {
         goto end_label_37;
@@ -8632,11 +8646,11 @@ s+=s1;
     
 return s;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::sequential_statement() {QCString s;
-    if (jj_2_76(2147483647)) {if (!hasError) {
+    if (jj_2_77(2147483647)) {if (!hasError) {
       
       s = signal_assignment_statement();
       }
@@ -8645,7 +8659,7 @@ QCString VhdlParser::sequential_statement() {QCString s;
 FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s;
       }
       
-    } else if (jj_2_77(3)) {if (!hasError) {
+    } else if (jj_2_78(3)) {if (!hasError) {
       
       s = assertion_statement();
       }
@@ -8654,7 +8668,7 @@ FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s;
 FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s;
       }
       
-    } else if (jj_2_78(3)) {if (!hasError) {
+    } else if (jj_2_79(3)) {if (!hasError) {
       
       s = report_statement();
       }
@@ -8663,7 +8677,7 @@ FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s;
 FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s;
       }
       
-    } else if (jj_2_79(3)) {if (!hasError) {
+    } else if (jj_2_80(3)) {if (!hasError) {
       
       s = wait_statement();
       }
@@ -8672,7 +8686,7 @@ FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s;
 FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s;
       }
       
-    } else if (jj_2_80(2147483647)) {if (!hasError) {
+    } else if (jj_2_81(2147483647)) {if (!hasError) {
       
       s = variable_assignment_statement();
       }
@@ -8681,7 +8695,7 @@ FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s;
 FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s;
       }
       
-    } else if (jj_2_81(3)) {if (!hasError) {
+    } else if (jj_2_82(3)) {if (!hasError) {
       
       s = procedure_call_statement();
       }
@@ -8690,7 +8704,7 @@ FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s;
 FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s;
       }
       
-    } else if (jj_2_82(3)) {if (!hasError) {
+    } else if (jj_2_83(3)) {if (!hasError) {
       
       if_statement();
       }
@@ -8699,7 +8713,7 @@ FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s;
 return s;
       }
       
-    } else if (jj_2_83(3)) {if (!hasError) {
+    } else if (jj_2_84(3)) {if (!hasError) {
       
       case_statement();
       }
@@ -8708,7 +8722,7 @@ return s;
 return s;
       }
       
-    } else if (jj_2_84(3)) {if (!hasError) {
+    } else if (jj_2_85(3)) {if (!hasError) {
       
       loop_statement();
       }
@@ -8717,7 +8731,7 @@ return s;
 return s;
       }
       
-    } else if (jj_2_85(3)) {if (!hasError) {
+    } else if (jj_2_86(3)) {if (!hasError) {
       
       s = next_statement();
       }
@@ -8726,7 +8740,7 @@ return s;
 return s;
       }
       
-    } else if (jj_2_86(3)) {if (!hasError) {
+    } else if (jj_2_87(3)) {if (!hasError) {
       
       s = exit_statement();
       }
@@ -8735,7 +8749,7 @@ return s;
 return s;
       }
       
-    } else if (jj_2_87(3)) {if (!hasError) {
+    } else if (jj_2_88(3)) {if (!hasError) {
       
       s = return_statement();
       }
@@ -8766,7 +8780,7 @@ FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s;
       }
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::shift_expression() {QCString s,s1,s2;if (!hasError) {
@@ -8800,7 +8814,7 @@ QCString VhdlParser::shift_expression() {QCString s,s1,s2;if (!hasError) {
     
 return s+s1+s2;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::shift_operator() {
@@ -8877,7 +8891,7 @@ return "ror";
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::sign() {
@@ -8910,11 +8924,11 @@ return "-";
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::signal_assignment_statement() {QCString s,s1,s2,s3;
-    if (jj_2_89(2147483647)) {if (!hasError) {
+    if (jj_2_90(2147483647)) {if (!hasError) {
       
       conditional_signal_assignment_wave();
       }
@@ -8923,7 +8937,7 @@ QCString VhdlParser::signal_assignment_statement() {QCString s,s1,s2,s3;
 return "";
       }
       
-    } else if (jj_2_90(2147483647)) {if (!hasError) {
+    } else if (jj_2_91(2147483647)) {if (!hasError) {
       
       selected_signal_assignment_wave();
       }
@@ -8940,7 +8954,7 @@ return "";
       case BASIC_IDENTIFIER:
       case EXTENDED_CHARACTER:{if (!hasError) {
         
-        if (jj_2_88(2)) {if (!hasError) {
+        if (jj_2_89(2)) {if (!hasError) {
           
           s = identifier();
           }
@@ -9004,7 +9018,7 @@ return s+s1+"<="+s2+s3+";";
       }
     }
 assert(false);
-  }
+}
 
 
 void VhdlParser::semi() {if (!hasError) {
@@ -9012,7 +9026,7 @@ void VhdlParser::semi() {if (!hasError) {
     jj_consume_token(SEMI_T);
     }
     
-  }
+}
 
 
 void VhdlParser::signal_declaration() {Token* tok=0;QCString s,s1,s2,s3,s4;if (!hasError) {
@@ -9075,7 +9089,7 @@ if(tok)
       s3.prepend(":=");
      s4=s1+s2+s3;
      addVhdlType(s.data(),getLine(),Entry::VARIABLE_SEC,VhdlDocGen::SIGNAL,0,s4.data(),Public);
-  }
+}
 
 
 QCString VhdlParser::signal_kind() {
@@ -9108,7 +9122,7 @@ return "bus";
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::signal_list() {QCString s,s1;
@@ -9178,7 +9192,7 @@ return "all";
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::signature() {QCString s,s1,s2;if (!hasError) {
@@ -9260,7 +9274,7 @@ s+="return ";s+=s1;
     
 s1="["+s+"]";return s1;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::simple_expression() {QCString s,s1,s2;if (!hasError) {
@@ -9290,7 +9304,7 @@ s+=s1;
     if (!hasError) {
     
     while (!hasError) {
-      if (jj_2_91(2147483647)) {
+      if (jj_2_92(2147483647)) {
         ;
       } else {
         goto end_label_40;
@@ -9313,7 +9327,7 @@ s+=s1;s+=s2;
     
 return s;
 assert(false);
-  }
+}
 
 
 void VhdlParser::simple_name() {if (!hasError) {
@@ -9321,7 +9335,7 @@ void VhdlParser::simple_name() {if (!hasError) {
     name();
     }
     
-  }
+}
 
 
 QCString VhdlParser::slice_name() {QCString s,s1;if (!hasError) {
@@ -9343,7 +9357,7 @@ QCString VhdlParser::slice_name() {QCString s,s1;if (!hasError) {
     
 return s+"("+s1+")";
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::string_literal() {Token *tok=0;if (!hasError) {
@@ -9353,7 +9367,7 @@ QCString VhdlParser::string_literal() {Token *tok=0;if (!hasError) {
     
 return tok->image.c_str();
 assert(false);
-  }
+}
 
 
 void VhdlParser::subprogram_body() {QCString s;if (!hasError) {
@@ -9426,11 +9440,11 @@ if (s.data())
 tempEntry->endBodyLine=getLine(END_T);
       createFlow();
       currP=0;
-  }
+}
 
 
 void VhdlParser::subprogram_declaration() {
-    if (jj_2_92(2147483647)) {if (!hasError) {
+    if (jj_2_93(2147483647)) {if (!hasError) {
       
       subprogram_instantiation_declaration();
       }
@@ -9461,7 +9475,7 @@ currP=0;
         errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
       }
     }
-  }
+}
 
 
 void VhdlParser::subprogram_1() {
@@ -9485,7 +9499,7 @@ void VhdlParser::subprogram_1() {
       jj_consume_token(-1);
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
-  }
+}
 
 
 QCString VhdlParser::subprogram_declarative_item() {QCString s;
@@ -9584,7 +9598,7 @@ return s;
       }
     default:
       jj_la1[214] = jj_gen;
-      if (jj_2_93(2147483647)) {if (!hasError) {
+      if (jj_2_94(2147483647)) {if (!hasError) {
         
         s = attribute_declaration();
         }
@@ -9619,7 +9633,7 @@ return s;
           }
         default:
           jj_la1[215] = jj_gen;
-          if (jj_2_94(3)) {if (!hasError) {
+          if (jj_2_95(3)) {if (!hasError) {
             
             s = group_template_declaration();
             }
@@ -9651,7 +9665,7 @@ return s;
       }
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::subprogram_declarative_part() {QCString s,s1;if (!hasError) {
@@ -9694,7 +9708,7 @@ s+=s1;
     
 return s;
 assert(false);
-  }
+}
 
 
 void VhdlParser::subprogram_kind() {
@@ -9718,7 +9732,7 @@ void VhdlParser::subprogram_kind() {
       jj_consume_token(-1);
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
-  }
+}
 
 
 void VhdlParser::subprogram_specification() {QCString s;Token *tok=0;Token *t;
@@ -9735,7 +9749,7 @@ void VhdlParser::subprogram_specification() {QCString s;Token *tok=0;Token *t;
       
 currP=VhdlDocGen::PROCEDURE;
               createFunction(s.data(),currP,0);
-              tempEntry=current;
+              tempEntry=current.get();
                current->startLine=getLine(PROCEDURE_T);
                current->bodyLine=getLine(PROCEDURE_T);
       }
@@ -9772,7 +9786,7 @@ param_sec=0;
       }
       if (!hasError) {
       
-      if (jj_2_95(2)) {if (!hasError) {
+      if (jj_2_96(2)) {if (!hasError) {
         
         gen_interface_list();
         }
@@ -9783,7 +9797,7 @@ param_sec=0;
       }
       if (!hasError) {
       
-      if (jj_2_96(2)) {if (!hasError) {
+      if (jj_2_97(2)) {if (!hasError) {
         
         gen_assoc_list();
         }
@@ -9855,7 +9869,7 @@ currP=VhdlDocGen::FUNCTION;
      createFunction(tok->image.c_str(),currP,s.data());
      else
      createFunction(0,currP,s.data());
-      tempEntry=current;
+      tempEntry=current.get();
       current->startLine=getLine(FUNCTION_T);
       current->bodyLine=getLine(FUNCTION_T);
       }
@@ -9900,7 +9914,7 @@ param_sec=0;
       }
       if (!hasError) {
       
-tempEntry=current;
+tempEntry=current.get();
                 current->type=s;
                 newEntry();
       }
@@ -9912,7 +9926,7 @@ tempEntry=current;
       jj_consume_token(-1);
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
-  }
+}
 
 
 void VhdlParser::subprogram_statement_part() {if (!hasError) {
@@ -9952,7 +9966,7 @@ void VhdlParser::subprogram_statement_part() {if (!hasError) {
     end_label_42: ;
     }
     
-  }
+}
 
 
 QCString VhdlParser::subtype_declaration() {QCString s,s1;if (!hasError) {
@@ -9979,7 +9993,7 @@ QCString VhdlParser::subtype_declaration() {QCString s,s1;if (!hasError) {
 addVhdlType(s.data(),getLine(),Entry::VARIABLE_SEC,VhdlDocGen::SUBTYPE,0,s1.data(),Public);
   return " subtype "+s+" is "+s1+";";
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::subtype_indication() {QCString s,s1,s2;if (!hasError) {
@@ -9988,7 +10002,7 @@ QCString VhdlParser::subtype_indication() {QCString s,s1,s2;if (!hasError) {
     }
     if (!hasError) {
     
-    if (jj_2_97(2147483647)) {if (!hasError) {
+    if (jj_2_98(2147483647)) {if (!hasError) {
       
       s1 = name();
       }
@@ -9999,7 +10013,7 @@ QCString VhdlParser::subtype_indication() {QCString s,s1,s2;if (!hasError) {
     }
     if (!hasError) {
     
-    if (jj_2_98(2147483647)) {if (!hasError) {
+    if (jj_2_99(2147483647)) {if (!hasError) {
       
       s2 = constraint();
       }
@@ -10011,11 +10025,11 @@ QCString VhdlParser::subtype_indication() {QCString s,s1,s2;if (!hasError) {
     
 return s+" "+s1+" "+s2;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::suffix() {QCString s;
-    if (jj_2_99(2147483647)) {if (!hasError) {
+    if (jj_2_100(2147483647)) {if (!hasError) {
       
       s = name();
       }
@@ -10066,7 +10080,7 @@ return " all ";
       }
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::target() {QCString s;
@@ -10102,7 +10116,7 @@ return s;
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::term() {QCString s,s1,s2;if (!hasError) {
@@ -10112,7 +10126,7 @@ QCString VhdlParser::term() {QCString s,s1,s2;if (!hasError) {
     if (!hasError) {
     
     while (!hasError) {
-      if (jj_2_100(2)) {
+      if (jj_2_101(2)) {
         ;
       } else {
         goto end_label_43;
@@ -10135,7 +10149,7 @@ s+=s1;s+=s2;
     
 return s;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::timeout_clause() {QCString s;if (!hasError) {
@@ -10149,7 +10163,7 @@ QCString VhdlParser::timeout_clause() {QCString s;if (!hasError) {
     
 return " for "+s;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::type_conversion() {QCString s,s1;if (!hasError) {
@@ -10171,11 +10185,11 @@ QCString VhdlParser::type_conversion() {QCString s,s1;if (!hasError) {
     
 return s+"("+s1+")";
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::type_declaration() {QCString s;
-    if (jj_2_101(3)) {if (!hasError) {
+    if (jj_2_102(3)) {if (!hasError) {
       
       s = full_type_declaration();
       }
@@ -10204,7 +10218,7 @@ return s;
       }
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::type_definition() {QCString s;
@@ -10258,7 +10272,7 @@ return s;
       }
     default:
       jj_la1[228] = jj_gen;
-      if (jj_2_102(2)) {if (!hasError) {
+      if (jj_2_103(2)) {if (!hasError) {
         
         protected_type_body();
         }
@@ -10288,7 +10302,7 @@ return "";
       }
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::type_mark() {QCString s;if (!hasError) {
@@ -10298,7 +10312,7 @@ QCString VhdlParser::type_mark() {QCString s;if (!hasError) {
     
 return s;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::unconstraint_array_definition() {QCString s,s1,s2,s3;if (!hasError) {
@@ -10355,7 +10369,7 @@ s3+=",";s3+=s1;
     
 return "array("+s+s3+") of "+s2;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::use_clause() {QCString s,s1;if (!hasError) {
@@ -10411,7 +10425,7 @@ QCStringList ql1=QCStringList::split(",",s);
                    s1="use "+s;
                    return s1;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::variable_assignment_statement() {QCString s,s1,s2;
@@ -10422,7 +10436,7 @@ QCString VhdlParser::variable_assignment_statement() {QCString s,s1,s2;
     case BASIC_IDENTIFIER:
     case EXTENDED_CHARACTER:{if (!hasError) {
       
-      if (jj_2_103(2)) {if (!hasError) {
+      if (jj_2_104(2)) {if (!hasError) {
         
         s = identifier();
         }
@@ -10479,7 +10493,7 @@ return "";
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::variable_declaration() {Token *tok=0;Token *t1=0;QCString s,s1,s2;if (!hasError) {
@@ -10558,7 +10572,7 @@ int spec;
     addVhdlType(s.data(),getLine(),Entry::VARIABLE_SEC,spec,0,it.data(),Public);
     return val;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::wait_statement() {QCString s,s1,s2,s3;Token *t=0;if (!hasError) {
@@ -10638,7 +10652,7 @@ QCString VhdlParser::wait_statement() {QCString s,s1,s2,s3;Token *t=0;if (!hasEr
 if(t) s.append(":");
   return s+" wait "+s1+s2+s3+";";
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::waveform() {QCString s,s1;
@@ -10713,7 +10727,7 @@ return " unaffected ";
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::waveform_element() {QCString s,s1;if (!hasError) {
@@ -10746,7 +10760,7 @@ s1.prepend(" after ");
     
 return s+s1;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::protected_type_body() {if (!hasError) {
@@ -10792,7 +10806,7 @@ QCString VhdlParser::protected_type_body() {if (!hasError) {
     
 return "";
 assert(false);
-  }
+}
 
 
 void VhdlParser::protected_type_body_declarative_item() {
@@ -10859,7 +10873,7 @@ void VhdlParser::protected_type_body_declarative_item() {
       }
     default:
       jj_la1[243] = jj_gen;
-      if (jj_2_104(2147483647)) {if (!hasError) {
+      if (jj_2_105(2147483647)) {if (!hasError) {
         
         attribute_declaration();
         }
@@ -10882,7 +10896,7 @@ void VhdlParser::protected_type_body_declarative_item() {
           }
         default:
           jj_la1[244] = jj_gen;
-          if (jj_2_105(3)) {if (!hasError) {
+          if (jj_2_106(3)) {if (!hasError) {
             
             group_template_declaration();
             }
@@ -10905,7 +10919,7 @@ void VhdlParser::protected_type_body_declarative_item() {
         }
       }
     }
-  }
+}
 
 
 void VhdlParser::protected_type_body_declarative_part() {if (!hasError) {
@@ -10942,7 +10956,7 @@ void VhdlParser::protected_type_body_declarative_part() {if (!hasError) {
     end_label_47: ;
     }
     
-  }
+}
 
 
 QCString VhdlParser::protected_type_declaration() {if (!hasError) {
@@ -10987,7 +11001,7 @@ error_skipto(END_T);
     
 return "";
 assert(false);
-  }
+}
 
 
 void VhdlParser::protected_type_declarative_item() {
@@ -11021,7 +11035,7 @@ void VhdlParser::protected_type_declarative_item() {
       jj_consume_token(-1);
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
-  }
+}
 
 
 void VhdlParser::protected_type_declarative_part() {if (!hasError) {
@@ -11053,7 +11067,7 @@ void VhdlParser::protected_type_declarative_part() {if (!hasError) {
     end_label_48: ;
     }
     
-  }
+}
 
 
 QCString VhdlParser::context_ref() {QCString s;if (!hasError) {
@@ -11071,7 +11085,7 @@ QCString VhdlParser::context_ref() {QCString s;if (!hasError) {
     
 return "context "+s ;
 assert(false);
-  }
+}
 
 
 void VhdlParser::context_declaration() {QCString s,s1;if (!hasError) {
@@ -11153,7 +11167,7 @@ parse_sec=CONTEXT_SEC;
     
 parse_sec=0;
                           addVhdlType(s.data(),getLine(LIBRARY_T),Entry::VARIABLE_SEC,VhdlDocGen::LIBRARY,"context",s1.data(),Public);
-  }
+}
 
 
 QCString VhdlParser::libustcont_stats() {QCString s;
@@ -11197,7 +11211,7 @@ return s;
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 void VhdlParser::package_instantiation_declaration() {QCString s,s1,s2;if (!hasError) {
@@ -11246,7 +11260,7 @@ void VhdlParser::package_instantiation_declaration() {QCString s,s1,s2;if (!hasE
     
 QCString q=" is new "+s1+s2;
       addVhdlType(s.data(),getLine(PACKAGE_T),Entry::VARIABLE_SEC,VhdlDocGen::INSTANTIATION,"package",q.data(),Public);
-  }
+}
 
 
 QCString VhdlParser::interface_package_declaration() {QCString s,s1;if (!hasError) {
@@ -11288,7 +11302,7 @@ QCString VhdlParser::interface_package_declaration() {QCString s,s1;if (!hasErro
 current->name=s;
                             return "package "+s+" is new "+s1;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::subprogram_instantiation_declaration() {QCString s,s1,s2;if (!hasError) {
@@ -11339,7 +11353,7 @@ QCString q= " is new "+s1+s2;
       addVhdlType(s.data(),getLine(FUNCTION_T),Entry::VARIABLE_SEC,VhdlDocGen::INSTANTIATION,"function ",q.data(),Public);
     return q;
 assert(false);
-  }
+}
 
 
 void VhdlParser::gen_assoc_list() {if (!hasError) {
@@ -11363,7 +11377,7 @@ void VhdlParser::gen_assoc_list() {if (!hasError) {
     jj_consume_token(RPAREN_T);
     }
     
-  }
+}
 
 
 void VhdlParser::gen_interface_list() {if (!hasError) {
@@ -11393,7 +11407,7 @@ void VhdlParser::gen_interface_list() {if (!hasError) {
     jj_consume_token(RPAREN_T);
     }
     
-  }
+}
 
 
 void VhdlParser::case_scheme() {if (!hasError) {
@@ -11414,7 +11428,7 @@ void VhdlParser::case_scheme() {if (!hasError) {
     }
     if (!hasError) {
     
-    if (jj_2_106(3)) {if (!hasError) {
+    if (jj_2_107(3)) {if (!hasError) {
       
       ttend();
       }
@@ -11440,7 +11454,7 @@ void VhdlParser::case_scheme() {if (!hasError) {
     jj_consume_token(SEMI_T);
     }
     
-  }
+}
 
 
 void VhdlParser::when_stats() {if (!hasError) {
@@ -11451,7 +11465,7 @@ void VhdlParser::when_stats() {if (!hasError) {
       }
       if (!hasError) {
       
-      if (jj_2_107(2)) {if (!hasError) {
+      if (jj_2_108(2)) {if (!hasError) {
         
         label();
         }
@@ -11490,7 +11504,7 @@ void VhdlParser::when_stats() {if (!hasError) {
     end_label_50: ;
     }
     
-  }
+}
 
 
 void VhdlParser::ttend() {if (!hasError) {
@@ -11518,7 +11532,7 @@ void VhdlParser::ttend() {if (!hasError) {
     jj_consume_token(SEMI_T);
     }
     
-  }
+}
 
 
 void VhdlParser::generate_statement_body() {if (!hasError) {
@@ -11530,7 +11544,7 @@ void VhdlParser::generate_statement_body() {if (!hasError) {
     generate_statement_body();
     }
     
-  }
+}
 
 
 void VhdlParser::generate_statement_body1() {if (!hasError) {
@@ -11557,7 +11571,7 @@ void VhdlParser::generate_statement_body1() {if (!hasError) {
     case VARIABLE_T:{if (!hasError) {
       
       while (!hasError) {
-        if (jj_2_108(2147483647)) {
+        if (jj_2_109(2147483647)) {
           ;
         } else {
           goto end_label_51;
@@ -11611,7 +11625,7 @@ void VhdlParser::generate_statement_body1() {if (!hasError) {
     end_label_52: ;
     }
     
-  }
+}
 
 
 QCString VhdlParser::external_name() {QCString s,s1,s2;if (!hasError) {
@@ -11643,7 +11657,7 @@ QCString t="<<"+s;
                          QCString t1=s1+":"+s2+">>";
                          return   s+s1;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::sig_stat() {Token *t;
@@ -11687,7 +11701,7 @@ return t->image.data();
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::external_pathname() {QCString s;
@@ -11731,11 +11745,11 @@ return s;
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::absolute_pathname() {QCString s,s1;
-    if (jj_2_109(2147483647)) {if (!hasError) {
+    if (jj_2_110(2147483647)) {if (!hasError) {
       
       jj_consume_token(DOT_T);
       }
@@ -11776,7 +11790,7 @@ return "."+s;
       }
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::relative_pathname() {QCString s,s1,s2;if (!hasError) {
@@ -11785,7 +11799,7 @@ QCString VhdlParser::relative_pathname() {QCString s,s1,s2;if (!hasError) {
     }
     if (!hasError) {
     
-    if (jj_2_110(2147483647)) {if (!hasError) {
+    if (jj_2_111(2147483647)) {if (!hasError) {
       
       s1 = pathname_element_list();
       }
@@ -11801,7 +11815,7 @@ QCString VhdlParser::relative_pathname() {QCString s,s1,s2;if (!hasError) {
     
 return s+s1+s2;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::neg_list() {QCString s;if (!hasError) {
@@ -11834,7 +11848,7 @@ s+="^.";
     
 return s;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::pathname_element() {QCString s,s1;if (!hasError) {
@@ -11870,7 +11884,7 @@ if(!s1.isEmpty())
 
     return s;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::pathname_element_list() {QCString s,s1,s2;if (!hasError) {
@@ -11891,7 +11905,7 @@ s+=".";
     if (!hasError) {
     
     while (!hasError) {
-      if (jj_2_111(2147483647)) {
+      if (jj_2_112(2147483647)) {
         ;
       } else {
         goto end_label_54;
@@ -11914,7 +11928,7 @@ s2+=s1;s2+=".";
     
 return s+s2;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::package_path_name() {QCString s;if (!hasError) {
@@ -11928,11 +11942,11 @@ QCString VhdlParser::package_path_name() {QCString s;if (!hasError) {
     
 return "@"+s;
 assert(false);
-  }
+}
 
 
 void VhdlParser::conditional_signal_assignment_wave() {
-    if (jj_2_112(2147483647)) {if (!hasError) {
+    if (jj_2_113(2147483647)) {if (!hasError) {
       
       conditional_force_assignment();
       }
@@ -11956,7 +11970,7 @@ void VhdlParser::conditional_signal_assignment_wave() {
         errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
       }
     }
-  }
+}
 
 
 void VhdlParser::conditional_waveform_assignment() {if (!hasError) {
@@ -12016,7 +12030,7 @@ void VhdlParser::conditional_waveform_assignment() {if (!hasError) {
     jj_consume_token(SEMI_T);
     }
     
-  }
+}
 
 
 void VhdlParser::else_wave_list() {if (!hasError) {
@@ -12047,7 +12061,7 @@ void VhdlParser::else_wave_list() {if (!hasError) {
     }
     }
     
-  }
+}
 
 
 void VhdlParser::conditional_force_assignment() {if (!hasError) {
@@ -12125,11 +12139,11 @@ void VhdlParser::conditional_force_assignment() {if (!hasError) {
     jj_consume_token(SEMI_T);
     }
     
-  }
+}
 
 
 void VhdlParser::selected_signal_assignment_wave() {
-    if (jj_2_113(2147483647)) {if (!hasError) {
+    if (jj_2_114(2147483647)) {if (!hasError) {
       
       selected_force_assignment();
       }
@@ -12149,7 +12163,7 @@ void VhdlParser::selected_signal_assignment_wave() {
         errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
       }
     }
-  }
+}
 
 
 void VhdlParser::selected_variable_assignment() {if (!hasError) {
@@ -12192,11 +12206,11 @@ void VhdlParser::selected_variable_assignment() {if (!hasError) {
     sel_var_list();
     }
     
-  }
+}
 
 
 void VhdlParser::select_name() {
-    if (jj_2_114(2147483647)) {if (!hasError) {
+    if (jj_2_115(2147483647)) {if (!hasError) {
       
       aggregate();
       }
@@ -12219,7 +12233,7 @@ void VhdlParser::select_name() {
         errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
       }
     }
-  }
+}
 
 
 void VhdlParser::selected_waveform_assignment() {if (!hasError) {
@@ -12279,7 +12293,7 @@ void VhdlParser::selected_waveform_assignment() {if (!hasError) {
     sel_wave_list();
     }
     
-  }
+}
 
 
 void VhdlParser::selected_force_assignment() {if (!hasError) {
@@ -12342,7 +12356,7 @@ void VhdlParser::selected_force_assignment() {if (!hasError) {
     sel_var_list();
     }
     
-  }
+}
 
 
 void VhdlParser::sel_var_list() {if (!hasError) {
@@ -12386,7 +12400,7 @@ void VhdlParser::sel_var_list() {if (!hasError) {
     if (!hasError) {
     
     while (!hasError) {
-      if (jj_2_115(2147483647)) {
+      if (jj_2_116(2147483647)) {
         ;
       } else {
         goto end_label_55;
@@ -12430,7 +12444,7 @@ void VhdlParser::sel_var_list() {if (!hasError) {
     end_label_55: ;
     }
     
-  }
+}
 
 
 void VhdlParser::sel_wave_list() {if (!hasError) {
@@ -12473,7 +12487,7 @@ void VhdlParser::sel_wave_list() {if (!hasError) {
     jj_consume_token(SEMI_T);
     }
     
-  }
+}
 
 
 void VhdlParser::inout_stat() {
@@ -12497,7 +12511,7 @@ void VhdlParser::inout_stat() {
       jj_consume_token(-1);
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
-  }
+}
 
 
 void VhdlParser::else_stat() {if (!hasError) {
@@ -12543,7 +12557,7 @@ void VhdlParser::else_stat() {if (!hasError) {
     end_label_57: ;
     }
     
-  }
+}
 
 
 QCString VhdlParser::interface_subprogram_declaration() {QCString s;
@@ -12578,7 +12592,7 @@ return s;
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::iproc() {QCString s,s1;if (!hasError) {
@@ -12597,7 +12611,7 @@ QCString VhdlParser::iproc() {QCString s,s1;if (!hasError) {
 current->name=s;
   return "procedure "+s+s1;
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::ifunc() {QCString s,s1,s2,s3;Token *t=0;Token *t1=0;Token *t2=0;if (!hasError) {
@@ -12711,7 +12725,7 @@ QCString q;
                     }
          currP=0;return "";
 assert(false);
-  }
+}
 
 
 QCString VhdlParser::param() {QCString s,s1;Token *tok=0;if (!hasError) {
@@ -12765,7 +12779,7 @@ if(tok)
                       param_sec=0;
                       return s+"("+s1+")";
 assert(false);
-  }
+}
 
 
 void VhdlParser::parseInline() {
@@ -12795,31 +12809,21 @@ void VhdlParser::parseInline() {
       jj_consume_token(-1);
       errorHandler->handleParseError(token, getToken(1), __FUNCTION__, this), hasError = true;
     }
-  }
+}
 
 
  VhdlParser::VhdlParser(TokenManager *tm){
     head = NULL;
+    errorHandlerCreated = false;
     ReInit(tm);
 }
-   VhdlParser::~VhdlParser()
+VhdlParser::~VhdlParser()
 {
-  if (token_source) delete token_source;
-  if (head) {
-    Token *next, *t = head;
-    while (t) {
-      next = t->next;
-      delete t;
-      t = next;
-    }
-  }
-  if (errorHandlerCreated) {
-    delete errorHandler;
-  }
+  clear();
 }
 
 void VhdlParser::ReInit(TokenManager *tm){
-    if (head) delete head;
+    clear();
     errorHandler = new ErrorHandler();
     errorHandlerCreated = true;
     hasError = false;
@@ -12841,6 +12845,24 @@ void VhdlParser::ReInit(TokenManager *tm){
   }
 
 
+void VhdlParser::clear(){
+  //Since token manager was generate from outside,
+  //parser should not take care of deleting
+  //if (token_source) delete token_source;
+  if (head) {
+    Token *next, *t = head;
+    while (t) {
+      next = t->next;
+      delete t;
+      t = next;
+    }
+  }
+  if (errorHandlerCreated) {
+    delete errorHandler;
+  }
+}
+
+
 Token * VhdlParser::jj_consume_token(int kind)  {
     Token *oldToken;
     if ((oldToken = token)->next != NULL) token = token->next;
@@ -12850,7 +12872,7 @@ Token * VhdlParser::jj_consume_token(int kind)  {
       jj_gen++;
       if (++jj_gc > 100) {
         jj_gc = 0;
-        for (int i = 0; i < 115; i++) {
+        for (int i = 0; i < 116; i++) {
           JJCalls *c = &jj_2_rtns[i];
           while (c != NULL) {
             if (c->gen < jj_gen) c->first = NULL;
@@ -12863,7 +12885,8 @@ Token * VhdlParser::jj_consume_token(int kind)  {
     token = oldToken;
     jj_kind = kind;
     JAVACC_STRING_TYPE image = kind >= 0 ? tokenImage[kind] : tokenImage[0];
-    errorHandler->handleUnexpectedToken(kind, image.substr(1, image.size() - 2), getToken(1), this), hasError = true;
+    errorHandler->handleUnexpectedToken(kind, image.substr(1, image.size() - 2), getToken(1), this);
+    hasError = true;
     return token;
   }
 
@@ -12920,28 +12943,25 @@ int VhdlParser::jj_ntk_f(){
   }
 
 
-void VhdlParser::jj_add_error_token(int kind, int pos)  {
+  void VhdlParser::jj_add_error_token(int kind, int pos)  {
   }
 
-  /** Generate ParseException. */
 
  void  VhdlParser::parseError()   {
       fprintf(stderr, "Parse error at: %d:%d, after token: %s encountered: %s\n", token->beginLine, token->beginColumn, addUnicodeEscapes(token->image).c_str(), addUnicodeEscapes(getToken(1)->image).c_str());
    }
 
 
- void VhdlParser::enable_tracing()  {
 void VhdlParser::enable_tracing()  {
   }
 
-  /** Disable tracing. */
-
- void VhdlParser::disable_tracing()  {
+  void VhdlParser::disable_tracing()  {
   }
 
 
-void VhdlParser::jj_rescan_token(){
+  void VhdlParser::jj_rescan_token(){
     jj_rescan = true;
-    for (int i = 0; i < 115; i++) {
+    for (int i = 0; i < 116; i++) {
       JJCalls *p = &jj_2_rtns[i];
       do {
         if (p->gen > jj_gen) {
@@ -13062,6 +13082,7 @@ void VhdlParser::jj_rescan_token(){
             case 112: jj_3_113(); break;
             case 113: jj_3_114(); break;
             case 114: jj_3_115(); break;
+            case 115: jj_3_116(); break;
           }
         }
         p = p->next;
@@ -13071,7 +13092,7 @@ void VhdlParser::jj_rescan_token(){
   }
 
 
-void VhdlParser::jj_save(int index, int xla){
+  void VhdlParser::jj_save(int index, int xla){
     JJCalls *p = &jj_2_rtns[index];
     while (p->gen > jj_gen) {
       if (p->next == NULL) { p = p->next = new JJCalls(); break; }
index 3e32daa..efdfe33 100644 (file)
 namespace vhdl {
 namespace parser {
   struct JJCalls {
-    int gen;
-    Token *first;
-    int arg;
-    JJCalls *next;
+    int        gen;
+    int        arg;
+    JJCalls*   next;
+    Token*     first;
     ~JJCalls() { if (next) delete next; }
-    JJCalls() { next = NULL; arg = 0; gen = -1; first = NULL; }
+     JJCalls() { next = NULL; arg = 0; gen = -1; first = NULL; }
   };
 
 class VhdlParser {
@@ -582,7 +582,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_1() || jj_done;
+    return (!jj_3_1() || jj_done);
  { jj_save(0, xla); }
   }
 
@@ -590,7 +590,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_2() || jj_done;
+    return (!jj_3_2() || jj_done);
  { jj_save(1, xla); }
   }
 
@@ -598,7 +598,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_3() || jj_done;
+    return (!jj_3_3() || jj_done);
  { jj_save(2, xla); }
   }
 
@@ -606,7 +606,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_4() || jj_done;
+    return (!jj_3_4() || jj_done);
  { jj_save(3, xla); }
   }
 
@@ -614,7 +614,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_5() || jj_done;
+    return (!jj_3_5() || jj_done);
  { jj_save(4, xla); }
   }
 
@@ -622,7 +622,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_6() || jj_done;
+    return (!jj_3_6() || jj_done);
  { jj_save(5, xla); }
   }
 
@@ -630,7 +630,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_7() || jj_done;
+    return (!jj_3_7() || jj_done);
  { jj_save(6, xla); }
   }
 
@@ -638,7 +638,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_8() || jj_done;
+    return (!jj_3_8() || jj_done);
  { jj_save(7, xla); }
   }
 
@@ -646,7 +646,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_9() || jj_done;
+    return (!jj_3_9() || jj_done);
  { jj_save(8, xla); }
   }
 
@@ -654,7 +654,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_10() || jj_done;
+    return (!jj_3_10() || jj_done);
  { jj_save(9, xla); }
   }
 
@@ -662,7 +662,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_11() || jj_done;
+    return (!jj_3_11() || jj_done);
  { jj_save(10, xla); }
   }
 
@@ -670,7 +670,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_12() || jj_done;
+    return (!jj_3_12() || jj_done);
  { jj_save(11, xla); }
   }
 
@@ -678,7 +678,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_13() || jj_done;
+    return (!jj_3_13() || jj_done);
  { jj_save(12, xla); }
   }
 
@@ -686,7 +686,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_14() || jj_done;
+    return (!jj_3_14() || jj_done);
  { jj_save(13, xla); }
   }
 
@@ -694,7 +694,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_15() || jj_done;
+    return (!jj_3_15() || jj_done);
  { jj_save(14, xla); }
   }
 
@@ -702,7 +702,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_16() || jj_done;
+    return (!jj_3_16() || jj_done);
  { jj_save(15, xla); }
   }
 
@@ -710,7 +710,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_17() || jj_done;
+    return (!jj_3_17() || jj_done);
  { jj_save(16, xla); }
   }
 
@@ -718,7 +718,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_18() || jj_done;
+    return (!jj_3_18() || jj_done);
  { jj_save(17, xla); }
   }
 
@@ -726,7 +726,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_19() || jj_done;
+    return (!jj_3_19() || jj_done);
  { jj_save(18, xla); }
   }
 
@@ -734,7 +734,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_20() || jj_done;
+    return (!jj_3_20() || jj_done);
  { jj_save(19, xla); }
   }
 
@@ -742,7 +742,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_21() || jj_done;
+    return (!jj_3_21() || jj_done);
  { jj_save(20, xla); }
   }
 
@@ -750,7 +750,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_22() || jj_done;
+    return (!jj_3_22() || jj_done);
  { jj_save(21, xla); }
   }
 
@@ -758,7 +758,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_23() || jj_done;
+    return (!jj_3_23() || jj_done);
  { jj_save(22, xla); }
   }
 
@@ -766,7 +766,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_24() || jj_done;
+    return (!jj_3_24() || jj_done);
  { jj_save(23, xla); }
   }
 
@@ -774,7 +774,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_25() || jj_done;
+    return (!jj_3_25() || jj_done);
  { jj_save(24, xla); }
   }
 
@@ -782,7 +782,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_26() || jj_done;
+    return (!jj_3_26() || jj_done);
  { jj_save(25, xla); }
   }
 
@@ -790,7 +790,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_27() || jj_done;
+    return (!jj_3_27() || jj_done);
  { jj_save(26, xla); }
   }
 
@@ -798,7 +798,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_28() || jj_done;
+    return (!jj_3_28() || jj_done);
  { jj_save(27, xla); }
   }
 
@@ -806,7 +806,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_29() || jj_done;
+    return (!jj_3_29() || jj_done);
  { jj_save(28, xla); }
   }
 
@@ -814,7 +814,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_30() || jj_done;
+    return (!jj_3_30() || jj_done);
  { jj_save(29, xla); }
   }
 
@@ -822,7 +822,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_31() || jj_done;
+    return (!jj_3_31() || jj_done);
  { jj_save(30, xla); }
   }
 
@@ -830,7 +830,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_32() || jj_done;
+    return (!jj_3_32() || jj_done);
  { jj_save(31, xla); }
   }
 
@@ -838,7 +838,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_33() || jj_done;
+    return (!jj_3_33() || jj_done);
  { jj_save(32, xla); }
   }
 
@@ -846,7 +846,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_34() || jj_done;
+    return (!jj_3_34() || jj_done);
  { jj_save(33, xla); }
   }
 
@@ -854,7 +854,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_35() || jj_done;
+    return (!jj_3_35() || jj_done);
  { jj_save(34, xla); }
   }
 
@@ -862,7 +862,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_36() || jj_done;
+    return (!jj_3_36() || jj_done);
  { jj_save(35, xla); }
   }
 
@@ -870,7 +870,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_37() || jj_done;
+    return (!jj_3_37() || jj_done);
  { jj_save(36, xla); }
   }
 
@@ -878,7 +878,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_38() || jj_done;
+    return (!jj_3_38() || jj_done);
  { jj_save(37, xla); }
   }
 
@@ -886,7 +886,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_39() || jj_done;
+    return (!jj_3_39() || jj_done);
  { jj_save(38, xla); }
   }
 
@@ -894,7 +894,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_40() || jj_done;
+    return (!jj_3_40() || jj_done);
  { jj_save(39, xla); }
   }
 
@@ -902,7 +902,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_41() || jj_done;
+    return (!jj_3_41() || jj_done);
  { jj_save(40, xla); }
   }
 
@@ -910,7 +910,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_42() || jj_done;
+    return (!jj_3_42() || jj_done);
  { jj_save(41, xla); }
   }
 
@@ -918,7 +918,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_43() || jj_done;
+    return (!jj_3_43() || jj_done);
  { jj_save(42, xla); }
   }
 
@@ -926,7 +926,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_44() || jj_done;
+    return (!jj_3_44() || jj_done);
  { jj_save(43, xla); }
   }
 
@@ -934,7 +934,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_45() || jj_done;
+    return (!jj_3_45() || jj_done);
  { jj_save(44, xla); }
   }
 
@@ -942,7 +942,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_46() || jj_done;
+    return (!jj_3_46() || jj_done);
  { jj_save(45, xla); }
   }
 
@@ -950,7 +950,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_47() || jj_done;
+    return (!jj_3_47() || jj_done);
  { jj_save(46, xla); }
   }
 
@@ -958,7 +958,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_48() || jj_done;
+    return (!jj_3_48() || jj_done);
  { jj_save(47, xla); }
   }
 
@@ -966,7 +966,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_49() || jj_done;
+    return (!jj_3_49() || jj_done);
  { jj_save(48, xla); }
   }
 
@@ -974,7 +974,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_50() || jj_done;
+    return (!jj_3_50() || jj_done);
  { jj_save(49, xla); }
   }
 
@@ -982,7 +982,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_51() || jj_done;
+    return (!jj_3_51() || jj_done);
  { jj_save(50, xla); }
   }
 
@@ -990,7 +990,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_52() || jj_done;
+    return (!jj_3_52() || jj_done);
  { jj_save(51, xla); }
   }
 
@@ -998,7 +998,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_53() || jj_done;
+    return (!jj_3_53() || jj_done);
  { jj_save(52, xla); }
   }
 
@@ -1006,7 +1006,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_54() || jj_done;
+    return (!jj_3_54() || jj_done);
  { jj_save(53, xla); }
   }
 
@@ -1014,7 +1014,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_55() || jj_done;
+    return (!jj_3_55() || jj_done);
  { jj_save(54, xla); }
   }
 
@@ -1022,7 +1022,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_56() || jj_done;
+    return (!jj_3_56() || jj_done);
  { jj_save(55, xla); }
   }
 
@@ -1030,7 +1030,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_57() || jj_done;
+    return (!jj_3_57() || jj_done);
  { jj_save(56, xla); }
   }
 
@@ -1038,7 +1038,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_58() || jj_done;
+    return (!jj_3_58() || jj_done);
  { jj_save(57, xla); }
   }
 
@@ -1046,7 +1046,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_59() || jj_done;
+    return (!jj_3_59() || jj_done);
  { jj_save(58, xla); }
   }
 
@@ -1054,7 +1054,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_60() || jj_done;
+    return (!jj_3_60() || jj_done);
  { jj_save(59, xla); }
   }
 
@@ -1062,7 +1062,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_61() || jj_done;
+    return (!jj_3_61() || jj_done);
  { jj_save(60, xla); }
   }
 
@@ -1070,7 +1070,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_62() || jj_done;
+    return (!jj_3_62() || jj_done);
  { jj_save(61, xla); }
   }
 
@@ -1078,7 +1078,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_63() || jj_done;
+    return (!jj_3_63() || jj_done);
  { jj_save(62, xla); }
   }
 
@@ -1086,7 +1086,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_64() || jj_done;
+    return (!jj_3_64() || jj_done);
  { jj_save(63, xla); }
   }
 
@@ -1094,7 +1094,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_65() || jj_done;
+    return (!jj_3_65() || jj_done);
  { jj_save(64, xla); }
   }
 
@@ -1102,7 +1102,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_66() || jj_done;
+    return (!jj_3_66() || jj_done);
  { jj_save(65, xla); }
   }
 
@@ -1110,7 +1110,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_67() || jj_done;
+    return (!jj_3_67() || jj_done);
  { jj_save(66, xla); }
   }
 
@@ -1118,7 +1118,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_68() || jj_done;
+    return (!jj_3_68() || jj_done);
  { jj_save(67, xla); }
   }
 
@@ -1126,7 +1126,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_69() || jj_done;
+    return (!jj_3_69() || jj_done);
  { jj_save(68, xla); }
   }
 
@@ -1134,7 +1134,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_70() || jj_done;
+    return (!jj_3_70() || jj_done);
  { jj_save(69, xla); }
   }
 
@@ -1142,7 +1142,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_71() || jj_done;
+    return (!jj_3_71() || jj_done);
  { jj_save(70, xla); }
   }
 
@@ -1150,7 +1150,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_72() || jj_done;
+    return (!jj_3_72() || jj_done);
  { jj_save(71, xla); }
   }
 
@@ -1158,7 +1158,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_73() || jj_done;
+    return (!jj_3_73() || jj_done);
  { jj_save(72, xla); }
   }
 
@@ -1166,7 +1166,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_74() || jj_done;
+    return (!jj_3_74() || jj_done);
  { jj_save(73, xla); }
   }
 
@@ -1174,7 +1174,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_75() || jj_done;
+    return (!jj_3_75() || jj_done);
  { jj_save(74, xla); }
   }
 
@@ -1182,7 +1182,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_76() || jj_done;
+    return (!jj_3_76() || jj_done);
  { jj_save(75, xla); }
   }
 
@@ -1190,7 +1190,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_77() || jj_done;
+    return (!jj_3_77() || jj_done);
  { jj_save(76, xla); }
   }
 
@@ -1198,7 +1198,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_78() || jj_done;
+    return (!jj_3_78() || jj_done);
  { jj_save(77, xla); }
   }
 
@@ -1206,7 +1206,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_79() || jj_done;
+    return (!jj_3_79() || jj_done);
  { jj_save(78, xla); }
   }
 
@@ -1214,7 +1214,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_80() || jj_done;
+    return (!jj_3_80() || jj_done);
  { jj_save(79, xla); }
   }
 
@@ -1222,7 +1222,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_81() || jj_done;
+    return (!jj_3_81() || jj_done);
  { jj_save(80, xla); }
   }
 
@@ -1230,7 +1230,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_82() || jj_done;
+    return (!jj_3_82() || jj_done);
  { jj_save(81, xla); }
   }
 
@@ -1238,7 +1238,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_83() || jj_done;
+    return (!jj_3_83() || jj_done);
  { jj_save(82, xla); }
   }
 
@@ -1246,7 +1246,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_84() || jj_done;
+    return (!jj_3_84() || jj_done);
  { jj_save(83, xla); }
   }
 
@@ -1254,7 +1254,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_85() || jj_done;
+    return (!jj_3_85() || jj_done);
  { jj_save(84, xla); }
   }
 
@@ -1262,7 +1262,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_86() || jj_done;
+    return (!jj_3_86() || jj_done);
  { jj_save(85, xla); }
   }
 
@@ -1270,7 +1270,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_87() || jj_done;
+    return (!jj_3_87() || jj_done);
  { jj_save(86, xla); }
   }
 
@@ -1278,7 +1278,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_88() || jj_done;
+    return (!jj_3_88() || jj_done);
  { jj_save(87, xla); }
   }
 
@@ -1286,7 +1286,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_89() || jj_done;
+    return (!jj_3_89() || jj_done);
  { jj_save(88, xla); }
   }
 
@@ -1294,7 +1294,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_90() || jj_done;
+    return (!jj_3_90() || jj_done);
  { jj_save(89, xla); }
   }
 
@@ -1302,7 +1302,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_91() || jj_done;
+    return (!jj_3_91() || jj_done);
  { jj_save(90, xla); }
   }
 
@@ -1310,7 +1310,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_92() || jj_done;
+    return (!jj_3_92() || jj_done);
  { jj_save(91, xla); }
   }
 
@@ -1318,7 +1318,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_93() || jj_done;
+    return (!jj_3_93() || jj_done);
  { jj_save(92, xla); }
   }
 
@@ -1326,7 +1326,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_94() || jj_done;
+    return (!jj_3_94() || jj_done);
  { jj_save(93, xla); }
   }
 
@@ -1334,7 +1334,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_95() || jj_done;
+    return (!jj_3_95() || jj_done);
  { jj_save(94, xla); }
   }
 
@@ -1342,7 +1342,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_96() || jj_done;
+    return (!jj_3_96() || jj_done);
  { jj_save(95, xla); }
   }
 
@@ -1350,7 +1350,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_97() || jj_done;
+    return (!jj_3_97() || jj_done);
  { jj_save(96, xla); }
   }
 
@@ -1358,7 +1358,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_98() || jj_done;
+    return (!jj_3_98() || jj_done);
  { jj_save(97, xla); }
   }
 
@@ -1366,7 +1366,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_99() || jj_done;
+    return (!jj_3_99() || jj_done);
  { jj_save(98, xla); }
   }
 
@@ -1374,7 +1374,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_100() || jj_done;
+    return (!jj_3_100() || jj_done);
  { jj_save(99, xla); }
   }
 
@@ -1382,7 +1382,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_101() || jj_done;
+    return (!jj_3_101() || jj_done);
  { jj_save(100, xla); }
   }
 
@@ -1390,7 +1390,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_102() || jj_done;
+    return (!jj_3_102() || jj_done);
  { jj_save(101, xla); }
   }
 
@@ -1398,7 +1398,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_103() || jj_done;
+    return (!jj_3_103() || jj_done);
  { jj_save(102, xla); }
   }
 
@@ -1406,7 +1406,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_104() || jj_done;
+    return (!jj_3_104() || jj_done);
  { jj_save(103, xla); }
   }
 
@@ -1414,7 +1414,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_105() || jj_done;
+    return (!jj_3_105() || jj_done);
  { jj_save(104, xla); }
   }
 
@@ -1422,7 +1422,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_106() || jj_done;
+    return (!jj_3_106() || jj_done);
  { jj_save(105, xla); }
   }
 
@@ -1430,7 +1430,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_107() || jj_done;
+    return (!jj_3_107() || jj_done);
  { jj_save(106, xla); }
   }
 
@@ -1438,7 +1438,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_108() || jj_done;
+    return (!jj_3_108() || jj_done);
  { jj_save(107, xla); }
   }
 
@@ -1446,7 +1446,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_109() || jj_done;
+    return (!jj_3_109() || jj_done);
  { jj_save(108, xla); }
   }
 
@@ -1454,7 +1454,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_110() || jj_done;
+    return (!jj_3_110() || jj_done);
  { jj_save(109, xla); }
   }
 
@@ -1462,7 +1462,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_111() || jj_done;
+    return (!jj_3_111() || jj_done);
  { jj_save(110, xla); }
   }
 
@@ -1470,7 +1470,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_112() || jj_done;
+    return (!jj_3_112() || jj_done);
  { jj_save(111, xla); }
   }
 
@@ -1478,7 +1478,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_113() || jj_done;
+    return (!jj_3_113() || jj_done);
  { jj_save(112, xla); }
   }
 
@@ -1486,7 +1486,7 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_114() || jj_done;
+    return (!jj_3_114() || jj_done);
  { jj_save(113, xla); }
   }
 
@@ -1494,10 +1494,18 @@ void parseInline();
  {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
     jj_done = false;
-    return !jj_3_115() || jj_done;
+    return (!jj_3_115() || jj_done);
  { jj_save(114, xla); }
   }
 
+ inline bool jj_2_116(int xla)
+ {
+    jj_la = xla; jj_lastpos = jj_scanpos = token;
+    jj_done = false;
+    return (!jj_3_116() || jj_done);
+ { jj_save(115, xla); }
+  }
+
  inline bool jj_3_43()
  {
     if (jj_done) return true;
@@ -1520,27 +1528,27 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_442()
+ inline bool jj_3R_443()
  {
     if (jj_done) return true;
     if (jj_scan_token(FOR_T)) return true;
-    if (jj_3R_407()) return true;
+    if (jj_3R_408()) return true;
     return false;
   }
 
- inline bool jj_3R_366()
+ inline bool jj_3R_367()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_441()) {
+    if (jj_3R_442()) {
     jj_scanpos = xsp;
-    if (jj_3R_442()) return true;
+    if (jj_3R_443()) return true;
     }
     return false;
   }
 
- inline bool jj_3R_441()
+ inline bool jj_3R_442()
  {
     if (jj_done) return true;
     if (jj_scan_token(WHILE_T)) return true;
@@ -1551,19 +1559,19 @@ void parseInline();
  inline bool jj_3R_197()
  {
     if (jj_done) return true;
-    if (jj_3R_345()) return true;
+    if (jj_3R_346()) return true;
     return false;
   }
 
- inline bool jj_3R_399()
+ inline bool jj_3R_400()
  {
     if (jj_done) return true;
     if (jj_scan_token(SEMI_T)) return true;
-    if (jj_3R_398()) return true;
+    if (jj_3R_399()) return true;
     return false;
   }
 
- inline bool jj_3R_411()
+ inline bool jj_3R_412()
  {
     if (jj_done) return true;
     if (jj_scan_token(LPAREN_T)) return true;
@@ -1608,14 +1616,14 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_312()
+ inline bool jj_3R_313()
  {
     if (jj_done) return true;
-    if (jj_3R_398()) return true;
+    if (jj_3R_399()) return true;
     Token * xsp;
     while (true) {
       xsp = jj_scanpos;
-      if (jj_3R_399()) { jj_scanpos = xsp; break; }
+      if (jj_3R_400()) { jj_scanpos = xsp; break; }
     }
     return false;
   }
@@ -1630,10 +1638,10 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_398()
+ inline bool jj_3R_399()
  {
     if (jj_done) return true;
-    if (jj_3R_489()) return true;
+    if (jj_3R_490()) return true;
     return false;
   }
 
@@ -1644,15 +1652,15 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_557()
+ inline bool jj_3R_558()
  {
     if (jj_done) return true;
-    if (jj_3R_612()) return true;
+    if (jj_3R_613()) return true;
     if (jj_3R_69()) return true;
     return false;
   }
 
- inline bool jj_3R_556()
+ inline bool jj_3R_557()
  {
     if (jj_done) return true;
     if (jj_3R_92()) return true;
@@ -1673,7 +1681,7 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_555()
+ inline bool jj_3R_556()
  {
     if (jj_done) return true;
     if (jj_3R_107()) return true;
@@ -1687,22 +1695,22 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_489()
+ inline bool jj_3R_490()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
     if (jj_3_39()) {
     jj_scanpos = xsp;
-    if (jj_3R_555()) {
+    if (jj_3R_556()) {
     jj_scanpos = xsp;
     if (jj_3_40()) {
     jj_scanpos = xsp;
     if (jj_3_41()) {
     jj_scanpos = xsp;
-    if (jj_3R_556()) {
+    if (jj_3R_557()) {
     jj_scanpos = xsp;
-    if (jj_3R_557()) return true;
+    if (jj_3R_558()) return true;
     }
     }
     }
@@ -1727,57 +1735,57 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_624()
+ inline bool jj_3R_625()
  {
     if (jj_done) return true;
     if (jj_3R_69()) return true;
     return false;
   }
 
- inline bool jj_3R_414()
+ inline bool jj_3R_696()
  {
     if (jj_done) return true;
-    if (jj_scan_token(ALL_T)) return true;
+    if (jj_3R_69()) return true;
     return false;
   }
 
- inline bool jj_3R_413()
+ inline bool jj_3R_415()
  {
     if (jj_done) return true;
-    if (jj_scan_token(OTHER_T)) return true;
+    if (jj_scan_token(ALL_T)) return true;
     return false;
   }
 
- inline bool jj_3R_695()
+ inline bool jj_3R_414()
  {
     if (jj_done) return true;
-    if (jj_3R_69()) return true;
+    if (jj_scan_token(OTHER_T)) return true;
     return false;
   }
 
- inline bool jj_3R_330()
+ inline bool jj_3R_331()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_412()) {
-    jj_scanpos = xsp;
     if (jj_3R_413()) {
     jj_scanpos = xsp;
-    if (jj_3R_414()) return true;
+    if (jj_3R_414()) {
+    jj_scanpos = xsp;
+    if (jj_3R_415()) return true;
     }
     }
     return false;
   }
 
- inline bool jj_3R_412()
+ inline bool jj_3R_413()
  {
     if (jj_done) return true;
     if (jj_3R_196()) return true;
     return false;
   }
 
- inline bool jj_3R_327()
+ inline bool jj_3R_328()
  {
     if (jj_done) return true;
     if (jj_scan_token(CONFIGURATION_T)) return true;
@@ -1785,7 +1793,7 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_326()
+ inline bool jj_3R_327()
  {
     if (jj_done) return true;
     if (jj_scan_token(ENTITY_T)) return true;
@@ -1794,20 +1802,33 @@ void parseInline();
     if (jj_3_38()) jj_scanpos = xsp;
     if (jj_3R_59()) return true;
     xsp = jj_scanpos;
-    if (jj_3R_411()) jj_scanpos = xsp;
+    if (jj_3R_412()) jj_scanpos = xsp;
     return false;
   }
 
- inline bool jj_3R_173()
+ inline bool jj_3R_426()
  {
     if (jj_done) return true;
+    if (jj_scan_token(IS_T)) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_325()) {
+    if (jj_3R_696()) {
     jj_scanpos = xsp;
+    if (jj_scan_token(145)) return true;
+    }
+    return false;
+  }
+
+ inline bool jj_3R_173()
+ {
+    if (jj_done) return true;
+    Token * xsp;
+    xsp = jj_scanpos;
     if (jj_3R_326()) {
     jj_scanpos = xsp;
-    if (jj_3R_327()) return true;
+    if (jj_3R_327()) {
+    jj_scanpos = xsp;
+    if (jj_3R_328()) return true;
     }
     }
     return false;
@@ -1820,7 +1841,7 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_325()
+ inline bool jj_3R_326()
  {
     if (jj_done) return true;
     Token * xsp;
@@ -1830,19 +1851,6 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_425()
- {
-    if (jj_done) return true;
-    if (jj_scan_token(IS_T)) return true;
-    Token * xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_695()) {
-    jj_scanpos = xsp;
-    if (jj_scan_token(145)) return true;
-    }
-    return false;
-  }
-
  inline bool jj_3R_154()
  {
     if (jj_done) return true;
@@ -1852,28 +1860,28 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_621()
+ inline bool jj_3R_622()
  {
     if (jj_done) return true;
     if (jj_3R_58()) return true;
     return false;
   }
 
- inline bool jj_3R_620()
+ inline bool jj_3R_621()
  {
     if (jj_done) return true;
     if (jj_3R_67()) return true;
     return false;
   }
 
- inline bool jj_3R_564()
+ inline bool jj_3R_565()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_620()) {
+    if (jj_3R_621()) {
     jj_scanpos = xsp;
-    if (jj_3R_621()) return true;
+    if (jj_3R_622()) return true;
     }
     return false;
   }
@@ -1892,7 +1900,7 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_531()
+ inline bool jj_3R_532()
  {
     if (jj_done) return true;
     if (jj_scan_token(TYPE_T)) return true;
@@ -1901,42 +1909,42 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_623()
+ inline bool jj_3R_624()
  {
     if (jj_done) return true;
     if (jj_scan_token(ELSE_T)) return true;
-    if (jj_3R_258()) return true;
+    if (jj_3R_259()) return true;
     return false;
   }
 
- inline bool jj_3R_622()
+ inline bool jj_3R_623()
  {
     if (jj_done) return true;
     if (jj_scan_token(ELSIF_T)) return true;
     if (jj_3R_79()) return true;
     if (jj_scan_token(THEN_T)) return true;
-    if (jj_3R_258()) return true;
+    if (jj_3R_259()) return true;
     return false;
   }
 
- inline bool jj_3R_344()
+ inline bool jj_3R_520()
  {
     if (jj_done) return true;
-    if (jj_scan_token(COMMA_T)) return true;
-    if (jj_3R_69()) return true;
+    if (jj_scan_token(LPAREN_T)) return true;
+    if (jj_3R_313()) return true;
+    if (jj_scan_token(RPAREN_T)) return true;
     return false;
   }
 
- inline bool jj_3R_519()
+ inline bool jj_3R_345()
  {
     if (jj_done) return true;
-    if (jj_scan_token(LPAREN_T)) return true;
-    if (jj_3R_312()) return true;
-    if (jj_scan_token(RPAREN_T)) return true;
+    if (jj_scan_token(COMMA_T)) return true;
+    if (jj_3R_69()) return true;
     return false;
   }
 
- inline bool jj_3R_254()
+ inline bool jj_3R_255()
  {
     if (jj_done) return true;
     if (jj_3R_69()) return true;
@@ -1949,21 +1957,21 @@ void parseInline();
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_254()) jj_scanpos = xsp;
+    if (jj_3R_255()) jj_scanpos = xsp;
     if (jj_scan_token(IF_T)) return true;
     if (jj_3R_79()) return true;
     if (jj_scan_token(THEN_T)) return true;
-    if (jj_3R_258()) return true;
+    if (jj_3R_259()) return true;
     while (true) {
       xsp = jj_scanpos;
-      if (jj_3R_622()) { jj_scanpos = xsp; break; }
+      if (jj_3R_623()) { jj_scanpos = xsp; break; }
     }
     xsp = jj_scanpos;
-    if (jj_3R_623()) jj_scanpos = xsp;
+    if (jj_3R_624()) jj_scanpos = xsp;
     if (jj_scan_token(END_T)) return true;
     if (jj_scan_token(IF_T)) return true;
     xsp = jj_scanpos;
-    if (jj_3R_624()) jj_scanpos = xsp;
+    if (jj_3R_625()) jj_scanpos = xsp;
     if (jj_scan_token(SEMI_T)) return true;
     return false;
   }
@@ -1975,34 +1983,34 @@ void parseInline();
     Token * xsp;
     while (true) {
       xsp = jj_scanpos;
-      if (jj_3R_344()) { jj_scanpos = xsp; break; }
+      if (jj_3R_345()) { jj_scanpos = xsp; break; }
     }
     return false;
   }
 
- inline bool jj_3R_423()
+ inline bool jj_3R_424()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
     if (jj_scan_token(77)) jj_scanpos = xsp;
     xsp = jj_scanpos;
-    if (jj_3R_519()) jj_scanpos = xsp;
+    if (jj_3R_520()) jj_scanpos = xsp;
     return false;
   }
 
- inline bool jj_3R_164()
+ inline bool jj_3_116()
  {
     if (jj_done) return true;
-    if (jj_scan_token(BASIC_IDENTIFIER)) return true;
+    if (jj_3R_58()) return true;
+    if (jj_scan_token(WHEN_T)) return true;
     return false;
   }
 
- inline bool jj_3_115()
+ inline bool jj_3R_164()
  {
     if (jj_done) return true;
-    if (jj_3R_58()) return true;
-    if (jj_scan_token(WHEN_T)) return true;
+    if (jj_scan_token(BASIC_IDENTIFIER)) return true;
     return false;
   }
 
@@ -2025,15 +2033,15 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_544()
+ inline bool jj_3R_545()
  {
     if (jj_done) return true;
     if (jj_scan_token(COMMA_T)) return true;
-    if (jj_3R_543()) return true;
+    if (jj_3R_544()) return true;
     return false;
   }
 
- inline bool jj_3R_385()
+ inline bool jj_3R_386()
  {
     if (jj_done) return true;
     if (jj_3R_58()) return true;
@@ -2048,35 +2056,35 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_65()
+ inline bool jj_3R_446()
  {
     if (jj_done) return true;
-    if (jj_scan_token(GROUP_T)) return true;
-    if (jj_3R_69()) return true;
-    if (jj_scan_token(IS_T)) return true;
-    if (jj_scan_token(LPAREN_T)) return true;
-    if (jj_3R_473()) return true;
-    if (jj_scan_token(RPAREN_T)) return true;
-    if (jj_scan_token(SEMI_T)) return true;
+    if (jj_3R_529()) return true;
     return false;
   }
 
- inline bool jj_3R_445()
+ inline bool jj_3R_530()
  {
     if (jj_done) return true;
-    if (jj_3R_528()) return true;
+    if (jj_scan_token(COMMA_T)) return true;
+    if (jj_3R_448()) return true;
     return false;
   }
 
- inline bool jj_3R_529()
+ inline bool jj_3R_65()
  {
     if (jj_done) return true;
-    if (jj_scan_token(COMMA_T)) return true;
-    if (jj_3R_447()) return true;
+    if (jj_scan_token(GROUP_T)) return true;
+    if (jj_3R_69()) return true;
+    if (jj_scan_token(IS_T)) return true;
+    if (jj_scan_token(LPAREN_T)) return true;
+    if (jj_3R_474()) return true;
+    if (jj_scan_token(RPAREN_T)) return true;
+    if (jj_scan_token(SEMI_T)) return true;
     return false;
   }
 
- inline bool jj_3R_545()
+ inline bool jj_3R_546()
  {
     if (jj_done) return true;
     if (jj_scan_token(WHEN_T)) return true;
@@ -2084,28 +2092,14 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_304()
- {
-    if (jj_done) return true;
-    if (jj_3R_383()) return true;
-    return false;
-  }
-
- inline bool jj_3R_382()
+ inline bool jj_3R_305()
  {
     if (jj_done) return true;
-    if (jj_scan_token(GROUP_T)) return true;
-    if (jj_3R_69()) return true;
-    if (jj_scan_token(COLON_T)) return true;
-    if (jj_3R_69()) return true;
-    if (jj_scan_token(LPAREN_T)) return true;
-    if (jj_3R_474()) return true;
-    if (jj_scan_token(RPAREN_T)) return true;
-    if (jj_scan_token(SEMI_T)) return true;
+    if (jj_3R_384()) return true;
     return false;
   }
 
- inline bool jj_3R_424()
+ inline bool jj_3R_425()
  {
     if (jj_done) return true;
     Token * xsp;
@@ -2117,106 +2111,113 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_343()
+ inline bool jj_3R_344()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_424()) jj_scanpos = xsp;
+    if (jj_3R_425()) jj_scanpos = xsp;
     if (jj_scan_token(FUNCTION_T)) return true;
     if (jj_3R_59()) return true;
-    if (jj_3R_423()) return true;
+    if (jj_3R_424()) return true;
     if (jj_scan_token(RETURN_T)) return true;
     if (jj_3R_59()) return true;
     xsp = jj_scanpos;
-    if (jj_3R_425()) jj_scanpos = xsp;
+    if (jj_3R_426()) jj_scanpos = xsp;
     return false;
   }
 
- inline bool jj_3R_474()
+ inline bool jj_3R_383()
+ {
+    if (jj_done) return true;
+    if (jj_scan_token(GROUP_T)) return true;
+    if (jj_3R_69()) return true;
+    if (jj_scan_token(COLON_T)) return true;
+    if (jj_3R_69()) return true;
+    if (jj_scan_token(LPAREN_T)) return true;
+    if (jj_3R_475()) return true;
+    if (jj_scan_token(RPAREN_T)) return true;
+    if (jj_scan_token(SEMI_T)) return true;
+    return false;
+  }
+
+ inline bool jj_3R_475()
  {
     if (jj_done) return true;
-    if (jj_3R_543()) return true;
+    if (jj_3R_544()) return true;
     Token * xsp;
     while (true) {
       xsp = jj_scanpos;
-      if (jj_3R_544()) { jj_scanpos = xsp; break; }
+      if (jj_3R_545()) { jj_scanpos = xsp; break; }
     }
     return false;
   }
 
- inline bool jj_3R_607()
+ inline bool jj_3R_304()
  {
     if (jj_done) return true;
-    if (jj_3R_351()) return true;
+    if (jj_3R_58()) return true;
+    if (jj_3R_385()) return true;
     return false;
   }
 
- inline bool jj_3R_303()
+ inline bool jj_3R_343()
  {
     if (jj_done) return true;
-    if (jj_3R_58()) return true;
-    if (jj_3R_384()) return true;
+    if (jj_scan_token(PROCEDURE_T)) return true;
+    if (jj_3R_69()) return true;
+    if (jj_3R_424()) return true;
     return false;
   }
 
- inline bool jj_3R_342()
+ inline bool jj_3R_608()
  {
     if (jj_done) return true;
-    if (jj_scan_token(PROCEDURE_T)) return true;
-    if (jj_3R_69()) return true;
-    if (jj_3R_423()) return true;
+    if (jj_3R_352()) return true;
     return false;
   }
 
- inline bool jj_3R_606()
+ inline bool jj_3R_607()
  {
     if (jj_done) return true;
     if (jj_3R_59()) return true;
     return false;
   }
 
- inline bool jj_3R_543()
+ inline bool jj_3R_544()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_606()) {
+    if (jj_3R_607()) {
     jj_scanpos = xsp;
-    if (jj_3R_607()) return true;
+    if (jj_3R_608()) return true;
     }
     return false;
   }
 
- inline bool jj_3R_70()
- {
-    if (jj_done) return true;
-    if (jj_scan_token(GENERIC_T)) return true;
-    if (jj_scan_token(MAP_T)) return true;
-    if (jj_scan_token(LPAREN_T)) return true;
-    if (jj_3R_165()) return true;
-    if (jj_scan_token(RPAREN_T)) return true;
-    return false;
-  }
-
  inline bool jj_3R_194()
  {
     if (jj_done) return true;
-    if (jj_3R_343()) return true;
+    if (jj_3R_344()) return true;
     return false;
   }
 
- inline bool jj_3R_170()
+ inline bool jj_3R_70()
  {
     if (jj_done) return true;
-    if (jj_3R_69()) return true;
+    if (jj_scan_token(GENERIC_T)) return true;
+    if (jj_scan_token(MAP_T)) return true;
+    if (jj_scan_token(LPAREN_T)) return true;
+    if (jj_3R_165()) return true;
+    if (jj_scan_token(RPAREN_T)) return true;
     return false;
   }
 
  inline bool jj_3R_193()
  {
     if (jj_done) return true;
-    if (jj_3R_342()) return true;
+    if (jj_3R_343()) return true;
     return false;
   }
 
@@ -2232,36 +2233,43 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_158()
+ inline bool jj_3R_170()
  {
     if (jj_done) return true;
-    if (jj_3R_312()) return true;
+    if (jj_3R_69()) return true;
     return false;
   }
 
- inline bool jj_3R_475()
+ inline bool jj_3R_476()
  {
     if (jj_done) return true;
     if (jj_scan_token(ELSE_T)) return true;
     if (jj_3R_58()) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_545()) jj_scanpos = xsp;
+    if (jj_3R_546()) jj_scanpos = xsp;
     return false;
   }
 
- inline bool jj_3R_384()
+ inline bool jj_3R_385()
  {
     if (jj_done) return true;
     Token * xsp;
-    if (jj_3R_475()) return true;
+    if (jj_3R_476()) return true;
     while (true) {
       xsp = jj_scanpos;
-      if (jj_3R_475()) { jj_scanpos = xsp; break; }
+      if (jj_3R_476()) { jj_scanpos = xsp; break; }
     }
     return false;
   }
 
+ inline bool jj_3R_158()
+ {
+    if (jj_done) return true;
+    if (jj_3R_313()) return true;
+    return false;
+  }
+
  inline bool jj_3R_66()
  {
     if (jj_done) return true;
@@ -2273,7 +2281,7 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_383()
+ inline bool jj_3R_384()
  {
     if (jj_done) return true;
     Token * xsp;
@@ -2285,14 +2293,14 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_446()
+ inline bool jj_3R_447()
  {
     if (jj_done) return true;
-    if (jj_3R_404()) return true;
+    if (jj_3R_405()) return true;
     return false;
   }
 
- inline bool jj_3R_321()
+ inline bool jj_3R_322()
  {
     if (jj_done) return true;
     if (jj_scan_token(IF_T)) return true;
@@ -2300,42 +2308,42 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_168()
+ inline bool jj_3R_448()
  {
     if (jj_done) return true;
+    if (jj_3R_445()) return true;
+    if (jj_scan_token(WHEN_T)) return true;
+    if (jj_3R_85()) return true;
     Token * xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_320()) {
-    jj_scanpos = xsp;
-    if (jj_3R_321()) return true;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_530()) { jj_scanpos = xsp; break; }
     }
+    if (jj_scan_token(SEMI_T)) return true;
     return false;
   }
 
- inline bool jj_3R_320()
+ inline bool jj_3R_168()
  {
     if (jj_done) return true;
-    if (jj_scan_token(FOR_T)) return true;
-    if (jj_3R_407()) return true;
+    Token * xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_321()) {
+    jj_scanpos = xsp;
+    if (jj_3R_322()) return true;
+    }
     return false;
   }
 
- inline bool jj_3R_447()
+ inline bool jj_3R_321()
  {
     if (jj_done) return true;
-    if (jj_3R_444()) return true;
-    if (jj_scan_token(WHEN_T)) return true;
-    if (jj_3R_85()) return true;
-    Token * xsp;
-    while (true) {
-      xsp = jj_scanpos;
-      if (jj_3R_529()) { jj_scanpos = xsp; break; }
-    }
-    if (jj_scan_token(SEMI_T)) return true;
+    if (jj_scan_token(FOR_T)) return true;
+    if (jj_3R_408()) return true;
     return false;
   }
 
- inline bool jj_3R_305()
+ inline bool jj_3R_306()
  {
     if (jj_done) return true;
     if (jj_3R_58()) return true;
@@ -2349,36 +2357,19 @@ void parseInline();
     }
     while (true) {
       xsp = jj_scanpos;
-      if (jj_3R_385()) { jj_scanpos = xsp; break; }
+      if (jj_3R_386()) { jj_scanpos = xsp; break; }
     }
     return false;
   }
 
- inline bool jj_3R_74()
- {
-    if (jj_done) return true;
-    if (jj_3R_69()) return true;
-    if (jj_scan_token(COLON_T)) return true;
-    if (jj_3R_168()) return true;
-    if (jj_scan_token(GENERATE_T)) return true;
-    if (jj_3R_169()) return true;
-    if (jj_scan_token(END_T)) return true;
-    if (jj_scan_token(GENERATE_T)) return true;
-    Token * xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_170()) jj_scanpos = xsp;
-    if (jj_scan_token(SEMI_T)) return true;
-    return false;
-  }
-
- inline bool jj_3R_302()
+ inline bool jj_3R_303()
  {
     if (jj_done) return true;
-    if (jj_3R_383()) return true;
+    if (jj_3R_384()) return true;
     return false;
   }
 
- inline bool jj_3_111()
+ inline bool jj_3_112()
  {
     if (jj_done) return true;
     if (jj_3R_142()) return true;
@@ -2386,13 +2377,20 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_104()
+ inline bool jj_3R_74()
  {
     if (jj_done) return true;
-    if (jj_3R_59()) return true;
-    if (jj_scan_token(LPAREN_T)) return true;
-    if (jj_3R_225()) return true;
-    if (jj_scan_token(RPAREN_T)) return true;
+    if (jj_3R_69()) return true;
+    if (jj_scan_token(COLON_T)) return true;
+    if (jj_3R_168()) return true;
+    if (jj_scan_token(GENERATE_T)) return true;
+    if (jj_3R_169()) return true;
+    if (jj_scan_token(END_T)) return true;
+    if (jj_scan_token(GENERATE_T)) return true;
+    Token * xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_170()) jj_scanpos = xsp;
+    if (jj_scan_token(SEMI_T)) return true;
     return false;
   }
 
@@ -2409,19 +2407,29 @@ void parseInline();
     if (jj_scan_token(LESSTHAN_T)) return true;
     if (jj_scan_token(FORCE_T)) return true;
     xsp = jj_scanpos;
-    if (jj_3R_304()) jj_scanpos = xsp;
-    if (jj_3R_305()) return true;
+    if (jj_3R_305()) jj_scanpos = xsp;
+    if (jj_3R_306()) return true;
     return false;
   }
 
- inline bool jj_3_114()
+ inline bool jj_3R_104()
+ {
+    if (jj_done) return true;
+    if (jj_3R_59()) return true;
+    if (jj_scan_token(LPAREN_T)) return true;
+    if (jj_3R_226()) return true;
+    if (jj_scan_token(RPAREN_T)) return true;
+    return false;
+  }
+
+ inline bool jj_3_115()
  {
     if (jj_done) return true;
     if (jj_3R_108()) return true;
     return false;
   }
 
- inline bool jj_3R_368()
+ inline bool jj_3R_369()
  {
     if (jj_done) return true;
     if (jj_scan_token(WITH_T)) return true;
@@ -2433,12 +2441,12 @@ void parseInline();
     if (jj_3R_114()) return true;
     if (jj_scan_token(LESSTHAN_T)) return true;
     xsp = jj_scanpos;
-    if (jj_3R_446()) jj_scanpos = xsp;
-    if (jj_3R_447()) return true;
+    if (jj_3R_447()) jj_scanpos = xsp;
+    if (jj_3R_448()) return true;
     return false;
   }
 
- inline bool jj_3R_300()
+ inline bool jj_3R_301()
  {
     if (jj_done) return true;
     if (jj_3R_142()) return true;
@@ -2446,14 +2454,14 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_686()
+ inline bool jj_3R_687()
  {
     if (jj_done) return true;
     if (jj_3R_59()) return true;
     return false;
   }
 
- inline bool jj_3R_574()
+ inline bool jj_3R_575()
  {
     if (jj_done) return true;
     if (jj_scan_token(WHEN_T)) return true;
@@ -2461,40 +2469,33 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_685()
+ inline bool jj_3R_686()
  {
     if (jj_done) return true;
     if (jj_3R_108()) return true;
     return false;
   }
 
- inline bool jj_3R_662()
+ inline bool jj_3R_663()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_685()) {
+    if (jj_3R_686()) {
     jj_scanpos = xsp;
-    if (jj_3R_686()) return true;
+    if (jj_3R_687()) return true;
     }
     return false;
   }
 
- inline bool jj_3R_462()
- {
-    if (jj_done) return true;
-    if (jj_3R_533()) return true;
-    return false;
-  }
-
- inline bool jj_3_113()
+ inline bool jj_3_114()
  {
     if (jj_done) return true;
     if (jj_3R_144()) return true;
     return false;
   }
 
- inline bool jj_3R_526()
+ inline bool jj_3R_527()
  {
     if (jj_done) return true;
     if (jj_scan_token(WITH_T)) return true;
@@ -2503,23 +2504,30 @@ void parseInline();
     Token * xsp;
     xsp = jj_scanpos;
     if (jj_scan_token(155)) jj_scanpos = xsp;
-    if (jj_3R_662()) return true;
+    if (jj_3R_663()) return true;
     if (jj_scan_token(VARASSIGN_T)) return true;
-    if (jj_3R_305()) return true;
+    if (jj_3R_306()) return true;
     return false;
   }
 
- inline bool jj_3R_443()
+ inline bool jj_3R_444()
  {
     if (jj_done) return true;
-    if (jj_3R_404()) return true;
+    if (jj_3R_405()) return true;
     return false;
   }
 
- inline bool jj_3R_270()
+ inline bool jj_3R_463()
  {
     if (jj_done) return true;
-    if (jj_3R_368()) return true;
+    if (jj_3R_534()) return true;
+    return false;
+  }
+
+ inline bool jj_3R_271()
+ {
+    if (jj_done) return true;
+    if (jj_3R_369()) return true;
     return false;
   }
 
@@ -2528,29 +2536,20 @@ void parseInline();
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_269()) {
+    if (jj_3R_270()) {
     jj_scanpos = xsp;
-    if (jj_3R_270()) return true;
+    if (jj_3R_271()) return true;
     }
     return false;
   }
 
- inline bool jj_3R_269()
+ inline bool jj_3R_270()
  {
     if (jj_done) return true;
     if (jj_3R_144()) return true;
     return false;
   }
 
- inline bool jj_3R_156()
- {
-    if (jj_done) return true;
-    if (jj_scan_token(LPAREN_T)) return true;
-    if (jj_3R_311()) return true;
-    if (jj_scan_token(RPAREN_T)) return true;
-    return false;
-  }
-
  inline bool jj_3R_143()
  {
     if (jj_done) return true;
@@ -2559,96 +2558,98 @@ void parseInline();
     if (jj_scan_token(FORCE_T)) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_302()) jj_scanpos = xsp;
+    if (jj_3R_303()) jj_scanpos = xsp;
     if (jj_3R_58()) return true;
     if (jj_scan_token(WHEN_T)) return true;
     xsp = jj_scanpos;
-    if (jj_3R_303()) jj_scanpos = xsp;
+    if (jj_3R_304()) jj_scanpos = xsp;
     if (jj_scan_token(SEMI_T)) return true;
     return false;
   }
 
- inline bool jj_3R_136()
+ inline bool jj_3R_156()
  {
     if (jj_done) return true;
-    if (jj_scan_token(TYPE_T)) return true;
-    if (jj_3R_69()) return true;
-    if (jj_scan_token(IS_T)) return true;
-    if (jj_3R_576()) return true;
-    if (jj_scan_token(SEMI_T)) return true;
+    if (jj_scan_token(LPAREN_T)) return true;
+    if (jj_3R_312()) return true;
+    if (jj_scan_token(RPAREN_T)) return true;
     return false;
   }
 
- inline bool jj_3R_528()
+ inline bool jj_3R_529()
  {
     if (jj_done) return true;
     if (jj_scan_token(ELSE_T)) return true;
     if (jj_3R_58()) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_574()) jj_scanpos = xsp;
+    if (jj_3R_575()) jj_scanpos = xsp;
     return false;
   }
 
- inline bool jj_3_112()
+ inline bool jj_3_113()
  {
     if (jj_done) return true;
     if (jj_3R_143()) return true;
     return false;
   }
 
- inline bool jj_3R_323()
+ inline bool jj_3R_136()
  {
     if (jj_done) return true;
-    if (jj_3R_409()) return true;
+    if (jj_scan_token(TYPE_T)) return true;
+    if (jj_3R_69()) return true;
+    if (jj_scan_token(IS_T)) return true;
+    if (jj_3R_577()) return true;
+    if (jj_scan_token(SEMI_T)) return true;
     return false;
   }
 
- inline bool jj_3R_63()
+ inline bool jj_3R_324()
  {
     if (jj_done) return true;
-    if (jj_3R_59()) return true;
-    Token * xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_156()) jj_scanpos = xsp;
+    if (jj_3R_410()) return true;
     return false;
   }
 
- inline bool jj_3R_367()
+ inline bool jj_3R_368()
  {
     if (jj_done) return true;
     if (jj_3R_114()) return true;
     if (jj_scan_token(LESSTHAN_T)) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_443()) jj_scanpos = xsp;
-    if (jj_3R_444()) return true;
+    if (jj_3R_444()) jj_scanpos = xsp;
+    if (jj_3R_445()) return true;
     if (jj_scan_token(WHEN_T)) return true;
     if (jj_3R_58()) return true;
     xsp = jj_scanpos;
-    if (jj_3R_445()) jj_scanpos = xsp;
+    if (jj_3R_446()) jj_scanpos = xsp;
     if (jj_scan_token(SEMI_T)) return true;
     return false;
   }
 
- inline bool jj_3R_569()
+ inline bool jj_3R_63()
  {
     if (jj_done) return true;
-    if (jj_3R_312()) return true;
+    if (jj_3R_59()) return true;
+    Token * xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_156()) jj_scanpos = xsp;
     return false;
   }
 
- inline bool jj_3R_268()
+ inline bool jj_3R_269()
  {
     if (jj_done) return true;
-    if (jj_3R_367()) return true;
+    if (jj_3R_368()) return true;
     return false;
   }
 
- inline bool jj_3R_397()
+ inline bool jj_3R_570()
  {
     if (jj_done) return true;
-    if (jj_scan_token(INTEGER)) return true;
+    if (jj_3R_313()) return true;
     return false;
   }
 
@@ -2657,33 +2658,40 @@ void parseInline();
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_267()) {
+    if (jj_3R_268()) {
     jj_scanpos = xsp;
-    if (jj_3R_268()) return true;
+    if (jj_3R_269()) return true;
     }
     return false;
   }
 
- inline bool jj_3R_267()
+ inline bool jj_3R_268()
  {
     if (jj_done) return true;
     if (jj_3R_143()) return true;
     return false;
   }
 
- inline bool jj_3R_311()
+ inline bool jj_3R_398()
+ {
+    if (jj_done) return true;
+    if (jj_scan_token(INTEGER)) return true;
+    return false;
+  }
+
+ inline bool jj_3R_312()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_396()) {
+    if (jj_3R_397()) {
     jj_scanpos = xsp;
-    if (jj_3R_397()) return true;
+    if (jj_3R_398()) return true;
     }
     return false;
   }
 
- inline bool jj_3R_396()
+ inline bool jj_3R_397()
  {
     if (jj_done) return true;
     if (jj_3R_59()) return true;
@@ -2698,12 +2706,12 @@ void parseInline();
     Token * xsp;
     while (true) {
       xsp = jj_scanpos;
-      if (jj_3R_300()) { jj_scanpos = xsp; break; }
+      if (jj_3R_301()) { jj_scanpos = xsp; break; }
     }
     return false;
   }
 
- inline bool jj_3R_554()
+ inline bool jj_3R_555()
  {
     if (jj_done) return true;
     if (jj_scan_token(AT_T)) return true;
@@ -2711,7 +2719,7 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_301()
+ inline bool jj_3R_302()
  {
     if (jj_done) return true;
     if (jj_scan_token(LPAREN_T)) return true;
@@ -2720,14 +2728,14 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3_110()
+ inline bool jj_3_111()
  {
     if (jj_done) return true;
     if (jj_3R_141()) return true;
     return false;
   }
 
- inline bool jj_3R_656()
+ inline bool jj_3R_657()
  {
     if (jj_done) return true;
     if (jj_scan_token(FILE_T)) return true;
@@ -2736,29 +2744,29 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_579()
+ inline bool jj_3R_612()
  {
     if (jj_done) return true;
-    if (jj_scan_token(OPEN_T)) return true;
-    if (jj_3R_58()) return true;
+    if (jj_3R_141()) return true;
     return false;
   }
 
- inline bool jj_3R_611()
+ inline bool jj_3R_580()
  {
     if (jj_done) return true;
-    if (jj_3R_141()) return true;
+    if (jj_scan_token(OPEN_T)) return true;
+    if (jj_3R_58()) return true;
     return false;
   }
 
- inline bool jj_3R_533()
+ inline bool jj_3R_534()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_579()) jj_scanpos = xsp;
+    if (jj_3R_580()) jj_scanpos = xsp;
     if (jj_scan_token(IS_T)) return true;
-    if (jj_3R_580()) return true;
+    if (jj_3R_581()) return true;
     return false;
   }
 
@@ -2768,46 +2776,38 @@ void parseInline();
     if (jj_3R_69()) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_301()) jj_scanpos = xsp;
+    if (jj_3R_302()) jj_scanpos = xsp;
     return false;
   }
 
- inline bool jj_3R_580()
+ inline bool jj_3R_640()
  {
     if (jj_done) return true;
-    if (jj_3R_58()) return true;
+    if (jj_scan_token(NEG_T)) return true;
+    if (jj_scan_token(DOT_T)) return true;
     return false;
   }
 
- inline bool jj_3R_639()
+ inline bool jj_3R_581()
  {
     if (jj_done) return true;
-    if (jj_scan_token(NEG_T)) return true;
-    if (jj_scan_token(DOT_T)) return true;
+    if (jj_3R_58()) return true;
     return false;
   }
 
- inline bool jj_3R_610()
+ inline bool jj_3R_611()
  {
     if (jj_done) return true;
     Token * xsp;
-    if (jj_3R_639()) return true;
+    if (jj_3R_640()) return true;
     while (true) {
       xsp = jj_scanpos;
-      if (jj_3R_639()) { jj_scanpos = xsp; break; }
+      if (jj_3R_640()) { jj_scanpos = xsp; break; }
     }
     return false;
   }
 
- inline bool jj_3R_448()
- {
-    if (jj_done) return true;
-    if (jj_scan_token(DOUBLEMULT_T)) return true;
-    if (jj_3R_369()) return true;
-    return false;
-  }
-
- inline bool jj_3_109()
+ inline bool jj_3_110()
  {
     if (jj_done) return true;
     if (jj_scan_token(DOT_T)) return true;
@@ -2815,32 +2815,48 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_553()
+ inline bool jj_3R_554()
  {
     if (jj_done) return true;
-    if (jj_3R_610()) return true;
+    if (jj_3R_611()) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_611()) jj_scanpos = xsp;
+    if (jj_3R_612()) jj_scanpos = xsp;
     if (jj_3R_69()) return true;
     return false;
   }
 
- inline bool jj_3R_375()
+ inline bool jj_3R_449()
  {
     if (jj_done) return true;
-    if (jj_scan_token(FILE_T)) return true;
-    if (jj_3R_196()) return true;
-    if (jj_scan_token(COLON_T)) return true;
+    if (jj_scan_token(DOUBLEMULT_T)) return true;
+    if (jj_3R_370()) return true;
+    return false;
+  }
+
+ inline bool jj_3R_610()
+ {
+    if (jj_done) return true;
+    if (jj_scan_token(DOT_T)) return true;
+    if (jj_3R_69()) return true;
+    return false;
+  }
+
+ inline bool jj_3R_376()
+ {
+    if (jj_done) return true;
+    if (jj_scan_token(FILE_T)) return true;
+    if (jj_3R_196()) return true;
+    if (jj_scan_token(COLON_T)) return true;
     if (jj_3R_84()) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_462()) jj_scanpos = xsp;
+    if (jj_3R_463()) jj_scanpos = xsp;
     if (jj_scan_token(SEMI_T)) return true;
     return false;
   }
 
- inline bool jj_3R_263()
+ inline bool jj_3R_264()
  {
     if (jj_done) return true;
     if (jj_3R_69()) return true;
@@ -2851,44 +2867,50 @@ void parseInline();
  {
     if (jj_done) return true;
     if (jj_scan_token(DOT_T)) return true;
+    if (jj_3R_141()) return true;
     if (jj_3R_69()) return true;
     return false;
   }
 
- inline bool jj_3R_283()
+ inline bool jj_3R_553()
+ {
+    if (jj_done) return true;
+    Token * xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_609()) {
+    jj_scanpos = xsp;
+    if (jj_3R_610()) return true;
+    }
+    return false;
+  }
+
+ inline bool jj_3R_284()
  {
     if (jj_done) return true;
     if (jj_scan_token(NOT_T)) return true;
-    if (jj_3R_369()) return true;
+    if (jj_3R_370()) return true;
     return false;
   }
 
- inline bool jj_3R_282()
+ inline bool jj_3R_283()
  {
     if (jj_done) return true;
     if (jj_scan_token(ABS_T)) return true;
-    if (jj_3R_369()) return true;
+    if (jj_3R_370()) return true;
     return false;
   }
 
- inline bool jj_3R_608()
+ inline bool jj_3R_489()
  {
     if (jj_done) return true;
-    if (jj_scan_token(DOT_T)) return true;
-    if (jj_3R_141()) return true;
-    if (jj_3R_69()) return true;
+    if (jj_3R_555()) return true;
     return false;
   }
 
- inline bool jj_3R_552()
+ inline bool jj_3R_488()
  {
     if (jj_done) return true;
-    Token * xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_608()) {
-    jj_scanpos = xsp;
-    if (jj_3R_609()) return true;
-    }
+    if (jj_3R_554()) return true;
     return false;
   }
 
@@ -2897,30 +2919,38 @@ void parseInline();
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_281()) {
-    jj_scanpos = xsp;
     if (jj_3R_282()) {
     jj_scanpos = xsp;
-    if (jj_3R_283()) return true;
+    if (jj_3R_283()) {
+    jj_scanpos = xsp;
+    if (jj_3R_284()) return true;
     }
     }
     return false;
   }
 
- inline bool jj_3R_281()
+ inline bool jj_3R_282()
  {
     if (jj_done) return true;
-    if (jj_3R_369()) return true;
+    if (jj_3R_370()) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_448()) jj_scanpos = xsp;
+    if (jj_3R_449()) jj_scanpos = xsp;
     return false;
   }
 
- inline bool jj_3R_488()
+ inline bool jj_3R_396()
  {
     if (jj_done) return true;
-    if (jj_3R_554()) return true;
+    Token * xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_487()) {
+    jj_scanpos = xsp;
+    if (jj_3R_488()) {
+    jj_scanpos = xsp;
+    if (jj_3R_489()) return true;
+    }
+    }
     return false;
   }
 
@@ -2931,129 +2961,119 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_395()
+ inline bool jj_3_107()
  {
     if (jj_done) return true;
-    Token * xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_486()) {
-    jj_scanpos = xsp;
-    if (jj_3R_487()) {
-    jj_scanpos = xsp;
-    if (jj_3R_488()) return true;
-    }
-    }
+    if (jj_3R_138()) return true;
     return false;
   }
 
- inline bool jj_3R_486()
+ inline bool jj_3R_697()
  {
     if (jj_done) return true;
-    if (jj_3R_552()) return true;
+    if (jj_scan_token(COMMA_T)) return true;
+    if (jj_3R_96()) return true;
     return false;
   }
 
- inline bool jj_3R_696()
+ inline bool jj_3R_486()
  {
     if (jj_done) return true;
-    if (jj_scan_token(COMMA_T)) return true;
-    if (jj_3R_96()) return true;
+    if (jj_scan_token(VARIABLE_T)) return true;
     return false;
   }
 
  inline bool jj_3R_146()
  {
     if (jj_done) return true;
-    if (jj_3R_308()) return true;
+    if (jj_3R_309()) return true;
     if (jj_3R_145()) return true;
     return false;
   }
 
- inline bool jj_3_106()
+ inline bool jj_3R_485()
  {
     if (jj_done) return true;
-    if (jj_3R_138()) return true;
+    if (jj_scan_token(SIGNAL_T)) return true;
     return false;
   }
 
- inline bool jj_3R_393()
+ inline bool jj_3R_394()
  {
     if (jj_done) return true;
     if (jj_scan_token(OR_T)) return true;
     return false;
   }
 
- inline bool jj_3R_392()
+ inline bool jj_3R_393()
  {
     if (jj_done) return true;
     if (jj_scan_token(XOR_T)) return true;
     return false;
   }
 
- inline bool jj_3R_485()
+ inline bool jj_3R_392()
  {
     if (jj_done) return true;
-    if (jj_scan_token(VARIABLE_T)) return true;
+    if (jj_scan_token(XNOR_T)) return true;
     return false;
   }
 
- inline bool jj_3R_391()
+ inline bool jj_3R_395()
  {
     if (jj_done) return true;
-    if (jj_scan_token(XNOR_T)) return true;
+    Token * xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_484()) {
+    jj_scanpos = xsp;
+    if (jj_3R_485()) {
+    jj_scanpos = xsp;
+    if (jj_3R_486()) return true;
+    }
+    }
     return false;
   }
 
  inline bool jj_3R_484()
  {
     if (jj_done) return true;
-    if (jj_scan_token(SIGNAL_T)) return true;
+    if (jj_scan_token(CONSTANT_T)) return true;
     return false;
   }
 
- inline bool jj_3R_390()
+ inline bool jj_3R_391()
  {
     if (jj_done) return true;
     if (jj_scan_token(NOR_T)) return true;
     return false;
   }
 
- inline bool jj_3R_389()
+ inline bool jj_3R_390()
  {
     if (jj_done) return true;
     if (jj_scan_token(NAND_T)) return true;
     return false;
   }
 
- inline bool jj_3R_394()
+ inline bool jj_3_109()
  {
     if (jj_done) return true;
-    Token * xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_483()) {
-    jj_scanpos = xsp;
-    if (jj_3R_484()) {
-    jj_scanpos = xsp;
-    if (jj_3R_485()) return true;
-    }
-    }
+    if (jj_3R_140()) return true;
     return false;
   }
 
- inline bool jj_3R_483()
+ inline bool jj_3R_275()
  {
     if (jj_done) return true;
-    if (jj_scan_token(CONSTANT_T)) return true;
+    if (jj_3R_132()) return true;
     return false;
   }
 
- inline bool jj_3R_308()
+ inline bool jj_3R_309()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_388()) {
-    jj_scanpos = xsp;
     if (jj_3R_389()) {
     jj_scanpos = xsp;
     if (jj_3R_390()) {
@@ -3062,7 +3082,9 @@ void parseInline();
     jj_scanpos = xsp;
     if (jj_3R_392()) {
     jj_scanpos = xsp;
-    if (jj_3R_393()) return true;
+    if (jj_3R_393()) {
+    jj_scanpos = xsp;
+    if (jj_3R_394()) return true;
     }
     }
     }
@@ -3071,24 +3093,22 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_388()
+ inline bool jj_3R_389()
  {
     if (jj_done) return true;
     if (jj_scan_token(AND_T)) return true;
     return false;
   }
 
- inline bool jj_3_108()
- {
-    if (jj_done) return true;
-    if (jj_3R_140()) return true;
-    return false;
-  }
-
- inline bool jj_3R_274()
+ inline bool jj_3R_311()
  {
     if (jj_done) return true;
-    if (jj_3R_132()) return true;
+    if (jj_scan_token(SLSL_T)) return true;
+    if (jj_3R_395()) return true;
+    if (jj_3R_396()) return true;
+    if (jj_scan_token(COLON_T)) return true;
+    if (jj_3R_84()) return true;
+    if (jj_scan_token(RSRS_T)) return true;
     return false;
   }
 
@@ -3104,32 +3124,20 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_310()
- {
-    if (jj_done) return true;
-    if (jj_scan_token(SLSL_T)) return true;
-    if (jj_3R_394()) return true;
-    if (jj_3R_395()) return true;
-    if (jj_scan_token(COLON_T)) return true;
-    if (jj_3R_84()) return true;
-    if (jj_scan_token(RSRS_T)) return true;
-    return false;
-  }
-
- inline bool jj_3R_408()
+ inline bool jj_3R_409()
  {
     if (jj_done) return true;
     if (jj_3R_140()) return true;
     return false;
   }
 
- inline bool jj_3R_322()
+ inline bool jj_3R_323()
  {
     if (jj_done) return true;
     Token * xsp;
     while (true) {
       xsp = jj_scanpos;
-      if (jj_3R_408()) { jj_scanpos = xsp; break; }
+      if (jj_3R_409()) { jj_scanpos = xsp; break; }
     }
     if (jj_scan_token(BEGIN_T)) return true;
     return false;
@@ -3140,15 +3148,30 @@ void parseInline();
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_322()) jj_scanpos = xsp;
+    if (jj_3R_323()) jj_scanpos = xsp;
     while (true) {
       xsp = jj_scanpos;
-      if (jj_3R_323()) { jj_scanpos = xsp; break; }
+      if (jj_3R_324()) { jj_scanpos = xsp; break; }
     }
     return false;
   }
 
- inline bool jj_3R_264()
+ inline bool jj_3R_285()
+ {
+    if (jj_done) return true;
+    if (jj_3R_69()) return true;
+    return false;
+  }
+
+ inline bool jj_3R_662()
+ {
+    if (jj_done) return true;
+    if (jj_scan_token(BEGIN_T)) return true;
+    if (jj_3R_662()) return true;
+    return false;
+  }
+
+ inline bool jj_3R_265()
  {
     if (jj_done) return true;
     if (jj_scan_token(WHEN_T)) return true;
@@ -3156,14 +3179,14 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_284()
+ inline bool jj_3R_235()
  {
     if (jj_done) return true;
-    if (jj_3R_69()) return true;
+    if (jj_3R_132()) return true;
     return false;
   }
 
- inline bool jj_3R_262()
+ inline bool jj_3R_263()
  {
     if (jj_done) return true;
     if (jj_3R_69()) return true;
@@ -3171,11 +3194,11 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_661()
+ inline bool jj_3_108()
  {
     if (jj_done) return true;
-    if (jj_scan_token(BEGIN_T)) return true;
-    if (jj_3R_661()) return true;
+    if (jj_3R_139()) return true;
+    if (jj_scan_token(COLON_T)) return true;
     return false;
   }
 
@@ -3184,32 +3207,28 @@ void parseInline();
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_262()) jj_scanpos = xsp;
-    if (jj_scan_token(EXIT_T)) return true;
-    xsp = jj_scanpos;
     if (jj_3R_263()) jj_scanpos = xsp;
+    if (jj_scan_token(EXIT_T)) return true;
     xsp = jj_scanpos;
     if (jj_3R_264()) jj_scanpos = xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_265()) jj_scanpos = xsp;
     if (jj_scan_token(SEMI_T)) return true;
     return false;
   }
 
- inline bool jj_3R_234()
- {
-    if (jj_done) return true;
-    if (jj_3R_132()) return true;
-    return false;
-  }
-
- inline bool jj_3_107()
+ inline bool jj_3R_138()
  {
     if (jj_done) return true;
-    if (jj_3R_139()) return true;
-    if (jj_scan_token(COLON_T)) return true;
+    if (jj_scan_token(END_T)) return true;
+    Token * xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_285()) jj_scanpos = xsp;
+    if (jj_scan_token(SEMI_T)) return true;
     return false;
   }
 
- inline bool jj_3R_687()
+ inline bool jj_3R_688()
  {
     if (jj_done) return true;
     if (jj_scan_token(LPAREN_T)) return true;
@@ -3217,47 +3236,48 @@ void parseInline();
     Token * xsp;
     while (true) {
       xsp = jj_scanpos;
-      if (jj_3R_696()) { jj_scanpos = xsp; break; }
+      if (jj_3R_697()) { jj_scanpos = xsp; break; }
     }
     if (jj_scan_token(RPAREN_T)) return true;
     return false;
   }
 
- inline bool jj_3R_138()
+ inline bool jj_3R_641()
  {
     if (jj_done) return true;
-    if (jj_scan_token(END_T)) return true;
-    Token * xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_284()) jj_scanpos = xsp;
-    if (jj_scan_token(SEMI_T)) return true;
+    if (jj_3R_132()) return true;
     return false;
   }
 
- inline bool jj_3R_640()
+ inline bool jj_3R_652()
  {
     if (jj_done) return true;
-    if (jj_3R_132()) return true;
+    if (jj_scan_token(WHEN_T)) return true;
+    Token * xsp;
+    xsp = jj_scanpos;
+    if (jj_3_108()) jj_scanpos = xsp;
+    if (jj_3R_85()) return true;
+    if (jj_scan_token(ARROW_T)) return true;
+    if (jj_3R_662()) return true;
     return false;
   }
 
  inline bool jj_3R_208()
  {
     if (jj_done) return true;
-    if (jj_3R_351()) return true;
+    if (jj_3R_352()) return true;
     return false;
   }
 
- inline bool jj_3R_651()
+ inline bool jj_3R_619()
  {
     if (jj_done) return true;
-    if (jj_scan_token(WHEN_T)) return true;
     Token * xsp;
-    xsp = jj_scanpos;
-    if (jj_3_107()) jj_scanpos = xsp;
-    if (jj_3R_85()) return true;
-    if (jj_scan_token(ARROW_T)) return true;
-    if (jj_3R_661()) return true;
+    if (jj_3R_652()) return true;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_652()) { jj_scanpos = xsp; break; }
+    }
     return false;
   }
 
@@ -3280,51 +3300,39 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_618()
+ inline bool jj_3R_695()
  {
     if (jj_done) return true;
-    Token * xsp;
-    if (jj_3R_651()) return true;
-    while (true) {
-      xsp = jj_scanpos;
-      if (jj_3R_651()) { jj_scanpos = xsp; break; }
-    }
+    if (jj_3R_352()) return true;
     return false;
   }
 
- inline bool jj_3R_694()
+ inline bool jj_3R_561()
  {
     if (jj_done) return true;
-    if (jj_3R_351()) return true;
+    if (jj_scan_token(CASE_T)) return true;
+    if (jj_3R_58()) return true;
+    if (jj_scan_token(GENERATE_T)) return true;
+    if (jj_3R_619()) return true;
     return false;
   }
 
- inline bool jj_3R_693()
+ inline bool jj_3R_694()
  {
     if (jj_done) return true;
     if (jj_3R_59()) return true;
     return false;
   }
 
- inline bool jj_3R_683()
- {
-    if (jj_done) return true;
-    Token * xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_693()) {
-    jj_scanpos = xsp;
-    if (jj_3R_694()) return true;
-    }
-    return false;
-  }
-
- inline bool jj_3R_560()
+ inline bool jj_3R_684()
  {
     if (jj_done) return true;
-    if (jj_scan_token(CASE_T)) return true;
-    if (jj_3R_58()) return true;
-    if (jj_scan_token(GENERATE_T)) return true;
-    if (jj_3R_618()) return true;
+    Token * xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_694()) {
+    jj_scanpos = xsp;
+    if (jj_3R_695()) return true;
+    }
     return false;
   }
 
@@ -3347,7 +3355,7 @@ void parseInline();
     if (jj_done) return true;
     if (jj_scan_token(GENERIC_T)) return true;
     if (jj_scan_token(LPAREN_T)) return true;
-    if (jj_3R_312()) return true;
+    if (jj_3R_313()) return true;
     if (jj_scan_token(RPAREN_T)) return true;
     return false;
   }
@@ -3363,65 +3371,65 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_469()
+ inline bool jj_3R_470()
  {
     if (jj_done) return true;
-    if (jj_3R_538()) return true;
-    if (jj_scan_token(COLON_T)) return true;
     if (jj_3R_539()) return true;
+    if (jj_scan_token(COLON_T)) return true;
+    if (jj_3R_540()) return true;
     return false;
   }
 
- inline bool jj_3R_684()
+ inline bool jj_3R_685()
  {
     if (jj_done) return true;
-    if (jj_3R_233()) return true;
+    if (jj_3R_234()) return true;
     return false;
   }
 
- inline bool jj_3R_584()
+ inline bool jj_3R_585()
  {
     if (jj_done) return true;
     if (jj_scan_token(ALL_T)) return true;
     return false;
   }
 
- inline bool jj_3R_583()
+ inline bool jj_3R_584()
  {
     if (jj_done) return true;
     if (jj_scan_token(OTHER_T)) return true;
     return false;
   }
 
- inline bool jj_3R_637()
+ inline bool jj_3R_638()
  {
     if (jj_done) return true;
-    if (jj_3R_658()) return true;
+    if (jj_3R_659()) return true;
     return false;
   }
 
- inline bool jj_3R_582()
+ inline bool jj_3R_583()
  {
     if (jj_done) return true;
     Token * xsp;
-    if (jj_3R_637()) return true;
+    if (jj_3R_638()) return true;
     while (true) {
       xsp = jj_scanpos;
-      if (jj_3R_637()) { jj_scanpos = xsp; break; }
+      if (jj_3R_638()) { jj_scanpos = xsp; break; }
     }
     return false;
   }
 
- inline bool jj_3R_538()
+ inline bool jj_3R_539()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_582()) {
-    jj_scanpos = xsp;
     if (jj_3R_583()) {
     jj_scanpos = xsp;
-    if (jj_3R_584()) return true;
+    if (jj_3R_584()) {
+    jj_scanpos = xsp;
+    if (jj_3R_585()) return true;
     }
     }
     return false;
@@ -3435,35 +3443,35 @@ void parseInline();
     if (jj_scan_token(IS_T)) return true;
     if (jj_scan_token(NEW_T)) return true;
     if (jj_3R_59()) return true;
-    if (jj_3R_233()) return true;
+    if (jj_3R_234()) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_274()) jj_scanpos = xsp;
+    if (jj_3R_275()) jj_scanpos = xsp;
     if (jj_scan_token(SEMI_T)) return true;
     return false;
   }
 
- inline bool jj_3R_658()
+ inline bool jj_3R_107()
  {
     if (jj_done) return true;
-    if (jj_3R_683()) return true;
+    if (jj_scan_token(PACKAGE_T)) return true;
+    if (jj_3R_69()) return true;
+    if (jj_scan_token(IS_T)) return true;
+    if (jj_scan_token(NEW_T)) return true;
+    if (jj_3R_59()) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_684()) jj_scanpos = xsp;
+    if (jj_3R_641()) jj_scanpos = xsp;
     return false;
   }
 
- inline bool jj_3R_107()
+ inline bool jj_3R_659()
  {
     if (jj_done) return true;
-    if (jj_scan_token(PACKAGE_T)) return true;
-    if (jj_3R_69()) return true;
-    if (jj_scan_token(IS_T)) return true;
-    if (jj_scan_token(NEW_T)) return true;
-    if (jj_3R_59()) return true;
+    if (jj_3R_684()) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_640()) jj_scanpos = xsp;
+    if (jj_3R_685()) jj_scanpos = xsp;
     return false;
   }
 
@@ -3475,10 +3483,10 @@ void parseInline();
     if (jj_scan_token(IS_T)) return true;
     if (jj_scan_token(NEW_T)) return true;
     if (jj_3R_59()) return true;
-    if (jj_3R_233()) return true;
+    if (jj_3R_234()) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_234()) jj_scanpos = xsp;
+    if (jj_3R_235()) jj_scanpos = xsp;
     if (jj_scan_token(SEMI_T)) return true;
     return false;
   }
@@ -3504,48 +3512,55 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_542()
+ inline bool jj_3R_543()
  {
     if (jj_done) return true;
     if (jj_scan_token(COMMA_T)) return true;
-    if (jj_3R_541()) return true;
+    if (jj_3R_542()) return true;
     return false;
   }
 
- inline bool jj_3R_682()
+ inline bool jj_3R_683()
  {
     if (jj_done) return true;
     if (jj_3R_69()) return true;
     return false;
   }
 
- inline bool jj_3R_253()
+ inline bool jj_3R_254()
  {
     if (jj_done) return true;
-    if (jj_3R_365()) return true;
+    if (jj_3R_366()) return true;
     return false;
   }
 
- inline bool jj_3R_692()
+ inline bool jj_3R_693()
  {
     if (jj_done) return true;
-    if (jj_3R_702()) return true;
+    if (jj_3R_703()) return true;
     if (jj_scan_token(SEMI_T)) return true;
     return false;
   }
 
- inline bool jj_3R_681()
+ inline bool jj_3R_682()
  {
     if (jj_done) return true;
     Token * xsp;
     while (true) {
       xsp = jj_scanpos;
-      if (jj_3R_692()) { jj_scanpos = xsp; break; }
+      if (jj_3R_693()) { jj_scanpos = xsp; break; }
     }
     return false;
   }
 
- inline bool jj_3R_605()
+ inline bool jj_3R_720()
+ {
+    if (jj_done) return true;
+    if (jj_3R_382()) return true;
+    return false;
+  }
+
+ inline bool jj_3R_606()
  {
     if (jj_done) return true;
     if (jj_scan_token(BOX_T)) return true;
@@ -3555,18 +3570,33 @@ void parseInline();
  inline bool jj_3R_719()
  {
     if (jj_done) return true;
-    if (jj_3R_381()) return true;
+    if (jj_3R_379()) return true;
     return false;
   }
 
  inline bool jj_3R_718()
  {
     if (jj_done) return true;
-    if (jj_3R_378()) return true;
+    if (jj_3R_347()) return true;
     return false;
   }
 
- inline bool jj_3R_348()
+ inline bool jj_3R_703()
+ {
+    if (jj_done) return true;
+    Token * xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_718()) {
+    jj_scanpos = xsp;
+    if (jj_3R_719()) {
+    jj_scanpos = xsp;
+    if (jj_3R_720()) return true;
+    }
+    }
+    return false;
+  }
+
+ inline bool jj_3R_349()
  {
     if (jj_done) return true;
     if (jj_scan_token(ENTITY_T)) return true;
@@ -3574,85 +3604,81 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_717()
+ inline bool jj_3R_681()
  {
     if (jj_done) return true;
-    if (jj_3R_346()) return true;
+    if (jj_3R_69()) return true;
     return false;
   }
 
- inline bool jj_3R_702()
+ inline bool jj_3R_253()
  {
     if (jj_done) return true;
-    Token * xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_717()) {
-    jj_scanpos = xsp;
-    if (jj_3R_718()) {
-    jj_scanpos = xsp;
-    if (jj_3R_719()) return true;
-    }
-    }
+    if (jj_3R_365()) return true;
     return false;
   }
 
- inline bool jj_3R_473()
+ inline bool jj_3R_474()
  {
     if (jj_done) return true;
-    if (jj_3R_541()) return true;
+    if (jj_3R_542()) return true;
     Token * xsp;
     while (true) {
       xsp = jj_scanpos;
-      if (jj_3R_542()) { jj_scanpos = xsp; break; }
+      if (jj_3R_543()) { jj_scanpos = xsp; break; }
     }
     return false;
   }
 
- inline bool jj_3R_680()
+ inline bool jj_3R_658()
  {
     if (jj_done) return true;
-    if (jj_3R_69()) return true;
+    if (jj_scan_token(PROTECTED_T)) return true;
+    if (jj_3R_682()) return true;
+    if (jj_scan_token(END_T)) return true;
+    if (jj_scan_token(PROTECTED_T)) return true;
+    Token * xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_683()) jj_scanpos = xsp;
     return false;
   }
 
- inline bool jj_3R_252()
+ inline bool jj_3R_692()
  {
     if (jj_done) return true;
-    if (jj_3R_364()) return true;
+    if (jj_3R_702()) return true;
     return false;
   }
 
- inline bool jj_3R_657()
+ inline bool jj_3R_542()
  {
     if (jj_done) return true;
-    if (jj_scan_token(PROTECTED_T)) return true;
-    if (jj_3R_681()) return true;
-    if (jj_scan_token(END_T)) return true;
-    if (jj_scan_token(PROTECTED_T)) return true;
+    if (jj_3R_540()) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_682()) jj_scanpos = xsp;
+    if (jj_3R_606()) jj_scanpos = xsp;
     return false;
   }
 
- inline bool jj_3R_541()
+ inline bool jj_3_105()
  {
     if (jj_done) return true;
-    if (jj_3R_539()) return true;
-    Token * xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_605()) jj_scanpos = xsp;
+    if (jj_3R_64()) return true;
     return false;
   }
 
- inline bool jj_3R_691()
+ inline bool jj_3R_680()
  {
     if (jj_done) return true;
-    if (jj_3R_701()) return true;
+    Token * xsp;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_692()) { jj_scanpos = xsp; break; }
+    }
     return false;
   }
 
- inline bool jj_3R_619()
+ inline bool jj_3R_620()
  {
     if (jj_done) return true;
     if (jj_scan_token(LPAREN_T)) return true;
@@ -3661,49 +3687,45 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3_104()
+ inline bool jj_3R_602()
  {
     if (jj_done) return true;
-    if (jj_3R_64()) return true;
+    if (jj_scan_token(FILE_T)) return true;
     return false;
   }
 
- inline bool jj_3R_679()
+ inline bool jj_3R_717()
  {
     if (jj_done) return true;
-    Token * xsp;
-    while (true) {
-      xsp = jj_scanpos;
-      if (jj_3R_691()) { jj_scanpos = xsp; break; }
-    }
+    if (jj_3R_383()) return true;
     return false;
   }
 
  inline bool jj_3R_601()
  {
     if (jj_done) return true;
-    if (jj_scan_token(FILE_T)) return true;
+    if (jj_scan_token(GROUP_T)) return true;
     return false;
   }
 
  inline bool jj_3R_600()
  {
     if (jj_done) return true;
-    if (jj_scan_token(GROUP_T)) return true;
+    if (jj_scan_token(UNITS_T)) return true;
     return false;
   }
 
  inline bool jj_3R_599()
  {
     if (jj_done) return true;
-    if (jj_scan_token(UNITS_T)) return true;
+    if (jj_scan_token(LITERAL_T)) return true;
     return false;
   }
 
- inline bool jj_3R_598()
+ inline bool jj_3_106()
  {
     if (jj_done) return true;
-    if (jj_scan_token(LITERAL_T)) return true;
+    if (jj_3R_65()) return true;
     return false;
   }
 
@@ -3714,181 +3736,217 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_597()
+ inline bool jj_3R_598()
  {
     if (jj_done) return true;
     if (jj_scan_token(LABEL_T)) return true;
     return false;
   }
 
- inline bool jj_3R_596()
+ inline bool jj_3R_715()
+ {
+    if (jj_done) return true;
+    if (jj_3R_379()) return true;
+    return false;
+  }
+
+ inline bool jj_3R_597()
  {
     if (jj_done) return true;
     if (jj_scan_token(COMPONENT_T)) return true;
     return false;
   }
 
- inline bool jj_3R_595()
+ inline bool jj_3R_596()
  {
     if (jj_done) return true;
     if (jj_scan_token(VARIABLE_T)) return true;
     return false;
   }
 
- inline bool jj_3_105()
+ inline bool jj_3R_714()
  {
     if (jj_done) return true;
-    if (jj_3R_65()) return true;
+    if (jj_3R_64()) return true;
     return false;
   }
 
- inline bool jj_3R_715()
+ inline bool jj_3R_595()
  {
     if (jj_done) return true;
-    if (jj_3R_381()) return true;
+    if (jj_scan_token(SIGNAL_T)) return true;
     return false;
   }
 
  inline bool jj_3R_594()
  {
     if (jj_done) return true;
-    if (jj_scan_token(SIGNAL_T)) return true;
+    if (jj_scan_token(CONSTANT_T)) return true;
     return false;
   }
 
- inline bool jj_3R_714()
+ inline bool jj_3R_713()
  {
     if (jj_done) return true;
-    if (jj_3R_378()) return true;
+    if (jj_3R_377()) return true;
     return false;
   }
 
  inline bool jj_3R_593()
  {
     if (jj_done) return true;
-    if (jj_scan_token(CONSTANT_T)) return true;
+    if (jj_scan_token(SUBTYPE_T)) return true;
     return false;
   }
 
- inline bool jj_3R_592()
+ inline bool jj_3R_712()
  {
     if (jj_done) return true;
-    if (jj_scan_token(SUBTYPE_T)) return true;
+    if (jj_3R_376()) return true;
     return false;
   }
 
- inline bool jj_3R_713()
+ inline bool jj_3R_592()
  {
     if (jj_done) return true;
-    if (jj_3R_64()) return true;
+    if (jj_scan_token(TYPE_T)) return true;
     return false;
   }
 
- inline bool jj_3R_591()
+ inline bool jj_3R_711()
  {
     if (jj_done) return true;
-    if (jj_scan_token(TYPE_T)) return true;
+    if (jj_3R_375()) return true;
     return false;
   }
 
- inline bool jj_3R_590()
+ inline bool jj_3R_591()
  {
     if (jj_done) return true;
     if (jj_scan_token(PACKAGE_T)) return true;
     return false;
   }
 
- inline bool jj_3R_712()
+ inline bool jj_3R_710()
  {
     if (jj_done) return true;
-    if (jj_3R_376()) return true;
+    if (jj_3R_373()) return true;
     return false;
   }
 
- inline bool jj_3R_589()
+ inline bool jj_3R_590()
  {
     if (jj_done) return true;
     if (jj_scan_token(FUNCTION_T)) return true;
     return false;
   }
 
- inline bool jj_3R_711()
+ inline bool jj_3R_709()
  {
     if (jj_done) return true;
-    if (jj_3R_375()) return true;
+    if (jj_3R_372()) return true;
     return false;
   }
 
- inline bool jj_3R_588()
+ inline bool jj_3R_589()
  {
     if (jj_done) return true;
     if (jj_scan_token(PROCEDURE_T)) return true;
     return false;
   }
 
- inline bool jj_3R_710()
+ inline bool jj_3R_708()
  {
     if (jj_done) return true;
-    if (jj_3R_374()) return true;
+    if (jj_3R_371()) return true;
     return false;
   }
 
- inline bool jj_3R_587()
+ inline bool jj_3R_588()
  {
     if (jj_done) return true;
     if (jj_scan_token(CONFIGURATION_T)) return true;
     return false;
   }
 
- inline bool jj_3R_709()
+ inline bool jj_3R_707()
  {
     if (jj_done) return true;
-    if (jj_3R_372()) return true;
+    if (jj_3R_525()) return true;
     return false;
   }
 
- inline bool jj_3R_586()
+ inline bool jj_3R_587()
  {
     if (jj_done) return true;
     if (jj_scan_token(ARCHITECTURE_T)) return true;
     return false;
   }
 
- inline bool jj_3R_708()
- {
-    if (jj_done) return true;
-    if (jj_3R_371()) return true;
-    return false;
-  }
-
- inline bool jj_3R_707()
+ inline bool jj_3R_706()
  {
     if (jj_done) return true;
-    if (jj_3R_370()) return true;
+    if (jj_3R_92()) return true;
     return false;
   }
 
- inline bool jj_3R_706()
+ inline bool jj_3R_702()
  {
     if (jj_done) return true;
-    if (jj_3R_524()) return true;
+    Token * xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_706()) {
+    jj_scanpos = xsp;
+    if (jj_3R_707()) {
+    jj_scanpos = xsp;
+    if (jj_3R_708()) {
+    jj_scanpos = xsp;
+    if (jj_3R_709()) {
+    jj_scanpos = xsp;
+    if (jj_3R_710()) {
+    jj_scanpos = xsp;
+    if (jj_3R_711()) {
+    jj_scanpos = xsp;
+    if (jj_3R_712()) {
+    jj_scanpos = xsp;
+    if (jj_3R_713()) {
+    jj_scanpos = xsp;
+    if (jj_3R_714()) {
+    jj_scanpos = xsp;
+    if (jj_3R_715()) {
+    jj_scanpos = xsp;
+    if (jj_3R_716()) {
+    jj_scanpos = xsp;
+    if (jj_3_106()) {
+    jj_scanpos = xsp;
+    if (jj_3R_717()) return true;
+    }
+    }
+    }
+    }
+    }
+    }
+    }
+    }
+    }
+    }
+    }
+    }
     return false;
   }
 
- inline bool jj_3R_585()
+ inline bool jj_3R_586()
  {
     if (jj_done) return true;
     if (jj_scan_token(ENTITY_T)) return true;
     return false;
   }
 
- inline bool jj_3R_539()
+ inline bool jj_3R_540()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_585()) {
-    jj_scanpos = xsp;
     if (jj_3R_586()) {
     jj_scanpos = xsp;
     if (jj_3R_587()) {
@@ -3919,7 +3977,9 @@ void parseInline();
     jj_scanpos = xsp;
     if (jj_3R_600()) {
     jj_scanpos = xsp;
-    if (jj_3R_601()) return true;
+    if (jj_3R_601()) {
+    jj_scanpos = xsp;
+    if (jj_3R_602()) return true;
     }
     }
     }
@@ -3939,134 +3999,82 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_705()
- {
-    if (jj_done) return true;
-    if (jj_3R_92()) return true;
-    return false;
-  }
-
- inline bool jj_3R_701()
+ inline bool jj_3R_252()
  {
     if (jj_done) return true;
-    Token * xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_705()) {
-    jj_scanpos = xsp;
-    if (jj_3R_706()) {
-    jj_scanpos = xsp;
-    if (jj_3R_707()) {
-    jj_scanpos = xsp;
-    if (jj_3R_708()) {
-    jj_scanpos = xsp;
-    if (jj_3R_709()) {
-    jj_scanpos = xsp;
-    if (jj_3R_710()) {
-    jj_scanpos = xsp;
-    if (jj_3R_711()) {
-    jj_scanpos = xsp;
-    if (jj_3R_712()) {
-    jj_scanpos = xsp;
-    if (jj_3R_713()) {
-    jj_scanpos = xsp;
-    if (jj_3R_714()) {
-    jj_scanpos = xsp;
-    if (jj_3R_715()) {
-    jj_scanpos = xsp;
-    if (jj_3_105()) {
-    jj_scanpos = xsp;
-    if (jj_3R_716()) return true;
-    }
-    }
-    }
-    }
-    }
-    }
-    }
-    }
-    }
-    }
-    }
-    }
+    if (jj_3R_364()) return true;
     return false;
   }
 
- inline bool jj_3R_563()
+ inline bool jj_3R_564()
  {
     if (jj_done) return true;
     if (jj_scan_token(OPEN_T)) return true;
     return false;
   }
 
- inline bool jj_3R_251()
+ inline bool jj_3R_563()
  {
     if (jj_done) return true;
-    if (jj_3R_363()) return true;
+    if (jj_scan_token(CONFIGURATION_T)) return true;
+    if (jj_3R_59()) return true;
     return false;
   }
 
  inline bool jj_3R_562()
  {
     if (jj_done) return true;
-    if (jj_scan_token(CONFIGURATION_T)) return true;
+    if (jj_scan_token(ENTITY_T)) return true;
     if (jj_3R_59()) return true;
+    Token * xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_620()) jj_scanpos = xsp;
     return false;
   }
 
- inline bool jj_3R_561()
+ inline bool jj_3R_528()
  {
     if (jj_done) return true;
-    if (jj_scan_token(ENTITY_T)) return true;
-    if (jj_3R_59()) return true;
-    Token * xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_619()) jj_scanpos = xsp;
+    if (jj_scan_token(AFTER_T)) return true;
+    if (jj_3R_58()) return true;
     return false;
   }
 
- inline bool jj_3R_505()
+ inline bool jj_3R_506()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_561()) {
-    jj_scanpos = xsp;
     if (jj_3R_562()) {
     jj_scanpos = xsp;
-    if (jj_3R_563()) return true;
+    if (jj_3R_563()) {
+    jj_scanpos = xsp;
+    if (jj_3R_564()) return true;
     }
     }
     return false;
   }
 
- inline bool jj_3R_527()
- {
-    if (jj_done) return true;
-    if (jj_scan_token(AFTER_T)) return true;
-    if (jj_3R_58()) return true;
-    return false;
-  }
-
  inline bool jj_3R_137()
  {
     if (jj_done) return true;
     if (jj_scan_token(PROTECTED_T)) return true;
     if (jj_scan_token(BODY_T)) return true;
-    if (jj_3R_679()) return true;
+    if (jj_3R_680()) return true;
     if (jj_scan_token(END_T)) return true;
     if (jj_scan_token(PROTECTED_T)) return true;
     if (jj_scan_token(BODY_T)) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_680()) jj_scanpos = xsp;
+    if (jj_3R_681()) jj_scanpos = xsp;
     return false;
   }
 
- inline bool jj_3R_495()
+ inline bool jj_3R_496()
  {
     if (jj_done) return true;
     if (jj_scan_token(COMMA_T)) return true;
-    if (jj_3R_444()) return true;
+    if (jj_3R_445()) return true;
     return false;
   }
 
@@ -4078,7 +4086,7 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_704()
+ inline bool jj_3R_705()
  {
     if (jj_done) return true;
     if (jj_3R_196()) return true;
@@ -4095,24 +4103,24 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3_29()
+ inline bool jj_3R_445()
  {
     if (jj_done) return true;
-    if (jj_3R_83()) return true;
+    if (jj_3R_58()) return true;
+    Token * xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_528()) jj_scanpos = xsp;
     return false;
   }
 
- inline bool jj_3R_444()
+ inline bool jj_3_29()
  {
     if (jj_done) return true;
-    if (jj_3R_58()) return true;
-    Token * xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_527()) jj_scanpos = xsp;
+    if (jj_3R_83()) return true;
     return false;
   }
 
- inline bool jj_3R_358()
+ inline bool jj_3R_359()
  {
     if (jj_done) return true;
     if (jj_3R_85()) return true;
@@ -4120,87 +4128,87 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_235()
+ inline bool jj_3R_236()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_358()) jj_scanpos = xsp;
+    if (jj_3R_359()) jj_scanpos = xsp;
     if (jj_3R_58()) return true;
     return false;
   }
 
- inline bool jj_3R_160()
- {
-    if (jj_done) return true;
-    if (jj_3R_84()) return true;
-    return false;
-  }
-
- inline bool jj_3R_406()
+ inline bool jj_3R_407()
  {
     if (jj_done) return true;
     if (jj_scan_token(UNAFFECTED_T)) return true;
     return false;
   }
 
- inline bool jj_3R_159()
+ inline bool jj_3R_160()
  {
     if (jj_done) return true;
-    if (jj_3R_83()) return true;
+    if (jj_3R_84()) return true;
     return false;
   }
 
- inline bool jj_3R_67()
+ inline bool jj_3R_318()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_159()) {
+    if (jj_3R_406()) {
     jj_scanpos = xsp;
-    if (jj_3R_160()) return true;
+    if (jj_3R_407()) return true;
     }
     return false;
   }
 
- inline bool jj_3R_317()
+ inline bool jj_3R_406()
  {
     if (jj_done) return true;
+    if (jj_3R_445()) return true;
     Token * xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_405()) {
-    jj_scanpos = xsp;
-    if (jj_3R_406()) return true;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_496()) { jj_scanpos = xsp; break; }
     }
     return false;
   }
 
- inline bool jj_3R_405()
+ inline bool jj_3R_159()
+ {
+    if (jj_done) return true;
+    if (jj_3R_83()) return true;
+    return false;
+  }
+
+ inline bool jj_3R_67()
  {
     if (jj_done) return true;
-    if (jj_3R_444()) return true;
     Token * xsp;
-    while (true) {
-      xsp = jj_scanpos;
-      if (jj_3R_495()) { jj_scanpos = xsp; break; }
+    xsp = jj_scanpos;
+    if (jj_3R_159()) {
+    jj_scanpos = xsp;
+    if (jj_3R_160()) return true;
     }
     return false;
   }
 
- inline bool jj_3R_470()
+ inline bool jj_3R_251()
  {
     if (jj_done) return true;
-    if (jj_3R_540()) return true;
+    if (jj_3R_69()) return true;
     if (jj_scan_token(COLON_T)) return true;
-    if (jj_3R_59()) return true;
     return false;
   }
 
- inline bool jj_3R_250()
+ inline bool jj_3R_471()
  {
     if (jj_done) return true;
-    if (jj_3R_69()) return true;
+    if (jj_3R_541()) return true;
     if (jj_scan_token(COLON_T)) return true;
+    if (jj_3R_59()) return true;
     return false;
   }
 
@@ -4209,30 +4217,30 @@ void parseInline();
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_250()) jj_scanpos = xsp;
-    if (jj_scan_token(WAIT_T)) return true;
-    xsp = jj_scanpos;
     if (jj_3R_251()) jj_scanpos = xsp;
+    if (jj_scan_token(WAIT_T)) return true;
     xsp = jj_scanpos;
     if (jj_3R_252()) jj_scanpos = xsp;
     xsp = jj_scanpos;
     if (jj_3R_253()) jj_scanpos = xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_254()) jj_scanpos = xsp;
     if (jj_scan_token(SEMI_T)) return true;
     return false;
   }
 
- inline bool jj_3R_380()
+ inline bool jj_3R_381()
  {
     if (jj_done) return true;
     if (jj_scan_token(DISCONNECT_T)) return true;
-    if (jj_3R_470()) return true;
+    if (jj_3R_471()) return true;
     if (jj_scan_token(AFTER_T)) return true;
     if (jj_3R_58()) return true;
     if (jj_scan_token(SEMI_T)) return true;
     return false;
   }
 
- inline bool jj_3R_458()
+ inline bool jj_3R_459()
  {
     if (jj_done) return true;
     if (jj_scan_token(VARASSIGN_T)) return true;
@@ -4240,7 +4248,7 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_238()
+ inline bool jj_3R_239()
  {
     if (jj_done) return true;
     if (jj_scan_token(DOWNTO_T)) return true;
@@ -4252,55 +4260,55 @@ void parseInline();
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_237()) {
+    if (jj_3R_238()) {
     jj_scanpos = xsp;
-    if (jj_3R_238()) return true;
+    if (jj_3R_239()) return true;
     }
     return false;
   }
 
- inline bool jj_3R_237()
+ inline bool jj_3R_238()
  {
     if (jj_done) return true;
     if (jj_scan_token(TO_T)) return true;
     return false;
   }
 
- inline bool jj_3R_568()
+ inline bool jj_3R_155()
  {
     if (jj_done) return true;
-    if (jj_3R_309()) return true;
+    if (jj_scan_token(COMMA_T)) return true;
+    if (jj_3R_154()) return true;
     return false;
   }
 
- inline bool jj_3R_155()
+ inline bool jj_3R_569()
  {
     if (jj_done) return true;
-    if (jj_scan_token(COMMA_T)) return true;
-    if (jj_3R_154()) return true;
+    if (jj_3R_310()) return true;
     return false;
   }
 
- inline bool jj_3R_567()
+ inline bool jj_3R_568()
  {
     if (jj_done) return true;
     if (jj_3R_69()) return true;
     return false;
   }
 
- inline bool jj_3R_520()
+ inline bool jj_3R_521()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_567()) {
+    if (jj_3R_568()) {
     jj_scanpos = xsp;
-    if (jj_3R_568()) return true;
+    if (jj_3R_569()) return true;
     }
     return false;
   }
 
- inline bool jj_3R_461()
+ inline bool jj_3R_462()
  {
     if (jj_done) return true;
     if (jj_scan_token(VARASSIGN_T)) return true;
@@ -4308,25 +4316,7 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_558()
- {
-    if (jj_done) return true;
-    if (jj_scan_token(REJECT_T)) return true;
-    if (jj_3R_58()) return true;
-    return false;
-  }
-
- inline bool jj_3R_494()
- {
-    if (jj_done) return true;
-    Token * xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_558()) jj_scanpos = xsp;
-    if (jj_scan_token(INERTIAL_T)) return true;
-    return false;
-  }
-
- inline bool jj_3R_374()
+ inline bool jj_3R_375()
  {
     if (jj_done) return true;
     Token * xsp;
@@ -4337,53 +4327,64 @@ void parseInline();
     if (jj_scan_token(COLON_T)) return true;
     if (jj_3R_84()) return true;
     xsp = jj_scanpos;
-    if (jj_3R_461()) jj_scanpos = xsp;
+    if (jj_3R_462()) jj_scanpos = xsp;
     if (jj_scan_token(SEMI_T)) return true;
     return false;
   }
 
- inline bool jj_3R_472()
+ inline bool jj_3R_559()
+ {
+    if (jj_done) return true;
+    if (jj_scan_token(REJECT_T)) return true;
+    if (jj_3R_58()) return true;
+    return false;
+  }
+
+ inline bool jj_3R_473()
  {
     if (jj_done) return true;
     if (jj_scan_token(COMMA_T)) return true;
-    if (jj_3R_471()) return true;
+    if (jj_3R_472()) return true;
     return false;
   }
 
- inline bool jj_3R_404()
+ inline bool jj_3R_495()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_493()) {
-    jj_scanpos = xsp;
-    if (jj_3R_494()) return true;
-    }
+    if (jj_3R_559()) jj_scanpos = xsp;
+    if (jj_scan_token(INERTIAL_T)) return true;
     return false;
   }
 
- inline bool jj_3R_493()
+ inline bool jj_3R_440()
  {
     if (jj_done) return true;
-    if (jj_scan_token(TRANSPORT_T)) return true;
+    if (jj_3R_527()) return true;
     return false;
   }
 
- inline bool jj_3R_439()
+ inline bool jj_3R_405()
  {
     if (jj_done) return true;
-    if (jj_3R_526()) return true;
+    Token * xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_494()) {
+    jj_scanpos = xsp;
+    if (jj_3R_495()) return true;
+    }
     return false;
   }
 
- inline bool jj_3_28()
+ inline bool jj_3R_494()
  {
     if (jj_done) return true;
-    if (jj_3R_82()) return true;
+    if (jj_scan_token(TRANSPORT_T)) return true;
     return false;
   }
 
- inline bool jj_3_103()
+ inline bool jj_3_104()
  {
     if (jj_done) return true;
     if (jj_3R_69()) return true;
@@ -4391,24 +4392,24 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_361()
+ inline bool jj_3R_362()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_438()) {
+    if (jj_3R_439()) {
     jj_scanpos = xsp;
-    if (jj_3R_439()) return true;
+    if (jj_3R_440()) return true;
     }
     return false;
   }
 
- inline bool jj_3R_438()
+ inline bool jj_3R_439()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3_103()) jj_scanpos = xsp;
+    if (jj_3_104()) jj_scanpos = xsp;
     if (jj_3R_114()) return true;
     if (jj_scan_token(VARASSIGN_T)) return true;
     if (jj_3R_58()) return true;
@@ -4416,6 +4417,13 @@ void parseInline();
     return false;
   }
 
+ inline bool jj_3_28()
+ {
+    if (jj_done) return true;
+    if (jj_3R_82()) return true;
+    return false;
+  }
+
  inline bool jj_3_27()
  {
     if (jj_done) return true;
@@ -4423,7 +4431,7 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_276()
+ inline bool jj_3R_277()
  {
     if (jj_done) return true;
     if (jj_3R_82()) return true;
@@ -4435,44 +4443,34 @@ void parseInline();
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_275()) {
+    if (jj_3R_276()) {
     jj_scanpos = xsp;
-    if (jj_3R_276()) return true;
+    if (jj_3R_277()) return true;
     }
     return false;
   }
 
- inline bool jj_3R_275()
+ inline bool jj_3R_276()
  {
     if (jj_done) return true;
     if (jj_3R_81()) return true;
     return false;
   }
 
- inline bool jj_3R_381()
+ inline bool jj_3R_382()
  {
     if (jj_done) return true;
     if (jj_scan_token(USE_T)) return true;
-    if (jj_3R_471()) return true;
+    if (jj_3R_472()) return true;
     Token * xsp;
     while (true) {
       xsp = jj_scanpos;
-      if (jj_3R_472()) { jj_scanpos = xsp; break; }
+      if (jj_3R_473()) { jj_scanpos = xsp; break; }
     }
     if (jj_scan_token(SEMI_T)) return true;
     return false;
   }
 
- inline bool jj_3R_703()
- {
-    if (jj_done) return true;
-    if (jj_scan_token(ARRAY_T)) return true;
-    if (jj_3R_82()) return true;
-    if (jj_scan_token(OF_T)) return true;
-    if (jj_3R_84()) return true;
-    return false;
-  }
-
  inline bool jj_3R_62()
  {
     if (jj_done) return true;
@@ -4490,6 +4488,16 @@ void parseInline();
     return false;
   }
 
+ inline bool jj_3R_704()
+ {
+    if (jj_done) return true;
+    if (jj_scan_token(ARRAY_T)) return true;
+    if (jj_3R_82()) return true;
+    if (jj_scan_token(OF_T)) return true;
+    if (jj_3R_84()) return true;
+    return false;
+  }
+
  inline bool jj_3R_157()
  {
     if (jj_done) return true;
@@ -4497,6 +4505,20 @@ void parseInline();
     return false;
   }
 
+ inline bool jj_3R_637()
+ {
+    if (jj_done) return true;
+    if (jj_3R_658()) return true;
+    return false;
+  }
+
+ inline bool jj_3_103()
+ {
+    if (jj_done) return true;
+    if (jj_3R_137()) return true;
+    return false;
+  }
+
  inline bool jj_3R_636()
  {
     if (jj_done) return true;
@@ -4504,7 +4526,7 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_372()
+ inline bool jj_3R_373()
  {
     if (jj_done) return true;
     if (jj_scan_token(CONSTANT_T)) return true;
@@ -4513,18 +4535,11 @@ void parseInline();
     if (jj_3R_84()) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_458()) jj_scanpos = xsp;
+    if (jj_3R_459()) jj_scanpos = xsp;
     if (jj_scan_token(SEMI_T)) return true;
     return false;
   }
 
- inline bool jj_3_102()
- {
-    if (jj_done) return true;
-    if (jj_3R_137()) return true;
-    return false;
-  }
-
  inline bool jj_3R_635()
  {
     if (jj_done) return true;
@@ -4546,36 +4561,22 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3_26()
- {
-    if (jj_done) return true;
-    if (jj_3R_80()) return true;
-    return false;
-  }
-
- inline bool jj_3R_632()
- {
-    if (jj_done) return true;
-    if (jj_3R_653()) return true;
-    return false;
-  }
-
- inline bool jj_3R_576()
+ inline bool jj_3R_577()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_632()) {
-    jj_scanpos = xsp;
     if (jj_3R_633()) {
     jj_scanpos = xsp;
     if (jj_3R_634()) {
     jj_scanpos = xsp;
     if (jj_3R_635()) {
     jj_scanpos = xsp;
-    if (jj_3_102()) {
+    if (jj_3R_636()) {
+    jj_scanpos = xsp;
+    if (jj_3_103()) {
     jj_scanpos = xsp;
-    if (jj_3R_636()) return true;
+    if (jj_3R_637()) return true;
     }
     }
     }
@@ -4584,71 +4585,78 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_379()
+ inline bool jj_3_26()
+ {
+    if (jj_done) return true;
+    if (jj_3R_80()) return true;
+    return false;
+  }
+
+ inline bool jj_3R_380()
  {
     if (jj_done) return true;
     if (jj_scan_token(FOR_T)) return true;
     if (jj_3R_177()) return true;
-    if (jj_3R_331()) return true;
+    if (jj_3R_332()) return true;
     if (jj_scan_token(SEMI_T)) return true;
     return false;
   }
 
- inline bool jj_3R_566()
+ inline bool jj_3_99()
  {
     if (jj_done) return true;
-    if (jj_3R_332()) return true;
+    if (jj_3R_133()) return true;
     return false;
   }
 
- inline bool jj_3_98()
+ inline bool jj_3R_458()
  {
     if (jj_done) return true;
-    if (jj_3R_133()) return true;
+    if (jj_3R_532()) return true;
     return false;
   }
 
- inline bool jj_3R_457()
+ inline bool jj_3R_567()
  {
     if (jj_done) return true;
-    if (jj_3R_531()) return true;
+    if (jj_3R_333()) return true;
     return false;
   }
 
- inline bool jj_3R_565()
+ inline bool jj_3_102()
  {
     if (jj_done) return true;
-    if (jj_3R_80()) return true;
+    if (jj_3R_136()) return true;
     return false;
   }
 
- inline bool jj_3R_507()
+ inline bool jj_3R_371()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_565()) {
+    if (jj_3_102()) {
     jj_scanpos = xsp;
-    if (jj_3R_566()) return true;
+    if (jj_3R_458()) return true;
     }
     return false;
   }
 
- inline bool jj_3_101()
+ inline bool jj_3R_566()
  {
     if (jj_done) return true;
-    if (jj_3R_136()) return true;
+    if (jj_3R_80()) return true;
     return false;
   }
 
- inline bool jj_3R_370()
+ inline bool jj_3R_508()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3_101()) {
+    if (jj_3R_566()) {
     jj_scanpos = xsp;
-    if (jj_3R_457()) return true;
+    if (jj_3R_567()) return true;
     }
     return false;
   }
@@ -4663,7 +4671,7 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3_100()
+ inline bool jj_3_101()
  {
     if (jj_done) return true;
     if (jj_3R_134()) return true;
@@ -4678,7 +4686,7 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_365()
+ inline bool jj_3R_366()
  {
     if (jj_done) return true;
     if (jj_scan_token(FOR_T)) return true;
@@ -4693,12 +4701,12 @@ void parseInline();
     Token * xsp;
     while (true) {
       xsp = jj_scanpos;
-      if (jj_3_100()) { jj_scanpos = xsp; break; }
+      if (jj_3_101()) { jj_scanpos = xsp; break; }
     }
     return false;
   }
 
- inline bool jj_3R_246()
+ inline bool jj_3R_247()
  {
     if (jj_done) return true;
     if (jj_3R_108()) return true;
@@ -4710,81 +4718,73 @@ void parseInline();
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_245()) {
+    if (jj_3R_246()) {
     jj_scanpos = xsp;
-    if (jj_3R_246()) return true;
+    if (jj_3R_247()) return true;
     }
     return false;
   }
 
- inline bool jj_3_99()
+ inline bool jj_3_100()
  {
     if (jj_done) return true;
     if (jj_3R_59()) return true;
     return false;
   }
 
- inline bool jj_3R_245()
+ inline bool jj_3R_246()
  {
     if (jj_done) return true;
     if (jj_3R_59()) return true;
     return false;
   }
 
- inline bool jj_3_25()
- {
-    if (jj_done) return true;
-    if (jj_scan_token(WHEN_T)) return true;
-    if (jj_3R_79()) return true;
-    if (jj_scan_token(ELSE_T)) return true;
-    return false;
-  }
-
- inline bool jj_3R_349()
+ inline bool jj_3_98()
  {
     if (jj_done) return true;
-    if (jj_scan_token(CONFIGURATION_T)) return true;
-    if (jj_3R_69()) return true;
+    if (jj_3R_59()) return true;
     return false;
   }
 
- inline bool jj_3_97()
+ inline bool jj_3R_218()
  {
     if (jj_done) return true;
-    if (jj_3R_59()) return true;
+    if (jj_scan_token(ALL_T)) return true;
     return false;
   }
 
- inline bool jj_3R_217()
+ inline bool jj_3_25()
  {
     if (jj_done) return true;
-    if (jj_scan_token(ALL_T)) return true;
+    if (jj_scan_token(WHEN_T)) return true;
+    if (jj_3R_79()) return true;
+    if (jj_scan_token(ELSE_T)) return true;
     return false;
   }
 
- inline bool jj_3R_216()
+ inline bool jj_3R_350()
  {
     if (jj_done) return true;
-    if (jj_3R_309()) return true;
+    if (jj_scan_token(CONFIGURATION_T)) return true;
+    if (jj_3R_69()) return true;
     return false;
   }
 
- inline bool jj_3R_215()
+ inline bool jj_3R_217()
  {
     if (jj_done) return true;
-    if (jj_3R_351()) return true;
+    if (jj_3R_310()) return true;
     return false;
   }
 
- inline bool jj_3R_319()
+ inline bool jj_3R_216()
  {
     if (jj_done) return true;
-    if (jj_scan_token(WHEN_T)) return true;
-    if (jj_3R_79()) return true;
+    if (jj_3R_352()) return true;
     return false;
   }
 
- inline bool jj_3R_214()
+ inline bool jj_3R_215()
  {
     if (jj_done) return true;
     if (jj_3R_59()) return true;
@@ -4796,26 +4796,24 @@ void parseInline();
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_214()) {
-    jj_scanpos = xsp;
     if (jj_3R_215()) {
     jj_scanpos = xsp;
     if (jj_3R_216()) {
     jj_scanpos = xsp;
-    if (jj_3R_217()) return true;
+    if (jj_3R_217()) {
+    jj_scanpos = xsp;
+    if (jj_3R_218()) return true;
     }
     }
     }
     return false;
   }
 
- inline bool jj_3R_318()
+ inline bool jj_3R_320()
  {
     if (jj_done) return true;
     if (jj_scan_token(WHEN_T)) return true;
     if (jj_3R_79()) return true;
-    if (jj_scan_token(ELSE_T)) return true;
-    if (jj_3R_317()) return true;
     return false;
   }
 
@@ -4826,6 +4824,16 @@ void parseInline();
     return false;
   }
 
+ inline bool jj_3R_319()
+ {
+    if (jj_done) return true;
+    if (jj_scan_token(WHEN_T)) return true;
+    if (jj_3R_79()) return true;
+    if (jj_scan_token(ELSE_T)) return true;
+    if (jj_3R_318()) return true;
+    return false;
+  }
+
  inline bool jj_3R_84()
  {
     if (jj_done) return true;
@@ -4841,14 +4849,14 @@ void parseInline();
  inline bool jj_3R_167()
  {
     if (jj_done) return true;
-    if (jj_3R_317()) return true;
+    if (jj_3R_318()) return true;
     Token * xsp;
     while (true) {
       xsp = jj_scanpos;
-      if (jj_3R_318()) { jj_scanpos = xsp; break; }
+      if (jj_3R_319()) { jj_scanpos = xsp; break; }
     }
     xsp = jj_scanpos;
-    if (jj_3R_319()) jj_scanpos = xsp;
+    if (jj_3R_320()) jj_scanpos = xsp;
     return false;
   }
 
@@ -4863,7 +4871,7 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_371()
+ inline bool jj_3R_372()
  {
     if (jj_done) return true;
     if (jj_scan_token(SUBTYPE_T)) return true;
@@ -4874,25 +4882,25 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_630()
+ inline bool jj_3R_631()
  {
     if (jj_done) return true;
     if (jj_3R_112()) return true;
     return false;
   }
 
- inline bool jj_3R_571()
+ inline bool jj_3R_572()
  {
     if (jj_done) return true;
     Token * xsp;
     while (true) {
       xsp = jj_scanpos;
-      if (jj_3R_630()) { jj_scanpos = xsp; break; }
+      if (jj_3R_631()) { jj_scanpos = xsp; break; }
     }
     return false;
   }
 
- inline bool jj_3R_364()
+ inline bool jj_3R_365()
  {
     if (jj_done) return true;
     if (jj_scan_token(UNTIL_T)) return true;
@@ -4907,35 +4915,42 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_523()
+ inline bool jj_3R_524()
  {
     if (jj_done) return true;
     if (jj_scan_token(LPAREN_T)) return true;
-    if (jj_3R_569()) return true;
+    if (jj_3R_570()) return true;
     if (jj_scan_token(RPAREN_T)) return true;
     return false;
   }
 
- inline bool jj_3_24()
+ inline bool jj_3R_522()
  {
     if (jj_done) return true;
-    if (jj_3R_78()) return true;
+    if (jj_scan_token(LPAREN_T)) return true;
+    if (jj_3R_313()) return true;
+    if (jj_scan_token(RPAREN_T)) return true;
     return false;
   }
 
- inline bool jj_3R_521()
+ inline bool jj_3_97()
  {
     if (jj_done) return true;
-    if (jj_scan_token(LPAREN_T)) return true;
-    if (jj_3R_312()) return true;
-    if (jj_scan_token(RPAREN_T)) return true;
+    if (jj_3R_132()) return true;
+    return false;
+  }
+
+ inline bool jj_3_24()
+ {
+    if (jj_done) return true;
+    if (jj_3R_78()) return true;
     return false;
   }
 
  inline bool jj_3_96()
  {
     if (jj_done) return true;
-    if (jj_3R_132()) return true;
+    if (jj_3R_131()) return true;
     return false;
   }
 
@@ -4946,10 +4961,15 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3_95()
+ inline bool jj_3R_523()
  {
     if (jj_done) return true;
-    if (jj_3R_131()) return true;
+    Token * xsp;
+    xsp = jj_scanpos;
+    if (jj_scan_token(84)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(52)) return true;
+    }
     return false;
   }
 
@@ -4968,15 +4988,18 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_522()
+ inline bool jj_3R_433()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_scan_token(84)) {
-    jj_scanpos = xsp;
-    if (jj_scan_token(52)) return true;
-    }
+    if (jj_3R_523()) jj_scanpos = xsp;
+    if (jj_scan_token(FUNCTION_T)) return true;
+    if (jj_3R_521()) return true;
+    xsp = jj_scanpos;
+    if (jj_3R_524()) jj_scanpos = xsp;
+    if (jj_scan_token(RETURN_T)) return true;
+    if (jj_3R_157()) return true;
     return false;
   }
 
@@ -4992,29 +5015,14 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_503()
+ inline bool jj_3R_504()
  {
     if (jj_done) return true;
     if (jj_3R_78()) return true;
     return false;
   }
 
- inline bool jj_3R_432()
- {
-    if (jj_done) return true;
-    Token * xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_522()) jj_scanpos = xsp;
-    if (jj_scan_token(FUNCTION_T)) return true;
-    if (jj_3R_520()) return true;
-    xsp = jj_scanpos;
-    if (jj_3R_523()) jj_scanpos = xsp;
-    if (jj_scan_token(RETURN_T)) return true;
-    if (jj_3R_157()) return true;
-    return false;
-  }
-
- inline bool jj_3R_502()
+ inline bool jj_3R_503()
  {
     if (jj_done) return true;
     if (jj_3R_77()) return true;
@@ -5036,7 +5044,7 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_501()
+ inline bool jj_3R_502()
  {
     if (jj_done) return true;
     if (jj_3R_76()) return true;
@@ -5063,7 +5071,7 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_500()
+ inline bool jj_3R_501()
  {
     if (jj_done) return true;
     if (jj_3R_87()) return true;
@@ -5080,62 +5088,72 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_499()
- {
-    if (jj_done) return true;
-    if (jj_3R_560()) return true;
-    return false;
-  }
-
- inline bool jj_3R_498()
+ inline bool jj_3R_500()
  {
     if (jj_done) return true;
-    if (jj_3R_74()) return true;
+    if (jj_3R_561()) return true;
     return false;
   }
 
- inline bool jj_3R_346()
+ inline bool jj_3R_347()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_431()) {
+    if (jj_3R_432()) {
     jj_scanpos = xsp;
-    if (jj_3R_432()) return true;
+    if (jj_3R_433()) return true;
     }
     return false;
   }
 
- inline bool jj_3R_431()
+ inline bool jj_3R_432()
  {
     if (jj_done) return true;
     if (jj_scan_token(PROCEDURE_T)) return true;
-    if (jj_3R_520()) return true;
+    if (jj_3R_521()) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_521()) jj_scanpos = xsp;
-    xsp = jj_scanpos;
-    if (jj_3_95()) jj_scanpos = xsp;
+    if (jj_3R_522()) jj_scanpos = xsp;
     xsp = jj_scanpos;
     if (jj_3_96()) jj_scanpos = xsp;
-    if (jj_3R_423()) return true;
+    xsp = jj_scanpos;
+    if (jj_3_97()) jj_scanpos = xsp;
+    if (jj_3R_424()) return true;
     return false;
   }
 
- inline bool jj_3R_497()
+ inline bool jj_3R_499()
+ {
+    if (jj_done) return true;
+    if (jj_3R_74()) return true;
+    return false;
+  }
+
+ inline bool jj_3R_498()
  {
     if (jj_done) return true;
     if (jj_3R_88()) return true;
     return false;
   }
 
- inline bool jj_3R_409()
+ inline bool jj_3R_632()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_496()) {
+    if (jj_scan_token(46)) {
     jj_scanpos = xsp;
+    if (jj_scan_token(80)) return true;
+    }
+    return false;
+  }
+
+ inline bool jj_3R_410()
+ {
+    if (jj_done) return true;
+    Token * xsp;
+    xsp = jj_scanpos;
     if (jj_3R_497()) {
     jj_scanpos = xsp;
     if (jj_3R_498()) {
@@ -5150,6 +5168,8 @@ void parseInline();
     jj_scanpos = xsp;
     if (jj_3R_503()) {
     jj_scanpos = xsp;
+    if (jj_3R_504()) {
+    jj_scanpos = xsp;
     if (jj_scan_token(189)) return true;
     }
     }
@@ -5162,22 +5182,17 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_496()
+ inline bool jj_3R_497()
  {
     if (jj_done) return true;
-    if (jj_3R_559()) return true;
+    if (jj_3R_560()) return true;
     return false;
   }
 
- inline bool jj_3R_631()
+ inline bool jj_3R_630()
  {
     if (jj_done) return true;
-    Token * xsp;
-    xsp = jj_scanpos;
-    if (jj_scan_token(46)) {
-    jj_scanpos = xsp;
-    if (jj_scan_token(80)) return true;
-    }
+    if (jj_3R_653()) return true;
     return false;
   }
 
@@ -5188,35 +5203,35 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_629()
+ inline bool jj_3R_571()
  {
     if (jj_done) return true;
-    if (jj_3R_652()) return true;
+    Token * xsp;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_630()) { jj_scanpos = xsp; break; }
+    }
     return false;
   }
 
- inline bool jj_3R_570()
+ inline bool jj_3_94()
  {
     if (jj_done) return true;
-    Token * xsp;
-    while (true) {
-      xsp = jj_scanpos;
-      if (jj_3R_629()) { jj_scanpos = xsp; break; }
-    }
+    if (jj_3R_64()) return true;
     return false;
   }
 
- inline bool jj_3R_172()
+ inline bool jj_3R_675()
  {
     if (jj_done) return true;
-    if (jj_3R_324()) return true;
+    if (jj_3R_383()) return true;
     return false;
   }
 
- inline bool jj_3_93()
+ inline bool jj_3R_172()
  {
     if (jj_done) return true;
-    if (jj_3R_64()) return true;
+    if (jj_3R_325()) return true;
     return false;
   }
 
@@ -5242,40 +5257,33 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_76()
+ inline bool jj_3_95()
  {
     if (jj_done) return true;
-    Token * xsp;
-    xsp = jj_scanpos;
-    if (jj_3_16()) jj_scanpos = xsp;
-    xsp = jj_scanpos;
-    if (jj_scan_token(79)) jj_scanpos = xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_171()) {
-    jj_scanpos = xsp;
-    if (jj_3R_172()) return true;
-    }
+    if (jj_3R_65()) return true;
     return false;
   }
 
  inline bool jj_3R_673()
  {
     if (jj_done) return true;
-    if (jj_3R_381()) return true;
-    return false;
-  }
-
- inline bool jj_3_94()
- {
-    if (jj_done) return true;
-    if (jj_3R_65()) return true;
+    if (jj_3R_379()) return true;
     return false;
   }
 
- inline bool jj_3R_672()
+ inline bool jj_3R_76()
  {
     if (jj_done) return true;
-    if (jj_3R_378()) return true;
+    Token * xsp;
+    xsp = jj_scanpos;
+    if (jj_3_16()) jj_scanpos = xsp;
+    xsp = jj_scanpos;
+    if (jj_scan_token(79)) jj_scanpos = xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_171()) {
+    jj_scanpos = xsp;
+    if (jj_3R_172()) return true;
+    }
     return false;
   }
 
@@ -5287,23 +5295,17 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_78()
+ inline bool jj_3R_672()
  {
     if (jj_done) return true;
-    Token * xsp;
-    xsp = jj_scanpos;
-    if (jj_3_15()) jj_scanpos = xsp;
-    xsp = jj_scanpos;
-    if (jj_scan_token(79)) jj_scanpos = xsp;
-    if (jj_3R_176()) return true;
-    if (jj_scan_token(SEMI_T)) return true;
+    if (jj_3R_64()) return true;
     return false;
   }
 
  inline bool jj_3R_671()
  {
     if (jj_done) return true;
-    if (jj_3R_64()) return true;
+    if (jj_3R_377()) return true;
     return false;
   }
 
@@ -5321,53 +5323,66 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3_14()
+ inline bool jj_3R_574()
  {
     if (jj_done) return true;
-    if (jj_3R_69()) return true;
-    if (jj_scan_token(COLON_T)) return true;
+    if (jj_3R_521()) return true;
     return false;
   }
 
- inline bool jj_3_13()
+ inline bool jj_3R_78()
  {
     if (jj_done) return true;
-    if (jj_3R_70()) return true;
+    Token * xsp;
+    xsp = jj_scanpos;
+    if (jj_3_15()) jj_scanpos = xsp;
+    xsp = jj_scanpos;
+    if (jj_scan_token(79)) jj_scanpos = xsp;
+    if (jj_3R_176()) return true;
+    if (jj_scan_token(SEMI_T)) return true;
     return false;
   }
 
  inline bool jj_3R_668()
  {
     if (jj_done) return true;
-    if (jj_3R_374()) return true;
+    if (jj_3R_373()) return true;
     return false;
   }
 
- inline bool jj_3R_573()
+ inline bool jj_3R_667()
+ {
+    if (jj_done) return true;
+    if (jj_3R_372()) return true;
+    return false;
+  }
+
+ inline bool jj_3R_666()
  {
     if (jj_done) return true;
-    if (jj_3R_520()) return true;
+    if (jj_3R_525()) return true;
     return false;
   }
 
- inline bool jj_3R_667()
+ inline bool jj_3_14()
  {
     if (jj_done) return true;
-    if (jj_3R_372()) return true;
+    if (jj_3R_69()) return true;
+    if (jj_scan_token(COLON_T)) return true;
     return false;
   }
 
- inline bool jj_3R_666()
+ inline bool jj_3_13()
  {
     if (jj_done) return true;
-    if (jj_3R_371()) return true;
+    if (jj_3R_70()) return true;
     return false;
   }
 
  inline bool jj_3R_665()
  {
     if (jj_done) return true;
-    if (jj_3R_524()) return true;
+    if (jj_3R_371()) return true;
     return false;
   }
 
@@ -5384,53 +5399,18 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_678()
- {
-    if (jj_done) return true;
-    if (jj_3R_690()) return true;
-    return false;
-  }
-
  inline bool jj_3R_664()
  {
     if (jj_done) return true;
-    if (jj_3R_370()) return true;
-    return false;
-  }
-
- inline bool jj_3R_677()
- {
-    if (jj_done) return true;
-    if (jj_3R_689()) return true;
-    return false;
-  }
-
- inline bool jj_3R_663()
- {
-    if (jj_done) return true;
     if (jj_3R_92()) return true;
     return false;
   }
 
- inline bool jj_3R_654()
- {
-    if (jj_done) return true;
-    Token * xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_677()) {
-    jj_scanpos = xsp;
-    if (jj_3R_678()) return true;
-    }
-    return false;
-  }
-
- inline bool jj_3R_652()
+ inline bool jj_3R_653()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_663()) {
-    jj_scanpos = xsp;
     if (jj_3R_664()) {
     jj_scanpos = xsp;
     if (jj_3R_665()) {
@@ -5451,9 +5431,11 @@ void parseInline();
     jj_scanpos = xsp;
     if (jj_3R_673()) {
     jj_scanpos = xsp;
-    if (jj_3_94()) {
+    if (jj_3R_674()) {
+    jj_scanpos = xsp;
+    if (jj_3_95()) {
     jj_scanpos = xsp;
-    if (jj_3R_674()) return true;
+    if (jj_3R_675()) return true;
     }
     }
     }
@@ -5469,21 +5451,33 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_175()
+ inline bool jj_3R_679()
  {
     if (jj_done) return true;
-    if (jj_3R_328()) return true;
+    if (jj_3R_691()) return true;
     return false;
   }
 
- inline bool jj_3R_174()
+ inline bool jj_3R_678()
  {
     if (jj_done) return true;
-    if (jj_3R_70()) return true;
+    if (jj_3R_690()) return true;
     return false;
   }
 
- inline bool jj_3R_460()
+ inline bool jj_3R_655()
+ {
+    if (jj_done) return true;
+    Token * xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_678()) {
+    jj_scanpos = xsp;
+    if (jj_3R_679()) return true;
+    }
+    return false;
+  }
+
+ inline bool jj_3R_461()
  {
     if (jj_done) return true;
     if (jj_scan_token(VARASSIGN_T)) return true;
@@ -5491,43 +5485,57 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_468()
+ inline bool jj_3R_175()
  {
     if (jj_done) return true;
-    if (jj_3R_69()) return true;
+    if (jj_3R_329()) return true;
     return false;
   }
 
- inline bool jj_3_92()
+ inline bool jj_3R_174()
+ {
+    if (jj_done) return true;
+    if (jj_3R_70()) return true;
+    return false;
+  }
+
+ inline bool jj_3_93()
  {
     if (jj_done) return true;
     if (jj_3R_130()) return true;
     return false;
   }
 
- inline bool jj_3R_347()
+ inline bool jj_3R_348()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_433()) {
+    if (jj_3R_434()) {
     jj_scanpos = xsp;
     if (jj_scan_token(137)) return true;
     }
     return false;
   }
 
- inline bool jj_3R_433()
+ inline bool jj_3R_434()
+ {
+    if (jj_done) return true;
+    if (jj_3R_525()) return true;
+    return false;
+  }
+
+ inline bool jj_3R_469()
  {
     if (jj_done) return true;
-    if (jj_3R_524()) return true;
+    if (jj_3R_69()) return true;
     return false;
   }
 
  inline bool jj_3R_177()
  {
     if (jj_done) return true;
-    if (jj_3R_330()) return true;
+    if (jj_3R_331()) return true;
     if (jj_scan_token(COLON_T)) return true;
     if (jj_3R_59()) return true;
     return false;
@@ -5536,15 +5544,15 @@ void parseInline();
  inline bool jj_3R_200()
  {
     if (jj_done) return true;
-    if (jj_3R_346()) return true;
     if (jj_3R_347()) return true;
+    if (jj_3R_348()) return true;
     return false;
   }
 
- inline bool jj_3R_572()
+ inline bool jj_3R_573()
  {
     if (jj_done) return true;
-    if (jj_3R_631()) return true;
+    if (jj_3R_632()) return true;
     return false;
   }
 
@@ -5567,7 +5575,22 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3_91()
+ inline bool jj_3_92()
+ {
+    if (jj_done) return true;
+    if (jj_3R_128()) return true;
+    if (jj_3R_129()) return true;
+    return false;
+  }
+
+ inline bool jj_3R_460()
+ {
+    if (jj_done) return true;
+    if (jj_3R_533()) return true;
+    return false;
+  }
+
+ inline bool jj_3R_162()
  {
     if (jj_done) return true;
     if (jj_3R_128()) return true;
@@ -5590,46 +5613,48 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_459()
- {
-    if (jj_done) return true;
-    if (jj_3R_532()) return true;
-    return false;
-  }
-
- inline bool jj_3R_162()
+ inline bool jj_3R_468()
  {
     if (jj_done) return true;
-    if (jj_3R_128()) return true;
-    if (jj_3R_129()) return true;
+    if (jj_3R_538()) return true;
     return false;
   }
 
  inline bool jj_3R_467()
  {
     if (jj_done) return true;
-    if (jj_3R_537()) return true;
+    if (jj_3R_66()) return true;
     return false;
   }
 
- inline bool jj_3R_466()
+ inline bool jj_3R_179()
  {
     if (jj_done) return true;
-    if (jj_3R_66()) return true;
+    if (jj_3R_333()) return true;
     return false;
   }
 
- inline bool jj_3R_179()
+ inline bool jj_3R_178()
  {
     if (jj_done) return true;
     if (jj_3R_332()) return true;
+    if (jj_scan_token(SEMI_T)) return true;
     return false;
   }
 
- inline bool jj_3R_178()
+ inline bool jj_3R_525()
  {
     if (jj_done) return true;
-    if (jj_3R_331()) return true;
+    if (jj_scan_token(IS_T)) return true;
+    if (jj_3R_571()) return true;
+    if (jj_scan_token(BEGIN_T)) return true;
+    if (jj_3R_572()) return true;
+    if (jj_scan_token(END_T)) return true;
+    Token * xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_573()) jj_scanpos = xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_574()) jj_scanpos = xsp;
     if (jj_scan_token(SEMI_T)) return true;
     return false;
   }
@@ -5642,7 +5667,7 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_377()
+ inline bool jj_3R_378()
  {
     if (jj_done) return true;
     if (jj_scan_token(COMPONENT_T)) return true;
@@ -5651,30 +5676,13 @@ void parseInline();
     xsp = jj_scanpos;
     if (jj_scan_token(56)) jj_scanpos = xsp;
     xsp = jj_scanpos;
-    if (jj_3R_466()) jj_scanpos = xsp;
-    xsp = jj_scanpos;
     if (jj_3R_467()) jj_scanpos = xsp;
-    if (jj_scan_token(END_T)) return true;
-    if (jj_scan_token(COMPONENT_T)) return true;
     xsp = jj_scanpos;
     if (jj_3R_468()) jj_scanpos = xsp;
-    if (jj_scan_token(SEMI_T)) return true;
-    return false;
-  }
-
- inline bool jj_3R_524()
- {
-    if (jj_done) return true;
-    if (jj_scan_token(IS_T)) return true;
-    if (jj_3R_570()) return true;
-    if (jj_scan_token(BEGIN_T)) return true;
-    if (jj_3R_571()) return true;
     if (jj_scan_token(END_T)) return true;
-    Token * xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_572()) jj_scanpos = xsp;
+    if (jj_scan_token(COMPONENT_T)) return true;
     xsp = jj_scanpos;
-    if (jj_3R_573()) jj_scanpos = xsp;
+    if (jj_3R_469()) jj_scanpos = xsp;
     if (jj_scan_token(SEMI_T)) return true;
     return false;
   }
@@ -5695,7 +5703,7 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_355()
+ inline bool jj_3R_356()
  {
     if (jj_done) return true;
     if (jj_scan_token(STRINGLITERAL)) return true;
@@ -5728,6 +5736,14 @@ void parseInline();
     return false;
   }
 
+ inline bool jj_3R_435()
+ {
+    if (jj_done) return true;
+    if (jj_scan_token(COMMA_T)) return true;
+    if (jj_3R_59()) return true;
+    return false;
+  }
+
  inline bool jj_3_10()
  {
     if (jj_done) return true;
@@ -5735,57 +5751,65 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_336()
+ inline bool jj_3R_337()
  {
     if (jj_done) return true;
     if (jj_scan_token(OTHER_T)) return true;
     return false;
   }
 
- inline bool jj_3R_434()
+ inline bool jj_3R_161()
  {
     if (jj_done) return true;
-    if (jj_scan_token(COMMA_T)) return true;
-    if (jj_3R_59()) return true;
+    if (jj_3R_314()) return true;
     return false;
   }
 
- inline bool jj_3R_335()
+ inline bool jj_3R_336()
  {
     if (jj_done) return true;
     if (jj_3R_69()) return true;
     return false;
   }
 
- inline bool jj_3R_334()
+ inline bool jj_3R_68()
+ {
+    if (jj_done) return true;
+    Token * xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_161()) jj_scanpos = xsp;
+    if (jj_3R_129()) return true;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_162()) { jj_scanpos = xsp; break; }
+    }
+    return false;
+  }
+
+ inline bool jj_3R_335()
  {
     if (jj_done) return true;
     if (jj_3R_68()) return true;
     return false;
   }
 
- inline bool jj_3R_161()
+ inline bool jj_3R_358()
  {
     if (jj_done) return true;
-    if (jj_3R_313()) return true;
+    if (jj_scan_token(RETURN_T)) return true;
+    if (jj_3R_59()) return true;
     return false;
   }
 
- inline bool jj_3R_68()
+ inline bool jj_3R_639()
  {
     if (jj_done) return true;
-    Token * xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_161()) jj_scanpos = xsp;
-    if (jj_3R_129()) return true;
-    while (true) {
-      xsp = jj_scanpos;
-      if (jj_3R_162()) { jj_scanpos = xsp; break; }
-    }
+    if (jj_scan_token(COMMA_T)) return true;
+    if (jj_3R_59()) return true;
     return false;
   }
 
- inline bool jj_3R_627()
+ inline bool jj_3R_628()
  {
     if (jj_done) return true;
     if (jj_3R_69()) return true;
@@ -5797,20 +5821,20 @@ void parseInline();
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_333()) {
-    jj_scanpos = xsp;
     if (jj_3R_334()) {
     jj_scanpos = xsp;
     if (jj_3R_335()) {
     jj_scanpos = xsp;
-    if (jj_3R_336()) return true;
+    if (jj_3R_336()) {
+    jj_scanpos = xsp;
+    if (jj_3R_337()) return true;
     }
     }
     }
     return false;
   }
 
- inline bool jj_3R_333()
+ inline bool jj_3R_334()
  {
     if (jj_done) return true;
     if (jj_3R_67()) return true;
@@ -5820,39 +5844,36 @@ void parseInline();
  inline bool jj_3R_357()
  {
     if (jj_done) return true;
-    if (jj_scan_token(RETURN_T)) return true;
-    if (jj_3R_59()) return true;
-    return false;
-  }
-
- inline bool jj_3R_638()
- {
-    if (jj_done) return true;
-    if (jj_scan_token(COMMA_T)) return true;
     if (jj_3R_59()) return true;
+    Token * xsp;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_435()) { jj_scanpos = xsp; break; }
+    }
     return false;
   }
 
- inline bool jj_3R_356()
+ inline bool jj_3R_234()
  {
     if (jj_done) return true;
-    if (jj_3R_59()) return true;
+    if (jj_scan_token(LBRACKET_T)) return true;
     Token * xsp;
-    while (true) {
-      xsp = jj_scanpos;
-      if (jj_3R_434()) { jj_scanpos = xsp; break; }
-    }
+    xsp = jj_scanpos;
+    if (jj_3R_357()) jj_scanpos = xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_358()) jj_scanpos = xsp;
+    if (jj_scan_token(RBRACKET_T)) return true;
     return false;
   }
 
- inline bool jj_3R_351()
+ inline bool jj_3R_352()
  {
     if (jj_done) return true;
     if (jj_scan_token(CHARACTER_LITERAL)) return true;
     return false;
   }
 
- inline bool jj_3R_613()
+ inline bool jj_3R_614()
  {
     if (jj_done) return true;
     if (jj_scan_token(LPAREN_T)) return true;
@@ -5861,111 +5882,98 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_233()
- {
-    if (jj_done) return true;
-    if (jj_scan_token(LBRACKET_T)) return true;
-    Token * xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_356()) jj_scanpos = xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_357()) jj_scanpos = xsp;
-    if (jj_scan_token(RBRACKET_T)) return true;
-    return false;
-  }
-
- inline bool jj_3R_604()
+ inline bool jj_3R_605()
  {
     if (jj_done) return true;
     if (jj_scan_token(ALL_T)) return true;
     return false;
   }
 
- inline bool jj_3R_603()
+ inline bool jj_3R_604()
  {
     if (jj_done) return true;
     if (jj_scan_token(OTHER_T)) return true;
     return false;
   }
 
- inline bool jj_3R_602()
+ inline bool jj_3R_603()
  {
     if (jj_done) return true;
     if (jj_3R_59()) return true;
     Token * xsp;
     while (true) {
       xsp = jj_scanpos;
-      if (jj_3R_638()) { jj_scanpos = xsp; break; }
+      if (jj_3R_639()) { jj_scanpos = xsp; break; }
     }
     return false;
   }
 
- inline bool jj_3R_540()
+ inline bool jj_3R_541()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_602()) {
-    jj_scanpos = xsp;
     if (jj_3R_603()) {
     jj_scanpos = xsp;
-    if (jj_3R_604()) return true;
+    if (jj_3R_604()) {
+    jj_scanpos = xsp;
+    if (jj_3R_605()) return true;
     }
     }
     return false;
   }
 
- inline bool jj_3R_578()
+ inline bool jj_3R_579()
  {
     if (jj_done) return true;
     if (jj_scan_token(BUS_T)) return true;
     return false;
   }
 
- inline bool jj_3R_625()
+ inline bool jj_3R_578()
  {
     if (jj_done) return true;
-    if (jj_scan_token(WHEN_T)) return true;
-    if (jj_3R_85()) return true;
-    if (jj_scan_token(ARROW_T)) return true;
-    if (jj_3R_258()) return true;
+    if (jj_scan_token(REGISTER_T)) return true;
     return false;
   }
 
- inline bool jj_3R_617()
+ inline bool jj_3R_533()
  {
     if (jj_done) return true;
-    if (jj_3R_69()) return true;
+    Token * xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_578()) {
+    jj_scanpos = xsp;
+    if (jj_3R_579()) return true;
+    }
     return false;
   }
 
  inline bool jj_3R_626()
  {
     if (jj_done) return true;
-    if (jj_3R_625()) return true;
+    if (jj_scan_token(WHEN_T)) return true;
+    if (jj_3R_85()) return true;
+    if (jj_scan_token(ARROW_T)) return true;
+    if (jj_3R_259()) return true;
     return false;
   }
 
- inline bool jj_3R_577()
+ inline bool jj_3R_618()
  {
     if (jj_done) return true;
-    if (jj_scan_token(REGISTER_T)) return true;
+    if (jj_3R_69()) return true;
     return false;
   }
 
- inline bool jj_3R_532()
+ inline bool jj_3R_627()
  {
     if (jj_done) return true;
-    Token * xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_577()) {
-    jj_scanpos = xsp;
-    if (jj_3R_578()) return true;
-    }
+    if (jj_3R_626()) return true;
     return false;
   }
 
- inline bool jj_3R_659()
+ inline bool jj_3R_660()
  {
     if (jj_done) return true;
     if (jj_3R_70()) return true;
@@ -5973,7 +5981,7 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_373()
+ inline bool jj_3R_374()
  {
     if (jj_done) return true;
     if (jj_scan_token(SIGNAL_T)) return true;
@@ -5982,14 +5990,14 @@ void parseInline();
     if (jj_3R_84()) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_459()) jj_scanpos = xsp;
-    xsp = jj_scanpos;
     if (jj_3R_460()) jj_scanpos = xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_461()) jj_scanpos = xsp;
     if (jj_scan_token(SEMI_T)) return true;
     return false;
   }
 
- inline bool jj_3R_255()
+ inline bool jj_3R_256()
  {
     if (jj_done) return true;
     if (jj_3R_69()) return true;
@@ -5997,68 +6005,68 @@ void parseInline();
     return false;
   }
 
+ inline bool jj_3_91()
+ {
+    if (jj_done) return true;
+    if (jj_3R_127()) return true;
+    return false;
+  }
+
  inline bool jj_3R_121()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_255()) jj_scanpos = xsp;
+    if (jj_3R_256()) jj_scanpos = xsp;
     if (jj_scan_token(CASE_T)) return true;
     if (jj_3R_58()) return true;
     if (jj_scan_token(IS_T)) return true;
-    if (jj_3R_625()) return true;
+    if (jj_3R_626()) return true;
     while (true) {
       xsp = jj_scanpos;
-      if (jj_3R_626()) { jj_scanpos = xsp; break; }
+      if (jj_3R_627()) { jj_scanpos = xsp; break; }
     }
     if (jj_scan_token(END_T)) return true;
     if (jj_scan_token(CASE_T)) return true;
     xsp = jj_scanpos;
-    if (jj_3R_627()) jj_scanpos = xsp;
+    if (jj_3R_628()) jj_scanpos = xsp;
     if (jj_scan_token(SEMI_T)) return true;
     return false;
   }
 
- inline bool jj_3R_650()
+ inline bool jj_3R_651()
  {
     if (jj_done) return true;
-    if (jj_3R_409()) return true;
+    if (jj_3R_410()) return true;
     return false;
   }
 
  inline bool jj_3_90()
  {
     if (jj_done) return true;
-    if (jj_3R_127()) return true;
+    if (jj_3R_126()) return true;
     return false;
   }
 
- inline bool jj_3R_616()
+ inline bool jj_3R_617()
  {
     if (jj_done) return true;
     Token * xsp;
     while (true) {
       xsp = jj_scanpos;
-      if (jj_3R_650()) { jj_scanpos = xsp; break; }
+      if (jj_3R_651()) { jj_scanpos = xsp; break; }
     }
     return false;
   }
 
- inline bool jj_3_89()
- {
-    if (jj_done) return true;
-    if (jj_3R_126()) return true;
-    return false;
-  }
-
- inline bool jj_3R_525()
+ inline bool jj_3R_526()
  {
     if (jj_done) return true;
-    if (jj_3R_404()) return true;
+    if (jj_3R_405()) return true;
     return false;
   }
 
- inline bool jj_3_88()
+ inline bool jj_3_89()
  {
     if (jj_done) return true;
     if (jj_3R_69()) return true;
@@ -6066,76 +6074,76 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_437()
+ inline bool jj_3R_438()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3_88()) jj_scanpos = xsp;
+    if (jj_3_89()) jj_scanpos = xsp;
     if (jj_3R_114()) return true;
     if (jj_scan_token(LESSTHAN_T)) return true;
     xsp = jj_scanpos;
-    if (jj_3R_525()) jj_scanpos = xsp;
-    if (jj_3R_317()) return true;
-    if (jj_scan_token(SEMI_T)) return true;
-    return false;
-  }
-
- inline bool jj_3R_660()
- {
-    if (jj_done) return true;
-    if (jj_3R_328()) return true;
+    if (jj_3R_526()) jj_scanpos = xsp;
+    if (jj_3R_318()) return true;
     if (jj_scan_token(SEMI_T)) return true;
     return false;
   }
 
- inline bool jj_3R_436()
+ inline bool jj_3R_437()
  {
     if (jj_done) return true;
     if (jj_3R_127()) return true;
     return false;
   }
 
- inline bool jj_3R_386()
+ inline bool jj_3R_387()
  {
     if (jj_done) return true;
-    if (jj_3R_476()) return true;
+    if (jj_3R_477()) return true;
     if (jj_3R_68()) return true;
     return false;
   }
 
- inline bool jj_3R_506()
+ inline bool jj_3R_661()
  {
     if (jj_done) return true;
-    if (jj_scan_token(LPAREN_T)) return true;
-    if (jj_3R_564()) return true;
-    if (jj_scan_token(RPAREN_T)) return true;
+    if (jj_3R_329()) return true;
+    if (jj_scan_token(SEMI_T)) return true;
     return false;
   }
 
- inline bool jj_3R_360()
+ inline bool jj_3R_361()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_435()) {
-    jj_scanpos = xsp;
     if (jj_3R_436()) {
     jj_scanpos = xsp;
-    if (jj_3R_437()) return true;
+    if (jj_3R_437()) {
+    jj_scanpos = xsp;
+    if (jj_3R_438()) return true;
     }
     }
     return false;
   }
 
- inline bool jj_3R_435()
+ inline bool jj_3R_436()
  {
     if (jj_done) return true;
     if (jj_3R_126()) return true;
     return false;
   }
 
- inline bool jj_3R_559()
+ inline bool jj_3R_507()
+ {
+    if (jj_done) return true;
+    if (jj_scan_token(LPAREN_T)) return true;
+    if (jj_3R_565()) return true;
+    if (jj_scan_token(RPAREN_T)) return true;
+    return false;
+  }
+
+ inline bool jj_3R_560()
  {
     if (jj_done) return true;
     if (jj_3R_69()) return true;
@@ -6143,162 +6151,131 @@ void parseInline();
     if (jj_scan_token(BLOCK_T)) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_613()) jj_scanpos = xsp;
+    if (jj_3R_614()) jj_scanpos = xsp;
     xsp = jj_scanpos;
     if (jj_scan_token(56)) jj_scanpos = xsp;
-    if (jj_3R_614()) return true;
     if (jj_3R_615()) return true;
-    if (jj_scan_token(BEGIN_T)) return true;
     if (jj_3R_616()) return true;
+    if (jj_scan_token(BEGIN_T)) return true;
+    if (jj_3R_617()) return true;
     if (jj_scan_token(END_T)) return true;
     if (jj_scan_token(BLOCK_T)) return true;
     xsp = jj_scanpos;
-    if (jj_3R_617()) jj_scanpos = xsp;
+    if (jj_3R_618()) jj_scanpos = xsp;
     if (jj_scan_token(SEMI_T)) return true;
     return false;
   }
 
- inline bool jj_3_9()
- {
-    if (jj_done) return true;
-    if (jj_3R_66()) return true;
-    return false;
-  }
-
- inline bool jj_3R_401()
+ inline bool jj_3R_402()
  {
     if (jj_done) return true;
     if (jj_scan_token(MINUS_T)) return true;
     return false;
   }
 
- inline bool jj_3R_418()
+ inline bool jj_3_9()
  {
     if (jj_done) return true;
-    if (jj_3R_59()) return true;
-    Token * xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_506()) jj_scanpos = xsp;
+    if (jj_3R_66()) return true;
     return false;
   }
 
- inline bool jj_3R_313()
+ inline bool jj_3R_314()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_400()) {
+    if (jj_3R_401()) {
     jj_scanpos = xsp;
-    if (jj_3R_401()) return true;
+    if (jj_3R_402()) return true;
     }
     return false;
   }
 
- inline bool jj_3R_400()
+ inline bool jj_3R_401()
  {
     if (jj_done) return true;
     if (jj_scan_token(PLUS_T)) return true;
     return false;
   }
 
- inline bool jj_3R_551()
+ inline bool jj_3R_552()
  {
     if (jj_done) return true;
     if (jj_scan_token(ROR_T)) return true;
     return false;
   }
 
- inline bool jj_3R_550()
- {
-    if (jj_done) return true;
-    if (jj_scan_token(ROL_T)) return true;
-    return false;
-  }
-
- inline bool jj_3R_648()
+ inline bool jj_3R_419()
  {
     if (jj_done) return true;
-    if (jj_3R_537()) return true;
+    if (jj_3R_59()) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_660()) jj_scanpos = xsp;
+    if (jj_3R_507()) jj_scanpos = xsp;
     return false;
   }
 
- inline bool jj_3R_549()
+ inline bool jj_3R_551()
  {
     if (jj_done) return true;
-    if (jj_scan_token(SRA_T)) return true;
+    if (jj_scan_token(ROL_T)) return true;
     return false;
   }
 
- inline bool jj_3R_548()
+ inline bool jj_3R_550()
  {
     if (jj_done) return true;
-    if (jj_scan_token(SLA_T)) return true;
+    if (jj_scan_token(SRA_T)) return true;
     return false;
   }
 
- inline bool jj_3R_647()
+ inline bool jj_3R_549()
  {
     if (jj_done) return true;
-    if (jj_3R_66()) return true;
-    Token * xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_659()) jj_scanpos = xsp;
+    if (jj_scan_token(SLA_T)) return true;
     return false;
   }
 
- inline bool jj_3R_547()
+ inline bool jj_3R_548()
  {
     if (jj_done) return true;
     if (jj_scan_token(SRL_T)) return true;
     return false;
   }
 
- inline bool jj_3R_614()
+ inline bool jj_3R_649()
  {
     if (jj_done) return true;
+    if (jj_3R_538()) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_647()) jj_scanpos = xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_648()) jj_scanpos = xsp;
-    return false;
-  }
-
- inline bool jj_3R_649()
- {
-    if (jj_done) return true;
-    if (jj_3R_140()) return true;
+    if (jj_3R_661()) jj_scanpos = xsp;
     return false;
   }
 
- inline bool jj_3R_615()
+ inline bool jj_3R_648()
  {
     if (jj_done) return true;
+    if (jj_3R_66()) return true;
     Token * xsp;
-    while (true) {
-      xsp = jj_scanpos;
-      if (jj_3R_649()) { jj_scanpos = xsp; break; }
-    }
+    xsp = jj_scanpos;
+    if (jj_3R_660()) jj_scanpos = xsp;
     return false;
   }
 
- inline bool jj_3R_546()
+ inline bool jj_3R_547()
  {
     if (jj_done) return true;
     if (jj_scan_token(SLL_T)) return true;
     return false;
   }
 
- inline bool jj_3R_476()
+ inline bool jj_3R_477()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_546()) {
-    jj_scanpos = xsp;
     if (jj_3R_547()) {
     jj_scanpos = xsp;
     if (jj_3R_548()) {
@@ -6307,7 +6284,9 @@ void parseInline();
     jj_scanpos = xsp;
     if (jj_3R_550()) {
     jj_scanpos = xsp;
-    if (jj_3R_551()) return true;
+    if (jj_3R_551()) {
+    jj_scanpos = xsp;
+    if (jj_3R_552()) return true;
     }
     }
     }
@@ -6316,27 +6295,63 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_306()
+ inline bool jj_3R_615()
+ {
+    if (jj_done) return true;
+    Token * xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_648()) jj_scanpos = xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_649()) jj_scanpos = xsp;
+    return false;
+  }
+
+ inline bool jj_3R_650()
+ {
+    if (jj_done) return true;
+    if (jj_3R_140()) return true;
+    return false;
+  }
+
+ inline bool jj_3R_616()
+ {
+    if (jj_done) return true;
+    Token * xsp;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_650()) { jj_scanpos = xsp; break; }
+    }
+    return false;
+  }
+
+ inline bool jj_3R_307()
  {
     if (jj_done) return true;
     if (jj_3R_68()) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_386()) jj_scanpos = xsp;
+    if (jj_3R_387()) jj_scanpos = xsp;
     return false;
   }
 
- inline bool jj_3R_299()
+ inline bool jj_3R_245()
  {
     if (jj_done) return true;
-    if (jj_3R_382()) return true;
+    if (jj_3R_363()) return true;
     return false;
   }
 
- inline bool jj_3R_244()
+ inline bool jj_3R_300()
  {
     if (jj_done) return true;
-    if (jj_3R_362()) return true;
+    if (jj_3R_383()) return true;
+    return false;
+  }
+
+ inline bool jj_3_88()
+ {
+    if (jj_done) return true;
+    if (jj_3R_125()) return true;
     return false;
   }
 
@@ -6350,7 +6365,7 @@ void parseInline();
  inline bool jj_3_87()
  {
     if (jj_done) return true;
-    if (jj_3R_125()) return true;
+    if (jj_3R_124()) return true;
     return false;
   }
 
@@ -6361,6 +6376,13 @@ void parseInline();
     return false;
   }
 
+ inline bool jj_3R_299()
+ {
+    if (jj_done) return true;
+    if (jj_3R_382()) return true;
+    return false;
+  }
+
  inline bool jj_3R_298()
  {
     if (jj_done) return true;
@@ -6375,78 +6397,78 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_296()
+ inline bool jj_3_86()
  {
     if (jj_done) return true;
-    if (jj_3R_379()) return true;
+    if (jj_3R_123()) return true;
     return false;
   }
 
- inline bool jj_3_86()
+ inline bool jj_3R_296()
  {
     if (jj_done) return true;
-    if (jj_3R_124()) return true;
+    if (jj_3R_379()) return true;
     return false;
   }
 
- inline bool jj_3R_295()
+ inline bool jj_3R_118()
  {
     if (jj_done) return true;
-    if (jj_3R_378()) return true;
+    if (jj_3R_69()) return true;
+    if (jj_scan_token(COLON_T)) return true;
     return false;
   }
 
- inline bool jj_3_85()
+ inline bool jj_3_81()
  {
     if (jj_done) return true;
-    if (jj_3R_123()) return true;
+    Token * xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_118()) jj_scanpos = xsp;
+    if (jj_3R_114()) return true;
+    if (jj_scan_token(VARASSIGN_T)) return true;
     return false;
   }
 
- inline bool jj_3R_118()
+ inline bool jj_3_85()
  {
     if (jj_done) return true;
-    if (jj_3R_69()) return true;
-    if (jj_scan_token(COLON_T)) return true;
+    if (jj_3R_122()) return true;
     return false;
   }
 
- inline bool jj_3R_293()
+ inline bool jj_3R_294()
  {
     if (jj_done) return true;
-    if (jj_3R_377()) return true;
+    if (jj_3R_378()) return true;
     return false;
   }
 
- inline bool jj_3R_294()
+ inline bool jj_3R_295()
  {
     if (jj_done) return true;
     if (jj_3R_64()) return true;
     return false;
   }
 
- inline bool jj_3R_292()
+ inline bool jj_3_84()
  {
     if (jj_done) return true;
-    if (jj_3R_376()) return true;
+    if (jj_3R_121()) return true;
     return false;
   }
 
- inline bool jj_3_80()
+ inline bool jj_3R_293()
  {
     if (jj_done) return true;
-    Token * xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_118()) jj_scanpos = xsp;
-    if (jj_3R_114()) return true;
-    if (jj_scan_token(VARASSIGN_T)) return true;
+    if (jj_3R_377()) return true;
     return false;
   }
 
- inline bool jj_3_84()
+ inline bool jj_3R_292()
  {
     if (jj_done) return true;
-    if (jj_3R_122()) return true;
+    if (jj_3R_376()) return true;
     return false;
   }
 
@@ -6457,17 +6479,17 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_290()
+ inline bool jj_3_83()
  {
     if (jj_done) return true;
-    if (jj_3R_374()) return true;
+    if (jj_3R_120()) return true;
     return false;
   }
 
- inline bool jj_3_83()
+ inline bool jj_3R_290()
  {
     if (jj_done) return true;
-    if (jj_3R_121()) return true;
+    if (jj_3R_374()) return true;
     return false;
   }
 
@@ -6492,31 +6514,24 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3_82()
+ inline bool jj_3R_421()
  {
     if (jj_done) return true;
-    if (jj_3R_120()) return true;
+    if (jj_3R_508()) return true;
     return false;
   }
 
- inline bool jj_3R_286()
+ inline bool jj_3_82()
  {
     if (jj_done) return true;
-    if (jj_3R_370()) return true;
+    if (jj_3R_119()) return true;
     return false;
   }
 
  inline bool jj_3R_420()
  {
     if (jj_done) return true;
-    if (jj_3R_507()) return true;
-    return false;
-  }
-
- inline bool jj_3R_419()
- {
-    if (jj_done) return true;
-    if (jj_3R_381()) return true;
+    if (jj_3R_382()) return true;
     return false;
   }
 
@@ -6525,8 +6540,6 @@ void parseInline();
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_285()) {
-    jj_scanpos = xsp;
     if (jj_3R_286()) {
     jj_scanpos = xsp;
     if (jj_3R_287()) {
@@ -6553,9 +6566,11 @@ void parseInline();
     jj_scanpos = xsp;
     if (jj_3R_298()) {
     jj_scanpos = xsp;
+    if (jj_3R_299()) {
+    jj_scanpos = xsp;
     if (jj_3_8()) {
     jj_scanpos = xsp;
-    if (jj_3R_299()) return true;
+    if (jj_3R_300()) return true;
     }
     }
     }
@@ -6574,20 +6589,13 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_285()
+ inline bool jj_3R_286()
  {
     if (jj_done) return true;
     if (jj_3R_92()) return true;
     return false;
   }
 
- inline bool jj_3_81()
- {
-    if (jj_done) return true;
-    if (jj_3R_119()) return true;
-    return false;
-  }
-
  inline bool jj_3R_113()
  {
     if (jj_done) return true;
@@ -6596,14 +6604,14 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_243()
+ inline bool jj_3R_244()
  {
     if (jj_done) return true;
-    if (jj_3R_361()) return true;
+    if (jj_3R_362()) return true;
     return false;
   }
 
- inline bool jj_3_76()
+ inline bool jj_3_77()
  {
     if (jj_done) return true;
     Token * xsp;
@@ -6614,19 +6622,26 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_332()
+ inline bool jj_3_80()
+ {
+    if (jj_done) return true;
+    if (jj_3R_117()) return true;
+    return false;
+  }
+
+ inline bool jj_3R_333()
  {
     if (jj_done) return true;
     if (jj_scan_token(FOR_T)) return true;
-    if (jj_3R_418()) return true;
+    if (jj_3R_419()) return true;
     Token * xsp;
     while (true) {
       xsp = jj_scanpos;
-      if (jj_3R_419()) { jj_scanpos = xsp; break; }
+      if (jj_3R_420()) { jj_scanpos = xsp; break; }
     }
     while (true) {
       xsp = jj_scanpos;
-      if (jj_3R_420()) { jj_scanpos = xsp; break; }
+      if (jj_3R_421()) { jj_scanpos = xsp; break; }
     }
     if (jj_scan_token(END_T)) return true;
     if (jj_scan_token(FOR_T)) return true;
@@ -6637,29 +6652,22 @@ void parseInline();
  inline bool jj_3_79()
  {
     if (jj_done) return true;
-    if (jj_3R_117()) return true;
-    return false;
-  }
-
- inline bool jj_3_78()
- {
-    if (jj_done) return true;
     if (jj_3R_116()) return true;
     return false;
   }
 
- inline bool jj_3_77()
+ inline bool jj_3_78()
  {
     if (jj_done) return true;
     if (jj_3R_115()) return true;
     return false;
   }
 
- inline bool jj_3R_504()
+ inline bool jj_3R_505()
  {
     if (jj_done) return true;
     if (jj_scan_token(COMMA_T)) return true;
-    if (jj_3R_317()) return true;
+    if (jj_3R_318()) return true;
     if (jj_scan_token(WHEN_T)) return true;
     if (jj_3R_85()) return true;
     return false;
@@ -6670,17 +6678,15 @@ void parseInline();
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_242()) {
-    jj_scanpos = xsp;
-    if (jj_3_77()) {
+    if (jj_3R_243()) {
     jj_scanpos = xsp;
     if (jj_3_78()) {
     jj_scanpos = xsp;
     if (jj_3_79()) {
     jj_scanpos = xsp;
-    if (jj_3R_243()) {
+    if (jj_3_80()) {
     jj_scanpos = xsp;
-    if (jj_3_81()) {
+    if (jj_3R_244()) {
     jj_scanpos = xsp;
     if (jj_3_82()) {
     jj_scanpos = xsp;
@@ -6694,7 +6700,9 @@ void parseInline();
     jj_scanpos = xsp;
     if (jj_3_87()) {
     jj_scanpos = xsp;
-    if (jj_3R_244()) return true;
+    if (jj_3_88()) {
+    jj_scanpos = xsp;
+    if (jj_3R_245()) return true;
     }
     }
     }
@@ -6710,10 +6718,18 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_242()
+ inline bool jj_3R_243()
  {
     if (jj_done) return true;
-    if (jj_3R_360()) return true;
+    if (jj_3R_361()) return true;
+    return false;
+  }
+
+ inline bool jj_3R_509()
+ {
+    if (jj_done) return true;
+    if (jj_scan_token(COMMA_T)) return true;
+    if (jj_3R_59()) return true;
     return false;
   }
 
@@ -6724,7 +6740,7 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_239()
+ inline bool jj_3R_240()
  {
     if (jj_done) return true;
     if (jj_scan_token(LPAREN_T)) return true;
@@ -6733,116 +6749,108 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_508()
+ inline bool jj_3_76()
  {
     if (jj_done) return true;
-    if (jj_scan_token(COMMA_T)) return true;
-    if (jj_3R_59()) return true;
+    if (jj_3R_112()) return true;
     return false;
   }
 
- inline bool jj_3_75()
+ inline bool jj_3R_259()
  {
     if (jj_done) return true;
-    if (jj_3R_112()) return true;
+    Token * xsp;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3_76()) { jj_scanpos = xsp; break; }
+    }
     return false;
   }
 
- inline bool jj_3R_417()
+ inline bool jj_3R_418()
  {
     if (jj_done) return true;
-    if (jj_3R_328()) return true;
+    if (jj_3R_329()) return true;
     return false;
   }
 
- inline bool jj_3R_416()
+ inline bool jj_3R_417()
  {
     if (jj_done) return true;
     if (jj_3R_70()) return true;
     return false;
   }
 
- inline bool jj_3R_258()
+ inline bool jj_3R_416()
  {
     if (jj_done) return true;
-    Token * xsp;
-    while (true) {
-      xsp = jj_scanpos;
-      if (jj_3_75()) { jj_scanpos = xsp; break; }
-    }
+    if (jj_scan_token(USE_T)) return true;
+    if (jj_3R_506()) return true;
     return false;
   }
 
- inline bool jj_3R_415()
+ inline bool jj_3R_422()
  {
     if (jj_done) return true;
-    if (jj_scan_token(USE_T)) return true;
-    if (jj_3R_505()) return true;
+    if (jj_3R_59()) return true;
+    Token * xsp;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_509()) { jj_scanpos = xsp; break; }
+    }
     return false;
   }
 
- inline bool jj_3R_331()
+ inline bool jj_3R_332()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_415()) jj_scanpos = xsp;
-    xsp = jj_scanpos;
     if (jj_3R_416()) jj_scanpos = xsp;
     xsp = jj_scanpos;
     if (jj_3R_417()) jj_scanpos = xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_418()) jj_scanpos = xsp;
     return false;
   }
 
- inline bool jj_3R_421()
- {
-    if (jj_done) return true;
-    if (jj_3R_59()) return true;
-    Token * xsp;
-    while (true) {
-      xsp = jj_scanpos;
-      if (jj_3R_508()) { jj_scanpos = xsp; break; }
-    }
-    return false;
-  }
-
- inline bool jj_3R_266()
+ inline bool jj_3R_267()
  {
     if (jj_done) return true;
     if (jj_3R_58()) return true;
     return false;
   }
 
- inline bool jj_3R_363()
+ inline bool jj_3R_364()
  {
     if (jj_done) return true;
     if (jj_scan_token(ON_T)) return true;
-    if (jj_3R_421()) return true;
+    if (jj_3R_422()) return true;
     return false;
   }
 
- inline bool jj_3_74()
+ inline bool jj_3_75()
  {
     if (jj_done) return true;
     if (jj_3R_111()) return true;
     return false;
   }
 
- inline bool jj_3R_410()
+ inline bool jj_3R_411()
  {
     if (jj_done) return true;
-    if (jj_3R_317()) return true;
+    if (jj_3R_318()) return true;
     if (jj_scan_token(WHEN_T)) return true;
     if (jj_3R_85()) return true;
     Token * xsp;
     while (true) {
       xsp = jj_scanpos;
-      if (jj_3R_504()) { jj_scanpos = xsp; break; }
+      if (jj_3R_505()) { jj_scanpos = xsp; break; }
     }
     return false;
   }
 
- inline bool jj_3R_324()
+ inline bool jj_3R_325()
  {
     if (jj_done) return true;
     if (jj_scan_token(WITH_T)) return true;
@@ -6851,19 +6859,19 @@ void parseInline();
     if (jj_3R_114()) return true;
     if (jj_scan_token(LESSTHAN_T)) return true;
     if (jj_3R_166()) return true;
-    if (jj_3R_410()) return true;
+    if (jj_3R_411()) return true;
     if (jj_scan_token(SEMI_T)) return true;
     return false;
   }
 
- inline bool jj_3R_688()
+ inline bool jj_3R_689()
  {
     if (jj_done) return true;
     if (jj_3R_111()) return true;
     return false;
   }
 
- inline bool jj_3R_471()
+ inline bool jj_3R_472()
  {
     if (jj_done) return true;
     if (jj_3R_69()) return true;
@@ -6872,7 +6880,7 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_338()
+ inline bool jj_3R_339()
  {
     if (jj_done) return true;
     if (jj_scan_token(SEVERITY_T)) return true;
@@ -6880,7 +6888,7 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_359()
+ inline bool jj_3R_360()
  {
     if (jj_done) return true;
     if (jj_3R_69()) return true;
@@ -6890,95 +6898,95 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_378()
+ inline bool jj_3R_379()
  {
     if (jj_done) return true;
     if (jj_scan_token(ATTRIBUTE_T)) return true;
-    if (jj_3R_219()) return true;
+    if (jj_3R_220()) return true;
     if (jj_scan_token(OF_T)) return true;
-    if (jj_3R_469()) return true;
+    if (jj_3R_470()) return true;
     if (jj_scan_token(IS_T)) return true;
     if (jj_3R_58()) return true;
     if (jj_scan_token(SEMI_T)) return true;
     return false;
   }
 
- inline bool jj_3R_315()
+ inline bool jj_3R_316()
  {
     if (jj_done) return true;
     if (jj_scan_token(COMMA_T)) return true;
-    if (jj_3R_314()) return true;
+    if (jj_3R_315()) return true;
     return false;
   }
 
- inline bool jj_3R_110()
+ inline bool jj_3R_677()
  {
     if (jj_done) return true;
-    if (jj_3R_69()) return true;
-    if (jj_scan_token(APOSTROPHE_T)) return true;
-    if (jj_3R_59()) return true;
+    if (jj_3R_81()) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_239()) jj_scanpos = xsp;
+    if (jj_3R_689()) jj_scanpos = xsp;
     return false;
   }
 
- inline bool jj_3R_676()
+ inline bool jj_3R_110()
  {
     if (jj_done) return true;
-    if (jj_3R_81()) return true;
+    if (jj_3R_69()) return true;
+    if (jj_scan_token(APOSTROPHE_T)) return true;
+    if (jj_3R_59()) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_688()) jj_scanpos = xsp;
+    if (jj_3R_240()) jj_scanpos = xsp;
     return false;
   }
 
- inline bool jj_3R_354()
+ inline bool jj_3R_676()
  {
     if (jj_done) return true;
-    if (jj_scan_token(RANGE_T)) return true;
+    if (jj_3R_688()) return true;
     return false;
   }
 
- inline bool jj_3R_675()
+ inline bool jj_3R_654()
  {
     if (jj_done) return true;
-    if (jj_3R_687()) return true;
+    Token * xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_676()) {
+    jj_scanpos = xsp;
+    if (jj_3R_677()) return true;
+    }
     return false;
   }
 
- inline bool jj_3R_653()
+ inline bool jj_3R_355()
  {
     if (jj_done) return true;
-    Token * xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_675()) {
-    jj_scanpos = xsp;
-    if (jj_3R_676()) return true;
-    }
+    if (jj_scan_token(RANGE_T)) return true;
     return false;
   }
 
- inline bool jj_3R_219()
+ inline bool jj_3R_220()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_353()) {
+    if (jj_3R_354()) {
     jj_scanpos = xsp;
-    if (jj_3R_354()) return true;
+    if (jj_3R_355()) return true;
     }
     return false;
   }
 
- inline bool jj_3R_353()
+ inline bool jj_3R_354()
  {
     if (jj_done) return true;
     if (jj_3R_69()) return true;
     return false;
   }
 
- inline bool jj_3R_265()
+ inline bool jj_3R_266()
  {
     if (jj_done) return true;
     if (jj_3R_69()) return true;
@@ -6991,15 +6999,15 @@ void parseInline();
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_265()) jj_scanpos = xsp;
+    if (jj_3R_266()) jj_scanpos = xsp;
     if (jj_scan_token(RETURN_T)) return true;
     xsp = jj_scanpos;
-    if (jj_3R_266()) jj_scanpos = xsp;
+    if (jj_3R_267()) jj_scanpos = xsp;
     if (jj_scan_token(SEMI_T)) return true;
     return false;
   }
 
- inline bool jj_3R_249()
+ inline bool jj_3R_250()
  {
     if (jj_done) return true;
     if (jj_scan_token(SEVERITY_T)) return true;
@@ -7007,6 +7015,14 @@ void parseInline();
     return false;
   }
 
+ inline bool jj_3R_308()
+ {
+    if (jj_done) return true;
+    if (jj_3R_388()) return true;
+    if (jj_3R_307()) return true;
+    return false;
+  }
+
  inline bool jj_3_6()
  {
     if (jj_done) return true;
@@ -7026,7 +7042,7 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_337()
+ inline bool jj_3R_338()
  {
     if (jj_done) return true;
     if (jj_scan_token(REPORT_T)) return true;
@@ -7034,56 +7050,48 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_307()
+ inline bool jj_3R_249()
  {
     if (jj_done) return true;
-    if (jj_3R_387()) return true;
-    if (jj_3R_306()) return true;
+    if (jj_3R_69()) return true;
+    if (jj_scan_token(COLON_T)) return true;
     return false;
   }
 
  inline bool jj_3R_165()
  {
     if (jj_done) return true;
-    if (jj_3R_314()) return true;
+    if (jj_3R_315()) return true;
     Token * xsp;
     while (true) {
       xsp = jj_scanpos;
-      if (jj_3R_315()) { jj_scanpos = xsp; break; }
+      if (jj_3R_316()) { jj_scanpos = xsp; break; }
     }
     return false;
   }
 
- inline bool jj_3R_248()
- {
-    if (jj_done) return true;
-    if (jj_3R_69()) return true;
-    if (jj_scan_token(COLON_T)) return true;
-    return false;
-  }
-
  inline bool jj_3R_116()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_248()) jj_scanpos = xsp;
+    if (jj_3R_249()) jj_scanpos = xsp;
     if (jj_scan_token(REPORT_T)) return true;
     if (jj_3R_58()) return true;
     xsp = jj_scanpos;
-    if (jj_3R_249()) jj_scanpos = xsp;
+    if (jj_3R_250()) jj_scanpos = xsp;
     if (jj_scan_token(SEMI_T)) return true;
     return false;
   }
 
- inline bool jj_3R_700()
+ inline bool jj_3R_701()
  {
     if (jj_done) return true;
     if (jj_3R_59()) return true;
     return false;
   }
 
- inline bool jj_3R_402()
+ inline bool jj_3R_403()
  {
     if (jj_done) return true;
     if (jj_3R_63()) return true;
@@ -7091,77 +7099,64 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_314()
+ inline bool jj_3R_483()
  {
     if (jj_done) return true;
-    Token * xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_402()) jj_scanpos = xsp;
-    if (jj_3R_403()) return true;
+    if (jj_scan_token(NOTEQU_T)) return true;
     return false;
   }
 
- inline bool jj_3R_482()
+ inline bool jj_3R_315()
  {
     if (jj_done) return true;
-    if (jj_scan_token(NOTEQU_T)) return true;
+    Token * xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_403()) jj_scanpos = xsp;
+    if (jj_3R_404()) return true;
     return false;
   }
 
- inline bool jj_3R_481()
+ inline bool jj_3R_482()
  {
     if (jj_done) return true;
     if (jj_scan_token(LESSTHAN_T)) return true;
     return false;
   }
 
- inline bool jj_3R_480()
+ inline bool jj_3R_481()
  {
     if (jj_done) return true;
     if (jj_scan_token(GREATERTHAN_T)) return true;
     return false;
   }
 
- inline bool jj_3R_247()
- {
-    if (jj_done) return true;
-    if (jj_3R_139()) return true;
-    if (jj_scan_token(COLON_T)) return true;
-    return false;
-  }
-
- inline bool jj_3R_479()
+ inline bool jj_3R_480()
  {
     if (jj_done) return true;
     if (jj_scan_token(EQU_T)) return true;
     return false;
   }
 
- inline bool jj_3R_478()
+ inline bool jj_3R_479()
  {
     if (jj_done) return true;
     if (jj_scan_token(GT_T)) return true;
     return false;
   }
 
- inline bool jj_3R_115()
+ inline bool jj_3R_248()
  {
     if (jj_done) return true;
-    Token * xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_247()) jj_scanpos = xsp;
-    if (jj_3R_187()) return true;
-    if (jj_scan_token(SEMI_T)) return true;
+    if (jj_3R_139()) return true;
+    if (jj_scan_token(COLON_T)) return true;
     return false;
   }
 
- inline bool jj_3R_387()
+ inline bool jj_3R_388()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_477()) {
-    jj_scanpos = xsp;
     if (jj_3R_478()) {
     jj_scanpos = xsp;
     if (jj_3R_479()) {
@@ -7170,7 +7165,9 @@ void parseInline();
     jj_scanpos = xsp;
     if (jj_3R_481()) {
     jj_scanpos = xsp;
-    if (jj_3R_482()) return true;
+    if (jj_3R_482()) {
+    jj_scanpos = xsp;
+    if (jj_3R_483()) return true;
     }
     }
     }
@@ -7179,27 +7176,55 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_477()
+ inline bool jj_3R_478()
  {
     if (jj_done) return true;
     if (jj_scan_token(LT_T)) return true;
     return false;
   }
 
+ inline bool jj_3R_115()
+ {
+    if (jj_done) return true;
+    Token * xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_248()) jj_scanpos = xsp;
+    if (jj_3R_187()) return true;
+    if (jj_scan_token(SEMI_T)) return true;
+    return false;
+  }
+
  inline bool jj_3R_145()
  {
     if (jj_done) return true;
-    if (jj_3R_306()) return true;
+    if (jj_3R_307()) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_307()) jj_scanpos = xsp;
+    if (jj_3R_308()) jj_scanpos = xsp;
     return false;
   }
 
- inline bool jj_3R_699()
+ inline bool jj_3R_700()
  {
     if (jj_done) return true;
-    if (jj_3R_704()) return true;
+    if (jj_3R_705()) return true;
+    return false;
+  }
+
+ inline bool jj_3R_691()
+ {
+    if (jj_done) return true;
+    if (jj_scan_token(RECORD_T)) return true;
+    Token * xsp;
+    if (jj_3R_700()) return true;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_700()) { jj_scanpos = xsp; break; }
+    }
+    if (jj_scan_token(END_T)) return true;
+    if (jj_scan_token(RECORD_T)) return true;
+    xsp = jj_scanpos;
+    if (jj_3R_701()) jj_scanpos = xsp;
     return false;
   }
 
@@ -7210,9 +7235,9 @@ void parseInline();
     if (jj_3R_79()) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_337()) jj_scanpos = xsp;
-    xsp = jj_scanpos;
     if (jj_3R_338()) jj_scanpos = xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_339()) jj_scanpos = xsp;
     return false;
   }
 
@@ -7223,74 +7248,57 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_690()
+ inline bool jj_3_73()
  {
     if (jj_done) return true;
-    if (jj_scan_token(RECORD_T)) return true;
-    Token * xsp;
-    if (jj_3R_699()) return true;
-    while (true) {
-      xsp = jj_scanpos;
-      if (jj_3R_699()) { jj_scanpos = xsp; break; }
-    }
-    if (jj_scan_token(END_T)) return true;
-    if (jj_scan_token(RECORD_T)) return true;
-    xsp = jj_scanpos;
-    if (jj_3R_700()) jj_scanpos = xsp;
+    if (jj_3R_68()) return true;
+    if (jj_3R_109()) return true;
+    if (jj_3R_68()) return true;
     return false;
   }
 
- inline bool jj_3R_698()
+ inline bool jj_3_74()
  {
     if (jj_done) return true;
-    if (jj_3R_703()) return true;
+    if (jj_3R_110()) return true;
     return false;
   }
 
- inline bool jj_3_72()
+ inline bool jj_3R_699()
  {
     if (jj_done) return true;
-    if (jj_3R_68()) return true;
-    if (jj_3R_109()) return true;
-    if (jj_3R_68()) return true;
+    if (jj_3R_704()) return true;
     return false;
   }
 
- inline bool jj_3_73()
+ inline bool jj_3R_81()
  {
     if (jj_done) return true;
-    if (jj_3R_110()) return true;
+    if (jj_scan_token(RANGE_T)) return true;
+    if (jj_3R_83()) return true;
     return false;
   }
 
- inline bool jj_3R_697()
+ inline bool jj_3R_698()
  {
     if (jj_done) return true;
     if (jj_3R_62()) return true;
     return false;
   }
 
- inline bool jj_3R_689()
+ inline bool jj_3R_690()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_697()) {
+    if (jj_3R_698()) {
     jj_scanpos = xsp;
-    if (jj_3R_698()) return true;
+    if (jj_3R_699()) return true;
     }
     return false;
   }
 
- inline bool jj_3R_81()
- {
-    if (jj_done) return true;
-    if (jj_scan_token(RANGE_T)) return true;
-    if (jj_3R_83()) return true;
-    return false;
-  }
-
- inline bool jj_3_71()
+ inline bool jj_3_72()
  {
     if (jj_done) return true;
     if (jj_3R_108()) return true;
@@ -7325,7 +7333,7 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_227()
+ inline bool jj_3R_228()
  {
     if (jj_done) return true;
     if (jj_scan_token(LPAREN_T)) return true;
@@ -7334,17 +7342,17 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_226()
+ inline bool jj_3R_227()
  {
     if (jj_done) return true;
     if (jj_3R_108()) return true;
     return false;
   }
 
- inline bool jj_3R_465()
+ inline bool jj_3R_466()
  {
     if (jj_done) return true;
-    if (jj_3R_233()) return true;
+    if (jj_3R_234()) return true;
     return false;
   }
 
@@ -7355,14 +7363,14 @@ void parseInline();
     if (jj_scan_token(APOSTROPHE_T)) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_226()) {
+    if (jj_3R_227()) {
     jj_scanpos = xsp;
-    if (jj_3R_227()) return true;
+    if (jj_3R_228()) return true;
     }
     return false;
   }
 
- inline bool jj_3R_341()
+ inline bool jj_3R_342()
  {
     if (jj_done) return true;
     if (jj_3R_112()) return true;
@@ -7375,7 +7383,7 @@ void parseInline();
     Token * xsp;
     while (true) {
       xsp = jj_scanpos;
-      if (jj_3R_341()) { jj_scanpos = xsp; break; }
+      if (jj_3R_342()) { jj_scanpos = xsp; break; }
     }
     return false;
   }
@@ -7387,22 +7395,22 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_236()
+ inline bool jj_3R_340()
  {
     if (jj_done) return true;
-    if (jj_scan_token(COMMA_T)) return true;
-    if (jj_3R_235()) return true;
+    if (jj_3R_422()) return true;
     return false;
   }
 
- inline bool jj_3R_339()
+ inline bool jj_3R_237()
  {
     if (jj_done) return true;
-    if (jj_3R_421()) return true;
+    if (jj_scan_token(COMMA_T)) return true;
+    if (jj_3R_236()) return true;
     return false;
   }
 
- inline bool jj_3R_575()
+ inline bool jj_3R_576()
  {
     if (jj_done) return true;
     if (jj_scan_token(NEW_T)) return true;
@@ -7410,14 +7418,14 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_530()
+ inline bool jj_3R_531()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
     if (jj_3_4()) {
     jj_scanpos = xsp;
-    if (jj_3R_575()) return true;
+    if (jj_3R_576()) return true;
     }
     return false;
   }
@@ -7430,37 +7438,37 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_536()
+ inline bool jj_3R_537()
  {
     if (jj_done) return true;
-    if (jj_3R_309()) return true;
+    if (jj_3R_310()) return true;
     return false;
   }
 
- inline bool jj_3R_535()
+ inline bool jj_3R_536()
  {
     if (jj_done) return true;
     if (jj_scan_token(CHARACTER_LITERAL)) return true;
     return false;
   }
 
- inline bool jj_3R_534()
+ inline bool jj_3R_535()
  {
     if (jj_done) return true;
     if (jj_3R_69()) return true;
     return false;
   }
 
- inline bool jj_3R_463()
+ inline bool jj_3R_464()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_534()) {
-    jj_scanpos = xsp;
     if (jj_3R_535()) {
     jj_scanpos = xsp;
-    if (jj_3R_536()) return true;
+    if (jj_3R_536()) {
+    jj_scanpos = xsp;
+    if (jj_3R_537()) return true;
     }
     }
     return false;
@@ -7474,13 +7482,13 @@ void parseInline();
     xsp = jj_scanpos;
     if (jj_scan_token(15)) {
     jj_scanpos = xsp;
-    if (jj_3R_339()) return true;
+    if (jj_3R_340()) return true;
     }
     if (jj_scan_token(RPAREN_T)) return true;
     return false;
   }
 
- inline bool jj_3R_464()
+ inline bool jj_3R_465()
  {
     if (jj_done) return true;
     if (jj_scan_token(COLON_T)) return true;
@@ -7488,36 +7496,22 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_376()
+ inline bool jj_3R_377()
  {
     if (jj_done) return true;
     if (jj_scan_token(ALIAS_T)) return true;
-    if (jj_3R_463()) return true;
+    if (jj_3R_464()) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_464()) jj_scanpos = xsp;
+    if (jj_3R_465()) jj_scanpos = xsp;
     if (jj_scan_token(IS_T)) return true;
     if (jj_3R_59()) return true;
     xsp = jj_scanpos;
-    if (jj_3R_465()) jj_scanpos = xsp;
+    if (jj_3R_466()) jj_scanpos = xsp;
     if (jj_scan_token(SEMI_T)) return true;
     return false;
   }
 
- inline bool jj_3R_108()
- {
-    if (jj_done) return true;
-    if (jj_scan_token(LPAREN_T)) return true;
-    if (jj_3R_235()) return true;
-    Token * xsp;
-    while (true) {
-      xsp = jj_scanpos;
-      if (jj_3R_236()) { jj_scanpos = xsp; break; }
-    }
-    if (jj_scan_token(RPAREN_T)) return true;
-    return false;
-  }
-
  inline bool jj_3R_188()
  {
     if (jj_done) return true;
@@ -7526,17 +7520,17 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_272()
- {
-    if (jj_done) return true;
-    if (jj_scan_token(MINUS_T)) return true;
-    return false;
-  }
-
- inline bool jj_3R_273()
+ inline bool jj_3R_108()
  {
     if (jj_done) return true;
-    if (jj_scan_token(AMPERSAND_T)) return true;
+    if (jj_scan_token(LPAREN_T)) return true;
+    if (jj_3R_236()) return true;
+    Token * xsp;
+    while (true) {
+      xsp = jj_scanpos;
+      if (jj_3R_237()) { jj_scanpos = xsp; break; }
+    }
+    if (jj_scan_token(RPAREN_T)) return true;
     return false;
   }
 
@@ -7566,32 +7560,24 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_340()
+ inline bool jj_3R_341()
  {
     if (jj_done) return true;
-    if (jj_3R_422()) return true;
+    if (jj_3R_423()) return true;
     return false;
   }
 
- inline bool jj_3R_128()
+ inline bool jj_3R_273()
  {
     if (jj_done) return true;
-    Token * xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_271()) {
-    jj_scanpos = xsp;
-    if (jj_3R_272()) {
-    jj_scanpos = xsp;
-    if (jj_3R_273()) return true;
-    }
-    }
+    if (jj_scan_token(MINUS_T)) return true;
     return false;
   }
 
- inline bool jj_3R_271()
+ inline bool jj_3R_274()
  {
     if (jj_done) return true;
-    if (jj_scan_token(PLUS_T)) return true;
+    if (jj_scan_token(AMPERSAND_T)) return true;
     return false;
   }
 
@@ -7601,92 +7587,99 @@ void parseInline();
     Token * xsp;
     while (true) {
       xsp = jj_scanpos;
-      if (jj_3R_340()) { jj_scanpos = xsp; break; }
+      if (jj_3R_341()) { jj_scanpos = xsp; break; }
     }
     return false;
   }
 
- inline bool jj_3_3()
+ inline bool jj_3R_128()
  {
     if (jj_done) return true;
-    if (jj_3R_60()) return true;
+    Token * xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_272()) {
+    jj_scanpos = xsp;
+    if (jj_3R_273()) {
+    jj_scanpos = xsp;
+    if (jj_3R_274()) return true;
+    }
+    }
     return false;
   }
 
- inline bool jj_3R_518()
+ inline bool jj_3R_272()
  {
     if (jj_done) return true;
-    if (jj_3R_382()) return true;
+    if (jj_scan_token(PLUS_T)) return true;
     return false;
   }
 
- inline bool jj_3R_491()
+ inline bool jj_3R_519()
  {
     if (jj_done) return true;
-    if (jj_scan_token(BOX_T)) return true;
+    if (jj_3R_383()) return true;
     return false;
   }
 
- inline bool jj_3R_492()
+ inline bool jj_3_3()
  {
     if (jj_done) return true;
-    if (jj_3R_59()) return true;
-    if (jj_scan_token(LPAREN_T)) return true;
     if (jj_3R_60()) return true;
-    if (jj_scan_token(RPAREN_T)) return true;
     return false;
   }
 
- inline bool jj_3_70()
+ inline bool jj_3R_518()
  {
     if (jj_done) return true;
-    if (jj_3R_65()) return true;
+    if (jj_3R_382()) return true;
     return false;
   }
 
- inline bool jj_3R_517()
+ inline bool jj_3_71()
  {
     if (jj_done) return true;
-    if (jj_3R_381()) return true;
+    if (jj_3R_65()) return true;
     return false;
   }
 
- inline bool jj_3R_516()
+ inline bool jj_3R_517()
  {
     if (jj_done) return true;
-    if (jj_3R_378()) return true;
+    if (jj_3R_379()) return true;
     return false;
   }
 
- inline bool jj_3R_403()
+ inline bool jj_3R_492()
  {
     if (jj_done) return true;
-    Token * xsp;
-    xsp = jj_scanpos;
-    if (jj_3R_490()) {
-    jj_scanpos = xsp;
-    if (jj_3R_491()) {
-    jj_scanpos = xsp;
-    if (jj_3R_492()) return true;
-    }
-    }
+    if (jj_scan_token(BOX_T)) return true;
     return false;
   }
 
- inline bool jj_3R_490()
+ inline bool jj_3R_493()
  {
     if (jj_done) return true;
+    if (jj_3R_59()) return true;
+    if (jj_scan_token(LPAREN_T)) return true;
     if (jj_3R_60()) return true;
+    if (jj_scan_token(RPAREN_T)) return true;
     return false;
   }
 
- inline bool jj_3_69()
+ inline bool jj_3_70()
  {
     if (jj_done) return true;
     if (jj_3R_64()) return true;
     return false;
   }
 
+ inline bool jj_3R_516()
+ {
+    if (jj_done) return true;
+    if (jj_3R_377()) return true;
+    return false;
+  }
+
  inline bool jj_3R_515()
  {
     if (jj_done) return true;
@@ -7694,10 +7687,25 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3_2()
+ inline bool jj_3R_404()
  {
     if (jj_done) return true;
-    if (jj_3R_59()) return true;
+    Token * xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_491()) {
+    jj_scanpos = xsp;
+    if (jj_3R_492()) {
+    jj_scanpos = xsp;
+    if (jj_3R_493()) return true;
+    }
+    }
+    return false;
+  }
+
+ inline bool jj_3R_491()
+ {
+    if (jj_done) return true;
+    if (jj_3R_60()) return true;
     return false;
   }
 
@@ -7711,14 +7719,14 @@ void parseInline();
  inline bool jj_3R_513()
  {
     if (jj_done) return true;
-    if (jj_3R_374()) return true;
+    if (jj_3R_373()) return true;
     return false;
   }
 
- inline bool jj_3R_225()
+ inline bool jj_3_2()
  {
     if (jj_done) return true;
-    if (jj_3R_165()) return true;
+    if (jj_3R_59()) return true;
     return false;
   }
 
@@ -7736,10 +7744,10 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_510()
+ inline bool jj_3R_226()
  {
     if (jj_done) return true;
-    if (jj_3R_370()) return true;
+    if (jj_3R_165()) return true;
     return false;
   }
 
@@ -7750,13 +7758,11 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_422()
+ inline bool jj_3R_423()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_509()) {
-    jj_scanpos = xsp;
     if (jj_3R_510()) {
     jj_scanpos = xsp;
     if (jj_3R_511()) {
@@ -7769,15 +7775,17 @@ void parseInline();
     jj_scanpos = xsp;
     if (jj_3R_515()) {
     jj_scanpos = xsp;
-    if (jj_3_69()) {
-    jj_scanpos = xsp;
     if (jj_3R_516()) {
     jj_scanpos = xsp;
+    if (jj_3_70()) {
+    jj_scanpos = xsp;
     if (jj_3R_517()) {
     jj_scanpos = xsp;
-    if (jj_3_70()) {
+    if (jj_3R_518()) {
+    jj_scanpos = xsp;
+    if (jj_3_71()) {
     jj_scanpos = xsp;
-    if (jj_3R_518()) return true;
+    if (jj_3R_519()) return true;
     }
     }
     }
@@ -7792,18 +7800,18 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_509()
+ inline bool jj_3R_510()
  {
     if (jj_done) return true;
     if (jj_3R_92()) return true;
     return false;
   }
 
- inline bool jj_3R_329()
+ inline bool jj_3R_330()
  {
     if (jj_done) return true;
     if (jj_scan_token(LPAREN_T)) return true;
-    if (jj_3R_225()) return true;
+    if (jj_3R_226()) return true;
     if (jj_scan_token(RPAREN_T)) return true;
     return false;
   }
@@ -7815,14 +7823,7 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_152()
- {
-    if (jj_done) return true;
-    if (jj_3R_58()) return true;
-    return false;
-  }
-
- inline bool jj_3_68()
+ inline bool jj_3_69()
  {
     if (jj_done) return true;
     if (jj_3R_69()) return true;
@@ -7835,12 +7836,19 @@ void parseInline();
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3_68()) jj_scanpos = xsp;
+    if (jj_3_69()) jj_scanpos = xsp;
     if (jj_3R_176()) return true;
     if (jj_scan_token(SEMI_T)) return true;
     return false;
   }
 
+ inline bool jj_3R_152()
+ {
+    if (jj_done) return true;
+    if (jj_3R_58()) return true;
+    return false;
+  }
+
  inline bool jj_3R_151()
  {
     if (jj_done) return true;
@@ -7863,53 +7871,60 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_655()
- {
-    if (jj_done) return true;
-    if (jj_scan_token(ACCESS_T)) return true;
-    if (jj_3R_84()) return true;
-    return false;
-  }
-
  inline bool jj_3R_176()
  {
     if (jj_done) return true;
     if (jj_3R_59()) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_329()) jj_scanpos = xsp;
+    if (jj_3R_330()) jj_scanpos = xsp;
     return false;
   }
 
- inline bool jj_3_66()
+ inline bool jj_3_67()
  {
     if (jj_done) return true;
     if (jj_3R_86()) return true;
     return false;
   }
 
- inline bool jj_3R_224()
+ inline bool jj_3R_656()
+ {
+    if (jj_done) return true;
+    if (jj_scan_token(ACCESS_T)) return true;
+    if (jj_3R_84()) return true;
+    return false;
+  }
+
+ inline bool jj_3R_204()
+ {
+    if (jj_done) return true;
+    if (jj_3R_351()) return true;
+    return false;
+  }
+
+ inline bool jj_3R_225()
  {
     if (jj_done) return true;
     if (jj_scan_token(BASED_LITERAL)) return true;
     return false;
   }
 
- inline bool jj_3R_204()
+ inline bool jj_3R_224()
  {
     if (jj_done) return true;
-    if (jj_3R_350()) return true;
+    if (jj_scan_token(INTEGER)) return true;
     return false;
   }
 
- inline bool jj_3R_223()
+ inline bool jj_3_68()
  {
     if (jj_done) return true;
-    if (jj_scan_token(INTEGER)) return true;
+    if (jj_3R_107()) return true;
     return false;
   }
 
- inline bool jj_3R_222()
+ inline bool jj_3R_223()
  {
     if (jj_done) return true;
     if (jj_scan_token(DECIMAL_LITERAL)) return true;
@@ -7921,23 +7936,16 @@ void parseInline();
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_222()) {
-    jj_scanpos = xsp;
     if (jj_3R_223()) {
     jj_scanpos = xsp;
-    if (jj_3R_224()) return true;
+    if (jj_3R_224()) {
+    jj_scanpos = xsp;
+    if (jj_3R_225()) return true;
     }
     }
     return false;
   }
 
- inline bool jj_3_67()
- {
-    if (jj_done) return true;
-    if (jj_3R_107()) return true;
-    return false;
-  }
-
  inline bool jj_3R_203()
  {
     if (jj_done) return true;
@@ -7948,14 +7956,14 @@ void parseInline();
  inline bool jj_3R_202()
  {
     if (jj_done) return true;
-    if (jj_3R_349()) return true;
+    if (jj_3R_350()) return true;
     return false;
   }
 
  inline bool jj_3R_201()
  {
     if (jj_done) return true;
-    if (jj_3R_348()) return true;
+    if (jj_3R_349()) return true;
     return false;
   }
 
@@ -7970,7 +7978,7 @@ void parseInline();
     jj_scanpos = xsp;
     if (jj_3R_203()) {
     jj_scanpos = xsp;
-    if (jj_3_67()) {
+    if (jj_3_68()) {
     jj_scanpos = xsp;
     if (jj_3R_204()) return true;
     }
@@ -7980,56 +7988,56 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3_65()
+ inline bool jj_3_66()
  {
     if (jj_done) return true;
     if (jj_3R_59()) return true;
     return false;
   }
 
- inline bool jj_3_64()
+ inline bool jj_3_65()
  {
     if (jj_done) return true;
     if (jj_3R_106()) return true;
     return false;
   }
 
- inline bool jj_3R_456()
+ inline bool jj_3R_457()
  {
     if (jj_done) return true;
     if (jj_3R_108()) return true;
     return false;
   }
 
- inline bool jj_3_63()
+ inline bool jj_3_64()
  {
     if (jj_done) return true;
     if (jj_3R_105()) return true;
     return false;
   }
 
- inline bool jj_3R_455()
+ inline bool jj_3R_456()
  {
     if (jj_done) return true;
-    if (jj_3R_530()) return true;
+    if (jj_3R_531()) return true;
     return false;
   }
 
- inline bool jj_3_62()
+ inline bool jj_3_63()
  {
     if (jj_done) return true;
     if (jj_3R_61()) return true;
     return false;
   }
 
- inline bool jj_3R_454()
+ inline bool jj_3R_455()
  {
     if (jj_done) return true;
     if (jj_3R_59()) return true;
     return false;
   }
 
- inline bool jj_3_61()
+ inline bool jj_3_62()
  {
     if (jj_done) return true;
     if (jj_scan_token(LPAREN_T)) return true;
@@ -8038,42 +8046,42 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_453()
+ inline bool jj_3R_454()
  {
     if (jj_done) return true;
     if (jj_3R_106()) return true;
     return false;
   }
 
- inline bool jj_3_60()
+ inline bool jj_3_61()
  {
     if (jj_done) return true;
     if (jj_3R_104()) return true;
     return false;
   }
 
- inline bool jj_3R_241()
+ inline bool jj_3R_242()
  {
     if (jj_done) return true;
     if (jj_3R_59()) return true;
     return false;
   }
 
- inline bool jj_3R_452()
+ inline bool jj_3R_453()
  {
     if (jj_done) return true;
     if (jj_3R_105()) return true;
     return false;
   }
 
- inline bool jj_3R_451()
+ inline bool jj_3R_452()
  {
     if (jj_done) return true;
     if (jj_3R_61()) return true;
     return false;
   }
 
- inline bool jj_3R_450()
+ inline bool jj_3R_451()
  {
     if (jj_done) return true;
     if (jj_scan_token(LPAREN_T)) return true;
@@ -8082,13 +8090,11 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_369()
+ inline bool jj_3R_370()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_449()) {
-    jj_scanpos = xsp;
     if (jj_3R_450()) {
     jj_scanpos = xsp;
     if (jj_3R_451()) {
@@ -8101,7 +8107,9 @@ void parseInline();
     jj_scanpos = xsp;
     if (jj_3R_455()) {
     jj_scanpos = xsp;
-    if (jj_3R_456()) return true;
+    if (jj_3R_456()) {
+    jj_scanpos = xsp;
+    if (jj_3R_457()) return true;
     }
     }
     }
@@ -8112,14 +8120,14 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_449()
+ inline bool jj_3R_450()
  {
     if (jj_done) return true;
     if (jj_3R_104()) return true;
     return false;
   }
 
- inline bool jj_3R_328()
+ inline bool jj_3R_329()
  {
     if (jj_done) return true;
     if (jj_scan_token(PORT_T)) return true;
@@ -8130,26 +8138,26 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_581()
+ inline bool jj_3R_582()
  {
     if (jj_done) return true;
-    if (jj_3R_312()) return true;
+    if (jj_3R_313()) return true;
     return false;
   }
 
- inline bool jj_3R_240()
+ inline bool jj_3R_241()
  {
     if (jj_done) return true;
-    if (jj_3R_359()) return true;
+    if (jj_3R_360()) return true;
     return false;
   }
 
- inline bool jj_3R_537()
+ inline bool jj_3R_538()
  {
     if (jj_done) return true;
     if (jj_scan_token(PORT_T)) return true;
     if (jj_scan_token(LPAREN_T)) return true;
-    if (jj_3R_581()) return true;
+    if (jj_3R_582()) return true;
     if (jj_scan_token(RPAREN_T)) return true;
     if (jj_scan_token(SEMI_T)) return true;
     return false;
@@ -8164,23 +8172,23 @@ void parseInline();
     Token * xsp;
     while (true) {
       xsp = jj_scanpos;
-      if (jj_3R_240()) { jj_scanpos = xsp; break; }
+      if (jj_3R_241()) { jj_scanpos = xsp; break; }
     }
     if (jj_scan_token(END_T)) return true;
     if (jj_scan_token(UNITS_T)) return true;
     xsp = jj_scanpos;
-    if (jj_3R_241()) jj_scanpos = xsp;
+    if (jj_3R_242()) jj_scanpos = xsp;
     return false;
   }
 
- inline bool jj_3_59()
+ inline bool jj_3_60()
  {
     if (jj_done) return true;
     if (jj_3R_103()) return true;
     return false;
   }
 
- inline bool jj_3R_221()
+ inline bool jj_3R_222()
  {
     if (jj_done) return true;
     if (jj_3R_103()) return true;
@@ -8192,12 +8200,12 @@ void parseInline();
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_221()) jj_scanpos = xsp;
+    if (jj_3R_222()) jj_scanpos = xsp;
     if (jj_3R_59()) return true;
     return false;
   }
 
- inline bool jj_3R_407()
+ inline bool jj_3R_408()
  {
     if (jj_done) return true;
     if (jj_3R_69()) return true;
@@ -8206,28 +8214,28 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3_58()
+ inline bool jj_3_59()
  {
     if (jj_done) return true;
     if (jj_3R_86()) return true;
     return false;
   }
 
- inline bool jj_3_56()
+ inline bool jj_3_57()
  {
     if (jj_done) return true;
     if (jj_3R_64()) return true;
     return false;
   }
 
- inline bool jj_3_57()
+ inline bool jj_3_58()
  {
     if (jj_done) return true;
     if (jj_3R_65()) return true;
     return false;
   }
 
- inline bool jj_3R_350()
+ inline bool jj_3R_351()
  {
     if (jj_done) return true;
     if (jj_scan_token(PACKAGE_T)) return true;
@@ -8235,21 +8243,21 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3_55()
+ inline bool jj_3_56()
  {
     if (jj_done) return true;
     if (jj_3R_65()) return true;
     return false;
   }
 
- inline bool jj_3R_316()
+ inline bool jj_3R_317()
  {
     if (jj_done) return true;
-    if (jj_3R_404()) return true;
+    if (jj_3R_405()) return true;
     return false;
   }
 
- inline bool jj_3R_260()
+ inline bool jj_3R_261()
  {
     if (jj_done) return true;
     if (jj_3R_69()) return true;
@@ -8263,32 +8271,32 @@ void parseInline();
     xsp = jj_scanpos;
     if (jj_scan_token(50)) jj_scanpos = xsp;
     xsp = jj_scanpos;
-    if (jj_3R_316()) jj_scanpos = xsp;
+    if (jj_3R_317()) jj_scanpos = xsp;
     return false;
   }
 
- inline bool jj_3R_309()
+ inline bool jj_3R_310()
  {
     if (jj_done) return true;
     if (jj_scan_token(STRINGLITERAL)) return true;
     return false;
   }
 
- inline bool jj_3R_646()
+ inline bool jj_3R_647()
  {
     if (jj_done) return true;
     if (jj_scan_token(TYPE_T)) return true;
     return false;
   }
 
- inline bool jj_3R_645()
+ inline bool jj_3R_646()
  {
     if (jj_done) return true;
     if (jj_scan_token(FILE_T)) return true;
     return false;
   }
 
- inline bool jj_3R_644()
+ inline bool jj_3R_645()
  {
     if (jj_done) return true;
     if (jj_scan_token(SHARED_T)) return true;
@@ -8296,41 +8304,39 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3_54()
+ inline bool jj_3_55()
  {
     if (jj_done) return true;
     if (jj_3R_102()) return true;
     return false;
   }
 
- inline bool jj_3R_643()
+ inline bool jj_3R_644()
  {
     if (jj_done) return true;
     if (jj_scan_token(VARIABLE_T)) return true;
     return false;
   }
 
- inline bool jj_3R_642()
+ inline bool jj_3R_643()
  {
     if (jj_done) return true;
     if (jj_scan_token(SIGNAL_T)) return true;
     return false;
   }
 
- inline bool jj_3R_641()
+ inline bool jj_3R_642()
  {
     if (jj_done) return true;
     if (jj_scan_token(CONSTANT_T)) return true;
     return false;
   }
 
- inline bool jj_3R_612()
+ inline bool jj_3R_613()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_641()) {
-    jj_scanpos = xsp;
     if (jj_3R_642()) {
     jj_scanpos = xsp;
     if (jj_3R_643()) {
@@ -8339,7 +8345,9 @@ void parseInline();
     jj_scanpos = xsp;
     if (jj_3R_645()) {
     jj_scanpos = xsp;
-    if (jj_3R_646()) return true;
+    if (jj_3R_646()) {
+    jj_scanpos = xsp;
+    if (jj_3R_647()) return true;
     }
     }
     }
@@ -8348,7 +8356,7 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_352()
+ inline bool jj_3R_353()
  {
     if (jj_done) return true;
     if (jj_scan_token(COMMA_T)) return true;
@@ -8382,7 +8390,7 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_440()
+ inline bool jj_3R_441()
  {
     if (jj_done) return true;
     if (jj_3R_69()) return true;
@@ -8390,12 +8398,12 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_362()
+ inline bool jj_3R_363()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_440()) jj_scanpos = xsp;
+    if (jj_3R_441()) jj_scanpos = xsp;
     if (jj_scan_token(NULL_T)) return true;
     if (jj_scan_token(SEMI_T)) return true;
     return false;
@@ -8409,7 +8417,7 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_261()
+ inline bool jj_3R_262()
  {
     if (jj_done) return true;
     if (jj_scan_token(WHEN_T)) return true;
@@ -8417,14 +8425,14 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3_53()
+ inline bool jj_3_54()
  {
     if (jj_done) return true;
     if (jj_scan_token(LBRACKET_T)) return true;
     return false;
   }
 
- inline bool jj_3R_259()
+ inline bool jj_3R_260()
  {
     if (jj_done) return true;
     if (jj_3R_69()) return true;
@@ -8437,17 +8445,17 @@ void parseInline();
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_259()) jj_scanpos = xsp;
-    if (jj_scan_token(NEXT_T)) return true;
-    xsp = jj_scanpos;
     if (jj_3R_260()) jj_scanpos = xsp;
+    if (jj_scan_token(NEXT_T)) return true;
     xsp = jj_scanpos;
     if (jj_3R_261()) jj_scanpos = xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_262()) jj_scanpos = xsp;
     if (jj_scan_token(SEMI_T)) return true;
     return false;
   }
 
- inline bool jj_3R_220()
+ inline bool jj_3R_221()
  {
     if (jj_done) return true;
     if (jj_scan_token(LPAREN_T)) return true;
@@ -8456,14 +8464,14 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_218()
+ inline bool jj_3R_219()
  {
     if (jj_done) return true;
-    if (jj_3R_233()) return true;
+    if (jj_3R_234()) return true;
     return false;
   }
 
- inline bool jj_3_52()
+ inline bool jj_3_53()
  {
     if (jj_done) return true;
     if (jj_scan_token(LPAREN_T)) return true;
@@ -8482,38 +8490,38 @@ void parseInline();
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_218()) jj_scanpos = xsp;
+    if (jj_3R_219()) jj_scanpos = xsp;
     if (jj_scan_token(APOSTROPHE_T)) return true;
-    if (jj_3R_219()) return true;
+    if (jj_3R_220()) return true;
     xsp = jj_scanpos;
-    if (jj_3R_220()) jj_scanpos = xsp;
+    if (jj_3R_221()) jj_scanpos = xsp;
     return false;
   }
 
- inline bool jj_3_48()
+ inline bool jj_3_52()
  {
     if (jj_done) return true;
-    if (jj_3R_98()) return true;
+    if (jj_scan_token(LPAREN_T)) return true;
+    if (jj_3R_67()) return true;
+    if (jj_scan_token(RPAREN_T)) return true;
     return false;
   }
 
- inline bool jj_3_51()
+ inline bool jj_3_48()
  {
     if (jj_done) return true;
-    if (jj_scan_token(LPAREN_T)) return true;
-    if (jj_3R_67()) return true;
-    if (jj_scan_token(RPAREN_T)) return true;
+    if (jj_3R_98()) return true;
     return false;
   }
 
- inline bool jj_3_50()
+ inline bool jj_3_51()
  {
     if (jj_done) return true;
     if (jj_3R_100()) return true;
     return false;
   }
 
- inline bool jj_3R_213()
+ inline bool jj_3R_214()
  {
     if (jj_done) return true;
     if (jj_scan_token(LPAREN_T)) return true;
@@ -8521,13 +8529,13 @@ void parseInline();
     Token * xsp;
     while (true) {
       xsp = jj_scanpos;
-      if (jj_3R_352()) { jj_scanpos = xsp; break; }
+      if (jj_3R_353()) { jj_scanpos = xsp; break; }
     }
     if (jj_scan_token(RPAREN_T)) return true;
     return false;
   }
 
- inline bool jj_3_49()
+ inline bool jj_3_50()
  {
     if (jj_done) return true;
     if (jj_scan_token(DOT_T)) return true;
@@ -8535,14 +8543,15 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_209()
+ inline bool jj_3_49()
  {
     if (jj_done) return true;
-    if (jj_3R_98()) return true;
+    if (jj_scan_token(APOSTROPHE_T)) return true;
+    if (jj_scan_token(SUBTYPE_T)) return true;
     return false;
   }
 
- inline bool jj_3R_212()
+ inline bool jj_3R_213()
  {
     if (jj_done) return true;
     if (jj_scan_token(LPAREN_T)) return true;
@@ -8551,21 +8560,28 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_149()
+ inline bool jj_3R_209()
  {
     if (jj_done) return true;
-    if (jj_3R_310()) return true;
+    if (jj_3R_98()) return true;
     return false;
   }
 
- inline bool jj_3R_211()
+ inline bool jj_3R_212()
  {
     if (jj_done) return true;
     if (jj_3R_100()) return true;
     return false;
   }
 
- inline bool jj_3R_210()
+ inline bool jj_3R_149()
+ {
+    if (jj_done) return true;
+    if (jj_3R_311()) return true;
+    return false;
+  }
+
+ inline bool jj_3R_211()
  {
     if (jj_done) return true;
     if (jj_scan_token(DOT_T)) return true;
@@ -8573,6 +8589,14 @@ void parseInline();
     return false;
   }
 
+ inline bool jj_3R_210()
+ {
+    if (jj_done) return true;
+    if (jj_scan_token(APOSTROPHE_T)) return true;
+    if (jj_scan_token(SUBTYPE_T)) return true;
+    return false;
+  }
+
  inline bool jj_3R_98()
  {
     if (jj_done) return true;
@@ -8584,7 +8608,10 @@ void parseInline();
     jj_scanpos = xsp;
     if (jj_3R_212()) {
     jj_scanpos = xsp;
-    if (jj_3R_213()) return true;
+    if (jj_3R_213()) {
+    jj_scanpos = xsp;
+    if (jj_3R_214()) return true;
+    }
     }
     }
     }
@@ -8627,7 +8654,7 @@ void parseInline();
  inline bool jj_3R_147()
  {
     if (jj_done) return true;
-    if (jj_3R_309()) return true;
+    if (jj_3R_310()) return true;
     return false;
   }
 
@@ -8648,21 +8675,21 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_280()
+ inline bool jj_3R_281()
  {
     if (jj_done) return true;
     if (jj_scan_token(REM_T)) return true;
     return false;
   }
 
- inline bool jj_3R_279()
+ inline bool jj_3R_280()
  {
     if (jj_done) return true;
     if (jj_scan_token(MOD_T)) return true;
     return false;
   }
 
- inline bool jj_3R_278()
+ inline bool jj_3R_279()
  {
     if (jj_done) return true;
     if (jj_scan_token(SLASH_T)) return true;
@@ -8674,75 +8701,75 @@ void parseInline();
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_277()) {
-    jj_scanpos = xsp;
     if (jj_3R_278()) {
     jj_scanpos = xsp;
     if (jj_3R_279()) {
     jj_scanpos = xsp;
-    if (jj_3R_280()) return true;
+    if (jj_3R_280()) {
+    jj_scanpos = xsp;
+    if (jj_3R_281()) return true;
     }
     }
     }
     return false;
   }
 
- inline bool jj_3R_277()
+ inline bool jj_3R_278()
  {
     if (jj_done) return true;
     if (jj_scan_token(MULT_T)) return true;
     return false;
   }
 
- inline bool jj_3R_628()
+ inline bool jj_3R_629()
  {
     if (jj_done) return true;
     if (jj_3R_69()) return true;
     return false;
   }
 
- inline bool jj_3R_430()
+ inline bool jj_3R_431()
  {
     if (jj_done) return true;
     if (jj_scan_token(LINKAGE_T)) return true;
     return false;
   }
 
- inline bool jj_3R_429()
+ inline bool jj_3R_430()
  {
     if (jj_done) return true;
     if (jj_scan_token(BUFFER_T)) return true;
     return false;
   }
 
- inline bool jj_3R_428()
+ inline bool jj_3R_429()
  {
     if (jj_done) return true;
     if (jj_scan_token(INOUT_T)) return true;
     return false;
   }
 
- inline bool jj_3R_427()
+ inline bool jj_3R_428()
  {
     if (jj_done) return true;
     if (jj_scan_token(OUT_T)) return true;
     return false;
   }
 
- inline bool jj_3R_345()
+ inline bool jj_3R_346()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_426()) {
-    jj_scanpos = xsp;
     if (jj_3R_427()) {
     jj_scanpos = xsp;
     if (jj_3R_428()) {
     jj_scanpos = xsp;
     if (jj_3R_429()) {
     jj_scanpos = xsp;
-    if (jj_3R_430()) return true;
+    if (jj_3R_430()) {
+    jj_scanpos = xsp;
+    if (jj_3R_431()) return true;
     }
     }
     }
@@ -8750,21 +8777,21 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_426()
+ inline bool jj_3R_427()
  {
     if (jj_done) return true;
     if (jj_scan_token(IN_T)) return true;
     return false;
   }
 
- inline bool jj_3R_257()
+ inline bool jj_3R_258()
  {
     if (jj_done) return true;
-    if (jj_3R_366()) return true;
+    if (jj_3R_367()) return true;
     return false;
   }
 
- inline bool jj_3R_256()
+ inline bool jj_3R_257()
  {
     if (jj_done) return true;
     if (jj_3R_69()) return true;
@@ -8777,15 +8804,15 @@ void parseInline();
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_256()) jj_scanpos = xsp;
-    xsp = jj_scanpos;
     if (jj_3R_257()) jj_scanpos = xsp;
+    xsp = jj_scanpos;
+    if (jj_3R_258()) jj_scanpos = xsp;
     if (jj_scan_token(LOOP_T)) return true;
-    if (jj_3R_258()) return true;
+    if (jj_3R_259()) return true;
     if (jj_scan_token(END_T)) return true;
     if (jj_scan_token(LOOP_T)) return true;
     xsp = jj_scanpos;
-    if (jj_3R_628()) jj_scanpos = xsp;
+    if (jj_3R_629()) jj_scanpos = xsp;
     if (jj_scan_token(SEMI_T)) return true;
     return false;
   }
@@ -8804,7 +8831,7 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_232()
+ inline bool jj_3R_233()
  {
     if (jj_done) return true;
     if (jj_scan_token(NULL_T)) return true;
@@ -8818,48 +8845,41 @@ void parseInline();
     return false;
   }
 
- inline bool jj_3R_231()
+ inline bool jj_3R_232()
  {
     if (jj_done) return true;
-    if (jj_3R_355()) return true;
+    if (jj_3R_356()) return true;
     return false;
   }
 
- inline bool jj_3R_230()
+ inline bool jj_3R_231()
  {
     if (jj_done) return true;
     if (jj_3R_96()) return true;
     return false;
   }
 
- inline bool jj_3R_229()
+ inline bool jj_3R_230()
  {
     if (jj_done) return true;
     if (jj_3R_95()) return true;
     return false;
   }
 
- inline bool jj_3R_228()
- {
-    if (jj_done) return true;
-    if (jj_3R_94()) return true;
-    return false;
-  }
-
  inline bool jj_3R_106()
  {
     if (jj_done) return true;
     Token * xsp;
     xsp = jj_scanpos;
-    if (jj_3R_228()) {
-    jj_scanpos = xsp;
     if (jj_3R_229()) {
     jj_scanpos = xsp;
     if (jj_3R_230()) {
     jj_scanpos = xsp;
     if (jj_3R_231()) {
     jj_scanpos = xsp;
-    if (jj_3R_232()) return true;
+    if (jj_3R_232()) {
+    jj_scanpos = xsp;
+    if (jj_3R_233()) return true;
     }
     }
     }
@@ -8867,39 +8887,53 @@ void parseInline();
     return false;
   }
 
-  public: TokenManager *token_source;
-  public: CharStream *jj_input_stream;
+ inline bool jj_3R_229()
+ {
+    if (jj_done) return true;
+    if (jj_3R_94()) return true;
+    return false;
+  }
+
+
+public: 
+  TokenManager *token_source;
+  CharStream   *jj_input_stream;
   /** Current token. */
-  public: Token *token;
+  Token        *token;
   /** Next token. */
-  public: Token *jj_nt;
-  private: int jj_ntk;
-  private: JJCalls jj_2_rtns[116];
-  private: bool jj_rescan;
-  private: int jj_gc;
-  private: Token *jj_scanpos, *jj_lastpos;
-  private: int jj_la;
+  Token        *jj_nt;
+private: 
+  int           jj_ntk;
+  JJCalls       jj_2_rtns[117];
+  bool          jj_rescan;
+  int           jj_gc;
+  Token        *jj_scanpos, *jj_lastpos;
+  int           jj_la;
   /** Whether we are looking ahead. */
-  private: bool jj_lookingAhead;
-  private: bool jj_semLA;
-  private: int jj_gen;
-  private: int jj_la1[294];
-  private: ErrorHandler *errorHandler;
-  private: bool errorHandlerCreated;
-  protected: bool hasError;
-  public: void setErrorHandler(ErrorHandler *eh) {
+  bool          jj_lookingAhead;
+  bool          jj_semLA;
+  int           jj_gen;
+  int           jj_la1[294];
+  ErrorHandler *errorHandler;
+  bool          errorHandlerCreated;
+protected: 
+  bool          hasError;
+public: 
+  void setErrorHandler(ErrorHandler *eh) {
     if (errorHandlerCreated) delete errorHandler;
     errorHandler = eh;
     errorHandlerCreated = false;
   }
- Token *head; 
- public: 
 Token *head; 
+public: 
 
  VhdlParser(TokenManager *tm);
-   public: virtual ~VhdlParser();
+  virtual ~VhdlParser();
 
 void ReInit(TokenManager *tm);
 
+void clear();
+
 Token * jj_consume_token(int kind);
 
 bool  jj_scan_token(int kind);
@@ -8909,31 +8943,36 @@ Token * getNextToken();
 Token * getToken(int index);
 
 int jj_ntk_f();
- private: int jj_kind;
+private:
+  int jj_kind;
   int **jj_expentries;
   int *jj_expentry;
 
-void jj_add_error_token(int kind, int pos);
+  void jj_add_error_token(int kind, int pos);
+protected:
+  /** Generate ParseException. */
+
+  virtual void  parseError();
+private:
+  int  trace_indent;
+  bool trace_enabled;
 
-protected: virtual void  parseError();
-  private: int trace_indent;
-  private: bool trace_enabled;
-  /** Enable tracing. */
+public:
 
-public: void enable_tracing();
+  void enable_tracing();
 
-public: void disable_tracing();
+  void disable_tracing();
 
-void jj_rescan_token();
+  void jj_rescan_token();
 
-void jj_save(int index, int xla);
+  void jj_save(int index, int xla);
 typedef unsigned long long uint64;
 
 static Entry* current_root;
 static Entry* tempEntry;
 static Entry*  lastEntity  ;
 static Entry*  lastCompound  ;
-static Entry*  current;
+static std::shared_ptr<Entry> current;
 static QCString compSpec;
 static QCString currName;
 static int levelCounter;
@@ -8944,7 +8983,6 @@ static QCString forL;
 static int param_sec ;
 static int parse_sec;
 static int currP;
-static Entry* currentCompound;
 
 //----------------------------------------
 
@@ -8970,8 +9008,10 @@ static  void mapLibPackage( Entry* root);
 static void createFlow();
 static void error_skipto(int kind);
 static void oneLineComment(QCString qcs);
-static void setMultCommentLine();private: bool jj_done;
+static void setMultCommentLine();
 
+private:
+  bool jj_done;
 };
 }
 }
index 8d4b417..882402b 100644 (file)
@@ -430,7 +430,7 @@ const  int DEFAULT = 0;
   static JAVACC_CHAR_TYPE tokenImage_arr_20[] = 
 {0x22, 0x61, 0x73, 0x73, 0x75, 0x6d, 0x65, 0x22, 0};
   static JAVACC_CHAR_TYPE tokenImage_arr_21[] = 
-{0x22, 0x61, 0x73, 0x73, 0x75, 0x6d, 0x65, 0x5f, 0x67, 0x75, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x65, 0x65, 0x22, 0};
+{0x22, 0x61, 0x73, 0x73, 0x75, 0x6d, 0x65, 0x5f, 0x67, 0x75, 0x61, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x65, 0x22, 0};
   static JAVACC_CHAR_TYPE tokenImage_arr_22[] = 
 {0x22, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x22, 0};
   static JAVACC_CHAR_TYPE tokenImage_arr_23[] = 
index 3a6746f..676546b 100644 (file)
@@ -34,8 +34,6 @@ void  VhdlParserIF::parseVhdlfile(const char* inputBuffer,bool inLine)
   //  fprintf(stderr,"\n\nparsed lines: %d\n",yyLineNr);
   //  fprintf(stderr,"\n\nerrors : %d\n\n",myErr->getErrorCount());
   delete myParser;
-  delete myErr;
 }
 
 void VhdlParser::error_skipto(int kind)
index a696fa6..5edbfc5 100644 (file)
@@ -1,5 +1,6 @@
 /* VhdlParserTokenManager.cc */
-#include "./VhdlParserTokenManager.h"
+#include "VhdlParserTokenManager.h"
+#include "TokenMgrError.h"
 namespace vhdl {
 namespace parser {
 static const unsigned long long jjbitVec0[] = {
@@ -12,10 +13,10 @@ static const unsigned long long jjbitVec3[] = {
    0x0ULL, 0x0ULL, 0xffffffff00000000ULL, 0xffffffffffffffffULL
 };
 static const int jjnextStates[] = {
-   54, 55, 56, 57, 58, 61, 65, 66, 67, 76, 21, 48, 49, 2, 37, 38, 
+   58, 59, 60, 61, 62, 65, 69, 70, 71, 80, 21, 50, 51, 2, 37, 38, 
    0, 3, 4, 5, 7, 12, 13, 15, 16, 24, 23, 25, 33, 34, 36, 39, 
-   40, 42, 56, 57, 58, 61, 60, 59, 61, 65, 66, 67, 68, 69, 71, 9, 
-   10, 28, 29, 45, 47, 50, 52, 27, 30, 
+   40, 42, 46, 47, 49, 53, 54, 56, 60, 61, 62, 65, 64, 63, 65, 69, 
+   70, 71, 72, 73, 75, 9, 10, 28, 29, 27, 30, 
 };
 static JAVACC_CHAR_TYPE jjstrLiteralChars_0[] = {0};
 static JAVACC_CHAR_TYPE jjstrLiteralChars_1[] = {0};
@@ -2490,25 +2491,25 @@ void  VhdlParserTokenManager::setDebugStream(FILE *ds){ debugStream = ds; }
    switch(curChar)
    {
       case 65:
-         return jjMoveStringLiteralDfa12_0(active0, 0L, active1, 0x8000000ULL);
+         return jjMoveStringLiteralDfa12_0(active0, 0x200000ULL, active1, 0x8000000ULL);
       case 69:
          if ((active0 & 0x20000ULL) != 0L)
          {
             jjmatchedKind = 17;
             jjmatchedPos = 11;
          }
-         return jjMoveStringLiteralDfa12_0(active0, 0x200000ULL, active1, 0L);
+         break;
       case 79:
          return jjMoveStringLiteralDfa12_0(active0, 0x40000000ULL, active1, 0L);
       case 97:
-         return jjMoveStringLiteralDfa12_0(active0, 0L, active1, 0x8000000ULL);
+         return jjMoveStringLiteralDfa12_0(active0, 0x200000ULL, active1, 0x8000000ULL);
       case 101:
          if ((active0 & 0x20000ULL) != 0L)
          {
             jjmatchedKind = 17;
             jjmatchedPos = 11;
          }
-         return jjMoveStringLiteralDfa12_0(active0, 0x200000ULL, active1, 0L);
+         break;
       case 111:
          return jjMoveStringLiteralDfa12_0(active0, 0x40000000ULL, active1, 0L);
       default :
@@ -2686,7 +2687,7 @@ int VhdlParserTokenManager::jjMoveNfa_0(int startState, int curPos){
    curChar = input_stream->readChar();
    curPos = 0;
    int startsAt = 0;
-   jjnewStateCnt = 77;
+   jjnewStateCnt = 81;
    int i = 1;
    jjstateSet[0] = startState;
    int kind = 0x7fffffff;
@@ -2915,128 +2916,146 @@ int VhdlParserTokenManager::jjMoveNfa_0(int startState, int curPos){
                   break;
                case 44:
                   if (curChar == 33)
-                     { jjCheckNAddTwoStates(45, 47); }
+                     { jjCheckNAddTwoStates(45, 46); }
                   break;
                case 45:
-                  { jjCheckNAddTwoStates(45, 47); }
+                  if ((0xfffffbffffffffffULL & l) != 0L)
+                     { jjCheckNAddTwoStates(45, 46); }
                   break;
                case 46:
-                  if (curChar == 47 && kind > 9)
-                     kind = 9;
+                  if (curChar == 42)
+                     { jjCheckNAddStates(34, 36); }
                   break;
                case 47:
-                  if (curChar == 42)
-                     jjstateSet[jjnewStateCnt++] = 46;
+                  if ((0xffff7bffffffffffULL & l) != 0L)
+                     { jjCheckNAddTwoStates(48, 46); }
                   break;
                case 48:
-                  if (curChar == 42)
-                     jjstateSet[jjnewStateCnt++] = 44;
+                  if ((0xfffffbffffffffffULL & l) != 0L)
+                     { jjCheckNAddTwoStates(48, 46); }
                   break;
                case 49:
-                  if (curChar == 42)
-                     { jjCheckNAddTwoStates(50, 52); }
+                  if (curChar == 47 && kind > 9)
+                     kind = 9;
                   break;
                case 50:
-                  { jjCheckNAddTwoStates(50, 52); }
+                  if (curChar == 42)
+                     jjstateSet[jjnewStateCnt++] = 44;
                   break;
                case 51:
-                  if (curChar == 47 && kind > 10)
-                     kind = 10;
+                  if (curChar == 42)
+                     { jjCheckNAddTwoStates(52, 53); }
                   break;
                case 52:
-                  if (curChar == 42)
-                     jjstateSet[jjnewStateCnt++] = 51;
+                  if ((0xfffffbffffffffffULL & l) != 0L)
+                     { jjCheckNAddTwoStates(52, 53); }
                   break;
                case 53:
+                  if (curChar == 42)
+                     { jjCheckNAddStates(37, 39); }
+                  break;
+               case 54:
+                  if ((0xffff7bffffffffffULL & l) != 0L)
+                     { jjCheckNAddTwoStates(55, 53); }
+                  break;
+               case 55:
+                  if ((0xfffffbffffffffffULL & l) != 0L)
+                     { jjCheckNAddTwoStates(55, 53); }
+                  break;
+               case 56:
+                  if (curChar == 47 && kind > 10)
+                     kind = 10;
+                  break;
+               case 57:
                   if ((0x3ff000000000000ULL & l) == 0L)
                      break;
                   if (kind > 165)
                      kind = 165;
                   { jjCheckNAddStates(0, 10); }
                   break;
-               case 55:
+               case 59:
                   if ((0x3ff000000000000ULL & l) == 0L)
                      break;
                   if (kind > 165)
                      kind = 165;
-                  { jjCheckNAddTwoStates(54, 55); }
+                  { jjCheckNAddTwoStates(58, 59); }
                   break;
-               case 57:
+               case 61:
                   if ((0x3ff000000000000ULL & l) == 0L)
                      break;
                   if (kind > 170)
                      kind = 170;
-                  { jjCheckNAddStates(34, 37); }
+                  { jjCheckNAddStates(40, 43); }
                   break;
-               case 58:
+               case 62:
                   if (curChar == 46)
-                     { jjCheckNAdd(59); }
+                     { jjCheckNAdd(63); }
                   break;
-               case 59:
+               case 63:
                   if ((0x3ff000000000000ULL & l) == 0L)
                      break;
                   if (kind > 170)
                      kind = 170;
-                  { jjCheckNAddStates(38, 40); }
+                  { jjCheckNAddStates(44, 46); }
                   break;
-               case 62:
+               case 66:
                   if ((0x280000000000ULL & l) != 0L)
-                     { jjCheckNAdd(63); }
+                     { jjCheckNAdd(67); }
                   break;
-               case 63:
+               case 67:
                   if ((0x3ff000000000000ULL & l) == 0L)
                      break;
                   if (kind > 170)
                      kind = 170;
-                  { jjCheckNAddTwoStates(64, 63); }
+                  { jjCheckNAddTwoStates(68, 67); }
                   break;
-               case 66:
+               case 70:
                   if ((0x3ff000000000000ULL & l) != 0L)
-                     { jjCheckNAddStates(41, 43); }
+                     { jjCheckNAddStates(47, 49); }
                   break;
-               case 67:
+               case 71:
                   if (curChar == 35)
-                     { jjCheckNAdd(68); }
+                     { jjCheckNAdd(72); }
                   break;
-               case 68:
+               case 72:
                   if ((0x3ff000000000000ULL & l) != 0L)
-                     { jjCheckNAddStates(44, 46); }
+                     { jjCheckNAddStates(50, 52); }
                   break;
-               case 69:
+               case 73:
                   if (curChar == 46)
-                     { jjCheckNAdd(70); }
+                     { jjCheckNAdd(74); }
                   break;
-               case 70:
+               case 74:
                   if ((0x3ff000000000000ULL & l) != 0L)
-                     { jjCheckNAddTwoStates(70, 71); }
+                     { jjCheckNAddTwoStates(74, 75); }
                   break;
-               case 71:
+               case 75:
                   if (curChar != 35)
                      break;
                   if (kind > 172)
                      kind = 172;
-                  jjstateSet[jjnewStateCnt++] = 72;
+                  jjstateSet[jjnewStateCnt++] = 76;
                   break;
-               case 73:
+               case 77:
                   if ((0x280000000000ULL & l) != 0L)
-                     { jjCheckNAdd(74); }
+                     { jjCheckNAdd(78); }
                   break;
-               case 74:
+               case 78:
                   if ((0x3ff000000000000ULL & l) == 0L)
                      break;
                   if (kind > 172)
                      kind = 172;
-                  { jjCheckNAddTwoStates(75, 74); }
+                  { jjCheckNAddTwoStates(79, 78); }
                   break;
-               case 76:
+               case 80:
                   if ((0x3ff000000000000ULL & l) != 0L)
-                     { jjCheckNAddTwoStates(76, 21); }
+                     { jjCheckNAddTwoStates(80, 21); }
                   break;
                default : break;
             }
          } while(i != startsAt);
       }
-      else if ((int)curChar < 128)
+      else if (curChar < 128)
       {
          unsigned long long l = 1ULL << (curChar & 077);
          (void)l;
@@ -3071,7 +3090,7 @@ int VhdlParserTokenManager::jjMoveNfa_0(int startState, int curPos){
                   break;
                case 9:
                   if ((0x7fffffffffffffffULL & l) != 0L)
-                     { jjAddStates(47, 48); }
+                     { jjAddStates(53, 54); }
                   break;
                case 12:
                   if (curChar == 95)
@@ -3125,7 +3144,7 @@ int VhdlParserTokenManager::jjMoveNfa_0(int startState, int curPos){
                   break;
                case 28:
                   if ((0x7fffffffffffffffULL & l) != 0L)
-                     { jjAddStates(49, 50); }
+                     { jjAddStates(55, 56); }
                   break;
                case 30:
                   if ((0x7fffffffffffffffULL & l) == 0L)
@@ -3145,50 +3164,58 @@ int VhdlParserTokenManager::jjMoveNfa_0(int startState, int curPos){
                   { jjAddStates(31, 33); }
                   break;
                case 45:
-                  { jjAddStates(51, 52); }
+                  { jjCheckNAddTwoStates(45, 46); }
                   break;
-               case 50:
-                  { jjAddStates(53, 54); }
+               case 47:
+               case 48:
+                  { jjCheckNAddTwoStates(48, 46); }
+                  break;
+               case 52:
+                  { jjCheckNAddTwoStates(52, 53); }
                   break;
                case 54:
-                  if (curChar == 95)
-                     jjstateSet[jjnewStateCnt++] = 55;
+               case 55:
+                  { jjCheckNAddTwoStates(55, 53); }
                   break;
-               case 56:
+               case 58:
                   if (curChar == 95)
-                     jjstateSet[jjnewStateCnt++] = 57;
+                     jjstateSet[jjnewStateCnt++] = 59;
                   break;
                case 60:
                   if (curChar == 95)
-                     jjstateSet[jjnewStateCnt++] = 59;
-                  break;
-               case 61:
-                  if ((0x2000000020ULL & l) != 0L)
-                     { jjCheckNAddTwoStates(62, 63); }
+                     jjstateSet[jjnewStateCnt++] = 61;
                   break;
                case 64:
                   if (curChar == 95)
-                     { jjCheckNAdd(63); }
+                     jjstateSet[jjnewStateCnt++] = 63;
                   break;
                case 65:
-                  if (curChar == 95)
-                     jjstateSet[jjnewStateCnt++] = 66;
+                  if ((0x2000000020ULL & l) != 0L)
+                     { jjCheckNAddTwoStates(66, 67); }
                   break;
                case 68:
+                  if (curChar == 95)
+                     { jjCheckNAdd(67); }
+                  break;
+               case 69:
+                  if (curChar == 95)
+                     jjstateSet[jjnewStateCnt++] = 70;
+                  break;
+               case 72:
                   if ((0x7fffffe07fffffeULL & l) != 0L)
-                     { jjCheckNAddStates(44, 46); }
+                     { jjCheckNAddStates(50, 52); }
                   break;
-               case 70:
+               case 74:
                   if ((0x7fffffe07fffffeULL & l) != 0L)
-                     { jjCheckNAddTwoStates(70, 71); }
+                     { jjCheckNAddTwoStates(74, 75); }
                   break;
-               case 72:
+               case 76:
                   if ((0x2000000020ULL & l) != 0L)
-                     { jjCheckNAddTwoStates(73, 74); }
+                     { jjCheckNAddTwoStates(77, 78); }
                   break;
-               case 75:
+               case 79:
                   if (curChar == 95)
-                     { jjCheckNAdd(74); }
+                     { jjCheckNAdd(78); }
                   break;
                default : break;
             }
@@ -3214,7 +3241,7 @@ int VhdlParserTokenManager::jjMoveNfa_0(int startState, int curPos){
                   break;
                case 9:
                   if (jjCanMove_1(hiByte, i1, i2, l1, l2))
-                     { jjAddStates(47, 48); }
+                     { jjAddStates(53, 54); }
                   break;
                case 15:
                   if (jjCanMove_1(hiByte, i1, i2, l1, l2))
@@ -3226,14 +3253,14 @@ int VhdlParserTokenManager::jjMoveNfa_0(int startState, int curPos){
                   break;
                case 28:
                   if (jjCanMove_1(hiByte, i1, i2, l1, l2))
-                     { jjAddStates(49, 50); }
+                     { jjAddStates(55, 56); }
                   break;
                case 30:
                   if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
                      break;
                   if (kind > 189)
                      kind = 189;
-                  { jjAddStates(55, 56); }
+                  { jjAddStates(57, 58); }
                   break;
                case 33:
                   if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
@@ -3251,11 +3278,21 @@ int VhdlParserTokenManager::jjMoveNfa_0(int startState, int curPos){
                   break;
                case 45:
                   if (jjCanMove_0(hiByte, i1, i2, l1, l2))
-                     { jjAddStates(51, 52); }
+                     { jjCheckNAddTwoStates(45, 46); }
                   break;
-               case 50:
+               case 47:
+               case 48:
                   if (jjCanMove_0(hiByte, i1, i2, l1, l2))
-                     { jjAddStates(53, 54); }
+                     { jjCheckNAddTwoStates(48, 46); }
+                  break;
+               case 52:
+                  if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+                     { jjCheckNAddTwoStates(52, 53); }
+                  break;
+               case 54:
+               case 55:
+                  if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+                     { jjCheckNAddTwoStates(55, 53); }
                   break;
                default : if (i1 == 0 || l1 == 0 || i2 == 0 ||  l2 == 0) break; else break;
             }
@@ -3268,7 +3305,7 @@ int VhdlParserTokenManager::jjMoveNfa_0(int startState, int curPos){
          kind = 0x7fffffff;
       }
       ++curPos;
-      if ((i = jjnewStateCnt), (jjnewStateCnt = startsAt), (i == (startsAt = 77 - startsAt)))
+      if ((i = jjnewStateCnt), (jjnewStateCnt = startsAt), (i == (startsAt = 81 - startsAt)))
          break;
       if (input_stream->endOfInput()) { break; }
       curChar = input_stream->readChar();
@@ -3321,10 +3358,10 @@ bool VhdlParserTokenManager::jjCanMove_1(int hiByte, int i1, int i2, unsigned lo
 Token * VhdlParserTokenManager::jjFillToken(){
    Token *t;
    JAVACC_STRING_TYPE curTokenImage;
-   int beginLine;
-   int endLine;
-   int beginColumn;
-   int endColumn;
+   int beginLine   = -1;
+   int endLine     = -1;
+   int beginColumn = -1;
+   int endColumn   = -1;
    JAVACC_STRING_TYPE im = jjstrLiteralImages[jjmatchedKind];
    curTokenImage = (im.length() == 0) ? input_stream->GetImage() : im;
    if (input_stream->getTrackLineColumn()) {
@@ -3333,7 +3370,9 @@ Token * VhdlParserTokenManager::jjFillToken(){
      endLine = input_stream->getEndLine();
      endColumn = input_stream->getEndColumn();
    }
-   t = Token::newToken(jjmatchedKind, curTokenImage);
+   t = Token::newToken(jjmatchedKind);
+   t->kind = jjmatchedKind;
+   t->image = curTokenImage;
    t->specialToken = NULL;
    t->next = NULL;
 
@@ -3444,16 +3483,14 @@ void  VhdlParserTokenManager::SkipLexicalActions(Token *matchedToken){
       case 9 : {
          image.append(input_stream->GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1)));
    {
-     QCString q(image.data());
-     q.stripPrefix("/*!");
-     q.resize(q.length()-2);
+     QCString q = filter2008VhdlComment(image.data());
      ::vhdl::parser::VhdlParser::handleCommentBlock(q.data(),TRUE);image.clear();
    }
          break;
        }
       case 10 : {
          image.append(input_stream->GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1)));
-                                                    ::vhdl::parser::VhdlParser::lineCount(image.data());image.clear();
+      ::vhdl::parser::VhdlParser::lineCount(image.data());image.clear();
          break;
        }
       default :
@@ -3591,7 +3628,7 @@ void  VhdlParserTokenManager::TokenLexicalActions(Token *matchedToken){
 }
   /** Reinitialise parser. */
   void VhdlParserTokenManager::ReInit(JAVACC_CHARSTREAM *stream, int lexState, VhdlParser *parserArg) {
-    if (input_stream) delete input_stream;
+    clear();
     jjmatchedPos = jjnewStateCnt = 0;
     curLexState = lexState;
     input_stream = stream;
@@ -3606,16 +3643,23 @@ void  VhdlParserTokenManager::TokenLexicalActions(Token *matchedToken){
   void VhdlParserTokenManager::ReInitRounds() {
     int i;
     jjround = 0x80000001;
-    for (i = 77; i-- > 0;)
+    for (i = 81; i-- > 0;)
       jjrounds[i] = 0x80000000;
   }
 
   /** Switch to specified lex state. */
   void VhdlParserTokenManager::SwitchTo(int lexState) {
-    if (lexState >= 1 || lexState < 0)
-      assert(false);
-      //throw 1;//new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
-    else
+    if (lexState >= 1 || lexState < 0) {
+      JAVACC_STRING_TYPE message;
+#ifdef WIDE_CHAR
+      message += L"Error: Ignoring invalid lexical state : ";
+      message += lexState; message += L". State unchanged.";
+#else
+      message += "Error: Ignoring invalid lexical state : ";
+      message += lexState; message += ". State unchanged.";
+#endif
+      throw new TokenMgrError(message, INVALID_LEXICAL_STATE);
+    } else
       curLexState = lexState;
   }
 
@@ -3623,14 +3667,23 @@ void  VhdlParserTokenManager::TokenLexicalActions(Token *matchedToken){
   VhdlParserTokenManager::VhdlParserTokenManager (JAVACC_CHARSTREAM *stream, int lexState, VhdlParser *parserArg)
   {
     input_stream = NULL;
+    errorHandlerCreated = false;
     ReInit(stream, lexState, parserArg);
   }
 
   // Destructor
   VhdlParserTokenManager::~VhdlParserTokenManager () {
-    if (input_stream) delete input_stream;
-    if (errorHandlerCreated) delete errorHandler;
+    clear();
   }
 
+  // clear
+  void VhdlParserTokenManager::clear() {
+    //Since input_stream was generated outside of TokenManager
+    //TokenManager should not take care of deleting it
+    //if (input_stream) delete input_stream;
+    if (errorHandlerCreated) delete errorHandler;    
+  }
+
+
 }
 }
index e6a7245..96a2449 100644 (file)
@@ -1,5 +1,6 @@
 #ifndef VHDLPARSERTOKENMANAGER_H
 #define VHDLPARSERTOKENMANAGER_H
+#include "stdio.h"
 #include "JavaCC.h"
 #include "CharStream.h"
 #include "Token.h"
@@ -116,23 +117,27 @@ void  TokenLexicalActions(Token *matchedToken);
   public: virtual ~VhdlParserTokenManager();
   void ReInit(JAVACC_CHARSTREAM *stream, int lexState = 0, VhdlParser *parserArg = NULL);
   void SwitchTo(int lexState);
+  void clear();
   const JAVACC_SIMPLE_STRING jjKindsForBitVector(int i, unsigned long long vec);
   const JAVACC_SIMPLE_STRING jjKindsForStateVector(int lexState, int vec[], int start, int end);
-    JAVACC_CHARSTREAM  *input_stream;
-    int jjrounds[77];
-    int jjstateSet[2 * 77];
-    JAVACC_STRING_TYPE jjimage;
-    JAVACC_STRING_TYPE image;
-    int jjimageLen;
-    int lengthOfMatch;
-    JAVACC_CHAR_TYPE curChar;
-    TokenManagerErrorHandler *errorHandler;
-    bool errorHandlerCreated;
-    public: void setErrorHandler(TokenManagerErrorHandler *eh) {
+  JAVACC_CHARSTREAM*        input_stream;
+  int                       jjrounds[81];
+  int                       jjstateSet[2 * 81];
+  JAVACC_STRING_TYPE        jjimage;
+  JAVACC_STRING_TYPE        image;
+  int                       jjimageLen;
+  int                       lengthOfMatch;
+  JAVACC_CHAR_TYPE          curChar;
+  TokenManagerErrorHandler* errorHandler;
+  bool                      errorHandlerCreated;
+
+public: 
+  void setErrorHandler(TokenManagerErrorHandler *eh) {
       if (errorHandlerCreated && errorHandler != NULL) delete errorHandler;
       errorHandler = eh;
       errorHandlerCreated = false;
     }
+    
 };
 }
 }
index af1bd34..3151528 100644 (file)
@@ -31,7 +31,7 @@ static Entry* current_root;
 static Entry* tempEntry;
 static Entry*  lastEntity  ;
 static Entry*  lastCompound  ;
-static Entry*  current;
+static std::shared_ptr<Entry> current;
 static QCString compSpec;
 static QCString currName;
 static int levelCounter;
@@ -42,7 +42,6 @@ static QCString forL;
 static int param_sec ;
 static int parse_sec;
 static int currP;
-static Entry* currentCompound;
 
 //----------------------------------------
 
@@ -108,17 +107,17 @@ SKIP:
 // VHDL 2008 doxygen comment /*! .... */
 SKIP :
 {
-  <MULT_DOXYGEN_VHDL_COMMENT_2008 : "/*!"  (~[])* "*/" >
+  <MULT_DOXYGEN_VHDL_COMMENT_2008 : "/*!" (~["*"])* "*" ("*" | ~["*","/"] (~["*"])* "*")* "/">
   {
    {
-     QCString q(image.data());
-     q.stripPrefix("/*!");
-     q.resize(q.length()-2);
+     QCString q = filter2008VhdlComment(image.data());
      ::vhdl::parser::VhdlParser::handleCommentBlock(q.data(),TRUE);image.clear();
    }
   }
-  | <MULT_VHDL_2008_COMMENT : "/*"  (~[])* "*/" >  {::vhdl::parser::VhdlParser::lineCount(image.data());image.clear();}
-}
+  | <MULT_VHDL_2008_COMMENT : "/*" (~["*"])* "*" ("*" | ~["*","/"] (~["*"])* "*")* "/">
+    {
+      ::vhdl::parser::VhdlParser::lineCount(image.data());image.clear();}
+    }
 
 /* KEYWORDS */
 
@@ -134,7 +133,7 @@ TOKEN [IGNORE_CASE] :
 | <ARRAY_T: "array"> {VhdlParser::setLineParsed(ARRAY_T);}
 | <ASSERT_T: "assert">
 | <ASSUME_T: "assume">
-| <ASSUME_GUARANTEE_T: "assume_guarentee">
+| <ASSUME_GUARANTEE_T: "assume_guarantee">
 | <ATTRIBUTE_T: "attribute"> {::vhdl::parser::VhdlParser::setLineParsed(ATTRIBUTE_T);}
 | <BEGIN_T: "begin">
 | <BLOCK_T: "block">
@@ -409,7 +408,7 @@ void architecture_body() : {QCString s,s1;}
                   QCString t=s1+"::"+s;
                   genLabels.resize(0);
                   pushLabel(genLabels,s1);
-                  lastCompound=current;
+                  lastCompound=current.get();
                   addVhdlType(t,getLine(ARCHITECTURE_T),Entry::CLASS_SEC,VhdlDocGen::ARCHITECTURE,0,0,Private);
     }
    try{
@@ -1012,7 +1011,7 @@ void entity_declaration() :  {QCString s;}
    // try{
     <ENTITY_T> s=identifier()  <IS_T>
              {
-                lastEntity=current;
+                lastEntity=current.get();
                 lastCompound=0;
                 addVhdlType(s.data(),getLine(ENTITY_T),Entry::CLASS_SEC,VhdlDocGen::ENTITY,0,0,Public);
                }
@@ -1209,7 +1208,7 @@ QCString full_type_declaration() :  {Entry *tmpEntry;QCString s,s1,s2;}
 {
 <TYPE_T> s=identifier() <IS_T>
 {
-  tmpEntry=current;
+  tmpEntry=current.get();
   addVhdlType(s.data(),getLine(),Entry::VARIABLE_SEC,VhdlDocGen::RECORD,0,0,Public);
 }
  try{
@@ -1614,6 +1613,9 @@ QCString name_ext1() : {QCString s,s1,s2;}
  {
 
   (
+ LOOKAHEAD(<APOSTROPHE_T><SUBTYPE_T>)
+ <APOSTROPHE_T><SUBTYPE_T>{s+="'subtype";}
+|
  LOOKAHEAD(<DOT_T> suffix())
  <DOT_T> s1=suffix(){s+=".";s+=s1;}
 |
@@ -1693,7 +1695,7 @@ void package_body() :  {QCString s;}
 {
 <PACKAGE_T> <BODY_T> s=name() <IS_T>
  {
-                        lastCompound=current;
+                        lastCompound=current.get();
                         s.prepend("_");
                         addVhdlType(s,getLine(),Entry::CLASS_SEC,VhdlDocGen::PACKAGE_BODY,0,0,Protected);
                       }
@@ -1729,15 +1731,15 @@ void package_declaration():  {QCString s;}
 
  <PACKAGE_T> s=identifier() <IS_T>
                           {
-                          lastCompound=current;
-                          Entry *clone=new Entry(*current);
+                          lastCompound=current.get();
+                          std::shared_ptr<Entry> clone=std::make_shared<Entry>(*current);
                           clone->section=Entry::NAMESPACE_SEC;
                           clone->spec=VhdlDocGen::PACKAGE;
                           clone->name=s;
                           clone->startLine=getLine(PACKAGE_T);
                           clone->bodyLine=getLine(PACKAGE_T);
                           clone->protection=Package;
-                          current_root->addSubEntry(clone);
+                          current_root->moveToSubEntryAndKeep(clone);
                           addVhdlType(s,getLine(PACKAGE_T),Entry::CLASS_SEC,VhdlDocGen::PACKAGE,0,0,Package);
                           }
     package_declarative_part()
@@ -1932,7 +1934,7 @@ void process_statement() : {QCString s,s1,s2;Token *tok=0;}
    currName=s;
 
    current->name=currName;
-   tempEntry=current;
+   tempEntry=current.get();
    current->endBodyLine=getLine();
    currP=0;
  if(tok)
@@ -2292,7 +2294,7 @@ void subprogram_specification() : {QCString s;Token *tok=0;Token *t;}
  {
               currP=VhdlDocGen::PROCEDURE;
               createFunction(s.data(),currP,0);
-              tempEntry=current;
+              tempEntry=current.get();
                current->startLine=getLine(PROCEDURE_T);
                current->bodyLine=getLine(PROCEDURE_T);
 
@@ -2309,14 +2311,14 @@ void subprogram_specification() : {QCString s;Token *tok=0;Token *t;}
      createFunction(tok->image.c_str(),currP,s.data());
      else
      createFunction(0,currP,s.data());
-      tempEntry=current;
+      tempEntry=current.get();
       current->startLine=getLine(FUNCTION_T);
       current->bodyLine=getLine(FUNCTION_T);
   }
  [{ param_sec=PARAM_SEC; } <LPAREN_T> formal_parameter_list() <RPAREN_T> { param_sec=0; }]
     <RETURN_T> s=type_mark()
              {
-                tempEntry=current;
+                tempEntry=current.get();
                 current->type=s;
                 newEntry();
               }