Commit e835d4b2 authored by Sergio Oller's avatar Sergio Oller Committed by Dimitri van Heesch

Bug 707641 - `FILTER_SOURCE_FILES=YES` required to build CALL_GRAPHS

https://bugzilla.gnome.org/show_bug.cgi?id=707641

Add references if the file is filtered, as the parser
does not know whether we are insideBody or not.
parent 54f60c11
...@@ -29,7 +29,8 @@ class Definition; ...@@ -29,7 +29,8 @@ class Definition;
void parseCCode(CodeOutputInterface &,const char *,const QCString &, void parseCCode(CodeOutputInterface &,const char *,const QCString &,
SrcLangExt lang, bool isExample, const char *exName,FileDef *fd, SrcLangExt lang, bool isExample, const char *exName,FileDef *fd,
int startLine,int endLine,bool inlineFragment, int startLine,int endLine,bool inlineFragment,
MemberDef *memberDef,bool showLineNumbers,Definition *searchCtx); MemberDef *memberDef,bool showLineNumbers,Definition *searchCtx,
bool collectXRefs);
void resetCCodeParserState(); void resetCCodeParserState();
void codeFreeScanner(); void codeFreeScanner();
......
...@@ -123,6 +123,7 @@ static bool g_lexInit = FALSE; ...@@ -123,6 +123,7 @@ static bool g_lexInit = FALSE;
static QStack<int> g_classScopeLengthStack; static QStack<int> g_classScopeLengthStack;
static Definition *g_searchCtx; static Definition *g_searchCtx;
static bool g_collectXRefs;
// context for an Objective-C method call // context for an Objective-C method call
struct ObjCCallCtx struct ObjCCallCtx
...@@ -885,7 +886,7 @@ static bool getLinkInScope(const QCString &c, // scope ...@@ -885,7 +886,7 @@ static bool getLinkInScope(const QCString &c, // scope
// g_currentDefinition,g_currentMemberDef,g_insideBody); // g_currentDefinition,g_currentMemberDef,g_insideBody);
if (g_currentDefinition && g_currentMemberDef && if (g_currentDefinition && g_currentMemberDef &&
md!=g_currentMemberDef && g_insideBody) md!=g_currentMemberDef && g_insideBody && g_collectXRefs)
{ {
addDocCrossReference(g_currentMemberDef,md); addDocCrossReference(g_currentMemberDef,md);
} }
...@@ -1018,7 +1019,8 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,const char *clName ...@@ -1018,7 +1019,8 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,const char *clName
Definition *d = md->getOuterScope()==Doxygen::globalScope ? Definition *d = md->getOuterScope()==Doxygen::globalScope ?
md->getFileDef() : md->getOuterScope(); md->getFileDef() : md->getOuterScope();
if (md->getGroupDef()) d = md->getGroupDef(); if (md->getGroupDef()) d = md->getGroupDef();
if (d && d->isLinkable() && md->isLinkable() && g_currentMemberDef) if (d && d->isLinkable() && md->isLinkable() &&
g_currentMemberDef && g_collectXRefs)
{ {
addDocCrossReference(g_currentMemberDef,md); addDocCrossReference(g_currentMemberDef,md);
} }
...@@ -1071,7 +1073,7 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,const char *clName ...@@ -1071,7 +1073,7 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,const char *clName
} }
writeMultiLineCodeLink(ol,md,text); writeMultiLineCodeLink(ol,md,text);
addToSearchIndex(clName); addToSearchIndex(clName);
if (g_currentMemberDef) if (g_currentMemberDef && g_collectXRefs)
{ {
addDocCrossReference(g_currentMemberDef,md); addDocCrossReference(g_currentMemberDef,md);
} }
...@@ -1127,7 +1129,7 @@ static bool generateClassMemberLink(CodeOutputInterface &ol,MemberDef *xmd,const ...@@ -1127,7 +1129,7 @@ static bool generateClassMemberLink(CodeOutputInterface &ol,MemberDef *xmd,const
{ {
// add usage reference // add usage reference
if (g_currentDefinition && g_currentMemberDef && if (g_currentDefinition && g_currentMemberDef &&
/*xmd!=g_currentMemberDef &&*/ g_insideBody) /*xmd!=g_currentMemberDef &&*/ g_insideBody && g_collectXRefs)
{ {
addDocCrossReference(g_currentMemberDef,xmd); addDocCrossReference(g_currentMemberDef,xmd);
} }
...@@ -1504,7 +1506,7 @@ static void writeObjCMethodCall(ObjCCallCtx *ctx) ...@@ -1504,7 +1506,7 @@ static void writeObjCMethodCall(ObjCCallCtx *ctx)
if (ctx->method && ctx->method->isLinkable()) if (ctx->method && ctx->method->isLinkable())
{ {
writeMultiLineCodeLink(*g_code,ctx->method,pName->data()); writeMultiLineCodeLink(*g_code,ctx->method,pName->data());
if (g_currentMemberDef) if (g_currentMemberDef && g_collectXRefs)
{ {
addDocCrossReference(g_currentMemberDef,ctx->method); addDocCrossReference(g_currentMemberDef,ctx->method);
} }
...@@ -1583,7 +1585,7 @@ static void writeObjCMethodCall(ObjCCallCtx *ctx) ...@@ -1583,7 +1585,7 @@ static void writeObjCMethodCall(ObjCCallCtx *ctx)
else if (ctx->objectVar && ctx->objectVar->isLinkable()) // object is class variable else if (ctx->objectVar && ctx->objectVar->isLinkable()) // object is class variable
{ {
writeMultiLineCodeLink(*g_code,ctx->objectVar,pObject->data()); writeMultiLineCodeLink(*g_code,ctx->objectVar,pObject->data());
if (g_currentMemberDef) if (g_currentMemberDef && g_collectXRefs)
{ {
addDocCrossReference(g_currentMemberDef,ctx->objectVar); addDocCrossReference(g_currentMemberDef,ctx->objectVar);
} }
...@@ -3537,9 +3539,10 @@ void resetCCodeParserState() ...@@ -3537,9 +3539,10 @@ void resetCCodeParserState()
} }
void parseCCode(CodeOutputInterface &od,const char *className,const QCString &s, void parseCCode(CodeOutputInterface &od,const char *className,const QCString &s,
SrcLangExt lang,bool exBlock, const char *exName,FileDef *fd, SrcLangExt lang,bool exBlock, const char *exName,FileDef *fd,
int startLine,int endLine,bool inlineFragment, int startLine,int endLine,bool inlineFragment,
MemberDef *memberDef,bool showLineNumbers,Definition *searchCtx) MemberDef *memberDef,bool showLineNumbers,Definition *searchCtx,
bool collectXRefs)
{ {
//printf("***parseCode() exBlock=%d exName=%s fd=%p className=%s searchCtx=%s\n", //printf("***parseCode() exBlock=%d exName=%s fd=%p className=%s searchCtx=%s\n",
// exBlock,exName,fd,className,searchCtx?searchCtx->name().data():"<none>"); // exBlock,exName,fd,className,searchCtx?searchCtx->name().data():"<none>");
...@@ -3555,6 +3558,7 @@ void parseCCode(CodeOutputInterface &od,const char *className,const QCString &s, ...@@ -3555,6 +3558,7 @@ void parseCCode(CodeOutputInterface &od,const char *className,const QCString &s,
g_currentFontClass = 0; g_currentFontClass = 0;
g_needsTermination = FALSE; g_needsTermination = FALSE;
g_searchCtx = searchCtx; g_searchCtx = searchCtx;
g_collectXRefs = collectXRefs;
g_inFunctionTryBlock = FALSE; g_inFunctionTryBlock = FALSE;
if (endLine!=-1) if (endLine!=-1)
g_inputLines = endLine+1; g_inputLines = endLine+1;
......
...@@ -870,7 +870,8 @@ void DBusXMLScanner::parseCode(CodeOutputInterface & /* codeOutIntf */, ...@@ -870,7 +870,8 @@ void DBusXMLScanner::parseCode(CodeOutputInterface & /* codeOutIntf */,
bool /* inlineFragment */, bool /* inlineFragment */,
MemberDef * /* memberDef */, MemberDef * /* memberDef */,
bool /*showLineNumbers*/, bool /*showLineNumbers*/,
Definition * /* searchCtx */) Definition * /* searchCtx */,
bool /*collectXRefs*/ )
{ } { }
void DBusXMLScanner::resetCodeParserState() void DBusXMLScanner::resetCodeParserState()
......
...@@ -51,7 +51,8 @@ public: ...@@ -51,7 +51,8 @@ public:
bool inlineFragment=FALSE, bool inlineFragment=FALSE,
MemberDef *memberDef=0, MemberDef *memberDef=0,
bool showLineNumbers=TRUE, bool showLineNumbers=TRUE,
Definition *searchCtx=0 Definition *searchCtx=0,
bool collectXRefs=TRUE
); );
void resetCodeParserState(); void resetCodeParserState();
......
...@@ -807,6 +807,7 @@ void FileDef::writeSource(OutputList &ol,bool sameTu,QStrList &filesInSameTu) ...@@ -807,6 +807,7 @@ void FileDef::writeSource(OutputList &ol,bool sameTu,QStrList &filesInSameTu)
static bool generateTreeView = Config_getBool("GENERATE_TREEVIEW"); static bool generateTreeView = Config_getBool("GENERATE_TREEVIEW");
static bool filterSourceFiles = Config_getBool("FILTER_SOURCE_FILES"); static bool filterSourceFiles = Config_getBool("FILTER_SOURCE_FILES");
static bool latexSourceCode = Config_getBool("LATEX_SOURCE_CODE"); static bool latexSourceCode = Config_getBool("LATEX_SOURCE_CODE");
DevNullCodeDocInterface devNullIntf;
QCString title = m_docname; QCString title = m_docname;
if (!m_fileVersion.isEmpty()) if (!m_fileVersion.isEmpty())
{ {
...@@ -878,10 +879,33 @@ void FileDef::writeSource(OutputList &ol,bool sameTu,QStrList &filesInSameTu) ...@@ -878,10 +879,33 @@ void FileDef::writeSource(OutputList &ol,bool sameTu,QStrList &filesInSameTu)
ParserInterface *pIntf = Doxygen::parserManager->getParser(getDefFileExtension()); ParserInterface *pIntf = Doxygen::parserManager->getParser(getDefFileExtension());
pIntf->resetCodeParserState(); pIntf->resetCodeParserState();
ol.startCodeFragment(); ol.startCodeFragment();
bool needs2PassParsing =
Doxygen::parseSourcesNeeded && // we need to parse (filtered) sources for cross-references
!filterSourceFiles && // but user wants to show sources as-is
!getFileFilter(absFilePath(),TRUE).isEmpty(); // and there is a filter used while parsing
if (needs2PassParsing)
{
// parse code for cross-references only (see bug707641)
pIntf->parseCode(devNullIntf,0,
fileToString(absFilePath(),TRUE,TRUE),
getLanguage(),
FALSE,0,this
);
}
pIntf->parseCode(ol,0, pIntf->parseCode(ol,0,
fileToString(absFilePath(),filterSourceFiles,TRUE), fileToString(absFilePath(),filterSourceFiles,TRUE),
getLanguage(), getLanguage(), // lang
FALSE,0,this FALSE, // isExampleBlock
0, // exampleName
this, // fileDef
-1, // startLine
-1, // endLine
FALSE, // inlineFragment
0, // memberDef
TRUE, // showLineNumbers
0, // searchCtx
!needs2PassParsing // collectXRefs
); );
ol.endCodeFragment(); ol.endCodeFragment();
} }
......
...@@ -27,7 +27,8 @@ class Definition; ...@@ -27,7 +27,8 @@ class Definition;
void parseFortranCode(CodeOutputInterface &,const char *,const QCString &, void parseFortranCode(CodeOutputInterface &,const char *,const QCString &,
bool ,const char *,FileDef *fd, bool ,const char *,FileDef *fd,
int startLine,int endLine,bool inlineFragment, int startLine,int endLine,bool inlineFragment,
MemberDef *memberDef,bool showLineNumbers,Definition *searchCtx); MemberDef *memberDef,bool showLineNumbers,Definition *searchCtx,
bool collectRefs);
void resetFortranCodeParserState(); void resetFortranCodeParserState();
void codeFreeScanner(); void codeFreeScanner();
......
...@@ -132,6 +132,7 @@ static int g_inputLines; //!< number of line in the code fragment ...@@ -132,6 +132,7 @@ static int g_inputLines; //!< number of line in the code fragment
static int g_yyLineNr; //!< current line number static int g_yyLineNr; //!< current line number
static bool g_needsTermination; static bool g_needsTermination;
static Definition *g_searchCtx; static Definition *g_searchCtx;
static bool g_collectXRefs;
static bool g_isFixedForm; static bool g_isFixedForm;
static bool g_insideBody; //!< inside subprog/program body? => create links static bool g_insideBody; //!< inside subprog/program body? => create links
...@@ -378,36 +379,6 @@ static void writeMultiLineCodeLink(CodeOutputInterface &ol, ...@@ -378,36 +379,6 @@ static void writeMultiLineCodeLink(CodeOutputInterface &ol,
} }
} }
#if 0
static QCString fileLocation()
{
QCString result = g_sourceFileDef?g_sourceFileDef->absFilePath():QCString("[unknown]");
result+=":"+QCString().setNum(g_yyLineNr);
result+=":"+QCString().setNum(1);
return result;
}
/**
generates dictionay entries that are used if REFERENCED_BY_RELATION ... options are set
(e.g. the "referenced by ..." list after the function documentation)
*/
static void addDocCrossReference(MemberDef *src, MemberDef *dst)
{
if (dst->isTypedef() || dst->isEnumerate()) return; // don't add types
//printf("======= addDocCrossReference src=%s,dst=%s\n",src->name().data(),dst->name().data());
if ((Config_getBool("REFERENCED_BY_RELATION") || Config_getBool("CALLER_GRAPH")) &&
(src->isFunction()))
{
dst->addSourceReferencedBy(src,fileLocation());
}
if ((Config_getBool("REFERENCES_RELATION") || Config_getBool("CALL_GRAPH")) && (src->isFunction()))
{
src->addSourceReferences(dst,fileLocation());
}
}
#endif
//------------------------------------------------------------------------------- //-------------------------------------------------------------------------------
/** /**
...@@ -565,7 +536,8 @@ static bool getLink(UseSDict *usedict, // dictonary with used modules ...@@ -565,7 +536,8 @@ static bool getLink(UseSDict *usedict, // dictonary with used modules
if (md->getGroupDef()) d = md->getGroupDef(); if (md->getGroupDef()) d = md->getGroupDef();
if (d && d->isLinkable()) if (d && d->isLinkable())
{ {
if (g_currentDefinition && g_currentMemberDef && md!=g_currentMemberDef && g_insideBody) if (g_currentDefinition && g_currentMemberDef &&
md!=g_currentMemberDef && g_insideBody && g_collectXRefs)
{ {
addDocCrossReference(g_currentMemberDef,md); addDocCrossReference(g_currentMemberDef,md);
} }
...@@ -1133,7 +1105,8 @@ void resetFortranCodeParserState() {} ...@@ -1133,7 +1105,8 @@ void resetFortranCodeParserState() {}
void parseFortranCode(CodeOutputInterface &od,const char *className,const QCString &s, void parseFortranCode(CodeOutputInterface &od,const char *className,const QCString &s,
bool exBlock, const char *exName,FileDef *fd, bool exBlock, const char *exName,FileDef *fd,
int startLine,int endLine,bool inlineFragment, int startLine,int endLine,bool inlineFragment,
MemberDef *memberDef,bool,Definition *searchCtx) MemberDef *memberDef,bool,Definition *searchCtx,
bool collectXRefs)
{ {
//printf("***parseCode() exBlock=%d exName=%s fd=%p\n",exBlock,exName,fd); //printf("***parseCode() exBlock=%d exName=%s fd=%p\n",exBlock,exName,fd);
...@@ -1150,6 +1123,7 @@ void parseFortranCode(CodeOutputInterface &od,const char *className,const QCStri ...@@ -1150,6 +1123,7 @@ void parseFortranCode(CodeOutputInterface &od,const char *className,const QCStri
g_currentFontClass = 0; g_currentFontClass = 0;
g_needsTermination = FALSE; g_needsTermination = FALSE;
g_searchCtx = searchCtx; g_searchCtx = searchCtx;
g_collectXRefs = collectXRefs;
if (endLine!=-1) if (endLine!=-1)
g_inputLines = endLine+1; g_inputLines = endLine+1;
else else
......
...@@ -48,7 +48,8 @@ class FortranLanguageScanner : public ParserInterface ...@@ -48,7 +48,8 @@ class FortranLanguageScanner : public ParserInterface
bool inlineFragment=FALSE, bool inlineFragment=FALSE,
MemberDef *memberDef=0, MemberDef *memberDef=0,
bool showLineNumbers=TRUE, bool showLineNumbers=TRUE,
Definition *searchCtx=0 Definition *searchCtx=0,
bool collectXRefs=TRUE
); );
void resetCodeParserState(); void resetCodeParserState();
void parsePrototype(const char *text); void parsePrototype(const char *text);
......
...@@ -2354,12 +2354,13 @@ void FortranLanguageScanner::parseCode(CodeOutputInterface & codeOutIntf, ...@@ -2354,12 +2354,13 @@ void FortranLanguageScanner::parseCode(CodeOutputInterface & codeOutIntf,
bool inlineFragment, bool inlineFragment,
MemberDef *memberDef, MemberDef *memberDef,
bool showLineNumbers, bool showLineNumbers,
Definition *searchCtx Definition *searchCtx,
bool collectXRefs
) )
{ {
::parseFortranCode(codeOutIntf,scopeName,input,isExampleBlock,exampleName, ::parseFortranCode(codeOutIntf,scopeName,input,isExampleBlock,exampleName,
fileDef,startLine,endLine,inlineFragment,memberDef, fileDef,startLine,endLine,inlineFragment,memberDef,
showLineNumbers,searchCtx); showLineNumbers,searchCtx,collectXRefs);
} }
bool FortranLanguageScanner::needsPreprocessing(const QCString &extension) bool FortranLanguageScanner::needsPreprocessing(const QCString &extension)
......
...@@ -2347,7 +2347,8 @@ void MarkdownFileParser::parseCode(CodeOutputInterface &codeOutIntf, ...@@ -2347,7 +2347,8 @@ void MarkdownFileParser::parseCode(CodeOutputInterface &codeOutIntf,
bool inlineFragment, bool inlineFragment,
MemberDef *memberDef, MemberDef *memberDef,
bool showLineNumbers, bool showLineNumbers,
Definition *searchCtx Definition *searchCtx,
bool collectXRefs
) )
{ {
ParserInterface *pIntf = Doxygen::parserManager->getParser("*.cpp"); ParserInterface *pIntf = Doxygen::parserManager->getParser("*.cpp");
...@@ -2355,7 +2356,8 @@ void MarkdownFileParser::parseCode(CodeOutputInterface &codeOutIntf, ...@@ -2355,7 +2356,8 @@ void MarkdownFileParser::parseCode(CodeOutputInterface &codeOutIntf,
{ {
pIntf->parseCode( pIntf->parseCode(
codeOutIntf,scopeName,input,lang,isExampleBlock,exampleName, codeOutIntf,scopeName,input,lang,isExampleBlock,exampleName,
fileDef,startLine,endLine,inlineFragment,memberDef,showLineNumbers,searchCtx); fileDef,startLine,endLine,inlineFragment,memberDef,showLineNumbers,
searchCtx,collectXRefs);
} }
} }
......
...@@ -48,7 +48,8 @@ class MarkdownFileParser : public ParserInterface ...@@ -48,7 +48,8 @@ class MarkdownFileParser : public ParserInterface
bool inlineFragment=FALSE, bool inlineFragment=FALSE,
MemberDef *memberDef=0, MemberDef *memberDef=0,
bool showLineNumbers=TRUE, bool showLineNumbers=TRUE,
Definition *searchCtx=0 Definition *searchCtx=0,
bool collectXRefs=TRUE
); );
void resetCodeParserState(); void resetCodeParserState();
void parsePrototype(const char *text); void parsePrototype(const char *text);
......
...@@ -98,6 +98,7 @@ class ParserInterface ...@@ -98,6 +98,7 @@ class ParserInterface
* @param[in] showLineNumbers if set to TRUE and also fileDef is not 0, * @param[in] showLineNumbers if set to TRUE and also fileDef is not 0,
* line numbers will be added to the source fragement * line numbers will be added to the source fragement
* @param[in] searchCtx context under which search data has to be stored. * @param[in] searchCtx context under which search data has to be stored.
* @param[in] collectXRefs collect cross-reference relations.
*/ */
virtual void parseCode(CodeOutputInterface &codeOutIntf, virtual void parseCode(CodeOutputInterface &codeOutIntf,
const char *scopeName, const char *scopeName,
...@@ -111,7 +112,8 @@ class ParserInterface ...@@ -111,7 +112,8 @@ class ParserInterface
bool inlineFragment=FALSE, bool inlineFragment=FALSE,
MemberDef *memberDef=0, MemberDef *memberDef=0,
bool showLineNumbers=TRUE, bool showLineNumbers=TRUE,
Definition *searchCtx=0 Definition *searchCtx=0,
bool collectXRefs=TRUE
) = 0; ) = 0;
/** Resets the state of the code parser. /** Resets the state of the code parser.
......
...@@ -36,7 +36,8 @@ class Definition; ...@@ -36,7 +36,8 @@ class Definition;
extern void parsePythonCode(CodeOutputInterface &,const char *,const QCString &, extern void parsePythonCode(CodeOutputInterface &,const char *,const QCString &,
bool ,const char *,FileDef *fd, bool ,const char *,FileDef *fd,
int startLine,int endLine,bool inlineFragment, int startLine,int endLine,bool inlineFragment,
MemberDef *memberDef,bool showLineNumbers,Definition *searchCtx); MemberDef *memberDef,bool showLineNumbers,Definition *searchCtx,
bool collectXRefs);
extern void resetPythonCodeParserState(); extern void resetPythonCodeParserState();
#endif #endif
...@@ -62,6 +62,7 @@ static int g_inputPosition; //!< read offset during parsing ...@@ -62,6 +62,7 @@ static int g_inputPosition; //!< read offset during parsing
static const char * g_currentFontClass; static const char * g_currentFontClass;
static bool g_needsTermination; static bool g_needsTermination;
static Definition *g_searchCtx; static Definition *g_searchCtx;
static bool g_collectXRefs;
static int g_inputLines; //!< number of line in the code fragment static int g_inputLines; //!< number of line in the code fragment
static int g_yyLineNr; //!< current line number static int g_yyLineNr; //!< current line number
static FileDef * g_sourceFileDef; static FileDef * g_sourceFileDef;
...@@ -493,35 +494,6 @@ static void codifyLines(char *text) ...@@ -493,35 +494,6 @@ static void codifyLines(char *text)
} }
} }
#if 0
static QCString fileLocation()
{
QCString result = g_sourceFileDef?g_sourceFileDef->absFilePath():QCString("[unknown]");
result+=":"+QCString().setNum(g_yyLineNr);
result+=":"+QCString().setNum(1);
return result;
}
static void addDocCrossReference(MemberDef *src,MemberDef *dst)
{
static bool referencedByRelation = Config_getBool("REFERENCED_BY_RELATION");
static bool callerGraph = Config_getBool("CALLER_GRAPH");
static bool referencesRelation = Config_getBool("REFERENCES_RELATION");
static bool callGraph = Config_getBool("CALL_GRAPH");
if (dst->isTypedef() || dst->isEnumerate()) return; // don't add types
//printf("addDocCrossReference src=%s,dst=%s\n",src->name().data(),dst->name().data());
if ((referencedByRelation || callerGraph) && (src->isFunction() || src->isSlot()))
{
dst->addSourceReferencedBy(src,fileLocation());
}
if ((referencesRelation || callGraph) && (src->isFunction() || src->isSlot()))
{
src->addSourceReferences(dst,fileLocation());
}
}
#endif
static bool getLinkInScope(const QCString &c, // scope static bool getLinkInScope(const QCString &c, // scope
const QCString &m, // member const QCString &m, // member
...@@ -553,7 +525,7 @@ static bool getLinkInScope(const QCString &c, // scope ...@@ -553,7 +525,7 @@ static bool getLinkInScope(const QCString &c, // scope
// g_currentDefinition,g_currentMemberDef); // g_currentDefinition,g_currentMemberDef);
if (g_currentDefinition && g_currentMemberDef && if (g_currentDefinition && g_currentMemberDef &&
md!=g_currentMemberDef) md!=g_currentMemberDef && g_collectXRefs)
{ {
addDocCrossReference(g_currentMemberDef,md); addDocCrossReference(g_currentMemberDef,md);
} }
...@@ -652,7 +624,8 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,char *clName, ...@@ -652,7 +624,8 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,char *clName,
Definition *d = md->getOuterScope()==Doxygen::globalScope ? Definition *d = md->getOuterScope()==Doxygen::globalScope ?
md->getBodyDef() : md->getOuterScope(); md->getBodyDef() : md->getOuterScope();
if (md->getGroupDef()) d = md->getGroupDef(); if (md->getGroupDef()) d = md->getGroupDef();
if (d && d->isLinkable() && md->isLinkable() && g_currentMemberDef) if (d && d->isLinkable() && md->isLinkable() &&
g_currentMemberDef && g_collectXRefs)
{ {
addDocCrossReference(g_currentMemberDef,md); addDocCrossReference(g_currentMemberDef,md);
} }
...@@ -678,7 +651,8 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,char *clName, ...@@ -678,7 +651,8 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,char *clName,
Definition *d = md->getOuterScope()==Doxygen::globalScope ? Definition *d = md->getOuterScope()==Doxygen::globalScope ?
md->getBodyDef() : md->getOuterScope(); md->getBodyDef() : md->getOuterScope();
if (md->getGroupDef()) d = md->getGroupDef(); if (md->getGroupDef()) d = md->getGroupDef();
if (d && d->isLinkable() && md->isLinkable() && g_currentMemberDef) if (d && d->isLinkable() && md->isLinkable() &&
g_currentMemberDef && g_collectXRefs)
{ {
addDocCrossReference(g_currentMemberDef,md); addDocCrossReference(g_currentMemberDef,md);
} }
...@@ -700,7 +674,8 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,char *clName, ...@@ -700,7 +674,8 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,char *clName,
Definition *d = md->getOuterScope()==Doxygen::globalScope ? Definition *d = md->getOuterScope()==Doxygen::globalScope ?
md->getBodyDef() : md->getOuterScope(); md->getBodyDef() : md->getOuterScope();
if (md->getGroupDef()) d = md->getGroupDef(); if (md->getGroupDef()) d = md->getGroupDef();
if (d && d->isLinkable() && md->isLinkable() && g_currentMemberDef) if (d && d->isLinkable() && md->isLinkable() &&
g_currentMemberDef && g_collectXRefs)
{ {
addDocCrossReference(g_currentMemberDef,md); addDocCrossReference(g_currentMemberDef,md);
} }
...@@ -773,7 +748,7 @@ static bool findMemberLink(CodeOutputInterface &ol,Definition *sym,const char *s ...@@ -773,7 +748,7 @@ static bool findMemberLink(CodeOutputInterface &ol,Definition *sym,const char *s
ClassDef *thisCd = (ClassDef *)g_currentDefinition; ClassDef *thisCd = (ClassDef *)g_currentDefinition;
if (sym->definitionType()==Definition::TypeMember) if (sym->definitionType()==Definition::TypeMember)
{ {
if (g_currentMemberDef) if (g_currentMemberDef && g_collectXRefs)
{ {
addDocCrossReference(g_currentMemberDef,(MemberDef*)sym); addDocCrossReference(g_currentMemberDef,(MemberDef*)sym);
} }
...@@ -1452,7 +1427,7 @@ static void adjustScopesAndSuites(unsigned indentLength) ...@@ -1452,7 +1427,7 @@ static void adjustScopesAndSuites(unsigned indentLength)
void parsePythonCode(CodeOutputInterface &od,const char * /*className*/, void parsePythonCode(CodeOutputInterface &od,const char * /*className*/,
const QCString &s,bool exBlock, const char *exName, const QCString &s,bool exBlock, const char *exName,
FileDef *fd,int startLine,int endLine,bool /*inlineFragment*/, FileDef *fd,int startLine,int endLine,bool /*inlineFragment*/,
MemberDef *,bool,Definition *searchCtx) MemberDef *,bool,Definition *searchCtx,bool collectXRefs)
{ {
//printf("***parseCode()\n"); //printf("***parseCode()\n");
...@@ -1466,6 +1441,7 @@ void parsePythonCode(CodeOutputInterface &od,const char * /*className*/, ...@@ -1466,6 +1441,7 @@ void parsePythonCode(CodeOutputInterface &od,const char * /*className*/,
g_currentFontClass = 0; g_currentFontClass = 0;
g_needsTermination = FALSE; g_needsTermination = FALSE;
g_searchCtx=searchCtx; g_searchCtx=searchCtx;
g_collectXRefs=collectXRefs;
if (endLine!=-1) if (endLine!=-1)
g_inputLines = endLine+1; g_inputLines = endLine+1;
else else
......
...@@ -55,7 +55,8 @@ class PythonLanguageScanner : public ParserInterface ...@@ -55,7 +55,8 @@ class PythonLanguageScanner : public ParserInterface
bool inlineFragment=FALSE, bool inlineFragment=FALSE,
MemberDef *memberDef=0, MemberDef *memberDef=0,
bool showLineNumbers=TRUE, bool showLineNumbers=TRUE,
Definition *searchCtx=0 Definition *searchCtx=0,
bool collectXrefs=TRUE
); );
void resetCodeParserState(); void resetCodeParserState();
void parsePrototype(const char *text); void parsePrototype(const char *text);
......
...@@ -1709,12 +1709,13 @@ void PythonLanguageScanner::parseCode(CodeOutputInterface &codeOutIntf, ...@@ -1709,12 +1709,13 @@ void PythonLanguageScanner::parseCode(CodeOutputInterface &codeOutIntf,
bool inlineFragment, bool inlineFragment,
MemberDef *memberDef, MemberDef *memberDef,
bool showLineNumbers, bool showLineNumbers,
Definition *searchCtx Definition *searchCtx,
bool collectXRefs
) )
{ {
::parsePythonCode(codeOutIntf,scopeName,input,isExampleBlock,exampleName, ::parsePythonCode(codeOutIntf,scopeName,input,isExampleBlock,exampleName,
fileDef,startLine,endLine,inlineFragment,memberDef, fileDef,startLine,endLine,inlineFragment,memberDef,
showLineNumbers,searchCtx); showLineNumbers,searchCtx,collectXRefs);
} }
void PythonLanguageScanner::parsePrototype(const char *text) void PythonLanguageScanner::parsePrototype(const char *text)
......
...@@ -50,7 +50,8 @@ class CLanguageScanner : public ParserInterface ...@@ -50,7 +50,8 @@ class CLanguageScanner : public ParserInterface
bool inlineFragment=FALSE, bool inlineFragment=FALSE,
MemberDef *memberDef=0, MemberDef *memberDef=0,
bool showLineNumbers=TRUE, bool showLineNumbers=TRUE,
Definition *searchCtx=0 Definition *searchCtx=0,
bool collectXRefs=TRUE
); );
void resetCodeParserState(); void resetCodeParserState();
void parsePrototype(const char *text); void parsePrototype(const char *text);
......
...@@ -6928,12 +6928,13 @@ void CLanguageScanner::parseCode(CodeOutputInterface & codeOutIntf, ...@@ -6928,12 +6928,13 @@ void CLanguageScanner::parseCode(CodeOutputInterface & codeOutIntf,
bool inlineFragment, bool inlineFragment,
MemberDef *memberDef, MemberDef *memberDef,
bool showLineNumbers, bool showLineNumbers,
Definition *searchCtx Definition *searchCtx,
bool collectXRefs
) )
{ {
::parseCCode(codeOutIntf,scopeName,input,lang,isExampleBlock,exampleName, ::parseCCode(codeOutIntf,scopeName,input,lang,isExampleBlock,exampleName,
fileDef,startLine,endLine,inlineFragment,memberDef, fileDef,startLine,endLine,inlineFragment,memberDef,
showLineNumbers,searchCtx); showLineNumbers,searchCtx,collectXRefs);
} }
bool CLanguageScanner::needsPreprocessing(const QCString &extension) bool CLanguageScanner::needsPreprocessing(const QCString &extension)
......
...@@ -49,7 +49,8 @@ class TclLanguageScanner : public ParserInterface ...@@ -49,7 +49,8 @@ class TclLanguageScanner : public ParserInterface
bool inlineFragment=FALSE, bool inlineFragment=FALSE,
MemberDef *memberDef=0, MemberDef *memberDef=0,
bool showLineNumbers=TRUE, bool showLineNumbers=TRUE,
Definition *searchCtx=0 Definition *searchCtx=0,
bool collectXRefs=TRUE
); );
void resetCodeParserState(); void resetCodeParserState();
void parsePrototype(const char *text); void parsePrototype(const char *text);
......
...@@ -2569,7 +2569,8 @@ void TclLanguageScanner::parseCode(CodeOutputInterface & codeOutIntf, ...@@ -2569,7 +2569,8 @@ void TclLanguageScanner::parseCode(CodeOutputInterface & codeOutIntf,
bool inlineFragment, bool inlineFragment,
MemberDef *memberDef, MemberDef *memberDef,
bool showLineNumbers, bool showLineNumbers,
Definition *searchCtx Definition *searchCtx,
bool collectXRefs
) )
{ {
(void)scopeName; (void)scopeName;
...@@ -2579,6 +2580,7 @@ void TclLanguageScanner::parseCode(CodeOutputInterface & codeOutIntf, ...@@ -2579,6 +2580,7 @@ void TclLanguageScanner::parseCode(CodeOutputInterface & codeOutIntf,
(void)endLine; (void)endLine;
(void)inlineFragment; (void)inlineFragment;
(void)searchCtx; (void)searchCtx;
(void)collectXRefs;
if (input.length()<1) return; if (input.length()<1) return;
tcl.input_string = input; tcl.input_string = input;
......
...@@ -8,7 +8,8 @@ class MemberDef; ...@@ -8,7 +8,8 @@ class MemberDef;
void parseVhdlCode(CodeOutputInterface &,const char *,const QCString &, void parseVhdlCode(CodeOutputInterface &,const char *,const QCString &,
bool ,const char *,FileDef *fd, bool ,const char *,FileDef *fd,
int startLine,int endLine,bool inlineFragment, int startLine,int endLine,bool inlineFragment,
MemberDef *memberDef,bool showLineNumbers,Definition *searchCtx); MemberDef *memberDef,bool showLineNumbers,Definition *searchCtx,
bool collectXRefs);
void resetVhdlCodeParserState(); void resetVhdlCodeParserState();
void codeFreeVhdlScanner(); void codeFreeVhdlScanner();
......
...@@ -1512,7 +1512,8 @@ void resetVhdlCodeParserState() ...@@ -1512,7 +1512,8 @@ void resetVhdlCodeParserState()
void parseVhdlCode(CodeOutputInterface &od,const char *className,const QCString &s, void parseVhdlCode(CodeOutputInterface &od,const char *className,const QCString &s,
bool /*exBlock*/, const char *exName,FileDef *fd, bool /*exBlock*/, const char *exName,FileDef *fd,
int startLine,int endLine,bool inlineFragment, int startLine,int endLine,bool inlineFragment,
MemberDef *memberDef,bool,Definition *searchCtx) MemberDef *memberDef,bool,Definition *searchCtx,
bool /* collectXRefs */)
{ {
//printf("***parseCode() exBlock=%d exName=%s fd=%p\n",exBlock,exName,fd); //printf("***parseCode() exBlock=%d exName=%s fd=%p\n",exBlock,exName,fd);
if (s.isEmpty()) return; if (s.isEmpty()) return;
......
...@@ -68,7 +68,8 @@ class VHDLLanguageScanner : public ParserInterface ...@@ -68,7 +68,8 @@ class VHDLLanguageScanner : public ParserInterface
bool inlineFragment=FALSE, bool inlineFragment=FALSE,
MemberDef *memberDef=0, MemberDef *memberDef=0,
bool showLineNumbers=TRUE, bool showLineNumbers=TRUE,
Definition *searchCtx=0 Definition *searchCtx=0,
bool collectXRefs=TRUE
); );
void resetCodeParserState(); void resetCodeParserState();
void parsePrototype(const char *text); void parsePrototype(const char *text);
......
...@@ -805,12 +805,13 @@ void VHDLLanguageScanner::parseCode(CodeOutputInterface &codeOutIntf, ...@@ -805,12 +805,13 @@ void VHDLLanguageScanner::parseCode(CodeOutputInterface &codeOutIntf,
bool inlineFragment, bool inlineFragment,
MemberDef *memberDef, MemberDef *memberDef,
bool showLineNumbers, bool showLineNumbers,
Definition *searchCtx Definition *searchCtx,
bool collectXRefs
) )
{ {
::parseVhdlCode(codeOutIntf,scopeName,input,isExampleBlock,exampleName, ::parseVhdlCode(codeOutIntf,scopeName,input,isExampleBlock,exampleName,
fileDef,startLine,endLine,inlineFragment,memberDef, fileDef,startLine,endLine,inlineFragment,memberDef,
showLineNumbers,searchCtx); showLineNumbers,searchCtx,collectXRefs);
} }
/* /*
......
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