From d033ece659ef73379802b0c3d6b6f718f79b0436 Mon Sep 17 00:00:00 2001
From: Dimitri van Heesch
Date: Sun, 11 Aug 2002 20:15:10 +0000
Subject: Release-1.2.17-20020811
---
INSTALL | 4 +-
README | 4 +-
VERSION | 2 +-
doc/arch.doc | 4 +-
doc/autolink.doc | 2 +-
doc/commands.doc | 10 +-
doc/faq.doc | 8 +-
doc/htmlcmds.doc | 134 ++++-----
doc/install.doc | 5 +-
doc/language.doc | 16 +-
packages/rpm/doxygen.spec | 2 +-
src/classdef.cpp | 11 +-
src/cmdmapper.cpp | 4 +-
src/cmdmapper.h | 136 ++++-----
src/code.h | 4 +-
src/code.l | 65 ++---
src/definition.cpp | 4 +-
src/diagram.cpp | 2 +-
src/doc.l | 14 +-
src/docparser.cpp | 693 ++++++++++++++++++++++++++++++++++++----------
src/docparser.h | 279 ++++++++++++++-----
src/doctokenizer.h | 20 +-
src/doctokenizer.l | 53 +++-
src/docvisitor.h | 14 +-
src/dot.cpp | 16 +-
src/doxygen.cpp | 12 +-
src/doxygen.h | 3 +-
src/filedef.cpp | 7 -
src/ftvhelp.cpp | 12 +-
src/groupdef.cpp | 2 +-
src/htmldocvisitor.h | 627 +++++++++++++++++++++++++++++++++++++++++
src/htmlgen.cpp | 37 ++-
src/htmlgen.h | 6 +
src/htmlhelp.cpp | 12 +-
src/index.cpp | 40 +--
src/latexgen.cpp | 11 +-
src/latexgen.h | 2 +
src/mangen.h | 2 +
src/memberdef.cpp | 2 +-
src/namespacedef.cpp | 2 +-
src/outputgen.h | 66 +++--
src/outputlist.cpp | 19 ++
src/outputlist.h | 7 +
src/page.h | 3 +-
src/printdocvisitor.h | 122 ++++----
src/rtfgen.cpp | 43 +--
src/rtfgen.h | 4 +-
src/scanner.l | 30 +-
src/translator_it.h | 14 +-
src/translator_pl.h | 174 ++++++++++--
src/translator_sr.h | 144 +++++-----
src/util.cpp | 378 ++++++++++++-------------
src/util.h | 18 ++
src/xmlgen.cpp | 10 +
54 files changed, 2389 insertions(+), 926 deletions(-)
create mode 100644 src/htmldocvisitor.h
diff --git a/INSTALL b/INSTALL
index e5e99fa..f6399f6 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,6 +1,6 @@
-DOXYGEN Version 1.2.17-20020804
+DOXYGEN Version 1.2.17-20020811
Please read the installation section of the manual for instructions.
--------
-Dimitri van Heesch (04 August 2002)
+Dimitri van Heesch (11 August 2002)
diff --git a/README b/README
index 967ac22..d8b4355 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-DOXYGEN Version 1.2.17_20020804
+DOXYGEN Version 1.2.17_20020811
Please read INSTALL for compilation instructions.
@@ -17,4 +17,4 @@ to subscribe to the lists or to visit the archives.
Enjoy,
-Dimitri van Heesch (dimitri@stack.nl) (04 August 2002)
+Dimitri van Heesch (dimitri@stack.nl) (11 August 2002)
diff --git a/VERSION b/VERSION
index 07b9071..d5e9194 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.2.17-20020804
+1.2.17-20020811
diff --git a/doc/arch.doc b/doc/arch.doc
index 1851d31..71b9ff5 100644
--- a/doc/arch.doc
+++ b/doc/arch.doc
@@ -58,7 +58,7 @@ of macros. This is to allow macro names to appear in the type of
function parameters for instance.
Another difference is that the preprocessor parses, but not actually includes
-code when it encounters a #include (with the exception of #include
+code when it encounters a \#include (with the exception of \#include
found inside { ... } blocks). The reasons behind this deviation from
the standard is to prevent feeding multiple definitions of the
same functions/classes to doxygen's parser. If all source files would
@@ -67,7 +67,7 @@ definitions (and their documentation) would be present in each
translation unit.
The preprocessor is written using \c flex and can be found in
-\c src/pre.l. For condition blocks (#if) evaluation of constant expressions
+\c src/pre.l. For condition blocks (\#if) evaluation of constant expressions
is needed. For this a \c yacc based parser is used, which can be found
in \c src/constexp.y and \c src/constexp.l.
diff --git a/doc/autolink.doc b/doc/autolink.doc
index c7f9ba7..3bb0e9a 100644
--- a/doc/autolink.doc
+++ b/doc/autolink.doc
@@ -62,7 +62,7 @@
(\"::")n \"()"
(\"::")n \
- where n>0.
+ where n\>0.
\par Note 1:
The patterns above should not contain spaces, tabs or newlines.
diff --git a/doc/commands.doc b/doc/commands.doc
index 0a6a352..33456bb 100644
--- a/doc/commands.doc
+++ b/doc/commands.doc
@@ -90,6 +90,7 @@ documentation:
\refitem cmdline \\line
\refitem cmdlink \\link
\refitem cmdmainpage \\mainpage
+\refitem cmdn \\n
\refitem cmdname \\name
\refitem cmdnamespace \\namespace
\refitem cmdnosubgrouping \\nosubgrouping
@@ -205,7 +206,7 @@ doxygen. Unrecognized commands are treated as normal text.
\addindex \\def
Indicates that a comment block contains documentation for a
- \c #define macro.
+ \c \#define macro.
\par Example:
\verbinclude define.h
@@ -1627,6 +1628,13 @@ ALIASES = "english=\if english" \
Equivalent to \ref cmdarg "\\arg"
+\section cmdn \n
+
+ \addindex \\n
+ Forces a new line. Equivalent to \ and inspired by
+ the printf function.
+
+
\section cmdp \p
\addindex \\p
diff --git a/doc/faq.doc b/doc/faq.doc
index 98199eb..4f7ce54 100644
--- a/doc/faq.doc
+++ b/doc/faq.doc
@@ -104,7 +104,7 @@ You can document your class like
To make doxygen put
-#include \
+\#include \
in the documentation of the class MyClassName regardless of the name of the actual
@@ -192,15 +192,15 @@ remove the % and keep the word unlinked.
This error happens when doxygen lexical scanner has a rules that matches
more than 16K input character in one go. I've seen this happening
-on a very large generated file (>16K lines), where the built-in preprocessor
-converted it into an empty file (with >16K of newlines). Another case
+on a very large generated file (\>16K lines), where the built-in preprocessor
+converted it into an empty file (with \>16K of newlines). Another case
where this might happen is if you have lines in your code with more than
16K characters.
If you have ran into such a case and want me to fix it, you
should send me a code fragment that triggers the message.
-How did doxygen get it's name?
+How did doxygen get its name?
Doxygen got its name from playing with the words
documentation and generator.
diff --git a/doc/htmlcmds.doc b/doc/htmlcmds.doc
index 7f79852..96b22f5 100644
--- a/doc/htmlcmds.doc
+++ b/doc/htmlcmds.doc
@@ -23,73 +23,73 @@ documentation. Note that all attributes of a HTML tag are ignored
Ends a paragraph.
-\ Starts a preformatted fragment.
-\ Ends a preformatted fragment.
-\ Starts a section of text displayed in a smaller font.
-\ Ends a \ section.
-\ Starts a section of bold text.
-\ Ends a section of bold text.
-\ Starts a piece of text displayed in subscript.
-\ Ends a \ section.
-\ Starts a piece of text displayed in superscript.
-\ Ends a \ section.
-\ ends a table.
-\ Starts a new table data element.
-\ Ends a table data element.
-\ Starts a new table row.
-\ Ends a table row.
-\ Starts a piece of text displayed in a typewriter font.
-\ Ends a \ section.
-\ Starts a piece of text displayed in a typewriter font.
-\ Ends a \ section.
-\ Starts an unnumbered item list.
-\ Ends an unnumbered item list.
-\ Starts a piece of text displayed in an italic font.
-\ Ends a \ section.
+\ Ends a link or anchor (HTML only).
+\ Starts a piece of text displayed in a bold font.
+\ Ends a \ section.
+\ Does not generate any output.
+\ Does not generate any output.
+\ Forces a line break.
+\ starts a section of centered text.
+\ ends a section of centered text.
+\ Starts a caption. Use within a table only.
+\ Ends a caption. Use within a table only.
+\
Starts a piece of text displayed in a typewriter font.
+\ End a \
section.
+\ Starts an item description.
+\ Starts a piece of text displayed in a typewriter font.
+\ Ends a \ section.
+\ Starts a description list.
+\ Ends a description list.
+\ Starts an item title.
+\ Ends an item title.
+\ Starts a piece of text displayed in an italic font.
+\ Ends a \ section.
+\ Does not generate any output.
+\ Does not generate any output.
+\ Writes a horizontal ruler.
+\ Starts an unnumbered section.
+\ Ends an unnumberd section.
+\ Starts an unnumbered subsection.
+\ Ends an unnumbered subsection.
+\ Starts an unnumbered subsubsection.
+\ Ends an unnumbered subsubsection.
+\ Starts a piece of text displayed in an italic font.
+\ Does not generate any output.
+\ Ends a \ section.
+\ This command is written with attributes to the HTML output only.
+\ Starts a new list item.
+\ Ends a list item.
+\ Does not generate any output.
+\ ignored by doxygen.
+\ ignored by doxygen.
+\ Starts a numbered item list.
+\ Ends a numbered item list.
+\ Starts a new paragraph.
+
\ Ends a paragraph.
+\ Starts a preformatted fragment.
+\ Ends a preformatted fragment.
+\ Starts a section of text displayed in a smaller font.
+\ Ends a \ section.
+\ Starts a section of bold text.
+\ Ends a section of bold text.
+\ Starts a piece of text displayed in subscript.
+\ Ends a \ section.
+\ Starts a piece of text displayed in superscript.
+\ Ends a \ section.
+\ ends a table.
+\ Starts a new table data element.
+\ Ends a table data element.
+\ Starts a new table row.
+\ Ends a table row.
+\ Starts a piece of text displayed in a typewriter font.
+\ Ends a \ section.
+\ Starts a piece of text displayed in a typewriter font.
+\ Ends a \ section.
+\ Starts an unnumbered item list.
+\ Ends an unnumbered item list.
+\ Starts a piece of text displayed in an italic font.
+\ Ends a \ section.
The special HTML character entities that are recognized by Doxygen:
diff --git a/doc/install.doc b/doc/install.doc
index 96a1056..fe7fd55 100644
--- a/doc/install.doc
+++ b/doc/install.doc
@@ -181,8 +181,9 @@ Compilation is now done by performing the following steps:
directory manually to some bin
directory in your search path.
This is sufficient to use doxygen.
- \note You need the GNU install tool for this to work. Other
- install tools may put the binaries in the wrong directory!
+ \note You need the GNU install tool for this to work (it is part of
+ the fileutils package). Other install tools may put the binaries in
+ the wrong directory!
If you have a RPM or DEP package, then please follow the
standard installation procedure that is required for these packages.
diff --git a/doc/language.doc b/doc/language.doc
index 42b1195..f850044 100644
--- a/doc/language.doc
+++ b/doc/language.doc
@@ -25,7 +25,7 @@ Doxygen has built-in support for multiple languages. This means
that the text fragments that doxygen generates can be produced in
languages other than English (the default) at configuration time.
-Currently (version 1.2.14-20020317), 27 languages
+Currently (version 1.2.17-20020804), 27 languages
are supported (sorted alphabetically):
Brazilian Portuguese, Chinese, Chinese Traditional, Croatian, Czech,
Danish, Dutch, English, Finnish, French,
@@ -133,7 +133,7 @@ when the translator was updated.
Italian
Alessandro Falappa Ahmed Aldo Faisal
alessandro@NOSPAM.falappa.net aaf23@NOSPAM.cam.ac.uk
- 1.2.17
+ up-to-date
Japanese
@@ -175,7 +175,7 @@ when the translator was updated.
Russian
Alexandr Chelpanov
cav@NOSPAM.cryptopro.ru
- 1.2.17
+ up-to-date
Serbian
@@ -252,7 +252,7 @@ when the translator was updated.
\hline
Hungarian & F\"{o}ldv\'{a}ri Gy\"{o}rgy & {\tt foldvari@diatronltd.com} & 1.2.1 \\
\hline
- Italian & Alessandro Falappa & {\tt alessandro@falappa.net} & 1.2.17 \\
+ Italian & Alessandro Falappa & {\tt alessandro@falappa.net} & up-to-date \\
& Ahmed Aldo Faisal & {\tt aaf23@cam.ac.uk} & \\
\hline
Japanese & Ryunosuke Sato & {\tt puyo@mint.freemail.ne.jp} & 1.2.17 \\
@@ -269,7 +269,7 @@ when the translator was updated.
\hline
Romanian & Alexandru Iosup & {\tt aiosup@yahoo.com} & 1.2.16 \\
\hline
- Russian & Alexandr Chelpanov & {\tt cav@cryptopro.ru} & 1.2.17 \\
+ Russian & Alexandr Chelpanov & {\tt cav@cryptopro.ru} & up-to-date \\
\hline
Serbian & Dejan Milosavljevic & {\tt dmilos@email.com} & 1.2.16 \\
\hline
@@ -315,8 +315,8 @@ Just follow these steps:
defines which language translators will be compiled into doxygen
executable. It is a kind of configuration file. If you are sure that
you do not need some of the languages, you can remove (comment out)
- definitions of symbols for the languages, or you can say \c #undef
- instead of \c #define for them.
+ definitions of symbols for the languages, or you can say \c \#undef
+ instead of \c \#define for them.
Edit language.cpp:
Add a
\verbatim
@@ -346,7 +346,7 @@ Just follow these steps:
Edit translator_xx.h
:
Rename TRANSLATOR_EN_H
to TRANSLATOR_XX_H
- twice (i.e. in the \c #ifndef and \c #define preprocessor commands at
+ twice (i.e. in the \c \#ifndef and \c \#define preprocessor commands at
the beginning of the file).
Rename TranslatorEnglish to TranslatorYourLanguage
In the member idLanguage()
change "english" into the
diff --git a/packages/rpm/doxygen.spec b/packages/rpm/doxygen.spec
index a41a72c..efa0314 100644
--- a/packages/rpm/doxygen.spec
+++ b/packages/rpm/doxygen.spec
@@ -1,6 +1,6 @@
Summary: A documentation system for C/C++.
Name: doxygen
-Version: 1.2.17_20020804
+Version: 1.2.17_20020811
Release: 1
Epoch: 1
Source0: ftp://ftp.stack.nl/pub/users/dimitri/%{name}-%{version}.src.tar.gz
diff --git a/src/classdef.cpp b/src/classdef.cpp
index eb0f199..d8be5e5 100644
--- a/src/classdef.cpp
+++ b/src/classdef.cpp
@@ -39,7 +39,10 @@
static QCString stripExtension(const char *fName)
{
QCString result=fName;
- if (result.right(htmlFileExtensionLength)==htmlFileExtension) result=result.left(result.length()-htmlFileExtensionLength);
+ if (result.right(Doxygen::htmlFileExtension.length())==Doxygen::htmlFileExtension)
+ {
+ result=result.left(result.length()-Doxygen::htmlFileExtension.length());
+ }
return result;
}
@@ -853,7 +856,7 @@ void ClassDef::writeDocumentation(OutputList &ol)
Doxygen::tagFile << " " << endl;
Doxygen::tagFile << " " << convertToXML(name()) << " " << endl;
- Doxygen::tagFile << " " << convertToXML(getOutputFileBase()) << htmlFileExtension << " " << endl;
+ Doxygen::tagFile << " " << convertToXML(getOutputFileBase()) << Doxygen::htmlFileExtension << " " << endl;
if (m_tempArgs)
{
ArgumentListIterator ali(*m_tempArgs);
@@ -993,7 +996,7 @@ void ClassDef::writeDocumentation(OutputList &ol)
ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Html);
ol.writeString("[");
- ol.startHtmlLink("graph_legend"+htmlFileExtension);
+ ol.startHtmlLink("graph_legend"+Doxygen::htmlFileExtension);
ol.docify(theTranslator->trLegend());
ol.endHtmlLink();
ol.writeString("] ");
@@ -1028,7 +1031,7 @@ void ClassDef::writeDocumentation(OutputList &ol)
ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Html);
ol.writeString("[");
- ol.startHtmlLink("graph_legend"+htmlFileExtension);
+ ol.startHtmlLink("graph_legend"+Doxygen::htmlFileExtension);
ol.docify(theTranslator->trLegend());
ol.endHtmlLink();
ol.writeString("] ");
diff --git a/src/cmdmapper.cpp b/src/cmdmapper.cpp
index eb7c25a..b2aedcf 100644
--- a/src/cmdmapper.cpp
+++ b/src/cmdmapper.cpp
@@ -86,7 +86,8 @@ CommandMap cmdMap[] =
{ "verbinclude", CMD_VERBINCLUDE },
{ "version", CMD_VERSION },
{ "warning", CMD_WARNING },
- { "authors", CMD_AUTHOR },
+ { "author", CMD_AUTHOR },
+ { "authors", CMD_AUTHORS },
{ "throws", CMD_EXCEPTION },
{ "\\", CMD_BSLASH },
{ "@", CMD_AT },
@@ -97,6 +98,7 @@ CommandMap cmdMap[] =
{ "#", CMD_HASH },
{ "%", CMD_PERCENT },
{ "~", CMD_LANGSWITCH },
+ { "_internalref", CMD_INTERNALREF },
{ 0, 0 }
};
diff --git a/src/cmdmapper.h b/src/cmdmapper.h
index 09a8e92..e9dd096 100644
--- a/src/cmdmapper.h
+++ b/src/cmdmapper.h
@@ -31,73 +31,75 @@ const int SIMPLESECT_BIT = 0x1000;
enum CommandType
{
- CMD_UNKNOWN=0,
- CMD_ADDINDEX=1, /* DocIndex, word as arg */
- CMD_ANCHOR=2,
- CMD_ATTENTION=3 | SIMPLESECT_BIT,
- CMD_AUTHOR=4 | SIMPLESECT_BIT,
- CMD_BOLD=5,
- CMD_BUG=6 | SIMPLESECT_BIT,
- CMD_CODE=7,
- CMD_COPYDOC=8, /* reference yields subtree */
- CMD_DATE=9 | SIMPLESECT_BIT,
- CMD_DEPRECATED=10 | SIMPLESECT_BIT,
- CMD_DONTINCLUDE=11, /* file name */
- CMD_DOTFILE=12, /* file name */
- CMD_EMPHASIS =13,
- CMD_ENDCODE=14,
- CMD_ENDHTMLONLY=15,
- CMD_ENDLATEXONLY=16,
- CMD_ENDLINK=17,
- CMD_ENDVERBATIM=18 ,
- CMD_EXCEPTION=19 | SIMPLESECT_BIT,
- CMD_HTMLINCLUDE=20 ,
- CMD_HTMLONLY=21 ,
- CMD_IMAGE=22 , /* some number of arguments */
- CMD_INCLUDE=23 ,
- CMD_INTERNAL=24 , /* node, with sub paragraphs? */
- CMD_INVARIANT=25| SIMPLESECT_BIT ,
- CMD_LATEXONLY=26 ,
- CMD_LI=27 ,
- CMD_LINE=28 ,
- CMD_LINK=29 , /* argument + "text", TODO {@link...} */
- CMD_NOTE=30 | SIMPLESECT_BIT ,
- CMD_PAR=31 | SIMPLESECT_BIT ,
- CMD_PARAM=32 | SIMPLESECT_BIT,
- CMD_POST=33 | SIMPLESECT_BIT,
- CMD_PRE=34 | SIMPLESECT_BIT ,
- CMD_REF=35 ,
- CMD_SECREFITEM=36 ,
- CMD_REMARK=37 | SIMPLESECT_BIT ,
- CMD_RETURN=38 | SIMPLESECT_BIT ,
- CMD_RETVAL=39 | SIMPLESECT_BIT,
- CMD_SA=40 | SIMPLESECT_BIT ,
- CMD_SECTION=41 ,
- CMD_SINCE=42 | SIMPLESECT_BIT,
- CMD_SKIP=43 ,
- CMD_SKIPLINE=44 ,
- CMD_STARTCODE=45,
- CMD_JAVALINK=46,
- CMD_TEST=47 | SIMPLESECT_BIT,
- CMD_TODO=48 | SIMPLESECT_BIT,
- CMD_UNTIL=49 ,
- CMD_VERBATIM=50 ,
- CMD_VERBINCLUDE=51 ,
- CMD_VERSION=52 | SIMPLESECT_BIT,
- CMD_WARNING=53 | SIMPLESECT_BIT ,
- CMD_BSLASH=54 ,
- CMD_AT=55 ,
- CMD_LESS=56 ,
- CMD_GREATER=57 ,
- CMD_AMP=58 ,
- CMD_DOLLAR=59 ,
- CMD_HASH=60 ,
- CMD_PERCENT=61,
- CMD_LINEBREAK=62,
- CMD_FORMULA=63,
- CMD_SECREFLIST=64,
- CMD_ENDSECREFLIST=65,
- CMD_LANGSWITCH=66
+ CMD_UNKNOWN = 0,
+ CMD_ADDINDEX = 1,
+ CMD_ANCHOR = 2,
+ CMD_ATTENTION = 3 | SIMPLESECT_BIT,
+ CMD_AUTHOR = 4 | SIMPLESECT_BIT,
+ CMD_BOLD = 5,
+ CMD_BUG = 6 | SIMPLESECT_BIT,
+ CMD_CODE = 7,
+ CMD_COPYDOC = 8,
+ CMD_DATE = 9 | SIMPLESECT_BIT,
+ CMD_DEPRECATED = 10 | SIMPLESECT_BIT,
+ CMD_DONTINCLUDE = 11,
+ CMD_DOTFILE = 12,
+ CMD_EMPHASIS = 13,
+ CMD_ENDCODE = 14,
+ CMD_ENDHTMLONLY = 15,
+ CMD_ENDLATEXONLY = 16,
+ CMD_ENDLINK = 17,
+ CMD_ENDVERBATIM = 18,
+ CMD_EXCEPTION = 19 | SIMPLESECT_BIT,
+ CMD_HTMLINCLUDE = 20,
+ CMD_HTMLONLY = 21,
+ CMD_IMAGE = 22,
+ CMD_INCLUDE = 23,
+ CMD_INTERNAL = 24,
+ CMD_INVARIANT = 25 | SIMPLESECT_BIT ,
+ CMD_LATEXONLY = 26,
+ CMD_LI = 27,
+ CMD_LINE = 28,
+ CMD_LINK = 29,
+ CMD_NOTE = 30 | SIMPLESECT_BIT ,
+ CMD_PAR = 31 | SIMPLESECT_BIT ,
+ CMD_PARAM = 32 | SIMPLESECT_BIT,
+ CMD_POST = 33 | SIMPLESECT_BIT,
+ CMD_PRE = 34 | SIMPLESECT_BIT ,
+ CMD_REF = 35,
+ CMD_SECREFITEM = 36,
+ CMD_REMARK = 37 | SIMPLESECT_BIT ,
+ CMD_RETURN = 38 | SIMPLESECT_BIT ,
+ CMD_RETVAL = 39 | SIMPLESECT_BIT,
+ CMD_SA = 40 | SIMPLESECT_BIT ,
+ CMD_SECTION = 41,
+ CMD_SINCE = 42 | SIMPLESECT_BIT,
+ CMD_SKIP = 43,
+ CMD_SKIPLINE = 44,
+ CMD_STARTCODE = 45,
+ CMD_JAVALINK = 46,
+ CMD_TEST = 47 | SIMPLESECT_BIT,
+ CMD_TODO = 48 | SIMPLESECT_BIT,
+ CMD_UNTIL = 49,
+ CMD_VERBATIM = 50,
+ CMD_VERBINCLUDE = 51,
+ CMD_VERSION = 52 | SIMPLESECT_BIT,
+ CMD_WARNING = 53 | SIMPLESECT_BIT ,
+ CMD_BSLASH = 54,
+ CMD_AT = 55,
+ CMD_LESS = 56,
+ CMD_GREATER = 57,
+ CMD_AMP = 58,
+ CMD_DOLLAR = 59,
+ CMD_HASH = 60,
+ CMD_PERCENT = 61,
+ CMD_LINEBREAK = 62,
+ CMD_FORMULA = 63,
+ CMD_SECREFLIST = 64,
+ CMD_ENDSECREFLIST= 65,
+ CMD_LANGSWITCH = 66,
+ CMD_AUTHORS = 67 | SIMPLESECT_BIT,
+ CMD_INTERNALREF = 68
};
enum HtmlTagType
diff --git a/src/code.h b/src/code.h
index 1023d00..db1ab18 100644
--- a/src/code.h
+++ b/src/code.h
@@ -21,11 +21,11 @@
#include "qtbc.h"
#include
-class OutputDocInterface;
+class BaseCodeDocInterface;
class FileDef;
class MemberDef;
-extern void parseCode(OutputDocInterface &,const char *,const QCString &,
+extern void parseCode(BaseCodeDocInterface &,const char *,const QCString &,
bool ,const char *,FileDef *fd=0,
int startLine=-1,int endLine=-1,bool inlineFragment=FALSE);
extern void initParseCodeContext();
diff --git a/src/code.l b/src/code.l
index 59b0f16..a3e7b00 100644
--- a/src/code.l
+++ b/src/code.l
@@ -48,7 +48,7 @@
* statics
*/
-static OutputDocInterface * g_code;
+static BaseCodeDocInterface * g_code;
static ClassSDict g_codeClassSDict(17);
static ClassDef *g_curClassDef;
@@ -414,7 +414,7 @@ static void codifyLines(char *text)
* 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(OutputDocInterface &ol,
+static void writeMultiLineCodeLink(BaseCodeDocInterface &ol,
const char *ref,const char *file,
const char *anchor,const char *text)
{
@@ -610,7 +610,7 @@ static void addDocCrossReference(MemberDef *src,MemberDef *dst)
}
-static void generateClassOrGlobalLink(OutputDocInterface &ol,char *clName,int *clNameLen=0)
+static void generateClassOrGlobalLink(BaseCodeDocInterface &ol,char *clName,int *clNameLen=0)
{
int i=0;
if (*clName=='~') // correct for matching negated values i.s.o. destructors.
@@ -642,11 +642,7 @@ static void generateClassOrGlobalLink(OutputDocInterface &ol,char *clName,int *c
// g_exampleFile.data());
if (cd->addExample(anchor,g_exampleName,g_exampleFile))
{
- ol.pushGeneratorState();
- ol.disable(OutputGenerator::Latex);
- ol.disable(OutputGenerator::RTF);
- ol.writeAnchor(0,anchor);
- ol.popGeneratorState();
+ ol.writeCodeAnchor(anchor);
g_anchorCount++;
}
}
@@ -681,7 +677,8 @@ static void generateClassOrGlobalLink(OutputDocInterface &ol,char *clName,int *c
}
static bool getLink(const char *className,
- const char *memberName,OutputDocInterface &result,
+ const char *memberName,
+ BaseCodeDocInterface &ol,
const char *text=0)
{
MemberDef *md;
@@ -704,13 +701,7 @@ static bool getLink(const char *className,
// g_exampleFile.data());
if (md->addExample(anchor,g_exampleName,g_exampleFile))
{
- //bool latexEnabled = result.isEnabled(OutputGenerator::Latex);
- result.pushGeneratorState();
- //if (latexEnabled) result.disable(OutputGenerator::Latex);
- result.disable(OutputGenerator::Latex);
- result.writeAnchor(0,anchor);
- result.popGeneratorState();
- //if (latexEnabled) result.enable(OutputGenerator::Latex);
+ ol.writeCodeAnchor(anchor);
g_anchorCount++;
}
}
@@ -733,7 +724,7 @@ static bool getLink(const char *className,
}
//printf("d->getOutputBase()=`%s' name=`%s' member name=`%s'\n",d->getOutputFileBase().data(),d->name().data(),md->name().data());
- writeMultiLineCodeLink(result,d->getReference(),d->getOutputFileBase(),
+ writeMultiLineCodeLink(ol,d->getReference(),d->getOutputFileBase(),
md->getBodyAnchor(),text ? text : memberName);
return TRUE;
}
@@ -741,7 +732,7 @@ static bool getLink(const char *className,
return FALSE;
}
-static bool generateClassMemberLink(OutputDocInterface &ol,ClassDef *mcd,const char *memName)
+static bool generateClassMemberLink(BaseCodeDocInterface &ol,ClassDef *mcd,const char *memName)
{
if (mcd)
{
@@ -764,10 +755,7 @@ static bool generateClassMemberLink(OutputDocInterface &ol,ClassDef *mcd,const c
// g_exampleFile.data());
if (xmd->addExample(anchor,g_exampleName,g_exampleFile))
{
- ol.pushGeneratorState();
- ol.disable(OutputGenerator::Latex);
- ol.writeAnchor(0,anchor);
- ol.popGeneratorState();
+ ol.writeCodeAnchor(anchor);
g_anchorCount++;
}
}
@@ -799,7 +787,7 @@ static bool generateClassMemberLink(OutputDocInterface &ol,ClassDef *mcd,const c
return FALSE;
}
-static void generateMemberLink(OutputDocInterface &ol,const QCString &varName,
+static void generateMemberLink(BaseCodeDocInterface &ol,const QCString &varName,
char *memName)
{
//printf("generateMemberLink(object=%s,mem=%s) classScope=%s\n",
@@ -812,23 +800,17 @@ static void generateMemberLink(OutputDocInterface &ol,const QCString &varName,
if (vcd)
{
//printf("Class found!\n");
- OutputDocInterface *result = ol.clone();
- if (getLink(vcd->name(),memName,*result))
+ if (getLink(vcd->name(),memName,ol))
{
//printf("Found result!\n");
- ol.append(result);
- delete result;
return;
}
BaseClassListIterator bcli(*vcd->baseClasses());
for ( ; bcli.current() ; ++bcli)
{
- OutputDocInterface *result = ol.clone();
- if (getLink(bcli.current()->classDef->name(),memName,*result))
+ if (getLink(bcli.current()->classDef->name(),memName,ol))
{
//printf("Found result!\n");
- ol.append(result);
- delete result;
return;
}
}
@@ -896,9 +878,8 @@ static void generateMemberLink(OutputDocInterface &ol,const QCString &varName,
return;
}
-static void generateFunctionLink(OutputDocInterface &ol,char *funcName)
+static void generateFunctionLink(BaseCodeDocInterface &ol,char *funcName)
{
- OutputDocInterface *result = ol.clone();
//CodeClassDef *ccd=0;
ClassDef *ccd=0;
QCString locScope=g_classScope.copy();
@@ -924,24 +905,16 @@ static void generateFunctionLink(OutputDocInterface &ol,char *funcName)
BaseClassListIterator bcli(*ccd->baseClasses());
for ( ; bcli.current() ; ++bcli)
{
- if (getLink(bcli.current()->classDef->name(),locFunc,*result,funcName))
+ if (getLink(bcli.current()->classDef->name(),locFunc,ol,funcName))
{
- ol.append(result);
- delete result;
return;
}
}
}
- if (getLink(locScope,locFunc,*result,funcName))
+ if (!getLink(locScope,locFunc,ol,funcName))
{
- ol.append(result);
- }
- else
- {
- //codifyLines(funcName);
generateClassOrGlobalLink(ol,funcName);
}
- delete result;
return;
}
@@ -2008,12 +1981,12 @@ void initParseCodeContext()
g_anchorCount = 0;
}
-void parseCode(OutputDocInterface &od,const char *className,const QCString &s,
+void parseCode(BaseCodeDocInterface &od,const char *className,const QCString &s,
bool exBlock, const char *exName,FileDef *fd,
int startLine,int endLine,bool inlineFragment)
{
if (s.isEmpty()) return;
- g_code = od.clone();
+ g_code = &od;
g_inputString = s;
g_inputPosition = 0;
g_currentFontClass = 0;
@@ -2060,8 +2033,6 @@ void parseCode(OutputDocInterface &od,const char *className,const QCString &s,
endFontClass();
g_code->endCodeLine();
}
- od.append(g_code);
- delete g_code;
return;
}
diff --git a/src/definition.cpp b/src/definition.cpp
index 5d5ca03..1e7652b 100644
--- a/src/definition.cpp
+++ b/src/definition.cpp
@@ -408,6 +408,9 @@ void Definition::writeSourceRefList(OutputList &ol,const char *scopeName,
name.prepend(scope+"::");
}
}
+ if (md->isFunction() || md->isSlot() ||
+ md->isPrototype() || md->isSignal()
+ ) name+="()";
Definition *d = md->getOuterScope();
if (d==Doxygen::globalScope) d=md->getBodyDef();
if (md->getStartBodyLine()!=-1 && md->getBodyDef())
@@ -447,7 +450,6 @@ void Definition::writeSourceRefList(OutputList &ol,const char *scopeName,
{
ol.docify(name);
}
- if (md->isFunction() || md->isSlot() || md->isPrototype() || md->isSignal()) ol.docify("()");
}
index=newIndex+matchLen;
}
diff --git a/src/diagram.cpp b/src/diagram.cpp
index 3e9eb33..a2891c0 100644
--- a/src/diagram.cpp
+++ b/src/diagram.cpp
@@ -166,7 +166,7 @@ static void writeMapArea(QTextStream &t,ClassDef *cd,int x,int y,int w,int h)
{
if ((dest=Doxygen::tagDestinationDict[ref])) t << *dest << "/";
}
- t << cd->getOutputFileBase() << htmlFileExtension << "\" ";
+ t << cd->getOutputFileBase() << Doxygen::htmlFileExtension << "\" ";
t << "alt=\"" << cd->displayName();
t << "\" shape=\"rect\" coords=\"" << x << "," << y << ",";
t << (x+w) << "," << (y+h) << "\">" << endl;
diff --git a/src/doc.l b/src/doc.l
index e7eeb6d..23b96ec 100644
--- a/src/doc.l
+++ b/src/doc.l
@@ -1,4 +1,4 @@
-/*****************************************************************************
+/****************************************************************************
*
*
*
@@ -31,7 +31,6 @@
#include
// new experimental parser
-#include "docparser.h"
#include "debug.h"
#include "doc.h"
@@ -446,7 +445,10 @@ static QCString stripKnownExtensions(const char *text)
{
QCString result=text;
if (result.right(4)==".tex") result=result.left(result.length()-4);
- else if (result.right(htmlFileExtensionLength)==htmlFileExtension) result=result.left(result.length()-htmlFileExtensionLength);
+ else if (result.right(Doxygen::htmlFileExtension.length())==Doxygen::htmlFileExtension)
+ {
+ result=result.left(result.length()-Doxygen::htmlFileExtension.length());
+ }
//printf("%s stripKnowExtensions(%s)\n",result.data(),text);
return result;
}
@@ -1928,9 +1930,9 @@ LINKMASK [a-z_A-Z0-9:#.,~&*/\[\]<>()\-\+]+({B}*("const"|"volatile"))?
internalRefAnchor.resize(0);
BEGIN(DocInternalRef);
}
-[A-Z_a-z0-9.:\-\+]+ {
+[A-Z_a-z0-9.:#\-\+]+ {
internalRefFile=yytext;
- int i = internalRefFile.find(':');
+ int i = internalRefFile.find('#');
if (i!=-1)
{
internalRefAnchor=internalRefFile.right(internalRefFile.length()-i-1);
@@ -2947,7 +2949,7 @@ void parseDoc(OutputDocInterface &od,const char *fileName,int startLine,
if (Debug::isFlagSet(Debug::Validate))
{
- validatingParseDoc(fileName,startLine,docStr);
+ od.parseDoc(fileName,startLine,clName,md,docStr);
}
strcpy(yyFileName,fileName);
diff --git a/src/docparser.cpp b/src/docparser.cpp
index a34f652..da1d808 100644
--- a/src/docparser.cpp
+++ b/src/docparser.cpp
@@ -27,6 +27,8 @@
#include "doxygen.h"
#include "debug.h"
+#include "util.h"
+#include "page.h"
#include "docparser.h"
#include "doctokenizer.h"
@@ -38,9 +40,67 @@
//---------------------------------------------------------------------------
+static QCString g_context;
+static bool g_inSeeBlock;
+static bool g_insideHtmlLink;
static QStack g_nodeStack;
static QStack g_styleStack;
+struct DocParserContext
+{
+ QCString context;
+ bool inSeeBlock;
+ bool insideHtmlLink;
+ QStack nodeStack;
+ QStack styleStack;
+};
+
+static QStack g_parserStack;
+
+//---------------------------------------------------------------------------
+
+static void docParserPushContext()
+{
+ doctokenizerYYpushContext();
+ DocParserContext *ctx = new DocParserContext;
+ ctx->context = g_context;
+ ctx->inSeeBlock = g_inSeeBlock;
+ ctx->insideHtmlLink = g_insideHtmlLink;
+ ctx->nodeStack = g_nodeStack;
+ ctx->styleStack = g_styleStack;
+ g_parserStack.push(ctx);
+}
+
+static void docParserPopContext()
+{
+ DocParserContext *ctx = g_parserStack.pop();
+ g_context = ctx->context;
+ g_inSeeBlock = ctx->inSeeBlock;
+ g_insideHtmlLink = ctx->insideHtmlLink;
+ g_nodeStack = ctx->nodeStack;
+ g_styleStack = ctx->styleStack;
+ delete ctx;
+ doctokenizerYYpopContext();
+}
+
+//---------------------------------------------------------------------------
+
+static QCString stripKnownExtensions(const char *text)
+{
+ QCString result=text;
+ if (result.right(4)==".tex")
+ {
+ result=result.left(result.length()-4);
+ }
+ else if (result.right(Doxygen::htmlFileExtension.length())==
+ Doxygen::htmlFileExtension)
+ {
+ result=result.left(result.length()-Doxygen::htmlFileExtension.length());
+ }
+ return result;
+}
+
+
//---------------------------------------------------------------------------
/*! Returns TRUE iff node n is a child of a preformatted node */
@@ -185,7 +245,7 @@ static void handlePendingStyleCommands(DocNode *parent,QList &children)
DocStyleChange *sc = g_styleStack.top();
while (sc && sc->position()>=g_nodeStack.count())
{ // there are unclosed style modifiers in the paragraph
- const char *cmd;
+ const char *cmd="";
switch (sc->style())
{
case DocStyleChange::Bold: cmd = "b"; break;
@@ -205,6 +265,39 @@ static void handlePendingStyleCommands(DocNode *parent,QList &children)
}
}
+static void handleLinkedWord(DocNode *parent,QList &children)
+{
+ Definition *compound=0;
+ MemberDef *member=0;
+ if (resolveRef(g_context,g_token->name,g_inSeeBlock,&compound,&member))
+ {
+ if (member) // member link
+ {
+ children.append(new
+ DocLinkedWord(parent,g_token->name,
+ compound->getReference(),
+ compound->getOutputFileBase(),
+ member->anchor()
+ )
+ );
+ }
+ else // compound link
+ {
+ children.append(new
+ DocLinkedWord(parent,g_token->name,
+ compound->getReference(),
+ compound->getOutputFileBase(),
+ ""
+ )
+ );
+ }
+ }
+ else // normal word
+ {
+ children.append(new DocWord(parent,g_token->name));
+ }
+}
+
/* Helper function that deals with the most common tokens allowed in
* title like sections.
* @param parent Parent node, owner of the children list passed as
@@ -220,7 +313,7 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList &children
handleWord)
{
DBG(("token %s at %d",tokToString(tok),doctokenizerYYlineno));
- if (tok==TK_WORD || tok==TK_SYMBOL || tok==TK_URL ||
+ if (tok==TK_WORD || tok==TK_LNKWORD || tok==TK_SYMBOL || tok==TK_URL ||
tok==TK_COMMAND || tok==TK_HTMLTAG
)
{
@@ -285,7 +378,7 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList &children
{
doctokenizerYYsetStateHtmlOnly();
int retval = doctokenizerYYlex();
- children.append(new DocVerbatim(parent,g_token->verb,DocVerbatim::HtmlOnly));
+ children.append(new DocVerbatim(parent,g_context,g_token->verb,DocVerbatim::HtmlOnly));
if (retval==0) printf("Error: htmlonly section ended without end marker at line %d\n",
doctokenizerYYlineno);
doctokenizerYYsetStatePara();
@@ -295,7 +388,7 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList &children
{
doctokenizerYYsetStateLatexOnly();
int retval = doctokenizerYYlex();
- children.append(new DocVerbatim(parent,g_token->verb,DocVerbatim::LatexOnly));
+ children.append(new DocVerbatim(parent,g_context,g_token->verb,DocVerbatim::LatexOnly));
if (retval==0) printf("Error: latexonly section ended without end marker at line %d\n",
doctokenizerYYlineno);
doctokenizerYYsetStatePara();
@@ -307,6 +400,57 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList &children
children.append(form);
}
break;
+ case CMD_ANCHOR:
+ {
+ int tok=doctokenizerYYlex();
+ if (tok!=TK_WHITESPACE)
+ {
+ printf("Error: expected whitespace after %s command at line %d\n",
+ tokenName.data(),doctokenizerYYlineno);
+ break;
+ }
+ tok=doctokenizerYYlex();
+ if (tok==0)
+ {
+ printf("Error: unexpected end of comment block at line %d while parsing the "
+ "argument of command %s\n",doctokenizerYYlineno, tokenName.data());
+ break;
+ }
+ else if (tok!=TK_WORD && tok!=TK_LNKWORD)
+ {
+ printf("Error: unexpected token %s as the argument of %s at line %d.\n",
+ tokToString(tok),tokenName.data(),doctokenizerYYlineno);
+ break;
+ }
+ DocAnchor *anchor = new DocAnchor(parent,g_token->name);
+ children.append(anchor);
+ }
+ break;
+ case CMD_INTERNALREF:
+ {
+ int tok=doctokenizerYYlex();
+ if (tok!=TK_WHITESPACE)
+ {
+ printf("Error: expected whitespace after %s command at line %d\n",
+ tokenName.data(),doctokenizerYYlineno);
+ break;
+ }
+ doctokenizerYYsetStateInternalRef();
+ tok=doctokenizerYYlex(); // get the reference id
+ DocInternalRef *ref=0;
+ if (tok!=TK_WORD && tok!=TK_LNKWORD)
+ {
+ printf("Error: unexpected token %s as the argument of %s at line %d.\n",
+ tokToString(tok),tokenName.data(),doctokenizerYYlineno);
+ doctokenizerYYsetStatePara();
+ break;
+ }
+ ref = new DocInternalRef(parent,g_token->name);
+ children.append(ref);
+ ref->parse();
+ doctokenizerYYsetStatePara();
+ }
+ break;
default:
return FALSE;
}
@@ -413,9 +557,19 @@ handlepara:
children.append(new DocWhiteSpace(parent,g_token->chars));
}
break;
+ case TK_LNKWORD:
+ if (handleWord)
+ {
+ handleLinkedWord(parent,children);
+ }
+ else
+ return FALSE;
+ break;
case TK_WORD:
if (handleWord)
+ {
children.append(new DocWord(parent,g_token->name));
+ }
else
return FALSE;
break;
@@ -483,6 +637,77 @@ DocSymbol::SymType DocSymbol::decodeSymbol(const QCString &symName,char *letter)
//---------------------------------------------------------------------------
+static int internalValidatingParseDoc(DocNode *parent,QList &children,
+ const QCString &doc)
+{
+ int retval = RetVal_OK;
+
+ doctokenizerYYinit(doc);
+
+ // first parse any number of paragraphs
+ bool isFirst=FALSE;
+ DocPara *lastPar=0;
+ do
+ {
+ DocPara *par = new DocPara(parent);
+ if (isFirst) { par->markFirst(); isFirst=FALSE; }
+ retval=par->parse();
+ if (!par->isEmpty())
+ {
+ children.append(par);
+ lastPar=par;
+ }
+ } while (retval==TK_NEWPARA);
+ if (lastPar) lastPar->markLast();
+
+ return retval;
+}
+
+//---------------------------------------------------------------------------
+
+void DocXRefItem::parse()
+{
+ QCString listName;
+ switch(m_type)
+ {
+ case Bug: listName="bug"; break;
+ case Test: listName="test"; break;
+ case Todo: listName="todo"; break;
+ case Deprecated: listName="deprecated"; break;
+ }
+ RefList *refList = Doxygen::specialLists->find(listName);
+ if (Config_getBool(refList->optionName())) // list is enabled
+ {
+ RefItem *item = refList->getRefItem(m_id);
+ ASSERT(item!=0);
+
+ m_file = refList->listName();
+ m_anchor = item->listAnchor;
+ m_title = refList->sectionTitle();
+
+ docParserPushContext();
+ internalValidatingParseDoc(this,m_children,item->text);
+ docParserPopContext();
+ }
+}
+
+//---------------------------------------------------------------------------
+
+DocFormula::DocFormula(DocNode *parent,int id) :
+ m_parent(parent)
+{
+ QCString formCmd;
+ formCmd.sprintf("\\form#%d",id);
+ Formula *formula=Doxygen::formulaNameDict[formCmd];
+ if (formula)
+ {
+ m_name.sprintf("form_%d",formula->getId());
+ m_text = formula->getFormulaText();
+ }
+}
+
+//---------------------------------------------------------------------------
+
int DocLanguage::parse()
{
int retval;
@@ -490,13 +715,17 @@ int DocLanguage::parse()
g_nodeStack.push(this);
// parse one or more paragraphs
+ bool isFirst=TRUE;
+ DocPara *par=0;
do
{
- DocPara *par = new DocPara(this);
+ par = new DocPara(this);
+ if (isFirst) { par->markFirst(); isFirst=FALSE; }
m_children.append(par);
retval=par->parse();
}
while (retval==TK_NEWPARA);
+ if (par) par->markLast();
DBG(("DocLanguage::parse() end\n"));
DocNode *n = g_nodeStack.pop();
@@ -568,7 +797,7 @@ void DocSecRefList::parse()
break;
}
tok=doctokenizerYYlex();
- if (tok!=TK_WORD)
+ if (tok!=TK_WORD && tok!=TK_LNKWORD)
{
printf("Error: unexpected token %s as the argument of \\refitem at line %d.\n",
tokToString(tok),doctokenizerYYlineno);
@@ -603,10 +832,98 @@ endsecreflist:
ASSERT(n==this);
}
+//---------------------------------------------------------------------------
+
+DocInternalRef::DocInternalRef(DocNode *parent,const QCString &ref)
+ : m_parent(parent)
+{
+ int i=ref.find('#');
+ if (i!=-1)
+ {
+ m_anchor = ref.right(ref.length()-i-1);
+ m_file = ref.left(i);
+ }
+ else
+ {
+ m_file = ref;
+ }
+}
+void DocInternalRef::parse()
+{
+ g_nodeStack.push(this);
+ DBG(("DocInternalRef::parse() start\n"));
+
+ int tok;
+ while ((tok=doctokenizerYYlex()))
+ {
+ if (!defaultHandleToken(this,tok,m_children))
+ {
+ switch (tok)
+ {
+ case TK_COMMAND:
+ printf("Error: Illegal command %s as part of a \\ref at line %d\n",
+ g_token->name.data(),doctokenizerYYlineno);
+ break;
+ case TK_SYMBOL:
+ printf("Error: Unsupported symbol %s found at line %d\n",
+ g_token->name.data(),doctokenizerYYlineno);
+ break;
+ default:
+ printf("Error: Unexpected token %s at line %d\n",
+ g_token->name.data(),doctokenizerYYlineno);
+ break;
+ }
+ }
+ }
+
+ handlePendingStyleCommands(this,m_children);
+ DBG(("DocInternalRef::parse() end\n"));
+ DocNode *n=g_nodeStack.pop();
+ ASSERT(n==this);
+}
//---------------------------------------------------------------------------
+DocRef::DocRef(DocNode *parent,const QCString &target) :
+ m_parent(parent), m_refToSection(FALSE), m_refToAnchor(FALSE)
+{
+ Definition *compound = 0;
+ MemberDef *member = 0;
+ ASSERT(!target.isEmpty());
+ SectionInfo *sec = Doxygen::sectionDict[target];
+ if (sec) // ref to section or anchor
+ {
+ m_text = sec->title;
+ if (m_text.isEmpty()) m_text = sec->label;
+
+ m_ref = sec->ref;
+ m_file = stripKnownExtensions(sec->fileName);
+ m_anchor = sec->label;
+ m_refToAnchor = sec->type==SectionInfo::Anchor;
+ m_refToSection = sec->type!=SectionInfo::Anchor;
+ }
+ else if (resolveRef(g_context,target,TRUE,&compound,&member))
+ {
+ if (member) // ref to member
+ {
+ m_file = compound->getOutputFileBase();
+ m_ref = compound->getReference();
+ m_anchor = member->anchor();
+ }
+ else // ref to compound
+ {
+ m_file = compound->getOutputFileBase();
+ m_ref = compound->getReference();
+ }
+ }
+ else // oops, bogus target
+ {
+ printf("Error: unable to resolve reference to `%s' for \\ref command at line %d\n",
+ target.data(),doctokenizerYYlineno);
+ }
+}
+
void DocRef::parse()
{
g_nodeStack.push(this);
@@ -643,6 +960,33 @@ void DocRef::parse()
//---------------------------------------------------------------------------
+DocLink::DocLink(DocNode *parent,const QCString &target) :
+ m_parent(parent)
+{
+ Definition *compound;
+ PageInfo *page;
+ if (resolveLink(g_context,stripKnownExtensions(target),g_inSeeBlock,
+ &compound,&page,m_anchor))
+ {
+ if (compound)
+ {
+ m_file = compound->getOutputFileBase();
+ m_ref = compound->getReference();
+ }
+ else if (page)
+ {
+ m_file = page->getOutputFileBase();
+ m_ref = page->getReference();
+ }
+ }
+ else // oops, bogus target
+ {
+ printf("Error: unable to resolve link to `%s' for \\link command at line %d\n",
+ target.data(),doctokenizerYYlineno);
+ }
+}
+
+
QCString DocLink::parse(bool isJavaLink)
{
QCString result;
@@ -944,16 +1288,24 @@ int DocInternal::parse()
DBG(("DocInternal::parse() start\n"));
// first parse any number of paragraphs
+ bool isFirst=FALSE;
+ DocPara *lastPar=0;
do
{
DocPara *par = new DocPara(this);
+ if (isFirst) { par->markFirst(); isFirst=FALSE; }
retval=par->parse();
- if (!par->isEmpty()) m_children.append(par);
+ if (!par->isEmpty())
+ {
+ m_children.append(par);
+ lastPar=par;
+ }
if (retval==TK_LISTITEM)
{
printf("Error: Invalid list item found at line %d!\n",doctokenizerYYlineno);
}
} while (retval!=0 && retval!=RetVal_Section);
+ if (lastPar) lastPar->markLast();
// then parse any number of level1 sections
while (retval==RetVal_Section)
@@ -1094,13 +1446,17 @@ int DocHtmlCell::parse()
DBG(("DocHtmlCell::parse() start\n"));
// parse one or more paragraphs
+ bool isFirst=FALSE;
+ DocPara *par=0;
do
{
- DocPara *par = new DocPara(this);
+ par = new DocPara(this);
+ if (isFirst) { par->markFirst(); isFirst=FALSE; }
m_children.append(par);
retval=par->parse();
}
while (retval==TK_NEWPARA);
+ if (par) par->markLast();
DBG(("DocHtmlCell::parse() end\n"));
DocNode *n=g_nodeStack.pop();
@@ -1311,13 +1667,17 @@ int DocHtmlDescData::parse()
g_nodeStack.push(this);
DBG(("DocHtmlDescData::parse() start\n"));
+ bool isFirst=FALSE;
+ DocPara *par=0;
do
{
- DocPara *par = new DocPara(this);
+ par = new DocPara(this);
+ if (isFirst) { par->markFirst(); isFirst=FALSE; }
m_children.append(par);
retval=par->parse();
}
while (retval==TK_NEWPARA);
+ if (par) par->markLast();
DBG(("DocHtmlDescData::parse() end\n"));
DocNode *n=g_nodeStack.pop();
@@ -1404,13 +1764,17 @@ int DocHtmlPre::parse()
int rv;
g_nodeStack.push(this);
+ bool isFirst=FALSE;
+ DocPara *par=0;
do
{
- DocPara *par = new DocPara(this);
+ par = new DocPara(this);
+ if (isFirst) { par->markFirst(); isFirst=FALSE; }
m_children.append(par);
rv=par->parse();
}
while (rv==TK_NEWPARA);
+ if (par) par->markLast();
DocNode *n=g_nodeStack.pop();
ASSERT(n==this);
@@ -1426,13 +1790,17 @@ int DocHtmlListItem::parse()
g_nodeStack.push(this);
// parse one or more paragraphs
+ bool isFirst=FALSE;
+ DocPara *par=0;
do
{
- DocPara *par = new DocPara(this);
+ par = new DocPara(this);
+ if (isFirst) { par->markFirst(); isFirst=FALSE; }
m_children.append(par);
retval=par->parse();
}
while (retval==TK_NEWPARA);
+ if (par) par->markLast();
DocNode *n=g_nodeStack.pop();
ASSERT(n==this);
@@ -1506,6 +1874,8 @@ int DocSimpleListItem::parse()
{
g_nodeStack.push(this);
int rv=m_paragraph->parse();
+ m_paragraph->markFirst();
+ m_paragraph->markLast();
DocNode *n=g_nodeStack.pop();
ASSERT(n==this);
return rv;
@@ -1535,6 +1905,8 @@ int DocAutoListItem::parse()
int retval = RetVal_OK;
g_nodeStack.push(this);
retval=m_paragraph->parse();
+ m_paragraph->markFirst();
+ m_paragraph->markLast();
DocNode *n=g_nodeStack.pop();
ASSERT(n==this);
return retval;
@@ -1602,24 +1974,23 @@ void DocTitle::parse()
//--------------------------------------------------------------------------
DocSimpleSect::DocSimpleSect(DocNode *parent,Type t) :
- m_parent(parent), m_type(t)
+ m_parent(parent), m_type(t)
{
- m_paragraph = new DocPara(this);
- //m_params.setAutoDelete(TRUE);
- m_title = 0;
+ m_title=0;
}
-DocSimpleSect::~DocSimpleSect()
+DocSimpleSect::~DocSimpleSect()
{
- delete m_paragraph;
- delete m_title;
+ delete m_title;
}
void DocSimpleSect::accept(DocVisitor *v)
{
v->visitPre(this);
if (m_title) m_title->accept(v);
- m_paragraph->accept(v);
+ QListIterator cli(m_children);
+ DocNode *n;
+ for (cli.toFirst();(n=cli.current());++cli) n->accept(v);
v->visitPost(this);
}
@@ -1635,34 +2006,38 @@ int DocSimpleSect::parse(bool userTitle)
m_title->parse();
}
- int retval = m_paragraph->parse();
+ // add new paragraph as child
+ DocPara *par = new DocPara(this);
+ if (m_children.isEmpty())
+ {
+ par->markFirst();
+ }
+ else
+ {
+ ASSERT(m_children.last()->kind()==DocNode::Kind_Para);
+ ((DocPara *)m_children.last())->markLast(FALSE);
+ }
+ par->markLast();
+ m_children.append(par);
+
+ // parse the contents of the paragraph
+ int retval = par->parse();
DBG(("DocSimpleSect::parse() end retval=%d\n",retval));
- DocNode *n = g_nodeStack.pop();
+ DocNode *n=g_nodeStack.pop();
ASSERT(n==this);
return retval; // 0==EOF, TK_NEWPARA, TK_LISTITEM, TK_ENDLIST, RetVal_SimpleSec
}
-void DocSimpleSect::addParam(const QCString &name)
-{
- m_params.append(name);
-}
-
//--------------------------------------------------------------------------
-int DocPara::handleSimpleSection(DocSimpleSect::Type t)
+int DocParamList::parse(const QCString &cmdName)
{
- DocSimpleSect *ss=new DocSimpleSect(this,t);
- m_children.append(ss);
- int rv = ss->parse(t==DocSimpleSect::User);
- return (rv!=TK_NEWPARA) ? rv : RetVal_OK;
-}
+ int retval=RetVal_OK;
+ DBG(("DocParamList::parse() start\n"));
+ g_nodeStack.push(this);
-int DocPara::handleParamSection(const QCString &cmdName,DocSimpleSect::Type t)
-{
int tok=doctokenizerYYlex();
- DocSimpleSect *ss=new DocSimpleSect(this,t);
- m_children.append(ss);
if (tok!=TK_WHITESPACE)
{
printf("Error: expected whitespace after %s command at line %d\n",
@@ -1670,12 +2045,12 @@ int DocPara::handleParamSection(const QCString &cmdName,DocSimpleSect::Type t)
}
doctokenizerYYsetStateParam();
tok=doctokenizerYYlex();
- doctokenizerYYsetStatePara();
while (tok==TK_WORD) /* there is a parameter name */
{
- ss->addParam(g_token->name);
+ m_params.append(g_token->name);
tok=doctokenizerYYlex();
}
+ doctokenizerYYsetStatePara();
if (tok==0) /* premature end of comment block */
{
printf("Error: unexpected end of comment block at line %d while parsing the "
@@ -1683,71 +2058,75 @@ int DocPara::handleParamSection(const QCString &cmdName,DocSimpleSect::Type t)
return 0;
}
ASSERT(tok==TK_WHITESPACE);
- int rv = ss->parse(FALSE);
- return (rv!=TK_NEWPARA) ? rv : RetVal_OK;
+
+ retval = m_paragraph->parse();
+ m_paragraph->markFirst();
+ m_paragraph->markLast();
+
+ DBG(("DocParamList::parse() end retval=%d\n",retval));
+ DocNode *n=g_nodeStack.pop();
+ ASSERT(n==this);
+ return retval;
}
-#if 0
-int DocPara::handleStyleArgument(const QCString &cmdName)
+//--------------------------------------------------------------------------
+
+int DocParamSect::parse(const QCString &cmdName)
{
- int tok=doctokenizerYYlex();
- if (tok!=TK_WHITESPACE)
+ int retval=RetVal_OK;
+ DBG(("DocParamSect::parse() start\n"));
+ g_nodeStack.push(this);
+
+ DocParamList *pl = new DocParamList(this);
+ m_children.append(pl);
+ retval = pl->parse(cmdName);
+
+ DBG(("DocParamSect::parse() end retval=%d\n",retval));
+ DocNode *n=g_nodeStack.pop();
+ ASSERT(n==this);
+ return retval;
+}
+
+//--------------------------------------------------------------------------
+
+int DocPara::handleSimpleSection(DocSimpleSect::Type t)
+{
+ DocSimpleSect *ss=0;
+ if (!m_children.isEmpty() && // previous element
+ m_children.last()->kind()==Kind_SimpleSect && // was a simple sect
+ ((DocSimpleSect *)m_children.last())->type()==t) // of same type
{
- printf("Error: expected whitespace after %s command at line %d\n",
- cmdName.data(),doctokenizerYYlineno);
- return;
+ // append to previous section
+ ss=(DocSimpleSect *)m_children.last();
}
- while ((tok=doctokenizerYYlex()) && tok!=TK_WHITESPACE && tok!=TK_NEWPARA)
+ else // start new section
{
- if (!defaultHandleToken(this,tok,m_children))
- {
- switch (tok)
- {
- case TK_COMMAND:
- printf("Error: Illegal command \\%s as the argument of a \\%s command at line %d\n",
- g_token->name.data(),cmdName.data(),doctokenizerYYlineno);
- break;
- case TK_SYMBOL:
- printf("Error: Unsupported symbol %s found at line %d\n",
- g_token->name.data(),doctokenizerYYlineno);
- break;
- default:
- printf("Error: Unexpected token %s at line %d\n",
- g_token->name.data(),doctokenizerYYlineno);
- break;
- }
- }
+ ss=new DocSimpleSect(this,t);
+ m_children.append(ss);
}
- return tok==TK_NEWPARA ? TK_NEWPARA : RetVal_OK;
-}
-
-void DocPara::handleStyleEnter(DocStyleChange::Style s)
-{
- DBG(("HandleStyleEnter\n"));
- DocStyleChange *sc= new DocStyleChange(this,g_nodeStack.count(),s,TRUE);
- m_children.append(sc);
- g_styleStack.push(sc);
+ int rv = ss->parse(t==DocSimpleSect::User);
+ return (rv!=TK_NEWPARA) ? rv : RetVal_OK;
}
-void DocPara::handleStyleLeave(DocStyleChange::Style s,const char *tagName)
+int DocPara::handleParamSection(const QCString &cmdName,DocParamSect::Type t)
{
- DBG(("HandleStyleLeave\n"));
- if (g_styleStack.isEmpty() || // no style change
- g_styleStack.top()->style()!=s || // wrong style change
- g_styleStack.top()->position()!=g_nodeStack.count() // wrong position
- )
+ DocParamSect *ps=0;
+
+ if (!m_children.isEmpty() && // previous element
+ m_children.last()->kind()==Kind_ParamSect && // was a param sect
+ ((DocParamSect *)m_children.last())->type()==t) // of same type
{
- printf("Error: found %s> tag at line %d without matching <%s> in the same paragraph\n",
- tagName,doctokenizerYYlineno,tagName);
+ // append to previous section
+ ps=(DocParamSect *)m_children.last();
}
- else // end the section
+ else // start new section
{
- DocStyleChange *sc= new DocStyleChange(this,g_nodeStack.count(),s,FALSE);
- m_children.append(sc);
- g_styleStack.pop();
+ ps=new DocParamSect(this,t);
+ m_children.append(ps);
}
+ int rv=ps->parse(cmdName);
+ return (rv!=TK_NEWPARA) ? rv : RetVal_OK;
}
-#endif
int DocPara::handleXRefItem(DocXRefItem::Type t)
{
@@ -1757,7 +2136,9 @@ int DocPara::handleXRefItem(DocXRefItem::Type t)
retval=doctokenizerYYlex();
if (retval!=0)
{
- m_children.append(new DocXRefItem(this,g_token->id,t));
+ DocXRefItem *ref = new DocXRefItem(this,g_token->id,t);
+ m_children.append(ref);
+ ref->parse();
}
doctokenizerYYsetStatePara();
return retval;
@@ -1801,7 +2182,7 @@ void DocPara::handleImage(const QCString &cmdName)
return;
}
tok=doctokenizerYYlex();
- if (tok!=TK_WORD)
+ if (tok!=TK_WORD && tok!=TK_LNKWORD)
{
printf("Error: unexpected token %s as the argument of %s at line %d.\n",
tokToString(tok),cmdName.data(),doctokenizerYYlineno);
@@ -1937,7 +2318,7 @@ int DocPara::handleLanguageSwitch()
retval = tok;
goto endlang;
}
- else if (tok==TK_WORD)
+ else if (tok==TK_WORD || tok==TK_LNKWORD)
{
DocLanguage *dl = new DocLanguage(this,g_token->name);
m_children.append(dl);
@@ -2037,7 +2418,9 @@ int DocPara::handleCommand(const QCString &cmdName)
m_children.append(new DocSymbol(this,DocSymbol::Percent));
break;
case CMD_SA:
+ g_inSeeBlock=TRUE;
retval = handleSimpleSection(DocSimpleSect::See);
+ g_inSeeBlock=FALSE;
break;
case CMD_RETURN:
retval = handleSimpleSection(DocSimpleSect::Return);
@@ -2045,6 +2428,9 @@ int DocPara::handleCommand(const QCString &cmdName)
case CMD_AUTHOR:
retval = handleSimpleSection(DocSimpleSect::Author);
break;
+ case CMD_AUTHORS:
+ retval = handleSimpleSection(DocSimpleSect::Authors);
+ break;
case CMD_VERSION:
retval = handleSimpleSection(DocSimpleSect::Version);
break;
@@ -2102,7 +2488,7 @@ int DocPara::handleCommand(const QCString &cmdName)
"argument of command %s\n",doctokenizerYYlineno, cmdName.data());
break;
}
- else if (tok!=TK_WORD)
+ else if (tok!=TK_WORD && tok!=TK_LNKWORD)
{
printf("Error: unexpected token %s as the argument of %s at line %d.\n",
tokToString(tok),cmdName.data(),doctokenizerYYlineno);
@@ -2116,7 +2502,7 @@ int DocPara::handleCommand(const QCString &cmdName)
{
doctokenizerYYsetStateCode();
retval = doctokenizerYYlex();
- m_children.append(new DocVerbatim(this,g_token->verb,DocVerbatim::Code));
+ m_children.append(new DocVerbatim(this,g_context,g_token->verb,DocVerbatim::Code));
if (retval==0) printf("Error: code section ended without end marker at line %d\n",
doctokenizerYYlineno);
doctokenizerYYsetStatePara();
@@ -2126,7 +2512,7 @@ int DocPara::handleCommand(const QCString &cmdName)
{
doctokenizerYYsetStateHtmlOnly();
retval = doctokenizerYYlex();
- m_children.append(new DocVerbatim(this,g_token->verb,DocVerbatim::HtmlOnly));
+ m_children.append(new DocVerbatim(this,g_context,g_token->verb,DocVerbatim::HtmlOnly));
if (retval==0) printf("Error: htmlonly section ended without end marker at line %d\n",
doctokenizerYYlineno);
doctokenizerYYsetStatePara();
@@ -2136,7 +2522,7 @@ int DocPara::handleCommand(const QCString &cmdName)
{
doctokenizerYYsetStateLatexOnly();
retval = doctokenizerYYlex();
- m_children.append(new DocVerbatim(this,g_token->verb,DocVerbatim::LatexOnly));
+ m_children.append(new DocVerbatim(this,g_context,g_token->verb,DocVerbatim::LatexOnly));
if (retval==0) printf("Error: latexonly section ended without end marker at line %d\n",
doctokenizerYYlineno);
doctokenizerYYsetStatePara();
@@ -2146,7 +2532,7 @@ int DocPara::handleCommand(const QCString &cmdName)
{
doctokenizerYYsetStateVerbatim();
retval = doctokenizerYYlex();
- m_children.append(new DocVerbatim(this,g_token->verb,DocVerbatim::Verbatim));
+ m_children.append(new DocVerbatim(this,g_context,g_token->verb,DocVerbatim::Verbatim));
if (retval==0) printf("Error: verbatim section ended without end marker at line %d\n",
doctokenizerYYlineno);
doctokenizerYYsetStatePara();
@@ -2160,13 +2546,13 @@ int DocPara::handleCommand(const QCString &cmdName)
printf("Error: unexpected command %s at line %d\n",g_token->name.data(),doctokenizerYYlineno);
break;
case CMD_PARAM:
- retval = handleParamSection(cmdName,DocSimpleSect::Param);
+ retval = handleParamSection(cmdName,DocParamSect::Param);
break;
case CMD_RETVAL:
- retval = handleParamSection(cmdName,DocSimpleSect::RetVal);
+ retval = handleParamSection(cmdName,DocParamSect::RetVal);
break;
case CMD_EXCEPTION:
- retval = handleParamSection(cmdName,DocSimpleSect::Exception);
+ retval = handleParamSection(cmdName,DocParamSect::Exception);
break;
case CMD_BUG:
retval = handleXRefItem(DocXRefItem::Bug);
@@ -2202,7 +2588,7 @@ int DocPara::handleCommand(const QCString &cmdName)
"argument of command %s\n",doctokenizerYYlineno, cmdName.data());
break;
}
- else if (tok!=TK_WORD)
+ else if (tok!=TK_WORD && tok!=TK_LNKWORD)
{
printf("Error: unexpected token %s as the argument of %s at line %d.\n",
tokToString(tok),cmdName.data(),doctokenizerYYlineno);
@@ -2238,7 +2624,7 @@ int DocPara::handleCommand(const QCString &cmdName)
"argument of command %s\n",doctokenizerYYlineno, cmdName.data());
break;
}
- else if (tok!=TK_WORD)
+ else if (tok!=TK_WORD && tok!=TK_LNKWORD)
{
printf("Error: unexpected token %s as the argument of %s at line %d.\n",
tokToString(tok),cmdName.data(),doctokenizerYYlineno);
@@ -2309,6 +2695,9 @@ int DocPara::handleCommand(const QCString &cmdName)
case CMD_LANGSWITCH:
retval = handleLanguageSwitch();
break;
+ case CMD_INTERNALREF:
+ printf("Error: unexpected command %s at line %d\n",g_token->name.data(),doctokenizerYYlineno);
+ break;
default:
// we should not get here!
ASSERT(0);
@@ -2322,34 +2711,6 @@ int DocPara::handleCommand(const QCString &cmdName)
return retval;
}
-#if 0
-void DocPara::handlePendingStyleCommands()
-{
- if (!g_styleStack.isEmpty())
- {
- DocStyleChange *sc = g_styleStack.top();
- while (sc && sc->position()>=g_nodeStack.count())
- { // there are unclosed style modifiers in the paragraph
- const char *cmd;
- switch (sc->style())
- {
- case DocStyleChange::Bold: cmd = "b"; break;
- case DocStyleChange::Italic: cmd = "em"; break;
- case DocStyleChange::Code: cmd = "code"; break;
- case DocStyleChange::Center: cmd = "center"; break;
- case DocStyleChange::Small: cmd = "small"; break;
- case DocStyleChange::Subscript: cmd = "subscript"; break;
- case DocStyleChange::Superscript: cmd = "superscript"; break;
- }
- printf("Error: end of paragraph at line %d without end of style "
- "command %s>\n",doctokenizerYYlineno,cmd);
- m_children.append(new DocStyleChange(this,g_nodeStack.count(),sc->style(),FALSE));
- g_styleStack.pop();
- sc = g_styleStack.top();
- }
- }
-}
-#endif
int DocPara::handleHtmlStartTag(const QCString &tagName,const QList &tagOptions)
{
@@ -2483,7 +2844,9 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const QList &tag
{
DocHRef *href = new DocHRef(this,opt->value);
m_children.append(href);
+ g_insideHtmlLink=TRUE;
retval = href->parse();
+ g_insideHtmlLink=FALSE;
break;
}
else // unsupport option for tag a
@@ -2689,7 +3052,7 @@ int DocPara::parse()
{
reparsetoken:
DBG(("token %s at %d",tokToString(tok),doctokenizerYYlineno));
- if (tok==TK_WORD || tok==TK_SYMBOL || tok==TK_URL ||
+ if (tok==TK_WORD || tok==TK_LNKWORD || tok==TK_SYMBOL || tok==TK_URL ||
tok==TK_COMMAND || tok==TK_HTMLTAG
)
{
@@ -2701,6 +3064,9 @@ reparsetoken:
case TK_WORD:
m_children.append(new DocWord(this,g_token->name));
break;
+ case TK_LNKWORD:
+ handleLinkedWord(this,m_children);
+ break;
case TK_URL:
m_children.append(new DocURL(this,g_token->name));
break;
@@ -2708,12 +3074,12 @@ reparsetoken:
// prevent leading whitespace and collapse multiple whitespace areas
if (insidePRE(this) || // all whitespace is relavant
( // keep only whitespace after words, URL or symbols
- !m_children.isEmpty() &&
- (
+ !m_children.isEmpty() /* &&
+ (
m_children.last()->kind()==DocNode::Kind_Word ||
m_children.last()->kind()==DocNode::Kind_URL ||
m_children.last()->kind()==DocNode::Kind_Symbol
- )
+ )*/
)
)
{
@@ -2803,7 +3169,13 @@ reparsetoken:
// see if we have to start a simple section
int cmd = CmdMapper::map(g_token->name);
DocNode *n=parent();
- while (n && n->kind()!=DocNode::Kind_SimpleSect) n=n->parent();
+ while (n &&
+ n->kind()!=DocNode::Kind_SimpleSect &&
+ n->kind()!=DocNode::Kind_ParamSect
+ )
+ {
+ n=n->parent();
+ }
if (cmd&SIMPLESECT_BIT)
{
if (n // already in a simple section
@@ -2880,7 +3252,20 @@ reparsetoken:
}
break;
case TK_SYMBOL:
- break;
+ {
+ char letter='\0';
+ DocSymbol::SymType s = DocSymbol::decodeSymbol(g_token->name,&letter);
+ if (s!=DocSymbol::Unknown)
+ {
+ m_children.append(new DocSymbol(this,s,letter));
+ }
+ else
+ {
+ printf("Error: Unsupported symbol %s found at line %d\n",
+ g_token->name.data(),doctokenizerYYlineno);
+ }
+ break;
+ }
case TK_NEWPARA:
retval=TK_NEWPARA;
goto endparagraph;
@@ -2910,16 +3295,24 @@ int DocSection::parse()
g_nodeStack.push(this);
// first parse any number of paragraphs
+ bool isFirst=FALSE;
+ DocPara *lastPar=0;
do
{
DocPara *par = new DocPara(this);
+ if (isFirst) { par->markFirst(); isFirst=FALSE; }
retval=par->parse();
- if (!par->isEmpty()) m_children.append(par);
+ if (!par->isEmpty())
+ {
+ m_children.append(par);
+ lastPar = par;
+ }
if (retval==TK_LISTITEM)
{
printf("Error: Invalid list item found at line %d!\n",doctokenizerYYlineno);
}
} while (retval!=0 && retval!=RetVal_Section && retval!=RetVal_Internal);
+ if (lastPar) lastPar->markLast();
// then parse any number of nested sections
while (retval==RetVal_Section) // more sections follow
@@ -2958,20 +3351,27 @@ void DocRoot::parse()
{
g_nodeStack.push(this);
doctokenizerYYsetStatePara();
- DocPara *par=0;
int retval=0;
// first parse any number of paragraphs
+ bool isFirst=FALSE;
+ DocPara *lastPar=0;
do
{
- par = new DocPara(this);
+ DocPara *par = new DocPara(this);
+ if (isFirst) { par->markFirst(); isFirst=FALSE; }
retval=par->parse();
- if (!par->isEmpty()) m_children.append(par);
+ if (!par->isEmpty())
+ {
+ m_children.append(par);
+ lastPar = par;
+ }
if (retval==TK_LISTITEM)
{
printf("Error: Invalid list item found at line %d!\n",doctokenizerYYlineno);
}
} while (retval!=0 && retval!=RetVal_Section && retval!=RetVal_Internal);
+ if (lastPar) lastPar->markLast();
// then parse any number of level1 sections
while (retval==RetVal_Section)
@@ -3004,12 +3404,19 @@ void DocRoot::parse()
//--------------------------------------------------------------------------
-void validatingParseDoc(const char *fileName,int startLine,const char *input)
+DocNode *validatingParseDoc(const char *fileName,int startLine,
+ const char *context,const char *input)
{
//printf("---------------- input --------------------\n%s\n----------- end input -------------------\n",input);
- //
+
printf("========== validating %s at line %d\n",fileName,startLine);
g_token = new TokenInfo;
+
+ g_context = context;
+ g_nodeStack.clear();
+ g_styleStack.clear();
+ g_inSeeBlock = FALSE;
+ g_insideHtmlLink = FALSE;
doctokenizerYYlineno=startLine;
doctokenizerYYinit(input);
@@ -3025,13 +3432,13 @@ void validatingParseDoc(const char *fileName,int startLine,const char *input)
root->accept(v);
}
- delete root;
-
delete g_token;
// TODO: These should be called at the end of the program.
//doctokenizerYYcleanup();
//CmdMapper::freeInstance();
//HtmlTagMapper::freeInstance();
+
+ return root;
}
diff --git a/src/docparser.h b/src/docparser.h
index bbe5575..343a9f7 100644
--- a/src/docparser.h
+++ b/src/docparser.h
@@ -26,10 +26,21 @@
#include "docvisitor.h"
#include "doctokenizer.h"
+class DocNode;
+
//---------------------------------------------------------------------------
-/*! Main entry point */
-void validatingParseDoc(const char *fileName,int startLine,const char *input);
+/*! Main entry point for the documentation parser.
+ * @param fileName File in which the documentation block is found.
+ * @param startLine Line at which the documentation block is found.
+ * @param context Class or namespace in which of the item to which this
+ * block belongs.
+ * @param input String representation of the documentation block.
+ * @returns Root node of the abstract syntax tree. Ownership of the
+ * pointer is handed over to the caller.
+ */
+DocNode *validatingParseDoc(const char *fileName,int startLine,
+ const char *context, const char *input);
//---------------------------------------------------------------------------
@@ -37,6 +48,7 @@ void validatingParseDoc(const char *fileName,int startLine,const char *input);
class DocNode
{
public:
+ /*! Available node types. */
enum Kind { Kind_Root = 0,
Kind_Word = 1,
Kind_WhiteSpace = 2,
@@ -80,12 +92,22 @@ class DocNode
Kind_Formula = 40,
Kind_SecRefItem = 41,
Kind_SecRefList = 42,
- Kind_Language = 43
+ Kind_Language = 43,
+ Kind_LinkedWord = 44,
+ Kind_ParamSect = 45,
+ Kind_ParamList = 46,
+ Kind_InternalRef = 47
};
+ /*! Destructor. */
virtual ~DocNode() {}
+ /*! Returns the kind of node. Provides runtime type information */
virtual Kind kind() const = 0;
+ /*! Returns the parent of this node or 0 for the root node. */
virtual DocNode *parent() const = 0;
- virtual void accept(DocVisitor *) = 0;
+ /*! Acceptor function for node visitors. Part of the visitor pattern.
+ * @param v Abstract visitor.
+ */
+ virtual void accept(DocVisitor *v) = 0;
};
/*! Default accept implementation for compound nodes in the abstract
@@ -111,7 +133,6 @@ template class CompAccept
/*! Node representing a word
*/
-// TODO: check for word starting \# or having () and try to link to them
class DocWord : public DocNode
{
public:
@@ -127,6 +148,32 @@ class DocWord : public DocNode
QCString m_word;
};
+/*! Node representing a word that can be linked to something
+ */
+class DocLinkedWord : public DocNode
+{
+ public:
+ DocLinkedWord(DocNode *parent,const QCString &word,
+ const QCString &ref,const QCString &file,
+ const QCString &anchor) :
+ m_parent(parent), m_word(word), m_ref(ref),
+ m_file(file), m_anchor(anchor) {}
+ QCString word() const { return m_word; }
+ Kind kind() const { return Kind_Word; }
+ DocNode *parent() const { return m_parent; }
+ QCString file() const { return m_file; }
+ QCString ref() const { return m_ref; }
+ QCString anchor() const { return m_anchor; }
+ void accept(DocVisitor *v) { v->visit(this); }
+
+ private:
+ DocNode *m_parent;
+ QCString m_word;
+ QCString m_ref;
+ QCString m_file;
+ QCString m_anchor;
+};
+
/*! Node representing an URL (or email address) */
class DocURL : public DocNode
{
@@ -250,20 +297,24 @@ class DocWhiteSpace : public DocNode
};
/*! Verbatim, unparsed text fragment */
+// TODO: parse code
class DocVerbatim : public DocNode
{
public:
enum Type { Code, HtmlOnly, LatexOnly, Verbatim };
- DocVerbatim(DocNode *parent,const QCString &text, Type t) :
- m_parent(parent), m_text(text), m_type(t) {}
+ DocVerbatim(DocNode *parent,const QCString &context,
+ const QCString &text, Type t) :
+ m_parent(parent), m_context(context), m_text(text), m_type(t) {}
Kind kind() const { return Kind_Verbatim; }
Type type() const { return m_type; }
QCString text() const { return m_text; }
+ QCString context() const { return m_context; }
DocNode *parent() const { return m_parent; }
void accept(DocVisitor *v) { v->visit(this); }
private:
DocNode *m_parent;
+ QCString m_context;
QCString m_text;
Type m_type;
};
@@ -327,43 +378,25 @@ class DocIncOperator : public DocNode
};
/*! Item of a cross-referenced list */
-// TODO: lookup id and insert parsed documentation
-// (second pass to avoid context saving in the scanner?)
-class DocXRefItem : public DocNode
-{
- public:
- enum Type { Bug, Test, Todo, Deprecated };
- DocXRefItem(DocNode *parent,int id,Type t) :
- m_parent(parent), m_id(id), m_type(t) {}
- Kind kind() const { return Kind_XRefItem; }
- Type type() const { return m_type; }
- int id() const { return m_id; }
- DocNode *parent() const { return m_parent; }
- void accept(DocVisitor *v) { v->visit(this); }
-
- private:
- DocNode *m_parent;
- int m_id;
- Type m_type;
-};
-
-/*! Item of a cross-referenced list */
class DocFormula : public DocNode
{
public:
- DocFormula(DocNode *parent,int id) :
- m_parent(parent), m_id(id) {}
+ DocFormula(DocNode *parent,int id);
Kind kind() const { return Kind_Formula; }
- int id() const { return m_id; }
+ QCString name() const { return m_name; }
+ QCString text() const { return m_text; }
DocNode *parent() const { return m_parent; }
void accept(DocVisitor *v) { v->visit(this); }
private:
DocNode *m_parent;
- int m_id;
+ QCString m_name;
+ QCString m_text;
};
-/*! Node representing a entry in the index */
+//-----------------------------------------------------------------------
+
+/*! Node representing a entry in the index. */
class DocIndexEntry : public CompAccept, public DocNode
{
public:
@@ -411,6 +444,31 @@ class DocTitle : public CompAccept, public DocNode
DocNode *m_parent;
};
+/*! Item of a cross-referenced list */
+class DocXRefItem : public CompAccept, public DocNode
+{
+ public:
+ enum Type { Bug, Test, Todo, Deprecated };
+ DocXRefItem(DocNode *parent,int id,Type t) :
+ m_parent(parent), m_id(id), m_type(t) {}
+ Kind kind() const { return Kind_XRefItem; }
+ Type type() const { return m_type; }
+ QCString file() const { return m_file; }
+ QCString anchor() const { return m_anchor; }
+ QCString title() const { return m_title; }
+ void parse();
+ DocNode *parent() const { return m_parent; }
+ void accept(DocVisitor *v) { CompAccept::accept(this,v); }
+
+ private:
+ DocNode *m_parent;
+ int m_id;
+ Type m_type;
+ QCString m_file;
+ QCString m_anchor;
+ QCString m_title;
+};
+
/*! Image */
class DocImage : public CompAccept, public DocNode
{
@@ -449,67 +507,68 @@ class DocDotFile : public CompAccept, public DocNode
};
/*! Node representing a link to some item */
-// TODO: resolve link
class DocLink : public CompAccept, public DocNode
{
public:
- DocLink(DocNode *parent,const QCString &target) :
- m_parent(parent), m_target(target) {}
+ DocLink(DocNode *parent,const QCString &target);
QCString parse(bool);
Kind kind() const { return Kind_Link; }
- QCString target() const { return m_target; }
+ QCString file() const { return m_file; }
+ QCString ref() const { return m_ref; }
+ QCString anchor() const { return m_anchor; }
DocNode *parent() const { return m_parent; }
void accept(DocVisitor *v) { CompAccept::accept(this,v); }
private:
DocNode *m_parent;
- QCString m_target;
+ QCString m_file;
+ QCString m_ref;
+ QCString m_anchor;
};
/*! Node representing a reference to some item */
-// TODO: resolve reference
class DocRef : public CompAccept, public DocNode
{
public:
- DocRef(DocNode *parent,const QCString &target) :
- m_parent(parent), m_target(target) {}
+ DocRef(DocNode *parent,const QCString &target);
void parse();
- Kind kind() const { return Kind_Ref; }
- QCString target() const { return m_target; }
- DocNode *parent() const { return m_parent; }
- void accept(DocVisitor *v) { CompAccept::accept(this,v); }
+ Kind kind() const { return Kind_Ref; }
+ QCString file() const { return m_file; }
+ QCString ref() const { return m_ref; }
+ QCString anchor() const { return m_anchor; }
+ QCString targetTitle() const { return m_text; }
+ DocNode *parent() const { return m_parent; }
+ bool hasLinkText() const { return !m_children.isEmpty(); }
+ bool refToAnchor() const { return m_refToAnchor; }
+ bool refToSection() const { return m_refToSection; }
+ void accept(DocVisitor *v) { CompAccept::accept(this,v); }
private:
DocNode * m_parent;
- QCString m_target;
+ bool m_refToSection;
+ bool m_refToAnchor;
+ QCString m_file;
+ QCString m_ref;
+ QCString m_anchor;
+ QCString m_text;
};
-/*! Simple section */
-class DocSimpleSect : public DocNode
+/*! Node representing an internal reference to some item */
+class DocInternalRef : public CompAccept, public DocNode
{
public:
- enum Type
- {
- Unknown, See, Return, Author, Version, Since, Date,
- Note, Warning, Pre, Post, Invar, Remark, Attention, User,
- Param, RetVal, Exception
- };
- DocSimpleSect(DocNode *parent,Type t);
- virtual ~DocSimpleSect();
- int parse(bool userTitle);
- Kind kind() const { return Kind_SimpleSect; }
- void addParam(const QCString &name);
- const QStrList ¶meters() const { return m_params; }
- Type sectionType() const { return m_type; }
- DocNode *parent() const { return m_parent; }
- void accept(DocVisitor *v);
+ DocInternalRef(DocNode *parent,const QCString &target);
+ void parse();
+ Kind kind() const { return Kind_Ref; }
+ QCString file() const { return m_file; }
+ QCString anchor() const { return m_anchor; }
+ DocNode *parent() const { return m_parent; }
+ void accept(DocVisitor *v) { CompAccept::accept(this,v); }
private:
- DocNode * m_parent;
- DocPara * m_paragraph;
- Type m_type;
- DocTitle * m_title;
- QStrList m_params;
+ DocNode * m_parent;
+ QCString m_file;
+ QCString m_anchor;
};
/*! Language specific node */
@@ -688,26 +747,71 @@ class DocHtmlList : public CompAccept, public DocNode
Type m_type;
};
+/*! Simple section */
+class DocSimpleSect : public CompAccept, public DocNode
+{
+ public:
+ enum Type
+ {
+ Unknown, See, Return, Author, Authors, Version, Since, Date,
+ Note, Warning, Pre, Post, Invar, Remark, Attention, User
+ };
+ DocSimpleSect(DocNode *parent,Type t);
+ virtual ~DocSimpleSect();
+ int parse(bool userTitle);
+ Kind kind() const { return Kind_SimpleSect; }
+ Type type() const { return m_type; }
+ DocNode *parent() const { return m_parent; }
+ void accept(DocVisitor *v);
+
+ private:
+ DocNode * m_parent;
+ Type m_type;
+ DocTitle * m_title;
+};
+
+/*! Parameter section */
+class DocParamSect : public CompAccept, public DocNode
+{
+ public:
+ enum Type
+ {
+ Unknown, Param, RetVal, Exception
+ };
+ DocParamSect(DocNode *parent,Type t) : m_parent(parent), m_type(t) {}
+ int parse(const QCString &cmdName);
+ Kind kind() const { return Kind_ParamSect; }
+ Type type() const { return m_type; }
+ DocNode *parent() const { return m_parent; }
+ void accept(DocVisitor *v) { CompAccept::accept(this,v); }
+
+ private:
+ DocNode * m_parent;
+ Type m_type;
+};
+
/*! Paragraph in the documentation tree */
class DocPara : public CompAccept, public DocNode
{
public:
- DocPara(DocNode *parent) : m_parent(parent) {}
+ DocPara(DocNode *parent) : m_parent(parent),
+ m_isFirst(FALSE), m_isLast(FALSE) {}
int parse();
Kind kind() const { return Kind_Para; }
DocNode *parent() const { return m_parent; }
bool isEmpty() const { return m_children.isEmpty(); }
void accept(DocVisitor *v) { CompAccept::accept(this,v); }
+ void markFirst(bool v=TRUE) { m_isFirst=v; }
+ void markLast(bool v=TRUE) { m_isLast=v; }
+ bool isFirst() const { return m_isFirst; }
+ bool isLast() const { return m_isLast; }
int handleCommand(const QCString &cmdName);
int handleHtmlStartTag(const QCString &tagName,const QList &tagOptions);
int handleHtmlEndTag(const QCString &tagName);
int handleSimpleSection(DocSimpleSect::Type t);
int handleXRefItem(DocXRefItem::Type t);
- int handleParamSection(const QCString &cmdName,DocSimpleSect::Type t);
- //void handleStyleEnter(DocStyleChange::Style t);
- //void handleStyleLeave(DocStyleChange::Style t,const char *tagName);
- //void handlePendingStyleCommands();
+ int handleParamSection(const QCString &cmdName,DocParamSect::Type t);
void handleIncludeOperator(const QCString &cmdName,DocIncOperator::Type t);
void handleImage(const QCString &cmdName);
void handleDotFile(const QCString &cmdName);
@@ -720,6 +824,33 @@ class DocPara : public CompAccept, public DocNode
private:
DocNode *m_parent;
QCString m_sectionId;
+ bool m_isFirst;
+ bool m_isLast;
+};
+
+/*! Node representing a parameter list. */
+class DocParamList : public DocNode
+{
+ public:
+ DocParamList(DocNode *parent) : m_parent(parent)
+ { m_paragraph=new DocPara(this); }
+ virtual ~DocParamList()
+ { delete m_paragraph; }
+ int parse(const QCString &cmdName);
+ Kind kind() const { return Kind_ParamList; }
+ DocNode *parent() const { return m_parent; }
+ const QStrList ¶meters() { return m_params; }
+ void accept(DocVisitor *v)
+ {
+ v->visitPre(this);
+ m_paragraph->accept(v);
+ v->visitPost(this);
+ }
+
+ private:
+ DocNode *m_parent;
+ DocPara *m_paragraph;
+ QStrList m_params;
};
/*! Node representing an item of a auto list */
@@ -728,8 +859,8 @@ class DocAutoListItem : public DocNode
public:
DocAutoListItem(DocNode *parent) : m_parent(parent)
{ m_paragraph=new DocPara(this); }
- int parse();
virtual ~DocAutoListItem() { delete m_paragraph; }
+ int parse();
Kind kind() const { return Kind_AutoListItem; }
DocNode *parent() const { return m_parent; }
void accept(DocVisitor *v)
diff --git a/src/doctokenizer.h b/src/doctokenizer.h
index 8e0abee..7bda1b0 100644
--- a/src/doctokenizer.h
+++ b/src/doctokenizer.h
@@ -25,15 +25,16 @@
enum Tokens
{
TK_WORD = 1,
- TK_WHITESPACE = 2,
- TK_LISTITEM = 3,
- TK_ENDLIST = 4,
- TK_COMMAND = 5,
- TK_HTMLTAG = 6,
- TK_SYMBOL = 7,
- TK_NEWPARA = 8,
- TK_RCSTAG = 9,
- TK_URL = 10,
+ TK_LNKWORD = 2,
+ TK_WHITESPACE = 3,
+ TK_LISTITEM = 4,
+ TK_ENDLIST = 5,
+ TK_COMMAND = 6,
+ TK_HTMLTAG = 7,
+ TK_SYMBOL = 8,
+ TK_NEWPARA = 9,
+ TK_RCSTAG = 10,
+ TK_URL = 11,
RetVal_OK = 0x10000,
RetVal_SimpleSec = 0x10001,
@@ -123,5 +124,6 @@ void doctokenizerYYsetStateFile();
void doctokenizerYYsetStatePattern();
void doctokenizerYYsetStateLink();
void doctokenizerYYsetStateRef();
+void doctokenizerYYsetStateInternalRef();
#endif
diff --git a/src/doctokenizer.l b/src/doctokenizer.l
index 31d6d7f..7f43614 100644
--- a/src/doctokenizer.l
+++ b/src/doctokenizer.l
@@ -83,6 +83,7 @@ const char *tokToString(int token)
{
case 0: return "TK_EOF";
case TK_WORD: return "TK_WORD";
+ case TK_LNKWORD: return "TK_LNKWORD";
case TK_WHITESPACE: return "TK_WHITESPACE";
case TK_LISTITEM: return "TK_LISTITEM";
case TK_ENDLIST: return "TK_ENDLIST";
@@ -221,8 +222,20 @@ LINKMASK [^ \t\n\r\\@<&$]+("("[^\n)]*")")?({BLANK}*("const"|"volatile"))?
SPCMD1 {CMD}[a-z_A-Z0-9]+
SPCMD2 {CMD}[\\@<>&$#%~]
SPCMD3 {CMD}form#[0-9]+
-WORD1 [^ \t\n\r\\@<&$]+
-WORD2 [^ \t\n\r\\@<&$]+"("[^\n)]*")"({BLANK}*("const"|"volatile"))?
+TEMPCHAR [a-z_A-Z0-9,: \t\*\&]
+FUNCCHAR [a-z_A-Z0-9,:\<\> \t\*\&]
+SCOPESEP "::"|"#"|"."
+SCOPEPRE {ID}("<"{TEMPCHAR}*">")?{SCOPESEP}
+SCOPEMASK {SCOPEPRE}*(~)?{ID}
+FUNCARG "("{FUNCCHAR}*")"
+OPNEW {BLANK}+"new"({BLANK}*"[]")?
+OPDEL {BLANK}+"delete"({BLANK}*"[]")?
+OPNORM {OPNEW}|{OPDEL}|"+"|"-"|"*"|"/"|"%"|"^"|"&"|"|"|"~"|"!"|"="|"<"|">"|"+="|"-="|"*="|"/="|"%="|"^="|"&="|"|="|"<<"|">>"|"<<="|">>="|"=="|"!="|"<="|">="|"&&"|"||"|"++"|"--"|","|"->*"|"->"|"[]"|"()"
+OPCAST {BLANK}+[^(\r\n.,]+
+OPMASK ({BLANK}*{OPNORM}({FUNCARG}?))|({OPCAST}{FUNCARG})
+LNKWORD1 {SCOPEMASK}({FUNCARG}({BLANK}*("const"|"volatile"))?)?
+LNKWORD2 {SCOPEPRE}*"operator"{OPMASK}
+WORD [^ \t\n\r\\@<>&$#,.]+
%option noyywrap
%option yylineno
@@ -241,6 +254,7 @@ WORD2 [^ \t\n\r\\@<&$]+"("[^\n)]*")"({BLANK}*("const"|"volatile"))?
%x St_Link
%x St_Ref
%x St_Ref2
+%x St_IntRef
%%
/* TODO: \~lang_id */
@@ -330,12 +344,24 @@ WORD2 [^ \t\n\r\\@<&$]+"("[^\n)]*")"({BLANK}*("const"|"volatile"))?
g_token->name = yytext;
return TK_SYMBOL;
}
-{WORD1} | /* word, #word, or %word */
-{WORD2} { /* function call */
+{LNKWORD1} |
+{LNKWORD2} {
+ g_token->name = yytext;
+ return TK_LNKWORD;
+ }
+"."|"," {
g_token->name = yytext;
return TK_WORD;
- /* dummy code to please the compiler, removing this
- results in a warning on my machine */ goto find_rule;
+ }
+{WORD} { /* function call */
+ g_token->name = yytext;
+ return TK_WORD;
+
+ /* the following is dummy code to please the
+ * compiler, removing this results in a warning
+ * on my machine
+ */
+ goto find_rule;
}
{BLANK}+ |
{BLANK}*\n{BLANK}* { /* white space */
@@ -387,8 +413,7 @@ WORD2 [^ \t\n\r\\@<&$]+"("[^\n)]*")"({BLANK}*("const"|"volatile"))?
g_token->name = yytext+1;
return TK_COMMAND;
}
-{WORD1} |
-{WORD2} { /* word */
+{WORD} { /* word */
g_token->name = yytext;
return TK_WORD;
}
@@ -417,6 +442,13 @@ WORD2 [^ \t\n\r\\@<&$]+"("[^\n)]*")"({BLANK}*("const"|"volatile"))?
unput(*yytext);
return 0;
}
+[A-Z_a-z0-9.:#\-\+]+ {
+ g_token->name = yytext;
+ return TK_WORD;
+ }
+{BLANK}+"\"" {
+ BEGIN(St_Ref2);
+ }
"&"{ID}";" { /* symbol */
g_token->name = yytext;
return TK_SYMBOL;
@@ -567,6 +599,11 @@ void doctokenizerYYsetStateRef()
BEGIN(St_Ref);
}
+void doctokenizerYYsetStateInternalRef()
+{
+ BEGIN(St_IntRef);
+}
+
void doctokenizerYYcleanup()
{
yy_delete_buffer( YY_CURRENT_BUFFER );
diff --git a/src/docvisitor.h b/src/docvisitor.h
index d72ef0f..b66161f 100644
--- a/src/docvisitor.h
+++ b/src/docvisitor.h
@@ -63,6 +63,10 @@ class DocFormula;
class DocSecRefItem;
class DocSecRefList;
class DocLanguage;
+class DocLinkedWord;
+class DocParamSect;
+class DocParamList;
+class DocInternalRef;
/*! @brief Abstract visitor that participates in the visitor pattern.
*/
@@ -76,7 +80,6 @@ class DocVisitor
virtual void visit(DocURL *) = 0;
virtual void visit(DocStyleChange *) = 0;
virtual void visit(DocVerbatim *) = 0;
- virtual void visit(DocXRefItem *) = 0;
virtual void visit(DocLineBreak *) = 0;
virtual void visit(DocHorRuler *) = 0;
virtual void visit(DocAnchor *) = 0;
@@ -84,6 +87,7 @@ class DocVisitor
virtual void visit(DocInclude *) = 0;
virtual void visit(DocIncOperator *) = 0;
virtual void visit(DocFormula *) = 0;
+ virtual void visit(DocLinkedWord *) = 0;
/*! @name Visitor functions for internal nodes */
virtual void visitPre(DocAutoList *) = 0;
@@ -146,6 +150,14 @@ class DocVisitor
virtual void visitPost(DocSecRefList *) = 0;
virtual void visitPre(DocLanguage *) = 0;
virtual void visitPost(DocLanguage *) = 0;
+ virtual void visitPre(DocParamSect *) = 0;
+ virtual void visitPost(DocParamSect *) = 0;
+ virtual void visitPre(DocParamList *) = 0;
+ virtual void visitPost(DocParamList *) = 0;
+ virtual void visitPre(DocXRefItem *) = 0;
+ virtual void visitPost(DocXRefItem *) = 0;
+ virtual void visitPre(DocInternalRef *) = 0;
+ virtual void visitPost(DocInternalRef *) = 0;
};
#endif
diff --git a/src/dot.cpp b/src/dot.cpp
index 2e9ca54..252f33e 100644
--- a/src/dot.cpp
+++ b/src/dot.cpp
@@ -394,7 +394,7 @@ void DotNode::writeBox(QTextStream &t,
}
else if (!m_url.isEmpty())
{
- t << ",URL=\"" << m_url << htmlFileExtension << "\"";
+ t << ",URL=\"" << m_url << Doxygen::htmlFileExtension << "\"";
}
t << "];" << endl;
}
@@ -1718,21 +1718,21 @@ void generateGraphLegend(const char *path)
dotText << "{\n";
dotText << " Node9 [shape=\"box\",label=\"Inherited\",fontsize=10,height=0.2,width=0.4,fontname=\"Helvetica\",color=\"black\",style=\"filled\" fontcolor=\"white\"];\n";
dotText << " Node10 -> Node9 [dir=back,color=\"midnightblue\",fontsize=10,style=\"solid\",fontname=\"Helvetica\"];\n";
- dotText << " Node10 [shape=\"box\",label=\"PublicBase\",fontsize=10,height=0.2,width=0.4,fontname=\"Helvetica\",color=\"black\",URL=\"$classPublicBase" << htmlFileExtension << "\"];\n";
+ dotText << " Node10 [shape=\"box\",label=\"PublicBase\",fontsize=10,height=0.2,width=0.4,fontname=\"Helvetica\",color=\"black\",URL=\"$classPublicBase" << Doxygen::htmlFileExtension << "\"];\n";
dotText << " Node11 -> Node10 [dir=back,color=\"midnightblue\",fontsize=10,style=\"solid\",fontname=\"Helvetica\"];\n";
- dotText << " Node11 [shape=\"box\",label=\"Truncated\",fontsize=10,height=0.2,width=0.4,fontname=\"Helvetica\",color=\"red\",URL=\"$classTruncated" << htmlFileExtension << "\"];\n";
+ dotText << " Node11 [shape=\"box\",label=\"Truncated\",fontsize=10,height=0.2,width=0.4,fontname=\"Helvetica\",color=\"red\",URL=\"$classTruncated" << Doxygen::htmlFileExtension << "\"];\n";
dotText << " Node13 -> Node9 [dir=back,color=\"darkgreen\",fontsize=10,style=\"solid\",fontname=\"Helvetica\"];\n";
- dotText << " Node13 [shape=\"box\",label=\"ProtectedBase\",fontsize=10,height=0.2,width=0.4,fontname=\"Helvetica\",color=\"black\",URL=\"$classProtectedBase" << htmlFileExtension << "\"];\n";
+ dotText << " Node13 [shape=\"box\",label=\"ProtectedBase\",fontsize=10,height=0.2,width=0.4,fontname=\"Helvetica\",color=\"black\",URL=\"$classProtectedBase" << Doxygen::htmlFileExtension << "\"];\n";
dotText << " Node14 -> Node9 [dir=back,color=\"firebrick4\",fontsize=10,style=\"solid\",fontname=\"Helvetica\"];\n";
- dotText << " Node14 [shape=\"box\",label=\"PrivateBase\",fontsize=10,height=0.2,width=0.4,fontname=\"Helvetica\",color=\"black\",URL=\"$classPrivateBase" << htmlFileExtension << "\"];\n";
+ dotText << " Node14 [shape=\"box\",label=\"PrivateBase\",fontsize=10,height=0.2,width=0.4,fontname=\"Helvetica\",color=\"black\",URL=\"$classPrivateBase" << Doxygen::htmlFileExtension << "\"];\n";
dotText << " Node15 -> Node9 [dir=back,color=\"midnightblue\",fontsize=10,style=\"solid\",fontname=\"Helvetica\"];\n";
dotText << " Node15 [shape=\"box\",label=\"Undocumented\",fontsize=10,height=0.2,width=0.4,fontname=\"Helvetica\",color=\"grey75\"];\n";
dotText << " Node16 -> Node9 [dir=back,color=\"midnightblue\",fontsize=10,style=\"solid\",fontname=\"Helvetica\"];\n";
- dotText << " Node16 [shape=\"box\",label=\"Templ< int >\",fontsize=10,height=0.2,width=0.4,fontname=\"Helvetica\",color=\"black\",URL=\"$classTempl" << htmlFileExtension << "\"];\n";
+ dotText << " Node16 [shape=\"box\",label=\"Templ< int >\",fontsize=10,height=0.2,width=0.4,fontname=\"Helvetica\",color=\"black\",URL=\"$classTempl" << Doxygen::htmlFileExtension << "\"];\n";
dotText << " Node17 -> Node16 [dir=back,color=\"orange\",fontsize=10,style=\"dashed\",label=\"< int >\",fontname=\"Helvetica\"];\n";
- dotText << " Node17 [shape=\"box\",label=\"Templ< T >\",fontsize=10,height=0.2,width=0.4,fontname=\"Helvetica\",color=\"black\",URL=\"$classTempl" << htmlFileExtension << "\"];\n";
+ dotText << " Node17 [shape=\"box\",label=\"Templ< T >\",fontsize=10,height=0.2,width=0.4,fontname=\"Helvetica\",color=\"black\",URL=\"$classTempl" << Doxygen::htmlFileExtension << "\"];\n";
dotText << " Node18 -> Node9 [dir=back,color=\"darkorchid3\",fontsize=10,style=\"dashed\",label=\"m_usedClass\",fontname=\"Helvetica\"];\n";
- dotText << " Node18 [shape=\"box\",label=\"Used\",fontsize=10,height=0.2,width=0.4,fontname=\"Helvetica\",color=\"black\",URL=\"$classUsed" << htmlFileExtension << "\"];\n";
+ dotText << " Node18 [shape=\"box\",label=\"Used\",fontsize=10,height=0.2,width=0.4,fontname=\"Helvetica\",color=\"black\",URL=\"$classUsed" << Doxygen::htmlFileExtension << "\"];\n";
dotText << "}\n";
dotFile.close();
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index 20dedec..95b723d 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -186,8 +186,7 @@ static void addMemberDocs(Entry *root,MemberDef *md, const char *funcDecl,
const char idMask[] = "[A-Za-z_][A-Za-z_0-9]*";
QCString spaces;
-QCString htmlFileExtension;
-int htmlFileExtensionLength;
+QCString Doxygen::htmlFileExtension;
//----------------------------------------------------------------------------
@@ -6059,7 +6058,7 @@ static void generateExampleDocs()
for (pdi.toFirst();(pi=pdi.current());++pdi)
{
msg("Generating docs for example %s...\n",pi->name.data());
- QCString n=convertNameToFile(pi->name+"-example");
+ QCString n=pi->fileName;
startFile(*outputList,n,n,"Example Documentation");
startTitle(*outputList,n);
outputList->docify(pi->name);
@@ -6268,9 +6267,9 @@ static void generateSearchIndex()
//outputList->generateExternalIndex();
outputList->pushGeneratorState();
outputList->disableAllBut(OutputGenerator::Html);
- startFile(*outputList,"header"+htmlFileExtension,0,"Search Engine",TRUE);
+ startFile(*outputList,"header"+Doxygen::htmlFileExtension,0,"Search Engine",TRUE);
outputList->endPlainFile();
- outputList->startPlainFile("footer"+htmlFileExtension);
+ outputList->startPlainFile("footer"+Doxygen::htmlFileExtension);
endFile(*outputList,TRUE);
outputList->popGeneratorState();
}
@@ -7135,8 +7134,7 @@ void readConfiguration(int argc, char **argv)
}
/* Set the global html file extension. */
- htmlFileExtension = Config_getString("HTML_FILE_EXTENSION");
- htmlFileExtensionLength = htmlFileExtension.length();
+ Doxygen::htmlFileExtension = Config_getString("HTML_FILE_EXTENSION");
/* init the special lists */
Doxygen::specialLists->setAutoDelete(TRUE);
diff --git a/src/doxygen.h b/src/doxygen.h
index 72d3a80..2938a34 100644
--- a/src/doxygen.h
+++ b/src/doxygen.h
@@ -51,8 +51,6 @@ class StringDict : public QDict
};
-extern QCString htmlFileExtension;
-extern int htmlFileExtensionLength;
extern QCString spaces;
/*! \brief This class serves as a namespace for global variables used by doxygen.
@@ -94,6 +92,7 @@ class Doxygen
static QDict expandAsDefinedDict;
static NamespaceDef *globalScope;
static QDict *specialLists; // array of special lists: todo, test, bug, deprecated ...
+ static QCString htmlFileExtension;
};
void initDoxygen();
diff --git a/src/filedef.cpp b/src/filedef.cpp
index c4fd5f4..040e458 100644
--- a/src/filedef.cpp
+++ b/src/filedef.cpp
@@ -321,13 +321,6 @@ void FileDef::writeDocumentation(OutputList &ol)
ol.enableAll();
}
- //ol.disableAllBut(OutputGenerator::Html);
- //ol.writeString((QCString)"Interface collaboration diagram for "
- // "here ");
- //ol.writeString((QCString)"
Include dependency diagram for "+fn+" can be found "+
- // "here .");
- //ol.enableAll();
-
ol.endTextBlock();
ol.startMemberSections();
diff --git a/src/ftvhelp.cpp b/src/ftvhelp.cpp
index e31a3fd..6a60074 100644
--- a/src/ftvhelp.cpp
+++ b/src/ftvhelp.cpp
@@ -347,7 +347,7 @@ static void generateFolderTreeViewData()
}
// Generate alternative index.html as a frame
- fileName=Config_getString("HTML_OUTPUT")+"/index"+htmlFileExtension;
+ fileName=Config_getString("HTML_OUTPUT")+"/index"+Doxygen::htmlFileExtension;
f.setName(fileName);
if (!f.open(IO_WriteOnly))
{
@@ -374,15 +374,15 @@ static void generateFolderTreeViewData()
}
t << "" << endl;
t << "
" << endl;
- t << " " << endl;
- t << " " << endl;
+ t << " " << endl;
+ t << " " << endl;
t << " " << endl;
t << "