summaryrefslogtreecommitdiffstats
path: root/src/docparser.cpp
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2002-12-07 21:08:27 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2002-12-07 21:08:27 (GMT)
commit6f118034b4528e83e5668bb4bfbcc2947bd180c7 (patch)
tree17668f7d76b3d88c791ebb8eec8dc386256af3e6 /src/docparser.cpp
parentf3e7209fed9703e8be668753d1083ba335121a6e (diff)
downloadDoxygen-6f118034b4528e83e5668bb4bfbcc2947bd180c7.zip
Doxygen-6f118034b4528e83e5668bb4bfbcc2947bd180c7.tar.gz
Doxygen-6f118034b4528e83e5668bb4bfbcc2947bd180c7.tar.bz2
Release-1.3-rc1-20021207
Diffstat (limited to 'src/docparser.cpp')
-rw-r--r--src/docparser.cpp407
1 files changed, 222 insertions, 185 deletions
diff --git a/src/docparser.cpp b/src/docparser.cpp
index f5c17d0..ded0692 100644
--- a/src/docparser.cpp
+++ b/src/docparser.cpp
@@ -172,13 +172,13 @@ static QCString findAndCopyImage(const char *fileName,DocImage::Type type)
}
else
{
- warn(g_fileName,doctokenizerYYlineno,
+ warn_doc_error(g_fileName,doctokenizerYYlineno,
"Warning: could not write output image %s",outputFile.data());
}
}
else
{
- warn(g_fileName,doctokenizerYYlineno,
+ warn_doc_error(g_fileName,doctokenizerYYlineno,
"Warning: could not open image %s",fileName);
}
@@ -205,14 +205,14 @@ static QCString findAndCopyImage(const char *fileName,DocImage::Type type)
text.sprintf("Warning: image file name %s is ambigious.\n",fileName);
text+="Possible candidates:\n";
text+=showFileDefMatches(Doxygen::imageNameDict,fileName);
- warn(g_fileName,doctokenizerYYlineno,text);
+ warn_doc_error(g_fileName,doctokenizerYYlineno,text);
}
else
{
result=fileName;
if (result.left(5)!="http:" && result.left(6)!="https:")
{
- warn(g_fileName,doctokenizerYYlineno,
+ warn_doc_error(g_fileName,doctokenizerYYlineno,
"Warning: image file %s is not found in IMAGE_PATH: "
"assuming external image.",fileName
);
@@ -228,7 +228,7 @@ static void checkArgumentName(const QString &name,bool isParam)
g_memberDef->argumentList() :
g_memberDef->declArgumentList();
if (al==0) return; // no argument list
- if (!Config_getBool("WARN_IF_UNDOCUMENTED")) return;
+ if (!Config_getBool("WARN_IF_DOC_ERROR")) return;
static QRegExp re("[a-zA-Z0-9_]+\\.*");
int p=0,i=0,l;
@@ -256,12 +256,11 @@ static void checkArgumentName(const QString &name,bool isParam)
//printf("member type=%d\n",memberDef->memberType());
QString scope=g_memberDef->getScopeString();
if (!scope.isEmpty()) scope+="::"; else scope="";
- warn(g_memberDef->docFile(),g_memberDef->docLine(),
+ warn_doc_error(g_memberDef->docFile(),g_memberDef->docLine(),
"Warning: argument `%s' of command @param "
"is not found in the argument list of %s%s%s",
aName.data(),scope.data(),g_memberDef->name().data(),
- argListToString(al).data()
- );
+ argListToString(al).data());
}
p=i+l;
}
@@ -269,7 +268,7 @@ static void checkArgumentName(const QString &name,bool isParam)
static void checkUndocumentedParams()
{
- if (g_memberDef && g_hasParamCommand && Config_getBool("WARN_IF_UNDOCUMENTED"))
+ if (g_memberDef && g_hasParamCommand && Config_getBool("WARN_IF_DOC_ERROR"))
{
ArgumentList *al=g_memberDef->isDocsForDefinition() ?
g_memberDef->argumentList() :
@@ -293,19 +292,20 @@ static void checkUndocumentedParams()
{
QString scope=g_memberDef->getScopeString();
if (!scope.isEmpty()) scope+="::"; else scope="";
- warn(g_memberDef->docFile(),g_memberDef->docLine(),
- "Warning: The following parameters of "
- "%s%s%s are not documented:",
- scope.data(),g_memberDef->name().data(),
- argListToString(al).data());
+ QString errMsg=(QString)
+ "Warning: The following parameters of "+
+ scope + QString(g_memberDef->name()) +
+ QString(argListToString(al)) +
+ " are not documented:";
for (ali.toFirst();(a=ali.current());++ali)
{
QString argName = g_memberDef->isDefine() ? a->type : a->name;
if (!argName.isEmpty() && g_paramsFound.find(argName)==0)
{
- warn_cont( " parameter %s\n",argName.data());
+ errMsg+=" parameter "+argName+"\n";
}
}
+ warn_doc_error(g_memberDef->docFile(),g_memberDef->docLine(),errMsg);
}
}
}
@@ -522,7 +522,7 @@ static int handleStyleArgument(DocNode *parent,QList<DocNode> &children,
int tok=doctokenizerYYlex();
if (tok!=TK_WHITESPACE)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command",
cmdName.data());
return tok;
}
@@ -535,15 +535,15 @@ static int handleStyleArgument(DocNode *parent,QList<DocNode> &children,
switch (tok)
{
case TK_COMMAND:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Illegal command \\%s as the argument of a \\%s command",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Illegal command \\%s as the argument of a \\%s command",
tokenName.data(),cmdName.data());
break;
case TK_SYMBOL:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found",
tokenName.data());
break;
default:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s",
tokToString(tok));
break;
}
@@ -570,7 +570,7 @@ static void handleStyleLeave(DocNode *parent,QList<DocNode> &children,
g_styleStack.top()->position()!=g_nodeStack.count() // wrong position
)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: found </%s> tag without matching <%s> in the same paragraph",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: found </%s> tag without matching <%s> in the same paragraph",
tagName,tagName);
}
else // end the section
@@ -600,7 +600,7 @@ static void handlePendingStyleCommands(DocNode *parent,QList<DocNode> &children)
case DocStyleChange::Superscript: cmd = "superscript"; break;
case DocStyleChange::Preformatted: cmd = "pre"; break;
}
- warn(g_fileName,doctokenizerYYlineno,"Warning: end of paragraph without end of style "
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: end of paragraph without end of style "
"command </%s>",cmd);
children.append(new DocStyleChange(parent,g_nodeStack.count(),sc->style(),FALSE));
g_styleStack.pop();
@@ -728,7 +728,7 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList<DocNode> &children
doctokenizerYYsetStateHtmlOnly();
int retval = doctokenizerYYlex();
children.append(new DocVerbatim(parent,g_context,g_token->verb,DocVerbatim::HtmlOnly,g_isExample,g_fileName));
- if (retval==0) warn(g_fileName,doctokenizerYYlineno,"Warning: htmlonly section ended without end marker");
+ if (retval==0) warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: htmlonly section ended without end marker");
doctokenizerYYsetStatePara();
}
break;
@@ -737,7 +737,7 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList<DocNode> &children
doctokenizerYYsetStateLatexOnly();
int retval = doctokenizerYYlex();
children.append(new DocVerbatim(parent,g_context,g_token->verb,DocVerbatim::LatexOnly,g_isExample,g_fileName));
- if (retval==0) warn(g_fileName,doctokenizerYYlineno,"Warning: latexonly section ended without end marker",doctokenizerYYlineno);
+ if (retval==0) warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: latexonly section ended without end marker",doctokenizerYYlineno);
doctokenizerYYsetStatePara();
}
break;
@@ -752,20 +752,20 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList<DocNode> &children
int tok=doctokenizerYYlex();
if (tok!=TK_WHITESPACE)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command",
tokenName.data());
break;
}
tok=doctokenizerYYlex();
if (tok==0)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment block while parsing the "
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment block while parsing the "
"argument of command %s",tokenName.data());
break;
}
else if (tok!=TK_WORD && tok!=TK_LNKWORD)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s",
tokToString(tok),tokenName.data());
break;
}
@@ -778,7 +778,7 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList<DocNode> &children
int tok=doctokenizerYYlex();
if (tok!=TK_WHITESPACE)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command",
tokenName.data());
break;
}
@@ -787,7 +787,7 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList<DocNode> &children
DocInternalRef *ref=0;
if (tok!=TK_WORD && tok!=TK_LNKWORD)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s",
tokToString(tok),tokenName.data());
doctokenizerYYsetStatePara();
break;
@@ -951,6 +951,8 @@ DocSymbol::SymType DocSymbol::decodeSymbol(const QString &symName,char *letter)
int l=symName.length();
DBG(("decodeSymbol(%s) l=%d\n",symName.data(),l));
if (symName=="&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=="&gt;") return DocSymbol::Greater;
else if (symName=="&amp;") return DocSymbol::Amp;
@@ -1040,14 +1042,14 @@ static void readTextFileByName(const QString &file,QString &text)
}
else if (ambig)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: included file name %s is ambigious"
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: included file name %s is ambigious"
"Possible candidates:\n%s",file.data(),
showFileDefMatches(Doxygen::exampleNameDict,file).data()
);
}
else
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: included file %s is not found"
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: included file %s is not found"
"Check you EXAMPLE_PATH",file.data());
}
}
@@ -1059,7 +1061,7 @@ DocAnchor::DocAnchor(DocNode *parent,const QString &id,bool newAnchor)
{
if (id.isEmpty())
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: Empty anchor label");
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Empty anchor label");
}
if (newAnchor) // found <a name="label">
{
@@ -1075,7 +1077,7 @@ DocAnchor::DocAnchor(DocNode *parent,const QString &id,bool newAnchor)
}
else
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: Invalid anchor id `%s'",id.data());
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Invalid anchor id `%s'",id.data());
}
}
}
@@ -1242,13 +1244,13 @@ void DocCopy::parse()
}
else // oops, recursion
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: recursive call chain of \\copydoc commands detected at %d\n",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: recursive call chain of \\copydoc commands detected at %d\n",
doctokenizerYYlineno);
}
}
else
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: target %s of \\copydoc command not found",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: target %s of \\copydoc command not found",
m_link.data());
}
}
@@ -1343,15 +1345,15 @@ void DocSecRefItem::parse()
switch (tok)
{
case TK_COMMAND:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a \\refitem",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a \\refitem",
g_token->name.data());
break;
case TK_SYMBOL:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found",
g_token->name.data());
break;
default:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s",
tokToString(tok));
break;
}
@@ -1371,13 +1373,13 @@ void DocSecRefItem::parse()
}
else
{
- warn(g_fileName,doctokenizerYYlineno,"Warning reference to unknown section %s",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning reference to unknown section %s",
m_target.data());
}
}
else
{
- warn(g_fileName,doctokenizerYYlineno,"Warning reference to empty target");
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning reference to empty target");
}
DBG(("DocSecRefItem::parse() end\n"));
@@ -1407,13 +1409,13 @@ void DocSecRefList::parse()
int tok=doctokenizerYYlex();
if (tok!=TK_WHITESPACE)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after \\refitem command");
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after \\refitem command");
break;
}
tok=doctokenizerYYlex();
if (tok!=TK_WORD && tok!=TK_LNKWORD)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of \\refitem",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of \\refitem",
tokToString(tok));
break;
}
@@ -1426,7 +1428,7 @@ void DocSecRefList::parse()
case CMD_ENDSECREFLIST:
goto endsecreflist;
default:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a \\secreflist",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a \\secreflist",
g_token->name.data());
goto endsecreflist;
}
@@ -1437,7 +1439,7 @@ void DocSecRefList::parse()
}
else
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s inside section reference list",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s inside section reference list",
tokToString(tok));
goto endsecreflist;
}
@@ -1480,15 +1482,15 @@ void DocInternalRef::parse()
switch (tok)
{
case TK_COMMAND:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a \\ref",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a \\ref",
g_token->name.data());
break;
case TK_SYMBOL:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found",
g_token->name.data());
break;
default:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s",
tokToString(tok));
break;
}
@@ -1551,7 +1553,7 @@ DocRef::DocRef(DocNode *parent,const QString &target) :
}
else // oops, bogus target
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: unable to resolve reference to `%s' for \\ref command",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unable to resolve reference to `%s' for \\ref command",
target.data());
}
}
@@ -1569,15 +1571,15 @@ void DocRef::parse()
switch (tok)
{
case TK_COMMAND:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a \\ref",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a \\ref",
g_token->name.data());
break;
case TK_SYMBOL:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found",
g_token->name.data());
break;
default:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s",
tokToString(tok));
break;
}
@@ -1620,7 +1622,7 @@ DocLink::DocLink(DocNode *parent,const QString &target) :
}
else // oops, bogus target
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: unable to resolve link to `%s' for \\link command",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unable to resolve link to `%s' for \\link command",
target.data());
}
}
@@ -1645,17 +1647,17 @@ QString DocLink::parse(bool isJavaLink)
case CMD_ENDLINK:
if (isJavaLink)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: {@link.. ended with @endlink command");
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: {@link.. ended with @endlink command");
}
goto endlink;
default:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a \\link",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a \\link",
g_token->name.data());
break;
}
break;
case TK_SYMBOL:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found",
g_token->name.data());
break;
case TK_LNKWORD:
@@ -1682,7 +1684,7 @@ QString DocLink::parse(bool isJavaLink)
m_children.append(new DocWord(this,g_token->name));
break;
default:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s",
tokToString(tok));
break;
}
@@ -1690,7 +1692,7 @@ QString DocLink::parse(bool isJavaLink)
}
if (tok==0)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected end of comment while inside"
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected end of comment while inside"
" link command\n");
}
endlink:
@@ -1727,15 +1729,15 @@ void DocDotFile::parse()
switch (tok)
{
case TK_COMMAND:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a \\dotfile",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a \\dotfile",
g_token->name.data());
break;
case TK_SYMBOL:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found",
g_token->name.data());
break;
default:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s",
tokToString(tok));
break;
}
@@ -1754,7 +1756,7 @@ void DocDotFile::parse()
}
else
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unknown option %s after image title",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unknown option %s after image title",
g_token->name.data());
}
tok=doctokenizerYYlex();
@@ -1771,14 +1773,14 @@ void DocDotFile::parse()
}
else if (ambig)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: included dot file name %s is ambigious.\n"
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: included dot file name %s is ambigious.\n"
"Possible candidates:\n%s",m_name.data(),
showFileDefMatches(Doxygen::exampleNameDict,m_name).data()
);
}
else
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: included dot file %s is not found "
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: included dot file %s is not found "
"in any of the paths specified via DOTFILE_DIRS!",m_name.data());
}
@@ -1804,15 +1806,15 @@ void DocImage::parse()
switch (tok)
{
case TK_COMMAND:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a \\image",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a \\image",
g_token->name.data());
break;
case TK_SYMBOL:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found",
g_token->name.data());
break;
default:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s",
tokToString(tok));
break;
}
@@ -1831,7 +1833,7 @@ void DocImage::parse()
}
else
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unknown option %s after image title",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unknown option %s after image title",
g_token->name.data());
}
tok=doctokenizerYYlex();
@@ -1862,7 +1864,7 @@ int DocHtmlHeader::parse()
switch (tok)
{
case TK_COMMAND:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a <h%d> tag",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a <h%d> tag",
g_token->name.data(),m_level);
break;
case TK_HTMLTAG:
@@ -1872,7 +1874,7 @@ int DocHtmlHeader::parse()
{
if (m_level!=1)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: <h%d> ended with </h1>",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: <h%d> ended with </h1>",
m_level);
}
goto endheader;
@@ -1881,7 +1883,7 @@ int DocHtmlHeader::parse()
{
if (m_level!=2)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: <h%d> ended with </h2>",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: <h%d> ended with </h2>",
m_level);
}
goto endheader;
@@ -1890,7 +1892,7 @@ int DocHtmlHeader::parse()
{
if (m_level!=3)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: <h%d> ended with </h3>",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: <h%d> ended with </h3>",
m_level);
}
goto endheader;
@@ -1899,7 +1901,7 @@ int DocHtmlHeader::parse()
{
if (m_level!=4)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: <h%d> ended with </h4>",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: <h%d> ended with </h4>",
m_level);
}
goto endheader;
@@ -1908,7 +1910,7 @@ int DocHtmlHeader::parse()
{
if (m_level!=5)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: <h%d> ended with </h5>",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: <h%d> ended with </h5>",
m_level);
}
goto endheader;
@@ -1917,24 +1919,24 @@ int DocHtmlHeader::parse()
{
if (m_level!=6)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: <h%d> ended with </h6>",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: <h%d> ended with </h6>",
m_level);
}
goto endheader;
}
else
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected html tag <%s%s> found within <h%d> context",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected html tag <%s%s> found within <h%d> context",
g_token->endTag?"/":"",g_token->name.data(),m_level);
}
}
break;
case TK_SYMBOL:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found",
g_token->name.data());
break;
default:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s",
tokToString(tok));
break;
}
@@ -1942,7 +1944,7 @@ int DocHtmlHeader::parse()
}
if (tok==0)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected end of comment while inside"
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected end of comment while inside"
" <h%d> tag\n",m_level);
}
endheader:
@@ -1969,11 +1971,11 @@ int DocHRef::parse()
switch (tok)
{
case TK_COMMAND:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a <a>..</a> block",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a <a>..</a> block",
g_token->name.data());
break;
case TK_SYMBOL:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found",
g_token->name.data());
break;
case TK_HTMLTAG:
@@ -1985,13 +1987,13 @@ int DocHRef::parse()
}
else
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected html tag <%s%s> found within <a href=...> context",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected html tag <%s%s> found within <a href=...> context",
g_token->endTag?"/":"",g_token->name.data(),doctokenizerYYlineno);
}
}
break;
default:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s",
tokToString(tok),doctokenizerYYlineno);
break;
}
@@ -1999,7 +2001,7 @@ int DocHRef::parse()
}
if (tok==0)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected end of comment while inside"
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected end of comment while inside"
" <a href=...> tag",doctokenizerYYlineno);
}
endhref:
@@ -2037,7 +2039,7 @@ int DocInternal::parse()
}
if (retval==TK_LISTITEM)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: Invalid list item found",doctokenizerYYlineno);
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Invalid list item found",doctokenizerYYlineno);
}
} while (retval!=0 && retval!=RetVal_Section);
if (lastPar) lastPar->markLast();
@@ -2049,7 +2051,7 @@ int DocInternal::parse()
//int secLev = sec->type==SectionInfo::Subsection ? 2 : 1;
//if (secLev!=1) // wrong level
//{
- // warn(g_fileName,doctokenizerYYlineno,"Warning: Expected level 1 section, found a section with level %d.",secLev);
+ // warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Expected level 1 section, found a section with level %d.",secLev);
// break;
//}
//else
@@ -2062,7 +2064,7 @@ int DocInternal::parse()
if (retval==RetVal_Internal)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: \\internal command found inside internal section");
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: \\internal command found inside internal section");
}
DBG(("DocInternal::parse() end\n"));
@@ -2081,7 +2083,7 @@ int DocIndexEntry::parse()
int tok=doctokenizerYYlex();
if (tok!=TK_WHITESPACE)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after \\addindex command");
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after \\addindex command");
goto endindexentry;
}
m_entry="";
@@ -2110,7 +2112,7 @@ int DocIndexEntry::parse()
case DocSymbol::Apos: m_entry+='\''; break;
case DocSymbol::Quot: m_entry+='"'; break;
default:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected symbol found as argument of \\addindex");
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected symbol found as argument of \\addindex");
break;
}
}
@@ -2127,13 +2129,13 @@ int DocIndexEntry::parse()
case CMD_HASH: m_entry+='#'; break;
case CMD_PERCENT: m_entry+='%'; break;
default:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected command %s found as argument of \\addindex",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected command %s found as argument of \\addindex",
g_token->name.data());
break;
}
break;
default:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s",
tokToString(tok));
break;
}
@@ -2161,11 +2163,11 @@ int DocHtmlCaption::parse()
switch (tok)
{
case TK_COMMAND:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a <caption> tag",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a <caption> tag",
g_token->name.data());
break;
case TK_SYMBOL:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found",
g_token->name.data());
break;
case TK_HTMLTAG:
@@ -2178,13 +2180,13 @@ int DocHtmlCaption::parse()
}
else
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected html tag <%s%s> found within <caption> context",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected html tag <%s%s> found within <caption> context",
g_token->endTag?"/":"",g_token->name.data());
}
}
break;
default:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s",
tokToString(tok));
break;
}
@@ -2192,7 +2194,7 @@ int DocHtmlCaption::parse()
}
if (tok==0)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected end of comment while inside"
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected end of comment while inside"
" <caption> tag",doctokenizerYYlineno);
}
endcaption:
@@ -2259,20 +2261,20 @@ int DocHtmlRow::parse()
}
else // found some other tag
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: expected <td> or <th> tag but "
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected <td> or <th> tag but "
"found <%s> instead!",g_token->name.data());
goto endrow;
}
}
else if (tok==0) // premature end of comment
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment while looking"
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment while looking"
" for a html description title");
goto endrow;
}
else // token other than html token
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: expected <td> or <th> tag but found %s token instead!",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected <td> or <th> tag but found %s token instead!",
tokToString(tok));
goto endrow;
}
@@ -2323,7 +2325,7 @@ getrow:
{
if (m_caption)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: table already has a caption, found another one");
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: table already has a caption, found another one");
}
else
{
@@ -2338,18 +2340,18 @@ getrow:
}
else // found wrong token
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: expected <tr> or <caption> tag but "
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected <tr> or <caption> tag but "
"found <%s%s> instead!", g_token->endTag ? "/" : "", g_token->name.data());
}
}
else if (tok==0) // premature end of comment
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment while looking"
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment while looking"
" for a <tr> or <caption> tag");
}
else // token other than html token
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: expected <tr> tag but found %s token instead!",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected <tr> tag but found %s token instead!",
tokToString(tok));
}
@@ -2383,11 +2385,11 @@ int DocHtmlDescTitle::parse()
switch (tok)
{
case TK_COMMAND:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a <dt> tag",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a <dt> tag",
g_token->name.data());
break;
case TK_SYMBOL:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found",
g_token->name.data());
break;
case TK_HTMLTAG:
@@ -2404,13 +2406,13 @@ int DocHtmlDescTitle::parse()
}
else
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected html tag <%s%s> found within <dt> context",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected html tag <%s%s> found within <dt> context",
g_token->endTag?"/":"",g_token->name.data());
}
}
break;
default:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s",
tokToString(tok));
break;
}
@@ -2418,7 +2420,7 @@ int DocHtmlDescTitle::parse()
}
if (tok==0)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected end of comment while inside"
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected end of comment while inside"
" <dt> tag");
}
endtitle:
@@ -2478,20 +2480,20 @@ int DocHtmlDescList::parse()
}
else // found some other tag
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: expected <dt> tag but "
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected <dt> tag but "
"found <%s> instead!",g_token->name.data());
goto enddesclist;
}
}
else if (tok==0) // premature end of comment
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment while looking"
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment while looking"
" for a html description title");
goto enddesclist;
}
else // token other than html token
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: expected <dt> tag but found %s token instead!",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected <dt> tag but found %s token instead!",
tokToString(tok));
goto enddesclist;
}
@@ -2516,7 +2518,7 @@ int DocHtmlDescList::parse()
if (retval==0)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment while inside <dl> block");
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment while inside <dl> block");
}
enddesclist:
@@ -2603,20 +2605,20 @@ int DocHtmlList::parse()
}
else // found some other tag
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: expected <li> tag but "
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected <li> tag but "
"found <%s> instead!",g_token->name.data());
goto endlist;
}
}
else if (tok==0) // premature end of comment
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment while looking"
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment while looking"
" for a html list item");
goto endlist;
}
else // token other than html token
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: expected <li> tag but found %s token instead!",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected <li> tag but found %s token instead!",
tokToString(tok));
goto endlist;
}
@@ -2630,7 +2632,7 @@ int DocHtmlList::parse()
if (retval==0)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment while inside <%cl> block",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment while inside <%cl> block",
m_type==Unordered ? 'u' : 'o');
}
@@ -2724,15 +2726,15 @@ void DocTitle::parse()
switch (tok)
{
case TK_COMMAND:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a title section",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Illegal command %s as part of a title section",
g_token->name.data());
break;
case TK_SYMBOL:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found",
g_token->name.data());
break;
default:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s",
tokToString(tok));
break;
}
@@ -2745,6 +2747,11 @@ void DocTitle::parse()
ASSERT(n==this);
}
+void DocTitle::parseFromString(const QString &text)
+{
+ m_children.append(new DocWord(this,text));
+}
+
//--------------------------------------------------------------------------
DocSimpleSect::DocSimpleSect(DocNode *parent,Type t) :
@@ -2803,6 +2810,24 @@ int DocSimpleSect::parse(bool userTitle)
return retval; // 0==EOF, TK_NEWPARA, TK_LISTITEM, TK_ENDLIST, RetVal_SimpleSec
}
+int DocSimpleSect::parseRcs()
+{
+ DBG(("DocSimpleSect::parseRcs() start\n"));
+ g_nodeStack.push(this);
+
+ m_title = new DocTitle(this);
+ m_title->parseFromString(g_token->name);
+
+ docParserPushContext();
+ internalValidatingParseDoc(this,m_children,g_token->text);
+ docParserPopContext();
+
+ DBG(("DocSimpleSect::parseRcs() end retval=%d\n",retval));
+ DocNode *n=g_nodeStack.pop();
+ ASSERT(n==this);
+ return RetVal_OK;
+}
+
//--------------------------------------------------------------------------
int DocParamList::parse(const QString &cmdName)
@@ -2814,7 +2839,7 @@ int DocParamList::parse(const QString &cmdName)
int tok=doctokenizerYYlex();
if (tok!=TK_WHITESPACE)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command",
cmdName.data());
}
doctokenizerYYsetStateParam();
@@ -2837,7 +2862,7 @@ int DocParamList::parse(const QString &cmdName)
doctokenizerYYsetStatePara();
if (tok==0) /* premature end of comment block */
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment block while parsing the "
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment block while parsing the "
"argument of command %s",cmdName.data());
return 0;
}
@@ -2945,7 +2970,7 @@ void DocPara::handleIncludeOperator(const QString &cmdName,DocIncOperator::Type
int tok=doctokenizerYYlex();
if (tok!=TK_WHITESPACE)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command",
cmdName.data());
return;
}
@@ -2954,13 +2979,13 @@ void DocPara::handleIncludeOperator(const QString &cmdName,DocIncOperator::Type
doctokenizerYYsetStatePara();
if (tok==0)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment block while parsing the "
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment block while parsing the "
"argument of command %s", cmdName.data());
return;
}
else if (tok!=TK_WORD)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s",
tokToString(tok),cmdName.data());
return;
}
@@ -2995,21 +3020,21 @@ void DocPara::handleImage(const QString &cmdName)
int tok=doctokenizerYYlex();
if (tok!=TK_WHITESPACE)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command",
cmdName.data());
return;
}
tok=doctokenizerYYlex();
if (tok!=TK_WORD && tok!=TK_LNKWORD)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s",
tokToString(tok),cmdName.data());
return;
}
tok=doctokenizerYYlex();
if (tok!=TK_WHITESPACE)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command",
cmdName.data());
return;
}
@@ -3020,7 +3045,7 @@ void DocPara::handleImage(const QString &cmdName)
else if (imgType=="rtf") t=DocImage::Rtf;
else
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: image type %s specified as the first argument of "
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: image type %s specified as the first argument of "
"%s is not valid",
imgType.data(),cmdName.data());
return;
@@ -3029,7 +3054,7 @@ void DocPara::handleImage(const QString &cmdName)
tok=doctokenizerYYlex();
if (tok!=TK_WORD)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s",
tokToString(tok),cmdName.data());
return;
}
@@ -3044,7 +3069,7 @@ void DocPara::handleDotFile(const QString &cmdName)
int tok=doctokenizerYYlex();
if (tok!=TK_WHITESPACE)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command",
cmdName.data());
return;
}
@@ -3052,12 +3077,13 @@ void DocPara::handleDotFile(const QString &cmdName)
tok=doctokenizerYYlex();
if (tok!=TK_WORD)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s",
tokToString(tok),cmdName.data());
return;
}
doctokenizerYYsetStatePara();
- DocDotFile *df = new DocDotFile(this,g_token->name);
+ QString name = g_token->name;
+ DocDotFile *df = new DocDotFile(this,name);
m_children.append(df);
df->parse();
}
@@ -3067,7 +3093,7 @@ void DocPara::handleLink(const QString &cmdName,bool isJavaLink)
int tok=doctokenizerYYlex();
if (tok!=TK_WHITESPACE)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command",
cmdName.data());
return;
}
@@ -3075,7 +3101,7 @@ void DocPara::handleLink(const QString &cmdName,bool isJavaLink)
tok=doctokenizerYYlex();
if (tok!=TK_WORD)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s",
tokToString(tok),cmdName.data());
return;
}
@@ -3094,7 +3120,7 @@ void DocPara::handleRef(const QString &cmdName)
int tok=doctokenizerYYlex();
if (tok!=TK_WHITESPACE)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command",
cmdName.data());
return;
}
@@ -3103,7 +3129,7 @@ void DocPara::handleRef(const QString &cmdName)
DocRef *ref=0;
if (tok!=TK_WORD)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s",
tokToString(tok),cmdName.data());
goto endref;
}
@@ -3144,7 +3170,7 @@ int DocPara::handleLanguageSwitch()
}
else
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s as parameter of \\~",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s as parameter of \\~",
tokToString(tok));
goto endlang;
}
@@ -3164,7 +3190,7 @@ void DocPara::handleInclude(const QString &cmdName,DocInclude::Type t)
int tok=doctokenizerYYlex();
if (tok!=TK_WHITESPACE)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command",
cmdName.data());
return;
}
@@ -3173,13 +3199,13 @@ void DocPara::handleInclude(const QString &cmdName,DocInclude::Type t)
doctokenizerYYsetStatePara();
if (tok==0)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment block while parsing the "
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment block while parsing the "
"argument of command %s",cmdName.data());
return;
}
else if (tok!=TK_WORD)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s",
tokToString(tok),cmdName.data());
return;
}
@@ -3194,20 +3220,20 @@ void DocPara::handleSection(const QString &cmdName)
int tok=doctokenizerYYlex();
if (tok!=TK_WHITESPACE)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command",
cmdName.data());
return;
}
tok=doctokenizerYYlex();
if (tok==0)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment block while parsing the "
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment block while parsing the "
"argument of command %s\n", cmdName.data());
return;
}
else if (tok!=TK_WORD && tok!=TK_LNKWORD)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s",
tokToString(tok),cmdName.data());
return;
}
@@ -3224,7 +3250,7 @@ int DocPara::handleCommand(const QString &cmdName)
switch (CmdMapper::map(cmdName))
{
case CMD_UNKNOWN:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Found unknown command `\\%s'",cmdName.data());
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Found unknown command `\\%s'",cmdName.data());
break;
case CMD_EMPHASIS:
m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Italic,TRUE));
@@ -3351,7 +3377,7 @@ int DocPara::handleCommand(const QString &cmdName)
doctokenizerYYsetStateCode();
retval = doctokenizerYYlex();
m_children.append(new DocVerbatim(this,g_context,g_token->verb,DocVerbatim::Code,g_isExample,g_fileName));
- if (retval==0) warn(g_fileName,doctokenizerYYlineno,"Warning: code section ended without end marker");
+ if (retval==0) warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: code section ended without end marker");
doctokenizerYYsetStatePara();
}
break;
@@ -3360,7 +3386,7 @@ int DocPara::handleCommand(const QString &cmdName)
doctokenizerYYsetStateHtmlOnly();
retval = doctokenizerYYlex();
m_children.append(new DocVerbatim(this,g_context,g_token->verb,DocVerbatim::HtmlOnly,g_isExample,g_fileName));
- if (retval==0) warn(g_fileName,doctokenizerYYlineno,"Warning: htmlonly section ended without end marker");
+ if (retval==0) warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: htmlonly section ended without end marker");
doctokenizerYYsetStatePara();
}
break;
@@ -3369,7 +3395,7 @@ int DocPara::handleCommand(const QString &cmdName)
doctokenizerYYsetStateLatexOnly();
retval = doctokenizerYYlex();
m_children.append(new DocVerbatim(this,g_context,g_token->verb,DocVerbatim::LatexOnly,g_isExample,g_fileName));
- if (retval==0) warn(g_fileName,doctokenizerYYlineno,"Warning: latexonly section ended without end marker");
+ if (retval==0) warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: latexonly section ended without end marker");
doctokenizerYYsetStatePara();
}
break;
@@ -3378,7 +3404,7 @@ int DocPara::handleCommand(const QString &cmdName)
doctokenizerYYsetStateVerbatim();
retval = doctokenizerYYlex();
m_children.append(new DocVerbatim(this,g_context,g_token->verb,DocVerbatim::Verbatim,g_isExample,g_fileName));
- if (retval==0) warn(g_fileName,doctokenizerYYlineno,"Warning: verbatim section ended without end marker");
+ if (retval==0) warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: verbatim section ended without end marker");
doctokenizerYYsetStatePara();
}
break;
@@ -3387,7 +3413,7 @@ int DocPara::handleCommand(const QString &cmdName)
case CMD_ENDLATEXONLY:
case CMD_ENDLINK:
case CMD_ENDVERBATIM:
- warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected command %s",g_token->name.data());
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected command %s",g_token->name.data());
break;
case CMD_PARAM:
retval = handleParamSection(cmdName,DocParamSect::Param);
@@ -3421,20 +3447,20 @@ int DocPara::handleCommand(const QString &cmdName)
int tok=doctokenizerYYlex();
if (tok!=TK_WHITESPACE)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command",
cmdName.data());
break;
}
tok=doctokenizerYYlex();
if (tok==0)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment block while parsing the "
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment block while parsing the "
"argument of command %s",cmdName.data());
break;
}
else if (tok!=TK_WORD && tok!=TK_LNKWORD)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s",
tokToString(tok),cmdName.data());
break;
}
@@ -3457,20 +3483,20 @@ int DocPara::handleCommand(const QString &cmdName)
int tok=doctokenizerYYlex();
if (tok!=TK_WHITESPACE)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command",
cmdName.data());
break;
}
tok=doctokenizerYYlex();
if (tok==0)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment block while parsing the "
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment block while parsing the "
"argument of command %s\n", cmdName.data());
break;
}
else if (tok!=TK_WORD && tok!=TK_LNKWORD)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s",
tokToString(tok),cmdName.data());
break;
}
@@ -3526,10 +3552,10 @@ int DocPara::handleCommand(const QString &cmdName)
}
break;
case CMD_SECREFITEM:
- warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected command %s",g_token->name.data());
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected command %s",g_token->name.data());
break;
case CMD_ENDSECREFLIST:
- warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected command %s",g_token->name.data());
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected command %s",g_token->name.data());
break;
case CMD_FORMULA:
{
@@ -3541,7 +3567,7 @@ int DocPara::handleCommand(const QString &cmdName)
retval = handleLanguageSwitch();
break;
case CMD_INTERNALREF:
- warn(g_fileName,doctokenizerYYlineno,"Warning: unexpected command %s",g_token->name.data());
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected command %s",g_token->name.data());
break;
default:
// we should not get here!
@@ -3581,7 +3607,7 @@ int DocPara::handleHtmlStartTag(const QString &tagName,const HtmlAttribList &tag
case HTML_LI:
if (!insideUL(this) && !insideOL(this))
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: lonely <li> tag found");
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: lonely <li> tag found");
}
else
{
@@ -3635,7 +3661,7 @@ int DocPara::handleHtmlStartTag(const QString &tagName,const HtmlAttribList &tag
retval = RetVal_DescTitle;
break;
case HTML_DD:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected tag <dd> found");
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected tag <dd> found");
break;
case HTML_TABLE:
{
@@ -3654,7 +3680,7 @@ int DocPara::handleHtmlStartTag(const QString &tagName,const HtmlAttribList &tag
retval = RetVal_TableHCell;
break;
case HTML_CAPTION:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected tag <caption> found");
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected tag <caption> found");
break;
case HTML_BR:
{
@@ -3684,7 +3710,7 @@ int DocPara::handleHtmlStartTag(const QString &tagName,const HtmlAttribList &tag
}
else
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: found <a> tag with name option but without value!");
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: found <a> tag with name option but without value!");
}
}
else if (opt->name=="href") // <a href=url>..</a> tag
@@ -3759,7 +3785,7 @@ int DocPara::handleHtmlStartTag(const QString &tagName,const HtmlAttribList &tag
}
break;
case HTML_UNKNOWN:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unsupported html tag <%s> found", tagName.data());
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unsupported html tag <%s> found", tagName.data());
break;
default:
// we should not get here!
@@ -3779,7 +3805,7 @@ int DocPara::handleHtmlEndTag(const QString &tagName)
case HTML_UL:
if (!insideUL(this))
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: found </ul> tag without matching <ul>");
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: found </ul> tag without matching <ul>");
}
else
{
@@ -3789,7 +3815,7 @@ int DocPara::handleHtmlEndTag(const QString &tagName)
case HTML_OL:
if (!insideOL(this))
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: found </ol> tag without matching <ol>");
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: found </ol> tag without matching <ol>");
}
else
{
@@ -3799,7 +3825,7 @@ int DocPara::handleHtmlEndTag(const QString &tagName)
case HTML_LI:
if (!insideLI(this))
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: found </li> tag without matching <li>");
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: found </li> tag without matching <li>");
}
else
{
@@ -3809,7 +3835,7 @@ int DocPara::handleHtmlEndTag(const QString &tagName)
//case HTML_PRE:
// if (!insidePRE(this))
// {
- // warn(g_fileName,doctokenizerYYlineno,"Warning: found </pre> tag without matching <pre>");
+ // warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: found </pre> tag without matching <pre>");
// }
// else
// {
@@ -3867,32 +3893,32 @@ int DocPara::handleHtmlEndTag(const QString &tagName)
// ignore </th> tag
break;
case HTML_CAPTION:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected tag </caption> found");
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected tag </caption> found");
break;
case HTML_BR:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Illegal </br> tag found\n");
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Illegal </br> tag found\n");
break;
case HTML_H1:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected tag </h1> found");
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected tag </h1> found");
break;
case HTML_H2:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected tag </h2> found");
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected tag </h2> found");
break;
case HTML_H3:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected tag </h3> found");
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected tag </h3> found");
break;
case HTML_IMG:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected tag </img> found");
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected tag </img> found");
break;
case HTML_HR:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected tag </hr> found");
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected tag </hr> found");
break;
case HTML_A:
- //warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected tag </a> found");
+ //warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected tag </a> found");
// ignore </a> tag (can be part of <a name=...></a>
break;
case HTML_UNKNOWN:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unsupported html tag </%s> found",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unsupported html tag </%s> found",
tagName.data());
break;
default:
@@ -4025,13 +4051,13 @@ reparsetoken:
}
else
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: End of list marker found "
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: End of list marker found "
"has invalid indent level");
}
}
else
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: End of list marker found without any preceding "
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: End of list marker found without any preceding "
"list items");
}
break;
@@ -4132,7 +4158,7 @@ reparsetoken:
}
else
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found",
g_token->name.data());
}
break;
@@ -4140,6 +4166,17 @@ reparsetoken:
case TK_NEWPARA:
retval=TK_NEWPARA;
goto endparagraph;
+ case TK_RCSTAG:
+ {
+ DocSimpleSect *ss=new DocSimpleSect(this,DocSimpleSect::Rcs);
+ m_children.append(ss);
+ ss->parseRcs();
+ }
+ break;
+ default:
+ warn_doc_error(g_fileName,doctokenizerYYlineno,
+ "Warning: Found unexpected token (id=%x)\n",tok);
+ break;
}
}
endparagraph:
@@ -4194,7 +4231,7 @@ int DocSection::parse()
}
if (retval==TK_LISTITEM)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: Invalid list item found");
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Invalid list item found");
}
} while (retval!=0 &&
retval!=RetVal_Internal &&
@@ -4247,7 +4284,7 @@ int DocSection::parse()
if (retval==RetVal_Subsection) level=2;
else if (retval==RetVal_Subsubsection) level=3;
else level=4;
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected %s "
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected %s "
"command found inside %s!",
sectionLevelToName[level],sectionLevelToName[m_level]);
retval=0; // stop parsing
@@ -4296,7 +4333,7 @@ void DocText::parse()
}
else
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unsupported symbol %s found",
g_token->name.data());
}
}
@@ -4329,13 +4366,13 @@ void DocText::parse()
m_children.append(new DocSymbol(this,DocSymbol::Percent));
break;
default:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected command `%s' found",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected command `%s' found",
g_token->name.data());
break;
}
break;
default:
- warn(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s",
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s",
tokToString(tok));
break;
}
@@ -4373,7 +4410,7 @@ void DocRoot::parse()
}
if (retval==TK_LISTITEM)
{
- warn(g_fileName,doctokenizerYYlineno,"Warning: Invalid list item found");
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Invalid list item found");
}
} while (retval!=0 && retval!=RetVal_Section && retval!=RetVal_Internal);
if (lastPar) lastPar->markLast();
@@ -4493,8 +4530,8 @@ DocNode *validatingParseText(const char *input)
return txt;
}
-void docFindSections(const char *input,PageInfo *pi,Definition *d,MemberGroup *mg)
+void docFindSections(const char *input,PageInfo *pi,Definition *d,MemberGroup *mg,const char *fileName)
{
- doctokenizerYYFindSections(input,pi,d,mg);
+ doctokenizerYYFindSections(input,pi,d,mg,fileName);
}