Commit 9fd2c403 authored by Dimitri van Heesch's avatar Dimitri van Heesch

Release-1.3-rc1-20021207

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