Commit 0921dea6 authored by Dimitri van Heesch's avatar Dimitri van Heesch

Merge pull request #181 from wtschueller/master

Tcl: collect XRefs also if INLINE_SOURCES = no
parents 4827ec0c 9d315a98
...@@ -451,6 +451,7 @@ static struct ...@@ -451,6 +451,7 @@ static struct
QList<Entry> entry; // list of all created entries, will be deleted after codifying QList<Entry> entry; // list of all created entries, will be deleted after codifying
Protection protection; // current protections state Protection protection; // current protections state
MemberDef *memberdef; // contain current MemberDef when codifying MemberDef *memberdef; // contain current MemberDef when codifying
bool collectXRefs;
} tcl; } tcl;
// scanner functions // scanner functions
...@@ -1652,6 +1653,40 @@ static void tcl_codify_link(QCString name) ...@@ -1652,6 +1653,40 @@ static void tcl_codify_link(QCString name)
{ {
myDef->addSourceReferencedBy(tcl.memberdef); myDef->addSourceReferencedBy(tcl.memberdef);
tcl.memberdef->addSourceReferences(myDef); tcl.memberdef->addSourceReferences(myDef);
} else {
Entry* callerEntry;
unsigned int i;
// walk the stack of scan contexts and find the enclosing method or proc
for (i=0;i<tcl.scan.count();i++)
{
callerEntry=tcl.scan.at(i)->entry_scan;
if (callerEntry->mtype==Method && !callerEntry->name.isEmpty())
{
break;
}
}
if (i<tcl.scan.count())
{
// enclosing method found
QCString callerName = callerEntry->name;
if (callerName.mid(0,2)=="::") // fully qualified global command
{
callerName = callerName.mid(2);
}
else
{
if (!(tcl.scan.at(0)->ns.stripWhiteSpace().isEmpty()))
{
callerName = tcl.scan.at(0)->ns + "::" + callerEntry->name;
}
}
MemberDef *callerDef=NULL;
callerDef = fn.find(callerName);
if (callerDef!=NULL && myDef!= NULL && tcl.collectXRefs)
{
addDocCrossReference(callerDef,myDef);
}
}
} }
} }
else if (tcl_keyword(myName)) // check keyword else if (tcl_keyword(myName)) // check keyword
...@@ -1665,6 +1700,122 @@ static void tcl_codify_link(QCString name) ...@@ -1665,6 +1700,122 @@ static void tcl_codify_link(QCString name)
} }
//! scan general argument for brackets
//
// parses (*tcl.list_commandwords.at(i)).utf8() and checks for brackets.
// Starts a new scan context if needed (*myScan==0 and brackets found).
// Returns NULL or the created scan context.
//
static tcl_scan *tcl_command_ARG(tcl_scan *myScan, unsigned int i, bool ignoreOutermostBraces)
{
QCString myName;
bool insideQuotes=false;
unsigned int insideBrackets=0;
unsigned int insideBraces=0;
myName = (*tcl.list_commandwords.at(i)).utf8();
if (i%2 != 0)
{
// handle white space
if (myScan!=NULL)
{
myScan->after << "NULL" << myName;
}
else
{
tcl_codify(NULL,myName);
}
}
else
{
QCString myStr = "";
unsigned int j;
for (j=0;j<myName.length();j++)
{
QChar c = myName[j];
bool backslashed = false;
if (j>0)
{
backslashed = myName[j-1]=='\\';
}
// this is a state machine
// input is c
// internal state is myScan and insideXXX
// these are the transitions:
if (c=='[' && !backslashed && insideBraces==0)
{
insideBrackets++;
}
if (c==']' && !backslashed && insideBraces==0 && insideBrackets>0)
{
insideBrackets--;
}
if (c=='{' && !backslashed && !insideQuotes && !(ignoreOutermostBraces && j==0))
{
insideBraces++;
}
if (c=='}' && !backslashed && !insideQuotes && insideBraces>0)
{
insideBraces--;
}
if (c=='"' && !backslashed && insideBraces==0)
{
insideQuotes=!insideQuotes;
}
// all output, depending on state and input
if (c=='[' && !backslashed && insideBrackets==1 && insideBraces==0)
{
// the first opening bracket, output what we have so far
myStr+=c;
if (myScan!=NULL)
{
myScan->after << "NULL" << myStr;
}
else
{
tcl_codify(NULL,myStr);
}
myStr="";
}
else if (c==']' && !backslashed && insideBrackets==0 && insideBraces==0)
{
// the last closing bracket, start recursion, switch to deferred
if (myScan!=NULL)
{
myScan->after << "script" << myStr;
}
else
{
myScan=tcl.scan.at(0);
myScan = tcl_scan_start('?',myStr,
myScan->ns,myScan->entry_cl,myScan->entry_fn);
}
myStr="";
myStr+=c;
}
else
{
myStr+=c;
}
}
if (myScan!=NULL)
{
myScan->after << "NULL" << myStr;
}
else
{
if (i==0)
{
tcl_codify_link(myStr);
}
else
{
tcl_codify(NULL,myStr);
}
}
}
return (myScan);
}
//! Handle internal tcl commands. //! Handle internal tcl commands.
// "if expr1 ?then? body1 elseif expr2 ?then? body2 elseif ... ?else? ?bodyN?" // "if expr1 ?then? body1 elseif expr2 ?then? body2 elseif ... ?else? ?bodyN?"
static void tcl_command_IF(QStringList type) static void tcl_command_IF(QStringList type)
...@@ -1672,13 +1823,28 @@ static void tcl_command_IF(QStringList type) ...@@ -1672,13 +1823,28 @@ static void tcl_command_IF(QStringList type)
D D
tcl_codify_cmd("keyword",0); tcl_codify_cmd("keyword",0);
tcl_codify_cmd(NULL,1); tcl_codify_cmd(NULL,1);
tcl_scan *myScan=tcl.scan.at(0); tcl_scan *myScan = NULL;
myScan = tcl_scan_start('?',*tcl.list_commandwords.at(2), myScan = tcl_command_ARG(myScan, 2, true);
myScan->ns,myScan->entry_cl,myScan->entry_fn);
for (unsigned int i = 3;i<tcl.list_commandwords.count();i++) for (unsigned int i = 3;i<tcl.list_commandwords.count();i++)
{
if (type[i] == "expr")
{
myScan = tcl_command_ARG(myScan, i, true);
}
else
{
if (myScan!=0)
{ {
myScan->after << type[i] << tcl.list_commandwords[i]; myScan->after << type[i] << tcl.list_commandwords[i];
} }
else
{
myScan=tcl.scan.at(0);
myScan = tcl_scan_start('?',*tcl.list_commandwords.at(i),
myScan->ns,myScan->entry_cl,myScan->entry_fn);
}
}
}
} }
//! Handle internal tcl commands. //! Handle internal tcl commands.
// "for start test next body" // "for start test next body"
...@@ -1691,7 +1857,7 @@ D ...@@ -1691,7 +1857,7 @@ D
myScan = tcl_scan_start('?',*tcl.list_commandwords.at(2), myScan = tcl_scan_start('?',*tcl.list_commandwords.at(2),
myScan->ns,myScan->entry_cl,myScan->entry_fn); myScan->ns,myScan->entry_cl,myScan->entry_fn);
myScan->after << "NULL" << tcl.list_commandwords[3]; myScan->after << "NULL" << tcl.list_commandwords[3];
myScan->after << "script" << tcl.list_commandwords[4]; myScan = tcl_command_ARG(myScan, 4, true);
myScan->after << "NULL" << tcl.list_commandwords[5]; myScan->after << "NULL" << tcl.list_commandwords[5];
myScan->after << "script" << tcl.list_commandwords[6]; myScan->after << "script" << tcl.list_commandwords[6];
myScan->after << "NULL" << tcl.list_commandwords[7]; myScan->after << "NULL" << tcl.list_commandwords[7];
...@@ -1705,14 +1871,22 @@ static void tcl_command_FOREACH() ...@@ -1705,14 +1871,22 @@ static void tcl_command_FOREACH()
{ {
D D
unsigned int i; unsigned int i;
tcl_scan *myScan=NULL;
tcl_codify_cmd("keyword",0); tcl_codify_cmd("keyword",0);
for (i = 1;i<tcl.list_commandwords.count()-1;i++) for (i = 1;i<tcl.list_commandwords.count()-1;i++)
{ {
tcl_codify_cmd(NULL,i); myScan = tcl_command_ARG(myScan, i, false);
} }
tcl_scan *myScan=tcl.scan.at(0); if (myScan!=0)
{
myScan->after << "script" << tcl.list_commandwords[tcl.list_commandwords.count()-1];
}
else
{
myScan=tcl.scan.at(0);
myScan = tcl_scan_start('?',*tcl.list_commandwords.at(tcl.list_commandwords.count()-1), myScan = tcl_scan_start('?',*tcl.list_commandwords.at(tcl.list_commandwords.count()-1),
myScan->ns,myScan->entry_cl,myScan->entry_fn); myScan->ns,myScan->entry_cl,myScan->entry_fn);
}
} }
///! Handle internal tcl commands. ///! Handle internal tcl commands.
...@@ -1722,68 +1896,29 @@ static void tcl_command_WHILE() ...@@ -1722,68 +1896,29 @@ static void tcl_command_WHILE()
D D
tcl_codify_cmd("keyword",0); tcl_codify_cmd("keyword",0);
tcl_codify_cmd(NULL,1); tcl_codify_cmd(NULL,1);
tcl_scan *myScan=tcl.scan.at(0); tcl_scan *myScan = NULL;
myScan = tcl_scan_start('?',*tcl.list_commandwords.at(2), myScan = tcl_command_ARG(myScan, 2, true);
myScan->ns,myScan->entry_cl,myScan->entry_fn); myScan = tcl_command_ARG(myScan, 3, false);
myScan->after << "NULL" << tcl.list_commandwords[3]; if (myScan!=0)
{
myScan->after << "script" << tcl.list_commandwords[4]; myScan->after << "script" << tcl.list_commandwords[4];
}
else
{
myScan=tcl.scan.at(0);
myScan = tcl_scan_start('?',*tcl.list_commandwords.at(4),
myScan->ns,myScan->entry_cl,myScan->entry_fn);
}
} }
//! Handle all other commands. //! Handle all other commands.
// Create links of first command word or first command word inside []. // Create links of first command word or first command word inside [].
static void tcl_command_OTHER() static void tcl_command_OTHER()
{ {
if (tcl.code == NULL) return; tcl_scan *myScan=NULL;
D
QCString myName;
for (unsigned int i=0; i< tcl.list_commandwords.count(); i++) for (unsigned int i=0; i< tcl.list_commandwords.count(); i++)
{ {
myName = (*tcl.list_commandwords.at(i)).utf8(); myScan = tcl_command_ARG(myScan, i, false);
if (i==0)
{
tcl_codify_link(myName);
}
else if (i%2 != 0)
{
tcl_codify(NULL,myName);
}
else
{
QCString myStr="";
int myCmd=0;
unsigned int i;
for (i=0;i<myName.length();i++)
{
QChar c = myName[i];
if (myCmd)
{
if (c==' '||c=='\t'||c=='\n'||c==']')
{//end of command
tcl_codify_link(myStr);
myStr="";
myCmd=0;
}
myStr+=c;
}
else
{
myStr+=c;
if (c=='[')
{//start of command
for (;i<myName.length();i++)
{
c = myName[i+1];
if (c!=' ' && c!='\t' && c!='\n') break;
myStr+=c;
}
tcl_codify(NULL,myStr);
myStr="";
myCmd=1;
}
}
}
tcl_codify(NULL,myStr);
}
} }
} }
...@@ -2165,13 +2300,14 @@ tcl_inf("->\n"); ...@@ -2165,13 +2300,14 @@ tcl_inf("->\n");
// check command // check command
QCString myStr = (*tcl.list_commandwords.at(0)).utf8(); QCString myStr = (*tcl.list_commandwords.at(0)).utf8();
tcl_scan *myScanBackup=tcl.scan.at(0);
int myLevel = 0; int myLevel = 0;
Protection myProt = tcl.protection; Protection myProt = tcl.protection;
if (tcl.list_commandwords.count() < 3) if (tcl.list_commandwords.count() < 3)
{ {
tcl_command_OTHER(); tcl_command_OTHER();
goto command_text; goto command_end;
} }
// remove leading "::" and apply TCL_SUBST // remove leading "::" and apply TCL_SUBST
if (myStr.left(2)=="::") myStr = myStr.mid(2); if (myStr.left(2)=="::") myStr = myStr.mid(2);
...@@ -2259,7 +2395,7 @@ tcl_inf("->\n"); ...@@ -2259,7 +2395,7 @@ tcl_inf("->\n");
goto command_end; goto command_end;
} }
tcl_command_OTHER(); tcl_command_OTHER();
goto command_text; goto command_end;
} }
if (myStr=="itcl::class") if (myStr=="itcl::class")
{ {
...@@ -2282,7 +2418,7 @@ tcl_inf("->\n"); ...@@ -2282,7 +2418,7 @@ tcl_inf("->\n");
goto command_end; goto command_end;
} }
tcl_command_OTHER(); tcl_command_OTHER();
goto command_text; goto command_end;
} }
if (myStr=="oo::define") if (myStr=="oo::define")
{ {
...@@ -2296,7 +2432,7 @@ tcl_inf("->\n"); ...@@ -2296,7 +2432,7 @@ tcl_inf("->\n");
if (tcl.scan.at(0)->entry_fn == NULL) if (tcl.scan.at(0)->entry_fn == NULL)
{// only parsed outside functions {// only parsed outside functions
tcl_command_VARIABLE(tcl.scan.at(0)->entry_cl && tcl.scan.at(0)->entry_cl->name!=""); tcl_command_VARIABLE(tcl.scan.at(0)->entry_cl && tcl.scan.at(0)->entry_cl->name!="");
goto command_text; goto command_end;
} }
} }
if (myStr=="common") if (myStr=="common")
...@@ -2305,7 +2441,7 @@ tcl_inf("->\n"); ...@@ -2305,7 +2441,7 @@ tcl_inf("->\n");
if (tcl.scan.at(0)->entry_fn == NULL) if (tcl.scan.at(0)->entry_fn == NULL)
{// only parsed outside functions {// only parsed outside functions
tcl_command_VARIABLE(0); tcl_command_VARIABLE(0);
goto command_text; goto command_end;
} }
} }
if (myStr=="inherit" || myStr=="superclass") if (myStr=="inherit" || myStr=="superclass")
...@@ -2343,7 +2479,7 @@ if expr1 ?then? body1 elseif expr2 ?then? body2 elseif ... ?else? ?bodyN? ...@@ -2343,7 +2479,7 @@ if expr1 ?then? body1 elseif expr2 ?then? body2 elseif ... ?else? ?bodyN?
if (myStr=="if" && tcl.list_commandwords.count() > 4) if (myStr=="if" && tcl.list_commandwords.count() > 4)
{ {
QStringList myType; QStringList myType;
myType << "keyword" << "NULL" << "script" << "NULL"; myType << "keyword" << "NULL" << "expr" << "NULL";
char myState='x';// last word: e'x'pr 't'hen 'b'ody 'e'lse else'i'f.. char myState='x';// last word: e'x'pr 't'hen 'b'ody 'e'lse else'i'f..
for (unsigned int i = 4; i < tcl.list_commandwords.count(); i = i + 2) for (unsigned int i = 4; i < tcl.list_commandwords.count(); i = i + 2)
{ {
...@@ -2392,7 +2528,7 @@ if expr1 ?then? body1 elseif expr2 ?then? body2 elseif ... ?else? ?bodyN? ...@@ -2392,7 +2528,7 @@ if expr1 ?then? body1 elseif expr2 ?then? body2 elseif ... ?else? ?bodyN?
else if (myState=='i') else if (myState=='i')
{ {
myState='x'; myState='x';
myType << "script" << "NULL"; myType << "expr" << "NULL";
} }
} }
if (myState != 'b') {myLine=__LINE__;goto command_warn;} if (myState != 'b') {myLine=__LINE__;goto command_warn;}
...@@ -2406,15 +2542,22 @@ if expr1 ?then? body1 elseif expr2 ?then? body2 elseif ... ?else? ?bodyN? ...@@ -2406,15 +2542,22 @@ if expr1 ?then? body1 elseif expr2 ?then? body2 elseif ... ?else? ?bodyN?
goto command_end; goto command_end;
} }
tcl_command_OTHER(); tcl_command_OTHER();
goto command_text; goto command_end;
command_warn:// print warning message because of wrong used syntax command_warn:// print warning message because of wrong used syntax
tcl_war("%d count=%d: %s\n",myLine,tcl.list_commandwords.count(),tcl.list_commandwords.join(" ").ascii()); tcl_war("%d count=%d: %s\n",myLine,tcl.list_commandwords.count(),tcl.list_commandwords.join(" ").ascii());
tcl_command_OTHER(); tcl_command_OTHER();
command_text:// print remaining text as comment
if (!myText.isEmpty()) tcl_codify("comment",myText);
myText = "";
command_end:// add remaining text to current context command_end:// add remaining text to current context
if (!myText.isEmpty()) tcl.scan.at(0)->after << "comment" << myText; if (!myText.isEmpty())
{
if(myScanBackup==tcl.scan.at(0))
{
tcl_codify("comment",myText);
}
else
{
tcl.scan.at(0)->after << "comment" << myText;
}
}
tcl.list_commandwords.clear(); tcl.list_commandwords.clear();
tcl.command = 0; tcl.command = 0;
tcl.protection = myProt; tcl.protection = myProt;
...@@ -2634,6 +2777,7 @@ tcl_inf("%s (%d,%d) %d %d\n",myStr.ascii(),startLine,endLine,isExampleBlock,inli ...@@ -2634,6 +2777,7 @@ tcl_inf("%s (%d,%d) %d %d\n",myStr.ascii(),startLine,endLine,isExampleBlock,inli
return; return;
} }
tcl_init(); tcl_init();
tcl.collectXRefs = collectXRefs;
tcl.memberdef = memberDef; tcl.memberdef = memberDef;
tcl.code = &codeOutIntf; tcl.code = &codeOutIntf;
if (startLine<0) if (startLine<0)
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="">
<compounddef id="057__caller__graphs_8tcl" kind="file">
<compoundname>057_caller_graphs.tcl</compoundname>
<innernamespace refid="namespacebar">bar</innernamespace>
<innernamespace refid="namespacefoo">foo</innernamespace>
<innernamespace refid="namespace1_1_11_1_11">1::1::1</innernamespace>
<innernamespace refid="namespace1">1</innernamespace>
<innernamespace refid="namespace1_1_11">1::1</innernamespace>
<innernamespace refid="namespace2_1_12_1_12_1_12_1_12">2::2::2::2::2</innernamespace>
<innernamespace refid="namespace2">2</innernamespace>
<innernamespace refid="namespace2_1_12">2::2</innernamespace>
<innernamespace refid="namespace2_1_12_1_12">2::2::2</innernamespace>
<innernamespace refid="namespace2_1_12_1_12_1_12">2::2::2::2</innernamespace>
<sectiondef kind="func">
<memberdef kind="function" id="057__caller__graphs_8tcl_1a85c692c418fec91930cfc7b3e82857d7" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>baz</definition>
<argsstring>args</argsstring>
<name>baz</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="057_caller_graphs.tcl" bodystart="57" bodyend="59"/>
</memberdef>
<memberdef kind="function" id="057__caller__graphs_8tcl_1ae4e1c2bb3adfdfbb71f52de84a8285b0" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>bar</definition>
<argsstring>args</argsstring>
<name>bar</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="057_caller_graphs.tcl" bodystart="63" bodyend="65"/>
<referencedby refid="namespace1_1a9722420639306872cea2593b83028a45" compoundref="057__caller__graphs_8tcl" startline="83" endline="86">1::test3</referencedby>
</memberdef>
<memberdef kind="function" id="057__caller__graphs_8tcl_1a3f808a00e1b937978455d707851ab33a" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>next</definition>
<argsstring>args</argsstring>
<name>next</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="057_caller_graphs.tcl" bodystart="100" bodyend="103"/>
<references refid="namespace2_1a2839d9dea7f0d08f48958c3fc0cd00d3" compoundref="057__caller__graphs_8tcl" startline="104" endline="112">2::next</references>
</memberdef>
</sectiondef>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<location file="057_caller_graphs.tcl"/>
</compounddef>
</doxygen>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="">
<compounddef id="namespace1" kind="namespace">
<compoundname>1</compoundname>
<innernamespace refid="namespace1_1_11">1::1</innernamespace>
<sectiondef kind="func">
<memberdef kind="function" id="namespace1_1a5024a7bc323958c7230615f2fcaeaef8" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>1::baz</definition>
<argsstring>args</argsstring>
<name>baz</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="057_caller_graphs.tcl" bodystart="60" bodyend="62"/>
<referencedby refid="namespace1_1a4a8285288ee1994ac886e2039777339e" compoundref="057__caller__graphs_8tcl" startline="75" endline="78">test1</referencedby>
<referencedby refid="namespace1_1a11615154d3c207ed4106dd0bcb0639e8" compoundref="057__caller__graphs_8tcl" startline="91" endline="94">test5</referencedby>
</memberdef>
<memberdef kind="function" id="namespace1_1ad58c8f16ad5f12178c71ca988865bb58" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>1::bar</definition>
<argsstring>args</argsstring>
<name>bar</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="057_caller_graphs.tcl" bodystart="66" bodyend="68"/>
<referencedby refid="namespace1_1ae1e88bb7ddd332348d7e29ac4a211b00" compoundref="057__caller__graphs_8tcl" startline="79" endline="82">test2</referencedby>
</memberdef>
<memberdef kind="function" id="namespace1_1a4a8285288ee1994ac886e2039777339e" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>1::test1</definition>
<argsstring>args</argsstring>
<name>test1</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="057_caller_graphs.tcl" bodystart="75" bodyend="78"/>
<references refid="namespace1_1a5024a7bc323958c7230615f2fcaeaef8" compoundref="057__caller__graphs_8tcl" startline="60" endline="62">baz</references>
</memberdef>
<memberdef kind="function" id="namespace1_1ae1e88bb7ddd332348d7e29ac4a211b00" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>1::test2</definition>
<argsstring>args</argsstring>
<name>test2</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="057_caller_graphs.tcl" bodystart="79" bodyend="82"/>
<references refid="namespace1_1ad58c8f16ad5f12178c71ca988865bb58" compoundref="057__caller__graphs_8tcl" startline="66" endline="68">bar</references>
</memberdef>
<memberdef kind="function" id="namespace1_1a9722420639306872cea2593b83028a45" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>1::test3</definition>
<argsstring>args</argsstring>
<name>test3</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="057_caller_graphs.tcl" bodystart="83" bodyend="86"/>
<references refid="057__caller__graphs_8tcl_1ae4e1c2bb3adfdfbb71f52de84a8285b0" compoundref="057__caller__graphs_8tcl" startline="63" endline="65">bar</references>
</memberdef>
<memberdef kind="function" id="namespace1_1addc9b30656419de5e2651e27a013db29" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>1::test4</definition>
<argsstring>args</argsstring>
<name>test4</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="057_caller_graphs.tcl" bodystart="87" bodyend="90"/>
<references refid="namespace1_1_11_1acebecc4cb718010d00c3c150158b75ab" compoundref="057__caller__graphs_8tcl" startline="69" endline="71">1::1::bar</references>
</memberdef>
<memberdef kind="function" id="namespace1_1a11615154d3c207ed4106dd0bcb0639e8" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>1::test5</definition>
<argsstring>args</argsstring>
<name>test5</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="057_caller_graphs.tcl" bodystart="91" bodyend="94"/>
<references refid="namespace1_1a5024a7bc323958c7230615f2fcaeaef8" compoundref="057__caller__graphs_8tcl" startline="60" endline="62">baz</references>
</memberdef>
</sectiondef>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<location file="[generated]" line="1" column="1"/>
</compounddef>
</doxygen>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="">
<compounddef id="namespace1_1_11" kind="namespace">
<compoundname>1::1</compoundname>
<innernamespace refid="namespace1_1_11_1_11">1::1::1</innernamespace>
<sectiondef kind="func">
<memberdef kind="function" id="namespace1_1_11_1acebecc4cb718010d00c3c150158b75ab" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>1::1::bar</definition>
<argsstring>args</argsstring>
<name>bar</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="057_caller_graphs.tcl" bodystart="69" bodyend="71"/>
<referencedby refid="namespace1_1addc9b30656419de5e2651e27a013db29" compoundref="057__caller__graphs_8tcl" startline="87" endline="90">1::test4</referencedby>
</memberdef>
</sectiondef>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<location file="[generated]" line="1" column="1"/>
</compounddef>
</doxygen>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="">
<compounddef id="namespace1_1_11_1_11" kind="namespace">
<compoundname>1::1::1</compoundname>
<sectiondef kind="func">
<memberdef kind="function" id="namespace1_1_11_1_11_1aa604df053f7ebe36205d1a5675459b96" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>1::1::1::bar</definition>
<argsstring>args</argsstring>
<name>bar</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="057_caller_graphs.tcl" bodystart="72" bodyend="74"/>
</memberdef>
</sectiondef>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<location file="057_caller_graphs.tcl" line="56" column="1"/>
</compounddef>
</doxygen>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="">
<compounddef id="namespace2" kind="namespace">
<compoundname>2</compoundname>
<innernamespace refid="namespace2_1_12">2::2</innernamespace>
<sectiondef kind="func">
<memberdef kind="function" id="namespace2_1a2839d9dea7f0d08f48958c3fc0cd00d3" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>2::next</definition>
<argsstring>args</argsstring>
<name>next</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="057_caller_graphs.tcl" bodystart="104" bodyend="112"/>
<references refid="namespace2_1_12_1aceefa876cf364f44da1f523d3f7b0649" compoundref="057__caller__graphs_8tcl" startline="113" endline="116">2::2::next</references>
<referencedby refid="057__caller__graphs_8tcl_1a3f808a00e1b937978455d707851ab33a" compoundref="057__caller__graphs_8tcl" startline="100" endline="103">next</referencedby>
<referencedby refid="namespace2_1_12_1_12_1_12_1_12_1ac07f64c62783fd8b44317389b4a711f8" compoundref="057__caller__graphs_8tcl" startline="125" endline="128">2::2::2::2::2::next</referencedby>
</memberdef>
</sectiondef>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<location file="[generated]" line="1" column="1"/>
</compounddef>
</doxygen>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="">
<compounddef id="namespace2_1_12" kind="namespace">
<compoundname>2::2</compoundname>
<innernamespace refid="namespace2_1_12_1_12">2::2::2</innernamespace>
<sectiondef kind="func">
<memberdef kind="function" id="namespace2_1_12_1aceefa876cf364f44da1f523d3f7b0649" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>2::2::next</definition>
<argsstring>args</argsstring>
<name>next</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="057_caller_graphs.tcl" bodystart="113" bodyend="116"/>
<references refid="namespace2_1_12_1_12_1a85524e2015e377d433cd8384335c11d6" compoundref="057__caller__graphs_8tcl" startline="117" endline="120">2::2::2::next</references>
<referencedby refid="namespace2_1a2839d9dea7f0d08f48958c3fc0cd00d3" compoundref="057__caller__graphs_8tcl" startline="104" endline="112">2::next</referencedby>
</memberdef>
</sectiondef>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<location file="[generated]" line="1" column="1"/>
</compounddef>
</doxygen>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="">
<compounddef id="namespace2_1_12_1_12" kind="namespace">
<compoundname>2::2::2</compoundname>
<innernamespace refid="namespace2_1_12_1_12_1_12">2::2::2::2</innernamespace>
<sectiondef kind="func">
<memberdef kind="function" id="namespace2_1_12_1_12_1a85524e2015e377d433cd8384335c11d6" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>2::2::2::next</definition>
<argsstring>args</argsstring>
<name>next</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="057_caller_graphs.tcl" bodystart="117" bodyend="120"/>
<references refid="namespace2_1_12_1_12_1_12_1a3ea6e2ce66f4a9c30009852e4c7da2fe" compoundref="057__caller__graphs_8tcl" startline="121" endline="124">2::2::2::2::next</references>
<referencedby refid="namespace2_1_12_1aceefa876cf364f44da1f523d3f7b0649" compoundref="057__caller__graphs_8tcl" startline="113" endline="116">2::2::next</referencedby>
</memberdef>
</sectiondef>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<location file="[generated]" line="1" column="1"/>
</compounddef>
</doxygen>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="">
<compounddef id="namespace2_1_12_1_12_1_12" kind="namespace">
<compoundname>2::2::2::2</compoundname>
<innernamespace refid="namespace2_1_12_1_12_1_12_1_12">2::2::2::2::2</innernamespace>
<sectiondef kind="func">
<memberdef kind="function" id="namespace2_1_12_1_12_1_12_1a3ea6e2ce66f4a9c30009852e4c7da2fe" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>2::2::2::2::next</definition>
<argsstring>args</argsstring>
<name>next</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="057_caller_graphs.tcl" bodystart="121" bodyend="124"/>
<references refid="namespace2_1_12_1_12_1_12_1_12_1ac07f64c62783fd8b44317389b4a711f8" compoundref="057__caller__graphs_8tcl" startline="125" endline="128">2::2::2::2::2::next</references>
<referencedby refid="namespace2_1_12_1_12_1a85524e2015e377d433cd8384335c11d6" compoundref="057__caller__graphs_8tcl" startline="117" endline="120">2::2::2::next</referencedby>
</memberdef>
</sectiondef>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<location file="[generated]" line="1" column="1"/>
</compounddef>
</doxygen>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="">
<compounddef id="namespace2_1_12_1_12_1_12_1_12" kind="namespace">
<compoundname>2::2::2::2::2</compoundname>
<sectiondef kind="func">
<memberdef kind="function" id="namespace2_1_12_1_12_1_12_1_12_1ac07f64c62783fd8b44317389b4a711f8" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>2::2::2::2::2::next</definition>
<argsstring>args</argsstring>
<name>next</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="057_caller_graphs.tcl" bodystart="125" bodyend="128"/>
<references refid="namespace2_1a2839d9dea7f0d08f48958c3fc0cd00d3" compoundref="057__caller__graphs_8tcl" startline="104" endline="112">2::next</references>
<referencedby refid="namespace2_1_12_1_12_1_12_1a3ea6e2ce66f4a9c30009852e4c7da2fe" compoundref="057__caller__graphs_8tcl" startline="121" endline="124">2::2::2::2::next</referencedby>
</memberdef>
</sectiondef>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<location file="057_caller_graphs.tcl" line="99" column="1"/>
</compounddef>
</doxygen>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="">
<compounddef id="namespacebar" kind="namespace">
<compoundname>bar</compoundname>
<sectiondef kind="func">
<memberdef kind="function" id="namespacebar_1aa1678a9adb588c0b91b118de7cc38ddb" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>bar::slave</definition>
<argsstring/>
<name>slave</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="057_caller_graphs.tcl" bodystart="27" bodyend="33"/>
<references refid="namespacebar_1a3426cd3a2eebcffa0dc333bcf5e2fe5e" compoundref="057__caller__graphs_8tcl" startline="34" endline="37">baz</references>
<referencedby refid="namespacefoo_1a265acdcaea6da32c3bbd9afb5d0e32a4" compoundref="057__caller__graphs_8tcl" startline="42" endline="46">foo::master</referencedby>
</memberdef>
<memberdef kind="function" id="namespacebar_1a3426cd3a2eebcffa0dc333bcf5e2fe5e" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>bar::baz</definition>
<argsstring/>
<name>baz</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="057_caller_graphs.tcl" bodystart="34" bodyend="37"/>
<references refid="namespacebar_1a88879545dee287d377e638b87cdf6dd7" compoundref="057__caller__graphs_8tcl" startline="38" endline="40">bazbaz</references>
<referencedby refid="namespacebar_1aa1678a9adb588c0b91b118de7cc38ddb" compoundref="057__caller__graphs_8tcl" startline="27" endline="33">slave</referencedby>
</memberdef>
<memberdef kind="function" id="namespacebar_1a88879545dee287d377e638b87cdf6dd7" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>bar::bazbaz</definition>
<argsstring/>
<name>bazbaz</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="057_caller_graphs.tcl" bodystart="38" bodyend="40"/>
<referencedby refid="namespacebar_1a3426cd3a2eebcffa0dc333bcf5e2fe5e" compoundref="057__caller__graphs_8tcl" startline="34" endline="37">baz</referencedby>
</memberdef>
</sectiondef>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<location file="057_caller_graphs.tcl" line="26" column="1"/>
</compounddef>
</doxygen>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="">
<compounddef id="namespacefoo" kind="namespace">
<compoundname>foo</compoundname>
<sectiondef kind="func">
<memberdef kind="function" id="namespacefoo_1a265acdcaea6da32c3bbd9afb5d0e32a4" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>foo::master</definition>
<argsstring/>
<name>master</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="057_caller_graphs.tcl" bodystart="42" bodyend="46"/>
<references refid="namespacebar_1aa1678a9adb588c0b91b118de7cc38ddb" compoundref="057__caller__graphs_8tcl" startline="27" endline="33">bar::slave</references>
</memberdef>
</sectiondef>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<location file="057_caller_graphs.tcl" line="41" column="1"/>
</compounddef>
</doxygen>
#// objective: test for completeness and correctness of references/referencedby relations
#// check: 057__caller__graphs_8tcl.xml
#// check: namespacebar.xml
#// check: namespacefoo.xml
#// check: namespace1.xml
#// check: namespace1_1_11.xml
#// check: namespace1_1_11_1_11.xml
#// check: namespace2.xml
#// check: namespace2_1_12.xml
#// check: namespace2_1_12_1_12.xml
#// check: namespace2_1_12_1_12_1_12.xml
#// check: namespace2_1_12_1_12_1_12_1_12.xml
#// config: EXTRACT_ALL = yes
#// config: INLINE_SOURCES = no
#// config: REFERENCED_BY_RELATION = yes
#// config: REFERENCES_RELATION = yes
# config: HAVE_DOT = yes
# config: CALLER_GRAPH = yes
# config: CALL_GRAPH = yes
# config: GENERATE_HTML = yes
# This is a stripped down example from my code.
# Doxygen 1.8.7 generates the correct relations (xml)
# but caller graphs will be incomplete.
# It does not generate any relations at all if INLINE_SOURCES = no.
namespace eval bar {}
proc bar::slave { } {
array set info [info frame 0]; puts -nonewline ->$info(proc)
if {1} then {
bar::baz
}
return
}
proc bar::baz {} {
array set info [info frame 0]; puts -nonewline ->$info(proc)
bar::bazbaz
}
proc bar::bazbaz {} {
array set info [info frame 0]; puts -nonewline ->$info(proc)
}
namespace eval foo {}
proc foo::master { } {
array set info [info frame 0]; puts -nonewline $info(proc)
bar::slave
return
}
#
# now we check tcl's rules: from the help
# NAME RESOLUTION
#... Command names are also always resolved by looking in the current
#namespace first. If not found there, they are searched for in every namespace on
#the current namespace's command path (which is empty by default). If not found
#there, command names are looked up in the global namespace (or, failing that,
#are processed by the unknown command.) ...
#
namespace eval ::1::1::1 {}
proc ::baz args {
array set info [info frame 0]; puts -nonewline ->$info(proc)
}
proc ::1::baz args {
array set info [info frame 0]; puts -nonewline ->$info(proc)
}
proc ::bar args {
array set info [info frame 0]; puts -nonewline ->$info(proc)
}
proc ::1::bar args {
array set info [info frame 0]; puts -nonewline ->$info(proc)
}
proc ::1::1::bar args {
array set info [info frame 0]; puts -nonewline ->$info(proc)
}
proc ::1::1::1::bar args {
array set info [info frame 0]; puts -nonewline ->$info(proc)
}
proc ::1::test1 args {
array set info [info frame 0]; puts -nonewline $info(proc)
baz
}
proc ::1::test2 args {
array set info [info frame 0]; puts -nonewline $info(proc)
bar
}
proc ::1::test3 args {
array set info [info frame 0]; puts -nonewline $info(proc)
::bar
}
proc ::1::test4 args {
array set info [info frame 0]; puts -nonewline $info(proc)
1::bar
}
proc ::1::test5 args {
array set info [info frame 0]; puts -nonewline $info(proc)
1::baz
}
#
# funny example, do you see the infinite loop?
# we stop before the interpreter crashes
set ::countdown 10
namespace eval ::2::2::2::2::2 {}
proc ::next args {
array set info [info frame 0]; puts $info(proc)
2::next
}
proc ::2::next args {
array set info [info frame 0]; puts $info(proc)
incr ::countdown -1
if {$::countdown>0} then {
2::next
} else {
puts "stop after 10 rounds."
}
}
proc ::2::2::next args {
array set info [info frame 0]; puts $info(proc)
2::next
}
proc ::2::2::2::next args {
array set info [info frame 0]; puts $info(proc)
2::next
}
proc ::2::2::2::2::next args {
array set info [info frame 0]; puts $info(proc)
2::next
}
proc ::2::2::2::2::2::next args {
array set info [info frame 0]; puts $info(proc)
2::next
}
# now, check with tcl what is called
foo::master
puts ""
foreach proc [lsort [info procs ::1::test?]] {
$proc
puts ""
}
::next
exit
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="">
<compounddef id="058__bracket__recursion_8tcl" kind="file">
<compoundname>058_bracket_recursion.tcl</compoundname>
<sectiondef kind="func">
<memberdef kind="function" id="058__bracket__recursion_8tcl_1aa889853547f65a22ae133cd57ff89601" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>Invoked</definition>
<argsstring>args</argsstring>
<name>Invoked</name>
<briefdescription>
<para>should be reference by every proc below </para>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="058_bracket_recursion.tcl" bodystart="10" bodyend="13"/>
<referencedby refid="058__bracket__recursion_8tcl_1ab08ae027fc5777bc4f0629f1b60b35db" compoundref="058__bracket__recursion_8tcl" startline="22" endline="25">a</referencedby>
<referencedby refid="058__bracket__recursion_8tcl_1a68bdb74c144118d936931c46f75d4b3e" compoundref="058__bracket__recursion_8tcl" startline="28" endline="32">b</referencedby>
<referencedby refid="058__bracket__recursion_8tcl_1ab14f56bc3bd7680490ece4ad7815465f" compoundref="058__bracket__recursion_8tcl" startline="33" endline="37">c</referencedby>
<referencedby refid="058__bracket__recursion_8tcl_1af43f4b1f0064a33b2d662af9f06d3a00" compoundref="058__bracket__recursion_8tcl" startline="38" endline="42">d</referencedby>
<referencedby refid="058__bracket__recursion_8tcl_1aff65a51a703804e0ad1adbcfd76c86f8" compoundref="058__bracket__recursion_8tcl" startline="43" endline="46">e</referencedby>
<referencedby refid="058__bracket__recursion_8tcl_1af6830d2c644b45088ea8f1f74a46b778" compoundref="058__bracket__recursion_8tcl" startline="47" endline="50">f</referencedby>
<referencedby refid="058__bracket__recursion_8tcl_1af08b4b5bfa9edf0b0a7dee1c2b2c29e0" compoundref="058__bracket__recursion_8tcl" startline="51" endline="55">g</referencedby>
<referencedby refid="058__bracket__recursion_8tcl_1af96fd0966e32a310a0778d2e5c357700" compoundref="058__bracket__recursion_8tcl" startline="56" endline="59">h</referencedby>
<referencedby refid="058__bracket__recursion_8tcl_1a8c90afd4641b25be86bd09983c3cbee0" compoundref="058__bracket__recursion_8tcl" startline="64" endline="68">i</referencedby>
<referencedby refid="058__bracket__recursion_8tcl_1a2aaa92757686acea102cba3475f0c13b" compoundref="058__bracket__recursion_8tcl" startline="69" endline="73">j</referencedby>
<referencedby refid="058__bracket__recursion_8tcl_1a20363f854eb4098a446733d63d34dbc1" compoundref="058__bracket__recursion_8tcl" startline="74" endline="77">k</referencedby>
<referencedby refid="058__bracket__recursion_8tcl_1aff56f84b49947b84b2a304f51cf8e678" compoundref="058__bracket__recursion_8tcl" startline="78" endline="81">l</referencedby>
<referencedby refid="058__bracket__recursion_8tcl_1a78d127e8bda64d4471ac811ad512fbd9" compoundref="058__bracket__recursion_8tcl" startline="82" endline="85">m</referencedby>
<referencedby refid="058__bracket__recursion_8tcl_1acdde3cd86eb2421ce8dbb2e85227d368" compoundref="058__bracket__recursion_8tcl" startline="86" endline="89">n</referencedby>
<referencedby refid="058__bracket__recursion_8tcl_1a495e7a4ede0831107e9d435080a7c268" compoundref="058__bracket__recursion_8tcl" startline="90" endline="94">o</referencedby>
<referencedby refid="058__bracket__recursion_8tcl_1a15229b450f26d8fa1c10bea4f3279f4d" compoundref="058__bracket__recursion_8tcl" startline="102" endline="107">p</referencedby>
<referencedby refid="058__bracket__recursion_8tcl_1ab678a0a9a7e94bce5b17141f40220d88" compoundref="058__bracket__recursion_8tcl" startline="108" endline="114">q</referencedby>
<referencedby refid="058__bracket__recursion_8tcl_1a0a0bd3dc69dd06934c4e6362155e0ace" compoundref="058__bracket__recursion_8tcl" startline="115" endline="120">r</referencedby>
<referencedby refid="058__bracket__recursion_8tcl_1a011c73f2dbb87635a3b4206c72355f6e" compoundref="058__bracket__recursion_8tcl" startline="121" endline="126">s</referencedby>
<referencedby refid="058__bracket__recursion_8tcl_1a69e959f6901827e4d8271aeaa5fba0fc" compoundref="058__bracket__recursion_8tcl" startline="128" endline="131">t</referencedby>
</memberdef>
<memberdef kind="function" id="058__bracket__recursion_8tcl_1a3f55465410c57ed00ab28827a741b1c3" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>NotInvoked</definition>
<argsstring>args</argsstring>
<name>NotInvoked</name>
<briefdescription>
<para>must not be reference by every proc below </para>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="058_bracket_recursion.tcl" bodystart="16" bodyend="19"/>
</memberdef>
<memberdef kind="function" id="058__bracket__recursion_8tcl_1ab08ae027fc5777bc4f0629f1b60b35db" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>a</definition>
<argsstring>args</argsstring>
<name>a</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="058_bracket_recursion.tcl" bodystart="22" bodyend="25"/>
<references refid="058__bracket__recursion_8tcl_1aa889853547f65a22ae133cd57ff89601" compoundref="058__bracket__recursion_8tcl" startline="10" endline="13">Invoked</references>
</memberdef>
<memberdef kind="function" id="058__bracket__recursion_8tcl_1a68bdb74c144118d936931c46f75d4b3e" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>b</definition>
<argsstring>args</argsstring>
<name>b</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="058_bracket_recursion.tcl" bodystart="28" bodyend="32"/>
<references refid="058__bracket__recursion_8tcl_1aa889853547f65a22ae133cd57ff89601" compoundref="058__bracket__recursion_8tcl" startline="10" endline="13">Invoked</references>
</memberdef>
<memberdef kind="function" id="058__bracket__recursion_8tcl_1ab14f56bc3bd7680490ece4ad7815465f" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>c</definition>
<argsstring>args</argsstring>
<name>c</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="058_bracket_recursion.tcl" bodystart="33" bodyend="37"/>
<references refid="058__bracket__recursion_8tcl_1aa889853547f65a22ae133cd57ff89601" compoundref="058__bracket__recursion_8tcl" startline="10" endline="13">Invoked</references>
</memberdef>
<memberdef kind="function" id="058__bracket__recursion_8tcl_1af43f4b1f0064a33b2d662af9f06d3a00" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>d</definition>
<argsstring>args</argsstring>
<name>d</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="058_bracket_recursion.tcl" bodystart="38" bodyend="42"/>
<references refid="058__bracket__recursion_8tcl_1aa889853547f65a22ae133cd57ff89601" compoundref="058__bracket__recursion_8tcl" startline="10" endline="13">Invoked</references>
</memberdef>
<memberdef kind="function" id="058__bracket__recursion_8tcl_1aff65a51a703804e0ad1adbcfd76c86f8" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>e</definition>
<argsstring>args</argsstring>
<name>e</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="058_bracket_recursion.tcl" bodystart="43" bodyend="46"/>
<references refid="058__bracket__recursion_8tcl_1aa889853547f65a22ae133cd57ff89601" compoundref="058__bracket__recursion_8tcl" startline="10" endline="13">Invoked</references>
</memberdef>
<memberdef kind="function" id="058__bracket__recursion_8tcl_1af6830d2c644b45088ea8f1f74a46b778" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>f</definition>
<argsstring>args</argsstring>
<name>f</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="058_bracket_recursion.tcl" bodystart="47" bodyend="50"/>
<references refid="058__bracket__recursion_8tcl_1aa889853547f65a22ae133cd57ff89601" compoundref="058__bracket__recursion_8tcl" startline="10" endline="13">Invoked</references>
</memberdef>
<memberdef kind="function" id="058__bracket__recursion_8tcl_1af08b4b5bfa9edf0b0a7dee1c2b2c29e0" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>g</definition>
<argsstring>args</argsstring>
<name>g</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="058_bracket_recursion.tcl" bodystart="51" bodyend="55"/>
<references refid="058__bracket__recursion_8tcl_1aa889853547f65a22ae133cd57ff89601" compoundref="058__bracket__recursion_8tcl" startline="10" endline="13">Invoked</references>
</memberdef>
<memberdef kind="function" id="058__bracket__recursion_8tcl_1af96fd0966e32a310a0778d2e5c357700" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>h</definition>
<argsstring>args</argsstring>
<name>h</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="058_bracket_recursion.tcl" bodystart="56" bodyend="59"/>
<references refid="058__bracket__recursion_8tcl_1aa889853547f65a22ae133cd57ff89601" compoundref="058__bracket__recursion_8tcl" startline="10" endline="13">Invoked</references>
</memberdef>
<memberdef kind="function" id="058__bracket__recursion_8tcl_1a8c90afd4641b25be86bd09983c3cbee0" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>i</definition>
<argsstring>args</argsstring>
<name>i</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="058_bracket_recursion.tcl" bodystart="64" bodyend="68"/>
<references refid="058__bracket__recursion_8tcl_1aa889853547f65a22ae133cd57ff89601" compoundref="058__bracket__recursion_8tcl" startline="10" endline="13">Invoked</references>
</memberdef>
<memberdef kind="function" id="058__bracket__recursion_8tcl_1a2aaa92757686acea102cba3475f0c13b" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>j</definition>
<argsstring>args</argsstring>
<name>j</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="058_bracket_recursion.tcl" bodystart="69" bodyend="73"/>
<references refid="058__bracket__recursion_8tcl_1aa889853547f65a22ae133cd57ff89601" compoundref="058__bracket__recursion_8tcl" startline="10" endline="13">Invoked</references>
</memberdef>
<memberdef kind="function" id="058__bracket__recursion_8tcl_1a20363f854eb4098a446733d63d34dbc1" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>k</definition>
<argsstring>args</argsstring>
<name>k</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="058_bracket_recursion.tcl" bodystart="74" bodyend="77"/>
<references refid="058__bracket__recursion_8tcl_1aa889853547f65a22ae133cd57ff89601" compoundref="058__bracket__recursion_8tcl" startline="10" endline="13">Invoked</references>
</memberdef>
<memberdef kind="function" id="058__bracket__recursion_8tcl_1aff56f84b49947b84b2a304f51cf8e678" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>l</definition>
<argsstring>args</argsstring>
<name>l</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="058_bracket_recursion.tcl" bodystart="78" bodyend="81"/>
<references refid="058__bracket__recursion_8tcl_1aa889853547f65a22ae133cd57ff89601" compoundref="058__bracket__recursion_8tcl" startline="10" endline="13">Invoked</references>
</memberdef>
<memberdef kind="function" id="058__bracket__recursion_8tcl_1a78d127e8bda64d4471ac811ad512fbd9" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>m</definition>
<argsstring>args</argsstring>
<name>m</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="058_bracket_recursion.tcl" bodystart="82" bodyend="85"/>
<references refid="058__bracket__recursion_8tcl_1aa889853547f65a22ae133cd57ff89601" compoundref="058__bracket__recursion_8tcl" startline="10" endline="13">Invoked</references>
</memberdef>
<memberdef kind="function" id="058__bracket__recursion_8tcl_1acdde3cd86eb2421ce8dbb2e85227d368" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>n</definition>
<argsstring>args</argsstring>
<name>n</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="058_bracket_recursion.tcl" bodystart="86" bodyend="89"/>
<references refid="058__bracket__recursion_8tcl_1aa889853547f65a22ae133cd57ff89601" compoundref="058__bracket__recursion_8tcl" startline="10" endline="13">Invoked</references>
</memberdef>
<memberdef kind="function" id="058__bracket__recursion_8tcl_1a495e7a4ede0831107e9d435080a7c268" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>o</definition>
<argsstring>args</argsstring>
<name>o</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="058_bracket_recursion.tcl" bodystart="90" bodyend="94"/>
<references refid="058__bracket__recursion_8tcl_1aa889853547f65a22ae133cd57ff89601" compoundref="058__bracket__recursion_8tcl" startline="10" endline="13">Invoked</references>
</memberdef>
<memberdef kind="function" id="058__bracket__recursion_8tcl_1a8a57650834f5708d404e9c386b2edf87" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>$NotInvoked</definition>
<argsstring>args</argsstring>
<name>$NotInvoked</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="058_bracket_recursion.tcl" bodystart="98" bodyend="101"/>
</memberdef>
<memberdef kind="function" id="058__bracket__recursion_8tcl_1a15229b450f26d8fa1c10bea4f3279f4d" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>p</definition>
<argsstring>args</argsstring>
<name>p</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="058_bracket_recursion.tcl" bodystart="102" bodyend="107"/>
<references refid="058__bracket__recursion_8tcl_1aa889853547f65a22ae133cd57ff89601" compoundref="058__bracket__recursion_8tcl" startline="10" endline="13">Invoked</references>
</memberdef>
<memberdef kind="function" id="058__bracket__recursion_8tcl_1ab678a0a9a7e94bce5b17141f40220d88" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>q</definition>
<argsstring>args</argsstring>
<name>q</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="058_bracket_recursion.tcl" bodystart="108" bodyend="114"/>
<references refid="058__bracket__recursion_8tcl_1aa889853547f65a22ae133cd57ff89601" compoundref="058__bracket__recursion_8tcl" startline="10" endline="13">Invoked</references>
</memberdef>
<memberdef kind="function" id="058__bracket__recursion_8tcl_1a0a0bd3dc69dd06934c4e6362155e0ace" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>r</definition>
<argsstring>args</argsstring>
<name>r</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="058_bracket_recursion.tcl" bodystart="115" bodyend="120"/>
<references refid="058__bracket__recursion_8tcl_1aa889853547f65a22ae133cd57ff89601" compoundref="058__bracket__recursion_8tcl" startline="10" endline="13">Invoked</references>
</memberdef>
<memberdef kind="function" id="058__bracket__recursion_8tcl_1a011c73f2dbb87635a3b4206c72355f6e" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>s</definition>
<argsstring>args</argsstring>
<name>s</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="058_bracket_recursion.tcl" bodystart="121" bodyend="126"/>
<references refid="058__bracket__recursion_8tcl_1aa889853547f65a22ae133cd57ff89601" compoundref="058__bracket__recursion_8tcl" startline="10" endline="13">Invoked</references>
</memberdef>
<memberdef kind="function" id="058__bracket__recursion_8tcl_1a69e959f6901827e4d8271aeaa5fba0fc" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
<type/>
<definition>t</definition>
<argsstring>args</argsstring>
<name>t</name>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<inbodydescription>
</inbodydescription>
<location file="058_bracket_recursion.tcl" bodystart="128" bodyend="131"/>
<references refid="058__bracket__recursion_8tcl_1aa889853547f65a22ae133cd57ff89601" compoundref="058__bracket__recursion_8tcl" startline="10" endline="13">Invoked</references>
</memberdef>
</sectiondef>
<briefdescription>
</briefdescription>
<detaileddescription>
</detaileddescription>
<location file="058_bracket_recursion.tcl"/>
</compounddef>
</doxygen>
#// objective: tests processing of commands inside brackets [], only references/referencedby relations are relevant
#// check: 058__bracket__recursion_8tcl.xml
#// config: REFERENCED_BY_RELATION = yes
#// config: REFERENCES_RELATION = yes
#// config: EXTRACT_ALL = yes
#// config: INLINE_SOURCES = yes
##
# \brief should be reference by every proc below
proc Invoked args {
puts "Procedure \"Invoked\" is invoked indeed. Ok."
return $args
}
##
# \brief must not be reference by every proc below
proc NotInvoked args {
puts "Procedure \"NotInvoked\" is invoked. Not Ok!"
return $args
}
#
# check if call references work at all
proc a args {
Invoked NotInvoked
return
}
#
# check brackets with various quoting, bracing
proc b args {
set r [Invoked]
set r [list \[NotInvoked \]]
return
}
proc c args {
set r \{[Invoked]\}
set r {[NotInvoked]}
return
}
proc d args {
set r "[Invoked]"
set r "\[NotInvoked \]"
return
}
proc e args {
set r [list \[NotInvoked [Invoked]\]]
return
}
proc f args {
set r [list [Invoked \[NotInvoked \]]]
return
}
proc g args {
set r "{[Invoked]}"
set r "{\[NotInvoked \]}"
return
}
proc h args {
[Invoked set] r {[NotInvoked]}
return
}
# check brackets in tcl commands containing script arguments
#
# example generated according to
# https://groups.google.com/d/msg/comp.lang.tcl/G5-mc3GiIyY/e-AVD9t7xMkJ
proc i args {
foreach item [Invoked] {
return
}
}
proc j args {
foreach [Invoked item] [list one two three] {
}
return
}
proc k args {
while {[Invoked 0]} {
}
}
proc l args {
for {} {[Invoked 0]} {} {
}
}
proc m args {
if {[Invoked 1]} {
}
}
proc n args {
if [Invoked 1] {
}
}
proc o args {
if {0} {
} elseif {[Invoked 0]} {
}
}
# these are really nasty examples
# they shows, that the condition argument may not be parsed as a script
set NotInvoked \$NotInvoked
proc $NotInvoked args {
puts "Procedure \"\$NotInvoked\" is invoked. Not Ok!"
return $args
}
proc p args {
set NotInvoked \$NotInvoked
if {$NotInvoked eq [Invoked 1]} {
}
return
}
proc q args {
set NotInvoked \$NotInvoked
if {0} {
} elseif {$NotInvoked eq [Invoked 1]} {
}
return
}
proc r args {
set NotInvoked \$NotInvoked
while {$NotInvoked eq [Invoked 1]} {
}
return
}
proc s args {
set NotInvoked \$NotInvoked
for {} {$NotInvoked eq [Invoked 1]} {} {
}
return
}
# dangling open brackets should not confuse the scanner
proc t args {
set foo ]]]][Invoked]
return
}
#
# call all single letter procs
# let tcl check what is called and what is not called
foreach p [info procs ?] {
puts "Check procedure \"$p\""
$p
}
exit
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