summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/classdef.cpp4
-rw-r--r--src/code.l1
-rw-r--r--src/commentscan.h4
-rw-r--r--src/commentscan.l8
-rw-r--r--src/config.h2
-rw-r--r--src/config.xml22
-rw-r--r--src/configimpl.h6
-rw-r--r--src/configimpl.l14
-rw-r--r--src/defargs.l17
-rw-r--r--src/docbookgen.cpp2154
-rw-r--r--src/docbookgen.h2
-rw-r--r--src/docparser.cpp237
-rw-r--r--src/docparser.h2
-rw-r--r--src/doctokenizer.h3
-rw-r--r--src/doctokenizer.l27
-rw-r--r--src/doxygen.cpp19
-rw-r--r--src/fortranscanner.l48
-rw-r--r--src/latexdocvisitor.cpp18
-rw-r--r--src/latexgen.cpp34
-rw-r--r--src/markdown.cpp2
-rw-r--r--src/printdocvisitor.h4
-rw-r--r--src/reflist.cpp24
-rw-r--r--src/rtfdocvisitor.cpp2
-rw-r--r--src/rtfgen.cpp3
-rw-r--r--src/scanner.l8
-rw-r--r--src/tagreader.cpp60
-rw-r--r--src/template.cpp4
-rw-r--r--src/util.cpp29
-rw-r--r--src/util.h5
-rw-r--r--src/vhdlcode.l69
-rw-r--r--src/vhdldocgen.cpp4
-rw-r--r--src/xmldocvisitor.cpp2
32 files changed, 367 insertions, 2471 deletions
diff --git a/src/classdef.cpp b/src/classdef.cpp
index 16fcfbf..944cd8c 100644
--- a/src/classdef.cpp
+++ b/src/classdef.cpp
@@ -674,6 +674,10 @@ void ClassDef::internalInsertMember(MemberDef *md,
case MemberType_Variable:
addMemberToList(MemberListType_variableMembers,md,FALSE);
break;
+ case MemberType_Define:
+ warn(md->getDefFileName(),md->getDefLine()-1,"A define (%s) cannot be made a member of %s",
+ md->name().data(), this->name().data());
+ break;
default:
err("Unexpected member type %d found!\n",md->memberType());
}
diff --git a/src/code.l b/src/code.l
index 3fd2f6a..053b6b5 100644
--- a/src/code.l
+++ b/src/code.l
@@ -2633,6 +2633,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\"
addType();
g_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);
diff --git a/src/commentscan.h b/src/commentscan.h
index e202f0a..d324969 100644
--- a/src/commentscan.h
+++ b/src/commentscan.h
@@ -40,7 +40,7 @@ class ParserInterface;
* @param[in,out] lineNr The line number at which the comment block was found.
* When the function returns it will be set to the last line parsed.
* @param[in] isBrief TRUE iff this comment block represents a brief description.
- * @param[in] isJavaDocStyle TRUE iff this comment block is in "JavaDoc" style.
+ * @param[in] isJavadocStyle TRUE iff this comment block is in "Javadoc" style.
* This means that it starts as a brief description until the end of
* the sentences is found and then proceeds as a detailed description.
* @param[in] isInbody TRUE iff this comment block is located in the body of
@@ -65,7 +65,7 @@ bool parseCommentBlock(ParserInterface *parser,
const QCString &fileName,
int &lineNr,
bool isBrief,
- bool isJavaDocStyle,
+ bool isJavadocStyle,
bool isInbody,
Protection &prot,
int &position,
diff --git a/src/commentscan.l b/src/commentscan.l
index ac83729..1d84917 100644
--- a/src/commentscan.l
+++ b/src/commentscan.l
@@ -1589,8 +1589,12 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
<PageDocArg1>. { // ignore other stuff
}
<PageDocArg2>.*"\n" { // second argument; page title
- yyLineNr++;
- current->args = yytext;
+ yyLineNr++;
+ // bug 748927
+ QCString tmp = yytext;
+ tmp = substitute(substitute(tmp,"@<","&lt;"),"@>","&gt;");
+ tmp = substitute(substitute(tmp,"\\<","&lt;"),"\\>","&gt;");
+ current->args = tmp;
addOutput('\n');
BEGIN( Comment );
}
diff --git a/src/config.h b/src/config.h
index 98f5a92..102774e 100644
--- a/src/config.h
+++ b/src/config.h
@@ -66,7 +66,7 @@ namespace Config
* and replaces environment variables.
* \param clearHeaderAndFooter set to TRUE when writing header and footer templates.
*/
- void postProcess(bool clearHeaderAndFooter);
+ void postProcess(bool clearHeaderAndFooter, bool compare = FALSE);
/*! Check the validity of the parsed options and correct or warn the user where needed. */
void checkAndCorrect();
diff --git a/src/config.xml b/src/config.xml
index 74c50c2..8adaba4 100644
--- a/src/config.xml
+++ b/src/config.xml
@@ -660,7 +660,7 @@ Go to the <a href="commands.html">next</a> section or return to the
<![CDATA[
If the \c MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all
comments according to the Markdown format, which allows for more readable
- documentation. See http://daringfireball.net/projects/markdown/ for details.
+ documentation. See https://daringfireball.net/projects/markdown/ for details.
The output of markdown processing is further processed by doxygen, so you
can mix doxygen, HTML, and XML commands with Markdown formatting.
Disable only in case of backward compatibilities issues.
@@ -2050,15 +2050,15 @@ hr.footer {
<![CDATA[
If the \c GENERATE_DOCSET tag is set to \c YES, additional index files
will be generated that can be used as input for
- <a href="https://developer.apple.com/tools/xcode/">Apple's Xcode 3
+ <a href="https://developer.apple.com/xcode/">Apple's Xcode 3
integrated development environment</a>, introduced with OSX 10.5 (Leopard).
To create a documentation set, doxygen will generate a Makefile in the
HTML output directory. Running \c make will produce the docset in that
directory and running <code>make install</code> will install the docset in
<code>~/Library/Developer/Shared/Documentation/DocSets</code>
so that Xcode will find it at startup. See
- https://developer.apple.com/tools/creatingdocsetswithdoxygen.html for
- more information.
+ https://developer.apple.com/library/archive/featuredarticles/DoxygenXcode/_index.html
+ for more information.
]]>
</docs>
</option>
@@ -2106,7 +2106,7 @@ The \c DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
doxygen generates three additional HTML index files:
\c index.hhp, \c index.hhc, and \c index.hhk. The \c index.hhp is a
project file that can be read by
- <a href="http://www.microsoft.com/en-us/download/details.aspx?id=21138">
+ <a href="https://www.microsoft.com/en-us/download/details.aspx?id=21138">
Microsoft's HTML Help Workshop</a>
on Windows.
<br>
@@ -2202,7 +2202,7 @@ The \c DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
<![CDATA[
The \c QHP_NAMESPACE tag specifies the namespace to use when generating
Qt Help Project output. For more information please see
- <a href="http://doc.qt.io/qt-4.8/qthelpproject.html#namespace">Qt Help Project / Namespace</a>.
+ <a href="http://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace">Qt Help Project / Namespace</a>.
]]>
</docs>
</option>
@@ -2211,7 +2211,7 @@ The \c DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
<![CDATA[
The \c QHP_VIRTUAL_FOLDER tag specifies the namespace to use when
generating Qt Help Project output. For more information please see
- <a href="http://doc.qt.io/qt-4.8/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>.
+ <a href="http://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>.
]]>
</docs>
</option>
@@ -2219,7 +2219,7 @@ The \c DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
<docs>
<![CDATA[
If the \c QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom filter to add. For more information please see
- <a href="http://doc.qt.io/qt-4.8/qthelpproject.html#custom-filters">Qt Help Project / Custom Filters</a>.
+ <a href="http://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters">Qt Help Project / Custom Filters</a>.
]]>
</docs>
</option>
@@ -2228,7 +2228,7 @@ The \c DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
<![CDATA[
The \c QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the custom filter to add.
For more information please see
- <a href="http://doc.qt.io/qt-4.8/qthelpproject.html#custom-filters">Qt Help Project / Custom Filters</a>.
+ <a href="http://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters">Qt Help Project / Custom Filters</a>.
]]>
</docs>
</option>
@@ -2236,7 +2236,7 @@ The \c DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
<docs>
<![CDATA[
The \c QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's filter section matches.
- <a href="http://doc.qt.io/qt-4.8/qthelpproject.html#filter-attributes">Qt Help Project / Filter Attributes</a>.
+ <a href="http://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes">Qt Help Project / Filter Attributes</a>.
]]>
</docs>
</option>
@@ -2386,7 +2386,7 @@ The \c DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
<value name="NativeMML" desc="(i.e. MathML)"/>
<value name="SVG"/>
</option>
- <option type='string' id='MATHJAX_RELPATH' format='string' defval='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/' depends='USE_MATHJAX'>
+ <option type='string' id='MATHJAX_RELPATH' format='string' defval='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/' depends='USE_MATHJAX'>
<docs>
<![CDATA[
When MathJax is enabled you need to specify the location relative to the
diff --git a/src/configimpl.h b/src/configimpl.h
index ef8bb21..1594d47 100644
--- a/src/configimpl.h
+++ b/src/configimpl.h
@@ -75,6 +75,7 @@ class ConfigOption
virtual void writeTemplate(FTextStream &t,bool sl,bool upd) = 0;
virtual void compareDoxyfile(FTextStream &t) = 0;
virtual void convertStrToVal() {}
+ virtual void emptyValueToDefault() {}
virtual void substEnvVars() = 0;
virtual void init() {}
@@ -189,6 +190,7 @@ class ConfigString : public ConfigOption
void compareDoxyfile(FTextStream &t);
void substEnvVars();
void init() { m_value = m_defValue.copy(); }
+ void emptyValueToDefault() { if(m_value.isEmpty()) m_value=m_defValue; };
private:
QCString m_value;
@@ -491,6 +493,10 @@ class ConfigImpl
*/
void convertStrToVal();
+ /*! Sets default value in case value is empty
+ */
+ void emptyValueToDefault();
+
/*! Replaces references to environment variable by the actual value
* of the environment variable.
*/
diff --git a/src/configimpl.l b/src/configimpl.l
index 0779e70..ed5b052 100644
--- a/src/configimpl.l
+++ b/src/configimpl.l
@@ -983,6 +983,15 @@ void ConfigImpl::convertStrToVal()
option->convertStrToVal();
}
}
+void ConfigImpl::emptyValueToDefault()
+{
+ QListIterator<ConfigOption> it = iterator();
+ ConfigOption *option;
+ for (;(option=it.current());++it)
+ {
+ option->emptyValueToDefault();
+ }
+}
static void substEnvVarsInString(QCString &s)
{
@@ -1854,7 +1863,7 @@ void Config::writeTemplate(FTextStream &t,bool shortList,bool update)
void Config::compareDoxyfile(FTextStream &t)
{
- postProcess(FALSE);
+ postProcess(FALSE, TRUE);
ConfigImpl::instance()->compareDoxyfile(t);
}
@@ -1863,9 +1872,10 @@ bool Config::parse(const char *fileName,bool update)
return ConfigImpl::instance()->parse(fileName,update);
}
-void Config::postProcess(bool clearHeaderAndFooter)
+void Config::postProcess(bool clearHeaderAndFooter, bool compare)
{
ConfigImpl::instance()->substituteEnvironmentVars();
+ if (!compare)ConfigImpl::instance()->emptyValueToDefault();
ConfigImpl::instance()->convertStrToVal();
// avoid bootstrapping issues when the config file already
diff --git a/src/defargs.l b/src/defargs.l
index 7f1e1bb..52052fa 100644
--- a/src/defargs.l
+++ b/src/defargs.l
@@ -52,6 +52,7 @@
#include <assert.h>
#include <ctype.h>
#include <qregexp.h>
+#include <qcstringlist.h>
#include "defargs.h"
#include "entry.h"
@@ -102,6 +103,19 @@ static int yyread(char *buf,int max_size)
return c;
}
+/* bug_520975 */
+static bool checkSpecialType(QCString &typ, QCString &nam)
+{
+ if (nam == "unsigned" || nam == "signed" ||
+ nam == "volatile" || nam == "const") return TRUE;
+ QCStringList qsl=QCStringList::split(' ',typ);
+ for (uint j=0;j<qsl.count();j++)
+ {
+ if (!(qsl[j] == "unsigned" || qsl[j] == "signed" ||
+ qsl[j] == "volatile" || qsl[j] == "const")) return FALSE;
+ }
+ return TRUE;
+}
%}
B [ \t]
@@ -384,8 +398,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\"
a->type.mid(sv)=="union" ||
a->type.mid(sv)=="class" ||
a->type.mid(sv)=="typename" ||
- a->type=="const" ||
- a->type=="volatile"
+ checkSpecialType(a->type, a->name)
)
{
a->type = a->type + " " + a->name;
diff --git a/src/docbookgen.cpp b/src/docbookgen.cpp
index 09ff14f..48b5d9e 100644
--- a/src/docbookgen.cpp
+++ b/src/docbookgen.cpp
@@ -70,54 +70,6 @@
#endif
//------------------
-class DocbookSectionMapper : public QIntDict<char>
-{
- public:
- DocbookSectionMapper() : QIntDict<char>(47)
- {
- insert(MemberListType_pubTypes,"public-type");
- insert(MemberListType_pubMethods,"public-func");
- insert(MemberListType_pubAttribs,"public-attrib");
- insert(MemberListType_pubSlots,"public-slot");
- insert(MemberListType_signals,"signal");
- insert(MemberListType_dcopMethods,"dcop-func");
- insert(MemberListType_properties,"property");
- insert(MemberListType_events,"event");
- insert(MemberListType_pubStaticMethods,"public-static-func");
- insert(MemberListType_pubStaticAttribs,"public-static-attrib");
- insert(MemberListType_proTypes,"protected-type");
- insert(MemberListType_proMethods,"protected-func");
- insert(MemberListType_proAttribs,"protected-attrib");
- insert(MemberListType_proSlots,"protected-slot");
- insert(MemberListType_proStaticMethods,"protected-static-func");
- insert(MemberListType_proStaticAttribs,"protected-static-attrib");
- insert(MemberListType_pacTypes,"package-type");
- insert(MemberListType_pacMethods,"package-func");
- insert(MemberListType_pacAttribs,"package-attrib");
- insert(MemberListType_pacStaticMethods,"package-static-func");
- insert(MemberListType_pacStaticAttribs,"package-static-attrib");
- insert(MemberListType_priTypes,"private-type");
- insert(MemberListType_priMethods,"private-func");
- insert(MemberListType_priAttribs,"private-attrib");
- insert(MemberListType_priSlots,"private-slot");
- insert(MemberListType_priStaticMethods,"private-static-func");
- insert(MemberListType_priStaticAttribs,"private-static-attrib");
- insert(MemberListType_friends,"friend");
- insert(MemberListType_related,"related");
- insert(MemberListType_decDefineMembers,"define");
- insert(MemberListType_decProtoMembers,"prototype");
- insert(MemberListType_decTypedefMembers,"typedef");
- insert(MemberListType_decSequenceMembers,"sequence");
- insert(MemberListType_decDictionaryMembers,"dictionary");
- insert(MemberListType_decEnumMembers,"enum");
- insert(MemberListType_decFuncMembers,"func");
- insert(MemberListType_decVarMembers,"var");
- }
-};
-
-static DocbookSectionMapper g_docbookSectionMapper;
-
-
inline void writeDocbookString(FTextStream &t,const char *s)
{
t << convertToDocBook(s);
@@ -151,20 +103,6 @@ inline void writeDocbookCodeString(FTextStream &t,const char *s, int &col)
}
}
-static void writeDocbookHeaderMainpage(FTextStream &t, QCString &pageName)
-{
- t << "<?xml version='1.0' encoding='UTF-8' standalone='no'?>" << endl;;
- t << "<chapter xmlns=\"http://docbook.org/ns/docbook\" version=\"5.0\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"";
- if (!pageName.isEmpty()) t << " xml:id=\"_" << pageName << "\"";
- t << ">" << endl;
-}
-
-static void writeDocbookHeader_ID(FTextStream &t, QCString id)
-{
- t << "<?xml version='1.0' encoding='UTF-8' standalone='no'?>" << endl;;
- t << "<section xmlns=\"http://docbook.org/ns/docbook\" version=\"5.0\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xml:id=\"_" << id << "\">" << endl;
-}
-
static void addIndexTerm(FTextStream &t, QCString prim, QCString sec = "")
{
t << "<indexterm><primary>";
@@ -189,25 +127,6 @@ void writeDocbookLink(FTextStream &t,const char * /*extRef*/,const char *compoun
t << "</link>";
}
-class TextGeneratorDocbookImpl : public TextGeneratorIntf
-{
- public:
- TextGeneratorDocbookImpl(FTextStream &t): m_t(t) {}
- void writeString(const char *s,bool /*keepSpaces*/) const
- {
- writeDocbookString(m_t,s);
- }
- void writeBreak(int) const {}
- void writeLink(const char *extRef,const char *file,
- const char *anchor,const char *text
- ) const
- {
- writeDocbookLink(m_t,extRef,file,anchor,text,0);
- }
- private:
- FTextStream &m_t;
-};
-
DocbookCodeGenerator::DocbookCodeGenerator(FTextStream &t) : m_lineNumber(-1), m_col(0),
m_insideCodeLine(FALSE), m_insideSpecialHL(FALSE)
{
@@ -330,2079 +249,6 @@ void DocbookCodeGenerator::endCodeFragment()
m_t << "</computeroutput></literallayout>" << endl;
}
-static void writeTemplateArgumentList(ArgumentList *al,
- FTextStream &t,
- Definition *scope,
- FileDef *fileScope,
- int indent)
-{
- QCString indentStr;
- indentStr.fill(' ',indent);
- if (al)
- {
- t << indentStr << "<templateparamlist>" << endl;
- ArgumentListIterator ali(*al);
- Argument *a;
- for (ali.toFirst();(a=ali.current());++ali)
- {
- t << indentStr << " <param>" << endl;
- if (!a->type.isEmpty())
- {
- t << indentStr << " <type>";
- linkifyText(TextGeneratorDocbookImpl(t),scope,fileScope,0,a->type);
- t << "</type>" << endl;
- }
- if (!a->name.isEmpty())
- {
- t << indentStr << " <declname>" << a->name << "</declname>" << endl;
- t << indentStr << " <defname>" << a->name << "</defname>" << endl;
- }
- if (!a->defval.isEmpty())
- {
- t << indentStr << " <defval>";
- linkifyText(TextGeneratorDocbookImpl(t),scope,fileScope,0,a->defval);
- t << "</defval>" << endl;
- }
- t << indentStr << " </param>" << endl;
- }
- t << indentStr << "</templateparamlist>" << endl;
- }
-}
-
-static void writeTemplateList(ClassDef *cd,FTextStream &t)
-{
- writeTemplateArgumentList(cd->templateArguments(),t,cd,0,4);
-}
-
-static void writeDocbookDocBlock(FTextStream &t,
- const QCString &fileName,
- int lineNr,
- Definition *scope,
- MemberDef * md,
- const QCString &text)
-{
- QCString stext = text.stripWhiteSpace();
- if (stext.isEmpty()) return;
- // convert the documentation string into an abstract syntax tree
- DocNode *root = validatingParseDoc(fileName,lineNr,scope,md,text,FALSE,FALSE);
- // create a code generator
- DocbookCodeGenerator *docbookCodeGen = new DocbookCodeGenerator(t);
- // create a parse tree visitor for Docbook
- DocbookDocVisitor *visitor = new DocbookDocVisitor(t,*docbookCodeGen);
- // visit all nodes
- root->accept(visitor);
- // clean up
- delete visitor;
- delete docbookCodeGen;
- delete root;
-}
-
-void writeDocbookCodeBlock(FTextStream &t,FileDef *fd)
-{
- ParserInterface *pIntf=Doxygen::parserManager->getParser(fd->getDefFileExtension());
- SrcLangExt langExt = getLanguageFromFileName(fd->getDefFileExtension());
- pIntf->resetCodeParserState();
- DocbookCodeGenerator *docbookGen = new DocbookCodeGenerator(t);
- pIntf->parseCode(*docbookGen, // codeOutIntf
- 0, // scopeName
- fileToString(fd->absFilePath(),Config_getBool(FILTER_SOURCE_FILES)),
- langExt, // lang
- FALSE, // isExampleBlock
- 0, // exampleName
- fd, // fileDef
- -1, // startLine
- -1, // endLine
- FALSE, // inlineFragement
- 0, // memberDef
- TRUE // showLineNumbers
- );
- docbookGen->finish();
- delete docbookGen;
-}
-
-static QCString classOutputFileBase(ClassDef *cd)
-{
- //static bool inlineGroupedClasses = Config_getBool(INLINE_GROUPED_CLASSES);
- //if (inlineGroupedClasses && cd->partOfGroups()!=0)
- return cd->getOutputFileBase();
- //else
- // return cd->getOutputFileBase();
-}
-
-static QCString memberOutputFileBase(MemberDef *md)
-{
- //static bool inlineGroupedClasses = Config_getBool(INLINE_GROUPED_CLASSES);
- //if (inlineGroupedClasses && md->getClassDef() && md->getClassDef()->partOfGroups()!=0)
- // return md->getClassDef()->getDocbookOutputFileBase();
- //else
- // return md->getOutputFileBase();
- return md->getOutputFileBase();
-}
-
-static void generateTOC(FTextStream &t, PageDef *pd)
-{
- if (pd->localToc().isDocbookEnabled())
- {
- t << " <toc>" << endl;
- t << " <title>" << theTranslator->trRTFTableOfContents() << "</title>" << endl;
- SectionDict *sectionDict = pd->getSectionDict();
- SDict<SectionInfo>::Iterator li(*sectionDict);
- SectionInfo *si;
- int level=1,l;
- bool inLi[5]={ FALSE, FALSE, FALSE, FALSE, FALSE };
- int maxLevel = pd->localToc().docbookLevel();
- for (li.toFirst();(si=li.current());++li)
- {
- if (si->type==SectionInfo::Section ||
- si->type==SectionInfo::Subsection ||
- si->type==SectionInfo::Subsubsection ||
- si->type==SectionInfo::Paragraph)
- {
- //printf(" level=%d title=%s\n",level,si->title.data());
- int nextLevel = (int)si->type;
- if (nextLevel>level)
- {
- for (l=level;l<nextLevel;l++)
- {
- if (l < maxLevel) t << " <tocdiv>" << endl;
- }
- }
- else if (nextLevel<level)
- {
- for (l=level;l>nextLevel;l--)
- {
- inLi[l]=FALSE;
- if (l <= maxLevel) t << " </tocdiv>" << endl;
- }
- }
- if (nextLevel <= maxLevel)
- {
- QCString titleDoc = convertToDocBook(si->title);
- t << " <tocentry>" << (si->title.isEmpty()?si->label:titleDoc) << "</tocentry>" << endl;
- }
- inLi[nextLevel]=TRUE;
- level = nextLevel;
- }
- }
- t << " </toc>" << endl;
- }
-}
-
-static void generateSourceRefList(FTextStream &t,const char *scopeName, const QCString &text,MemberSDict *members, Definition *def)
-{
- static bool sourceBrowser = Config_getBool(SOURCE_BROWSER);
- static bool refLinkSource = Config_getBool(REFERENCES_LINK_SOURCE);
-
- if (members)
- {
- members->sort();
-
- t << "<formalpara><title>" << convertToDocBook(text) << "</title><para>";
-
- QCString ldefLine=theTranslator->trWriteList(members->count());
-
- QRegExp marker("@[0-9]+");
- int index=0,newIndex,matchLen;
- // now replace all markers in inheritLine with links to the classes
- while ((newIndex=marker.match(ldefLine,index,&matchLen))!=-1)
- {
- bool ok;
- t << convertToDocBook(ldefLine.mid(index,newIndex-index));
- uint entryIndex = ldefLine.mid(newIndex+1,matchLen-1).toUInt(&ok);
- MemberDef *md=members->at(entryIndex);
- if (ok && md)
- {
- QCString scope=md->getScopeString();
- QCString name=md->name();
- //printf("class=%p scope=%s scopeName=%s\n",md->getClassDef(),scope.data(),scopeName);
- if (!scope.isEmpty() && scope!=scopeName)
- {
- name.prepend(scope+getLanguageSpecificSeparator(def->getLanguage()));
- }
- if (!md->isObjCMethod() &&
- (md->isFunction() || md->isSlot() ||
- md->isPrototype() || md->isSignal()
- )
- )
- {
- name+="()";
- }
- //Definition *d = md->getOutputFileBase();
- //if (d==Doxygen::globalScope) d=md->getBodyDef();
- if (sourceBrowser &&
- !(md->isLinkable() && !refLinkSource) &&
- md->getStartBodyLine()!=-1 &&
- md->getBodyDef()
- )
- {
- //printf("md->getBodyDef()=%p global=%p\n",md->getBodyDef(),Doxygen::globalScope);
-
- const int maxLineNrStr = 10;
- char anchorStr[maxLineNrStr];
- qsnprintf(anchorStr,maxLineNrStr,"l%05d",md->getStartBodyLine());
- //printf("Write object link to %s\n",md->getBodyDef()->getSourceFileBase().data());
- t << convertToDocBook(name);
- // or
- // ol.writeObjectLink(0,md->getBodyDef()->getSourceFileBase(),anchorStr,name);
- }
- else if (md->isLinkable() /*&& d && d->isLinkable()*/)
- {
- t << convertToDocBook(name);
- // or
- // ol.writeObjectLink(md->getReference(), md->getOutputFileBase(), md->anchor(),name);
- }
- else
- {
- t << convertToDocBook(name);
- }
- }
- index=newIndex+matchLen;
- }
- t << ldefLine.right(ldefLine.length()-index);
- t<< ".";
- t << "</para></formalpara>";
- }
-}
-static void generateInlineCode(FTextStream &t,const char *scopeName, Definition *def)
-{
- static bool inlineSources = Config_getBool(INLINE_SOURCES);
- //printf("Source Fragment %s: %d-%d bodyDef=%p\n",name().data(),
- // m_startBodyLine,m_endBodyLine,m_bodyDef);
- if (inlineSources && def->hasSources())
- {
- QCString codeFragment;
- int actualStart=def->getStartBodyLine(),actualEnd=def->getEndBodyLine();
- if (readCodeFragment(def->getBodyDef()->absFilePath(),
- actualStart,actualEnd,codeFragment)
- )
- {
- //printf("Adding code fragment '%s' ext='%s'\n",
- // codeFragment.data(),m_impl->defFileExt.data());
- ParserInterface *pIntf = Doxygen::parserManager->getParser(def->getDefFileExtension());
- pIntf->resetCodeParserState();
- //printf("Read:\n`%s'\n\n",codeFragment.data());
- MemberDef *thisMd = 0;
- if (def->definitionType()==Definition::TypeMember) thisMd = (MemberDef *)def;
-
- DocbookCodeGenerator *docbookGen = new DocbookCodeGenerator(t);
- docbookGen->startCodeFragment();
- pIntf->parseCode(*docbookGen, // codeOutIntf
- scopeName, // scope
- codeFragment, // input
- def->getLanguage(), // lang
- FALSE, // isExample
- 0, // exampleName
- def->getBodyDef(), // fileDef
- actualStart, // startLine
- actualEnd, // endLine
- TRUE, // inlineFragment
- thisMd, // memberDef
- TRUE // show line numbers
- );
- docbookGen->finish();
- docbookGen->endCodeFragment();
- delete docbookGen;
- }
- }
-}
-
-static void definedAtLine(int line, QCString fileName, FTextStream &t)
-{
- QCString refText = theTranslator->trDefinedAtLineInSourceFile();
- int lineMarkerPos = refText.find("@0");
- int fileMarkerPos = refText.find("@1");
- if (lineMarkerPos!=-1 && fileMarkerPos!=-1) // should always pass this.
- {
- if (lineMarkerPos<fileMarkerPos) // line marker before file marker
- {
- t << refText.left(lineMarkerPos)
- << line
- << refText.mid(lineMarkerPos+2, fileMarkerPos-lineMarkerPos-2)
- << fileName
- << refText.right(refText.length()-fileMarkerPos-2);
- }
- else // file marker before line marker
- {
- t << refText.left(fileMarkerPos)
- << fileName
- << refText.mid(fileMarkerPos+2, lineMarkerPos-fileMarkerPos-2)
- << line
- << refText.right(refText.length()-lineMarkerPos-2);
- }
- }
- else
- {
- err("translation error: invalid markers in trDefinedAtLineInSourceFile()\n");
- }
-}
-
-static void generateDocbookForMember(MemberDef *md,FTextStream &t,Definition *def, bool detailed=0)
-{
- // + declaration/definition arg lists
- // + reimplements
- // + reimplementedBy
- // + exceptions
- // + const/volatile specifiers
- // - examples
- // + source definition
- // + source references
- // + source referenced by
- // - body code
- // + template arguments
- // (templateArguments(), definitionTemplateParameterLists())
- // - call graph
-
- // 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;
- QCString memType;
- switch (md->memberType())
- {
- case MemberType_Define: memType="define"; break;
- case MemberType_Function: memType="function"; break;
- case MemberType_Variable: memType="variable"; break;
- case MemberType_Typedef: memType="typedef"; break;
- case MemberType_Enumeration: memType="enum"; break;
- case MemberType_EnumValue: ASSERT(0); break;
- case MemberType_Signal: memType="signal"; break;
- case MemberType_Slot: memType="slot"; break;
- case MemberType_Friend: memType="friend"; break;
- case MemberType_DCOP: memType="dcop"; break;
- case MemberType_Property: memType="property"; break;
- case MemberType_Event: memType="event"; break;
- case MemberType_Interface: memType="interface"; break;
- case MemberType_Service: memType="service"; break;
- case MemberType_Sequence: memType="sequence"; break;
- case MemberType_Dictionary: memType="dictionary"; break;
- }
- QCString scopeName;
- if (md->getClassDef())
- {
- scopeName=md->getClassDef()->name();
- }
- else if (md->getNamespaceDef())
- {
- scopeName=md->getNamespaceDef()->name();
- }
- if (detailed==0)
- {
- t << " <para>" << endl;
- t << " <itemizedlist>" << endl;
- t << " <listitem>" << endl;
- //enum
- bool closePara=TRUE;
- if (md->memberType()==MemberType_Enumeration)
- {
- bool inLi[5]={ FALSE, FALSE, FALSE, FALSE, FALSE };
- MemberList *enumFields = md->enumFieldList();
- t << " <para><literallayout>" << memType << " <link linkend=\"_";
- if (md->getGroupDef() && def->definitionType()==Definition::TypeGroup)
- {
- t << md->getGroupDef()->getOutputFileBase();
- }
- else
- {
- t << memberOutputFileBase(md);
- }
- t << "_1" << md->anchor() << "\">" << convertToDocBook(md->name()) << "</link>";
- if (enumFields!=0)
- {
- MemberListIterator emli(*enumFields);
- MemberDef *emd;
- t << " {" << endl;
- int cnt=0;
- for (emli.toFirst();(emd=emli.current());++emli)
- {
- if (cnt!=0)
- {
- t << "," << endl;
- }
- t << "<link linkend=\"_" << memberOutputFileBase(emd) << "_1" << emd->anchor() << "\">";
- writeDocbookString(t,emd->name());
- t << "</link>";
- if (!emd->initializer().isEmpty())
- {
- writeDocbookString(t,emd->initializer());
- }
- cnt++;
- }
- t << endl << "}";
- }
- t << "</literallayout>" << endl;
- if (md->briefDescription())
- {
- t << "<para><emphasis>";
- writeDocbookString(t,md->briefDescription());
- t << "</emphasis></para>" << endl;
- }
- }
- else if (md->memberType()==MemberType_Define)
- {
- t << " <para>" << "#" << memType << " <link linkend=\"_";
- if (md->getGroupDef() && def->definitionType()==Definition::TypeGroup)
- {
- t << md->getGroupDef()->getOutputFileBase();
- }
- else
- {
- t << memberOutputFileBase(md);
- }
- t << "_1" << md->anchor() << "\">" << convertToDocBook(md->name()) << "</link>";
- if (!md->initializer().isEmpty() && md->initializer().length()<2000)
- {
- t << " ";
- linkifyText(TextGeneratorDocbookImpl(t),def,md->getBodyDef(),md,md->initializer());
- }
- if (md->briefDescription())
- {
- t << "<para><emphasis>";
- writeDocbookString(t,md->briefDescription());
- t << "</emphasis></para>" << endl;
- }
- }
- else if (md->memberType()==MemberType_Variable)
- {
- if (md->getClassDef())
- {
- t << " <para>" << convertToDocBook(md->declaration());
- if (md->briefDescription())
- {
- t << "<para><emphasis>";
- writeDocbookString(t,md->briefDescription());
- t << "</emphasis></para>";
- }
- }
- else
- {
- t << " <para>";
- linkifyText(TextGeneratorDocbookImpl(t),def,md->getBodyDef(),md,md->typeString());
- t << " <link linkend=\"_";
- if (md->getGroupDef() && def->definitionType()==Definition::TypeGroup)
- {
- t << md->getGroupDef()->getOutputFileBase();
- }
- else
- {
- t << memberOutputFileBase(md);
- }
- t << "_1" << md->anchor() << "\">" << convertToDocBook(md->name()) << "</link>";
- if (md->briefDescription())
- {
- t << "<para><emphasis>";
- writeDocbookString(t,md->briefDescription());
- t << "</emphasis></para>" << endl;
- }
- }
- }
- else if (md->memberType()==MemberType_Typedef || md->memberType()==MemberType_Sequence ||
- md->memberType()==MemberType_Dictionary)
- {
- t << " <para>" << memType;
- t << " ";
- linkifyText(TextGeneratorDocbookImpl(t),def,md->getBodyDef(),md,md->typeString());
- t << " ";
- t << " <link linkend=\"_";
- if (md->getGroupDef() && def->definitionType()==Definition::TypeGroup)
- {
- t << md->getGroupDef()->getOutputFileBase();
- }
- else
- {
- t << memberOutputFileBase(md);
- }
- t << "_1" << md->anchor() << "\">" << convertToDocBook(md->name()) << "</link>";
- if (md->briefDescription())
- {
- t << "<para><emphasis>";
- writeDocbookString(t,md->briefDescription());
- t << "</emphasis></para>" << endl;
- }
- }
- else if (md->memberType()==MemberType_Function)
- {
- t << " <para>";
- linkifyText(TextGeneratorDocbookImpl(t),def,md->getBodyDef(),md,md->typeString());
- t << " <link linkend=\"_";
- if (md->getGroupDef() && def->definitionType()==Definition::TypeGroup)
- {
- t << md->getGroupDef()->getOutputFileBase();
- }
- else
- {
- t << memberOutputFileBase(md);
- }
- t << "_1" << md->anchor() << "\">" << convertToDocBook(md->name()) << "</link>";
- t << " (" << endl;
- ArgumentList *declAl = md->declArgumentList();
- if (declAl && declAl->count()>0)
- {
- ArgumentListIterator declAli(*declAl);
- Argument *a;
- int cnt=0;
- for (declAli.toFirst();(a=declAli.current());++declAli)
- {
- if (cnt!=0)
- {
- t << ", ";
- }
- if (!a->type.isEmpty())
- {
- linkifyText(TextGeneratorDocbookImpl(t),def,md->getBodyDef(),md,a->type);
- }
- t << " ";
- if (!a->name.isEmpty())
- {
- writeDocbookString(t,a->name);
- }
- cnt++;
- }
- }
- t << ")";
- if (md->briefDescription())
- {
- t << "<para><emphasis>";
- writeDocbookString(t,md->briefDescription());
- t << "</emphasis></para>" << endl;
- }
- }
- else
- {
- closePara = FALSE;
- }
- if (closePara) t << "</para>" << endl;
- t << " </listitem>" << endl;
- t << " </itemizedlist>" << endl;
- t << " </para>" << endl;
- }
- else
- {
- if (md->memberType()==MemberType_Enumeration)
- {
- MemberList *enumFields = md->enumFieldList();
- t << " <section xml:id=\"_";
- if (md->getGroupDef() && def->definitionType()==Definition::TypeGroup)
- {
- t << md->getGroupDef()->getOutputFileBase();
- }
- else
- {
- t << memberOutputFileBase(md);
- }
- t << "_1" << md->anchor() << "\">" << endl;
- t << " <title>" << memType << " " << convertToDocBook(md->name()) << " " << "</title>" << endl;
- t << " ";
- writeDocbookDocBlock(t,md->docFile(),md->docLine(),md->getOuterScope(),md,md->documentation());
- t << endl;
- if (enumFields!=0)
- {
- MemberListIterator emli(*enumFields);
- MemberDef *emd;
- t << " <formalpara>" << endl;
- t << " <title>" << theTranslator->trEnumerationValues() << ":</title>" << endl;
- t << " <variablelist>" << endl;
- for (emli.toFirst();(emd=emli.current());++emli)
- {
- t << " <varlistentry xml:id=\"_";
- t << memberOutputFileBase(emd) << "_1" << emd->anchor() << "\">" << endl;
- t << " <term>";
- writeDocbookString(t,emd->name());
- t << "</term>" << endl;
- t << " <listitem>" << endl;
- if(Config_getBool(REPEAT_BRIEF))
- {
- t << " <para>";
- writeDocbookString(t,emd->briefDescription());
- t << "</para>" << endl;
- }
- t << " </listitem>" << endl;
- t << " </varlistentry>" << endl;
- }
- t << " </variablelist>" << endl;
- t << " </formalpara>" << endl;
- t << " <para>";
- t << " <para>";
- definedAtLine(md->getDefLine(),stripPath(md->getDefFileName()),t);
- t << "</para>" << endl;
-
- t << " <literallayout><computeroutput>" << endl;
- t << "{" << endl;
- for (emli.toFirst();(emd=emli.current());++emli)
- {
- writeDocbookString(t,emd->name());
- if (!emd->initializer().isEmpty())
- {
- writeDocbookString(t,emd->initializer());
- }
- t << ", " << endl;
- }
- t << "}" << convertToDocBook(md->name()) << ";" << endl;
- t << " </computeroutput></literallayout>" << endl;
- t << " </para>" << endl;
- }
- t << " </section>" << endl;
- }
- else if (md->memberType()==MemberType_Typedef)
- {
- t << " <section xml:id=\"_";
- if (md->getGroupDef() && def->definitionType()==Definition::TypeGroup)
- {
- t << md->getGroupDef()->getOutputFileBase();
- }
- else
- {
- t << memberOutputFileBase(md);
- }
- t << "_1" << md->anchor() << "\">" << endl;
- t << " <title>" << convertToDocBook(md->definition()) << "</title>";
- if(Config_getBool(REPEAT_BRIEF))
- {
- t << " <emphasis>";
- writeDocbookString(t,md->briefDescription());
- t << "</emphasis>" << endl;
- }
- t << " ";
- writeDocbookDocBlock(t,md->docFile(),md->docLine(),md->getOuterScope(),md,md->documentation());
- t << endl;
- t << " </section>" << endl;
- }
- else if (md->memberType()==MemberType_Function)
- {
- t << " <section xml:id=\"_";
- if (md->getGroupDef() && def->definitionType()==Definition::TypeGroup)
- {
- t << md->getGroupDef()->getOutputFileBase();
- }
- else
- {
- t << memberOutputFileBase(md);
- }
- t << "_1" << md->anchor() << "\">" << endl;
- t << " <title>" << convertToDocBook(md->definition()) << " " << convertToDocBook(md->argsString()) << "</title>";
- addIndexTerm(t,md->name(),def->name());
- addIndexTerm(t,def->name(),md->name());
- if(Config_getBool(REPEAT_BRIEF))
- {
- if (!md->briefDescription().isEmpty())
- {
- t << " <emphasis>";
- writeDocbookString(t,md->briefDescription());
- t << "</emphasis>" << endl;
- }
- }
- t << " ";
- writeDocbookDocBlock(t,md->docFile(),md->docLine(),md->getOuterScope(),md,md->documentation());
- t << endl;
-
- if (Config_getBool(REFERENCED_BY_RELATION))
- {
- generateSourceRefList(t,md->name(),theTranslator->trReferencedBy(),md->getReferencedByMembers(),md);
- }
- if (Config_getBool(REFERENCES_RELATION))
- {
- generateSourceRefList(t,md->name(),theTranslator->trReferences(),md->getReferencesMembers(),md);
- }
- generateInlineCode(t,md->name(),md);
- t << " </section>" << endl;
- }
- else if (md->memberType()==MemberType_Define)
- {
- if (md->documentation())
- {
- t << " <section xml:id=\"_";
- if (md->getGroupDef() && def->definitionType()==Definition::TypeGroup)
- {
- t << md->getGroupDef()->getOutputFileBase();
- }
- else
- {
- t << memberOutputFileBase(md);
- }
- t << "_1" << md->anchor() << "\">" << endl;
- t << " <title>" << convertToDocBook(md->definition()) << "</title>";
- t << " ";
- writeDocbookDocBlock(t,md->docFile(),md->docLine(),md->getOuterScope(),md,md->documentation());
- t << endl;
- t << " </section>" << endl;
- }
- }
- else if (md->memberType()==MemberType_Variable)
- {
- if (md->getClassDef())
- {
- if (md->documentation())
- {
- t << " <section xml:id=\"_";
- if (md->getGroupDef() && def->definitionType()==Definition::TypeGroup)
- {
- t << md->getGroupDef()->getOutputFileBase();
- }
- else
- {
- t << memberOutputFileBase(md);
- }
- t << "_1" << md->anchor() << "\">" << endl;
- t << " <title>" << convertToDocBook(md->definition()) << "</title>";
- addIndexTerm(t,md->name(),def->name());
- addIndexTerm(t,def->name(),md->name());
- t << " ";
- writeDocbookDocBlock(t,md->docFile(),md->docLine(),md->getOuterScope(),md,md->documentation());
- t << endl;
- t << " </section>" << endl;
- }
- }
- else
- {
- t << " <section xml:id=\"_";
- if (md->getGroupDef() && def->definitionType()==Definition::TypeGroup)
- {
- t << md->getGroupDef()->getOutputFileBase();
- }
- else
- {
- t << memberOutputFileBase(md);
- }
- t << "_1" << md->anchor() << "\">" << endl;
- t << " <title>" << convertToDocBook(md->definition()) << "</title>";
- addIndexTerm(t,md->name(),def->name());
- addIndexTerm(t,def->name(),md->name());
- if(Config_getBool(REPEAT_BRIEF))
- {
- t << " <emphasis>";
- writeDocbookString(t,md->briefDescription());
- t << "</emphasis>" << endl;
- }
- t << " ";
- writeDocbookDocBlock(t,md->docFile(),md->docLine(),md->getOuterScope(),md,md->documentation());
- t << endl;
- t << " </section>" << endl;
- }
- }
- }
-}
-
-static void generateDocbookSection(Definition *d,FTextStream &t,MemberList *ml,const char *,
- bool detailed=0, const char *header=0,const char *documentation=0)
-{
- if (ml==0) return;
- MemberListIterator mli(*ml);
- MemberDef *md;
- int count=0;
- int doc_count=0;
- QCString title, desctitle, subtitle;
-
- for (mli.toFirst();(md=mli.current());++mli)
- {
- // namespace members are also inserted in the file scope, but
- // to prevent this duplication in the Docbook output, we filter those here.
- if (d->definitionType()!=Definition::TypeFile || md->getNamespaceDef()==0)
- {
- count++;
- }
- }
-
- if (count==0) return; // empty list
-
- subtitle = "";
- switch (ml->listType())
- {
- case MemberListType_pubMethods: d->getLanguage()==SrcLangExt_ObjC ? title = theTranslator->trInstanceMethods() : title = theTranslator->trPublicMembers();
- switch (d->getLanguage())
- {
- case SrcLangExt_ObjC: desctitle = theTranslator->trMethodDocumentation(); break;
- case SrcLangExt_Fortran: desctitle = theTranslator->trMemberFunctionDocumentationFortran(); break;
- default: desctitle = theTranslator->trMemberFunctionDocumentation(); break;
- };
- break;
- case MemberListType_priMethods: title=theTranslator->trPrivateMembers(); desctitle=""; break;
-
- case MemberListType_decTypedefMembers: title=theTranslator->trTypedefs(); desctitle=theTranslator->trTypedefDocumentation(); break;
- case MemberListType_decSequenceMembers: title=theTranslator->trSequences(); desctitle=theTranslator->trSequenceDocumentation(); break;
- case MemberListType_decDictionaryMembers: title=theTranslator->trDictionaries(); desctitle=theTranslator->trDictionaryDocumentation(); break;
- case MemberListType_decEnumMembers: title=theTranslator->trEnumerations(); desctitle=theTranslator->trEnumerationTypeDocumentation(); break;
- case MemberListType_decFuncMembers: title=theTranslator->trFunctions(); desctitle=theTranslator->trFunctionDocumentation(); break;
- case MemberListType_decVarMembers: title=theTranslator->trVariables(); desctitle=theTranslator->trVariableDocumentation(); break;
- case MemberListType_pubAttribs: title=theTranslator->trPublicAttribs(); desctitle=theTranslator->trMemberDataDocumentation(); break;
- case MemberListType_priAttribs: title=theTranslator->trPrivateAttribs(); desctitle=theTranslator->trMemberDataDocumentation(); break;
- case MemberListType_proAttribs: title=theTranslator->trProtectedAttribs(); desctitle=theTranslator->trMemberDataDocumentation(); break;
- case MemberListType_decDefineMembers: title=theTranslator->trDefines(); desctitle=theTranslator->trDefineDocumentation(); break;
- case MemberListType_related: title=theTranslator->trRelatedFunctions(); desctitle=theTranslator->trRelatedFunctionDocumentation();
- subtitle=theTranslator->trRelatedSubscript(); break;
- default: title=""; desctitle="";
- }
-
- if (detailed)
- {
- for (mli.toFirst();(md=mli.current());++mli)
- {
- if (md->documentation().isEmpty() && !Config_getBool(REPEAT_BRIEF))
- {
- continue;
- }
- doc_count = 1;
- break;
- }
-
- if(doc_count == 0) return;
-
- if (!QCString(header).isEmpty())
- {
- t << " <section>" << endl;
- t << " <title>" << convertToDocBook(header) << "</title>" << endl;
- }
- else if (desctitle)
- {
- t << " <section>" << endl;
- t << " <title>" << desctitle << "</title>" << endl;
- }
- }
- else
- {
- t << " <section>" << endl;
- if (!QCString(header).isEmpty())
- {
- t << " <title>" << convertToDocBook(header) << "</title>" << endl;
- }
- else
- {
- t << " <title>" << title << "</title>" << endl;
- }
- if (!subtitle.isEmpty())
- t << " <para>" << subtitle << "</para>" << endl;
- }
-
- if (documentation)
- {
- t << " <description>";
- writeDocbookDocBlock(t,d->docFile(),d->docLine(),d,0,documentation);
- t << "</description>" << endl;
- }
- for (mli.toFirst();(md=mli.current());++mli)
- {
- // namespace members are also inserted in the file scope, but
- // to prevent this duplication in the Docbook output, we filter those here.
- if (d->definitionType()!=Definition::TypeFile || md->getNamespaceDef()==0)
- {
- if (detailed && md->documentation().isEmpty() && !Config_getBool(REPEAT_BRIEF))
- {
- continue;
- }
-
- generateDocbookForMember(md,t,d,detailed);
- }
- }
- if (detailed)
- {
- if (!QCString(header).isEmpty())
- {
- t << " </section>" << endl;
- }
- else if (desctitle)
- {
- t << " </section>" << endl;
- }
- }
- else
- {
- t << " </section>" << endl;
- }
-}
-
-static void writeInnerClasses(const ClassSDict *cl,FTextStream &t)
-{
- if (cl)
- {
- ClassSDict::Iterator cli(*cl);
- ClassDef *cd;
- QCString title = theTranslator->trClasses();
-
- if (cli.toFirst())
- {
- t << " <section>" << endl;
- t << " <title> " << title << " </title>" << endl;
- }
- for (cli.toFirst();(cd=cli.current());++cli)
- {
- if (!cd->isHidden() && cd->name().find('@')==-1)
- {
- t << " <para>" << endl;
- t << " <itemizedlist>" << endl;
- t << " <listitem>" << endl;
- t << " <para>" << "struct <link linkend=\"_" << classOutputFileBase(cd) << "\">" << convertToDocBook(cd->name()) << "</link>";
- t << "</para>" << endl;
- if (cd->briefDescription())
- {
- t << "<para><emphasis>";
- writeDocbookString(t,cd->briefDescription());
- t << "</emphasis></para>" << endl;
- }
- t << " </listitem>" << endl;
- t << " </itemizedlist>" << endl;
- t << " </para>" << endl;
- }
- }
- if (cli.toFirst())
- {
- t << " </section>" << endl;
- }
- }
-}
-
-static void writeInnerNamespaces(const NamespaceSDict *nl,FTextStream &t)
-{
- if (nl)
- {
- NamespaceSDict::Iterator nli(*nl);
- NamespaceDef *nd;
- QCString title = theTranslator->trNamespaces();
-
- if (nli.toFirst())
- {
- t << " <simplesect>" << endl;
- t << " <title> " << title << " </title>" << endl;
- }
- for (nli.toFirst();(nd=nli.current());++nli)
- {
- if (!nd->isHidden() && nd->name().find('@')==-1) // skip anonymous scopes
- {
- t << " <para>" << endl;
- t << " <itemizedlist>" << endl;
- t << " <listitem>" << endl;
- t << " <para>" << "struct <link linkend=\"_" << nd->getOutputFileBase() << "\">" << convertToDocBook(nd->name()) << "</link>";
- t << "</para>" << endl;
- t << " </listitem>" << endl;
- t << " </itemizedlist>" << endl;
- t << " </para>" << endl;
- }
- }
- if (nli.toFirst())
- {
- t << " </simplesect>" << endl;
- }
- }
-}
-
-static void writeInnerFiles(const FileList *fl,FTextStream &t)
-{
- if (fl)
- {
- QListIterator<FileDef> fli(*fl);
- FileDef *fd;
- QCString title = theTranslator->trFile(TRUE,TRUE);
-
- if (fli.toFirst())
- {
- t << " <simplesect>" << endl;
- t << " <title> " << title << " </title>" << endl;
- }
- for (fli.toFirst();(fd=fli.current());++fli)
- {
- t << " <para>" << endl;
- t << " <itemizedlist>" << endl;
- t << " <listitem>" << endl;
- t << " <para>" << "file <link linkend=\"_" << fd->getOutputFileBase() << "\">" << convertToDocBook(fd->name()) << "</link>";
- t << "</para>" << endl;
- t << " </listitem>" << endl;
- t << " </itemizedlist>" << endl;
- t << " </para>" << endl;
- }
- if (fli.toFirst())
- {
- t << " </simplesect>" << endl;
- }
- }
-}
-
-static void writeInnerPages(const PageSDict *pl,FTextStream &t)
-{
- if (pl)
- {
- PageSDict::Iterator pli(*pl);
- PageDef *pd;
-
- for (pli.toFirst();(pd=pli.current());++pli)
- {
- t << "<xi:include href=\"" << pd->getOutputFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl;
- }
- }
-}
-
-static void writeInnerGroups(const GroupList *gl,FTextStream &t)
-{
- if (gl)
- {
- GroupListIterator gli(*gl);
- GroupDef *sgd;
-
- //Docbook header tags for inner groups
- if (gli.toFirst())
- {
- t << " <simplesect>" << endl;
- t << " <title>" << theTranslator->trModules() << "</title>" << endl;
- t << " </simplesect>" << endl;
- t << " <para>" << endl;
- t << " <itemizedlist>" << endl;
- }
-
- for (gli.toFirst();(sgd=gli.current());++gli)
- {
- t << " <listitem><para><link linkend=\"_" << sgd->getOutputFileBase() << "\">" << convertToDocBook(sgd->groupTitle()) << "</link></para></listitem>" << endl;
- }
-
- //Docbook footer tags for inner groups
- if (gli.toFirst())
- {
- t << " </itemizedlist>" << endl;
- t << " </para>" << endl;
- }
-
- }
-}
-
-static void writeInnerDirs(const DirList *dl,FTextStream &t)
-{
- if (dl)
- {
- QListIterator<DirDef> subdirs(*dl);
- DirDef *subdir;
- QCString title = theTranslator->trDirectories();
- if (subdirs.toFirst())
- {
- t << " <simplesect>" << endl;
- t << " <title> " << title << " </title>" << endl;
- }
- for (subdirs.toFirst();(subdir=subdirs.current());++subdirs)
- {
- t << " <para>" << endl;
- t << " <itemizedlist>" << endl;
- t << " <listitem>" << endl;
- t << " <para>" << "dir <link linkend=\"_" << subdir->getOutputFileBase() << "\">" << convertToDocBook(subdir->displayName()) << "</link>";
- t << "</para>" << endl;
- t << " </listitem>" << endl;
- t << " </itemizedlist>" << endl;
- t << " </para>" << endl;
- }
- if (subdirs.toFirst())
- {
- t << " </simplesect>" << endl;
- }
- }
-}
-
-static void writeInnerGroupFiles(const GroupList *gl,FTextStream &t)
-{
- if (gl)
- {
- GroupListIterator gli(*gl);
- GroupDef *sgd;
-
- for (gli.toFirst();(sgd=gli.current());++gli)
- {
- t << "<xi:include href=\"" << sgd->getOutputFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl;
- }
- }
-}
-
-static void generateDocbookForClass(ClassDef *cd,FTextStream &ti)
-{
- // + brief description
- // + detailed description
- // + template argument list(s)
- // - include file
- // + member groups
- // + inheritance diagram
- // + list of direct super classes
- // + list of direct sub classes
- // + list of inner classes
- // + collaboration diagram
- // + list of all members
- // + user defined member sections
- // + standard member sections
- // + detailed member documentation
- // - examples using the class
-
- 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->templateMaster()!=0) return; // skip generated template instances.
-
- msg("Generating Docbook output for class %s\n",cd->name().data());
-
- QCString fileDocbook=cd->getOutputFileBase()+".xml";
- //Add the file Documentation info to index file
- ti << " <xi:include href=\"" << fileDocbook << "\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl;
-
- QCString outputDirectory = Config_getString(DOCBOOK_OUTPUT);
- QCString fileName=outputDirectory+"/"+ classOutputFileBase(cd)+".xml";
- QCString relPath = relativePathToRoot(fileName);
- QFile f(fileName);
- if (!f.open(IO_WriteOnly))
- {
- err("Cannot open file %s for writing!\n",fileName.data());
- return;
- }
- FTextStream t(&f);
- //t.setEncoding(FTextStream::UnicodeUTF8);
-
- writeDocbookHeader_ID(t, classOutputFileBase(cd));
- t << "<title>";
- writeDocbookString(t,cd->name());
- addIndexTerm(t,cd->name());
- t << " " << cd->compoundTypeString() << " Reference";
- t << "</title>" << endl;
- if (cd->briefDescription())
- {
- t << " <para>" << endl;
- writeDocbookDocBlock(t,cd->briefFile(),cd->briefLine(),cd,0,cd->briefDescription());
- t << " </para>" << endl;
- }
-
- IncludeInfo *ii=cd->includeInfo();
- if (ii)
- {
- QCString nm = ii->includeName;
- if (nm.isEmpty() && ii->fileDef) nm = ii->fileDef->docName();
- if (!nm.isEmpty())
- {
- t << "<para>" << endl;
- t << " <programlisting>#include ";
- if (ii->fileDef && !ii->fileDef->isReference()) // TODO: support external references
- {
- t << "<link linkend=\"_" << ii->fileDef->getOutputFileBase() << "\">";
- }
- if (ii->local)
- {
- t << "&quot;";
- }
- else
- {
- t << "&lt;";
- }
- t << convertToDocBook(nm);
- if (ii->local)
- {
- t << "&quot;";
- }
- else
- {
- t << "&gt;";
- }
- if (ii->fileDef && !ii->fileDef->isReference())
- {
- t << "</link>";
- }
- t << "</programlisting>" << endl;
- t << "</para>" << endl;
- }
- }
-
- if (Config_getBool(HAVE_DOT) && (Config_getBool(CLASS_DIAGRAMS) || Config_getBool(CLASS_GRAPH)))
- {
- t << "<para>Inheritance diagram for " << convertToDocBook(cd->name()) << "</para>" << endl;
- DotClassGraph inheritanceGraph(cd,DotNode::Inheritance);
- inheritanceGraph.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT),fileName,relPath,TRUE,FALSE);
- }
-
- if (Config_getBool(HAVE_DOT) && Config_getBool(COLLABORATION_GRAPH))
- {
- t << "<para>Collaboration diagram for " << convertToDocBook(cd->name()) << "</para>" << endl;
- DotClassGraph collaborationGraph(cd,DotNode::Collaboration);
- collaborationGraph.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT),fileName,relPath,TRUE,FALSE);
- }
-
- writeInnerClasses(cd->getClassSDict(),t);
-
- writeTemplateList(cd,t);
- if (cd->getMemberGroupSDict())
- {
- MemberGroupSDict::Iterator mgli(*cd->getMemberGroupSDict());
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- generateDocbookSection(cd,t,mg->members(),"user-defined",0,mg->header(),
- mg->documentation());
- }
- }
-
- QListIterator<MemberList> mli(cd->getMemberLists());
- MemberList *ml;
- for (mli.toFirst();(ml=mli.current());++mli)
- {
- if ((ml->listType()&MemberListType_detailedLists)==0)
- {
- generateDocbookSection(cd,t,ml,g_docbookSectionMapper.find(ml->listType()));
- }
- }
-
- if ((Config_getBool(REPEAT_BRIEF) && cd->briefDescription()) || cd->documentation())
- {
- t << " <simplesect>" << endl;
- t << " <title>" << theTranslator->trDetailedDescription() << "</title>" << endl;
-
- if(Config_getBool(REPEAT_BRIEF))
- {
- if (cd->briefDescription())
- {
- t << " <para>" << endl;
- // A title as 'Brief Description' may not be necessary.
- //t << " <title>" << theTranslator->trBriefDescription() << "</title>" << endl;
- writeDocbookDocBlock(t,cd->briefFile(),cd->briefLine(),cd,0,cd->briefDescription());
- t << " </para>" << endl;
- }
- }
-
- if (cd->documentation())
- {
- writeDocbookDocBlock(t,cd->docFile(),cd->docLine(),cd,0,cd->documentation());
- }
- t << " </simplesect>" << endl;
- }
-
- if (cd->getMemberGroupSDict())
- {
- MemberGroupSDict::Iterator mgli(*cd->getMemberGroupSDict());
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- generateDocbookSection(cd,t,mg->members(),"user-defined",1,mg->header(),
- mg->documentation());
- }
- }
-
- for (mli.toFirst();(ml=mli.current());++mli)
- {
- if ((ml->listType()&MemberListType_detailedLists)==0)
- {
- generateDocbookSection(cd,t,ml,g_docbookSectionMapper.find(ml->listType()),1);
- }
- }
-
- /*// TODO: Handling of Inheritance and Colloboration graph for Docbook to be implemented
- DotClassGraph inheritanceGraph(cd,DotNode::Inheritance);
- if (!inheritanceGraph.isTrivial())
- {
- t << " <inheritancegraph>" << endl;
- inheritanceGraph.writeDocbook(t);
- t << " </inheritancegraph>" << endl;
- }
- DotClassGraph collaborationGraph(cd,DotNode::Collaboration);
- if (!collaborationGraph.isTrivial())
- {
- t << " <collaborationgraph>" << endl;
- collaborationGraph.writeDocbook(t);
- t << " </collaborationgraph>" << endl;
- }
- t << " <location file=\""
- << cd->getDefFileName() << "\" line=\""
- << cd->getDefLine() << "\"";
- if (cd->getStartBodyLine()!=-1)
- {
- FileDef *bodyDef = cd->getBodyDef();
- if (bodyDef)
- {
- t << " bodyfile=\"" << bodyDef->absFilePath() << "\"";
- }
- t << " bodystart=\"" << cd->getStartBodyLine() << "\" bodyend=\""
- << cd->getEndBodyLine() << "\"";
- }
- t << "/>" << endl;
- writeListOfAllMembers(cd,t);
- */
-
- t << " <para>" << cd->generatedFromFiles() << "</para>" << endl;
- t << " <para><itemizedlist><listitem><para>" << stripPath(cd->getDefFileName()) << "</para></listitem></itemizedlist></para>" << endl;
- t << "</section>" << endl;
-
-}
-
-static void generateDocbookForNamespace(NamespaceDef *nd,FTextStream &ti)
-{
- // + contained class definitions
- // + contained namespace definitions
- // + member groups
- // + normal members
- // + brief desc
- // + detailed desc
- // + location
- // - files containing (parts of) the namespace definition
-
- if (nd->isReference() || nd->isHidden()) return; // skip external references
-
- QCString fileDocbook=nd->getOutputFileBase()+".xml";
- //Add the file Documentation info to index file
- ti << " <xi:include href=\"" << fileDocbook << "\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl;
-
- QCString outputDirectory = Config_getString(DOCBOOK_OUTPUT);
- QCString fileName=outputDirectory+"/"+nd->getOutputFileBase()+".xml";
- QFile f(fileName);
- if (!f.open(IO_WriteOnly))
- {
- err("Cannot open file %s for writing!\n",fileName.data());
- return;
- }
- FTextStream t(&f);
- //t.setEncoding(FTextStream::UnicodeUTF8);
-
- writeDocbookHeader_ID(t, nd->getOutputFileBase());
- t << "<title>";
- addIndexTerm(t,nd->displayName());
- writeDocbookString(t,nd->title());
- t << "</title>" << endl;
-
- if (nd->briefDescription())
- {
- t << " <para>" << endl;
- //t << " <title>" << theTranslator->trBriefDescription() << "</title>" << endl;
- t << " </para>" << endl;
- }
- writeInnerClasses(nd->getClassSDict(),t);
- writeInnerNamespaces(nd->getNamespaceSDict(),t);
-
- if (nd->getMemberGroupSDict())
- {
- MemberGroupSDict::Iterator mgli(*nd->getMemberGroupSDict());
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- generateDocbookSection(nd,t,mg->members(),"user-defined",0,mg->header(),
- mg->documentation());
- }
- }
-
- QListIterator<MemberList> mli(nd->getMemberLists());
- MemberList *ml;
- for (mli.toFirst();(ml=mli.current());++mli)
- {
- if ((ml->listType()&MemberListType_declarationLists)!=0)
- {
- generateDocbookSection(nd,t,ml,g_docbookSectionMapper.find(ml->listType()));
- }
- }
-
- if ((Config_getBool(REPEAT_BRIEF) && nd->briefDescription()) || nd->documentation())
- {
- t << " <simplesect>" << endl;
- t << " <title>" << theTranslator->trDetailedDescription() << "</title>" << endl;
-
- if(Config_getBool(REPEAT_BRIEF))
- {
- if (nd->briefDescription())
- {
- t << " <para>" << endl;
- //t << " <title>" << theTranslator->trBriefDescription() << "</title>" << endl;
- writeDocbookDocBlock(t,nd->briefFile(),nd->briefLine(),nd,0,nd->briefDescription());
- t << " </para>" << endl;
- }
- }
-
- if (nd->documentation())
- {
- writeDocbookDocBlock(t,nd->docFile(),nd->docLine(),nd,0,nd->documentation());
- }
- t << " </simplesect>" << endl;
- }
-
- if (nd->getMemberGroupSDict())
- {
- MemberGroupSDict::Iterator mgli(*nd->getMemberGroupSDict());
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- generateDocbookSection(nd,t,mg->members(),"user-defined",1,mg->header(),
- mg->documentation());
- }
- }
-
- for (mli.toFirst();(ml=mli.current());++mli)
- {
- if ((ml->listType()&MemberListType_detailedLists)==0)
- {
- if (ml->listType() != MemberListType_allMembersList &&
- ml->listType() != MemberListType_docFuncMembers)
- generateDocbookSection(nd,t,ml,g_docbookSectionMapper.find(ml->listType()),1);
- }
- }
- // we actually need here "namespace"
- // t << " <para>" << theTranslator->trGeneratedFromFiles(ClassDef::Struct, FALSE) << "</para>" << endl;
- // t << " <para><itemizedlist><listitem><para>" << stripPath(nd->getDefFileName()) << "</para></listitem></itemizedlist></para>" << endl;
- t << "</section>" << endl;
-}
-
-static void generateDocbookForFile(FileDef *fd,FTextStream &ti)
-{
- // + includes files
- // + includedby files
- // + include graph
- // + included by graph
- // + contained class definitions
- // + contained namespace definitions
- // + member groups
- // + normal members
- // + brief desc
- // + detailed desc
- // + source code
- // + location
- // - number of lines
-
- if (fd->isReference()) return; // skip external references
-
- QCString fileDocbook=fd->getOutputFileBase()+".xml";
- //Add the file Documentation info to index file
- ti << " <xi:include href=\"" << fileDocbook << "\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl;
-
- QCString outputDirectory = Config_getString(DOCBOOK_OUTPUT);
- QCString fileName=outputDirectory+"/"+fd->getOutputFileBase()+".xml";
- QCString relPath = relativePathToRoot(fileName);
-
- QFile f(fileName);
- if (!f.open(IO_WriteOnly))
- {
- err("Cannot open file %s for writing!\n",fileName.data());
- return;
- }
- FTextStream t(&f);
- //t.setEncoding(FTextStream::UnicodeUTF8);
- writeDocbookHeader_ID(t, fd->getOutputFileBase());
-
- t << " <title>";
- writeDocbookString(t,fd->name());
- t << " File Reference";
- t << "</title>" << endl;
-
- if (fd->briefDescription())
- {
- t << " <para>" << endl;
- writeDocbookDocBlock(t,fd->briefFile(),fd->briefLine(),fd,0,fd->briefDescription());
- t << " </para>" << endl;
- }
-
- IncludeInfo *inc;
-
- if (fd->includeFileList())
- {
- QListIterator<IncludeInfo> ili1(*fd->includeFileList());
- for (ili1.toFirst();(inc=ili1.current());++ili1)
- {
- t << " <programlisting>#include ";
- if (inc->local)
- {
- t << "&quot;";
- }
- else
- {
- t << "&lt;";
- }
- t << convertToDocBook(inc->includeName);
- if (inc->local)
- {
- t << "&quot;";
- }
- else
- {
- t << "&gt;";
- }
- t << "</programlisting>" << endl;
- }
- }
- if (Config_getBool(HAVE_DOT))
- {
- if (Config_getBool(INCLUDE_GRAPH))
- {
- t << "<para>Include dependency diagram for " << convertToDocBook(fd->name()) << "</para>" << endl;
- DotInclDepGraph idepGraph(fd, FALSE);
- idepGraph.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT),fileName,relPath,FALSE);
- }
- if (Config_getBool(INCLUDED_BY_GRAPH))
- {
- t << "<para>Included by dependency diagram for " << convertToDocBook(fd->name()) << "</para>" << endl;
- DotInclDepGraph ibdepGraph(fd, TRUE);
- ibdepGraph.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT),fileName,relPath,FALSE);
- }
- }
-
- if (fd->getClassSDict())
- {
- writeInnerClasses(fd->getClassSDict(),t);
- }
- if (fd->getNamespaceSDict())
- {
- writeInnerNamespaces(fd->getNamespaceSDict(),t);
- }
-
- if (fd->getMemberGroupSDict())
- {
- MemberGroupSDict::Iterator mgli(*fd->getMemberGroupSDict());
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- generateDocbookSection(fd,t,mg->members(),"user-defined",0,mg->header(),
- mg->documentation());
- }
- }
-
- QListIterator<MemberList> mli(fd->getMemberLists());
- MemberList *ml;
- for (mli.toFirst();(ml=mli.current());++mli)
- {
- if ((ml->listType()&MemberListType_declarationLists)!=0)
- {
- generateDocbookSection(fd,t,ml,g_docbookSectionMapper.find(ml->listType()));
- }
- }
-
- t << " <simplesect>" << endl;
- t << " <title>" << theTranslator->trDetailedDescription() << "</title>" << endl;
- if(Config_getBool(REPEAT_BRIEF))
- {
- if (fd->briefDescription())
- {
- writeDocbookDocBlock(t,fd->briefFile(),fd->briefLine(),fd,0,fd->briefDescription());
- }
- }
- writeDocbookDocBlock(t,fd->docFile(),fd->docLine(),fd,0,fd->documentation());
- if (Config_getBool(FULL_PATH_NAMES))
- {
- t << " <para>Definition in file " << fd->getDefFileName() << "</para>" << endl;
- }
- else
- {
- t << " <para>Definition in file " << stripPath(fd->getDefFileName()) << "</para>" << endl;
- }
- t << " </simplesect>" << endl;
-
- for (mli.toFirst();(ml=mli.current());++mli)
- {
- if ((ml->listType()&MemberListType_declarationLists)!=0)
- {
- generateDocbookSection(fd,t,ml,g_docbookSectionMapper.find(ml->listType()),1);
- }
- }
-
- if (Config_getBool(DOCBOOK_PROGRAMLISTING))
- {
- t << " <literallayout><computeroutput>" << endl;;
- writeDocbookCodeBlock(t,fd);
- t << " </computeroutput></literallayout>" << endl;
- }
-
- t << "</section>" << endl;
-}
-
-static void generateDocbookForGroup(GroupDef *gd,FTextStream &ti)
-{
- // + members
- // + member groups
- // + files
- // + classes
- // + namespaces
- // - packages
- // + pages
- // + child groups
- // - examples
- // + brief description
- // + detailed description
-
- if (gd->isReference()) return; // skip external references
-
- if (!gd->isASubGroup())
- {
- QCString fileDocbook=gd->getOutputFileBase()+".xml";
- //Add the file Documentation info to index file
- ti << " <xi:include href=\"" << fileDocbook << "\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl;
- }
-
- QCString outputDirectory = Config_getString(DOCBOOK_OUTPUT);
- QCString fileName=outputDirectory+"/"+gd->getOutputFileBase()+".xml";
- QCString relPath = relativePathToRoot(fileName);
-
- QFile f(fileName);
- if (!f.open(IO_WriteOnly))
- {
- err("Cannot open file %s for writing!\n",fileName.data());
- return;
- }
-
- FTextStream t(&f);
- //t.setEncoding(FTextStream::UnicodeUTF8);
- writeDocbookHeader_ID(t, gd->getOutputFileBase());
-
- t << " <title>" << convertToDocBook(gd->groupTitle()) << "</title>" << endl;
- if (gd->briefDescription())
- {
- t << " <para>" << endl;
- writeDocbookDocBlock(t,gd->briefFile(),gd->briefLine(),gd,0,gd->briefDescription());
- t << " </para>" << endl;
- }
-
- if (Config_getBool(GROUP_GRAPHS) && Config_getBool(HAVE_DOT))
- {
- t << "<para>Collaboration diagram for " << convertToDocBook(gd->groupTitle()) << "</para>" << endl;
- DotGroupCollaboration collaborationGraph(gd);
- collaborationGraph.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT),fileName,relPath,FALSE);
- }
-
- writeInnerFiles(gd->getFiles(),t);
- writeInnerClasses(gd->getClasses(),t);
- writeInnerNamespaces(gd->getNamespaces(),t);
- writeInnerPages(gd->getPages(),t);
- writeInnerGroups(gd->getSubGroups(),t);
-
- if (gd->getMemberGroupSDict())
- {
- MemberGroupSDict::Iterator mgli(*gd->getMemberGroupSDict());
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- generateDocbookSection(gd,t,mg->members(),"user-defined",0,mg->header(),
- mg->documentation());
- }
- }
-
- QListIterator<MemberList> mli(gd->getMemberLists());
- MemberList *ml;
- for (mli.toFirst();(ml=mli.current());++mli)
- {
- if ((ml->listType()&MemberListType_declarationLists)!=0)
- {
- generateDocbookSection(gd,t,ml,g_docbookSectionMapper.find(ml->listType()));
- }
- }
-
- if(Config_getBool(REPEAT_BRIEF))
- {
- if (gd->briefDescription())
- {
- //t << " <section>" << endl;
- //t << " <title>" << theTranslator->trBriefDescription() << "</title>" << endl;
- writeDocbookDocBlock(t,gd->briefFile(),gd->briefLine(),gd,0,gd->briefDescription());
- //t << " </section>" << endl;
- }
- }
-
- if (gd->documentation())
- {
- t << " <simplesect>" << endl;
- t << " <title>" << theTranslator->trDetailedDescription() << "</title>" << endl;
- writeDocbookDocBlock(t,gd->docFile(),gd->docLine(),gd,0,gd->documentation());
- t << " </simplesect>" << endl;
- }
-
- for (mli.toFirst();(ml=mli.current());++mli)
- {
- if ((ml->listType()&MemberListType_declarationLists)!=0)
- {
- generateDocbookSection(gd,t,ml,g_docbookSectionMapper.find(ml->listType()),1);
- }
- }
-
- writeInnerGroupFiles(gd->getSubGroups(),t);
-
- t << "</section>" << endl;
-
-}
-
-static void generateDocbookForDir(DirDef *dd,FTextStream &ti)
-{
- if (dd->isReference()) return; // skip external references
-
- QCString fileDocbook=dd->getOutputFileBase()+".xml";
- //Add the file Documentation info to index file
- ti << " <xi:include href=\"" << fileDocbook << "\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl;
-
- QCString outputDirectory = Config_getString(DOCBOOK_OUTPUT);
- QCString fileName=outputDirectory+"/"+dd->getOutputFileBase()+".xml";
- QFile f(fileName);
- QCString relPath = relativePathToRoot(fileName);
-
- if (!f.open(IO_WriteOnly))
- {
- err("Cannot open file %s for writing!\n",fileName.data());
- return;
- }
-
- FTextStream t(&f);
- //t.setEncoding(FTextStream::UnicodeUTF8);
- writeDocbookHeader_ID(t, dd->getOutputFileBase());
-
- t << " <title>";
- t << theTranslator->trDirReference(dd->displayName());
- t << "</title>" << endl;
- if (dd->briefDescription())
- {
- writeDocbookDocBlock(t,dd->briefFile(),dd->briefLine(),dd,0,dd->briefDescription());
- }
- if (Config_getBool(DIRECTORY_GRAPH) && Config_getBool(HAVE_DOT))
- {
- t << "<para>Directory dependency diagram for " << convertToDocBook(dd->displayName()) << "</para>" << endl;
- DotDirDeps dirdepGraph(dd);
- dirdepGraph.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT),fileName,relPath,FALSE);
- }
-
- writeInnerDirs(&dd->subDirs(),t);
- writeInnerFiles(dd->getFiles(),t);
-
- t << " <simplesect>" << endl;
- t << " <title>" << theTranslator->trDetailedDescription() << "</title>" << endl;
- if (dd->briefDescription())
- {
- t << " <para>" << endl;
- writeDocbookDocBlock(t,dd->briefFile(),dd->briefLine(),dd,0,dd->briefDescription());
- t << " </para>" << endl;
- }
- writeDocbookDocBlock(t,dd->docFile(),dd->docLine(),dd,0,dd->documentation());
- t << " <para>Directory location is " << dd->name() << "</para>" << endl;
- t << " </simplesect>" << endl;
-
- t << "</section>" << endl;
-}
-
-static void generateDocbookForPage(PageDef *pd,FTextStream &ti,bool isExample)
-{
- // + name
- // + title
- // + documentation
-
- if (pd->isReference()) return;
-
- QCString pageName = pd->getOutputFileBase();
- if (pd->getGroupDef())
- {
- pageName+=(QCString)"_"+pd->name();
- }
- if (pageName=="index")
- {
- pageName="mainpage"; // to prevent overwriting the generated index page.
- }
-
- QCString outputDirectory = Config_getString(DOCBOOK_OUTPUT);
- QCString fileName=outputDirectory+"/"+pageName+".xml";
- QFile f(fileName);
- if (!f.open(IO_WriteOnly))
- {
- err("Cannot open file %s for writing!\n",fileName.data());
- return;
- }
-
- FTextStream t(&f);
- //t.setEncoding(FTextStream::UnicodeUTF8);
-
- if(isExample)
- {
- QCString fileDocbook=pageName+".xml";
- ti << " <xi:include href=\"" << fileDocbook << "\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl;
- }
-
- if (!pd->hasParentPage() && !isExample)
- {
- QCString fileDocbook=pageName+".xml";
- //Add the file Documentation info to index file
- ti << " <xi:include href=\"" << fileDocbook << "\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl;
- writeDocbookHeaderMainpage(t,pageName);
- }
- else
- {
- QCString pid;
- if(isExample)
- {
- pid = pageName;
- }
- else
- {
- pid = pageName+"_1"+pageName;
- }
- writeDocbookHeader_ID(t, pid);
- }
-
- SectionInfo *si = Doxygen::sectionDict->find(pd->name());
- if (si)
- {
- if ( pageName == "mainpage")
- t << " <title>" << convertToDocBook(theTranslator->trMainPage()) << "</title>" << endl;
- else
- t << " <title>" << convertToDocBook(si->title) << "</title>" << endl;
- }
- else
- {
- t << " <title>" << convertToDocBook(pd->name()) << "</title>" << endl;
- }
-
- generateTOC(t, pd);
- if (isExample)
- {
- writeDocbookDocBlock(t,pd->docFile(),pd->docLine(),pd,0,
- pd->documentation()+"\n\\include "+pd->name());
- }
- else
- {
- writeDocbookDocBlock(t,pd->docFile(),pd->docLine(),pd,0,
- pd->documentation());
- }
- writeInnerPages(pd->getSubPages(),t);
-
- if (!pd->hasParentPage() && !isExample)
- {
- t << endl << "</chapter>" << endl;
- }
- else
- {
- t << endl << "</section>" << endl;
- }
-}
-void generateDocbook_v1()
-{
-
- // + classes
- // + namespaces
- // + files
- // + groups
- // + related pages
- // - examples
-
- QCString outputDirectory = Config_getString(DOCBOOK_OUTPUT);
- if (outputDirectory.isEmpty())
- {
- outputDirectory=QDir::currentDirPath().utf8();
- }
- else
- {
- QDir dir(outputDirectory);
- if (!dir.exists())
- {
- dir.setPath(QDir::currentDirPath());
- if (!dir.mkdir(outputDirectory))
- {
- err("tag DOCBOOK_OUTPUT: Output directory `%s' does not "
- "exist and cannot be created\n",outputDirectory.data());
- exit(1);
- }
- else
- {
- msg("Notice: Output directory `%s' does not exist. "
- "I have created it for you.\n", outputDirectory.data());
- }
- dir.cd(outputDirectory);
- }
- outputDirectory=dir.absPath().utf8();
- }
-
- QDir dir(outputDirectory);
- if (!dir.exists())
- {
- dir.setPath(QDir::currentDirPath());
- if (!dir.mkdir(outputDirectory))
- {
- err("Cannot create directory %s\n",outputDirectory.data());
- return;
- }
- }
- QDir docbookDir(outputDirectory);
- createSubDirs(docbookDir);
-
- QCString fileName=outputDirectory+"/index.xml";
- QCString dbk_projectName = Config_getString(PROJECT_NAME);
- QFile f(fileName);
-
- f.setName(fileName);
- if (!f.open(IO_WriteOnly))
- {
- err("Cannot open file %s for writing!\n",fileName.data());
- return;
- }
- FTextStream t(&f);
- //t.setEncoding(FTextStream::UnicodeUTF8);
-
- // write index header for Docbook which calls the structure file
- t << "<?xml version='1.0' encoding='UTF-8' standalone='no'?>" << endl;;
- t << "<book xmlns=\"http://docbook.org/ns/docbook\" version=\"5.0\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">" << endl;
- t << " <info>" << endl;
- t << " <title>" << convertToDocBook(dbk_projectName) << "</title>" << endl;
- t << " </info>" << endl;
-
- // NAMESPACE DOCUMENTATION
- NamespaceSDict::Iterator nli(*Doxygen::namespaceSDict);
- NamespaceDef *nd;
-
- //Namespace Documentation index header
- if (nli.toFirst())
- {
- t << " <chapter>" << endl;
- t << " <title>Namespace Documentation</title>" << endl;
- }
-
- for (nli.toFirst();(nd=nli.current());++nli)
- {
- msg("Generating Docbook output for namespace %s\n",nd->name().data());
- generateDocbookForNamespace(nd,t);
- }
-
- //Namespace Documentation index footer
- if (nli.toFirst())
- {
- t << " </chapter>" << endl;
- }
-
- /** MAINPAGE DOCUMENTATION **/
-
- if (Doxygen::mainPage)
- {
- msg("Generating Docbook output for the main page\n");
- generateDocbookForPage(Doxygen::mainPage,t,FALSE);
- }
-
- // PAGE DOCUMENTATION
- {
- PageSDict::Iterator pdi(*Doxygen::pageSDict);
- PageDef *pd=0;
-
- for (pdi.toFirst();(pd=pdi.current());++pdi)
- {
- msg("Generating Docbook output for page %s\n",pd->name().data());
- generateDocbookForPage(pd,t,FALSE);
- }
- }
-
- /** MODULE GROUP DOCUMENTATION **/
-
- GroupSDict::Iterator gli(*Doxygen::groupSDict);
- GroupDef *gd;
-
- //Module group Documentation index header
- if (gli.toFirst())
- {
- t << " <chapter>" << endl;
- t << " <title>" << theTranslator->trModuleDocumentation() << "</title>" << endl;
- }
-
- for (;(gd=gli.current());++gli)
- {
- msg("Generating Docbook output for group %s\n",gd->name().data());
- generateDocbookForGroup(gd,t);
- }
-
- //Module group Documentation index footer
- if (gli.toFirst())
- {
- t << " </chapter>" << endl;
- }
-
- //CLASS DOCUMENTATION
-
- {
- ClassSDict::Iterator cli(*Doxygen::classSDict);
- ClassDef *cd;
-
- //Class Documentation index header
- if (cli.toFirst())
- {
- t << " <chapter>" << endl;
- t << " <title>" << theTranslator->trClassDocumentation() << "</title>" << endl;
- }
-
- for (cli.toFirst();(cd=cli.current());++cli)
- {
- generateDocbookForClass(cd,t);
- }
-
- //Class Documentation index footer
- if (cli.toFirst())
- {
- t << " </chapter>" << endl;
- }
- }
-
- // FILE DOCUMENTATION
-
- static bool showFiles = Config_getBool(SHOW_FILES);
- if (showFiles)
- {
- FileNameListIterator fnli(*Doxygen::inputNameList);
- FileName *fn;
-
- //File Documentation index header
- if (fnli.toFirst())
- {
- t << " <chapter>" << endl;
- t << " <title>" << theTranslator->trFileDocumentation() << "</title>" << endl;
- }
-
- for (;(fn=fnli.current());++fnli)
- {
- FileNameIterator fni(*fn);
- FileDef *fd;
- for (;(fd=fni.current());++fni)
- {
- msg("Generating Docbook output for file %s\n",fd->name().data());
- generateDocbookForFile(fd,t);
- }
- }
-
- //File Documentation index footer
- if (fnli.toFirst())
- {
- t << " </chapter>" << endl;
- }
- }
-
- // DIRECTORY DOCUMENTATION
- if (Config_getBool(DIRECTORY_GRAPH) && Config_getBool(HAVE_DOT))
- {
- DirDef *dir;
- DirSDict::Iterator sdi(*Doxygen::directories);
-
- //Directory Documentation index header
- if (sdi.toFirst())
- {
- t << " <chapter>" << endl;
- t << " <title>" << theTranslator->trDirDocumentation() << "</title>" << endl;
- }
-
- for (sdi.toFirst();(dir=sdi.current());++sdi)
- {
- msg("Generate Docbook output for dir %s\n",dir->name().data());
- generateDocbookForDir(dir,t);
- }
-
- //Module group Documentation index footer
- if (sdi.toFirst())
- {
- t << " </chapter>" << endl;
- }
- }
-
- // EXAMPLE PAGE DOCUMENTATION
-
- {
- PageSDict::Iterator pdi(*Doxygen::exampleSDict);
- PageDef *pd=0;
-
- //Example Page Documentation index header
- if (pdi.toFirst())
- {
- t << " <chapter>" << endl;
- t << " <title>" << theTranslator->trExampleDocumentation() << "</title>" << endl;
- }
-
- for (pdi.toFirst();(pd=pdi.current());++pdi)
- {
- msg("Generating Docbook output for example %s\n",pd->name().data());
- generateDocbookForPage(pd,t,TRUE);
- }
-
- //Example Page Documentation index footer
- if (pdi.toFirst())
- {
- t << " </chapter>" << endl;
- }
- }
-
- t << "<index/>" << endl;
- t << "</book>" << endl;
-
-}
-
DocbookGenerator::DocbookGenerator() : OutputGenerator()
{
DB_GEN_C
diff --git a/src/docbookgen.h b/src/docbookgen.h
index 104fbc5..08255a1 100644
--- a/src/docbookgen.h
+++ b/src/docbookgen.h
@@ -17,8 +17,6 @@
#include "outputgen.h"
-void generateDocbook_v1();
-
class DocbookCodeGenerator : public CodeOutputInterface
{
public:
diff --git a/src/docparser.cpp b/src/docparser.cpp
index 6057f1c..f01b509 100644
--- a/src/docparser.cpp
+++ b/src/docparser.cpp
@@ -56,6 +56,8 @@
#include "markdown.h"
#include "htmlentity.h"
+#define TK_COMMAND_CHAR(token) ((token)==TK_COMMAND_AT ? '@' : '\\')
+
// debug off
#define DBG(x) do {} while(0)
@@ -866,7 +868,31 @@ static bool findDocsForMemberOrCompound(const char *commandName,
return FALSE;
}
//---------------------------------------------------------------------------
+inline void errorHandleDefaultToken(DocNode *parent,int tok,
+ QList<DocNode> &children,const char *txt)
+{
+ switch (tok)
+ {
+ case TK_COMMAND_AT:
+ // fall through
+ 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);
+ break;
+ case TK_SYMBOL:
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found found as part of a %s",
+ qPrint(g_token->name), txt);
+ break;
+ default:
+ children.append(new DocWord(parent,g_token->name));
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s found as part of a %s",
+ tokToString(tok), txt);
+ break;
+ }
+}
+//---------------------------------------------------------------------------
// forward declaration
static bool defaultHandleToken(DocNode *parent,int tok,
QList<DocNode> &children,bool
@@ -876,6 +902,7 @@ static int handleStyleArgument(DocNode *parent,QList<DocNode> &children,
const QCString &cmdName)
{
DBG(("handleStyleArgument(%s)\n",qPrint(cmdName)));
+ QCString saveCmdName = cmdName;
int tok=doctokenizerYYlex();
if (tok!=TK_WHITESPACE)
{
@@ -901,14 +928,6 @@ static int handleStyleArgument(DocNode *parent,QList<DocNode> &children,
{
switch (tok)
{
- case TK_COMMAND:
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command \\%s as the argument of a \\%s command",
- qPrint(g_token->name),qPrint(cmdName));
- break;
- case TK_SYMBOL:
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found while handling command %s",
- qPrint(g_token->name),qPrint(cmdName));
- break;
case TK_HTMLTAG:
if (insideLI(parent) && Mappers::htmlTagMapper->map(g_token->name) && g_token->endTag)
{ // ignore </li> as the end of a style command
@@ -917,8 +936,7 @@ static int handleStyleArgument(DocNode *parent,QList<DocNode> &children,
return tok;
break;
default:
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s while handling command %s",
- tokToString(tok),qPrint(cmdName));
+ errorHandleDefaultToken(parent,tok,children,"\\" + saveCmdName + " command");
break;
}
break;
@@ -1297,21 +1315,7 @@ static void defaultHandleTitleAndSize(const int cmd, DocNode *parent, QList<DocN
}
if (!defaultHandleToken(parent,tok,children))
{
- switch (tok)
- {
- case TK_COMMAND:
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s as part of a \\%s",
- qPrint(g_token->name), Mappers::cmdMapper->find(cmd).data());
- break;
- case TK_SYMBOL:
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found",
- qPrint(g_token->name));
- break;
- default:
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s",
- tokToString(tok));
- break;
- }
+ errorHandleDefaultToken(parent,tok,children,Mappers::cmdMapper->find(cmd).data());
}
}
// parse size attributes
@@ -1370,7 +1374,7 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList<DocNode> &children
{
DBG(("token %s at %d",tokToString(tok),doctokenizerYYlineno));
if (tok==TK_WORD || tok==TK_LNKWORD || tok==TK_SYMBOL || tok==TK_URL ||
- tok==TK_COMMAND || tok==TK_HTMLTAG
+ tok==TK_COMMAND_AT || tok==TK_COMMAND_BS || tok==TK_HTMLTAG
)
{
DBG((" name=%s",qPrint(g_token->name)));
@@ -1380,7 +1384,9 @@ reparsetoken:
QCString tokenName = g_token->name;
switch (tok)
{
- case TK_COMMAND:
+ case TK_COMMAND_AT:
+ // fall through
+ case TK_COMMAND_BS:
switch (Mappers::cmdMapper->map(tokenName))
{
case CMD_BSLASH:
@@ -1564,6 +1570,9 @@ reparsetoken:
doctokenizerYYsetStatePara();
}
break;
+ case CMD_IMAGE:
+ ((DocPara *)parent) -> handleImage("image");
+ break;
default:
return FALSE;
}
@@ -1901,11 +1910,8 @@ DocAnchor::DocAnchor(DocNode *parent,const QCString &id,bool newAnchor)
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"Empty anchor label");
}
- if (newAnchor) // found <a name="label">
- {
- m_anchor = id;
- }
- else if (id.left(CiteConsts::anchorPrefix.length()) == CiteConsts::anchorPrefix)
+
+ if (id.left(CiteConsts::anchorPrefix.length()) == CiteConsts::anchorPrefix)
{
CiteInfo *cite = Doxygen::citeDict->find(id.mid(CiteConsts::anchorPrefix.length()));
if (cite)
@@ -1920,6 +1926,10 @@ DocAnchor::DocAnchor(DocNode *parent,const QCString &id,bool newAnchor)
m_file = "invalid";
}
}
+ else if (newAnchor) // found <a name="label">
+ {
+ m_anchor = id;
+ }
else // found \anchor label
{
SectionInfo *sec = Doxygen::sectionDict->find(id);
@@ -2331,21 +2341,7 @@ void DocSecRefItem::parse()
{
if (!defaultHandleToken(this,tok,m_children))
{
- switch (tok)
- {
- case TK_COMMAND:
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s as part of a \\refitem",
- qPrint(g_token->name));
- break;
- case TK_SYMBOL:
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found",
- qPrint(g_token->name));
- break;
- default:
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s",
- tokToString(tok));
- break;
- }
+ errorHandleDefaultToken(this,tok,m_children,"\\refitem");
}
}
doctokenizerYYsetStatePara();
@@ -2393,7 +2389,7 @@ void DocSecRefList::parse()
// handle items
while (tok)
{
- if (tok==TK_COMMAND)
+ if (tok==TK_COMMAND_AT || tok == TK_COMMAND_BS)
{
switch (Mappers::cmdMapper->map(g_token->name))
{
@@ -2473,21 +2469,7 @@ void DocInternalRef::parse()
{
if (!defaultHandleToken(this,tok,m_children))
{
- switch (tok)
- {
- case TK_COMMAND:
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s as part of a \\ref",
- qPrint(g_token->name));
- break;
- case TK_SYMBOL:
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found",
- qPrint(g_token->name));
- break;
- default:
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s",
- tokToString(tok));
- break;
- }
+ errorHandleDefaultToken(this,tok,m_children,"\\ref");
}
}
@@ -2631,19 +2613,10 @@ void DocRef::parse()
{
switch (tok)
{
- case TK_COMMAND:
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s as part of a \\ref",
- qPrint(g_token->name));
- break;
- case TK_SYMBOL:
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found",
- qPrint(g_token->name));
- break;
case TK_HTMLTAG:
break;
default:
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s",
- tokToString(tok));
+ errorHandleDefaultToken(this,tok,m_children,"\\ref");
break;
}
}
@@ -2754,7 +2727,9 @@ QCString DocLink::parse(bool isJavaLink,bool isXmlLink)
{
switch (tok)
{
- case TK_COMMAND:
+ case TK_COMMAND_AT:
+ // fall through
+ case TK_COMMAND_BS:
switch (Mappers::cmdMapper->map(g_token->name))
{
case CMD_ENDLINK:
@@ -2770,13 +2745,13 @@ QCString DocLink::parse(bool isJavaLink,bool isXmlLink)
}
break;
case TK_SYMBOL:
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found as part of a \\link",
qPrint(g_token->name));
break;
case TK_HTMLTAG:
if (g_token->name!="see" || !isXmlLink)
{
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected xml/html command %s found",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected xml/html command %s found as part of a \\link",
qPrint(g_token->name));
}
goto endlink;
@@ -2954,21 +2929,7 @@ void DocVhdlFlow::parse()
{
if (!defaultHandleToken(this,tok,m_children))
{
- switch (tok)
- {
- case TK_COMMAND:
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s as part of a \\vhdlflow",
- qPrint(g_token->name));
- break;
- case TK_SYMBOL:
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found",
- qPrint(g_token->name));
- break;
- default:
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s",
- tokToString(tok));
- break;
- }
+ errorHandleDefaultToken(this,tok,m_children,"\\vhdlflow");
}
}
tok=doctokenizerYYlex();
@@ -3015,10 +2976,6 @@ int DocHtmlHeader::parse()
{
switch (tok)
{
- case TK_COMMAND:
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s as part of a <h%d> tag",
- qPrint(g_token->name),m_level);
- break;
case TK_HTMLTAG:
{
int tagId=Mappers::htmlTagMapper->map(g_token->name);
@@ -3096,14 +3053,10 @@ int DocHtmlHeader::parse()
}
break;
- case TK_SYMBOL:
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found",
- qPrint(g_token->name));
- break;
default:
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s",
- tokToString(tok));
- break;
+ char tmp[20];
+ sprintf(tmp,"<h%d>tag",m_level);
+ errorHandleDefaultToken(this,tok,m_children,tmp);
}
}
}
@@ -3135,14 +3088,6 @@ int DocHRef::parse()
{
switch (tok)
{
- case TK_COMMAND:
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s as part of a <a>..</a> block",
- qPrint(g_token->name));
- break;
- case TK_SYMBOL:
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found",
- qPrint(g_token->name));
- break;
case TK_HTMLTAG:
{
@@ -3159,8 +3104,7 @@ int DocHRef::parse()
}
break;
default:
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s",
- tokToString(tok),doctokenizerYYlineno);
+ errorHandleDefaultToken(this,tok,m_children,"<a>..</a> block");
break;
}
}
@@ -3293,7 +3237,9 @@ int DocIndexEntry::parse()
}
}
break;
- case TK_COMMAND:
+ case TK_COMMAND_AT:
+ // fall through
+ case TK_COMMAND_BS:
switch (Mappers::cmdMapper->map(g_token->name))
{
case CMD_BSLASH: m_entry+='\\'; break;
@@ -3381,14 +3327,6 @@ int DocHtmlCaption::parse()
{
switch (tok)
{
- case TK_COMMAND:
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s as part of a <caption> tag",
- qPrint(g_token->name));
- break;
- case TK_SYMBOL:
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found",
- qPrint(g_token->name));
- break;
case TK_HTMLTAG:
{
int tagId=Mappers::htmlTagMapper->map(g_token->name);
@@ -3405,9 +3343,7 @@ int DocHtmlCaption::parse()
}
break;
default:
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s",
- tokToString(tok));
- break;
+ errorHandleDefaultToken(this,tok,m_children,"<caption> tag");
}
}
}
@@ -3920,7 +3856,9 @@ int DocHtmlDescTitle::parse()
{
switch (tok)
{
- case TK_COMMAND:
+ case TK_COMMAND_AT:
+ // fall through
+ case TK_COMMAND_BS:
{
QCString cmdName=g_token->name;
bool isJavaLink=FALSE;
@@ -3931,7 +3869,7 @@ int DocHtmlDescTitle::parse()
int tok=doctokenizerYYlex();
if (tok!=TK_WHITESPACE)
{
- warn_doc_error(g_fileName,doctokenizerYYlineno,"expected whitespace after %s command",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"expected whitespace after \\%s command",
qPrint(g_token->name));
}
else
@@ -3940,7 +3878,7 @@ int DocHtmlDescTitle::parse()
tok=doctokenizerYYlex(); // get the reference id
if (tok!=TK_WORD)
{
- warn_doc_error(g_fileName,doctokenizerYYlineno,"unexpected token %s as the argument of %s",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"unexpected token %s as the argument of \\%s command",
tokToString(tok),qPrint(cmdName));
}
else
@@ -3961,7 +3899,7 @@ int DocHtmlDescTitle::parse()
int tok=doctokenizerYYlex();
if (tok!=TK_WHITESPACE)
{
- warn_doc_error(g_fileName,doctokenizerYYlineno,"expected whitespace after %s command",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"expected whitespace after \\%s command",
qPrint(cmdName));
}
else
@@ -3970,7 +3908,7 @@ int DocHtmlDescTitle::parse()
tok=doctokenizerYYlex();
if (tok!=TK_WORD)
{
- warn_doc_error(g_fileName,doctokenizerYYlineno,"unexpected token %s as the argument of %s",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"unexpected token %s as the argument of \\%s command",
tokToString(tok),qPrint(cmdName));
}
else
@@ -3989,13 +3927,13 @@ int DocHtmlDescTitle::parse()
break;
default:
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s as part of a <dt> tag",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command \\%s found as part of a <dt> tag",
qPrint(g_token->name));
}
}
break;
case TK_SYMBOL:
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol \\%s found as part of a <dt> tag",
qPrint(g_token->name));
break;
case TK_HTMLTAG:
@@ -4036,7 +3974,7 @@ int DocHtmlDescTitle::parse()
}
break;
default:
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s found as part of a <dt> tag",
tokToString(tok));
break;
}
@@ -4541,21 +4479,7 @@ void DocTitle::parse()
{
if (!defaultHandleToken(this,tok,m_children))
{
- switch (tok)
- {
- case TK_COMMAND:
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s as part of a title section",
- qPrint(g_token->name));
- break;
- case TK_SYMBOL:
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found",
- qPrint(g_token->name));
- break;
- default:
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s",
- tokToString(tok));
- break;
- }
+ errorHandleDefaultToken(this,tok,m_children,"title section");
}
}
doctokenizerYYsetStatePara();
@@ -5416,7 +5340,7 @@ void DocPara::handleInheritDoc()
}
-int DocPara::handleCommand(const QCString &cmdName)
+int DocPara::handleCommand(const QCString &cmdName, const int tok)
{
DBG(("handleCommand(%s)\n",qPrint(cmdName)));
int retval = RetVal_OK;
@@ -5424,6 +5348,7 @@ int DocPara::handleCommand(const QCString &cmdName)
switch (cmdId)
{
case CMD_UNKNOWN:
+ m_children.append(new DocWord(this,TK_COMMAND_CHAR(tok) + cmdName));
warn_doc_error(g_fileName,doctokenizerYYlineno,"Found unknown command `\\%s'",qPrint(cmdName));
break;
case CMD_EMPHASIS:
@@ -6526,7 +6451,7 @@ int DocPara::parse()
reparsetoken:
DBG(("token %s at %d",tokToString(tok),doctokenizerYYlineno));
if (tok==TK_WORD || tok==TK_LNKWORD || tok==TK_SYMBOL || tok==TK_URL ||
- tok==TK_COMMAND || tok==TK_HTMLTAG
+ tok==TK_COMMAND_AT || tok == TK_COMMAND_BS || tok==TK_HTMLTAG
)
{
DBG((" name=%s",qPrint(g_token->name)));
@@ -6624,7 +6549,7 @@ reparsetoken:
}
else // other section
{
- tok = TK_COMMAND;
+ tok = TK_COMMAND_BS;
}
DBG(("reparsing command %s\n",qPrint(g_token->name)));
goto reparsetoken;
@@ -6669,7 +6594,9 @@ reparsetoken:
"list items");
}
break;
- case TK_COMMAND:
+ case TK_COMMAND_AT:
+ // fall through
+ case TK_COMMAND_BS:
{
// see if we have to start a simple section
int cmd = Mappers::cmdMapper->map(g_token->name);
@@ -6705,7 +6632,7 @@ reparsetoken:
}
// handle the command
- retval=handleCommand(g_token->name);
+ retval=handleCommand(g_token->name,tok);
DBG(("handleCommand returns %x\n",retval));
// check the return value
@@ -6723,7 +6650,7 @@ reparsetoken:
}
else // other section
{
- tok = TK_COMMAND;
+ tok = TK_COMMAND_BS;
}
DBG(("reparsing command %s\n",qPrint(g_token->name)));
goto reparsetoken;
@@ -6995,7 +6922,9 @@ void DocText::parse()
}
}
break;
- case TK_COMMAND:
+ case TK_COMMAND_AT:
+ // fall through
+ case TK_COMMAND_BS:
switch (Mappers::cmdMapper->map(g_token->name))
{
case CMD_BSLASH:
diff --git a/src/docparser.h b/src/docparser.h
index 68f9fc1..2bc716a 100644
--- a/src/docparser.h
+++ b/src/docparser.h
@@ -1155,7 +1155,7 @@ class DocPara : public CompAccept<DocPara>
bool isFirst() const { return m_isFirst; }
bool isLast() const { return m_isLast; }
- int handleCommand(const QCString &cmdName);
+ int handleCommand(const QCString &cmdName,const int tok);
int handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &tagHtmlAttribs);
int handleHtmlEndTag(const QCString &tagName);
int handleSimpleSection(DocSimpleSect::Type t,bool xmlContext=FALSE);
diff --git a/src/doctokenizer.h b/src/doctokenizer.h
index b3b9fa5..c12e77e 100644
--- a/src/doctokenizer.h
+++ b/src/doctokenizer.h
@@ -34,12 +34,13 @@ enum Tokens
TK_WHITESPACE = 3,
TK_LISTITEM = 4,
TK_ENDLIST = 5,
- TK_COMMAND = 6,
+ TK_COMMAND_AT = 6, //! Command starting with `@`
TK_HTMLTAG = 7,
TK_SYMBOL = 8,
TK_NEWPARA = 9,
TK_RCSTAG = 10,
TK_URL = 11,
+ TK_COMMAND_BS = 12, //! Command starting with `\`
RetVal_OK = 0x10000,
RetVal_SimpleSec = 0x10001,
diff --git a/src/doctokenizer.l b/src/doctokenizer.l
index 3118cfd..5cd97a8 100644
--- a/src/doctokenizer.l
+++ b/src/doctokenizer.l
@@ -41,6 +41,8 @@
#define YY_NO_INPUT 1
#define YY_NO_UNISTD_H 1
+
+#define TK_COMMAND_SEL() (yytext[0] == '@' ? TK_COMMAND_AT : TK_COMMAND_BS)
//--------------------------------------------------------------------------
@@ -116,12 +118,13 @@ const char *tokToString(int token)
case TK_WHITESPACE: return "TK_WHITESPACE";
case TK_LISTITEM: return "TK_LISTITEM";
case TK_ENDLIST: return "TK_ENDLIST";
- case TK_COMMAND: return "TK_COMMAND";
+ case TK_COMMAND_AT: return "TK_COMMAND_AT";
case TK_HTMLTAG: return "TK_HTMLTAG";
case TK_SYMBOL: return "TK_SYMBOL";
case TK_NEWPARA: return "TK_NEWPARA";
case TK_RCSTAG: return "TK_RCSTAG";
case TK_URL: return "TK_URL";
+ case TK_COMMAND_BS: return "TK_COMMAND_BS";
}
return "ERROR";
}
@@ -558,11 +561,11 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
}
<St_Para>"{"{BLANK}*"@link"/{BLANK}+ {
g_token->name = "javalink";
- return TK_COMMAND;
+ return TK_COMMAND_AT;
}
<St_Para>"{"{BLANK}*"@inheritDoc"{BLANK}*"}" {
g_token->name = "inheritdoc";
- return TK_COMMAND;
+ return TK_COMMAND_AT;
}
<St_Para>"@_fakenl" { // artificial new line
yylineno++;
@@ -572,14 +575,14 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
bool ok;
g_token->id = QCString(yytext).right((int)yyleng-6).toInt(&ok);
ASSERT(ok);
- return TK_COMMAND;
+ return TK_COMMAND_SEL();
}
<St_Para>{CMD}"n"\n { /* \n followed by real newline */
yylineno++;
g_token->name = yytext+1;
g_token->name = g_token->name.stripWhiteSpace();
g_token->paramDir=TokenInfo::Unspecified;
- return TK_COMMAND;
+ return TK_COMMAND_SEL();
}
<St_Para>{SPCMD1} |
<St_Para>{SPCMD2} |
@@ -587,7 +590,7 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
g_token->name = yytext+1;
g_token->name = g_token->name.stripWhiteSpace();
g_token->paramDir=TokenInfo::Unspecified;
- return TK_COMMAND;
+ return TK_COMMAND_SEL();
}
<St_Para>{PARAMIO} { /* param [in,out] command */
g_token->name = "param";
@@ -613,7 +616,7 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
{
g_token->paramDir=TokenInfo::Unspecified;
}
- return TK_COMMAND;
+ return TK_COMMAND_SEL();
}
<St_Para>("http:"|"https:"|"ftp:"|"file:"|"news:"){URLMASK}/\. { // URL.
g_token->name=yytext;
@@ -733,7 +736,7 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
}
<St_Text>[\\@<>&$#%~] {
g_token->name = yytext;
- return TK_COMMAND;
+ return TK_COMMAND_SEL();
}
<St_Para>({BLANK}*\n)+{BLANK}*\n/{LISTITEM} { /* skip trailing paragraph followed by new list item */
if (g_insidePre || g_autoListLevel==0)
@@ -926,7 +929,7 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
<St_TitleN>{SPCMD2} { /* special command */
g_token->name = yytext+1;
g_token->paramDir=TokenInfo::Unspecified;
- return TK_COMMAND;
+ return TK_COMMAND_SEL();
}
<St_TitleN>{ID}"=" { /* attribute */
if (yytext[0]=='%') // strip % if present
@@ -960,7 +963,7 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
<St_TitleQ>{SPCMD2} { /* special command */
g_token->name = yytext+1;
g_token->paramDir=TokenInfo::Unspecified;
- return TK_COMMAND;
+ return TK_COMMAND_SEL();
}
<St_TitleQ>{WORD1NQ} |
<St_TitleQ>{WORD2NQ} { /* word */
@@ -1091,7 +1094,7 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
<St_Ref2>{SPCMD2} { /* special command */
g_token->name = yytext+1;
g_token->paramDir=TokenInfo::Unspecified;
- return TK_COMMAND;
+ return TK_COMMAND_SEL();
}
<St_Ref2>{WORD1NQ} |
<St_Ref2>{WORD2NQ} {
@@ -1323,7 +1326,7 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
<*>[\\@<>&$#%~"=] { /* unescaped special character */
//warn(g_fileName,yylineno,"Unexpected character `%s', assuming command \\%s was meant.",yytext,yytext);
g_token->name = yytext;
- return TK_COMMAND;
+ return TK_COMMAND_SEL();
}
<*>. {
warn(g_fileName,yylineno,"Unexpected character `%s'",yytext);
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index b12b354..b94cd92 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -347,6 +347,7 @@ static STLInfo g_stlinfo[] =
{ "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
@@ -520,7 +521,7 @@ static void addSTLClasses(EntryNav *rootNav)
{
addSTLMember(classEntryNav,info->templType2,info->templName2);
}
- if (fullName=="std::auto_ptr" || fullName=="std::smart_ptr" ||
+ 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;
@@ -9729,7 +9730,7 @@ int readDir(QFileInfo *fi,
{
fn = new FileName(cfi->absFilePath().utf8(),name);
fn->append(fd);
- if (fnList) fnList->inSort(fn);
+ if (fnList) fnList->append(fn);
fnDict->insert(name,fn);
}
}
@@ -9828,7 +9829,7 @@ int readFileOrDirectory(const char *s,
{
fn = new FileName(filePath,name);
fn->append(fd);
- if (fnList) fnList->inSort(fn);
+ if (fnList) fnList->append(fn);
fnDict->insert(name,fn);
}
}
@@ -11041,6 +11042,7 @@ void searchInputFiles()
}
s=inputList.next();
}
+ Doxygen::inputNameList->sort();
delete killDict;
g_s.end();
}
@@ -11621,13 +11623,11 @@ void generateOutput()
g_outputList->add(new LatexGenerator);
LatexGenerator::init();
}
-#if 1
if (generateDocbook)
{
g_outputList->add(new DocbookGenerator);
DocbookGenerator::init();
}
-#endif
if (generateMan)
{
g_outputList->add(new ManGenerator);
@@ -11806,15 +11806,6 @@ void generateOutput()
g_s.end();
}
-#if 0
- if (generateDocbook)
- {
- g_s.begin("Generating Docbook output...\n");
- generateDocbook_v1();
- g_s.end();
- }
-#endif
-
if (Config_getBool(GENERATE_AUTOGEN_DEF))
{
g_s.begin("Generating AutoGen DEF output...\n");
diff --git a/src/fortranscanner.l b/src/fortranscanner.l
index 2bd6788..5f10669 100644
--- a/src/fortranscanner.l
+++ b/src/fortranscanner.l
@@ -231,6 +231,8 @@ static void updateVariablePrepassComment(int from, int to);
static void newLine();
static void initEntry();
+static const char *stateToString(int state);
+
//-----------------------------------------------------------------------------
#undef YY_INPUT
#define YY_INPUT(buf,result,max_size) result=yyread(buf,max_size);
@@ -2759,7 +2761,7 @@ void FortranLanguageScanner::parsePrototype(const char *text)
static void scanner_abort()
{
fprintf(stderr,"********************************************************************\n");
- fprintf(stderr,"Error in file %s line: %d, state: %d\n",yyFileName.data(),yyLineNr,YY_START);
+ 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());
@@ -2788,3 +2790,47 @@ extern "C" { // some bogus code to keep the compiler happy
}
#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;
+}
diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp
index 452a481..56691cf 100644
--- a/src/latexdocvisitor.cpp
+++ b/src/latexdocvisitor.cpp
@@ -215,13 +215,14 @@ void LatexDocVisitor::visit(DocURL *u)
if (m_hide) return;
if (Config_getBool(PDF_HYPERLINKS))
{
+ m_t << endl << "%% AME " << u->url() <<endl;
m_t << "\\href{";
if (u->isEmail()) m_t << "mailto:";
- m_t << u->url() << "}";
+ m_t << latexFilterURL(u->url()) << "}";
}
- m_t << "\\texttt{ ";
+ m_t << "{\\texttt{ ";
filter(u->url());
- m_t << "}";
+ m_t << "}}";
}
void LatexDocVisitor::visit(DocLineBreak *)
@@ -564,9 +565,9 @@ void LatexDocVisitor::visit(DocIndexEntry *i)
{
if (m_hide) return;
m_t << "\\index{";
- m_t << latexEscapeLabelName(i->entry(),false);
+ m_t << latexEscapeLabelName(i->entry());
m_t << "@{";
- m_t << latexEscapeIndexChars(i->entry(),false);
+ m_t << latexEscapeIndexChars(i->entry());
m_t << "}}";
}
@@ -1251,17 +1252,18 @@ void LatexDocVisitor::visitPre(DocHRef *href)
if (m_hide) return;
if (Config_getBool(PDF_HYPERLINKS))
{
+ m_t << endl << "%% AME " << href->url() <<endl;
m_t << "\\href{";
- m_t << href->url();
+ m_t << latexFilterURL(href->url());
m_t << "}";
}
- m_t << "\\texttt{ ";
+ m_t << "{\\texttt{ ";
}
void LatexDocVisitor::visitPost(DocHRef *)
{
if (m_hide) return;
- m_t << "}";
+ m_t << "}}";
}
void LatexDocVisitor::visitPre(DocHtmlHeader *header)
diff --git a/src/latexgen.cpp b/src/latexgen.cpp
index 50d4242..d061dd7 100644
--- a/src/latexgen.cpp
+++ b/src/latexgen.cpp
@@ -1369,12 +1369,12 @@ void LatexGenerator::startHtmlLink(const char *url)
t << url;
t << "}";
}
- t << "\\texttt{ ";
+ t << "{\\texttt{ ";
}
void LatexGenerator::endHtmlLink()
{
- t << "}";
+ t << "}}";
}
//void LatexGenerator::writeMailLink(const char *url)
@@ -1519,9 +1519,9 @@ void LatexGenerator::endTitleHead(const char *fileName,const char *name)
if (name)
{
t << "\\label{" << stripPath(fileName) << "}\\index{";
- t << latexEscapeLabelName(name,insideTabbing);
+ t << latexEscapeLabelName(name);
t << "@{";
- t << latexEscapeIndexChars(name,insideTabbing);
+ t << latexEscapeIndexChars(name);
t << "}}" << endl;
}
}
@@ -1602,27 +1602,27 @@ void LatexGenerator::startMemberDoc(const char *clname,
t << "\\index{";
if (clname)
{
- t << latexEscapeLabelName(clname,insideTabbing);
+ t << latexEscapeLabelName(clname);
t << "@{";
- t << latexEscapeIndexChars(clname,insideTabbing);
+ t << latexEscapeIndexChars(clname);
t << "}!";
}
- t << latexEscapeLabelName(memname,insideTabbing);
+ t << latexEscapeLabelName(memname);
t << "@{";
- t << latexEscapeIndexChars(memname,insideTabbing);
+ t << latexEscapeIndexChars(memname);
t << "}}" << endl;
t << "\\index{";
- t << latexEscapeLabelName(memname,insideTabbing);
+ t << latexEscapeLabelName(memname);
t << "@{";
- t << latexEscapeIndexChars(memname,insideTabbing);
+ t << latexEscapeIndexChars(memname);
t << "}";
if (clname)
{
t << "!";
- t << latexEscapeLabelName(clname,insideTabbing);
+ t << latexEscapeLabelName(clname);
t << "@{";
- t << latexEscapeIndexChars(clname,insideTabbing);
+ t << latexEscapeIndexChars(clname);
t << "}";
}
t << "}" << endl;
@@ -1640,7 +1640,7 @@ void LatexGenerator::startMemberDoc(const char *clname,
{
t << "\\texorpdfstring{";
}
- t << latexEscapeIndexChars(title,insideTabbing);
+ t << latexEscapeIndexChars(title);
if (pdfHyperlinks)
{
t << "}{" << latexEscapePDFString(title) << "}";
@@ -1715,16 +1715,16 @@ void LatexGenerator::addIndexItem(const char *s1,const char *s2)
if (s1)
{
t << "\\index{";
- t << latexEscapeLabelName(s1,insideTabbing);
+ t << latexEscapeLabelName(s1);
t << "@{";
- t << latexEscapeIndexChars(s1,insideTabbing);
+ t << latexEscapeIndexChars(s1);
t << "}";
if (s2)
{
t << "!";
- t << latexEscapeLabelName(s2,insideTabbing);
+ t << latexEscapeLabelName(s2);
t << "@{";
- t << latexEscapeIndexChars(s2,insideTabbing);
+ t << latexEscapeIndexChars(s2);
t << "}";
}
t << "}";
diff --git a/src/markdown.cpp b/src/markdown.cpp
index 59ce108..36b9734 100644
--- a/src/markdown.cpp
+++ b/src/markdown.cpp
@@ -1960,7 +1960,7 @@ void writeOneLineHeaderOrRuler(GrowBuf &out,const char *data,int size)
out.addStr(data,size);
if (hasLineBreak(data,size))
{
- out.addStr("<br>");
+ out.addStr("\n");
}
}
}
diff --git a/src/printdocvisitor.h b/src/printdocvisitor.h
index 8d9a2b9..6b5e09e 100644
--- a/src/printdocvisitor.h
+++ b/src/printdocvisitor.h
@@ -640,13 +640,13 @@ class PrintDocVisitor : public DocVisitor
void visitPre(DocXRefItem *x)
{
indent_pre();
- printf("<xrefitem file=\"%s\" anchor=\"%s\" title=\"%s\"/>\n",
+ printf("<xrefitem file=\"%s\" anchor=\"%s\" title=\"%s\">\n",
x->file().data(),x->anchor().data(),x->title().data());
}
void visitPost(DocXRefItem *)
{
indent_post();
- printf("<xrefitem/>\n");
+ printf("</xrefitem>\n");
}
void visitPre(DocInternalRef *r)
{
diff --git a/src/reflist.cpp b/src/reflist.cpp
index 1da603e..7ae4c80 100644
--- a/src/reflist.cpp
+++ b/src/reflist.cpp
@@ -131,7 +131,15 @@ void RefList::insertIntoList(const char *key,RefItem *item)
{
if (ri!=item)
{
- ri->extraItems.append(item);
+ // We also have to check if the item is not already in the "extra" list
+ QListIterator<RefItem> li(ri->extraItems);
+ RefItem *extraItem;
+ bool doubleItem = false;
+ for (li.toFirst();(extraItem=li.current());++li)
+ {
+ if (item == extraItem) doubleItem = true;
+ }
+ if (!doubleItem) ri->extraItems.append(item);
}
}
}
@@ -148,8 +156,6 @@ void RefList::generatePage()
for (it.toFirst();(item=it.current());++it)
{
doc += " <dt>";
- doc += "\\anchor ";
- doc += item->listAnchor;
doc += "\n";
if (item->scope)
{
@@ -171,15 +177,21 @@ void RefList::generatePage()
if (!item->args.isEmpty())
{
// escape @'s in argument list, needed for Java annotations (see issue #6208)
- doc += substitute(item->args,"@","@@");
+ // escape \'s in argument list (see issue #6533)
+ doc += substitute(substitute(item->args,"@","@@"),"\\","\\\\");
}
- doc += "</dt><dd> ";
+ doc += "</dt><dd> \\anchor ";
+ doc += item->listAnchor;
+ doc += " ";
doc += item->text;
QListIterator<RefItem> li(item->extraItems);
RefItem *extraItem;
for (li.toFirst();(extraItem=li.current());++li)
{
- doc += "<p>" + extraItem->text;
+ doc += "<p> \\anchor ";
+ doc += extraItem->listAnchor;
+ doc += " ";
+ doc += extraItem->text;
}
doc += "</dd>";
}
diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp
index 7fbfdc8..0be2266 100644
--- a/src/rtfdocvisitor.cpp
+++ b/src/rtfdocvisitor.cpp
@@ -1072,7 +1072,7 @@ void RTFDocVisitor::visitPre(DocHtmlHeader *header)
m_t << "{" // start section
<< rtf_Style_Reset;
QCString heading;
- int level = QMIN(header->level()+2,4);
+ int level = QMIN(header->level(),5);
heading.sprintf("Heading%d",level);
// set style
m_t << rtf_Style[heading]->reference;
diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp
index b4a9e65..34af705 100644
--- a/src/rtfgen.cpp
+++ b/src/rtfgen.cpp
@@ -2180,11 +2180,12 @@ void RTFGenerator::newParagraph()
m_omitParagraph = FALSE;
}
-void RTFGenerator::startParagraph(const char *)
+void RTFGenerator::startParagraph(const char *txt)
{
DBG_RTF(t << "{\\comment startParagraph}" << endl)
newParagraph();
t << "{" << endl;
+ if (QCString(txt) == "reference") t << "\\ql" << endl;
}
void RTFGenerator::endParagraph()
diff --git a/src/scanner.l b/src/scanner.l
index 0f681e9..cde0ade 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -602,15 +602,11 @@ static int yyread(char *buf,int max_size)
/* start command character */
CMD ("\\"|"@")
-SECTIONCMD {CMD}("image"|"author"|"internal"|"version"|"date"|"deprecated"|"param"|"exception"|"return"[s]?|"retval"|"bug"|"warning"|"par"|"sa"|"see"|"pre"|"post"|"invariant"|"note"|"remark"[s]?|"todo"|"test"|"xrefitem"|"ingroup"|"callgraph"|"callergraph"|"latexonly"|"htmlonly"|"xmlonly"|"docbookonly"|"manonly"|"{"|"verbatim"|"dotfile"|"dot"|"defgroup"|"addtogroup"|"weakgroup"|"class"|"namespace"|"union"|"struct"|"fn"|"var"|"details"|"typedef"|"def"|"overload")|("<"{PRE}">")
BN [ \t\n\r]
BL [ \t\r]*"\n"
B [ \t]
-BS ^(({B}*"//")?)(({B}*"*"+)?){B}*
ID "$"?[a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]*
-SCOPEID {ID}({ID}*{BN}*"::"{BN}*)*({ID}?)
SCOPENAME "$"?(({ID}?{BN}*"::"{BN}*)*)(((~|!){BN}*)?{ID})
-PHPSCOPENAME ({ID}"\\")+{ID}
TSCOPE {ID}("<"[a-z_A-Z0-9 \t\*\&,:]*">")?
CSSCOPENAME (({ID}?{BN}*"."{BN}*)*)((~{BN}*)?{ID})
PRE [pP][rR][eE]
@@ -3137,6 +3133,10 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
*pCopyQuotedGString+=*yytext;
BEGIN( lastStringContext );
}
+<CopyGString,CopyPHPGString>"<?php" { // we had an odd number of quotes.
+ *pCopyQuotedGString += yytext;
+ BEGIN( lastStringContext );
+ }
<CopyGString,CopyPHPGString>"/*"|"*/"|"//" {
*pCopyQuotedGString+=yytext;
}
diff --git a/src/tagreader.cpp b/src/tagreader.cpp
index 942c55b..1afa30d 100644
--- a/src/tagreader.cpp
+++ b/src/tagreader.cpp
@@ -102,6 +102,7 @@ class TagClassInfo
QCString name;
QCString filename;
QCString clangId;
+ QCString anchor;
TagAnchorInfoList docAnchors;
QList<BaseInfo> *bases;
QList<TagMemberInfo> members;
@@ -382,7 +383,7 @@ class TagFileParser : public QXmlDefaultHandler
}
else
{
- warn("Unknown compound attribute `%s' found!\n",kind.data());
+ warn("Unknown compound attribute `%s' found!",kind.data());
m_state = Invalid;
}
if (isObjC=="yes" && m_curClass)
@@ -410,7 +411,7 @@ class TagFileParser : public QXmlDefaultHandler
case InPackage: m_tagFilePackages.append(m_curPackage);
m_curPackage=0; break;
default:
- warn("tag `compound' was not expected!\n");
+ warn("tag `compound' was not expected!");
}
}
@@ -456,7 +457,7 @@ class TagFileParser : public QXmlDefaultHandler
case InNamespace: m_curNamespace->members.append(m_curMember); break;
case InGroup: m_curGroup->members.append(m_curMember); break;
case InPackage: m_curPackage->members.append(m_curMember); break;
- default: warn("Unexpected tag `member' found\n"); break;
+ default: warn("Unexpected tag `member' found"); break;
}
}
@@ -474,7 +475,7 @@ class TagFileParser : public QXmlDefaultHandler
}
else
{
- warn("Found enumvalue tag outside of member tag\n");
+ warn("Found `enumvalue' tag outside of member tag");
}
}
@@ -502,7 +503,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 `member' found\n"); break;
+ default: warn("Unexpected tag `docanchor' found"); break;
}
}
@@ -515,7 +516,7 @@ class TagFileParser : public QXmlDefaultHandler
case InNamespace: m_curNamespace->classList.append(m_curString); break;
case InGroup: m_curGroup->classList.append(m_curString); break;
case InPackage: m_curPackage->classList.append(m_curString); break;
- default: warn("Unexpected tag `class' found\n"); break;
+ default: warn("Unexpected tag `class' found"); break;
}
}
@@ -526,7 +527,7 @@ class TagFileParser : public QXmlDefaultHandler
case InNamespace: m_curNamespace->classList.append(m_curString); break;
case InFile: m_curFile->namespaceList.append(m_curString); break;
case InGroup: m_curGroup->namespaceList.append(m_curString); break;
- default: warn("Unexpected tag `namespace' found\n"); break;
+ default: warn("Unexpected tag `namespace' found"); break;
}
}
@@ -536,7 +537,7 @@ class TagFileParser : public QXmlDefaultHandler
{
case InGroup: m_curGroup->fileList.append(m_curString); break;
case InDir: m_curDir->fileList.append(m_curString); break;
- default: warn("Unexpected tag `file' found\n"); break;
+ default: warn("Unexpected tag `file' found"); break;
}
}
@@ -545,7 +546,7 @@ class TagFileParser : public QXmlDefaultHandler
switch(m_state)
{
case InGroup: m_curGroup->fileList.append(m_curString); break;
- default: warn("Unexpected tag `page' found\n"); break;
+ default: warn("Unexpected tag `page' found"); break;
}
}
@@ -554,7 +555,7 @@ class TagFileParser : public QXmlDefaultHandler
switch(m_state)
{
case InDir: m_curDir->subdirList.append(m_curString); break;
- default: warn("Unexpected tag `page' found\n"); break;
+ default: warn("Unexpected tag `dir' found"); break;
}
}
@@ -578,7 +579,7 @@ class TagFileParser : public QXmlDefaultHandler
}
else
{
- warn("Unexpected tag `type' found\n");
+ warn("Unexpected tag `type' found");
}
}
@@ -594,7 +595,7 @@ class TagFileParser : public QXmlDefaultHandler
case InDir: m_curDir->name = m_curString; break;
case InMember: m_curMember->name = m_curString; break;
case InPackage: m_curPackage->name = m_curString; break;
- default: warn("Unexpected tag `name' found\n"); break;
+ default: warn("Unexpected tag `name' found"); break;
}
}
@@ -628,7 +629,7 @@ class TagFileParser : public QXmlDefaultHandler
}
else
{
- warn("Unexpected tag `base' found\n");
+ warn("Unexpected tag `base' found");
}
}
@@ -640,7 +641,7 @@ class TagFileParser : public QXmlDefaultHandler
}
else
{
- warn("Unexpected tag `base' found\n");
+ warn("Unexpected tag `base' found");
}
}
@@ -657,7 +658,7 @@ class TagFileParser : public QXmlDefaultHandler
}
else
{
- warn("Unexpected tag `includes' found\n");
+ warn("Unexpected tag `includes' found");
}
m_curString="";
}
@@ -680,7 +681,7 @@ class TagFileParser : public QXmlDefaultHandler
}
else
{
- warn("Unexpected tag `templarg' found\n");
+ warn("Unexpected tag `templarg' found");
}
}
@@ -695,7 +696,7 @@ class TagFileParser : public QXmlDefaultHandler
case InPage: m_curPage->filename = m_curString; break;
case InPackage: m_curPackage->filename = m_curString; break;
case InDir: m_curDir->filename = m_curString; break;
- default: warn("Unexpected tag `filename' found\n"); break;
+ default: warn("Unexpected tag `filename' found"); break;
}
}
@@ -705,7 +706,7 @@ class TagFileParser : public QXmlDefaultHandler
{
case InFile: m_curFile->path = m_curString; break;
case InDir: m_curDir->path = m_curString; break;
- default: warn("Unexpected tag `path' found\n"); break;
+ default: warn("Unexpected tag `path' found"); break;
}
}
@@ -715,9 +716,13 @@ class TagFileParser : public QXmlDefaultHandler
{
m_curMember->anchor = m_curString;
}
+ else if (m_state==InClass)
+ {
+ m_curClass->anchor = m_curString;
+ }
else
{
- warn("Unexpected tag `anchor' found\n");
+ warn("Unexpected tag `anchor' found");
}
}
@@ -737,7 +742,7 @@ class TagFileParser : public QXmlDefaultHandler
}
else
{
- warn("warning: Unexpected tag `anchor' found\n");
+ warn("Unexpected tag `clangid' found");
}
}
@@ -751,7 +756,7 @@ class TagFileParser : public QXmlDefaultHandler
}
else
{
- warn("Unexpected tag `anchorfile' found\n");
+ warn("Unexpected tag `anchorfile' found");
}
}
@@ -763,7 +768,7 @@ class TagFileParser : public QXmlDefaultHandler
}
else
{
- warn("Unexpected tag `arglist' found\n");
+ warn("Unexpected tag `arglist' found");
}
}
void endTitle()
@@ -772,7 +777,7 @@ class TagFileParser : public QXmlDefaultHandler
{
case InGroup: m_curGroup->title = m_curString; break;
case InPage: m_curPage->title = m_curString; break;
- default: warn("Unexpected tag `title' found\n"); break;
+ default: warn("Unexpected tag `title' found"); break;
}
}
@@ -784,7 +789,7 @@ class TagFileParser : public QXmlDefaultHandler
}
else
{
- warn("Unexpected tag `subgroup' found\n");
+ warn("Unexpected tag `subgroup' found");
}
}
@@ -879,7 +884,7 @@ class TagFileParser : public QXmlDefaultHandler
}
else
{
- warn("Unknown tag `%s' found!\n",name.data());
+ warn("Unknown tag `%s' found!",name.data());
}
return TRUE;
}
@@ -894,7 +899,7 @@ class TagFileParser : public QXmlDefaultHandler
}
else
{
- warn("Unknown tag `%s' found!\n",name.data());
+ warn("Unknown tag `%s' found!",name.data());
}
return TRUE;
}
@@ -1158,7 +1163,7 @@ void TagFileParser::addDocAnchors(Entry *e,const TagAnchorInfoList &l)
}
else
{
- warn("Duplicate anchor %s found\n",ta->label.data());
+ warn("Duplicate anchor %s found",ta->label.data());
}
}
}
@@ -1335,6 +1340,7 @@ void TagFileParser::buildLists(Entry *root)
addDocAnchors(ce,tci->docAnchors);
TagInfo *ti = new TagInfo;
ti->tagName = m_tagName;
+ ti->anchor = tci->anchor;
ti->fileName = tci->filename;
ce->id = tci->clangId;
ce->tagInfo = ti;
diff --git a/src/template.cpp b/src/template.cpp
index 3e39d3c..b1435ce 100644
--- a/src/template.cpp
+++ b/src/template.cpp
@@ -698,7 +698,7 @@ class FilterTexLabel
{
if (v.isValid() && (v.type()==TemplateVariant::String))
{
- return TemplateVariant(latexEscapeLabelName(v.toString(),FALSE),TRUE);
+ return TemplateVariant(latexEscapeLabelName(v.toString()),TRUE);
}
else
{
@@ -717,7 +717,7 @@ class FilterTexIndex
{
if (v.isValid() && (v.type()==TemplateVariant::String))
{
- return TemplateVariant(latexEscapeIndexChars(v.toString(),FALSE),TRUE);
+ return TemplateVariant(latexEscapeIndexChars(v.toString()),TRUE);
}
else
{
diff --git a/src/util.cpp b/src/util.cpp
index 5d2051b..c76304b 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -6639,6 +6639,8 @@ PageDef *addRelatedPage(const char *name,const QCString &ptitle,
// append documentation block to the page.
pd->setDocumentation(doc,fileName,startLine);
//printf("Adding page docs `%s' pi=%p name=%s\n",doc.data(),pd,name);
+ // append (x)refitems to the page.
+ pd->setRefItems(sli);
}
else // new page
{
@@ -6928,7 +6930,7 @@ void filterLatexString(FTextStream &t,const char *str,
}
}
-QCString latexEscapeLabelName(const char *s,bool insideTabbing)
+QCString latexEscapeLabelName(const char *s)
{
QGString result;
QCString tmp(qstrlen(s)+1);
@@ -6958,14 +6960,14 @@ QCString latexEscapeLabelName(const char *s,bool insideTabbing)
p++;
}
tmp[i]=0;
- filterLatexString(t,tmp.data(),insideTabbing);
+ filterLatexString(t,tmp,TRUE);
break;
}
}
return result.data();
}
-QCString latexEscapeIndexChars(const char *s,bool insideTabbing)
+QCString latexEscapeIndexChars(const char *s)
{
QGString result;
QCString tmp(qstrlen(s)+1);
@@ -6996,7 +6998,7 @@ QCString latexEscapeIndexChars(const char *s,bool insideTabbing)
p++;
}
tmp[i]=0;
- filterLatexString(t,tmp.data(),insideTabbing);
+ filterLatexString(t,tmp.data(),TRUE);
break;
}
}
@@ -7027,6 +7029,25 @@ QCString latexEscapePDFString(const char *s)
return result.data();
}
+QCString latexFilterURL(const char *s)
+{
+ QGString result;
+ FTextStream t(&result);
+ const char *p=s;
+ char c;
+ while ((c=*p++))
+ {
+ switch (c)
+ {
+ case '#': t << "\\#"; break;
+ default:
+ t << c;
+ break;
+ }
+ }
+ return result.data();
+}
+
QCString rtfFormatBmkStr(const char *name)
{
diff --git a/src/util.h b/src/util.h
index f3c8510..3305332 100644
--- a/src/util.h
+++ b/src/util.h
@@ -347,9 +347,10 @@ void filterLatexString(FTextStream &t,const char *str,
bool insideItem=FALSE,
bool keepSpaces=FALSE);
-QCString latexEscapeLabelName(const char *s,bool insideTabbing);
-QCString latexEscapeIndexChars(const char *s,bool insideTabbing);
+QCString latexEscapeLabelName(const char *s);
+QCString latexEscapeIndexChars(const char *s);
QCString latexEscapePDFString(const char *s);
+QCString latexFilterURL(const char *s);
QCString rtfFormatBmkStr(const char *name);
diff --git a/src/vhdlcode.l b/src/vhdlcode.l
index 68dcafb..ee0731f 100644
--- a/src/vhdlcode.l
+++ b/src/vhdlcode.l
@@ -370,7 +370,7 @@ static void codifyLines(const char *text,const char *cl=0,bool classlink=FALSE,b
//g_code->codify(sp);
if (comment)
{
- writeFont("keyword",line.data());
+ writeFont("comment",line.data());
}
else
{
@@ -381,7 +381,7 @@ static void codifyLines(const char *text,const char *cl=0,bool classlink=FALSE,b
else
{
if (comment)
- writeFont("keyword",sp);
+ writeFont("comment",sp);
else
writeWord(sp,cl,classlink);
done=TRUE;
@@ -1478,11 +1478,11 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI
writeFont("keyword",vhdlcodeYYtext);
}
-<Bases>^{B}*{XILINX}[^\n]* {
- writeWord(yytext);
- //codifyLines(vhdlcodeYYtext,g_CurrClass.data(),TRUE);
- }
-
+<Bases>^{B}*{XILINX}/[^a-zA-Z0-9_] {
+ writeWord(yytext);
+ //codifyLines(vhdlcodeYYtext,g_CurrClass.data(),TRUE);
+ }
+
<Bases>^{B}*"set_"[^\n]* {
writeWord(yytext);
}
@@ -1497,37 +1497,38 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI
}
<*>\n{TEXTT} { // found normal or special comment on its own line
- QCString text(vhdlcodeYYtext);
- int i=text.find("--");
- if (text.mid(i,3)=="--!" && // hide special comment
- Config_getBool(STRIP_CODE_COMMENTS))
- {
- g_yyLineNr++; // skip complete line
- }
- else // normal comment
- {
- // startFontClass("keyword");
- codifyLines(text,0,FALSE,TRUE);
- // endFontClass();
- }
+ QCString text(vhdlcodeYYtext);
+ int i=text.find("--");
+ if (text.mid(i,3)=="--!") // && // hide special comment
+ {
+ if (!Config_getBool(STRIP_CODE_COMMENTS))
+ {
+ codifyLines(text,0,FALSE,TRUE);
+ }
+ g_yyLineNr++; // skip complete line
+ }
+ else // normal comment
+ {
+ codifyLines(text,0,FALSE,TRUE);
+ }
}
<*>{TEXTT} { // found normal or special comment after something
- QCString text(vhdlcodeYYtext);
- int i=text.find("--");
- if (text.mid(i,3)=="--!" &&
- Config_getBool(STRIP_CODE_COMMENTS))
- {
- // hide special comment
- }
- else // normal comment
- {
- // startFontClass("keyword");
- codifyLines(text,0,FALSE,TRUE);
- // endFontClass();
- }
+ QCString text(vhdlcodeYYtext);
+ int i=text.find("--");
+ if (text.mid(i,3)=="--!")
+ {
+ // hide special comment
+ if (!Config_getBool(STRIP_CODE_COMMENTS))
+ {
+ codifyLines(text,0,FALSE,TRUE);
+ }
+ }
+ else // normal comment
+ {
+ codifyLines(text,0,FALSE,TRUE);
+ }
}
-
%%
/*@ ----------------------------------------------------------------------------
diff --git a/src/vhdldocgen.cpp b/src/vhdldocgen.cpp
index 36392b7..410a4c5 100644
--- a/src/vhdldocgen.cpp
+++ b/src/vhdldocgen.cpp
@@ -602,7 +602,7 @@ const char* g_vhdlKeyWordMap1[] =
{
"natural","unsigned","signed","string","boolean", "bit","bit_vector","character",
"std_ulogic","std_ulogic_vector","std_logic","std_logic_vector","integer",
- "real","float","ufixed","sfixed","time",0
+ "real","float","ufixed","sfixed","time","positive",0
};
// logic
@@ -667,7 +667,7 @@ const char* g_vhdlKeyWordMap3[] =
QCString* VhdlDocGen::findKeyWord(const QCString& tmp)
{
static QCString vhdlkeyword("vhdlkeyword");
- static QCString vhdltype("comment");
+ static QCString vhdltype("keywordtype");
static QCString vhdllogic("vhdllogic");
static QCString preprocessor("keywordflow");
diff --git a/src/xmldocvisitor.cpp b/src/xmldocvisitor.cpp
index 525dbf5..35e9194 100644
--- a/src/xmldocvisitor.cpp
+++ b/src/xmldocvisitor.cpp
@@ -494,7 +494,7 @@ void XmlDocVisitor::visitPre(DocPara *)
void XmlDocVisitor::visitPost(DocPara *)
{
if (m_hide) return;
- m_t << "</para>";
+ m_t << "</para>" << endl;
}
void XmlDocVisitor::visitPre(DocRoot *)