diff options
40 files changed, 760 insertions, 414 deletions
@@ -1,7 +1,7 @@ -DOXYGEN Version 1.3-rc1-20021128 +DOXYGEN Version 1.3-rc1-20021207 Please read the installation section of the manual (http://www.doxygen.org/install.html) for instructions. -------- -Dimitri van Heesch (28 November 2002) +Dimitri van Heesch (07 December 2002) @@ -1,4 +1,4 @@ -DOXYGEN Version 1.3_rc1_20021128 +DOXYGEN Version 1.3_rc1_20021207 Please read INSTALL for compilation instructions. @@ -17,4 +17,4 @@ to subscribe to the lists or to visit the archives. Enjoy, -Dimitri van Heesch (dimitri@stack.nl) (28 November 2002) +Dimitri van Heesch (dimitri@stack.nl) (07 December 2002) @@ -1 +1 @@ -1.3-rc1-20021128 +1.3-rc1-20021207 diff --git a/doc/config.doc b/doc/config.doc index f94f8e8..6419e6e 100644 --- a/doc/config.doc +++ b/doc/config.doc @@ -195,6 +195,7 @@ followed by the descriptions of the tags grouped by category. \refitem cfg_treeview_width TREEVIEW_WIDTH \refitem cfg_verbatim_headers VERBATIM_HEADERS \refitem cfg_warn_format WARN_FORMAT +\refitem cfg_warn_if_doc_error WARN_IF_DOC_ERROR \refitem cfg_warn_if_undocumented WARN_IF_UNDOCUMENTED \refitem cfg_warn_logfile WARN_LOGFILE \refitem cfg_warnings WARNINGS @@ -583,6 +584,13 @@ function's detailed documentation block. for undocumented members. If \c EXTRACT_ALL is set to \c YES then this flag will automatically be disabled. +\anchor cfg_warn_if_doc_error +<dt>\c WARN_IF_DOC_ERROR <dd> + If \c WARN_IF_DOC_ERROR is set to \c YES, doxygen will generate warnings for + potential errors in the documentation, such as not documenting some + parameters in a documented function, or documenting parameters that + don't exist or using markup commands wrongly. + \anchor cfg_warn_format <dt>\c WARN_FORMAT <dd> \addindex WARN_FORMAT diff --git a/doc/language.doc b/doc/language.doc index 5b13d41..902603c 100644 --- a/doc/language.doc +++ b/doc/language.doc @@ -25,7 +25,7 @@ Doxygen has built-in support for multiple languages. This means that the text fragments that doxygen generates can be produced in languages other than English (the default) at configuration time. -Currently (version 1.3pre1), 28 languages +Currently (version 1.2.14-20020317), 28 languages are supported (sorted alphabetically): Brazilian Portuguese, Catalan, Chinese, Chinese Traditional, Croatian, Czech, Danish, Dutch, English, Finnish, @@ -119,9 +119,9 @@ when the translator was updated. </TR> <TR BGCOLOR="#ffffff"> <TD>German</TD> - <TD>Jens Seidel<br>Jens Breitenstein</TD> - <TD>jensseidel@NOSPAM.users.sf.net<br>Jens.Breitenstein@NOSPAM.tlc.de</TD> - <TD>1.2.17</TD> + <TD>Jens Seidel</TD> + <TD>jensseidel@NOSPAM.users.sf.net</TD> + <TD>up-to-date</TD> </TR> <TR BGCOLOR="#ffffff"> <TD>Greek</TD> @@ -139,7 +139,7 @@ when the translator was updated. <TD>Italian</TD> <TD>Alessandro Falappa<br>Ahmed Aldo Faisal</TD> <TD>alessandro@NOSPAM.falappa.net<br>aaf23@NOSPAM.cam.ac.uk</TD> - <TD>1.2.18</TD> + <TD>up-to-date</TD> </TR> <TR BGCOLOR="#ffffff"> <TD>Japanese</TD> @@ -253,14 +253,13 @@ when the translator was updated. \hline French & Xavier Outhier & {\tt xouthier@yahoo.fr} & 1.2.17 \\ \hline - German & Jens Seidel & {\tt jensseidel@users.sf.net} & 1.2.17 \\ - & Jens Breitenstein & {\tt Jens.Breitenstein@tlc.de} & \\ + German & Jens Seidel & {\tt jensseidel@users.sf.net} & up-to-date \\ \hline Greek & Harry Kalogirou & {\tt harkal@rainbow.cs.unipi.gr} & 1.2.11 \\ \hline Hungarian & F\"{o}ldv\'{a}ri Gy\"{o}rgy & {\tt foldvari@diatronltd.com} & 1.2.1 \\ \hline - Italian & Alessandro Falappa & {\tt alessandro@falappa.net} & 1.2.18 \\ + Italian & Alessandro Falappa & {\tt alessandro@falappa.net} & up-to-date \\ & Ahmed Aldo Faisal & {\tt aaf23@cam.ac.uk} & \\ \hline Japanese & Ryunosuke Sato & {\tt puyo@mint.freemail.ne.jp} & 1.2.18 \\ diff --git a/doc/maintainers.txt b/doc/maintainers.txt index 073c5e7..29b4a88 100644 --- a/doc/maintainers.txt +++ b/doc/maintainers.txt @@ -49,7 +49,7 @@ Alessandro Falappa: alessandro@falappa.net Ahmed Aldo Faisal: aaf23@cam.ac.uk Japanese -Ryunosuke Sato: puyo@mint.freemail.ne.jp +Ryunosuke Satoh: sun594@hotmail.com Kenji Nagamatsu: naga@joyful.club.ne.jp Korean diff --git a/packages/rpm/doxygen.spec b/packages/rpm/doxygen.spec index f32523b..52b9aa2 100644 --- a/packages/rpm/doxygen.spec +++ b/packages/rpm/doxygen.spec @@ -1,6 +1,6 @@ Summary: A documentation system for C/C++. Name: doxygen -Version: 1.3_rc1_20021128 +Version: 1.3_rc1_20021207 Release: 1 Epoch: 1 Source0: ftp://ftp.stack.nl/pub/users/dimitri/%{name}-%{version}.src.tar.gz diff --git a/src/classdef.cpp b/src/classdef.cpp index 70efe0d..426202d 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -556,7 +556,7 @@ void ClassDef::distributeMemberGroupDocumentation() void ClassDef::findSectionsInDocumentation() { - docFindSections(documentation(),0,this,0); + docFindSections(documentation(),0,this,0,docFile()); MemberGroupSDict::Iterator mgli(*memberGroupSDict); MemberGroup *mg; for (;(mg=mgli.current());++mgli) @@ -109,13 +109,15 @@ static int g_lastCContext; class VariableContext { public: + static const ClassDef *dummyContext; + class Scope : public SDict<ClassDef> { public: Scope() : SDict<ClassDef>(17) {} }; - VariableContext() + VariableContext() { m_scopes.setAutoDelete(TRUE); } @@ -157,12 +159,14 @@ class VariableContext void addVariable(const QCString &type,const QCString &name); ClassDef *findVariable(const QCString &name); + private: Scope m_globalScope; QList<Scope> m_scopes; }; void VariableContext::addVariable(const QCString &type,const QCString &name) { + //printf("VariableContext::addVariable(%s,%s)\n",type.data(),name.data()); QCString ltype = type.simplifyWhiteSpace(); QCString lname = name.simplifyWhiteSpace(); if (ltype.left(7)=="struct ") @@ -191,6 +195,11 @@ void VariableContext::addVariable(const QCString &type,const QCString &name) // probably a template class, try without arguments as well addVariable(ltype.left(i),name); } + else // add a dummy entry so the name is hidden + { + //printf("adding dummy context!\n"); + scope->append(lname,dummyContext); + } } ClassDef *VariableContext::findVariable(const QCString &name) @@ -215,6 +224,8 @@ ClassDef *VariableContext::findVariable(const QCString &name) return result; } +const ClassDef *VariableContext::dummyContext = (ClassDef*)0x8; + static VariableContext g_theVarContext; //------------------------------------------------------------------- @@ -539,8 +550,11 @@ static MemberDef *setCallContextForVar(const QCString &name) ClassDef *mcd = g_theVarContext.findVariable(name); if (mcd) // local variable { - //printf("local var `%s' mcd=%s\n",name.data(),mcd->name().data()); - g_theCallContext.setClass(mcd); + if (mcd!=VariableContext::dummyContext) + { + //printf("local var `%s' mcd=%s\n",name.data(),mcd->name().data()); + g_theCallContext.setClass(mcd); + } } else { @@ -611,7 +625,8 @@ static void addDocCrossReference(MemberDef *src,MemberDef *dst) } -static void generateClassOrGlobalLink(BaseCodeDocInterface &ol,char *clName,int *clNameLen=0) +static void generateClassOrGlobalLink(BaseCodeDocInterface &ol,char *clName, + bool typeOnly=FALSE) { int i=0; //printf("generateClassOrGlobalLink(clName=%s)\n",clName); @@ -621,12 +636,12 @@ static void generateClassOrGlobalLink(BaseCodeDocInterface &ol,char *clName,int clName++; } QCString className=clName; - if (clNameLen) *clNameLen=0; if (className.isEmpty()) return; ClassDef *cd=0; if (!g_theVarContext.findVariable(className)) // not a local variable { + //printf("not a local var!\n"); Definition *d = g_currentDefinition; cd = getResolvedClass(d,className); if (cd==0 && (i=className.find('<'))!=-1) @@ -650,11 +665,10 @@ static void generateClassOrGlobalLink(BaseCodeDocInterface &ol,char *clName,int } } writeMultiLineCodeLink(ol,cd->getReference(),cd->getOutputFileBase(),0,className); - if (clNameLen) *clNameLen=className.length()-i-1; } else { - if (cd==0) // not a class, see if it is a global enum/variable/typedef. + if (cd==0 && !typeOnly) // not a class, see if it is a global enum/variable/typedef. { MemberDef *md = setCallContextForVar(clName); //printf("is a global md=%p\n",md); @@ -677,7 +691,6 @@ static void generateClassOrGlobalLink(BaseCodeDocInterface &ol,char *clName,int } codifyLines(clName); - if (clNameLen) *clNameLen=className.length()-1; } } @@ -804,23 +817,26 @@ static void generateMemberLink(BaseCodeDocInterface &ol,const QCString &varName, ClassDef *vcd = g_theVarContext.findVariable(varName); if (vcd) { - //printf("Class found!\n"); - if (getLink(vcd->name(),memName,ol)) - { - //printf("Found result!\n"); - return; - } - BaseClassListIterator bcli(*vcd->baseClasses()); - for ( ; bcli.current() ; ++bcli) + if (vcd!=VariableContext::dummyContext) { - if (getLink(bcli.current()->classDef->name(),memName,ol)) + //printf("Class found!\n"); + if (getLink(vcd->name(),memName,ol)) { //printf("Found result!\n"); return; } + BaseClassListIterator bcli(*vcd->baseClasses()); + for ( ; bcli.current() ; ++bcli) + { + if (getLink(bcli.current()->classDef->name(),memName,ol)) + { + //printf("Found result!\n"); + return; + } + } } } - else // variable not in current context, maybe it is + else // variable not in current context, maybe it is in a parent context { vcd = getResolvedClass(g_currentDefinition,g_classScope); if (vcd && vcd->isLinkable()) @@ -1536,7 +1552,7 @@ TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned" <MemberCall2,FuncCall>[a-z_A-Z][:a-z_A-Z0-9]*({B}*"<"[^\n\<\>]*">")? { addParmType(); g_parmName=yytext; - generateClassOrGlobalLink(*g_code,yytext); + generateClassOrGlobalLink(*g_code,yytext,TRUE); } <MemberCall2,FuncCall>, { g_code->codify(yytext); diff --git a/src/config.l b/src/config.l index 88442d2..60bd014 100644 --- a/src/config.l +++ b/src/config.l @@ -1664,6 +1664,14 @@ void Config::create() "automatically be disabled. \n", TRUE ); + cb = addBool( + "WARN_IF_DOC_ERROR", + "If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for \n" + "potential errors in the documentation, such as not documenting some \n" + "parameters in a documented function, or documenting parameters that \n" + "don't exist or using markup commands wrongly. \n", + TRUE + ); cs = addString( "WARN_FORMAT", "The WARN_FORMAT tag determines the format of the warning messages that \n" diff --git a/src/docparser.cpp b/src/docparser.cpp index f5c17d0..ded0692 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -172,13 +172,13 @@ static QCString findAndCopyImage(const char *fileName,DocImage::Type type) } else { - warn(g_fileName,doctokenizerYYlineno, + warn_doc_error(g_fileName,doctokenizerYYlineno, "Warning: could not write output image %s",outputFile.data()); } } else { - warn(g_fileName,doctokenizerYYlineno, + warn_doc_error(g_fileName,doctokenizerYYlineno, "Warning: could not open image %s",fileName); } @@ -205,14 +205,14 @@ static QCString findAndCopyImage(const char *fileName,DocImage::Type type) text.sprintf("Warning: image file name %s is ambigious.\n",fileName); text+="Possible candidates:\n"; text+=showFileDefMatches(Doxygen::imageNameDict,fileName); - warn(g_fileName,doctokenizerYYlineno,text); + warn_doc_error(g_fileName,doctokenizerYYlineno,text); } else { result=fileName; if (result.left(5)!="http:" && result.left(6)!="https:") { - warn(g_fileName,doctokenizerYYlineno, + warn_doc_error(g_fileName,doctokenizerYYlineno, "Warning: image file %s is not found in IMAGE_PATH: " "assuming external image.",fileName ); @@ -228,7 +228,7 @@ static void checkArgumentName(const QString &name,bool isParam) g_memberDef->argumentList() : g_memberDef->declArgumentList(); if (al==0) return; // no argument list - if (!Config_getBool("WARN_IF_UNDOCUMENTED")) return; + if (!Config_getBool("WARN_IF_DOC_ERROR")) return; static QRegExp re("[a-zA-Z0-9_]+\\.*"); int p=0,i=0,l; @@ -256,12 +256,11 @@ static void checkArgumentName(const QString &name,bool isParam) //printf("member type=%d\n",memberDef->memberType()); QString scope=g_memberDef->getScopeString(); if (!scope.isEmpty()) scope+="::"; else scope=""; - warn(g_memberDef->docFile(),g_memberDef->docLine(), + warn_doc_error(g_memberDef->docFile(),g_memberDef->docLine(), "Warning: argument `%s' of command @param " "is not found in the argument list of %s%s%s", aName.data(),scope.data(),g_memberDef->name().data(), - argListToString(al).data() - ); + argListToString(al).data()); } p=i+l; } @@ -269,7 +268,7 @@ static void checkArgumentName(const QString &name,bool isParam) static void checkUndocumentedParams() { - if (g_memberDef && g_hasParamCommand && Config_getBool("WARN_IF_UNDOCUMENTED")) + if (g_memberDef && g_hasParamCommand && Config_getBool("WARN_IF_DOC_ERROR")) { ArgumentList *al=g_memberDef->isDocsForDefinition() ? g_memberDef->argumentList() : @@ -293,19 +292,20 @@ static void checkUndocumentedParams() { QString scope=g_memberDef->getScopeString(); if (!scope.isEmpty()) scope+="::"; else scope=""; - warn(g_memberDef->docFile(),g_memberDef->docLine(), - "Warning: The following parameters of " - "%s%s%s are not documented:", - scope.data(),g_memberDef->name().data(), - argListToString(al).data()); + QString errMsg=(QString) + "Warning: The following parameters of "+ + scope + QString(g_memberDef->name()) + + QString(argListToString(al)) + + " are not documented:"; for (ali.toFirst();(a=ali.current());++ali) { QString argName = g_memberDef->isDefine() ? a->type : a->name; if (!argName.isEmpty() && g_paramsFound.find(argName)==0) { - warn_cont( " parameter %s\n",argName.data()); + errMsg+=" parameter "+argName+"\n"; } } + warn_doc_error(g_memberDef->docFile(),g_memberDef->docLine(),errMsg); } } } @@ -522,7 +522,7 @@ static int handleStyleArgument(DocNode *parent,QList<DocNode> &children, int tok=doctokenizerYYlex(); if (tok!=TK_WHITESPACE) { - warn(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command", cmdName.data()); return tok; } @@ -535,15 +535,15 @@ static int handleStyleArgument(DocNode *parent,QList<DocNode> &children, switch (tok) { case TK_COMMAND: - warn(g_fileName,doctokenizerYYlineno,"Warning: Illegal command \\%s as the argument of a \\%s command", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Illegal command \\%s as the argument of a \\%s command", tokenName.data(),cmdName.data()); break; case TK_SYMBOL: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found", tokenName.data()); break; default: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s", tokToString(tok)); break; } @@ -570,7 +570,7 @@ static void handleStyleLeave(DocNode *parent,QList<DocNode> &children, g_styleStack.top()->position()!=g_nodeStack.count() // wrong position ) { - warn(g_fileName,doctokenizerYYlineno,"Warning: found </%s> tag without matching <%s> in the same paragraph", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: found </%s> tag without matching <%s> in the same paragraph", tagName,tagName); } else // end the section @@ -600,7 +600,7 @@ static void handlePendingStyleCommands(DocNode *parent,QList<DocNode> &children) case DocStyleChange::Superscript: cmd = "superscript"; break; case DocStyleChange::Preformatted: cmd = "pre"; break; } - warn(g_fileName,doctokenizerYYlineno,"Warning: end of paragraph without end of style " + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: end of paragraph without end of style " "command </%s>",cmd); children.append(new DocStyleChange(parent,g_nodeStack.count(),sc->style(),FALSE)); g_styleStack.pop(); @@ -728,7 +728,7 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList<DocNode> &children doctokenizerYYsetStateHtmlOnly(); int retval = doctokenizerYYlex(); children.append(new DocVerbatim(parent,g_context,g_token->verb,DocVerbatim::HtmlOnly,g_isExample,g_fileName)); - if (retval==0) warn(g_fileName,doctokenizerYYlineno,"Warning: htmlonly section ended without end marker"); + if (retval==0) warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: htmlonly section ended without end marker"); doctokenizerYYsetStatePara(); } break; @@ -737,7 +737,7 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList<DocNode> &children doctokenizerYYsetStateLatexOnly(); int retval = doctokenizerYYlex(); children.append(new DocVerbatim(parent,g_context,g_token->verb,DocVerbatim::LatexOnly,g_isExample,g_fileName)); - if (retval==0) warn(g_fileName,doctokenizerYYlineno,"Warning: latexonly section ended without end marker",doctokenizerYYlineno); + if (retval==0) warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: latexonly section ended without end marker",doctokenizerYYlineno); doctokenizerYYsetStatePara(); } break; @@ -752,20 +752,20 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList<DocNode> &children int tok=doctokenizerYYlex(); if (tok!=TK_WHITESPACE) { - warn(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command", tokenName.data()); break; } tok=doctokenizerYYlex(); if (tok==0) { - warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment block while parsing the " + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment block while parsing the " "argument of command %s",tokenName.data()); break; } else if (tok!=TK_WORD && tok!=TK_LNKWORD) { - warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s", tokToString(tok),tokenName.data()); break; } @@ -778,7 +778,7 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList<DocNode> &children int tok=doctokenizerYYlex(); if (tok!=TK_WHITESPACE) { - warn(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command", tokenName.data()); break; } @@ -787,7 +787,7 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList<DocNode> &children DocInternalRef *ref=0; if (tok!=TK_WORD && tok!=TK_LNKWORD) { - warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s", tokToString(tok),tokenName.data()); doctokenizerYYsetStatePara(); break; @@ -951,6 +951,8 @@ DocSymbol::SymType DocSymbol::decodeSymbol(const QString &symName,char *letter) int l=symName.length(); DBG(("decodeSymbol(%s) l=%d\n",symName.data(),l)); if (symName=="©") return DocSymbol::Copy; + else if (symName=="&tm;") return DocSymbol::Tm; + else if (symName=="®") return DocSymbol::Reg; else if (symName=="<") return DocSymbol::Less; else if (symName==">") return DocSymbol::Greater; else if (symName=="&") return DocSymbol::Amp; @@ -1040,14 +1042,14 @@ static void readTextFileByName(const QString &file,QString &text) } else if (ambig) { - warn(g_fileName,doctokenizerYYlineno,"Warning: included file name %s is ambigious" + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: included file name %s is ambigious" "Possible candidates:\n%s",file.data(), showFileDefMatches(Doxygen::exampleNameDict,file).data() ); } else { - warn(g_fileName,doctokenizerYYlineno,"Warning: included file %s is not found" + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: included file %s is not found" "Check you EXAMPLE_PATH",file.data()); } } @@ -1059,7 +1061,7 @@ DocAnchor::DocAnchor(DocNode *parent,const QString &id,bool newAnchor) { if (id.isEmpty()) { - warn(g_fileName,doctokenizerYYlineno,"Warning: Empty anchor label"); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Empty anchor label"); } if (newAnchor) // found <a name="label"> { @@ -1075,7 +1077,7 @@ DocAnchor::DocAnchor(DocNode *parent,const QString &id,bool newAnchor) } else { - warn(g_fileName,doctokenizerYYlineno,"Warning: Invalid anchor id `%s'",id.data()); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Invalid anchor id `%s'",id.data()); } } } @@ -1242,13 +1244,13 @@ void DocCopy::parse() } else // oops, recursion { - warn(g_fileName,doctokenizerYYlineno,"Warning: recursive call chain of \\copydoc commands detected at %d\n", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: recursive call chain of \\copydoc commands detected at %d\n", doctokenizerYYlineno); } } else { - warn(g_fileName,doctokenizerYYlineno,"Warning: target %s of \\copydoc command not found", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: target %s of \\copydoc command not found", m_link.data()); } } @@ -1343,15 +1345,15 @@ void DocSecRefItem::parse() switch (tok) { case TK_COMMAND: - warn(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a \\refitem", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a \\refitem", g_token->name.data()); break; case TK_SYMBOL: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found", g_token->name.data()); break; default: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s", tokToString(tok)); break; } @@ -1371,13 +1373,13 @@ void DocSecRefItem::parse() } else { - warn(g_fileName,doctokenizerYYlineno,"Warning reference to unknown section %s", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning reference to unknown section %s", m_target.data()); } } else { - warn(g_fileName,doctokenizerYYlineno,"Warning reference to empty target"); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning reference to empty target"); } DBG(("DocSecRefItem::parse() end\n")); @@ -1407,13 +1409,13 @@ void DocSecRefList::parse() int tok=doctokenizerYYlex(); if (tok!=TK_WHITESPACE) { - warn(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after \\refitem command"); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after \\refitem command"); break; } tok=doctokenizerYYlex(); if (tok!=TK_WORD && tok!=TK_LNKWORD) { - warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of \\refitem", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of \\refitem", tokToString(tok)); break; } @@ -1426,7 +1428,7 @@ void DocSecRefList::parse() case CMD_ENDSECREFLIST: goto endsecreflist; default: - warn(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a \\secreflist", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a \\secreflist", g_token->name.data()); goto endsecreflist; } @@ -1437,7 +1439,7 @@ void DocSecRefList::parse() } else { - warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s inside section reference list", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s inside section reference list", tokToString(tok)); goto endsecreflist; } @@ -1480,15 +1482,15 @@ void DocInternalRef::parse() switch (tok) { case TK_COMMAND: - warn(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a \\ref", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a \\ref", g_token->name.data()); break; case TK_SYMBOL: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found", g_token->name.data()); break; default: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s", tokToString(tok)); break; } @@ -1551,7 +1553,7 @@ DocRef::DocRef(DocNode *parent,const QString &target) : } else // oops, bogus target { - warn(g_fileName,doctokenizerYYlineno,"Warning: unable to resolve reference to `%s' for \\ref command", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unable to resolve reference to `%s' for \\ref command", target.data()); } } @@ -1569,15 +1571,15 @@ void DocRef::parse() switch (tok) { case TK_COMMAND: - warn(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a \\ref", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a \\ref", g_token->name.data()); break; case TK_SYMBOL: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found", g_token->name.data()); break; default: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s", tokToString(tok)); break; } @@ -1620,7 +1622,7 @@ DocLink::DocLink(DocNode *parent,const QString &target) : } else // oops, bogus target { - warn(g_fileName,doctokenizerYYlineno,"Warning: unable to resolve link to `%s' for \\link command", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unable to resolve link to `%s' for \\link command", target.data()); } } @@ -1645,17 +1647,17 @@ QString DocLink::parse(bool isJavaLink) case CMD_ENDLINK: if (isJavaLink) { - warn(g_fileName,doctokenizerYYlineno,"Warning: {@link.. ended with @endlink command"); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: {@link.. ended with @endlink command"); } goto endlink; default: - warn(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a \\link", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a \\link", g_token->name.data()); break; } break; case TK_SYMBOL: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found", g_token->name.data()); break; case TK_LNKWORD: @@ -1682,7 +1684,7 @@ QString DocLink::parse(bool isJavaLink) m_children.append(new DocWord(this,g_token->name)); break; default: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s", tokToString(tok)); break; } @@ -1690,7 +1692,7 @@ QString DocLink::parse(bool isJavaLink) } if (tok==0) { - warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected end of comment while inside" + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected end of comment while inside" " link command\n"); } endlink: @@ -1727,15 +1729,15 @@ void DocDotFile::parse() switch (tok) { case TK_COMMAND: - warn(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a \\dotfile", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a \\dotfile", g_token->name.data()); break; case TK_SYMBOL: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found", g_token->name.data()); break; default: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s", tokToString(tok)); break; } @@ -1754,7 +1756,7 @@ void DocDotFile::parse() } else { - warn(g_fileName,doctokenizerYYlineno,"Warning: Unknown option %s after image title", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unknown option %s after image title", g_token->name.data()); } tok=doctokenizerYYlex(); @@ -1771,14 +1773,14 @@ void DocDotFile::parse() } else if (ambig) { - warn(g_fileName,doctokenizerYYlineno,"Warning: included dot file name %s is ambigious.\n" + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: included dot file name %s is ambigious.\n" "Possible candidates:\n%s",m_name.data(), showFileDefMatches(Doxygen::exampleNameDict,m_name).data() ); } else { - warn(g_fileName,doctokenizerYYlineno,"Warning: included dot file %s is not found " + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: included dot file %s is not found " "in any of the paths specified via DOTFILE_DIRS!",m_name.data()); } @@ -1804,15 +1806,15 @@ void DocImage::parse() switch (tok) { case TK_COMMAND: - warn(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a \\image", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a \\image", g_token->name.data()); break; case TK_SYMBOL: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found", g_token->name.data()); break; default: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s", tokToString(tok)); break; } @@ -1831,7 +1833,7 @@ void DocImage::parse() } else { - warn(g_fileName,doctokenizerYYlineno,"Warning: Unknown option %s after image title", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unknown option %s after image title", g_token->name.data()); } tok=doctokenizerYYlex(); @@ -1862,7 +1864,7 @@ int DocHtmlHeader::parse() switch (tok) { case TK_COMMAND: - warn(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a <h%d> tag", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a <h%d> tag", g_token->name.data(),m_level); break; case TK_HTMLTAG: @@ -1872,7 +1874,7 @@ int DocHtmlHeader::parse() { if (m_level!=1) { - warn(g_fileName,doctokenizerYYlineno,"Warning: <h%d> ended with </h1>", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: <h%d> ended with </h1>", m_level); } goto endheader; @@ -1881,7 +1883,7 @@ int DocHtmlHeader::parse() { if (m_level!=2) { - warn(g_fileName,doctokenizerYYlineno,"Warning: <h%d> ended with </h2>", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: <h%d> ended with </h2>", m_level); } goto endheader; @@ -1890,7 +1892,7 @@ int DocHtmlHeader::parse() { if (m_level!=3) { - warn(g_fileName,doctokenizerYYlineno,"Warning: <h%d> ended with </h3>", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: <h%d> ended with </h3>", m_level); } goto endheader; @@ -1899,7 +1901,7 @@ int DocHtmlHeader::parse() { if (m_level!=4) { - warn(g_fileName,doctokenizerYYlineno,"Warning: <h%d> ended with </h4>", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: <h%d> ended with </h4>", m_level); } goto endheader; @@ -1908,7 +1910,7 @@ int DocHtmlHeader::parse() { if (m_level!=5) { - warn(g_fileName,doctokenizerYYlineno,"Warning: <h%d> ended with </h5>", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: <h%d> ended with </h5>", m_level); } goto endheader; @@ -1917,24 +1919,24 @@ int DocHtmlHeader::parse() { if (m_level!=6) { - warn(g_fileName,doctokenizerYYlineno,"Warning: <h%d> ended with </h6>", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: <h%d> ended with </h6>", m_level); } goto endheader; } else { - warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected html tag <%s%s> found within <h%d> context", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected html tag <%s%s> found within <h%d> context", g_token->endTag?"/":"",g_token->name.data(),m_level); } } break; case TK_SYMBOL: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found", g_token->name.data()); break; default: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s", tokToString(tok)); break; } @@ -1942,7 +1944,7 @@ int DocHtmlHeader::parse() } if (tok==0) { - warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected end of comment while inside" + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected end of comment while inside" " <h%d> tag\n",m_level); } endheader: @@ -1969,11 +1971,11 @@ int DocHRef::parse() switch (tok) { case TK_COMMAND: - warn(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a <a>..</a> block", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a <a>..</a> block", g_token->name.data()); break; case TK_SYMBOL: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found", g_token->name.data()); break; case TK_HTMLTAG: @@ -1985,13 +1987,13 @@ int DocHRef::parse() } else { - warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected html tag <%s%s> found within <a href=...> context", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected html tag <%s%s> found within <a href=...> context", g_token->endTag?"/":"",g_token->name.data(),doctokenizerYYlineno); } } break; default: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s", tokToString(tok),doctokenizerYYlineno); break; } @@ -1999,7 +2001,7 @@ int DocHRef::parse() } if (tok==0) { - warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected end of comment while inside" + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected end of comment while inside" " <a href=...> tag",doctokenizerYYlineno); } endhref: @@ -2037,7 +2039,7 @@ int DocInternal::parse() } if (retval==TK_LISTITEM) { - warn(g_fileName,doctokenizerYYlineno,"Warning: Invalid list item found",doctokenizerYYlineno); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Invalid list item found",doctokenizerYYlineno); } } while (retval!=0 && retval!=RetVal_Section); if (lastPar) lastPar->markLast(); @@ -2049,7 +2051,7 @@ int DocInternal::parse() //int secLev = sec->type==SectionInfo::Subsection ? 2 : 1; //if (secLev!=1) // wrong level //{ - // warn(g_fileName,doctokenizerYYlineno,"Warning: Expected level 1 section, found a section with level %d.",secLev); + // warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Expected level 1 section, found a section with level %d.",secLev); // break; //} //else @@ -2062,7 +2064,7 @@ int DocInternal::parse() if (retval==RetVal_Internal) { - warn(g_fileName,doctokenizerYYlineno,"Warning: \\internal command found inside internal section"); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: \\internal command found inside internal section"); } DBG(("DocInternal::parse() end\n")); @@ -2081,7 +2083,7 @@ int DocIndexEntry::parse() int tok=doctokenizerYYlex(); if (tok!=TK_WHITESPACE) { - warn(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after \\addindex command"); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after \\addindex command"); goto endindexentry; } m_entry=""; @@ -2110,7 +2112,7 @@ int DocIndexEntry::parse() case DocSymbol::Apos: m_entry+='\''; break; case DocSymbol::Quot: m_entry+='"'; break; default: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected symbol found as argument of \\addindex"); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected symbol found as argument of \\addindex"); break; } } @@ -2127,13 +2129,13 @@ int DocIndexEntry::parse() case CMD_HASH: m_entry+='#'; break; case CMD_PERCENT: m_entry+='%'; break; default: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected command %s found as argument of \\addindex", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected command %s found as argument of \\addindex", g_token->name.data()); break; } break; default: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s", tokToString(tok)); break; } @@ -2161,11 +2163,11 @@ int DocHtmlCaption::parse() switch (tok) { case TK_COMMAND: - warn(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a <caption> tag", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a <caption> tag", g_token->name.data()); break; case TK_SYMBOL: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found", g_token->name.data()); break; case TK_HTMLTAG: @@ -2178,13 +2180,13 @@ int DocHtmlCaption::parse() } else { - warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected html tag <%s%s> found within <caption> context", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected html tag <%s%s> found within <caption> context", g_token->endTag?"/":"",g_token->name.data()); } } break; default: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s", tokToString(tok)); break; } @@ -2192,7 +2194,7 @@ int DocHtmlCaption::parse() } if (tok==0) { - warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected end of comment while inside" + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected end of comment while inside" " <caption> tag",doctokenizerYYlineno); } endcaption: @@ -2259,20 +2261,20 @@ int DocHtmlRow::parse() } else // found some other tag { - warn(g_fileName,doctokenizerYYlineno,"Warning: expected <td> or <th> tag but " + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected <td> or <th> tag but " "found <%s> instead!",g_token->name.data()); goto endrow; } } else if (tok==0) // premature end of comment { - warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment while looking" + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment while looking" " for a html description title"); goto endrow; } else // token other than html token { - warn(g_fileName,doctokenizerYYlineno,"Warning: expected <td> or <th> tag but found %s token instead!", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected <td> or <th> tag but found %s token instead!", tokToString(tok)); goto endrow; } @@ -2323,7 +2325,7 @@ getrow: { if (m_caption) { - warn(g_fileName,doctokenizerYYlineno,"Warning: table already has a caption, found another one"); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: table already has a caption, found another one"); } else { @@ -2338,18 +2340,18 @@ getrow: } else // found wrong token { - warn(g_fileName,doctokenizerYYlineno,"Warning: expected <tr> or <caption> tag but " + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected <tr> or <caption> tag but " "found <%s%s> instead!", g_token->endTag ? "/" : "", g_token->name.data()); } } else if (tok==0) // premature end of comment { - warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment while looking" + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment while looking" " for a <tr> or <caption> tag"); } else // token other than html token { - warn(g_fileName,doctokenizerYYlineno,"Warning: expected <tr> tag but found %s token instead!", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected <tr> tag but found %s token instead!", tokToString(tok)); } @@ -2383,11 +2385,11 @@ int DocHtmlDescTitle::parse() switch (tok) { case TK_COMMAND: - warn(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a <dt> tag", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a <dt> tag", g_token->name.data()); break; case TK_SYMBOL: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found", g_token->name.data()); break; case TK_HTMLTAG: @@ -2404,13 +2406,13 @@ int DocHtmlDescTitle::parse() } else { - warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected html tag <%s%s> found within <dt> context", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected html tag <%s%s> found within <dt> context", g_token->endTag?"/":"",g_token->name.data()); } } break; default: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s", tokToString(tok)); break; } @@ -2418,7 +2420,7 @@ int DocHtmlDescTitle::parse() } if (tok==0) { - warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected end of comment while inside" + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected end of comment while inside" " <dt> tag"); } endtitle: @@ -2478,20 +2480,20 @@ int DocHtmlDescList::parse() } else // found some other tag { - warn(g_fileName,doctokenizerYYlineno,"Warning: expected <dt> tag but " + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected <dt> tag but " "found <%s> instead!",g_token->name.data()); goto enddesclist; } } else if (tok==0) // premature end of comment { - warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment while looking" + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment while looking" " for a html description title"); goto enddesclist; } else // token other than html token { - warn(g_fileName,doctokenizerYYlineno,"Warning: expected <dt> tag but found %s token instead!", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected <dt> tag but found %s token instead!", tokToString(tok)); goto enddesclist; } @@ -2516,7 +2518,7 @@ int DocHtmlDescList::parse() if (retval==0) { - warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment while inside <dl> block"); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment while inside <dl> block"); } enddesclist: @@ -2603,20 +2605,20 @@ int DocHtmlList::parse() } else // found some other tag { - warn(g_fileName,doctokenizerYYlineno,"Warning: expected <li> tag but " + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected <li> tag but " "found <%s> instead!",g_token->name.data()); goto endlist; } } else if (tok==0) // premature end of comment { - warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment while looking" + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment while looking" " for a html list item"); goto endlist; } else // token other than html token { - warn(g_fileName,doctokenizerYYlineno,"Warning: expected <li> tag but found %s token instead!", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected <li> tag but found %s token instead!", tokToString(tok)); goto endlist; } @@ -2630,7 +2632,7 @@ int DocHtmlList::parse() if (retval==0) { - warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment while inside <%cl> block", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment while inside <%cl> block", m_type==Unordered ? 'u' : 'o'); } @@ -2724,15 +2726,15 @@ void DocTitle::parse() switch (tok) { case TK_COMMAND: - warn(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a title section", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a title section", g_token->name.data()); break; case TK_SYMBOL: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found", g_token->name.data()); break; default: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s", tokToString(tok)); break; } @@ -2745,6 +2747,11 @@ void DocTitle::parse() ASSERT(n==this); } +void DocTitle::parseFromString(const QString &text) +{ + m_children.append(new DocWord(this,text)); +} + //-------------------------------------------------------------------------- DocSimpleSect::DocSimpleSect(DocNode *parent,Type t) : @@ -2803,6 +2810,24 @@ int DocSimpleSect::parse(bool userTitle) return retval; // 0==EOF, TK_NEWPARA, TK_LISTITEM, TK_ENDLIST, RetVal_SimpleSec } +int DocSimpleSect::parseRcs() +{ + DBG(("DocSimpleSect::parseRcs() start\n")); + g_nodeStack.push(this); + + m_title = new DocTitle(this); + m_title->parseFromString(g_token->name); + + docParserPushContext(); + internalValidatingParseDoc(this,m_children,g_token->text); + docParserPopContext(); + + DBG(("DocSimpleSect::parseRcs() end retval=%d\n",retval)); + DocNode *n=g_nodeStack.pop(); + ASSERT(n==this); + return RetVal_OK; +} + //-------------------------------------------------------------------------- int DocParamList::parse(const QString &cmdName) @@ -2814,7 +2839,7 @@ int DocParamList::parse(const QString &cmdName) int tok=doctokenizerYYlex(); if (tok!=TK_WHITESPACE) { - warn(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command", cmdName.data()); } doctokenizerYYsetStateParam(); @@ -2837,7 +2862,7 @@ int DocParamList::parse(const QString &cmdName) doctokenizerYYsetStatePara(); if (tok==0) /* premature end of comment block */ { - warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment block while parsing the " + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment block while parsing the " "argument of command %s",cmdName.data()); return 0; } @@ -2945,7 +2970,7 @@ void DocPara::handleIncludeOperator(const QString &cmdName,DocIncOperator::Type int tok=doctokenizerYYlex(); if (tok!=TK_WHITESPACE) { - warn(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command", cmdName.data()); return; } @@ -2954,13 +2979,13 @@ void DocPara::handleIncludeOperator(const QString &cmdName,DocIncOperator::Type doctokenizerYYsetStatePara(); if (tok==0) { - warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment block while parsing the " + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment block while parsing the " "argument of command %s", cmdName.data()); return; } else if (tok!=TK_WORD) { - warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s", tokToString(tok),cmdName.data()); return; } @@ -2995,21 +3020,21 @@ void DocPara::handleImage(const QString &cmdName) int tok=doctokenizerYYlex(); if (tok!=TK_WHITESPACE) { - warn(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command", cmdName.data()); return; } tok=doctokenizerYYlex(); if (tok!=TK_WORD && tok!=TK_LNKWORD) { - warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s", tokToString(tok),cmdName.data()); return; } tok=doctokenizerYYlex(); if (tok!=TK_WHITESPACE) { - warn(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command", cmdName.data()); return; } @@ -3020,7 +3045,7 @@ void DocPara::handleImage(const QString &cmdName) else if (imgType=="rtf") t=DocImage::Rtf; else { - warn(g_fileName,doctokenizerYYlineno,"Warning: image type %s specified as the first argument of " + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: image type %s specified as the first argument of " "%s is not valid", imgType.data(),cmdName.data()); return; @@ -3029,7 +3054,7 @@ void DocPara::handleImage(const QString &cmdName) tok=doctokenizerYYlex(); if (tok!=TK_WORD) { - warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s", tokToString(tok),cmdName.data()); return; } @@ -3044,7 +3069,7 @@ void DocPara::handleDotFile(const QString &cmdName) int tok=doctokenizerYYlex(); if (tok!=TK_WHITESPACE) { - warn(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command", cmdName.data()); return; } @@ -3052,12 +3077,13 @@ void DocPara::handleDotFile(const QString &cmdName) tok=doctokenizerYYlex(); if (tok!=TK_WORD) { - warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s", tokToString(tok),cmdName.data()); return; } doctokenizerYYsetStatePara(); - DocDotFile *df = new DocDotFile(this,g_token->name); + QString name = g_token->name; + DocDotFile *df = new DocDotFile(this,name); m_children.append(df); df->parse(); } @@ -3067,7 +3093,7 @@ void DocPara::handleLink(const QString &cmdName,bool isJavaLink) int tok=doctokenizerYYlex(); if (tok!=TK_WHITESPACE) { - warn(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command", cmdName.data()); return; } @@ -3075,7 +3101,7 @@ void DocPara::handleLink(const QString &cmdName,bool isJavaLink) tok=doctokenizerYYlex(); if (tok!=TK_WORD) { - warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s", tokToString(tok),cmdName.data()); return; } @@ -3094,7 +3120,7 @@ void DocPara::handleRef(const QString &cmdName) int tok=doctokenizerYYlex(); if (tok!=TK_WHITESPACE) { - warn(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command", cmdName.data()); return; } @@ -3103,7 +3129,7 @@ void DocPara::handleRef(const QString &cmdName) DocRef *ref=0; if (tok!=TK_WORD) { - warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s", tokToString(tok),cmdName.data()); goto endref; } @@ -3144,7 +3170,7 @@ int DocPara::handleLanguageSwitch() } else { - warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s as parameter of \\~", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s as parameter of \\~", tokToString(tok)); goto endlang; } @@ -3164,7 +3190,7 @@ void DocPara::handleInclude(const QString &cmdName,DocInclude::Type t) int tok=doctokenizerYYlex(); if (tok!=TK_WHITESPACE) { - warn(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command", cmdName.data()); return; } @@ -3173,13 +3199,13 @@ void DocPara::handleInclude(const QString &cmdName,DocInclude::Type t) doctokenizerYYsetStatePara(); if (tok==0) { - warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment block while parsing the " + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment block while parsing the " "argument of command %s",cmdName.data()); return; } else if (tok!=TK_WORD) { - warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s", tokToString(tok),cmdName.data()); return; } @@ -3194,20 +3220,20 @@ void DocPara::handleSection(const QString &cmdName) int tok=doctokenizerYYlex(); if (tok!=TK_WHITESPACE) { - warn(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command", cmdName.data()); return; } tok=doctokenizerYYlex(); if (tok==0) { - warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment block while parsing the " + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment block while parsing the " "argument of command %s\n", cmdName.data()); return; } else if (tok!=TK_WORD && tok!=TK_LNKWORD) { - warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s", tokToString(tok),cmdName.data()); return; } @@ -3224,7 +3250,7 @@ int DocPara::handleCommand(const QString &cmdName) switch (CmdMapper::map(cmdName)) { case CMD_UNKNOWN: - warn(g_fileName,doctokenizerYYlineno,"Warning: Found unknown command `\\%s'",cmdName.data()); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Found unknown command `\\%s'",cmdName.data()); break; case CMD_EMPHASIS: m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Italic,TRUE)); @@ -3351,7 +3377,7 @@ int DocPara::handleCommand(const QString &cmdName) doctokenizerYYsetStateCode(); retval = doctokenizerYYlex(); m_children.append(new DocVerbatim(this,g_context,g_token->verb,DocVerbatim::Code,g_isExample,g_fileName)); - if (retval==0) warn(g_fileName,doctokenizerYYlineno,"Warning: code section ended without end marker"); + if (retval==0) warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: code section ended without end marker"); doctokenizerYYsetStatePara(); } break; @@ -3360,7 +3386,7 @@ int DocPara::handleCommand(const QString &cmdName) doctokenizerYYsetStateHtmlOnly(); retval = doctokenizerYYlex(); m_children.append(new DocVerbatim(this,g_context,g_token->verb,DocVerbatim::HtmlOnly,g_isExample,g_fileName)); - if (retval==0) warn(g_fileName,doctokenizerYYlineno,"Warning: htmlonly section ended without end marker"); + if (retval==0) warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: htmlonly section ended without end marker"); doctokenizerYYsetStatePara(); } break; @@ -3369,7 +3395,7 @@ int DocPara::handleCommand(const QString &cmdName) doctokenizerYYsetStateLatexOnly(); retval = doctokenizerYYlex(); m_children.append(new DocVerbatim(this,g_context,g_token->verb,DocVerbatim::LatexOnly,g_isExample,g_fileName)); - if (retval==0) warn(g_fileName,doctokenizerYYlineno,"Warning: latexonly section ended without end marker"); + if (retval==0) warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: latexonly section ended without end marker"); doctokenizerYYsetStatePara(); } break; @@ -3378,7 +3404,7 @@ int DocPara::handleCommand(const QString &cmdName) doctokenizerYYsetStateVerbatim(); retval = doctokenizerYYlex(); m_children.append(new DocVerbatim(this,g_context,g_token->verb,DocVerbatim::Verbatim,g_isExample,g_fileName)); - if (retval==0) warn(g_fileName,doctokenizerYYlineno,"Warning: verbatim section ended without end marker"); + if (retval==0) warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: verbatim section ended without end marker"); doctokenizerYYsetStatePara(); } break; @@ -3387,7 +3413,7 @@ int DocPara::handleCommand(const QString &cmdName) case CMD_ENDLATEXONLY: case CMD_ENDLINK: case CMD_ENDVERBATIM: - warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected command %s",g_token->name.data()); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected command %s",g_token->name.data()); break; case CMD_PARAM: retval = handleParamSection(cmdName,DocParamSect::Param); @@ -3421,20 +3447,20 @@ int DocPara::handleCommand(const QString &cmdName) int tok=doctokenizerYYlex(); if (tok!=TK_WHITESPACE) { - warn(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command", cmdName.data()); break; } tok=doctokenizerYYlex(); if (tok==0) { - warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment block while parsing the " + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment block while parsing the " "argument of command %s",cmdName.data()); break; } else if (tok!=TK_WORD && tok!=TK_LNKWORD) { - warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s", tokToString(tok),cmdName.data()); break; } @@ -3457,20 +3483,20 @@ int DocPara::handleCommand(const QString &cmdName) int tok=doctokenizerYYlex(); if (tok!=TK_WHITESPACE) { - warn(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command", cmdName.data()); break; } tok=doctokenizerYYlex(); if (tok==0) { - warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment block while parsing the " + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment block while parsing the " "argument of command %s\n", cmdName.data()); break; } else if (tok!=TK_WORD && tok!=TK_LNKWORD) { - warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s", tokToString(tok),cmdName.data()); break; } @@ -3526,10 +3552,10 @@ int DocPara::handleCommand(const QString &cmdName) } break; case CMD_SECREFITEM: - warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected command %s",g_token->name.data()); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected command %s",g_token->name.data()); break; case CMD_ENDSECREFLIST: - warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected command %s",g_token->name.data()); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected command %s",g_token->name.data()); break; case CMD_FORMULA: { @@ -3541,7 +3567,7 @@ int DocPara::handleCommand(const QString &cmdName) retval = handleLanguageSwitch(); break; case CMD_INTERNALREF: - warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected command %s",g_token->name.data()); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected command %s",g_token->name.data()); break; default: // we should not get here! @@ -3581,7 +3607,7 @@ int DocPara::handleHtmlStartTag(const QString &tagName,const HtmlAttribList &tag case HTML_LI: if (!insideUL(this) && !insideOL(this)) { - warn(g_fileName,doctokenizerYYlineno,"Warning: lonely <li> tag found"); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: lonely <li> tag found"); } else { @@ -3635,7 +3661,7 @@ int DocPara::handleHtmlStartTag(const QString &tagName,const HtmlAttribList &tag retval = RetVal_DescTitle; break; case HTML_DD: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected tag <dd> found"); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected tag <dd> found"); break; case HTML_TABLE: { @@ -3654,7 +3680,7 @@ int DocPara::handleHtmlStartTag(const QString &tagName,const HtmlAttribList &tag retval = RetVal_TableHCell; break; case HTML_CAPTION: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected tag <caption> found"); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected tag <caption> found"); break; case HTML_BR: { @@ -3684,7 +3710,7 @@ int DocPara::handleHtmlStartTag(const QString &tagName,const HtmlAttribList &tag } else { - warn(g_fileName,doctokenizerYYlineno,"Warning: found <a> tag with name option but without value!"); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: found <a> tag with name option but without value!"); } } else if (opt->name=="href") // <a href=url>..</a> tag @@ -3759,7 +3785,7 @@ int DocPara::handleHtmlStartTag(const QString &tagName,const HtmlAttribList &tag } break; case HTML_UNKNOWN: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unsupported html tag <%s> found", tagName.data()); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unsupported html tag <%s> found", tagName.data()); break; default: // we should not get here! @@ -3779,7 +3805,7 @@ int DocPara::handleHtmlEndTag(const QString &tagName) case HTML_UL: if (!insideUL(this)) { - warn(g_fileName,doctokenizerYYlineno,"Warning: found </ul> tag without matching <ul>"); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: found </ul> tag without matching <ul>"); } else { @@ -3789,7 +3815,7 @@ int DocPara::handleHtmlEndTag(const QString &tagName) case HTML_OL: if (!insideOL(this)) { - warn(g_fileName,doctokenizerYYlineno,"Warning: found </ol> tag without matching <ol>"); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: found </ol> tag without matching <ol>"); } else { @@ -3799,7 +3825,7 @@ int DocPara::handleHtmlEndTag(const QString &tagName) case HTML_LI: if (!insideLI(this)) { - warn(g_fileName,doctokenizerYYlineno,"Warning: found </li> tag without matching <li>"); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: found </li> tag without matching <li>"); } else { @@ -3809,7 +3835,7 @@ int DocPara::handleHtmlEndTag(const QString &tagName) //case HTML_PRE: // if (!insidePRE(this)) // { - // warn(g_fileName,doctokenizerYYlineno,"Warning: found </pre> tag without matching <pre>"); + // warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: found </pre> tag without matching <pre>"); // } // else // { @@ -3867,32 +3893,32 @@ int DocPara::handleHtmlEndTag(const QString &tagName) // ignore </th> tag break; case HTML_CAPTION: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected tag </caption> found"); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected tag </caption> found"); break; case HTML_BR: - warn(g_fileName,doctokenizerYYlineno,"Warning: Illegal </br> tag found\n"); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Illegal </br> tag found\n"); break; case HTML_H1: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected tag </h1> found"); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected tag </h1> found"); break; case HTML_H2: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected tag </h2> found"); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected tag </h2> found"); break; case HTML_H3: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected tag </h3> found"); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected tag </h3> found"); break; case HTML_IMG: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected tag </img> found"); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected tag </img> found"); break; case HTML_HR: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected tag </hr> found"); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected tag </hr> found"); break; case HTML_A: - //warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected tag </a> found"); + //warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected tag </a> found"); // ignore </a> tag (can be part of <a name=...></a> break; case HTML_UNKNOWN: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unsupported html tag </%s> found", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unsupported html tag </%s> found", tagName.data()); break; default: @@ -4025,13 +4051,13 @@ reparsetoken: } else { - warn(g_fileName,doctokenizerYYlineno,"Warning: End of list marker found " + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: End of list marker found " "has invalid indent level"); } } else { - warn(g_fileName,doctokenizerYYlineno,"Warning: End of list marker found without any preceding " + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: End of list marker found without any preceding " "list items"); } break; @@ -4132,7 +4158,7 @@ reparsetoken: } else { - warn(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found", g_token->name.data()); } break; @@ -4140,6 +4166,17 @@ reparsetoken: case TK_NEWPARA: retval=TK_NEWPARA; goto endparagraph; + case TK_RCSTAG: + { + DocSimpleSect *ss=new DocSimpleSect(this,DocSimpleSect::Rcs); + m_children.append(ss); + ss->parseRcs(); + } + break; + default: + warn_doc_error(g_fileName,doctokenizerYYlineno, + "Warning: Found unexpected token (id=%x)\n",tok); + break; } } endparagraph: @@ -4194,7 +4231,7 @@ int DocSection::parse() } if (retval==TK_LISTITEM) { - warn(g_fileName,doctokenizerYYlineno,"Warning: Invalid list item found"); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Invalid list item found"); } } while (retval!=0 && retval!=RetVal_Internal && @@ -4247,7 +4284,7 @@ int DocSection::parse() if (retval==RetVal_Subsection) level=2; else if (retval==RetVal_Subsubsection) level=3; else level=4; - warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected %s " + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected %s " "command found inside %s!", sectionLevelToName[level],sectionLevelToName[m_level]); retval=0; // stop parsing @@ -4296,7 +4333,7 @@ void DocText::parse() } else { - warn(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found", g_token->name.data()); } } @@ -4329,13 +4366,13 @@ void DocText::parse() m_children.append(new DocSymbol(this,DocSymbol::Percent)); break; default: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected command `%s' found", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected command `%s' found", g_token->name.data()); break; } break; default: - warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s", tokToString(tok)); break; } @@ -4373,7 +4410,7 @@ void DocRoot::parse() } if (retval==TK_LISTITEM) { - warn(g_fileName,doctokenizerYYlineno,"Warning: Invalid list item found"); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Invalid list item found"); } } while (retval!=0 && retval!=RetVal_Section && retval!=RetVal_Internal); if (lastPar) lastPar->markLast(); @@ -4493,8 +4530,8 @@ DocNode *validatingParseText(const char *input) return txt; } -void docFindSections(const char *input,PageInfo *pi,Definition *d,MemberGroup *mg) +void docFindSections(const char *input,PageInfo *pi,Definition *d,MemberGroup *mg,const char *fileName) { - doctokenizerYYFindSections(input,pi,d,mg); + doctokenizerYYFindSections(input,pi,d,mg,fileName); } diff --git a/src/docparser.h b/src/docparser.h index d7788db..e20d3b3 100644 --- a/src/docparser.h +++ b/src/docparser.h @@ -59,7 +59,7 @@ DocNode *validatingParseDoc(const char *fileName,int startLine, DocNode *validatingParseText(const char *input); /*! Searches for section and anchor commands in the input */ -void docFindSections(const char *input,PageInfo *pi,Definition *d,MemberGroup *m); +void docFindSections(const char *input,PageInfo *pi,Definition *d,MemberGroup *m,const char *fileName); //--------------------------------------------------------------------------- @@ -156,6 +156,7 @@ template<class T> class CompAccept protected: QList<DocNode> m_children; + QList<DocNode> &getChildren() const { return m_children; } }; @@ -297,7 +298,7 @@ class DocSymbol : public DocNode { public: enum SymType { Unknown=0, BSlash,At,Less,Greater,Amp,Dollar,Hash,Percent, - Copy, Apos, Quot, Uml, Acute, Grave, Circ, Tilde, Szlig, + Copy, Tm, Reg, Apos, Quot, Uml, Acute, Grave, Circ, Tilde, Szlig, Cedil, Ring, Nbsp }; DocSymbol(DocNode *parent,SymType s,char letter='\0') : @@ -506,6 +507,7 @@ class DocTitle : public CompAccept<DocTitle>, public DocNode public: DocTitle(DocNode *parent) : m_parent(parent) {} void parse(); + void parseFromString(const QString &title); Kind kind() const { return Kind_Title; } DocNode *parent() const { return m_parent; } void accept(DocVisitor *v) { CompAccept<DocTitle>::accept(this,v); } @@ -856,11 +858,12 @@ class DocSimpleSect : public CompAccept<DocSimpleSect>, public DocNode enum Type { Unknown, See, Return, Author, Authors, Version, Since, Date, - Note, Warning, Pre, Post, Invar, Remark, Attention, User + Note, Warning, Pre, Post, Invar, Remark, Attention, User, Rcs }; DocSimpleSect(DocNode *parent,Type t); virtual ~DocSimpleSect(); int parse(bool userTitle); + int parseRcs(); Kind kind() const { return Kind_SimpleSect; } Type type() const { return m_type; } DocNode *parent() const { return m_parent; } diff --git a/src/doctokenizer.h b/src/doctokenizer.h index 74077f4..658e8a7 100644 --- a/src/doctokenizer.h +++ b/src/doctokenizer.h @@ -111,7 +111,7 @@ const char *tokToString(int token); // operations on the scanner void doctokenizerYYFindSections(const char *input,PageInfo *pi,Definition *d, - MemberGroup *mg); + MemberGroup *mg,const char *fileName); void doctokenizerYYinit(const char *input,const char *fileName); void doctokenizerYYcleanup(); void doctokenizerYYpushContext(); diff --git a/src/doctokenizer.l b/src/doctokenizer.l index be5db69..063d78e 100644 --- a/src/doctokenizer.l +++ b/src/doctokenizer.l @@ -51,6 +51,7 @@ static MemberGroup *g_memberGroup; static QCString g_secLabel; static QCString g_secTitle; static SectionInfo::SectionType g_secType; +static QCString g_endMarker; struct DocLexerContext { @@ -286,10 +287,10 @@ OPMASK ({BLANK}*{OPNORM}({FUNCARG}?))|({OPCAST}{FUNCARG}) LNKWORD1 ("::"|"#")?{SCOPEMASK} CVSPEC {BLANK}*("const"|"volatile") LNKWORD2 {SCOPEPRE}*"operator"{OPMASK} -WORD1 [^ \t\n\r\\@<>(){}&$#,.]+|"{"|"}" -WORD2 "."|","|"("|")" -WORD1NQ [^ \t\n\r\\@<>(){}&$#,."]+ -WORD2NQ "."|","|"("|")" +WORD1 [^ \t\n\r\\@<>()\[\]:;\?{}&$#,.]+|"{"|"}" +WORD2 "."|","|"("|")"|"["|"]"|":"|";"|"\?" +WORD1NQ [^ \t\n\r\\@<>()\[\]:;\?{}&$#,."]+ +WORD2NQ "."|","|"("|")"|"["|"]"|":"|";"|"\?" HTMLTAG "<"(("/")?){ID}({WS}+{ATTRIB})*">" HTMLKEYL "strong"|"center"|"table"|"caption"|"small"|"code"|"dfn"|"var"|"img"|"pre"|"sub"|"tr"|"td"|"th"|"ol"|"ul"|"li"|"tt"|"kbd"|"em"|"hr"|"dl"|"dt"|"dd"|"br"|"i"|"a"|"b"|"p" HTMLKEYU "STRONG"|"CENTER"|"TABLE"|"CAPTION"|"SMALL"|"CODE"|"DFN"|"VAR"|"IMG"|"PRE"|"SUB"|"TR"|"TD"|"TH"|"OL"|"UL"|"LI"|"TT"|"KBD"|"EM"|"HR"|"DL"|"DT"|"DD"|"BR"|"I"|"A"|"B"|"P" @@ -325,6 +326,7 @@ LABELID [a-z_A-Z][a-z_A-Z0-9\-]* %s St_SecLabel1 %s St_SecLabel2 %s St_SecTitle +%x St_SecSkip %% <St_Para>\r /* skip carriage return */ @@ -383,9 +385,9 @@ LABELID [a-z_A-Z][a-z_A-Z0-9\-]* } <St_Para>"$"{ID}":"[^\n$]+"$" { /* RCS tag */ QString tagName(yytext+1); - int i=tagName.find(':'); - g_token->name = tagName.left(i); - g_token->text = tagName.mid(i+1,tagName.length()-i-2); + int index=tagName.find(':'); + g_token->name = tagName.left(index); + g_token->text = tagName.mid(index+1,tagName.length()-index-2); return TK_RCSTAG; } <St_Para,St_HtmlOnly>"$("{ID}")" { /* environment variable */ @@ -720,6 +722,41 @@ LABELID [a-z_A-Z][a-z_A-Z0-9\-]* g_secType = SectionInfo::Paragraph; BEGIN(St_SecLabel2); } +<St_Sections>{CMD}"verbatim" { + g_endMarker="endverbatim"; + BEGIN(St_SecSkip); + } +<St_Sections>{CMD}"htmlonly" { + g_endMarker="endhtmlonly"; + BEGIN(St_SecSkip); + } +<St_Sections>{CMD}"latexonly" { + g_endMarker="endlatexonly"; + BEGIN(St_SecSkip); + } +<St_Sections>{CMD}"code" { + g_endMarker="endcode"; + BEGIN(St_SecSkip); + } +<St_Sections>"<!--" { + g_endMarker="-->"; + BEGIN(St_SecSkip); + } +<St_SecSkip>{CMD}{ID} { + if (strcmp(yytext+1,g_endMarker)==0) + { + BEGIN(St_Sections); + } + } +<St_SecSkip>"-->" { + if (strcmp(yytext,g_endMarker)==0) + { + BEGIN(St_Sections); + } + } +<St_SecSkip>[^a-z_A-Z0-9\-]+ +<St_SecSkip>. +<St_SecSkip>\n <St_Sections>. <St_Sections>\n <St_SecLabel1>{LABELID} { @@ -756,7 +793,7 @@ LABELID [a-z_A-Z][a-z_A-Z0-9\-]* //-------------------------------------------------------------------------- void doctokenizerYYFindSections(const char *input,PageInfo *pi,Definition *d, - MemberGroup *mg) + MemberGroup *mg,const char *fileName) { if (input==0) return; g_inputString = input; @@ -765,6 +802,7 @@ void doctokenizerYYFindSections(const char *input,PageInfo *pi,Definition *d, g_pageInfo = pi; g_definition = d; g_memberGroup = mg; + g_fileName = fileName; BEGIN(St_Sections); doctokenizerYYlineno = 1; doctokenizerYYlex(); diff --git a/src/dot.cpp b/src/dot.cpp index bccf249..70fa726 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -33,6 +33,8 @@ //-------------------------------------------------------------------- +static const int maxCmdLine = 4096; + /*! mapping from protection levels to color names */ static const char *edgeColorMap[] = { @@ -54,9 +56,12 @@ static const char *edgeStyleMap[] = * site image map. * \param t the stream to which the result is written. * \param mapName the name of the map file. + * \param urlOnly if FALSE the url field in the map contains an external + * references followed by a $ and then the URL. * \returns TRUE if succesful. */ -static bool convertMapFile(QTextStream &t,const char *mapName) +static bool convertMapFile(QTextStream &t,const char *mapName, + bool urlOnly=FALSE) { QFile f(mapName); if (!f.open(IO_ReadOnly)) @@ -93,30 +98,39 @@ static bool convertMapFile(QTextStream &t,const char *mapName) x2=x1; x1=temp; } - char *refPtr = url; - char *urlPtr = strchr(url,'$'); - //printf("url=`%s'\n",url); - if (urlPtr) + if (urlOnly) { - QCString *dest; - *urlPtr++='\0'; - //printf("refPtr=`%s' urlPtr=`%s'\n",refPtr,urlPtr); - //printf("Found url=%s coords=%d,%d,%d,%d\n",url,x1,y1,x2,y2); - t << "<area "; - if (*refPtr!='\0') - { - t << "doxygen=\"" << refPtr << ":"; - if ((dest=Doxygen::tagDestinationDict[refPtr])) t << *dest << "/"; - t << "\" "; - } - t << "href=\""; - if (*refPtr!='\0') + t << "<area href=\"" << url << "\" shape=\"rect\" coords=\"" + << x1 << "," << y1 << "," << x2 << "," << y2 << "\"" + << " alt=\"\">" << endl; + } + else // name and external reference are separated by a $ + { + char *refPtr = url; + char *urlPtr = strchr(url,'$'); + //printf("url=`%s'\n",url); + if (urlPtr) { - if ((dest=Doxygen::tagDestinationDict[refPtr])) t << *dest << "/"; + QCString *dest; + *urlPtr++='\0'; + //printf("refPtr=`%s' urlPtr=`%s'\n",refPtr,urlPtr); + //printf("Found url=%s coords=%d,%d,%d,%d\n",url,x1,y1,x2,y2); + t << "<area "; + if (*refPtr!='\0') + { + t << "doxygen=\"" << refPtr << ":"; + if ((dest=Doxygen::tagDestinationDict[refPtr])) t << *dest << "/"; + t << "\" "; + } + t << "href=\""; + if (*refPtr!='\0') + { + if ((dest=Doxygen::tagDestinationDict[refPtr])) t << *dest << "/"; + } + t << urlPtr << "\" shape=\"rect\" coords=\"" + << x1 << "," << y1 << "," << x2 << "," << y2 << "\"" + << " alt=\"\">" << endl; } - t << urlPtr << "\" shape=\"rect\" coords=\"" - << x1 << "," << y1 << "," << x2 << "," << y2 << "\"" - << " alt=\"\">" << endl; } } } @@ -766,7 +780,7 @@ void DotGfxHierarchyTable::writeGraph(QTextStream &out,const char *path) t << "}" << endl; f.close(); - QCString dotArgs(4096); + QCString dotArgs(maxCmdLine); dotArgs.sprintf("-T%s \"%s\" -o \"%s\"", imgExt.data(), dotName.data(),imgName.data()); //printf("Running: dot -T%s %s -o %s\n",imgExt.data(),dotName.data(),imgName.data()); @@ -1239,64 +1253,63 @@ static void findMaximalDotGraph(DotNode *root, ) { int minDistance=1; // min distance that shows only direct children. - int curDistance=2; // current distance to try + int curDistance; //=QMIN(2,maxDist); // current distance to try int maxDistance=maxDist; // max distance that show whole graph int width=0; int height=0; int maxDotGraphWidth = Config_getInt("MAX_DOT_GRAPH_WIDTH"); int maxDotGraphHeight = Config_getInt("MAX_DOT_GRAPH_HEIGHT"); + int lastFit=minDistance; // binary search for the maximal inheritance depth that fits in a reasonable // sized image (dimensions: Config_getInt("MAX_DOT_GRAPH_WIDTH"), Config_getInt("MAX_DOT_GRAPH_HEIGHT")) - if (maxDistance>1) + while (minDistance<=maxDistance) { - do - { - writeDotGraph(root,format,baseName,lrRank,renderParents, - curDistance,backArrows); + curDistance = (minDistance+maxDistance)/2; - QCString dotArgs(4096); - // create annotated dot file - dotArgs.sprintf("-Tdot \"%s.dot\" -o \"%s_tmp.dot\"",baseName.data(),baseName.data()); - if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0) - { - err("Problems running dot. Check your installation!\n"); - return; - } + writeDotGraph(root,format,baseName,lrRank,renderParents, + curDistance,backArrows); - // extract bounding box from the result - readBoundingBoxDot(baseName+"_tmp.dot",&width,&height); - width = width *96/72; // 96 pixels/inch, 72 points/inch - height = height*96/72; // 96 pixels/inch, 72 points/inch - //printf("Found bounding box (%d,%d) max (%d,%d)\n",width,height, - // Config_getInt("MAX_DOT_GRAPH_WIDTH"),Config_getInt("MAX_DOT_GRAPH_HEIGHT")); + QCString dotArgs(maxCmdLine); + // create annotated dot file + dotArgs.sprintf("-Tdot \"%s.dot\" -o \"%s_tmp.dot\"",baseName.data(),baseName.data()); + if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0) + { + err("Problems running dot. Check your installation!\n"); + return; + } - // remove temporary dot file - thisDir.remove(baseName+"_tmp.dot"); + // extract bounding box from the result + readBoundingBoxDot(baseName+"_tmp.dot",&width,&height); + width = width *96/72; // 96 pixels/inch, 72 points/inch + height = height*96/72; // 96 pixels/inch, 72 points/inch + //printf("Found bounding box (%d,%d) max (%d,%d)\n",width,height, + // Config_getInt("MAX_DOT_GRAPH_WIDTH"),Config_getInt("MAX_DOT_GRAPH_HEIGHT")); - bool graphFits=(width<maxDotGraphWidth && height<maxDotGraphHeight); - if (graphFits) // graph is small enough - { - minDistance=curDistance; - //printf("Image fits [%d-%d]\n",minDistance,maxDistance); - } - else // graph does not fit anymore with curDistance - { - //printf("Image does not fit [%d-%d]\n",minDistance,maxDistance); - maxDistance=curDistance; - } - curDistance=minDistance+(maxDistance-curDistance)/2; - //printf("curDistance=%d\n",curDistance); + // remove temporary dot file + thisDir.remove(baseName+"_tmp.dot"); - } while ((maxDistance-minDistance)>1); + bool graphFits=(width<maxDotGraphWidth && height<maxDotGraphHeight); + if (graphFits) // graph is small enough + { + lastFit=curDistance; + minDistance=curDistance+1; + //printf("Image fits [%d-%d]\n",minDistance,maxDistance); + } + else // graph does not fit anymore with curDistance + { + //printf("Image does not fit [%d-%d]\n",minDistance,maxDistance); + maxDistance=curDistance-1; + } } + //printf("lastFit=%d\n",lastFit); writeDotGraph(root, format, baseName, lrRank || (minDistance==1 && width>Config_getInt("MAX_DOT_GRAPH_WIDTH")), renderParents, - minDistance, + lastFit, backArrows ); } @@ -1357,7 +1370,7 @@ QCString DotClassGraph::writeGraph(QTextStream &out, if (format==BITMAP) // run dot to create a bitmap image { - QCString dotArgs(4096); + QCString dotArgs(maxCmdLine); QCString imgExt = Config_getEnum("DOT_IMAGE_FORMAT"); QCString imgName = baseName+"."+imgExt; dotArgs.sprintf("-T%s \"%s.dot\" -o \"%s\"", @@ -1410,7 +1423,7 @@ QCString DotClassGraph::writeGraph(QTextStream &out, } else if (format==EPS) // run dot to create a .eps image { - QCString dotArgs(4096); + QCString dotArgs(maxCmdLine); dotArgs.sprintf("-Tps \"%s.dot\" -o \"%s.eps\"",baseName.data(),baseName.data()); if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0) { @@ -1427,7 +1440,7 @@ QCString DotClassGraph::writeGraph(QTextStream &out, } if (Config_getBool("USE_PDFLATEX")) { - QCString epstopdfArgs(4096); + QCString epstopdfArgs(maxCmdLine); epstopdfArgs.sprintf("\"%s.eps\" --outfile=\"%s.pdf\"", baseName.data(),baseName.data()); if (iSystem("epstopdf",epstopdfArgs,TRUE)!=0) @@ -1594,7 +1607,7 @@ QCString DotInclDepGraph::writeGraph(QTextStream &out, if (format==BITMAP) { // run dot to create a bitmap image - QCString dotArgs(4096); + QCString dotArgs(maxCmdLine); QCString imgExt = Config_getEnum("DOT_IMAGE_FORMAT"); QCString imgName=baseName+"."+imgExt; dotArgs.sprintf("-T%s \"%s.dot\" -o \"%s\"", @@ -1640,7 +1653,7 @@ QCString DotInclDepGraph::writeGraph(QTextStream &out, else if (format==EPS) { // run dot to create a .eps image - QCString dotArgs(4096); + QCString dotArgs(maxCmdLine); dotArgs.sprintf("-Tps \"%s.dot\" -o \"%s.eps\"", baseName.data(),baseName.data()); if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0) @@ -1658,7 +1671,7 @@ QCString DotInclDepGraph::writeGraph(QTextStream &out, } if (Config_getBool("USE_PDFLATEX")) { - QCString epstopdfArgs(4096); + QCString epstopdfArgs(maxCmdLine); epstopdfArgs.sprintf("\"%s.eps\" --outfile=\"%s.pdf\"", baseName.data(),baseName.data()); if (iSystem("epstopdf",epstopdfArgs,TRUE)!=0) @@ -1747,7 +1760,7 @@ void generateGraphLegend(const char *path) QDir::setCurrent(d.absPath()); // run dot to generate the a bitmap image from the graph - QCString dotArgs(4096); + QCString dotArgs(maxCmdLine); QCString imgExt = Config_getEnum("DOT_IMAGE_FORMAT"); QCString imgName = "graph_legend."+imgExt; dotArgs.sprintf("-T%s graph_legend.dot -o %s",imgExt.data(),imgName.data()); @@ -1789,7 +1802,7 @@ void writeDotGraphFromFile(const char *inFile,const char *outDir, // outf.writeBlock(a.data(),s); //} - QCString dotArgs(4096); + QCString dotArgs(maxCmdLine); QCString imgExt = Config_getEnum("DOT_IMAGE_FORMAT"); QCString imgName = (QCString)outFile+"."+imgExt; if (format==BITMAP) @@ -1812,7 +1825,7 @@ void writeDotGraphFromFile(const char *inFile,const char *outDir, // Added by Nils Strom if ( (format==EPS) && (Config_getBool("USE_PDFLATEX")) ) { - QCString epstopdfArgs(4096); + QCString epstopdfArgs(maxCmdLine); epstopdfArgs.sprintf("\"%s.eps\" --outfile=\"%s.pdf\"", outFile,outFile); if (iSystem("epstopdf",epstopdfArgs,TRUE)!=0) @@ -1826,3 +1839,43 @@ void writeDotGraphFromFile(const char *inFile,const char *outDir, QDir::setCurrent(oldDir); } + +/*! Marco Dalla Gasperina [marcodg@attbi.com] added this to allow + * dotfiles to generate image maps. + * \param inFile just the basename part of the filename + * \param outDir output directory + * \returns a string which is the HTML image map (without the \<map\>\</map\>) + */ +QString getDotImageMapFromFile(const QString& inFile, const QString& outDir) +{ + QString outFile = inFile + ".map"; + + // chdir to the output dir, so dot can find the font file. + QCString oldDir = convertToQCString(QDir::currentDirPath()); + // go to the html output directory (i.e. path) + QDir::setCurrent(outDir); + //printf("Going to dir %s\n",QDir::currentDirPath().data()); + + QCString dotArgs(maxCmdLine); + dotArgs.sprintf("-Timap \"%s\" -o \"%s\"", inFile.data(), outFile.data()); + + QCString dotExe = Config_getString("DOT_PATH") + "dot"; + //printf("Running: %s %s\n",dotExe.data(),dotArgs.data()); + if (iSystem(dotExe,dotArgs)!=0) + { + err("Problems running dot. Check your installation!\n"); + QDir::setCurrent(oldDir); + return ""; + } + QString result; + QTextOStream tmpout(&result); + convertMapFile(tmpout, outFile, TRUE); + QDir().remove(outFile); + //printf("result=%s\n",result.data()); + + QDir::setCurrent(oldDir); + return result; +} +// end MDG mods + + @@ -173,5 +173,7 @@ class DotInclDepGraph void generateGraphLegend(const char *path); void writeDotGraphFromFile(const char *inFile,const char *outDir, const char *outFile,GraphOutputFormat format); +QString getDotImageMapFromFile(const QString& inFile, const QString& outDir); + #endif diff --git a/src/doxygen.cpp b/src/doxygen.cpp index a0476f4..30c3f15 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -103,8 +103,9 @@ StringDict Doxygen::tagDestinationDict(257); // all tag locations // a member group QDict<void> Doxygen::expandAsDefinedDict(257); // all macros that should be expanded -QIntDict<QCString> Doxygen::memberHeaderDict(1009); // dictionary of the member groups heading -QIntDict<QCString> Doxygen::memberDocDict(1009); // dictionary of the member groups heading +QIntDict<MemberGroupInfo> Doxygen::memGrpInfoDict(1009); // dictionary of the member groups heading +//QIntDict<QCString> Doxygen::memberHeaderDict(1009); // dictionary of the member groups heading +//QIntDict<QCString> Doxygen::memberDocDict(1009); // dictionary of the member groups heading PageInfo *Doxygen::mainPage = 0; QTextStream Doxygen::tagFile; @@ -173,10 +174,8 @@ void statistics() compoundKeywordDict.statistics(); fprintf(stderr,"--- expandAsDefinedDict stats ----\n"); Doxygen::expandAsDefinedDict.statistics(); - fprintf(stderr,"--- memberHeaderDict stats ----\n"); - Doxygen::memberHeaderDict.statistics(); - fprintf(stderr,"--- memberDocDict stats ----\n"); - Doxygen::memberDocDict.statistics(); + fprintf(stderr,"--- memGrpInfoDict stats ----\n"); + Doxygen::memGrpInfoDict.statistics(); } @@ -1061,10 +1060,13 @@ static void findUsingDirectives(Entry *root) static void findUsingDeclarations(Entry *root) { - if (root->section==Entry::USINGDECL_SEC) + if (root->section==Entry::USINGDECL_SEC && + !(root->parent->section&Entry::COMPOUND_MASK) // not a class/struct member + ) { - //printf("Found using declaration %s at line %d of %s\n", - // root->name.data(),root->startLine,root->fileName.data()); + printf("Found using declaration %s at line %d of %s inside section %x\n", + root->name.data(),root->startLine,root->fileName.data(), + root->parent->section); bool ambig; if (!root->name.isEmpty()) { @@ -1142,6 +1144,88 @@ static void findUsingDeclarations(Entry *root) //---------------------------------------------------------------------- +static void findUsingDeclImports(Entry *root) +{ + if (root->section==Entry::USINGDECL_SEC && + (root->parent->section&Entry::COMPOUND_MASK) // in a class/struct member + ) + { + //printf("Found using declaration %s at line %d of %s inside section %x\n", + // root->name.data(),root->startLine,root->fileName.data(), + // root->parent->section); + QCString fullName=removeRedundantWhiteSpace(root->parent->name); + fullName=stripAnonymousNamespaceScope(fullName); + fullName=stripTemplateSpecifiersFromScope(fullName); + ClassDef *cd = getClass(fullName); + if (cd) + { + //printf("found class %s\n",cd->name().data()); + int i=root->name.find("::"); + if (i!=-1) + { + QCString scope=root->name.left(i); + QCString memName=root->name.right(root->name.length()-i-2); + ClassDef *bcd = getResolvedClass(cd,scope); + if (bcd) + { + //printf("found class %s\n",bcd->name().data()); + MemberNameInfoSDict *mndict=bcd->memberNameInfoSDict(); + MemberNameInfo *mni = mndict->find(memName); + if (mni) + { + MemberNameInfoIterator mnii(*mni); + MemberInfo *mi; + for ( ; (mi=mnii.current()) ; ++mnii ) + { + MemberDef *md = mi->memberDef; + if (md && md->protection()!=Private) + { + //printf("found member %s\n",mni->memberName()); + MemberDef *newMd = new MemberDef( + root->fileName,root->startLine, + md->typeString(),memName,md->argsString(), + md->excpString(),root->protection,root->virt, + md->isStatic(),FALSE,md->memberType(), + md->templateArguments(),md->argumentList() + ); + cd->insertMember(newMd); + newMd->setMemberClass(cd); + if (!root->doc.isEmpty() || !root->brief.isEmpty()) + { + newMd->setDocumentation(root->doc,root->docFile,root->docLine); + newMd->setBriefDescription(root->brief,root->briefFile,root->briefLine); + } + else + { + newMd->setDocumentation(md->documentation(),md->docFile(),md->docLine()); + newMd->setBriefDescription(md->briefDescription(),md->briefFile(),md->briefLine()); + } + newMd->setDefinition(md->definition()); + newMd->setBitfields(md->bitfieldString()); + newMd->addSectionsToDefinition(root->anchors); + newMd->setBodySegment(md->getStartBodyLine(),md->getEndBodyLine()); + newMd->setBodyDef(md->getBodyDef()); + newMd->setInitializer(md->initializer()); + newMd->setMaxInitLines(md->initializerLines()); + newMd->setMemberGroupId(root->mGrpId); + newMd->setMemberSpecifiers(md->getMemberSpecifiers()); + } + } + } + } + } + } + } + EntryListIterator eli(*root->sublist); + Entry *e; + for (;(e=eli.current());++eli) + { + findUsingDeclImports(e); + } +} + +//---------------------------------------------------------------------- + static MemberDef *addVariableToClass( Entry *root, ClassDef *cd, @@ -7702,6 +7786,9 @@ void parseInput() findMemberDocumentation(root); // may introduce new members ! transferRelatedFunctionDocumentation(); + msg("Searching for members imported via using declarations...\n"); + findUsingDeclImports(root); + msg("Building page list...\n"); buildPageList(root); @@ -7833,7 +7920,7 @@ void generateOutput() msg("Resolving user defined references...\n"); resolveUserReferences(); - msg("Finding anchor and section in the documentation...\n"); + msg("Finding anchors and sections in the documentation...\n"); findSectionsInDocumentation(); msg("Generating index page...\n"); diff --git a/src/doxygen.h b/src/doxygen.h index 2938a34..d102345 100644 --- a/src/doxygen.h +++ b/src/doxygen.h @@ -87,8 +87,9 @@ class Doxygen static FormulaDict formulaNameDict; static StringDict tagDestinationDict; static StringDict aliasDict; - static QIntDict<QCString> memberHeaderDict; // dictionary of the member groups heading - static QIntDict<QCString> memberDocDict; // dictionary of the member groups heading + static QIntDict<MemberGroupInfo> memGrpInfoDict; + //static QIntDict<QCString> memberHeaderDict; // dictionary of the member groups heading + //static QIntDict<QCString> memberDocDict; // dictionary of the member groups heading static QDict<void> expandAsDefinedDict; static NamespaceDef *globalScope; static QDict<RefList> *specialLists; // array of special lists: todo, test, bug, deprecated ... diff --git a/src/entry.h b/src/entry.h index c619d48..5c0cdb4 100644 --- a/src/entry.h +++ b/src/entry.h @@ -132,15 +132,13 @@ struct Grouping enum GroupPri_t { GROUPING_LOWEST, - GROUPING_AUTO_WEAK = - GROUPING_LOWEST, //!< membership in group was defined via \@weakgroup \@{ \@} + GROUPING_AUTO_WEAK = + GROUPING_LOWEST, //!< membership in group was defined via \@weakgroup \@{ \@} GROUPING_AUTO_ADD, //!< membership in group was defined via \@add[to]group \@{ \@} GROUPING_AUTO_DEF, //!< membership in group was defined via \@defgroup \@{ \@} - GROUPING_AUTO_HIGHEST = - GROUPING_AUTO_DEF, + GROUPING_AUTO_HIGHEST = GROUPING_AUTO_DEF, GROUPING_INGROUP, //!< membership in group was defined by \@ingroup - GROUPING_HIGHEST = - GROUPING_INGROUP + GROUPING_HIGHEST = GROUPING_INGROUP }; static const char *getGroupPriName( GroupPri_t priority ) diff --git a/src/filedef.cpp b/src/filedef.cpp index 00f8f2c..2f7cde2 100644 --- a/src/filedef.cpp +++ b/src/filedef.cpp @@ -100,7 +100,7 @@ void FileDef::distributeMemberGroupDocumentation() void FileDef::findSectionsInDocumentation() { - docFindSections(documentation(),0,this,0); + docFindSections(documentation(),0,this,0,docFile()); MemberGroupSDict::Iterator mgli(*memberGroupSDict); MemberGroup *mg; for (;(mg=mgli.current());++mgli) diff --git a/src/groupdef.cpp b/src/groupdef.cpp index bd527c9..8b118f1 100644 --- a/src/groupdef.cpp +++ b/src/groupdef.cpp @@ -106,7 +106,7 @@ void GroupDef::distributeMemberGroupDocumentation() void GroupDef::findSectionsInDocumentation() { - docFindSections(documentation(),0,this,0); + docFindSections(documentation(),0,this,0,docFile()); MemberGroupSDict::Iterator mgli(*memberGroupSDict); MemberGroup *mg; for (;(mg=mgli.current());++mgli) diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp index 6d127c6..a5bcb1b 100644 --- a/src/htmldocvisitor.cpp +++ b/src/htmldocvisitor.cpp @@ -91,6 +91,8 @@ void HtmlDocVisitor::visit(DocSymbol *s) case DocSymbol::Hash: m_t << "#"; break; case DocSymbol::Percent: m_t << "%"; break; case DocSymbol::Copy: m_t << "©"; break; + case DocSymbol::Tm: m_t << "&tm;"; break; + case DocSymbol::Reg: m_t << "®"; break; case DocSymbol::Apos: m_t << "'"; break; case DocSymbol::Quot: m_t << "\""; break; case DocSymbol::Uml: m_t << "&" << s->letter() << "uml;"; break; @@ -364,11 +366,12 @@ void HtmlDocVisitor::visitPre(DocSimpleSect *s) case DocSimpleSect::Attention: m_t << theTranslator->trAttention(); break; case DocSimpleSect::User: break; + case DocSimpleSect::Rcs: break; case DocSimpleSect::Unknown: break; } // special case 1: user defined title - if (s->type()!=DocSimpleSect::User) + if (s->type()!=DocSimpleSect::User && s->type()!=DocSimpleSect::Rcs) { m_t << ":</b></dt><dd>"; } @@ -644,9 +647,13 @@ void HtmlDocVisitor::visitPre(DocDotFile *df) QString outDir = Config_getString("HTML_OUTPUT"); writeDotGraphFromFile(df->file(),outDir,baseName,BITMAP); m_t << "<div align=\"center\">" << endl; + QString mapName = baseName+".map"; + QString mapFile = df->file()+".map"; m_t << "<img src=\"" << baseName << "." << Config_getEnum("DOT_IMAGE_FORMAT") << "\" alt=\"" - << baseName << "\">" << endl; + << baseName << "\" border=\"0\" usemap=\"#" << mapName << "\">" << endl; + QString imap = getDotImageMapFromFile(df->file(),outDir); + m_t << "<map name=\"" << mapName << "\">" << imap << "</map>" << endl; if (df->hasCaption()) { m_t << "<p><strong>"; diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp index 38e335b..645c357 100644 --- a/src/latexdocvisitor.cpp +++ b/src/latexdocvisitor.cpp @@ -117,6 +117,8 @@ void LatexDocVisitor::visit(DocSymbol *s) case DocSymbol::Hash: m_t << "\\#"; break; case DocSymbol::Percent: m_t << "\\%"; break; case DocSymbol::Copy: m_t << "\\copyright"; break; + case DocSymbol::Tm: m_t << "\\texttrademark"; break; + case DocSymbol::Reg: m_t << "\\textregistered"; break; case DocSymbol::Apos: m_t << "'"; break; case DocSymbol::Quot: m_t << "''"; break; case DocSymbol::Uml: @@ -406,11 +408,12 @@ void LatexDocVisitor::visitPre(DocSimpleSect *s) case DocSimpleSect::Attention: m_t << theTranslator->trAttention(); break; case DocSimpleSect::User: break; + case DocSimpleSect::Rcs: break; case DocSimpleSect::Unknown: break; } // special case 1: user defined title - if (s->type()!=DocSimpleSect::User) + if (s->type()!=DocSimpleSect::User && s->type()!=DocSimpleSect::Rcs) { m_t << ":]"; } @@ -729,8 +732,13 @@ void LatexDocVisitor::visitPre(DocDotFile *df) { baseName=baseName.left(baseName.length()-4); } + if (baseName.right(4)==".dot") + { + baseName=baseName.left(baseName.length()-4); + } QString outDir = Config_getString("LATEX_OUTPUT"); - writeDotGraphFromFile(df->file(),outDir,baseName,EPS); + QString name = df->file(); + writeDotGraphFromFile(name,outDir,baseName,EPS); if (df->hasCaption()) { m_t << "\\begin{figure}[H]" << endl; diff --git a/src/latexgen.cpp b/src/latexgen.cpp index f95c174..e04045d 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -246,6 +246,7 @@ static void writeDefaultHeaderPart1(QTextStream &t) "\\usepackage{graphicx}\n" "\\usepackage{multicol}\n" "\\usepackage{float}\n" + "\\usepackage{textcomp}\n" "\\usepackage{alltt}\n"; if (Config_getBool("PDF_HYPERLINKS")) { diff --git a/src/mandocvisitor.cpp b/src/mandocvisitor.cpp index c5b1230..7700e5f 100644 --- a/src/mandocvisitor.cpp +++ b/src/mandocvisitor.cpp @@ -80,7 +80,9 @@ void ManDocVisitor::visit(DocSymbol *s) case DocSymbol::Dollar: m_t << "$"; break; case DocSymbol::Hash: m_t << "#"; break; case DocSymbol::Percent: m_t << "%"; break; - case DocSymbol::Copy: m_t << "(c)"; break; + case DocSymbol::Copy: m_t << "(C)"; break; + case DocSymbol::Tm: m_t << "(TM)"; break; + case DocSymbol::Reg: m_t << "(R)"; break; case DocSymbol::Apos: m_t << "'"; break; case DocSymbol::Quot: m_t << "''"; break; case DocSymbol::Uml: m_t << s->letter() << "\\*(4"; break; @@ -379,11 +381,12 @@ void ManDocVisitor::visitPre(DocSimpleSect *s) case DocSimpleSect::Attention: m_t << theTranslator->trAttention(); break; case DocSimpleSect::User: break; + case DocSimpleSect::Rcs: break; case DocSimpleSect::Unknown: break; } // special case 1: user defined title - if (s->type()!=DocSimpleSect::User) + if (s->type()!=DocSimpleSect::User && s->type()!=DocSimpleSect::Rcs) { m_t << ":\\fP" << endl; m_t << ".RS 4" << endl; diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 4450a8f..7015c08 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -567,10 +567,11 @@ bool MemberDef::isBriefSectionVisible() const // "", //getFileDef()->name().data(), // argsString()); - QCString *pMemGrp = Doxygen::memberDocDict[grpId]; + MemberGroupInfo *info = Doxygen::memGrpInfoDict[grpId]; + //QCString *pMemGrp = Doxygen::memberDocDict[grpId]; bool hasDocs = hasDocumentation() || // part of a documented member group - (grpId!=-1 && pMemGrp && !pMemGrp->isEmpty()); + (grpId!=-1 && info && !info->doc.isEmpty()); // only include static members with file/namespace scope if // explicitly enabled in the config file @@ -1969,6 +1970,6 @@ void MemberDef::setDeclArgumentList(ArgumentList *al) void MemberDef::findSectionsInDocumentation() { - docFindSections(documentation(),0,this,0); + docFindSections(documentation(),0,this,0,docFile()); } diff --git a/src/membergroup.cpp b/src/membergroup.cpp index 537d55d..d6567ee 100644 --- a/src/membergroup.cpp +++ b/src/membergroup.cpp @@ -37,7 +37,7 @@ //} MemberGroup::MemberGroup(Definition *parent, - int id,const char *hdr,const char *d) /* : Definition(idToName(id)) */ + int id,const char *hdr,const char *d,const char *docFile) { //printf("New member group id=%d header=%s desc=%s\n",id,hdr,d); memberList = new MemberList; @@ -49,6 +49,7 @@ MemberGroup::MemberGroup(Definition *parent, inDeclSection = 0; m_numDecMembers = -1; m_parent = parent; + m_docFile = docFile; //printf("Member group docs=`%s'\n",doc.data()); } @@ -216,7 +217,7 @@ void MemberGroup::addListReferences(Definition *def) void MemberGroup::findSectionsInDocumentation() { - docFindSections(doc,0,0,this); + docFindSections(doc,0,0,this,m_docFile); memberList->findSectionsInDocumentation(); } diff --git a/src/membergroup.h b/src/membergroup.h index d5f543e..e468436 100644 --- a/src/membergroup.h +++ b/src/membergroup.h @@ -36,7 +36,8 @@ class Definition; class MemberGroup { public: - MemberGroup(Definition *parent,int id,const char *header,const char *docs); + MemberGroup(Definition *parent,int id,const char *header, + const char *docs,const char *docFile); ~MemberGroup(); QCString header() const { return grpHeader; } int groupId() const { return grpId; } @@ -81,6 +82,7 @@ class MemberGroup bool inSameSection; int m_numDecMembers; Definition *m_parent; + QCString m_docFile; }; class MemberGroupList : public QList<MemberGroup> @@ -101,6 +103,13 @@ class MemberGroupSDict : public SIntDict<MemberGroup> ~MemberGroupSDict() {} }; +struct MemberGroupInfo +{ + QCString header; + QCString doc; + QCString docFile; +}; + //class MemberGroupDict : public QIntDict<MemberGroup> //{ // public: diff --git a/src/message.cpp b/src/message.cpp index 1f04dea..95a63db 100644 --- a/src/message.cpp +++ b/src/message.cpp @@ -103,65 +103,59 @@ void msg(const char *fmt, ...) } } -void warn(const char *file,int line,const char *fmt, ...) +static void do_warn(const char *tag, const char *file, int line, const char *fmt, va_list args) { - if (Config_getBool("WARNINGS")) + if (!Config_getBool(tag)) return; // warning type disabled + char text[4096]; + vsprintf(text, fmt, args); + if (file==0) file="<unknown>"; + switch(warnFormatOrder) { - if (file==0) file="<unknown>"; - char text[4096]; - va_list args; - va_start(args, fmt); - vsprintf(text, fmt, args); - va_end(args); - switch(warnFormatOrder) - { - case 1: fprintf(warnFile,outputFormat,file,line,text); break; - case 2: fprintf(warnFile,outputFormat,text,line,file); break; - case 3: fprintf(warnFile,outputFormat,line,text,file); break; - case 4: fprintf(warnFile,outputFormat,file,text,line); break; - case 5: fprintf(warnFile,outputFormat,text,file,line); break; - case 6: fprintf(warnFile,outputFormat,line,file,text); break; - default: - printf("Error: warning format has not been initialized!\n"); - } + case 1: fprintf(warnFile,outputFormat,file,line,text); break; + case 2: fprintf(warnFile,outputFormat,text,line,file); break; + case 3: fprintf(warnFile,outputFormat,line,text,file); break; + case 4: fprintf(warnFile,outputFormat,file,text,line); break; + case 5: fprintf(warnFile,outputFormat,text,file,line); break; + case 6: fprintf(warnFile,outputFormat,line,file,text); break; + default: + printf("Error: warning format has not been initialized!\n"); } } +void warn(const char *file,int line,const char *fmt, ...) +{ + va_list args; + va_start(args, fmt); + do_warn("WARNINGS", file, line, fmt, args); + va_end(args); +} + void warn_cont(const char *fmt, ...) { - if (Config_getBool("WARNINGS")) - { - va_list args; - va_start(args, fmt); - vfprintf(warnFile, fmt, args); - va_end(args); - } + if (!Config_getBool("WARNINGS")) + return; + va_list args; + va_start(args, fmt); + vfprintf(warnFile, fmt, args); + va_end(args); } void warn_undoc(const char *file,int line,const char *fmt, ...) { - if (Config_getBool("WARN_IF_UNDOCUMENTED")) - { - if (file==0) file="<unknwon>"; - char text[4096]; - va_list args; - va_start(args, fmt); - vsprintf(text, fmt, args); - va_end(args); - switch(warnFormatOrder) - { - case 1: fprintf(warnFile,outputFormat,file,line,text); break; - case 2: fprintf(warnFile,outputFormat,text,line,file); break; - case 3: fprintf(warnFile,outputFormat,line,text,file); break; - case 4: fprintf(warnFile,outputFormat,file,text,line); break; - case 5: fprintf(warnFile,outputFormat,text,file,line); break; - case 6: fprintf(warnFile,outputFormat,line,file,text); break; - default: - printf("Error: warning format has not been initialized!\n"); - } - } + va_list args; + va_start(args, fmt); + do_warn("WARN_IF_UNDOCUMENTED", file, line, fmt, args); + va_end(args); } +void warn_doc_error(const char *file,int line,const char *fmt, ...) +{ + va_list args; + va_start(args, fmt); + do_warn("WARN_IF_DOC_ERROR", file, line, fmt, args); + va_end(args); +} + void err(const char *fmt, ...) { va_list args; diff --git a/src/message.h b/src/message.h index 0822f23..725270d 100644 --- a/src/message.h +++ b/src/message.h @@ -24,6 +24,7 @@ extern void msg(const char *fmt, ...); extern void warn(const char *file,int line,const char *fmt, ...); extern void warn_cont(const char *fmt, ...); extern void warn_undoc(const char *file,int line,const char *fmt, ...); +extern void warn_doc_error(const char *file,int line,const char *fmt, ...); extern void err(const char *fmt, ...); void initWarningFormat(); diff --git a/src/namespacedef.cpp b/src/namespacedef.cpp index cac8dc9..fb20986 100644 --- a/src/namespacedef.cpp +++ b/src/namespacedef.cpp @@ -65,7 +65,7 @@ void NamespaceDef::distributeMemberGroupDocumentation() void NamespaceDef::findSectionsInDocumentation() { - docFindSections(documentation(),0,this,0); + docFindSections(documentation(),0,this,0,docFile()); MemberGroupSDict::Iterator mgli(*memberGroupSDict); MemberGroup *mg; for (;(mg=mgli.current());++mgli) @@ -80,7 +80,7 @@ class PageInfo } void findSectionsInDocumentation() { - docFindSections(doc,this,0,0); + docFindSections(doc,this,0,0,defFileName); } void writeDocAnchorsToTagFile() diff --git a/src/perlmodgen.cpp b/src/perlmodgen.cpp index 66c57f9..5814163 100644 --- a/src/perlmodgen.cpp +++ b/src/perlmodgen.cpp @@ -542,6 +542,8 @@ void PerlModDocVisitor::visit(DocSymbol *sy) case DocSymbol::Ring: accent = "ring"; break; case DocSymbol::BSlash: s = "\\\\"; break; case DocSymbol::Copy: symbol = "copyright"; break; + case DocSymbol::Tm: symbol = "trademark"; break; + case DocSymbol::Reg: symbol = "registered"; break; case DocSymbol::Szlig: symbol = "szlig"; break; case DocSymbol::Apos: s = "\\\'"; break; case DocSymbol::Unknown: @@ -770,6 +772,7 @@ void PerlModDocVisitor::visitPre(DocSimpleSect *s) case DocSimpleSect::Remark: type = "remark"; break; case DocSimpleSect::Attention: type = "attention"; break; case DocSimpleSect::User: type = "par"; break; + case DocSimpleSect::Rcs: type = "rcs"; break; case DocSimpleSect::Unknown: err("Error: unknown simple section found\n"); break; diff --git a/src/printdocvisitor.h b/src/printdocvisitor.h index de53e8a..550abde 100644 --- a/src/printdocvisitor.h +++ b/src/printdocvisitor.h @@ -264,6 +264,7 @@ class PrintDocVisitor : public DocVisitor case DocSimpleSect::Remark: printf("remark"); break; case DocSimpleSect::Attention: printf("attention"); break; case DocSimpleSect::User: printf("user"); break; + case DocSimpleSect::Rcs: printf("rcs"); break; case DocSimpleSect::Unknown: printf("unknown"); break; } printf(">\n"); diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp index 1b975c8..93faa02 100644 --- a/src/rtfdocvisitor.cpp +++ b/src/rtfdocvisitor.cpp @@ -95,7 +95,9 @@ void RTFDocVisitor::visit(DocSymbol *s) case DocSymbol::Dollar: m_t << "$"; break; case DocSymbol::Hash: m_t << "#"; break; case DocSymbol::Percent: m_t << "%"; break; - case DocSymbol::Copy: m_t << "\251"; break; + case DocSymbol::Copy: m_t << "(C)"; break; + case DocSymbol::Tm: m_t << "(TM)"; break; + case DocSymbol::Reg: m_t << "(R)"; break; case DocSymbol::Apos: m_t << "'"; break; case DocSymbol::Quot: m_t << "\""; break; case DocSymbol::Uml: switch(s->letter()) @@ -295,7 +297,7 @@ void RTFDocVisitor::visit(DocVerbatim *s) m_t << "{" << endl; m_t << "\\par" << endl; m_t << rtf_Style_Reset << getStyle("CodeExample"); - m_t << s->text(); + filter(s->text()); m_t << "\\par" << endl; m_t << "}" << endl; break; @@ -349,7 +351,7 @@ void RTFDocVisitor::visit(DocInclude *inc) m_t << "{" << endl; m_t << "\\par" << endl; m_t << rtf_Style_Reset << getStyle("CodeExample"); - m_t << inc->text(); + filter(inc->text()); m_t << "\\par" << endl; m_t << "}" << endl; break; @@ -491,11 +493,12 @@ void RTFDocVisitor::visitPre(DocSimpleSect *s) case DocSimpleSect::Attention: m_t << theTranslator->trAttention(); break; case DocSimpleSect::User: break; + case DocSimpleSect::Rcs: break; case DocSimpleSect::Unknown: break; } // special case 1: user defined title - if (s->type()!=DocSimpleSect::User) + if (s->type()!=DocSimpleSect::User && s->type()!=DocSimpleSect::Rcs) { m_t << ":}"; // end bold m_t << "\\par" << endl; diff --git a/src/scanner.l b/src/scanner.l index a346085..9f6d9fb 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -77,6 +77,7 @@ static int lastClassTemplSpecContext; static int lastSkipHtmlCommentContext; static int lastIfContext; static int lastInternalDocContext; +static int lastPreLineCtrlContext; static int nextDefContext; static int overloadContext; static Protection protection; @@ -448,7 +449,8 @@ static void setContext() insideIDL = fileName.right(4)==".idl" || fileName.right(4)==".odl"; insideJava = fileName.right(5)==".java"; insideCS = fileName.right(3)==".cs"; - insidePHP = fileName.right(4)==".php" || fileName.right(4)==".inc"; + insidePHP = fileName.right(4)==".php" || fileName.right(5)==".php4" || + fileName.right(4)==".inc"; if ( insidePHP ) { useOverrideCommands = TRUE; @@ -1366,8 +1368,10 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) current->bodyLine = yyLineNr; BEGIN( Define ); } -<FindMembers>{B}*"#"{B}+[0-9]+{B}+/"\"" { /* line control directive */ +<FindMembers,ReadBody>{B}*"#"{B}+[0-9]+{B}+/"\"" { /* line control directive */ yyLineNr = atoi(&yytext[1]); + //printf("setting line number to %d\n",yyLineNr); + lastPreLineCtrlContext = YY_START; BEGIN( PreLineCtrl ); } <PreLineCtrl>"\""[^\n\"]*"\"" { @@ -1375,7 +1379,8 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) } <PreLineCtrl>. {} <PreLineCtrl>\n { - BEGIN(FindMembers); + yyLineNr++; + BEGIN( lastPreLineCtrlContext ); } <SkipCPP>. <SkipCPP>\\[\r]*"\n"[\r]* { yyLineNr++ ; } @@ -1560,7 +1565,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) BEGIN( Doc ); } } -<FindMembers,FindFields,ReadInitializer>"//"([!/]?){B}*{CMD}"}"|"/*"([!*]?){B}*{CMD}"}"{B}*"*/" { +<FindMembers,FindFields,ReadInitializer>"//"([!/]?){B}*{CMD}"}".*|"/*"([!*]?){B}*{CMD}"}".*"*/" { if (memberGroupId==NOGROUP && autoGroupStack.isEmpty()) { warn(yyFileName,yyLineNr, @@ -1851,7 +1856,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) /* <FindFieldArg>"," { unput(*yytext); BEGIN(FindFields); } */ -<ReadBody>[^\r\n{}"'/]* { current->program += yytext ; } +<ReadBody>[^\r\n\#{}"'/]* { current->program += yytext ; } <ReadBody>"//".* { current->program += yytext ; } <ReadBody>\" { current->program += yytext ; pCopyQuotedString = ¤t->program; @@ -3659,9 +3664,15 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) memberGroupDocs+="\n\n"; } memberGroupDocs+=current->doc; - Doxygen::memberDocDict.insert(memberGroupId, - new QCString(memberGroupDocs) - ); + //Doxygen::memberDocDict.insert(memberGroupId, + // new QCString(memberGroupDocs) + // ); + MemberGroupInfo *info=Doxygen::memGrpInfoDict.find(memberGroupId); + if (info) + { + info->doc = memberGroupDocs; + info->docFile = yyFileName; + } current->doc.resize(0); current->brief.resize(0); BEGIN(lastDocContext); @@ -4583,9 +4594,13 @@ static void startGroup() memberGroupHeader="[NOHEADER]"; } memberGroupId = newMemberGroupId(); - Doxygen::memberHeaderDict.insert(memberGroupId, - new QCString(memberGroupHeader.stripWhiteSpace()) - ); + MemberGroupInfo *info = new MemberGroupInfo; + info->header = memberGroupHeader.stripWhiteSpace(); + Doxygen::memGrpInfoDict.insert(memberGroupId,info); + //Doxygen::memberHeaderDict.insert(memberGroupId, + // new QCString(memberGroupHeader.stripWhiteSpace()) + // ); + memberGroupRelates = current->relates.copy(); memberGroupInside = current->inside.copy(); current->mGrpId = memberGroupId; @@ -4609,9 +4624,12 @@ static void startGroupInDoc() // endGroup(); //} memberGroupId = newMemberGroupId(); - Doxygen::memberHeaderDict.insert(memberGroupId, - new QCString(memberGroupHeader.stripWhiteSpace()) - ); + MemberGroupInfo *info = new MemberGroupInfo; + info->header = memberGroupHeader.stripWhiteSpace(); + Doxygen::memGrpInfoDict.insert(memberGroupId,info); + //Doxygen::memberHeaderDict.insert(memberGroupId, + // new QCString(memberGroupHeader.stripWhiteSpace()) + // ); memberGroupRelates = current->relates.copy(); memberGroupInside = current->inside.copy(); current->mGrpId = memberGroupId; @@ -4627,9 +4645,15 @@ static void endGroup() { if (memberGroupId!=NOGROUP) // end of member group { - Doxygen::memberDocDict.insert(memberGroupId, - new QCString(memberGroupDocs) - ); + //Doxygen::memberDocDict.insert(memberGroupId, + // new QCString(memberGroupDocs) + // ); + MemberGroupInfo *info=Doxygen::memGrpInfoDict.find(memberGroupId); + if (info) + { + info->doc = memberGroupDocs; + info->docFile = yyFileName; + } memberGroupId=NOGROUP; memberGroupRelates.resize(0); memberGroupInside.resize(0); diff --git a/src/translator_it.h b/src/translator_it.h index 98604f2..836bdd5 100644 --- a/src/translator_it.h +++ b/src/translator_it.h @@ -19,6 +19,7 @@ * * Revision history * + * 2002/11: translated new items used since version 1.2.18 * 2002/08: translated new items used since version 1.2.17 * 2002/07: translated new items used since version 1.2.16 * 2002/06: modified trRelatedPagesDescription() method @@ -57,7 +58,7 @@ * * Il plurale dei termini inglesi non tradotti è stato reso con il singolare * della parola inglese secondo una convenzione spesso ritrovata nella documentazione - * tecnica (ad es "lista dei file" e non "lista dei files") + * tecnica (ad es. "lista dei file" e non "lista dei files") * * Se avete suggerimenti sulla traduzione di alcuni termini o volete segnalare * eventuali sviste potete scrivermi all'indirizzo: alessandro@falappa.net @@ -66,7 +67,7 @@ #ifndef TRANSLATOR_IT_H #define TRANSLATOR_IT_H -class TranslatorItalian : public TranslatorAdapter_1_2_18 +class TranslatorItalian : public Translator { public: @@ -1370,6 +1371,24 @@ class TranslatorItalian : public TranslatorAdapter_1_2_18 { return "Lista degli elementi deprecati"; } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.18 +////////////////////////////////////////////////////////////////////////// + + /*! Used as a header for declaration section of the events found in + * a C# program + */ + virtual QCString trEvents() + { + return "Eventi"; + } + /*! Header used for the documentation section of a class' events. */ + virtual QCString trEventDocumentation() + { + return "Documentazione degli eventi"; + } + }; #endif diff --git a/src/util.cpp b/src/util.cpp index 8e7c45e..0ced904 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -3132,7 +3132,8 @@ const char *getOverloadDocs() } void addMembersToMemberGroup(MemberList *ml, - MemberGroupSDict *memberGroupSDict,Definition *context) + MemberGroupSDict *memberGroupSDict, + Definition *context) { //printf("addMemberToMemberGroup()\n"); MemberListIterator mli(*ml); @@ -3151,14 +3152,21 @@ void addMembersToMemberGroup(MemberList *ml, int groupId=fmd->getMemberGroupId(); if (groupId!=-1) { - QCString *pGrpHeader = Doxygen::memberHeaderDict[groupId]; - QCString *pDocs = Doxygen::memberDocDict[groupId]; - if (pGrpHeader) + MemberGroupInfo *info = Doxygen::memGrpInfoDict[groupId]; + //QCString *pGrpHeader = Doxygen::memberHeaderDict[groupId]; + //QCString *pDocs = Doxygen::memberDocDict[groupId]; + if (info) { MemberGroup *mg = memberGroupSDict->find(groupId); if (mg==0) { - mg = new MemberGroup(context,groupId,*pGrpHeader,pDocs ? pDocs->data() : 0); + mg = new MemberGroup( + context, + groupId, + info->header, + info->doc, + info->docFile + ); memberGroupSDict->append(groupId,mg); } mg->insertMember(context,fmd); // insert in member group @@ -3172,14 +3180,21 @@ void addMembersToMemberGroup(MemberList *ml, int groupId=md->getMemberGroupId(); if (groupId!=-1) { - QCString *pGrpHeader = Doxygen::memberHeaderDict[groupId]; - QCString *pDocs = Doxygen::memberDocDict[groupId]; - if (pGrpHeader) + MemberGroupInfo *info = Doxygen::memGrpInfoDict[groupId]; + //QCString *pGrpHeader = Doxygen::memberHeaderDict[groupId]; + //QCString *pDocs = Doxygen::memberDocDict[groupId]; + if (info) { MemberGroup *mg = memberGroupSDict->find(groupId); if (mg==0) { - mg = new MemberGroup(context,groupId,*pGrpHeader,pDocs ? pDocs->data() : 0); + mg = new MemberGroup( + context, + groupId, + info->header, + info->doc, + info->docFile + ); memberGroupSDict->append(groupId,mg); } md = ml->take(index); // remove from member list diff --git a/src/xmldocvisitor.cpp b/src/xmldocvisitor.cpp index 6c94ca7..531fa92 100644 --- a/src/xmldocvisitor.cpp +++ b/src/xmldocvisitor.cpp @@ -76,6 +76,8 @@ void XmlDocVisitor::visit(DocSymbol *s) case DocSymbol::Hash: m_t << "#"; break; case DocSymbol::Percent: m_t << "%"; break; case DocSymbol::Copy: m_t << "<copy/>"; break; + case DocSymbol::Tm: m_t << "<trademark/>"; break; + case DocSymbol::Reg: m_t << "<registered/>"; break; case DocSymbol::Apos: m_t << "'"; break; case DocSymbol::Quot: m_t << "\""; break; case DocSymbol::Uml: m_t << "<umlaut char=\"" << s->letter() << "\"/>"; break; @@ -334,7 +336,7 @@ void XmlDocVisitor::visitPre(DocSimpleSect *s) case DocSimpleSect::Date: m_t << "date"; break; case DocSimpleSect::Note: - m_t << "bug"; break; + m_t << "note"; break; case DocSimpleSect::Warning: m_t << "warning"; break; case DocSimpleSect::Pre: @@ -349,6 +351,8 @@ void XmlDocVisitor::visitPre(DocSimpleSect *s) m_t << "attention"; break; case DocSimpleSect::User: m_t << "par"; break; + case DocSimpleSect::Rcs: + m_t << "rcs"; break; case DocSimpleSect::Unknown: break; } m_t << "\">"; diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index 070ccc2..bb73ca5 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -479,6 +479,8 @@ static void generateXMLForMember(MemberDef *md,QTextStream &ti,QTextStream &t,De case Protected: t << "protected"; break; case Private: t << "private"; break; } + t << "\" static=\""; + if (md->isStatic()) t << "yes"; else t << "no"; t << "\""; if (isFunc) |