Commit e3d21b2d authored by Petr Prikryl's avatar Petr Prikryl

Merge branch 'master' of https://github.com/doxygen/doxygen.git

parents 775978d3 0e1e9f73
...@@ -82,7 +82,7 @@ pdf: docs ...@@ -82,7 +82,7 @@ pdf: docs
DISTFILES = Doxyfile libmd5 addon tmake doc examples bin lib objects \ DISTFILES = Doxyfile libmd5 addon tmake doc examples bin lib objects \
qtools src configure configure.bin Makefile.in Makefile.win_nmake.in \ qtools src configure configure.bin Makefile.in Makefile.win_nmake.in \
Makefile.win_make.in INSTALL LANGUAGE.HOWTO LICENSE PLATFORMS \ Makefile.win_make.in INSTALL LANGUAGE.HOWTO LICENSE PLATFORMS \
VERSION packages winbuild jquery VERSION README.md packages winbuild jquery
archive: clean archive: clean
tar zcvf dx`date +%y%m%d`.tgz $(DISTFILES) tar zcvf dx`date +%y%m%d`.tgz $(DISTFILES)
......
...@@ -7,6 +7,7 @@ languages such as C, Objective-C, C#, PHP, Java, Python, IDL ...@@ -7,6 +7,7 @@ languages such as C, Objective-C, C#, PHP, Java, Python, IDL
and to some extent D. and to some extent D.
Doxygen can help you in three ways: Doxygen can help you in three ways:
1. It can generate an on-line documentation browser (in HTML) and/or an 1. It can generate an on-line documentation browser (in HTML) and/or an
off-line reference manual (in LaTeX) from a set of documented source files. off-line reference manual (in LaTeX) from a set of documented source files.
There is also support for generating output in RTF (MS-Word), PostScript, There is also support for generating output in RTF (MS-Word), PostScript,
......
...@@ -266,7 +266,7 @@ void QFileInfo::doStat() const ...@@ -266,7 +266,7 @@ void QFileInfo::doStat() const
} }
#else #else
QString file = fn; QString file = fn;
reslashify(file); reslashify(QDir::cleanDirPath(file));
#ifdef QT_LARGEFILE_SUPPORT #ifdef QT_LARGEFILE_SUPPORT
if ( _wstati64( (wchar_t*) file.ucs2(), b ) == -1 ) { if ( _wstati64( (wchar_t*) file.ucs2(), b ) == -1 ) {
#else #else
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
#ifndef CODE_H #ifndef CODE_H
#define CODE_H #define CODE_H
#include "types.h"
class CodeOutputInterface; class CodeOutputInterface;
class FileDef; class FileDef;
class MemberDef; class MemberDef;
...@@ -25,7 +27,7 @@ class QCString; ...@@ -25,7 +27,7 @@ class QCString;
class Definition; class Definition;
void parseCCode(CodeOutputInterface &,const char *,const QCString &, void parseCCode(CodeOutputInterface &,const char *,const QCString &,
bool ,const char *,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);
void resetCCodeParserState(); void resetCCodeParserState();
......
...@@ -112,6 +112,9 @@ static int g_memCallContext; ...@@ -112,6 +112,9 @@ static int g_memCallContext;
static int g_lastCContext; static int g_lastCContext;
static bool g_insideObjC; static bool g_insideObjC;
static bool g_insideJava;
static bool g_insideCS;
static bool g_insidePHP;
static bool g_insideProtocolList; static bool g_insideProtocolList;
static bool g_lexInit = FALSE; static bool g_lexInit = FALSE;
...@@ -863,7 +866,7 @@ static bool getLinkInScope(const QCString &c, // scope ...@@ -863,7 +866,7 @@ static bool getLinkInScope(const QCString &c, // scope
} }
Definition *d = md->getOuterScope()==Doxygen::globalScope ? Definition *d = md->getOuterScope()==Doxygen::globalScope ?
md->getBodyDef() : md->getOuterScope(); md->getFileDef() : md->getOuterScope();
if (md->getGroupDef()) d = md->getGroupDef(); if (md->getGroupDef()) d = md->getGroupDef();
if (d && d->isLinkable()) if (d && d->isLinkable())
{ {
...@@ -927,7 +930,14 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,const char *clName ...@@ -927,7 +930,14 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,const char *clName
{ {
className+="-p"; className+="-p";
} }
className = substitute(className,"\\","::"); // for PHP namespaces if (g_insidePHP)
{
className = substitute(className,"\\","::"); // for PHP namespaces
}
else if (g_insideCS || g_insideJava)
{
className = substitute(className,".","::"); // for PHP namespaces
}
ClassDef *cd=0,*lcd=0; ClassDef *cd=0,*lcd=0;
MemberDef *md=0; MemberDef *md=0;
bool isLocal=FALSE; bool isLocal=FALSE;
...@@ -1000,7 +1010,7 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,const char *clName ...@@ -1000,7 +1010,7 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,const char *clName
if (md) if (md)
{ {
Definition *d = md->getOuterScope()==Doxygen::globalScope ? Definition *d = md->getOuterScope()==Doxygen::globalScope ?
md->getBodyDef() : 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)
{ {
...@@ -1098,7 +1108,7 @@ static bool generateClassMemberLink(CodeOutputInterface &ol,MemberDef *xmd,const ...@@ -1098,7 +1108,7 @@ static bool generateClassMemberLink(CodeOutputInterface &ol,MemberDef *xmd,const
g_theCallContext.setClass(typeClass); g_theCallContext.setClass(typeClass);
Definition *xd = xmd->getOuterScope()==Doxygen::globalScope ? Definition *xd = xmd->getOuterScope()==Doxygen::globalScope ?
xmd->getBodyDef() : xmd->getOuterScope(); xmd->getFileDef() : xmd->getOuterScope();
if (xmd->getGroupDef()) xd = xmd->getGroupDef(); if (xmd->getGroupDef()) xd = xmd->getGroupDef();
if (xd && xd->isLinkable()) if (xd && xd->isLinkable())
{ {
...@@ -1747,8 +1757,10 @@ static int yyread(char *buf,int max_size) ...@@ -1747,8 +1757,10 @@ static int yyread(char *buf,int max_size)
B [ \t] B [ \t]
BN [ \t\n\r] BN [ \t\n\r]
ID "$"?[a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]* ID "$"?[a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]*
SEP ("::"|"\\") SEP ("::"|"\\")
SEPCS (".")
SCOPENAME ({SEP}{BN}*)?({ID}{BN}*{SEP}{BN}*)*("~"{BN}*)?{ID} SCOPENAME ({SEP}{BN}*)?({ID}{BN}*{SEP}{BN}*)*("~"{BN}*)?{ID}
SCOPENAMECS ({SEPCS}{BN}*)?({ID}{BN}*{SEPCS}{BN}*)*("~"{BN}*)?{ID}
TEMPLIST "<"[^\"\}\{\(\)\/\n\>]*">" TEMPLIST "<"[^\"\}\{\(\)\/\n\>]*">"
SCOPETNAME (((({ID}{TEMPLIST}?){BN}*)?{SEP}{BN}*)*)((~{BN}*)?{ID}) SCOPETNAME (((({ID}{TEMPLIST}?){BN}*)?{SEP}{BN}*)*)((~{BN}*)?{ID})
SCOPEPREFIX ({ID}{TEMPLIST}?{BN}*{SEP}{BN}*)+ SCOPEPREFIX ({ID}{TEMPLIST}?{BN}*{SEP}{BN}*)+
...@@ -2492,6 +2504,20 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" ...@@ -2492,6 +2504,20 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\"
generateClassOrGlobalLink(*g_code,yytext); generateClassOrGlobalLink(*g_code,yytext);
g_name+=yytext; g_name+=yytext;
} }
<Body>{SCOPENAMECS}/{BN}*[;,)\]] { // "int var;" or "var, var2" or "debug(f) macro"
if (!g_insideCS && !g_insideJava)
{
REJECT;
}
else
{
addType();
// changed this to generateFunctionLink, see bug 624514
//generateClassOrGlobalLink(*g_code,yytext,FALSE,TRUE);
generateFunctionLink(*g_code,yytext);
g_name+=yytext;
}
}
<Body>{SCOPENAME}/{BN}*[;,)\]] { // "int var;" or "var, var2" or "debug(f) macro" <Body>{SCOPENAME}/{BN}*[;,)\]] { // "int var;" or "var, var2" or "debug(f) macro"
addType(); addType();
// changed this to generateFunctionLink, see bug 624514 // changed this to generateFunctionLink, see bug 624514
...@@ -2499,6 +2525,18 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" ...@@ -2499,6 +2525,18 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\"
generateFunctionLink(*g_code,yytext); generateFunctionLink(*g_code,yytext);
g_name+=yytext; g_name+=yytext;
} }
<Body>{SCOPENAMECS}/{B}* { // p->func()
if (!g_insideCS && !g_insideJava)
{
REJECT;
}
else
{
addType();
generateClassOrGlobalLink(*g_code,yytext);
g_name+=yytext;
}
}
<Body>{SCOPENAME}/{B}* { // p->func() <Body>{SCOPENAME}/{B}* { // p->func()
addType(); addType();
generateClassOrGlobalLink(*g_code,yytext); generateClassOrGlobalLink(*g_code,yytext);
...@@ -3514,7 +3552,7 @@ void resetCCodeParserState() ...@@ -3514,7 +3552,7 @@ void resetCCodeParserState()
} }
void parseCCode(CodeOutputInterface &od,const char *className,const QCString &s, void parseCCode(CodeOutputInterface &od,const char *className,const QCString &s,
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)
{ {
...@@ -3562,11 +3600,13 @@ void parseCCode(CodeOutputInterface &od,const char *className,const QCString &s, ...@@ -3562,11 +3600,13 @@ void parseCCode(CodeOutputInterface &od,const char *className,const QCString &s,
g_sourceFileDef = new FileDef("",(exName?exName:"generated")); g_sourceFileDef = new FileDef("",(exName?exName:"generated"));
cleanupSourceDef = TRUE; cleanupSourceDef = TRUE;
} }
g_insideObjC = lang==SrcLangExt_ObjC;
g_insideJava = lang==SrcLangExt_Java;
g_insideCS = lang==SrcLangExt_CSharp;
g_insidePHP = lang==SrcLangExt_PHP;
if (g_sourceFileDef) if (g_sourceFileDef)
{ {
setCurrentDoc("l00001"); setCurrentDoc("l00001");
g_insideObjC = g_sourceFileDef->name().lower().right(2)==".m" ||
g_sourceFileDef->name().lower().right(3)==".mm";
} }
g_currentDefinition = 0; g_currentDefinition = 0;
g_currentMemberDef = 0; g_currentMemberDef = 0;
......
...@@ -414,8 +414,8 @@ static bool parseMore; ...@@ -414,8 +414,8 @@ static bool parseMore;
static int g_condCount; static int g_condCount;
static int g_commentCount; static int g_commentCount;
static bool g_spaceBeforeCmd; static QCString g_spaceBeforeCmd;
static bool g_spaceBeforeIf; static QCString g_spaceBeforeIf;
static QCString g_copyDocArg; static QCString g_copyDocArg;
static QCString g_guardExpr; static QCString g_guardExpr;
...@@ -1033,17 +1033,17 @@ RCSTAG "$"{ID}":"[^\n$]+"$" ...@@ -1033,17 +1033,17 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
// the {B}* in the front was added for bug620924 // the {B}* in the front was added for bug620924
QCString cmdName = QCString(yytext).stripWhiteSpace().data()+1; QCString cmdName = QCString(yytext).stripWhiteSpace().data()+1;
DocCmdMapper::Cmd *cmdPtr = DocCmdMapper::map(cmdName); DocCmdMapper::Cmd *cmdPtr = DocCmdMapper::map(cmdName);
g_spaceBeforeCmd = yytext[0]==' ' || yytext[0]=='\t';
if (cmdPtr) // special action is required if (cmdPtr) // special action is required
{ {
int i=0;
while (yytext[i]==' ' || yytext[i]=='\t') i++;
g_spaceBeforeCmd = QCString(yytext).left(i);
if (cmdPtr->endsBrief) if (cmdPtr->endsBrief)
{ {
briefEndsAtDot=FALSE; briefEndsAtDot=FALSE;
// this command forces the end of brief description // this command forces the end of brief description
setOutput(OutputDoc); setOutput(OutputDoc);
} }
int i=0;
while (yytext[i]==' ' || yytext[i]=='\t') i++;
//if (i>0) addOutput(QCString(yytext).left(i)); // removed for bug 689341 //if (i>0) addOutput(QCString(yytext).left(i)); // removed for bug 689341
if (cmdPtr->func && cmdPtr->func(cmdName)) if (cmdPtr->func && cmdPtr->func(cmdName))
{ {
...@@ -1067,7 +1067,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$" ...@@ -1067,7 +1067,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
{ {
// command without handler, to be processed // command without handler, to be processed
// later by parsedoc.cpp // later by parsedoc.cpp
addOutput(yytext+i); addOutput(yytext);
} }
} }
else // command not relevant else // command not relevant
...@@ -1795,15 +1795,15 @@ RCSTAG "$"{ID}":"[^\n$]+"$" ...@@ -1795,15 +1795,15 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
addOutput(*yytext); addOutput(*yytext);
} }
<GuardParamEnd>{B}*{DOCNL} { <GuardParamEnd>{B}*{DOCNL} {
g_spaceBeforeIf=FALSE; g_spaceBeforeIf.resize(0);
BEGIN(Comment); BEGIN(Comment);
} }
<GuardParamEnd>{B}* { <GuardParamEnd>{B}* {
if (g_spaceBeforeIf) // needed for 665313 in combation with bug620924 if (!g_spaceBeforeIf.isEmpty()) // needed for 665313 in combation with bug620924
{ {
addOutput(" "); addOutput(g_spaceBeforeIf);
} }
g_spaceBeforeIf=FALSE; g_spaceBeforeIf.resize(0);
BEGIN(Comment); BEGIN(Comment);
} }
<GuardParamEnd>. { <GuardParamEnd>. {
...@@ -2430,10 +2430,10 @@ static bool handleSubpage(const QCString &s) ...@@ -2430,10 +2430,10 @@ static bool handleSubpage(const QCString &s)
warn(yyFileName,yyLineNr, warn(yyFileName,yyLineNr,
"found \\subpage command in a comment block that is not marked as a page!"); "found \\subpage command in a comment block that is not marked as a page!");
} }
if (g_spaceBeforeCmd) if (!g_spaceBeforeCmd.isEmpty())
{ {
addOutput(' '); addOutput(g_spaceBeforeCmd);
g_spaceBeforeCmd=FALSE; g_spaceBeforeCmd.resize(0);
} }
addOutput("@"+s+" "); addOutput("@"+s+" ");
BEGIN(SubpageLabel); BEGIN(SubpageLabel);
...@@ -2449,10 +2449,10 @@ static bool handleAnchor(const QCString &s) ...@@ -2449,10 +2449,10 @@ static bool handleAnchor(const QCString &s)
static bool handleCite(const QCString &s) static bool handleCite(const QCString &s)
{ {
if (g_spaceBeforeCmd) if (!g_spaceBeforeCmd.isEmpty())
{ {
addOutput(' '); addOutput(g_spaceBeforeCmd);
g_spaceBeforeCmd=FALSE; g_spaceBeforeCmd.resize(0);
} }
addOutput("@"+s+" "); addOutput("@"+s+" ");
BEGIN(CiteLabel); BEGIN(CiteLabel);
...@@ -2535,10 +2535,10 @@ static bool handleEndIf(const QCString &) ...@@ -2535,10 +2535,10 @@ static bool handleEndIf(const QCString &)
delete guards.pop(); delete guards.pop();
} }
enabledSectionFound=FALSE; enabledSectionFound=FALSE;
if (g_spaceBeforeCmd) if (!g_spaceBeforeCmd.isEmpty())
{ {
addOutput(' '); addOutput(g_spaceBeforeCmd);
g_spaceBeforeCmd=FALSE; g_spaceBeforeCmd.resize(0);
} }
BEGIN( GuardParamEnd ); BEGIN( GuardParamEnd );
return FALSE; return FALSE;
...@@ -2689,10 +2689,10 @@ static bool handleCopyBrief(const QCString &) ...@@ -2689,10 +2689,10 @@ static bool handleCopyBrief(const QCString &)
// otherwise it will be copied inline (see bug691315 & bug700788) // otherwise it will be copied inline (see bug691315 & bug700788)
setOutput(OutputBrief); setOutput(OutputBrief);
} }
if (g_spaceBeforeCmd) if (!g_spaceBeforeCmd.isEmpty())
{ {
addOutput(' '); addOutput(g_spaceBeforeCmd);
g_spaceBeforeCmd=FALSE; g_spaceBeforeCmd.resize(0);
} }
addOutput("\\copybrief "); addOutput("\\copybrief ");
return FALSE; return FALSE;
...@@ -2701,10 +2701,10 @@ static bool handleCopyBrief(const QCString &) ...@@ -2701,10 +2701,10 @@ static bool handleCopyBrief(const QCString &)
static bool handleCopyDetails(const QCString &) static bool handleCopyDetails(const QCString &)
{ {
setOutput(OutputDoc); setOutput(OutputDoc);
if (g_spaceBeforeCmd) if (!g_spaceBeforeCmd.isEmpty())
{ {
addOutput(' '); addOutput(g_spaceBeforeCmd);
g_spaceBeforeCmd=FALSE; g_spaceBeforeCmd.resize(0);
} }
addOutput("\\copydetails "); addOutput("\\copydetails ");
return FALSE; return FALSE;
...@@ -2713,10 +2713,10 @@ static bool handleCopyDetails(const QCString &) ...@@ -2713,10 +2713,10 @@ static bool handleCopyDetails(const QCString &)
static bool handleCopyDoc(const QCString &) static bool handleCopyDoc(const QCString &)
{ {
setOutput(OutputBrief); setOutput(OutputBrief);
if (g_spaceBeforeCmd) if (!g_spaceBeforeCmd.isEmpty())
{ {
addOutput(' '); addOutput(g_spaceBeforeCmd);
g_spaceBeforeCmd=FALSE; g_spaceBeforeCmd.resize(0);
} }
addOutput("\\copybrief "); addOutput("\\copybrief ");
g_copyDocArg.resize(0); g_copyDocArg.resize(0);
...@@ -2775,8 +2775,8 @@ bool parseCommentBlock(/* in */ ParserInterface *parser, ...@@ -2775,8 +2775,8 @@ bool parseCommentBlock(/* in */ ParserInterface *parser,
briefEndsAtDot = isAutoBriefOn; briefEndsAtDot = isAutoBriefOn;
g_condCount = 0; g_condCount = 0;
g_sectionLevel = 0; g_sectionLevel = 0;
g_spaceBeforeCmd = FALSE; g_spaceBeforeCmd.resize(0);
g_spaceBeforeIf = FALSE; g_spaceBeforeIf.resize(0);
if (!current->inbodyDocs.isEmpty() && isInbody) // separate in body fragments if (!current->inbodyDocs.isEmpty() && isInbody) // separate in body fragments
{ {
......
...@@ -861,6 +861,7 @@ bool DBusXMLScanner::needsPreprocessing(const QCString & /* extension */) ...@@ -861,6 +861,7 @@ bool DBusXMLScanner::needsPreprocessing(const QCString & /* extension */)
void DBusXMLScanner::parseCode(CodeOutputInterface & /* codeOutIntf */, void DBusXMLScanner::parseCode(CodeOutputInterface & /* codeOutIntf */,
const char * /* scopeName */, const char * /* scopeName */,
const QCString & /* input */, const QCString & /* input */,
SrcLangExt /* lang */,
bool /* isExampleBlock */, bool /* isExampleBlock */,
const char * /* exampleName */, const char * /* exampleName */,
FileDef * /* fileDef */, FileDef * /* fileDef */,
......
...@@ -42,6 +42,7 @@ public: ...@@ -42,6 +42,7 @@ public:
void parseCode(CodeOutputInterface &codeOutIntf, void parseCode(CodeOutputInterface &codeOutIntf,
const char *scopeName, const char *scopeName,
const QCString &input, const QCString &input,
SrcLangExt lang,
bool isExampleBlock, bool isExampleBlock,
const char *exampleName=0, const char *exampleName=0,
FileDef *fileDef=0, FileDef *fileDef=0,
......
...@@ -1044,6 +1044,7 @@ void Definition::writeInlineCode(OutputList &ol,const char *scopeName) ...@@ -1044,6 +1044,7 @@ void Definition::writeInlineCode(OutputList &ol,const char *scopeName)
pIntf->parseCode(ol, // codeOutIntf pIntf->parseCode(ol, // codeOutIntf
scopeName, // scope scopeName, // scope
codeFragment, // input codeFragment, // input
m_impl->lang, // lang
FALSE, // isExample FALSE, // isExample
0, // exampleName 0, // exampleName
m_impl->body->fileDef, // fileDef m_impl->body->fileDef, // fileDef
......
...@@ -370,11 +370,13 @@ static void writeDocbookDocBlock(FTextStream &t, ...@@ -370,11 +370,13 @@ static void writeDocbookDocBlock(FTextStream &t,
void writeDocbookCodeBlock(FTextStream &t,FileDef *fd) void writeDocbookCodeBlock(FTextStream &t,FileDef *fd)
{ {
ParserInterface *pIntf=Doxygen::parserManager->getParser(fd->getDefFileExtension()); ParserInterface *pIntf=Doxygen::parserManager->getParser(fd->getDefFileExtension());
SrcLangExt langExt = getLanguageFromFileName(fd->getDefFileExtension());
pIntf->resetCodeParserState(); pIntf->resetCodeParserState();
DocbookCodeGenerator *docbookGen = new DocbookCodeGenerator(t); DocbookCodeGenerator *docbookGen = new DocbookCodeGenerator(t);
pIntf->parseCode(*docbookGen, // codeOutIntf pIntf->parseCode(*docbookGen, // codeOutIntf
0, // scopeName 0, // scopeName
fileToString(fd->absFilePath(),Config_getBool("FILTER_SOURCE_FILES")), fileToString(fd->absFilePath(),Config_getBool("FILTER_SOURCE_FILES")),
langExt, // lang
FALSE, // isExampleBlock FALSE, // isExampleBlock
0, // exampleName 0, // exampleName
fd, // fileDef fd, // fileDef
......
...@@ -249,12 +249,13 @@ void DocbookDocVisitor::visit(DocStyleChange *s) ...@@ -249,12 +249,13 @@ void DocbookDocVisitor::visit(DocStyleChange *s)
void DocbookDocVisitor::visit(DocVerbatim *s) void DocbookDocVisitor::visit(DocVerbatim *s)
{ {
if (m_hide) return; if (m_hide) return;
SrcLangExt langExt = getLanguageFromFileName(m_langExt);
switch(s->type()) switch(s->type())
{ {
case DocVerbatim::Code: // fall though case DocVerbatim::Code: // fall though
m_t << "<programlisting>"; m_t << "<programlisting>";
Doxygen::parserManager->getParser(m_langExt) Doxygen::parserManager->getParser(m_langExt)
->parseCode(m_ci,s->context(),s->text(), ->parseCode(m_ci,s->context(),s->text(),langExt,
s->isExample(),s->exampleFile()); s->isExample(),s->exampleFile());
m_t << "</programlisting>"; m_t << "</programlisting>";
break; break;
...@@ -346,6 +347,7 @@ void DocbookDocVisitor::visit(DocAnchor *anc) ...@@ -346,6 +347,7 @@ void DocbookDocVisitor::visit(DocAnchor *anc)
void DocbookDocVisitor::visit(DocInclude *inc) void DocbookDocVisitor::visit(DocInclude *inc)
{ {
if (m_hide) return; if (m_hide) return;
SrcLangExt langExt = getLanguageFromFileName(inc->extension());
switch(inc->type()) switch(inc->type())
{ {
case DocInclude::IncWithLines: case DocInclude::IncWithLines:
...@@ -356,6 +358,7 @@ void DocbookDocVisitor::visit(DocInclude *inc) ...@@ -356,6 +358,7 @@ void DocbookDocVisitor::visit(DocInclude *inc)
Doxygen::parserManager->getParser(inc->extension()) Doxygen::parserManager->getParser(inc->extension())
->parseCode(m_ci,inc->context(), ->parseCode(m_ci,inc->context(),
inc->text(), inc->text(),
langExt,
inc->isExample(), inc->isExample(),
inc->exampleFile(), &fd); inc->exampleFile(), &fd);
m_t << "</programlisting>"; m_t << "</programlisting>";
...@@ -366,6 +369,7 @@ void DocbookDocVisitor::visit(DocInclude *inc) ...@@ -366,6 +369,7 @@ void DocbookDocVisitor::visit(DocInclude *inc)
Doxygen::parserManager->getParser(inc->extension()) Doxygen::parserManager->getParser(inc->extension())
->parseCode(m_ci,inc->context(), ->parseCode(m_ci,inc->context(),
inc->text(), inc->text(),
langExt,
inc->isExample(), inc->isExample(),
inc->exampleFile()); inc->exampleFile());
m_t << "</programlisting>"; m_t << "</programlisting>";
...@@ -385,6 +389,7 @@ void DocbookDocVisitor::visit(DocInclude *inc) ...@@ -385,6 +389,7 @@ void DocbookDocVisitor::visit(DocInclude *inc)
->parseCode(m_ci, ->parseCode(m_ci,
inc->context(), inc->context(),
extractBlock(inc->text(),inc->blockId()), extractBlock(inc->text(),inc->blockId()),
langExt,
inc->isExample(), inc->isExample(),
inc->exampleFile() inc->exampleFile()
); );
...@@ -404,6 +409,7 @@ void DocbookDocVisitor::visit(DocIncOperator *op) ...@@ -404,6 +409,7 @@ void DocbookDocVisitor::visit(DocIncOperator *op)
pushEnabled(); pushEnabled();
m_hide = TRUE; m_hide = TRUE;
} }
SrcLangExt langExt = getLanguageFromFileName(m_langExt);
if (op->type()!=DocIncOperator::Skip) if (op->type()!=DocIncOperator::Skip)
{ {
popEnabled(); popEnabled();
...@@ -411,7 +417,7 @@ void DocbookDocVisitor::visit(DocIncOperator *op) ...@@ -411,7 +417,7 @@ void DocbookDocVisitor::visit(DocIncOperator *op)
{ {
Doxygen::parserManager->getParser(m_langExt) Doxygen::parserManager->getParser(m_langExt)
->parseCode(m_ci,op->context(), ->parseCode(m_ci,op->context(),
op->text(),op->isExample(), op->text(),langExt,op->isExample(),
op->exampleFile()); op->exampleFile());
} }
pushEnabled(); pushEnabled();
......
...@@ -879,6 +879,7 @@ void FileDef::writeSource(OutputList &ol,bool sameTu,QStrList &filesInSameTu) ...@@ -879,6 +879,7 @@ void FileDef::writeSource(OutputList &ol,bool sameTu,QStrList &filesInSameTu)
ol.startCodeFragment(); ol.startCodeFragment();
pIntf->parseCode(ol,0, pIntf->parseCode(ol,0,
fileToString(absFilePath(),filterSourceFiles,TRUE), fileToString(absFilePath(),filterSourceFiles,TRUE),
getLanguage(),
FALSE,0,this FALSE,0,this
); );
ol.endCodeFragment(); ol.endCodeFragment();
...@@ -917,6 +918,7 @@ void FileDef::parseSource(bool sameTu,QStrList &filesInSameTu) ...@@ -917,6 +918,7 @@ void FileDef::parseSource(bool sameTu,QStrList &filesInSameTu)
pIntf->parseCode( pIntf->parseCode(
devNullIntf,0, devNullIntf,0,
fileToString(absFilePath(),filterSourceFiles,TRUE), fileToString(absFilePath(),filterSourceFiles,TRUE),
getLanguage(),
FALSE,0,this FALSE,0,this
); );
} }
......
...@@ -39,6 +39,7 @@ class FortranLanguageScanner : public ParserInterface ...@@ -39,6 +39,7 @@ class FortranLanguageScanner : public ParserInterface
void parseCode(CodeOutputInterface &codeOutIntf, void parseCode(CodeOutputInterface &codeOutIntf,
const char *scopeName, const char *scopeName,
const QCString &input, const QCString &input,
SrcLangExt lang,
bool isExampleBlock, bool isExampleBlock,
const char *exampleName=0, const char *exampleName=0,
FileDef *fileDef=0, FileDef *fileDef=0,
......
...@@ -2306,6 +2306,7 @@ void FortranLanguageScanner::parseInput(const char *fileName, ...@@ -2306,6 +2306,7 @@ void FortranLanguageScanner::parseInput(const char *fileName,
void FortranLanguageScanner::parseCode(CodeOutputInterface & codeOutIntf, void FortranLanguageScanner::parseCode(CodeOutputInterface & codeOutIntf,
const char * scopeName, const char * scopeName,
const QCString & input, const QCString & input,
SrcLangExt /*lang*/,
bool isExampleBlock, bool isExampleBlock,
const char * exampleName, const char * exampleName,
FileDef * fileDef, FileDef * fileDef,
......
...@@ -417,6 +417,7 @@ void HtmlDocVisitor::visit(DocVerbatim *s) ...@@ -417,6 +417,7 @@ void HtmlDocVisitor::visit(DocVerbatim *s)
{ {
lang = s->language(); lang = s->language();
} }
SrcLangExt langExt = getLanguageFromFileName(lang);
switch(s->type()) switch(s->type())
{ {
case DocVerbatim::Code: case DocVerbatim::Code:
...@@ -426,6 +427,7 @@ void HtmlDocVisitor::visit(DocVerbatim *s) ...@@ -426,6 +427,7 @@ void HtmlDocVisitor::visit(DocVerbatim *s)
->parseCode(m_ci, ->parseCode(m_ci,
s->context(), s->context(),
s->text(), s->text(),
langExt,
s->isExample(), s->isExample(),
s->exampleFile(), s->exampleFile(),
0, // fileDef 0, // fileDef
...@@ -526,6 +528,7 @@ void HtmlDocVisitor::visit(DocAnchor *anc) ...@@ -526,6 +528,7 @@ void HtmlDocVisitor::visit(DocAnchor *anc)
void HtmlDocVisitor::visit(DocInclude *inc) void HtmlDocVisitor::visit(DocInclude *inc)
{ {
if (m_hide) return; if (m_hide) return;
SrcLangExt langExt = getLanguageFromFileName(inc->extension());
switch(inc->type()) switch(inc->type())
{ {
case DocInclude::Include: case DocInclude::Include:
...@@ -535,6 +538,7 @@ void HtmlDocVisitor::visit(DocInclude *inc) ...@@ -535,6 +538,7 @@ void HtmlDocVisitor::visit(DocInclude *inc)
->parseCode(m_ci, ->parseCode(m_ci,
inc->context(), inc->context(),
inc->text(), inc->text(),
langExt,
inc->isExample(), inc->isExample(),
inc->exampleFile(), inc->exampleFile(),
0, // fileDef 0, // fileDef
...@@ -558,6 +562,7 @@ void HtmlDocVisitor::visit(DocInclude *inc) ...@@ -558,6 +562,7 @@ void HtmlDocVisitor::visit(DocInclude *inc)
->parseCode(m_ci, ->parseCode(m_ci,
inc->context(), inc->context(),
inc->text(), inc->text(),
langExt,
inc->isExample(), inc->isExample(),
inc->exampleFile(), inc->exampleFile(),
&fd, // fileDef, &fd, // fileDef,
...@@ -592,6 +597,7 @@ void HtmlDocVisitor::visit(DocInclude *inc) ...@@ -592,6 +597,7 @@ void HtmlDocVisitor::visit(DocInclude *inc)
->parseCode(m_ci, ->parseCode(m_ci,
inc->context(), inc->context(),
extractBlock(inc->text(),inc->blockId()), extractBlock(inc->text(),inc->blockId()),
langExt,
inc->isExample(), inc->isExample(),
inc->exampleFile(), inc->exampleFile(),
0, 0,
...@@ -619,6 +625,7 @@ void HtmlDocVisitor::visit(DocIncOperator *op) ...@@ -619,6 +625,7 @@ void HtmlDocVisitor::visit(DocIncOperator *op)
pushEnabled(); pushEnabled();
m_hide=TRUE; m_hide=TRUE;
} }
SrcLangExt langExt = getLanguageFromFileName(m_langExt);
if (op->type()!=DocIncOperator::Skip) if (op->type()!=DocIncOperator::Skip)
{ {
popEnabled(); popEnabled();
...@@ -629,6 +636,7 @@ void HtmlDocVisitor::visit(DocIncOperator *op) ...@@ -629,6 +636,7 @@ void HtmlDocVisitor::visit(DocIncOperator *op)
m_ci, m_ci,
op->context(), op->context(),
op->text(), op->text(),
langExt,
op->isExample(), op->isExample(),
op->exampleFile(), op->exampleFile(),
0, // fileDef 0, // fileDef
......
...@@ -339,13 +339,14 @@ void LatexDocVisitor::visit(DocVerbatim *s) ...@@ -339,13 +339,14 @@ void LatexDocVisitor::visit(DocVerbatim *s)
{ {
lang = s->language(); lang = s->language();
} }
SrcLangExt langExt = getLanguageFromFileName(lang);
switch(s->type()) switch(s->type())
{ {
case DocVerbatim::Code: case DocVerbatim::Code:
{ {
m_t << "\n\\begin{DoxyCode}\n"; m_t << "\n\\begin{DoxyCode}\n";
Doxygen::parserManager->getParser(lang) Doxygen::parserManager->getParser(lang)
->parseCode(m_ci,s->context(),s->text(), ->parseCode(m_ci,s->context(),s->text(),langExt,
s->isExample(),s->exampleFile()); s->isExample(),s->exampleFile());
m_t << "\\end{DoxyCode}\n"; m_t << "\\end{DoxyCode}\n";
} }
...@@ -435,6 +436,7 @@ void LatexDocVisitor::visit(DocAnchor *anc) ...@@ -435,6 +436,7 @@ void LatexDocVisitor::visit(DocAnchor *anc)
void LatexDocVisitor::visit(DocInclude *inc) void LatexDocVisitor::visit(DocInclude *inc)
{ {
if (m_hide) return; if (m_hide) return;
SrcLangExt langExt = getLanguageFromFileName(inc->extension());
switch(inc->type()) switch(inc->type())
{ {
case DocInclude::IncWithLines: case DocInclude::IncWithLines:
...@@ -445,6 +447,7 @@ void LatexDocVisitor::visit(DocInclude *inc) ...@@ -445,6 +447,7 @@ void LatexDocVisitor::visit(DocInclude *inc)
Doxygen::parserManager->getParser(inc->extension()) Doxygen::parserManager->getParser(inc->extension())
->parseCode(m_ci,inc->context(), ->parseCode(m_ci,inc->context(),
inc->text(), inc->text(),
langExt,
inc->isExample(), inc->isExample(),
inc->exampleFile(), &fd); inc->exampleFile(), &fd);
m_t << "\\end{DoxyCodeInclude}" << endl; m_t << "\\end{DoxyCodeInclude}" << endl;
...@@ -454,7 +457,7 @@ void LatexDocVisitor::visit(DocInclude *inc) ...@@ -454,7 +457,7 @@ void LatexDocVisitor::visit(DocInclude *inc)
m_t << "\n\\begin{DoxyCodeInclude}\n"; m_t << "\n\\begin{DoxyCodeInclude}\n";
Doxygen::parserManager->getParser(inc->extension()) Doxygen::parserManager->getParser(inc->extension())
->parseCode(m_ci,inc->context(), ->parseCode(m_ci,inc->context(),
inc->text(),inc->isExample(), inc->text(),langExt,inc->isExample(),
inc->exampleFile()); inc->exampleFile());
m_t << "\\end{DoxyCodeInclude}\n"; m_t << "\\end{DoxyCodeInclude}\n";
break; break;
...@@ -474,6 +477,7 @@ void LatexDocVisitor::visit(DocInclude *inc) ...@@ -474,6 +477,7 @@ void LatexDocVisitor::visit(DocInclude *inc)
->parseCode(m_ci, ->parseCode(m_ci,
inc->context(), inc->context(),
extractBlock(inc->text(),inc->blockId()), extractBlock(inc->text(),inc->blockId()),
langExt,
inc->isExample(), inc->isExample(),
inc->exampleFile() inc->exampleFile()
); );
...@@ -493,13 +497,14 @@ void LatexDocVisitor::visit(DocIncOperator *op) ...@@ -493,13 +497,14 @@ void LatexDocVisitor::visit(DocIncOperator *op)
pushEnabled(); pushEnabled();
m_hide = TRUE; m_hide = TRUE;
} }
SrcLangExt langExt = getLanguageFromFileName(m_langExt);
if (op->type()!=DocIncOperator::Skip) if (op->type()!=DocIncOperator::Skip)
{ {
popEnabled(); popEnabled();
if (!m_hide) if (!m_hide)
{ {
Doxygen::parserManager->getParser(m_langExt) Doxygen::parserManager->getParser(m_langExt)
->parseCode(m_ci,op->context(),op->text(), ->parseCode(m_ci,op->context(),op->text(),langExt,
op->isExample(),op->exampleFile()); op->isExample(),op->exampleFile());
} }
pushEnabled(); pushEnabled();
......
...@@ -193,14 +193,21 @@ void ManDocVisitor::visit(DocStyleChange *s) ...@@ -193,14 +193,21 @@ void ManDocVisitor::visit(DocStyleChange *s)
void ManDocVisitor::visit(DocVerbatim *s) void ManDocVisitor::visit(DocVerbatim *s)
{ {
if (m_hide) return; if (m_hide) return;
QCString lang = m_langExt;
if (!s->language().isEmpty()) // explicit language setting
{
lang = s->language();
}
SrcLangExt langExt = getLanguageFromFileName(lang);
switch (s->type()) switch (s->type())
{ {
case DocVerbatim::Code: // fall though case DocVerbatim::Code: // fall though
if (!m_firstCol) m_t << endl; if (!m_firstCol) m_t << endl;
m_t << ".PP" << endl; m_t << ".PP" << endl;
m_t << ".nf" << endl; m_t << ".nf" << endl;
Doxygen::parserManager->getParser(0/*TODO*/) Doxygen::parserManager->getParser(lang)
->parseCode(m_ci,s->context(),s->text(), ->parseCode(m_ci,s->context(),s->text(),
langExt,
s->isExample(),s->exampleFile()); s->isExample(),s->exampleFile());
if (!m_firstCol) m_t << endl; if (!m_firstCol) m_t << endl;
m_t << ".fi" << endl; m_t << ".fi" << endl;
...@@ -240,6 +247,7 @@ void ManDocVisitor::visit(DocAnchor *) ...@@ -240,6 +247,7 @@ void ManDocVisitor::visit(DocAnchor *)
void ManDocVisitor::visit(DocInclude *inc) void ManDocVisitor::visit(DocInclude *inc)
{ {
if (m_hide) return; if (m_hide) return;
SrcLangExt langExt = getLanguageFromFileName(inc->extension());
switch(inc->type()) switch(inc->type())
{ {
case DocInclude::IncWithLines: case DocInclude::IncWithLines:
...@@ -252,6 +260,7 @@ void ManDocVisitor::visit(DocInclude *inc) ...@@ -252,6 +260,7 @@ void ManDocVisitor::visit(DocInclude *inc)
Doxygen::parserManager->getParser(inc->extension()) Doxygen::parserManager->getParser(inc->extension())
->parseCode(m_ci,inc->context(), ->parseCode(m_ci,inc->context(),
inc->text(), inc->text(),
langExt,
inc->isExample(), inc->isExample(),
inc->exampleFile(), &fd); inc->exampleFile(), &fd);
if (!m_firstCol) m_t << endl; if (!m_firstCol) m_t << endl;
...@@ -266,7 +275,9 @@ void ManDocVisitor::visit(DocInclude *inc) ...@@ -266,7 +275,9 @@ void ManDocVisitor::visit(DocInclude *inc)
m_t << ".nf" << endl; m_t << ".nf" << endl;
Doxygen::parserManager->getParser(inc->extension()) Doxygen::parserManager->getParser(inc->extension())
->parseCode(m_ci,inc->context(), ->parseCode(m_ci,inc->context(),
inc->text(),inc->isExample(), inc->text(),
langExt,
inc->isExample(),
inc->exampleFile()); inc->exampleFile());
if (!m_firstCol) m_t << endl; if (!m_firstCol) m_t << endl;
m_t << ".fi" << endl; m_t << ".fi" << endl;
...@@ -295,6 +306,7 @@ void ManDocVisitor::visit(DocInclude *inc) ...@@ -295,6 +306,7 @@ void ManDocVisitor::visit(DocInclude *inc)
->parseCode(m_ci, ->parseCode(m_ci,
inc->context(), inc->context(),
extractBlock(inc->text(),inc->blockId()), extractBlock(inc->text(),inc->blockId()),
langExt,
inc->isExample(), inc->isExample(),
inc->exampleFile() inc->exampleFile()
); );
...@@ -308,6 +320,7 @@ void ManDocVisitor::visit(DocInclude *inc) ...@@ -308,6 +320,7 @@ void ManDocVisitor::visit(DocInclude *inc)
void ManDocVisitor::visit(DocIncOperator *op) void ManDocVisitor::visit(DocIncOperator *op)
{ {
SrcLangExt langExt = getLanguageFromFileName(m_langExt);
//printf("DocIncOperator: type=%d first=%d, last=%d text=`%s'\n", //printf("DocIncOperator: type=%d first=%d, last=%d text=`%s'\n",
// op->type(),op->isFirst(),op->isLast(),op->text().data()); // op->type(),op->isFirst(),op->isLast(),op->text().data());
if (op->isFirst()) if (op->isFirst())
...@@ -326,8 +339,8 @@ void ManDocVisitor::visit(DocIncOperator *op) ...@@ -326,8 +339,8 @@ void ManDocVisitor::visit(DocIncOperator *op)
popEnabled(); popEnabled();
if (!m_hide) if (!m_hide)
{ {
Doxygen::parserManager->getParser(0/*TODO*/) Doxygen::parserManager->getParser(m_langExt)
->parseCode(m_ci,op->context(),op->text(), ->parseCode(m_ci,op->context(),op->text(),langExt,
op->isExample(),op->exampleFile()); op->isExample(),op->exampleFile());
} }
pushEnabled(); pushEnabled();
......
...@@ -2341,6 +2341,7 @@ void MarkdownFileParser::parseInput(const char *fileName, ...@@ -2341,6 +2341,7 @@ void MarkdownFileParser::parseInput(const char *fileName,
void MarkdownFileParser::parseCode(CodeOutputInterface &codeOutIntf, void MarkdownFileParser::parseCode(CodeOutputInterface &codeOutIntf,
const char *scopeName, const char *scopeName,
const QCString &input, const QCString &input,
SrcLangExt lang,
bool isExampleBlock, bool isExampleBlock,
const char *exampleName, const char *exampleName,
FileDef *fileDef, FileDef *fileDef,
...@@ -2356,7 +2357,7 @@ void MarkdownFileParser::parseCode(CodeOutputInterface &codeOutIntf, ...@@ -2356,7 +2357,7 @@ void MarkdownFileParser::parseCode(CodeOutputInterface &codeOutIntf,
if (pIntf!=this) if (pIntf!=this)
{ {
pIntf->parseCode( pIntf->parseCode(
codeOutIntf,scopeName,input,isExampleBlock,exampleName, codeOutIntf,scopeName,input,lang,isExampleBlock,exampleName,
fileDef,startLine,endLine,inlineFragment,memberDef,showLineNumbers,searchCtx); fileDef,startLine,endLine,inlineFragment,memberDef,showLineNumbers,searchCtx);
} }
} }
......
...@@ -39,6 +39,7 @@ class MarkdownFileParser : public ParserInterface ...@@ -39,6 +39,7 @@ class MarkdownFileParser : public ParserInterface
void parseCode(CodeOutputInterface &codeOutIntf, void parseCode(CodeOutputInterface &codeOutIntf,
const char *scopeName, const char *scopeName,
const QCString &input, const QCString &input,
SrcLangExt lang,
bool isExampleBlock, bool isExampleBlock,
const char *exampleName=0, const char *exampleName=0,
FileDef *fileDef=0, FileDef *fileDef=0,
......
...@@ -2701,7 +2701,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ...@@ -2701,7 +2701,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
ParserInterface *pIntf = Doxygen::parserManager->getParser(getDefFileExtension()); ParserInterface *pIntf = Doxygen::parserManager->getParser(getDefFileExtension());
pIntf->resetCodeParserState(); pIntf->resetCodeParserState();
ol.startCodeFragment(); ol.startCodeFragment();
pIntf->parseCode(ol,scopeName,m_impl->initializer,FALSE,0,getFileDef(), pIntf->parseCode(ol,scopeName,m_impl->initializer,lang,FALSE,0,getFileDef(),
-1,-1,TRUE,this,FALSE,this); -1,-1,TRUE,this,FALSE,this);
ol.endCodeFragment(); ol.endCodeFragment();
} }
...@@ -3795,6 +3795,12 @@ QCString MemberDef::qualifiedName() const ...@@ -3795,6 +3795,12 @@ QCString MemberDef::qualifiedName() const
qm+="]"; qm+="]";
return qm; return qm;
} }
else if (m_impl->enumScope && m_impl->enumScope->isStrong())
{
return m_impl->enumScope->qualifiedName()+
getLanguageSpecificSeparator(getLanguage())+
localName();
}
else else
{ {
return Definition::qualifiedName(); return Definition::qualifiedName();
...@@ -4139,6 +4145,13 @@ bool MemberDef::isStrong() const ...@@ -4139,6 +4145,13 @@ bool MemberDef::isStrong() const
return (m_impl->memSpec&Entry::Strong)!=0; return (m_impl->memSpec&Entry::Strong)!=0;
} }
bool MemberDef::isStrongEnumValue() const
{
return m_impl->mtype==MemberType_EnumValue &&
m_impl->enumScope &&
m_impl->enumScope->isStrong();
}
bool MemberDef::isUnretained() const bool MemberDef::isUnretained() const
{ {
return (m_impl->memSpec&Entry::Unretained)!=0; return (m_impl->memSpec&Entry::Unretained)!=0;
...@@ -4845,4 +4858,3 @@ void combineDeclarationAndDefinition(MemberDef *mdec,MemberDef *mdef) ...@@ -4845,4 +4858,3 @@ void combineDeclarationAndDefinition(MemberDef *mdec,MemberDef *mdef)
} }
} }
...@@ -169,6 +169,7 @@ class MemberDef : public Definition ...@@ -169,6 +169,7 @@ class MemberDef : public Definition
bool hasMultiLineInitializer() const; bool hasMultiLineInitializer() const;
bool protectionVisible() const; bool protectionVisible() const;
bool showInCallGraph() const; bool showInCallGraph() const;
bool isStrongEnumValue() const;
// output info // output info
bool isLinkableInProject() const; bool isLinkableInProject() const;
......
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
#include "filedef.h" #include "filedef.h"
static QCString outputFormat; static QCString outputFormat;
static const char *warning_str = "Warning: "; static const char *warning_str = "warning: ";
static const char *error_str = "Error: "; static const char *error_str = "error: ";
//static int warnFormatOrder; // 1 = $file,$line,$text //static int warnFormatOrder; // 1 = $file,$line,$text
// // 2 = $text,$line,$file // // 2 = $text,$line,$file
// // 3 = $line,$text,$file // // 3 = $line,$text,$file
......
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
#include <qdict.h> #include <qdict.h>
#include <qstrlist.h> #include <qstrlist.h>
#include "types.h"
class Entry; class Entry;
class FileDef; class FileDef;
class CodeOutputInterface; class CodeOutputInterface;
...@@ -79,6 +81,7 @@ class ParserInterface ...@@ -79,6 +81,7 @@ class ParserInterface
/** Parses a source file or fragment with the goal to produce /** Parses a source file or fragment with the goal to produce
* highlighted and cross-referenced output. * highlighted and cross-referenced output.
* @param[in] codeOutIntf Abstract interface for writing the result. * @param[in] codeOutIntf Abstract interface for writing the result.
* @param[in] lang The programming language of the code fragment.
* @param[in] scopeName Name of scope to which the code belongs. * @param[in] scopeName Name of scope to which the code belongs.
* @param[in] input Actual code in the form of a string * @param[in] input Actual code in the form of a string
* @param[in] isExampleBlock TRUE iff the code is part of an example. * @param[in] isExampleBlock TRUE iff the code is part of an example.
...@@ -99,6 +102,7 @@ class ParserInterface ...@@ -99,6 +102,7 @@ class ParserInterface
virtual void parseCode(CodeOutputInterface &codeOutIntf, virtual void parseCode(CodeOutputInterface &codeOutIntf,
const char *scopeName, const char *scopeName,
const QCString &input, const QCString &input,
SrcLangExt lang,
bool isExampleBlock, bool isExampleBlock,
const char *exampleName=0, const char *exampleName=0,
FileDef *fileDef=0, FileDef *fileDef=0,
......
...@@ -232,6 +232,7 @@ class DefineManager ...@@ -232,6 +232,7 @@ class DefineManager
Define *isDefined(const char *name) const Define *isDefined(const char *name) const
{ {
Define *d = m_contextDefines.find(name); Define *d = m_contextDefines.find(name);
if (d && d->undef) d=0;
//printf("isDefined(%s)=%p\n",name,d); //printf("isDefined(%s)=%p\n",name,d);
return d; return d;
} }
......
...@@ -25,13 +25,15 @@ ...@@ -25,13 +25,15 @@
#ifndef PYCODE_H #ifndef PYCODE_H
#define PYCODE_H #define PYCODE_H
#include "types.h"
class CodeOutputInterface; class CodeOutputInterface;
class FileDef; class FileDef;
class MemberDef; class MemberDef;
class QCString; class QCString;
class Definition; 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);
......
...@@ -46,6 +46,7 @@ class PythonLanguageScanner : public ParserInterface ...@@ -46,6 +46,7 @@ class PythonLanguageScanner : public ParserInterface
void parseCode(CodeOutputInterface &codeOutIntf, void parseCode(CodeOutputInterface &codeOutIntf,
const char *scopeName, const char *scopeName,
const QCString &input, const QCString &input,
SrcLangExt lang,
bool isExampleBlock, bool isExampleBlock,
const char *exampleName=0, const char *exampleName=0,
FileDef *fileDef=0, FileDef *fileDef=0,
......
...@@ -1700,6 +1700,7 @@ bool PythonLanguageScanner::needsPreprocessing(const QCString &) ...@@ -1700,6 +1700,7 @@ bool PythonLanguageScanner::needsPreprocessing(const QCString &)
void PythonLanguageScanner::parseCode(CodeOutputInterface &codeOutIntf, void PythonLanguageScanner::parseCode(CodeOutputInterface &codeOutIntf,
const char *scopeName, const char *scopeName,
const QCString &input, const QCString &input,
SrcLangExt /*lang*/,
bool isExampleBlock, bool isExampleBlock,
const char *exampleName, const char *exampleName,
FileDef *fileDef, FileDef *fileDef,
......
...@@ -420,6 +420,7 @@ void RTFDocVisitor::visit(DocVerbatim *s) ...@@ -420,6 +420,7 @@ void RTFDocVisitor::visit(DocVerbatim *s)
{ {
lang = s->language(); lang = s->language();
} }
SrcLangExt langExt = getLanguageFromFileName(lang);
switch(s->type()) switch(s->type())
{ {
case DocVerbatim::Code: // fall though case DocVerbatim::Code: // fall though
...@@ -427,7 +428,7 @@ void RTFDocVisitor::visit(DocVerbatim *s) ...@@ -427,7 +428,7 @@ void RTFDocVisitor::visit(DocVerbatim *s)
m_t << "\\par" << endl; m_t << "\\par" << endl;
m_t << rtf_Style_Reset << getStyle("CodeExample"); m_t << rtf_Style_Reset << getStyle("CodeExample");
Doxygen::parserManager->getParser(lang) Doxygen::parserManager->getParser(lang)
->parseCode(m_ci,s->context(),s->text(), ->parseCode(m_ci,s->context(),s->text(),langExt,
s->isExample(),s->exampleFile()); s->isExample(),s->exampleFile());
//m_t << "\\par" << endl; //m_t << "\\par" << endl;
m_t << "}" << endl; m_t << "}" << endl;
...@@ -527,6 +528,7 @@ void RTFDocVisitor::visit(DocAnchor *anc) ...@@ -527,6 +528,7 @@ void RTFDocVisitor::visit(DocAnchor *anc)
void RTFDocVisitor::visit(DocInclude *inc) void RTFDocVisitor::visit(DocInclude *inc)
{ {
if (m_hide) return; if (m_hide) return;
SrcLangExt langExt = getLanguageFromFileName(inc->extension());
DBG_RTF("{\\comment RTFDocVisitor::visit(DocInclude)}\n"); DBG_RTF("{\\comment RTFDocVisitor::visit(DocInclude)}\n");
switch(inc->type()) switch(inc->type())
{ {
...@@ -540,6 +542,7 @@ void RTFDocVisitor::visit(DocInclude *inc) ...@@ -540,6 +542,7 @@ void RTFDocVisitor::visit(DocInclude *inc)
Doxygen::parserManager->getParser(inc->extension()) Doxygen::parserManager->getParser(inc->extension())
->parseCode(m_ci,inc->context(), ->parseCode(m_ci,inc->context(),
inc->text(), inc->text(),
langExt,
inc->isExample(), inc->isExample(),
inc->exampleFile(), &fd); inc->exampleFile(), &fd);
m_t << "\\par"; m_t << "\\par";
...@@ -552,7 +555,7 @@ void RTFDocVisitor::visit(DocInclude *inc) ...@@ -552,7 +555,7 @@ void RTFDocVisitor::visit(DocInclude *inc)
m_t << rtf_Style_Reset << getStyle("CodeExample"); m_t << rtf_Style_Reset << getStyle("CodeExample");
Doxygen::parserManager->getParser(inc->extension()) Doxygen::parserManager->getParser(inc->extension())
->parseCode(m_ci,inc->context(), ->parseCode(m_ci,inc->context(),
inc->text(),inc->isExample(), inc->text(),langExt,inc->isExample(),
inc->exampleFile()); inc->exampleFile());
m_t << "\\par"; m_t << "\\par";
m_t << "}" << endl; m_t << "}" << endl;
...@@ -577,6 +580,7 @@ void RTFDocVisitor::visit(DocInclude *inc) ...@@ -577,6 +580,7 @@ void RTFDocVisitor::visit(DocInclude *inc)
->parseCode(m_ci, ->parseCode(m_ci,
inc->context(), inc->context(),
extractBlock(inc->text(),inc->blockId()), extractBlock(inc->text(),inc->blockId()),
langExt,
inc->isExample(), inc->isExample(),
inc->exampleFile() inc->exampleFile()
); );
...@@ -591,6 +595,7 @@ void RTFDocVisitor::visit(DocIncOperator *op) ...@@ -591,6 +595,7 @@ void RTFDocVisitor::visit(DocIncOperator *op)
//printf("DocIncOperator: type=%d first=%d, last=%d text=`%s'\n", //printf("DocIncOperator: type=%d first=%d, last=%d text=`%s'\n",
// op->type(),op->isFirst(),op->isLast(),op->text().data()); // op->type(),op->isFirst(),op->isLast(),op->text().data());
DBG_RTF("{\\comment RTFDocVisitor::visit(DocIncOperator)}\n"); DBG_RTF("{\\comment RTFDocVisitor::visit(DocIncOperator)}\n");
SrcLangExt langExt = getLanguageFromFileName(m_langExt);
if (op->isFirst()) if (op->isFirst())
{ {
if (!m_hide) if (!m_hide)
...@@ -608,7 +613,7 @@ void RTFDocVisitor::visit(DocIncOperator *op) ...@@ -608,7 +613,7 @@ void RTFDocVisitor::visit(DocIncOperator *op)
if (!m_hide) if (!m_hide)
{ {
Doxygen::parserManager->getParser(m_langExt) Doxygen::parserManager->getParser(m_langExt)
->parseCode(m_ci,op->context(),op->text(), ->parseCode(m_ci,op->context(),op->text(),langExt,
op->isExample(),op->exampleFile()); op->isExample(),op->exampleFile());
} }
pushEnabled(); pushEnabled();
......
...@@ -41,6 +41,7 @@ class CLanguageScanner : public ParserInterface ...@@ -41,6 +41,7 @@ class CLanguageScanner : public ParserInterface
void parseCode(CodeOutputInterface &codeOutIntf, void parseCode(CodeOutputInterface &codeOutIntf,
const char *scopeName, const char *scopeName,
const QCString &input, const QCString &input,
SrcLangExt lang,
bool isExampleBlock, bool isExampleBlock,
const char *exampleName=0, const char *exampleName=0,
FileDef *fileDef=0, FileDef *fileDef=0,
......
...@@ -45,10 +45,6 @@ ...@@ -45,10 +45,6 @@
#include "clangparser.h" #include "clangparser.h"
// Toggle for some debugging info
#define DBG_CTX(x) fprintf x
//#define DBG_CTX(x) do { } while(0)
#define YY_NEVER_INTERACTIVE 1 #define YY_NEVER_INTERACTIVE 1
#define YY_NO_INPUT 1 #define YY_NO_INPUT 1
...@@ -526,7 +522,6 @@ static void splitKnRArg(QCString &oldStyleArgPtr,QCString &oldStyleArgName) ...@@ -526,7 +522,6 @@ static void splitKnRArg(QCString &oldStyleArgPtr,QCString &oldStyleArgName)
oldStyleArgName=current->args.copy().stripWhiteSpace(); oldStyleArgName=current->args.copy().stripWhiteSpace();
} }
} }
DBG_CTX((stderr,"type=%s ptr=%s name=%s\n",oldStyleArgType.data(),oldStyleArgPtr.data(),oldStyleArgName.data()));
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -4656,7 +4651,6 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) ...@@ -4656,7 +4651,6 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
} }
else if (checkForKnRstyleC()) else if (checkForKnRstyleC())
{ {
DBG_CTX((stderr,"===> got a K&R style function\n"));
current->args = yytext; current->args = yytext;
oldStyleArgType.resize(0); oldStyleArgType.resize(0);
BEGIN(OldStyleArgs); BEGIN(OldStyleArgs);
...@@ -6827,6 +6821,7 @@ void CLanguageScanner::parseInput(const char *fileName, ...@@ -6827,6 +6821,7 @@ void CLanguageScanner::parseInput(const char *fileName,
void CLanguageScanner::parseCode(CodeOutputInterface & codeOutIntf, void CLanguageScanner::parseCode(CodeOutputInterface & codeOutIntf,
const char * scopeName, const char * scopeName,
const QCString & input, const QCString & input,
SrcLangExt lang,
bool isExampleBlock, bool isExampleBlock,
const char * exampleName, const char * exampleName,
FileDef * fileDef, FileDef * fileDef,
...@@ -6838,7 +6833,7 @@ void CLanguageScanner::parseCode(CodeOutputInterface & codeOutIntf, ...@@ -6838,7 +6833,7 @@ void CLanguageScanner::parseCode(CodeOutputInterface & codeOutIntf,
Definition *searchCtx Definition *searchCtx
) )
{ {
::parseCCode(codeOutIntf,scopeName,input,isExampleBlock,exampleName, ::parseCCode(codeOutIntf,scopeName,input,lang,isExampleBlock,exampleName,
fileDef,startLine,endLine,inlineFragment,memberDef, fileDef,startLine,endLine,inlineFragment,memberDef,
showLineNumbers,searchCtx); showLineNumbers,searchCtx);
} }
......
...@@ -40,6 +40,7 @@ class TclLanguageScanner : public ParserInterface ...@@ -40,6 +40,7 @@ class TclLanguageScanner : public ParserInterface
void parseCode(CodeOutputInterface &codeOutIntf, void parseCode(CodeOutputInterface &codeOutIntf,
const char *scopeName, const char *scopeName,
const QCString &input, const QCString &input,
SrcLangExt lang,
bool isExampleBlock, bool isExampleBlock,
const char *exampleName=0, const char *exampleName=0,
FileDef *fileDef=0, FileDef *fileDef=0,
......
...@@ -2560,6 +2560,7 @@ tcl_inf("%s\n",fileName); ...@@ -2560,6 +2560,7 @@ tcl_inf("%s\n",fileName);
void TclLanguageScanner::parseCode(CodeOutputInterface & codeOutIntf, void TclLanguageScanner::parseCode(CodeOutputInterface & codeOutIntf,
const char * scopeName, const char * scopeName,
const QCString & input, const QCString & input,
SrcLangExt lang,
bool isExampleBlock, bool isExampleBlock,
const char * exampleName, const char * exampleName,
FileDef * fileDef, FileDef * fileDef,
...@@ -2572,6 +2573,7 @@ void TclLanguageScanner::parseCode(CodeOutputInterface & codeOutIntf, ...@@ -2572,6 +2573,7 @@ void TclLanguageScanner::parseCode(CodeOutputInterface & codeOutIntf,
) )
{ {
(void)scopeName; (void)scopeName;
(void)lang;
(void)exampleName; (void)exampleName;
(void)fileDef; (void)fileDef;
(void)endLine; (void)endLine;
......
This diff is collapsed.
...@@ -2583,6 +2583,7 @@ void VhdlDocGen::writeSource(MemberDef *mdef,OutputList& ol,QCString & cname) ...@@ -2583,6 +2583,7 @@ void VhdlDocGen::writeSource(MemberDef *mdef,OutputList& ol,QCString & cname)
pIntf->parseCode(ol, // codeOutIntf pIntf->parseCode(ol, // codeOutIntf
0, // scope 0, // scope
codeFragment, // input codeFragment, // input
SrcLangExt_VHDL, // lang
FALSE, // isExample FALSE, // isExample
0, // exampleName 0, // exampleName
mdef->getFileDef(), // fileDef mdef->getFileDef(), // fileDef
......
...@@ -59,6 +59,7 @@ class VHDLLanguageScanner : public ParserInterface ...@@ -59,6 +59,7 @@ class VHDLLanguageScanner : public ParserInterface
void parseCode(CodeOutputInterface &codeOutIntf, void parseCode(CodeOutputInterface &codeOutIntf,
const char *scopeName, const char *scopeName,
const QCString &input, const QCString &input,
SrcLangExt lang,
bool isExampleBlock, bool isExampleBlock,
const char *exampleName=0, const char *exampleName=0,
FileDef *fileDef=0, FileDef *fileDef=0,
......
...@@ -796,6 +796,7 @@ void VHDLLanguageScanner::parseInput(const char *fileName, ...@@ -796,6 +796,7 @@ void VHDLLanguageScanner::parseInput(const char *fileName,
void VHDLLanguageScanner::parseCode(CodeOutputInterface &codeOutIntf, void VHDLLanguageScanner::parseCode(CodeOutputInterface &codeOutIntf,
const char *scopeName, const char *scopeName,
const QCString &input, const QCString &input,
SrcLangExt /*lang*/,
bool isExampleBlock, bool isExampleBlock,
const char *exampleName, const char *exampleName,
FileDef *fileDef, FileDef *fileDef,
......
...@@ -246,12 +246,13 @@ void XmlDocVisitor::visit(DocStyleChange *s) ...@@ -246,12 +246,13 @@ void XmlDocVisitor::visit(DocStyleChange *s)
void XmlDocVisitor::visit(DocVerbatim *s) void XmlDocVisitor::visit(DocVerbatim *s)
{ {
if (m_hide) return; if (m_hide) return;
SrcLangExt langExt = getLanguageFromFileName(m_langExt);
switch(s->type()) switch(s->type())
{ {
case DocVerbatim::Code: // fall though case DocVerbatim::Code: // fall though
m_t << "<programlisting>"; m_t << "<programlisting>";
Doxygen::parserManager->getParser(m_langExt) Doxygen::parserManager->getParser(m_langExt)
->parseCode(m_ci,s->context(),s->text(), ->parseCode(m_ci,s->context(),s->text(),langExt,
s->isExample(),s->exampleFile()); s->isExample(),s->exampleFile());
m_t << "</programlisting>"; m_t << "</programlisting>";
break; break;
...@@ -310,6 +311,7 @@ void XmlDocVisitor::visit(DocAnchor *anc) ...@@ -310,6 +311,7 @@ void XmlDocVisitor::visit(DocAnchor *anc)
void XmlDocVisitor::visit(DocInclude *inc) void XmlDocVisitor::visit(DocInclude *inc)
{ {
if (m_hide) return; if (m_hide) return;
SrcLangExt langExt = getLanguageFromFileName(inc->extension());
switch(inc->type()) switch(inc->type())
{ {
case DocInclude::IncWithLines: case DocInclude::IncWithLines:
...@@ -320,6 +322,7 @@ void XmlDocVisitor::visit(DocInclude *inc) ...@@ -320,6 +322,7 @@ void XmlDocVisitor::visit(DocInclude *inc)
Doxygen::parserManager->getParser(inc->extension()) Doxygen::parserManager->getParser(inc->extension())
->parseCode(m_ci,inc->context(), ->parseCode(m_ci,inc->context(),
inc->text(), inc->text(),
langExt,
inc->isExample(), inc->isExample(),
inc->exampleFile(), &fd); inc->exampleFile(), &fd);
m_t << "</programlisting>"; m_t << "</programlisting>";
...@@ -330,6 +333,7 @@ void XmlDocVisitor::visit(DocInclude *inc) ...@@ -330,6 +333,7 @@ void XmlDocVisitor::visit(DocInclude *inc)
Doxygen::parserManager->getParser(inc->extension()) Doxygen::parserManager->getParser(inc->extension())
->parseCode(m_ci,inc->context(), ->parseCode(m_ci,inc->context(),
inc->text(), inc->text(),
langExt,
inc->isExample(), inc->isExample(),
inc->exampleFile()); inc->exampleFile());
m_t << "</programlisting>"; m_t << "</programlisting>";
...@@ -352,6 +356,7 @@ void XmlDocVisitor::visit(DocInclude *inc) ...@@ -352,6 +356,7 @@ void XmlDocVisitor::visit(DocInclude *inc)
->parseCode(m_ci, ->parseCode(m_ci,
inc->context(), inc->context(),
extractBlock(inc->text(),inc->blockId()), extractBlock(inc->text(),inc->blockId()),
langExt,
inc->isExample(), inc->isExample(),
inc->exampleFile() inc->exampleFile()
); );
...@@ -373,6 +378,7 @@ void XmlDocVisitor::visit(DocIncOperator *op) ...@@ -373,6 +378,7 @@ void XmlDocVisitor::visit(DocIncOperator *op)
pushEnabled(); pushEnabled();
m_hide = TRUE; m_hide = TRUE;
} }
SrcLangExt langExt = getLanguageFromFileName(m_langExt);
if (op->type()!=DocIncOperator::Skip) if (op->type()!=DocIncOperator::Skip)
{ {
popEnabled(); popEnabled();
...@@ -380,7 +386,7 @@ void XmlDocVisitor::visit(DocIncOperator *op) ...@@ -380,7 +386,7 @@ void XmlDocVisitor::visit(DocIncOperator *op)
{ {
Doxygen::parserManager->getParser(m_langExt) Doxygen::parserManager->getParser(m_langExt)
->parseCode(m_ci,op->context(), ->parseCode(m_ci,op->context(),
op->text(),op->isExample(), op->text(),langExt,op->isExample(),
op->exampleFile()); op->exampleFile());
} }
pushEnabled(); pushEnabled();
......
...@@ -456,11 +456,13 @@ static void writeXMLDocBlock(FTextStream &t, ...@@ -456,11 +456,13 @@ static void writeXMLDocBlock(FTextStream &t,
void writeXMLCodeBlock(FTextStream &t,FileDef *fd) void writeXMLCodeBlock(FTextStream &t,FileDef *fd)
{ {
ParserInterface *pIntf=Doxygen::parserManager->getParser(fd->getDefFileExtension()); ParserInterface *pIntf=Doxygen::parserManager->getParser(fd->getDefFileExtension());
SrcLangExt langExt = getLanguageFromFileName(fd->getDefFileExtension());
pIntf->resetCodeParserState(); pIntf->resetCodeParserState();
XMLCodeGenerator *xmlGen = new XMLCodeGenerator(t); XMLCodeGenerator *xmlGen = new XMLCodeGenerator(t);
pIntf->parseCode(*xmlGen, // codeOutIntf pIntf->parseCode(*xmlGen, // codeOutIntf
0, // scopeName 0, // scopeName
fileToString(fd->absFilePath(),Config_getBool("FILTER_SOURCE_FILES")), fileToString(fd->absFilePath(),Config_getBool("FILTER_SOURCE_FILES")),
langExt, // lang
FALSE, // isExampleBlock FALSE, // isExampleBlock
0, // exampleName 0, // exampleName
fd, // fileDef fd, // fileDef
......
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