summaryrefslogtreecommitdiffstats
path: root/src/commentscan.l
diff options
context:
space:
mode:
Diffstat (limited to 'src/commentscan.l')
-rw-r--r--src/commentscan.l368
1 files changed, 215 insertions, 153 deletions
diff --git a/src/commentscan.l b/src/commentscan.l
index 2023448..f6cf099 100644
--- a/src/commentscan.l
+++ b/src/commentscan.l
@@ -30,6 +30,7 @@
#include <qstack.h>
#include <qregexp.h>
#include <qfile.h>
+#include <qstringlist.h>
#include "scanner.h"
#include "entry.h"
@@ -54,81 +55,81 @@
#define YY_NO_UNISTD_H 1
// forward declarations
-static bool handleBrief(const QCString &);
-static bool handleFn(const QCString &);
-static bool handleDef(const QCString &);
-static bool handleOverload(const QCString &);
-static bool handleEnum(const QCString &);
-static bool handleDefGroup(const QCString &);
-static bool handleAddToGroup(const QCString &);
-static bool handleWeakGroup(const QCString &);
-static bool handleNamespace(const QCString &);
-static bool handlePackage(const QCString &);
-static bool handleClass(const QCString &);
-static bool handleHeaderFile(const QCString &);
-static bool handleProtocol(const QCString &);
-static bool handleCategory(const QCString &);
-static bool handleUnion(const QCString &);
-static bool handleStruct(const QCString &);
-static bool handleInterface(const QCString &);
-static bool handleIdlException(const QCString &);
-static bool handlePage(const QCString &);
-static bool handleMainpage(const QCString &);
-static bool handleFile(const QCString &);
-static bool handleDir(const QCString &);
-static bool handleExample(const QCString &);
-static bool handleDetails(const QCString &);
-static bool handleName(const QCString &);
-static bool handleTodo(const QCString &);
-static bool handleTest(const QCString &);
-static bool handleBug(const QCString &);
-static bool handleSubpage(const QCString &s);
-static bool handleDeprecated(const QCString &);
-static bool handleXRefItem(const QCString &);
-static bool handleRelated(const QCString &);
-static bool handleRelatedAlso(const QCString &);
-static bool handleMemberOf(const QCString &);
-static bool handleRefItem(const QCString &);
-static bool handleSection(const QCString &);
-static bool handleAnchor(const QCString &);
-static bool handleCite(const QCString &);
-static bool handleFormatBlock(const QCString &);
-static bool handleAddIndex(const QCString &);
-static bool handleIf(const QCString &);
-static bool handleIfNot(const QCString &);
-static bool handleElseIf(const QCString &);
-static bool handleElse(const QCString &);
-static bool handleEndIf(const QCString &);
-static bool handleIngroup(const QCString &);
-static bool handleNoSubGrouping(const QCString &);
-static bool handleShowInitializer(const QCString &);
-static bool handleHideInitializer(const QCString &);
-static bool handleCallgraph(const QCString &);
-static bool handleHideCallgraph(const QCString &);
-static bool handleCallergraph(const QCString &);
-static bool handleHideCallergraph(const QCString &);
-static bool handleInternal(const QCString &);
-static bool handleLineBr(const QCString &);
-static bool handleStatic(const QCString &);
-static bool handlePure(const QCString &);
-static bool handlePrivate(const QCString &);
-static bool handlePrivateSection(const QCString &);
-static bool handleProtected(const QCString &);
-static bool handleProtectedSection(const QCString &);
-static bool handlePublic(const QCString &s);
-static bool handlePublicSection(const QCString &s);
-static bool handleToc(const QCString &s);
-static bool handleInherit(const QCString &);
-static bool handleExtends(const QCString &);
-static bool handleCopyDoc(const QCString &);
-static bool handleCopyBrief(const QCString &);
-static bool handleCopyDetails(const QCString &);
-static bool handleParBlock(const QCString &);
-static bool handleEndParBlock(const QCString &);
-static bool handleParam(const QCString &);
-static bool handleRetval(const QCString &);
-
-typedef bool (*DocCmdFunc)(const QCString &name);
+static bool handleBrief(const QCString &, const QCString &);
+static bool handleFn(const QCString &, const QCString &);
+static bool handleDef(const QCString &, const QCString &);
+static bool handleOverload(const QCString &, const QCString &);
+static bool handleEnum(const QCString &, const QCString &);
+static bool handleDefGroup(const QCString &, const QCString &);
+static bool handleAddToGroup(const QCString &, const QCString &);
+static bool handleWeakGroup(const QCString &, const QCString &);
+static bool handleNamespace(const QCString &, const QCString &);
+static bool handlePackage(const QCString &, const QCString &);
+static bool handleClass(const QCString &, const QCString &);
+static bool handleHeaderFile(const QCString &, const QCString &);
+static bool handleProtocol(const QCString &, const QCString &);
+static bool handleCategory(const QCString &, const QCString &);
+static bool handleUnion(const QCString &, const QCString &);
+static bool handleStruct(const QCString &, const QCString &);
+static bool handleInterface(const QCString &, const QCString &);
+static bool handleIdlException(const QCString &, const QCString &);
+static bool handlePage(const QCString &, const QCString &);
+static bool handleMainpage(const QCString &, const QCString &);
+static bool handleFile(const QCString &, const QCString &);
+static bool handleDir(const QCString &, const QCString &);
+static bool handleExample(const QCString &, const QCString &);
+static bool handleDetails(const QCString &, const QCString &);
+static bool handleName(const QCString &, const QCString &);
+static bool handleTodo(const QCString &, const QCString &);
+static bool handleTest(const QCString &, const QCString &);
+static bool handleBug(const QCString &, const QCString &);
+static bool handleSubpage(const QCString &s, const QCString &);
+static bool handleDeprecated(const QCString &, const QCString &);
+static bool handleXRefItem(const QCString &, const QCString &);
+static bool handleRelated(const QCString &, const QCString &);
+static bool handleRelatedAlso(const QCString &, const QCString &);
+static bool handleMemberOf(const QCString &, const QCString &);
+static bool handleRefItem(const QCString &, const QCString &);
+static bool handleSection(const QCString &, const QCString &);
+static bool handleAnchor(const QCString &, const QCString &);
+static bool handleCite(const QCString &, const QCString &);
+static bool handleFormatBlock(const QCString &, const QCString &);
+static bool handleAddIndex(const QCString &, const QCString &);
+static bool handleIf(const QCString &, const QCString &);
+static bool handleIfNot(const QCString &, const QCString &);
+static bool handleElseIf(const QCString &, const QCString &);
+static bool handleElse(const QCString &, const QCString &);
+static bool handleEndIf(const QCString &, const QCString &);
+static bool handleIngroup(const QCString &, const QCString &);
+static bool handleNoSubGrouping(const QCString &, const QCString &);
+static bool handleShowInitializer(const QCString &, const QCString &);
+static bool handleHideInitializer(const QCString &, const QCString &);
+static bool handleCallgraph(const QCString &, const QCString &);
+static bool handleHideCallgraph(const QCString &, const QCString &);
+static bool handleCallergraph(const QCString &, const QCString &);
+static bool handleHideCallergraph(const QCString &, const QCString &);
+static bool handleInternal(const QCString &, const QCString &);
+static bool handleLineBr(const QCString &, const QCString &);
+static bool handleStatic(const QCString &, const QCString &);
+static bool handlePure(const QCString &, const QCString &);
+static bool handlePrivate(const QCString &, const QCString &);
+static bool handlePrivateSection(const QCString &, const QCString &);
+static bool handleProtected(const QCString &, const QCString &);
+static bool handleProtectedSection(const QCString &, const QCString &);
+static bool handlePublic(const QCString &s, const QCString &);
+static bool handlePublicSection(const QCString &s, const QCString &);
+static bool handleToc(const QCString &s, const QCString &);
+static bool handleInherit(const QCString &, const QCString &);
+static bool handleExtends(const QCString &, const QCString &);
+static bool handleCopyDoc(const QCString &, const QCString &);
+static bool handleCopyBrief(const QCString &, const QCString &);
+static bool handleCopyDetails(const QCString &, const QCString &);
+static bool handleParBlock(const QCString &, const QCString &);
+static bool handleEndParBlock(const QCString &, const QCString &);
+static bool handleParam(const QCString &, const QCString &);
+static bool handleRetval(const QCString &, const QCString &);
+
+typedef bool (*DocCmdFunc)(const QCString &name, const QCString &opt);
struct DocCmdMap
{
@@ -1096,9 +1097,22 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
);
inInternalDocs = FALSE;
}
+<Comment>{B}*{CMD}[a-z_A-Z]+"{"[a-zA-Z_,:0-9\. ]*"}"{B}* |
<Comment>{B}*{CMD}[a-z_A-Z]+{B}* { // potentially interesting command
// the {B}* in the front was added for bug620924
- QCString cmdName = QCString(yytext).stripWhiteSpace().data()+1;
+ QCString fullMatch = QCString(yytext);
+ int idx = fullMatch.find('{');
+ QCString cmdName;
+ QCString optName;
+ if (idx == -1)
+ {
+ cmdName = QCString(yytext).stripWhiteSpace().data()+1; // to remove {CMD}
+ }
+ else
+ {
+ cmdName = fullMatch.left(idx).stripWhiteSpace().data()+1; // to remove {CMD}
+ optName = fullMatch.right(fullMatch.length() - idx).stripWhiteSpace().data();
+ }
DocCmdMapper::Cmd *cmdPtr = DocCmdMapper::map(cmdName);
if (cmdPtr) // special action is required
{
@@ -1112,7 +1126,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
setOutput(OutputDoc);
}
//if (i>0) addOutput(QCString(yytext).left(i)); // removed for bug 689341
- if (cmdPtr->func && cmdPtr->func(cmdName))
+ if (cmdPtr->func && cmdPtr->func(cmdName, optName))
{
// implicit split of the comment block into two
// entries. Restart the next block at the start
@@ -2257,14 +2271,14 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
//----------------------------------------------------------------------------
-static bool handleBrief(const QCString &)
+static bool handleBrief(const QCString &, const QCString &)
{
//printf("handleBrief\n");
setOutput(OutputBrief);
return FALSE;
}
-static bool handleFn(const QCString &)
+static bool handleFn(const QCString &, const QCString &)
{
bool stop=makeStructuralIndicator(Entry::MEMBERDOC_SEC);
functionProto.resize(0);
@@ -2273,7 +2287,7 @@ static bool handleFn(const QCString &)
return stop;
}
-static bool handleDef(const QCString &)
+static bool handleDef(const QCString &, const QCString &)
{
bool stop=makeStructuralIndicator(Entry::DEFINEDOC_SEC);
functionProto.resize(0);
@@ -2281,21 +2295,21 @@ static bool handleDef(const QCString &)
return stop;
}
-static bool handleOverload(const QCString &)
+static bool handleOverload(const QCString &, const QCString &)
{
functionProto.resize(0);
BEGIN(OverloadParam);
return FALSE;
}
-static bool handleEnum(const QCString &)
+static bool handleEnum(const QCString &, const QCString &)
{
bool stop=makeStructuralIndicator(Entry::ENUMDOC_SEC);
BEGIN(EnumDocArg1);
return stop;
}
-static bool handleDefGroup(const QCString &)
+static bool handleDefGroup(const QCString &, const QCString &)
{
bool stop=makeStructuralIndicator(Entry::GROUPDOC_SEC);
current->groupDocType = Entry::GROUPDOC_NORMAL;
@@ -2303,7 +2317,7 @@ static bool handleDefGroup(const QCString &)
return stop;
}
-static bool handleAddToGroup(const QCString &)
+static bool handleAddToGroup(const QCString &, const QCString &)
{
bool stop=makeStructuralIndicator(Entry::GROUPDOC_SEC);
current->groupDocType = Entry::GROUPDOC_ADD;
@@ -2311,7 +2325,7 @@ static bool handleAddToGroup(const QCString &)
return stop;
}
-static bool handleWeakGroup(const QCString &)
+static bool handleWeakGroup(const QCString &, const QCString &)
{
bool stop=makeStructuralIndicator(Entry::GROUPDOC_SEC);
current->groupDocType = Entry::GROUPDOC_WEAK;
@@ -2319,83 +2333,83 @@ static bool handleWeakGroup(const QCString &)
return stop;
}
-static bool handleNamespace(const QCString &)
+static bool handleNamespace(const QCString &, const QCString &)
{
bool stop=makeStructuralIndicator(Entry::NAMESPACEDOC_SEC);
BEGIN( NameSpaceDocArg1 );
return stop;
}
-static bool handlePackage(const QCString &)
+static bool handlePackage(const QCString &, const QCString &)
{
bool stop=makeStructuralIndicator(Entry::PACKAGEDOC_SEC);
BEGIN( PackageDocArg1 );
return stop;
}
-static bool handleClass(const QCString &)
+static bool handleClass(const QCString &, const QCString &)
{
bool stop=makeStructuralIndicator(Entry::CLASSDOC_SEC);
BEGIN( ClassDocArg1 );
return stop;
}
-static bool handleHeaderFile(const QCString &)
+static bool handleHeaderFile(const QCString &, const QCString &)
{
BEGIN( ClassDocArg2 );
return FALSE;
}
-static bool handleProtocol(const QCString &)
+static bool handleProtocol(const QCString &, const QCString &)
{ // Obj-C protocol
bool stop=makeStructuralIndicator(Entry::PROTOCOLDOC_SEC);
BEGIN( ClassDocArg1 );
return stop;
}
-static bool handleCategory(const QCString &)
+static bool handleCategory(const QCString &, const QCString &)
{ // Obj-C category
bool stop=makeStructuralIndicator(Entry::CATEGORYDOC_SEC);
BEGIN( CategoryDocArg1 );
return stop;
}
-static bool handleUnion(const QCString &)
+static bool handleUnion(const QCString &, const QCString &)
{
bool stop=makeStructuralIndicator(Entry::UNIONDOC_SEC);
BEGIN( ClassDocArg1 );
return stop;
}
-static bool handleStruct(const QCString &)
+static bool handleStruct(const QCString &, const QCString &)
{
bool stop=makeStructuralIndicator(Entry::STRUCTDOC_SEC);
BEGIN( ClassDocArg1 );
return stop;
}
-static bool handleInterface(const QCString &)
+static bool handleInterface(const QCString &, const QCString &)
{
bool stop=makeStructuralIndicator(Entry::INTERFACEDOC_SEC);
BEGIN( ClassDocArg1 );
return stop;
}
-static bool handleIdlException(const QCString &)
+static bool handleIdlException(const QCString &, const QCString &)
{
bool stop=makeStructuralIndicator(Entry::EXCEPTIONDOC_SEC);
BEGIN( ClassDocArg1 );
return stop;
}
-static bool handlePage(const QCString &)
+static bool handlePage(const QCString &, const QCString &)
{
bool stop=makeStructuralIndicator(Entry::PAGEDOC_SEC);
BEGIN( PageDocArg1 );
return stop;
}
-static bool handleMainpage(const QCString &)
+static bool handleMainpage(const QCString &, const QCString &)
{
bool stop=makeStructuralIndicator(Entry::MAINPAGEDOC_SEC);
if (!stop)
@@ -2406,7 +2420,7 @@ static bool handleMainpage(const QCString &)
return stop;
}
-static bool handleFile(const QCString &)
+static bool handleFile(const QCString &, const QCString &)
{
bool stop=makeStructuralIndicator(Entry::FILEDOC_SEC);
if (!stop)
@@ -2417,7 +2431,7 @@ static bool handleFile(const QCString &)
return stop;
}
-static bool handleParam(const QCString &)
+static bool handleParam(const QCString &, const QCString &)
{
// we need process param and retval arguments to escape leading underscores in case of
// markdown processing, see bug775493
@@ -2426,14 +2440,14 @@ static bool handleParam(const QCString &)
return FALSE;
}
-static bool handleRetval(const QCString &)
+static bool handleRetval(const QCString &, const QCString &)
{
addOutput("@retval ");
BEGIN( ParamArg1 );
return FALSE;
}
-static bool handleDir(const QCString &)
+static bool handleDir(const QCString &, const QCString &)
{
bool stop=makeStructuralIndicator(Entry::DIRDOC_SEC);
if (!stop) current->name = yyFileName;
@@ -2441,7 +2455,7 @@ static bool handleDir(const QCString &)
return stop;
}
-static bool handleExample(const QCString &)
+static bool handleExample(const QCString &, const QCString &)
{
bool stop=makeStructuralIndicator(Entry::EXAMPLE_SEC);
if (!stop) current->name = yyFileName;
@@ -2449,7 +2463,7 @@ static bool handleExample(const QCString &)
return stop;
}
-static bool handleDetails(const QCString &)
+static bool handleDetails(const QCString &, const QCString &)
{
if (inContext!=OutputBrief)
{
@@ -2460,7 +2474,7 @@ static bool handleDetails(const QCString &)
return FALSE;
}
-static bool handleName(const QCString &)
+static bool handleName(const QCString &, const QCString &)
{
bool stop=makeStructuralIndicator(Entry::MEMBERGRP_SEC);
if (!stop)
@@ -2475,7 +2489,7 @@ static bool handleName(const QCString &)
return stop;
}
-static bool handleTodo(const QCString &)
+static bool handleTodo(const QCString &, const QCString &)
{
newXRefKind = XRef_Todo;
setOutput(OutputXRef);
@@ -2483,7 +2497,7 @@ static bool handleTodo(const QCString &)
return FALSE;
}
-static bool handleTest(const QCString &)
+static bool handleTest(const QCString &, const QCString &)
{
newXRefKind = XRef_Test;
setOutput(OutputXRef);
@@ -2491,7 +2505,7 @@ static bool handleTest(const QCString &)
return FALSE;
}
-static bool handleBug(const QCString &)
+static bool handleBug(const QCString &, const QCString &)
{
newXRefKind = XRef_Bug;
setOutput(OutputXRef);
@@ -2499,7 +2513,7 @@ static bool handleBug(const QCString &)
return FALSE;
}
-static bool handleDeprecated(const QCString &)
+static bool handleDeprecated(const QCString &, const QCString &)
{
newXRefKind = XRef_Deprecated;
setOutput(OutputXRef);
@@ -2507,14 +2521,14 @@ static bool handleDeprecated(const QCString &)
return FALSE;
}
-static bool handleXRefItem(const QCString &)
+static bool handleXRefItem(const QCString &, const QCString &)
{
newXRefKind = XRef_Item;
BEGIN(XRefItemParam1);
return FALSE;
}
-static bool handleParBlock(const QCString &)
+static bool handleParBlock(const QCString &, const QCString &)
{
if (g_insideParBlock)
{
@@ -2531,7 +2545,7 @@ static bool handleParBlock(const QCString &)
return FALSE;
}
-static bool handleEndParBlock(const QCString &)
+static bool handleEndParBlock(const QCString &, const QCString &)
{
if (!g_insideParBlock)
{
@@ -2544,7 +2558,7 @@ static bool handleEndParBlock(const QCString &)
return FALSE;
}
-static bool handleRelated(const QCString &)
+static bool handleRelated(const QCString &, const QCString &)
{
if (!current->relates.isEmpty())
{
@@ -2556,7 +2570,7 @@ static bool handleRelated(const QCString &)
return FALSE;
}
-static bool handleRelatedAlso(const QCString &)
+static bool handleRelatedAlso(const QCString &, const QCString &)
{
if (!current->relates.isEmpty())
{
@@ -2568,7 +2582,7 @@ static bool handleRelatedAlso(const QCString &)
return FALSE;
}
-static bool handleMemberOf(const QCString &)
+static bool handleMemberOf(const QCString &, const QCString &)
{
if (!current->relates.isEmpty())
{
@@ -2580,14 +2594,14 @@ static bool handleMemberOf(const QCString &)
return FALSE;
}
-static bool handleRefItem(const QCString &)
+static bool handleRefItem(const QCString &, const QCString &)
{
addOutput("@refitem ");
BEGIN(LineParam);
return FALSE;
}
-static bool handleSection(const QCString &s)
+static bool handleSection(const QCString &s, const QCString &)
{
setOutput(OutputDoc);
addOutput("@"+s+" ");
@@ -2599,7 +2613,7 @@ static bool handleSection(const QCString &s)
return FALSE;
}
-static bool handleSubpage(const QCString &s)
+static bool handleSubpage(const QCString &s, const QCString &)
{
if (current->section!=Entry::EMPTY_SEC &&
current->section!=Entry::PAGEDOC_SEC &&
@@ -2619,14 +2633,14 @@ static bool handleSubpage(const QCString &s)
return FALSE;
}
-static bool handleAnchor(const QCString &s)
+static bool handleAnchor(const QCString &s, const QCString &)
{
addOutput("@"+s+" ");
BEGIN(AnchorLabel);
return FALSE;
}
-static bool handleCite(const QCString &s)
+static bool handleCite(const QCString &s, const QCString &)
{
if (!g_spaceBeforeCmd.isEmpty())
{
@@ -2638,24 +2652,24 @@ static bool handleCite(const QCString &s)
return FALSE;
}
-static bool handleFormatBlock(const QCString &s)
+static bool handleFormatBlock(const QCString &s, const QCString &opt)
{
- addOutput("@"+s+" ");
- //printf("handleFormatBlock(%s)\n",s.data());
+ addOutput("@"+s+" "+opt);
+ //printf("handleFormatBlock(%s) with option(%s)\n",s.data(),opt.data());
blockName=s;
g_commentCount=0;
BEGIN(FormatBlock);
return FALSE;
}
-static bool handleAddIndex(const QCString &)
+static bool handleAddIndex(const QCString &, const QCString &)
{
addOutput("@addindex ");
BEGIN(LineParam);
return FALSE;
}
-static bool handleIf(const QCString &)
+static bool handleIf(const QCString &, const QCString &)
{
enabledSectionFound=FALSE;
guardType = Guard_If;
@@ -2664,7 +2678,7 @@ static bool handleIf(const QCString &)
return FALSE;
}
-static bool handleIfNot(const QCString &)
+static bool handleIfNot(const QCString &, const QCString &)
{
enabledSectionFound=FALSE;
guardType = Guard_IfNot;
@@ -2673,7 +2687,7 @@ static bool handleIfNot(const QCString &)
return FALSE;
}
-static bool handleElseIf(const QCString &)
+static bool handleElseIf(const QCString &, const QCString &)
{
if (guards.isEmpty())
{
@@ -2688,7 +2702,7 @@ static bool handleElseIf(const QCString &)
return FALSE;
}
-static bool handleElse(const QCString &)
+static bool handleElse(const QCString &, const QCString &)
{
if (guards.isEmpty())
{
@@ -2702,7 +2716,7 @@ static bool handleElse(const QCString &)
return FALSE;
}
-static bool handleEndIf(const QCString &)
+static bool handleEndIf(const QCString &, const QCString &)
{
if (guards.isEmpty())
{
@@ -2723,56 +2737,56 @@ static bool handleEndIf(const QCString &)
return FALSE;
}
-static bool handleIngroup(const QCString &)
+static bool handleIngroup(const QCString &, const QCString &)
{
inGroupParamFound=FALSE;
BEGIN( InGroupParam );
return FALSE;
}
-static bool handleNoSubGrouping(const QCString &)
+static bool handleNoSubGrouping(const QCString &, const QCString &)
{
current->subGrouping = FALSE;
return FALSE;
}
-static bool handleShowInitializer(const QCString &)
+static bool handleShowInitializer(const QCString &, const QCString &)
{
current->initLines = 100000; // ON
return FALSE;
}
-static bool handleHideInitializer(const QCString &)
+static bool handleHideInitializer(const QCString &, const QCString &)
{
current->initLines = 0; // OFF
return FALSE;
}
-static bool handleCallgraph(const QCString &)
+static bool handleCallgraph(const QCString &, const QCString &)
{
current->callGraph = TRUE; // ON
return FALSE;
}
-static bool handleHideCallgraph(const QCString &)
+static bool handleHideCallgraph(const QCString &, const QCString &)
{
current->callGraph = FALSE; // OFF
return FALSE;
}
-static bool handleCallergraph(const QCString &)
+static bool handleCallergraph(const QCString &, const QCString &)
{
current->callerGraph = TRUE; // ON
return FALSE;
}
-static bool handleHideCallergraph(const QCString &)
+static bool handleHideCallergraph(const QCString &, const QCString &)
{
current->callerGraph = FALSE; // OFF
return FALSE;
}
-static bool handleInternal(const QCString &)
+static bool handleInternal(const QCString &, const QCString &)
{
if (!Config_getBool(INTERNAL_DOCS))
{
@@ -2794,85 +2808,133 @@ static bool handleInternal(const QCString &)
return FALSE;
}
-static bool handleLineBr(const QCString &)
+static bool handleLineBr(const QCString &, const QCString &)
{
addOutput('\n');
return FALSE;
}
-static bool handleStatic(const QCString &)
+static bool handleStatic(const QCString &, const QCString &)
{
endBrief();
current->stat = TRUE;
return FALSE;
}
-static bool handlePure(const QCString &)
+static bool handlePure(const QCString &, const QCString &)
{
endBrief();
current->virt = Pure;
return FALSE;
}
-static bool handlePrivate(const QCString &)
+static bool handlePrivate(const QCString &, const QCString &)
{
current->protection = Private;
return FALSE;
}
-static bool handlePrivateSection(const QCString &)
+static bool handlePrivateSection(const QCString &, const QCString &)
{
current->protection = protection = Private;
return FALSE;
}
-static bool handleProtected(const QCString &)
+static bool handleProtected(const QCString &, const QCString &)
{
current->protection = Protected;
return FALSE;
}
-static bool handleProtectedSection(const QCString &)
+static bool handleProtectedSection(const QCString &, const QCString &)
{
current->protection = protection = Protected ;
return FALSE;
}
-static bool handlePublic(const QCString &)
+static bool handlePublic(const QCString &, const QCString &)
{
current->protection = Public;
return FALSE;
}
-static bool handlePublicSection(const QCString &)
+static bool handlePublicSection(const QCString &, const QCString &)
{
current->protection = protection = Public;
return FALSE;
}
-static bool handleToc(const QCString &)
+static bool handleToc(const QCString &, const QCString &opt)
{
if (current->section==Entry::PAGEDOC_SEC ||
current->section==Entry::MAINPAGEDOC_SEC)
{
- current->stat=TRUE; // we 'abuse' stat to pass whether or the TOC is enabled
+ QString optName = opt.stripWhiteSpace(); // to be sure
+ optName = optName.left(optName.length() - 1).right(optName.length() - 2);
+ QStringList optList=QStringList::split(",",optName,FALSE);
+ QStringList::Iterator it;
+ for ( it = optList.begin(); it != optList.end(); ++it )
+ {
+ QString opt = (*it).stripWhiteSpace().lower();
+ char dum;
+ int level = 5;
+ int i = opt.find(':');
+ if (i>0) // found ':' but not on position 0 what would mean just a level
+ {
+ if (sscanf(opt.right(opt.length() - i - 1).data(),"%d%c",&level,&dum) != 1)
+ {
+ warn(yyFileName,yyLineNr,"Unknown option:level specified with \\tableofcontents: `%s'", (*it).stripWhiteSpace().data());
+ opt = "";
+ }
+ else
+ {
+ level = (level > 5 ? 5 : level);
+ level = (level <= 0 ? 5 : level);
+ opt = opt.left(i).stripWhiteSpace();
+ }
+ }
+ if (!opt.isEmpty())
+ {
+ if (opt == "html")
+ {
+ current->localToc |= (1 << Definition::Html);
+ current->localTocLevel[Definition::Html] = level;
+ }
+ else if (opt == "latex")
+ {
+ current->localToc |= (1 << Definition::Latex);
+ current->localTocLevel[Definition::Latex] = level;
+ }
+ else if (opt == "xml")
+ {
+ current->localToc |= (1 << Definition::Xml);
+ current->localTocLevel[Definition::Xml] = level;
+ }
+ else warn(yyFileName,yyLineNr,"Unknown option specified with \\tableofcontents: `%s'", (*it).stripWhiteSpace().data());
+ }
+ }
+ if (current->localToc == Definition::None)
+ {
+ current->localToc |= (1 << Definition::Html);
+ current->localTocLevel[Definition::Html] = 5;
+ }
}
return FALSE;
}
-static bool handleInherit(const QCString &)
+static bool handleInherit(const QCString &, const QCString &)
{
BEGIN(InheritParam);
return FALSE;
}
-static bool handleExtends(const QCString &)
+static bool handleExtends(const QCString &, const QCString &)
{
BEGIN(ExtendsParam);
return FALSE;
}
-static bool handleCopyBrief(const QCString &)
+static bool handleCopyBrief(const QCString &, const QCString &)
{
if (current->brief.isEmpty() && current->doc.isEmpty())
{ // if we don't have a brief or detailed description yet,
@@ -2889,7 +2951,7 @@ static bool handleCopyBrief(const QCString &)
return FALSE;
}
-static bool handleCopyDetails(const QCString &)
+static bool handleCopyDetails(const QCString &, const QCString &)
{
setOutput(OutputDoc);
if (!g_spaceBeforeCmd.isEmpty())
@@ -2901,7 +2963,7 @@ static bool handleCopyDetails(const QCString &)
return FALSE;
}
-static bool handleCopyDoc(const QCString &)
+static bool handleCopyDoc(const QCString &, const QCString &)
{
setOutput(OutputBrief);
if (!g_spaceBeforeCmd.isEmpty())