diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cmdmapper.cpp | 1 | ||||
-rw-r--r-- | src/cmdmapper.h | 3 | ||||
-rw-r--r-- | src/code.l | 9 | ||||
-rw-r--r-- | src/definition.cpp | 15 | ||||
-rw-r--r-- | src/definition.h | 1 | ||||
-rw-r--r-- | src/docbookvisitor.cpp | 22 | ||||
-rw-r--r-- | src/docparser.cpp | 6 | ||||
-rw-r--r-- | src/docparser.h | 3 | ||||
-rw-r--r-- | src/filedef.cpp | 2 | ||||
-rw-r--r-- | src/fortrancode.l | 11 | ||||
-rw-r--r-- | src/htmldocvisitor.cpp | 25 | ||||
-rw-r--r-- | src/htmlentity.cpp | 4 | ||||
-rw-r--r-- | src/latexdocvisitor.cpp | 22 | ||||
-rw-r--r-- | src/mandocvisitor.cpp | 27 | ||||
-rw-r--r-- | src/perlmodgen.cpp | 1 | ||||
-rw-r--r-- | src/printdocvisitor.h | 1 | ||||
-rw-r--r-- | src/pycode.l | 17 | ||||
-rw-r--r-- | src/rtfdocvisitor.cpp | 24 | ||||
-rw-r--r-- | src/sqlite3gen.cpp | 305 | ||||
-rw-r--r-- | src/vhdlcode.l | 16 | ||||
-rw-r--r-- | src/xmlcode.l | 19 | ||||
-rw-r--r-- | src/xmldocvisitor.cpp | 22 | ||||
-rw-r--r-- | src/xmlgen.cpp | 1 |
23 files changed, 438 insertions, 119 deletions
diff --git a/src/cmdmapper.cpp b/src/cmdmapper.cpp index 5ed25cc..2c8effc 100644 --- a/src/cmdmapper.cpp +++ b/src/cmdmapper.cpp @@ -89,6 +89,7 @@ CommandMap cmdMap[] = { "section", CMD_SECTION }, { "snippet", CMD_SNIPPET }, { "snippetdoc", CMD_SNIPPETDOC }, + { "snippetlineno", CMD_SNIPWITHLINES }, { "subpage", CMD_SUBPAGE }, { "subsection", CMD_SUBSECTION }, { "subsubsection", CMD_SUBSUBSECTION }, diff --git a/src/cmdmapper.h b/src/cmdmapper.h index 8800c38..8cb529d 100644 --- a/src/cmdmapper.h +++ b/src/cmdmapper.h @@ -135,7 +135,8 @@ enum CommandType CMD_PLUS = 105, CMD_MINUS = 106, CMD_INCLUDEDOC = 107, - CMD_SNIPPETDOC = 108 + CMD_SNIPPETDOC = 108, + CMD_SNIPWITHLINES= 109 }; enum HtmlTagType @@ -3659,16 +3659,17 @@ void parseCCode(CodeOutputInterface &od,const char *className,const QCString &s, g_searchCtx = searchCtx; g_collectXRefs = collectXRefs; g_inFunctionTryBlock = FALSE; - if (endLine!=-1) - g_inputLines = endLine+1; - else - g_inputLines = countLines(); if (startLine!=-1) g_yyLineNr = startLine; else g_yyLineNr = 1; + if (endLine!=-1) + g_inputLines = endLine+1; + else + g_inputLines = g_yyLineNr + countLines() - 1; + g_curlyCount = 0; g_bodyCurlyCount = 0; g_bracketCount = 0; diff --git a/src/definition.cpp b/src/definition.cpp index c585301..7e6e8ec 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -1876,6 +1876,21 @@ GroupList *Definition::partOfGroups() const return m_impl->partOfGroups; } +bool Definition::isLinkableViaGroup() const +{ + GroupList *gl = partOfGroups(); + if (gl) + { + GroupListIterator gli(*gl); + GroupDef *gd; + for (gli.toFirst();(gd=gli.current());++gli) + { + if (gd->isLinkable()) return TRUE; + } + } + return FALSE; +} + Definition *Definition::getOuterScope() const { return m_impl->outerScope; diff --git a/src/definition.h b/src/definition.h index a7401ad..48c572d 100644 --- a/src/definition.h +++ b/src/definition.h @@ -257,6 +257,7 @@ class Definition : public DefinitionIntf SrcLangExt getLanguage() const; GroupList *partOfGroups() const; + bool isLinkableViaGroup() const; QList<ListItemInfo> *xrefListItems() const; diff --git a/src/docbookvisitor.cpp b/src/docbookvisitor.cpp index 535d294..ab10da0 100644 --- a/src/docbookvisitor.cpp +++ b/src/docbookvisitor.cpp @@ -359,6 +359,28 @@ void DocbookDocVisitor::visit(DocInclude *inc) ); m_t << "</computeroutput></literallayout>"; break; + case DocInclude::SnipWithLines: + { + QFileInfo cfi( inc->file() ); + FileDef fd( cfi.dirPath().utf8(), cfi.fileName().utf8() ); + m_t << "<literallayout><computeroutput>"; + Doxygen::parserManager->getParser(inc->extension()) + ->parseCode(m_ci, + inc->context(), + extractBlock(inc->text(),inc->blockId()), + langExt, + inc->isExample(), + inc->exampleFile(), + &fd, + lineBlock(inc->text(),inc->blockId()), + -1, // endLine + FALSE, // inlineFragment + 0, // memberDef + TRUE // show line number + ); + m_t << "</computeroutput></literallayout>"; + } + break; case DocInclude::SnippetDoc: case DocInclude::IncludeDoc: err("Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s" diff --git a/src/docparser.cpp b/src/docparser.cpp index cdf549a..2602f78 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -1931,6 +1931,7 @@ void DocInclude::parse() readTextFileByName(m_file,m_text); break; case Snippet: + case SnipWithLines: readTextFileByName(m_file,m_text); // check here for the existence of the blockId inside the file, so we // only generate the warning once. @@ -5174,7 +5175,7 @@ void DocPara::handleInclude(const QCString &cmdName,DocInclude::Type t) } QCString fileName = g_token->name; QCString blockId; - if (t==DocInclude::Snippet || t==DocInclude::SnippetDoc) + if (t==DocInclude::Snippet || t==DocInclude::SnipWithLines || t==DocInclude::SnippetDoc) { if (fileName == "this") fileName=g_fileName; doctokenizerYYsetStateSnippet(); @@ -5701,6 +5702,9 @@ int DocPara::handleCommand(const QCString &cmdName) case CMD_SNIPPET: handleInclude(cmdName,DocInclude::Snippet); break; + case CMD_SNIPWITHLINES: + handleInclude(cmdName,DocInclude::SnipWithLines); + break; case CMD_INCLUDEDOC: handleInclude(cmdName,DocInclude::IncludeDoc); break; diff --git a/src/docparser.h b/src/docparser.h index 1fe5e95..f5167dc 100644 --- a/src/docparser.h +++ b/src/docparser.h @@ -483,7 +483,8 @@ class DocVerbatim : public DocNode class DocInclude : public DocNode { public: - enum Type { Include, DontInclude, VerbInclude, HtmlInclude, LatexInclude, IncWithLines, Snippet , IncludeDoc, SnippetDoc}; + enum Type { Include, DontInclude, VerbInclude, HtmlInclude, LatexInclude, + IncWithLines, Snippet , IncludeDoc, SnippetDoc, SnipWithLines}; DocInclude(DocNode *parent,const QCString &file, const QCString context, Type t, bool isExample,const QCString exampleFile, diff --git a/src/filedef.cpp b/src/filedef.cpp index 96cfe9e..0a1e6e2 100644 --- a/src/filedef.cpp +++ b/src/filedef.cpp @@ -1888,7 +1888,7 @@ void FileDef::writeMemberDocumentation(OutputList &ol,MemberListType lt,const QC bool FileDef::isLinkableInProject() const { static bool showFiles = Config_getBool(SHOW_FILES); - return hasDocumentation() && !isReference() && showFiles; + return hasDocumentation() && !isReference() && (showFiles || isLinkableViaGroup()); } static void getAllIncludeFilesRecursively( diff --git a/src/fortrancode.l b/src/fortrancode.l index a2a5d1a..6abb676 100644 --- a/src/fortrancode.l +++ b/src/fortrancode.l @@ -1263,16 +1263,17 @@ void parseFortranCode(CodeOutputInterface &od,const char *className,const QCStri g_needsTermination = FALSE; g_searchCtx = searchCtx; g_collectXRefs = collectXRefs; - if (endLine!=-1) - g_inputLines = endLine+1; - else - g_inputLines = countLines(); - if (startLine!=-1) g_yyLineNr = startLine; else g_yyLineNr = 1; + if (endLine!=-1) + g_inputLines = endLine+1; + else + g_inputLines = g_yyLineNr + countLines() - 1; + + g_exampleBlock = exBlock; g_exampleName = exName; g_sourceFileDef = fd; diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp index 1b1bc98..a42a8ec 100644 --- a/src/htmldocvisitor.cpp +++ b/src/htmldocvisitor.cpp @@ -578,6 +578,31 @@ void HtmlDocVisitor::visit(DocInclude *inc) -1, // endLine TRUE, // inlineFragment 0, // memberDef + FALSE, // show line number + m_ctx // search context + ); + m_t << PREFRAG_END; + forceStartParagraph(inc); + } + break; + case DocInclude::SnipWithLines: + { + forceEndParagraph(inc); + m_t << PREFRAG_START; + QFileInfo cfi( inc->file() ); + FileDef fd( cfi.dirPath().utf8(), cfi.fileName().utf8() ); + Doxygen::parserManager->getParser(inc->extension()) + ->parseCode(m_ci, + inc->context(), + extractBlock(inc->text(),inc->blockId()), + langExt, + inc->isExample(), + inc->exampleFile(), + &fd, + lineBlock(inc->text(),inc->blockId()), + -1, // endLine + FALSE, // inlineFragment + 0, // memberDef TRUE, // show line number m_ctx // search context ); diff --git a/src/htmlentity.cpp b/src/htmlentity.cpp index ff3c574..668c224 100644 --- a/src/htmlentity.cpp +++ b/src/htmlentity.cpp @@ -199,7 +199,7 @@ static struct htmlEntityInfo { SYM(oline), "\xe2\x80\xbe", "‾", "<oline/>", "‾", "{$\\overline{\\,}$}", NULL, "\\u8254?", { NULL, DocSymbol::Perl_unknown }}, { SYM(frasl), "\xe2\x81\x84", "⁄", "<frasl/>", "⁄", "/", NULL, "\\u8260?", { NULL, DocSymbol::Perl_unknown }}, { SYM(weierp), "\xe2\x84\x98", "℘", "<weierp/>", "℘", "{$\\wp$}", NULL, "\\u8472?", { NULL, DocSymbol::Perl_unknown }}, - { SYM(image), "\xe2\x84\x91", "ℑ", "<image/>", "ℑ", "{$\\Im$}", NULL, "\\u8465?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(image), "\xe2\x84\x91", "ℑ", "<imaginary/>", "ℑ", "{$\\Im$}", NULL, "\\u8465?", { NULL, DocSymbol::Perl_unknown }}, { SYM(real), "\xe2\x84\x9c", "ℜ", "<real/>", "ℜ", "{$\\Re$}", NULL, "\\u8476?", { NULL, DocSymbol::Perl_unknown }}, { SYM(trade), "\xe2\x84\xa2", "™", "<trademark/>", "™", "\\texttrademark{}", "(TM)", "\\'99", { "trademark", DocSymbol::Perl_symbol }}, { SYM(alefsym), "\xe2\x85\xb5", "ℵ", "<alefsym/>", "ℵ", "{$\\aleph$}", NULL, "\\u8501?", { NULL, DocSymbol::Perl_unknown }}, @@ -297,7 +297,7 @@ static struct htmlEntityInfo { SYM(euro), "\xe2\x82\xac", "€", "<euro/>", "€", "\\texteuro{}", NULL, "\\'80", { NULL, DocSymbol::Perl_unknown }}, // doxygen extension to the HTML4 table of HTML entities - { SYM(tm), "\xe2\x84\xa2", "™", "<trademark/>", "™", "\\texttrademark{}", "(TM)", "\\'99", { "trademark", DocSymbol::Perl_symbol }}, + { SYM(tm), "\xe2\x84\xa2", "™", "<tm/>", "™", "\\texttrademark{}", "(TM)", "\\'99", { "trademark", DocSymbol::Perl_symbol }}, { SYM(apos), "'", "'", "'", "'", "\\textquotesingle{}", "'", "'", { "\\\'", DocSymbol::Perl_string }}, // doxygen commands represented as HTML entities diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp index 13491e9..467800c 100644 --- a/src/latexdocvisitor.cpp +++ b/src/latexdocvisitor.cpp @@ -483,6 +483,28 @@ void LatexDocVisitor::visit(DocInclude *inc) m_t << "\\end{DoxyCodeInclude}" << endl; } break; + case DocInclude::SnipWithLines: + { + QFileInfo cfi( inc->file() ); + FileDef fd( cfi.dirPath().utf8(), cfi.fileName().utf8() ); + m_t << "\n\\begin{DoxyCodeInclude}\n"; + Doxygen::parserManager->getParser(inc->extension()) + ->parseCode(m_ci, + inc->context(), + extractBlock(inc->text(),inc->blockId()), + langExt, + inc->isExample(), + inc->exampleFile(), + &fd, + lineBlock(inc->text(),inc->blockId()), + -1, // endLine + FALSE, // inlineFragment + 0, // memberDef + TRUE // show line number + ); + m_t << "\\end{DoxyCodeInclude}" << endl; + } + break; case DocInclude::SnippetDoc: case DocInclude::IncludeDoc: err("Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s" diff --git a/src/mandocvisitor.cpp b/src/mandocvisitor.cpp index 771cd80..2233cc6 100644 --- a/src/mandocvisitor.cpp +++ b/src/mandocvisitor.cpp @@ -306,6 +306,33 @@ void ManDocVisitor::visit(DocInclude *inc) m_t << ".PP" << endl; m_firstCol=TRUE; break; + case DocInclude::SnipWithLines: + { + if (!m_firstCol) m_t << endl; + m_t << ".PP" << endl; + m_t << ".nf" << endl; + QFileInfo cfi( inc->file() ); + FileDef fd( cfi.dirPath().utf8(), cfi.fileName().utf8() ); + Doxygen::parserManager->getParser(inc->extension()) + ->parseCode(m_ci, + inc->context(), + extractBlock(inc->text(),inc->blockId()), + langExt, + inc->isExample(), + inc->exampleFile(), + &fd, + lineBlock(inc->text(),inc->blockId()), + -1, // endLine + FALSE, // inlineFragment + 0, // memberDef + TRUE // show line number + ); + if (!m_firstCol) m_t << endl; + m_t << ".fi" << endl; + m_t << ".PP" << endl; + m_firstCol=TRUE; + } + break; case DocInclude::SnippetDoc: case DocInclude::IncludeDoc: err("Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s" diff --git a/src/perlmodgen.cpp b/src/perlmodgen.cpp index 0cd9911..ef5cbc2 100644 --- a/src/perlmodgen.cpp +++ b/src/perlmodgen.cpp @@ -716,6 +716,7 @@ void PerlModDocVisitor::visit(DocInclude *inc) case DocInclude::LatexInclude: type = "latexonly"; break; case DocInclude::VerbInclude: type = "preformatted"; break; case DocInclude::Snippet: return; + case DocInclude::SnipWithLines: return; case DocInclude::SnippetDoc: case DocInclude::IncludeDoc: err("Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s" diff --git a/src/printdocvisitor.h b/src/printdocvisitor.h index 499fac2..d1dbb74 100644 --- a/src/printdocvisitor.h +++ b/src/printdocvisitor.h @@ -171,6 +171,7 @@ class PrintDocVisitor : public DocVisitor case DocInclude::LatexInclude: printf("latexinclude"); break; case DocInclude::VerbInclude: printf("verbinclude"); break; case DocInclude::Snippet: printf("snippet"); break; + case DocInclude::SnipWithLines: printf("snipwithlines"); break; case DocInclude::SnippetDoc: case DocInclude::IncludeDoc: err("Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s" diff --git a/src/pycode.l b/src/pycode.l index 3935107..a31a0ed 100644 --- a/src/pycode.l +++ b/src/pycode.l @@ -1534,8 +1534,8 @@ static void adjustScopesAndSuites(unsigned indentLength) void parsePythonCode(CodeOutputInterface &od,const char * /*className*/, const QCString &s,bool exBlock, const char *exName, - FileDef *fd,int startLine,int endLine,bool /*inlineFragment*/, - MemberDef *,bool,Definition *searchCtx,bool collectXRefs) + FileDef *fd,int startLine,int endLine,bool inlineFragment, + MemberDef *,bool,Definition *searchCtx,bool collectXRefs) { //printf("***parseCode()\n"); @@ -1551,22 +1551,22 @@ void parsePythonCode(CodeOutputInterface &od,const char * /*className*/, g_needsTermination = FALSE; g_searchCtx=searchCtx; g_collectXRefs=collectXRefs; - if (endLine!=-1) - g_inputLines = endLine+1; - else - g_inputLines = countLines(); - if (startLine!=-1) g_yyLineNr = startLine; else g_yyLineNr = 1; + if (endLine!=-1) + g_inputLines = endLine+1; + else + g_inputLines = g_yyLineNr + countLines() - 1; + g_exampleBlock = exBlock; g_exampleName = exName; g_sourceFileDef = fd; bool cleanupSourceDef = FALSE; - if (fd==0) + if (exBlock && fd==0) { // create a dummy filedef for the example g_sourceFileDef = new FileDef("",(exName?exName:"generated")); @@ -1577,6 +1577,7 @@ void parsePythonCode(CodeOutputInterface &od,const char * /*className*/, setCurrentDoc("l00001"); } + g_includeCodeFragment = inlineFragment; // Starts line 1 on the output startCodeLine(); diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp index 76da457..c85b638 100644 --- a/src/rtfdocvisitor.cpp +++ b/src/rtfdocvisitor.cpp @@ -444,6 +444,30 @@ void RTFDocVisitor::visit(DocInclude *inc) ); m_t << "}"; break; + case DocInclude::SnipWithLines: + { + QFileInfo cfi( inc->file() ); + FileDef fd( cfi.dirPath().utf8(), cfi.fileName().utf8() ); + m_t << "{" << endl; + if (!m_lastIsPara) m_t << "\\par" << endl; + m_t << rtf_Style_Reset << getStyle("CodeExample"); + Doxygen::parserManager->getParser(inc->extension()) + ->parseCode(m_ci, + inc->context(), + extractBlock(inc->text(),inc->blockId()), + langExt, + inc->isExample(), + inc->exampleFile(), + &fd, + lineBlock(inc->text(),inc->blockId()), + -1, // endLine + FALSE, // inlineFragment + 0, // memberDef + TRUE // show line number + ); + m_t << "}"; + } + break; case DocInclude::SnippetDoc: case DocInclude::IncludeDoc: err("Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s" diff --git a/src/sqlite3gen.cpp b/src/sqlite3gen.cpp index 5a86073..6bc8789 100644 --- a/src/sqlite3gen.cpp +++ b/src/sqlite3gen.cpp @@ -92,47 +92,64 @@ const char * schema_queries[][2] = { { "memberdef", "CREATE TABLE IF NOT EXISTS memberdef (\n" "\t-- All processed identifiers.\n" - "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n" - "\tid_file INTEGER NOT NULL, -- file where this identifier is located\n" - "\tline INTEGER NOT NULL, -- line where this identifier is located\n" - "\tcolumn INTEGER NOT NULL, -- column where this identifier is located\n" - "\trefid INTEGER NOT NULL, -- see the refids table\n" - "\tname TEXT NOT NULL,\n" - "\tdefinition TEXT,\n" - "\ttype TEXT,\n" - "\targsstring TEXT,\n" - "\tscope TEXT,\n" - "\tinitializer TEXT,\n" - "\tprot INTEGER DEFAULT 0, -- 0:public 1:protected 2:private 3:package\n" - "\tconst INTEGER DEFAULT 0, -- 0:non-constant 1:constant\n" - "\tvirt INTEGER DEFAULT 0, -- 0:non-virtual 1:virtual 2:pure-virtual\n" - "\tstatic INTEGER DEFAULT 0, -- 0:non-static 1:static\n" - "\texplicit INTEGER DEFAULT 0,\n" - "\tinline INTEGER DEFAULT 0,\n" - "\tfinal INTEGER DEFAULT 0,\n" - "\tsealed INTEGER DEFAULT 0,\n" - "\tnew INTEGER DEFAULT 0,\n" - "\toptional INTEGER DEFAULT 0,\n" - "\trequired INTEGER DEFAULT 0,\n" - "\tmutable INTEGER DEFAULT 0,\n" - "\tinitonly INTEGER DEFAULT 0,\n" - "\treadable INTEGER DEFAULT 0,\n" - "\twritable INTEGER DEFAULT 0,\n" - "\tgettable INTEGER DEFAULT 0,\n" - "\tsettable INTEGER DEFAULT 0,\n" - "\taccessor INTEGER DEFAULT 0,\n" - "\taddable INTEGER DEFAULT 0,\n" - "\tremovable INTEGER DEFAULT 0,\n" - "\traisable INTEGER DEFAULT 0,\n" + "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n" + "\trefid INTEGER NOT NULL, -- see the refids table\n" + "\tname TEXT NOT NULL,\n" + "\tdefinition TEXT,\n" + "\ttype TEXT,\n" + "\targsstring TEXT,\n" + "\tscope TEXT,\n" + "\tinitializer TEXT,\n" + "\tbitfield TEXT,\n" + "\tread TEXT,\n" + "\twrite TEXT,\n" + "\tprot INTEGER DEFAULT 0, -- 0:public 1:protected 2:private 3:package\n" + "\tstatic INTEGER DEFAULT 0, -- 0:no 1:yes\n" + "\tconst INTEGER DEFAULT 0, -- 0:no 1:yes\n" + "\texplicit INTEGER DEFAULT 0, -- 0:no 1:yes\n" + "\tinline INTEGER DEFAULT 0, -- 0:no 1:yes\n" + "\tfinal INTEGER DEFAULT 0, -- 0:no 1:yes\n" + "\tsealed INTEGER DEFAULT 0, -- 0:no 1:yes\n" + "\tnew INTEGER DEFAULT 0, -- 0:no 1:yes\n" + "\toptional INTEGER DEFAULT 0, -- 0:no 1:yes\n" + "\trequired INTEGER DEFAULT 0, -- 0:no 1:yes\n" + "\tvolatile INTEGER DEFAULT 0, -- 0:no 1:yes\n" + "\tvirt INTEGER DEFAULT 0, -- 0:no 1:virtual 2:pure-virtual\n" + "\tmutable INTEGER DEFAULT 0, -- 0:no 1:yes\n" + "\tinitonly INTEGER DEFAULT 0, -- 0:no 1:yes\n" + "\tattribute INTEGER DEFAULT 0, -- 0:no 1:yes\n" + "\tproperty INTEGER DEFAULT 0, -- 0:no 1:yes\n" + "\treadonly INTEGER DEFAULT 0, -- 0:no 1:yes\n" + "\tbound INTEGER DEFAULT 0, -- 0:no 1:yes\n" + "\tconstrained INTEGER DEFAULT 0, -- 0:no 1:yes\n" + "\ttransient INTEGER DEFAULT 0, -- 0:no 1:yes\n" + "\tmaybevoid INTEGER DEFAULT 0, -- 0:no 1:yes\n" + "\tmaybedefault INTEGER DEFAULT 0, -- 0:no 1:yes\n" + "\tmaybeambiguous INTEGER DEFAULT 0, -- 0:no 1:yes\n" + "\treadable INTEGER DEFAULT 0, -- 0:no 1:yes\n" + "\twritable INTEGER DEFAULT 0, -- 0:no 1:yes\n" + "\tgettable INTEGER DEFAULT 0, -- 0:no 1:yes\n" + "\tprivategettable INTEGER DEFAULT 0, -- 0:no 1:yes\n" + "\tprotectedgettable INTEGER DEFAULT 0, -- 0:no 1:yes\n" + "\tsettable INTEGER DEFAULT 0, -- 0:no 1:yes\n" + "\tprivatesettable INTEGER DEFAULT 0, -- 0:no 1:yes\n" + "\tprotectedsettable INTEGER DEFAULT 0, -- 0:no 1:yes\n" + "\taccessor INTEGER DEFAULT 0, -- 0:no 1:assign 2:copy 3:retain 4:string 5:weak\n" + "\taddable INTEGER DEFAULT 0, -- 0:no 1:yes\n" + "\tremovable INTEGER DEFAULT 0, -- 0:no 1:yes\n" + "\traisable INTEGER DEFAULT 0, -- 0:no 1:yes\n" /// @todo make a `kind' table - "\tkind INTEGER DEFAULT 0, -- 0:define 1:function 2:variable 3:typedef 4:enum 5:enumvalue 6:signal 7:slot 8:friend 9:DCOP 10:property 11:event\n" - "\tid_bodyfile INTEGER DEFAULT 0, -- file of definition\n" - "\tbodystart INTEGER DEFAULT 0, -- starting line of definition\n" - "\tbodyend INTEGER DEFAULT 0, -- ending line of definition\n" + "\tkind INTEGER DEFAULT 0, -- 0:define 1:function 2:variable 3:typedef 4:enum 5:enumvalue 6:signal 7:slot 8:friend 9:DCOP 10:property 11:event\n" + "\tbodystart INTEGER DEFAULT 0, -- starting line of definition\n" + "\tbodyend INTEGER DEFAULT 0, -- ending line of definition\n" + "\tid_bodyfile INTEGER DEFAULT 0, -- file of definition\n" + "\tid_file INTEGER NOT NULL, -- file where this identifier is located\n" + "\tline INTEGER NOT NULL, -- line where this identifier is located\n" + "\tcolumn INTEGER NOT NULL, -- column where this identifier is located\n" /// @todo make a `detaileddescription' table "\tdetaileddescription TEXT,\n" "\tbriefdescription TEXT,\n" - "\tinbodydescription TEXTi\n" + "\tinbodydescription TEXT\n" ");" }, { "compounddef", @@ -251,9 +268,121 @@ SqlStmt xrefs_insert= {"INSERT INTO xrefs " }; ////////////////////////////////////////////////////// SqlStmt memberdef_insert={"INSERT INTO memberdef " - "( refid, prot, static, const, explicit, inline, final, sealed, new, optional, required, virt, mutable, initonly, readable, writable, gettable, settable, accessor, addable, removable, raisable, name, type, definition, argsstring, scope, initializer, kind, id_bodyfile, bodystart, bodyend, id_file, line, column, detaileddescription, briefdescription, inbodydescription)" + "(" + "refid," + "name," + "definition," + "type," + "argsstring," + "scope," + "initializer," + "bitfield," + "read," + "write," + "prot," + "static," + "const," + "explicit," + "inline," + "final," + "sealed," + "new," + "optional," + "required," + "volatile," + "virt," + "mutable," + "initonly," + "attribute," + "property," + "readonly," + "bound," + "constrained," + "transient," + "maybevoid," + "maybedefault," + "maybeambiguous," + "readable," + "writable," + "gettable," + "protectedsettable," + "protectedgettable," + "settable," + "privatesettable," + "privategettable," + "accessor," + "addable," + "removable," + "raisable," + "kind," + "bodystart," + "bodyend," + "id_bodyfile," + "id_file," + "line," + "column," + "detaileddescription," + "briefdescription," + "inbodydescription" + ")" "VALUES " - "(:refid,:prot,:static,:const,:explicit,:inline,:final,:sealed,:new,:optional,:required,:virt,:mutable,:initonly,:readable,:writable,:gettable,:settable,:accessor,:addable,:removable,:raisable,:name,:type,:definition,:argsstring,:scope,:initializer,:kind,:id_bodyfile,:bodystart,:bodyend,:id_file,:line,:column,:detaileddescription,:briefdescription,:inbodydescription)" + "(" + ":refid," + ":name," + ":definition," + ":type," + ":argsstring," + ":scope," + ":initializer," + ":bitfield," + ":read," + ":write," + ":prot," + ":static," + ":const," + ":explicit," + ":inline," + ":final," + ":sealed," + ":new," + ":optional," + ":required," + ":volatile," + ":virt," + ":mutable," + ":initonly," + ":attribute," + ":property," + ":readonly," + ":bound," + ":constrained," + ":transient," + ":maybevoid," + ":maybedefault," + ":maybeambiguous," + ":readable," + ":writable," + ":gettable," + ":privategettable," + ":protectedgettable," + ":settable," + ":privatesettable," + ":privategettable," + ":accessor," + ":addable," + ":removable," + ":raisable," + ":kind," + ":bodystart," + ":bodyend," + ":id_bodyfile," + ":id_file," + ":line," + ":column," + ":detaileddescription," + ":briefdescription," + ":inbodydescription" + ")" ,NULL }; ////////////////////////////////////////////////////// @@ -400,11 +529,9 @@ static int insertRefid(sqlite3 *db, const char *refid) } -static void insertMemberReference(sqlite3 *db, const char*src, const char*dst, const char *file, int line, int column) +static void insertMemberReference(sqlite3 *db, int refid_src, int refid_dst, + int id_file, int line, int column) { - int id_file = insertFile(db,file); - int refid_src = insertRefid(db,src); - int refid_dst = insertRefid(db,dst); if (id_file==-1||refid_src==-1||refid_dst==-1) return; @@ -412,26 +539,20 @@ static void insertMemberReference(sqlite3 *db, const char*src, const char*dst, c bindIntParameter(xrefs_insert,":refid_dst",refid_dst); bindIntParameter(xrefs_insert,":id_file",id_file); bindIntParameter(xrefs_insert,":line",line); - bindIntParameter(xrefs_insert,":column",1); + bindIntParameter(xrefs_insert,":column",column); step(db,xrefs_insert); } -static void insertMemberReference(sqlite3 *db, MemberDef *src, MemberDef *dst, const char*floc) +static void insertMemberReference(sqlite3 *db, MemberDef *src, MemberDef *dst) { + QCString qrefid_dst = dst->getOutputFileBase() + "_1" + dst->anchor(); + QCString qrefid_src = src->getOutputFileBase() + "_1" + src->anchor(); if (dst->getStartBodyLine()!=-1 && dst->getBodyDef()) { - static char file[4096]; - int line=0,column=0; - if (floc) - { - int rv = sscanf(floc,"%[^:]:%d:%d",file,&line,&column); - if (rv!=3) - { - msg("unable to read file:line:col location from string [%s]\n",floc); - return; - } - } - insertMemberReference(db,src->anchor().data(),dst->anchor().data(),file,line,column); + int refid_src = insertRefid(db,qrefid_src.data()); + int refid_dst = insertRefid(db,qrefid_dst.data()); + int id_file = insertFile(db,"no-file"); // TODO: replace no-file with proper file + insertMemberReference(db,refid_src,refid_dst,id_file,dst->getStartBodyLine(),-1); } } @@ -462,7 +583,11 @@ static void insertMemberFunctionParams(sqlite3 *db,int id_memberdef,MemberDef *m QCString *s; while ((s=li.current())) { - insertMemberReference(db,md->anchor().data(),s->data(),def->getDefFileName().data(),md->getDefLine(),1); + QCString qrefid_src = md->getOutputFileBase() + "_1" + md->anchor(); + int refid_src = insertRefid(db,qrefid_src.data()); + int refid_dst = insertRefid(db,s->data()); + int id_file = insertFile(db,stripFromPath(def->getDefFileName())); + insertMemberReference(db,refid_src,refid_dst,id_file,md->getDefLine(),-1); ++li; } bindTextParameter(params_select,":type",a->type.data()); @@ -773,6 +898,7 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def) if (al!=0) { bindIntParameter(memberdef_insert,":const",al->constSpecifier); + bindIntParameter(memberdef_insert,":volatile",al->volatileSpecifier); } bindIntParameter(memberdef_insert,":explicit",md->isExplicit()); bindIntParameter(memberdef_insert,":inline",md->isInline()); @@ -784,26 +910,52 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def) bindIntParameter(memberdef_insert,":virt",md->virtualness()); } - // place in the arguments and linkify the arguments if (md->memberType() == MemberType_Variable) { bindIntParameter(memberdef_insert,":mutable",md->isMutable()); bindIntParameter(memberdef_insert,":initonly",md->isInitonly()); + bindIntParameter(memberdef_insert,":attribute",md->isAttribute()); + bindIntParameter(memberdef_insert,":property",md->isProperty()); + bindIntParameter(memberdef_insert,":readonly",md->isReadonly()); + bindIntParameter(memberdef_insert,":bound",md->isBound()); + bindIntParameter(memberdef_insert,":removable",md->isRemovable()); + bindIntParameter(memberdef_insert,":constrained",md->isConstrained()); + bindIntParameter(memberdef_insert,":transient",md->isTransient()); + bindIntParameter(memberdef_insert,":maybevoid",md->isMaybeVoid()); + bindIntParameter(memberdef_insert,":maybedefault",md->isMaybeDefault()); + bindIntParameter(memberdef_insert,":maybeambiguous",md->isMaybeAmbiguous()); + if (md->bitfieldString()) + { + QCString bitfield = md->bitfieldString(); + if (bitfield.at(0)==':') bitfield=bitfield.mid(1); + bindTextParameter(memberdef_insert,":bitfield",bitfield.stripWhiteSpace()); + } } else if (md->memberType() == MemberType_Property) { bindIntParameter(memberdef_insert,":readable",md->isReadable()); bindIntParameter(memberdef_insert,":writable",md->isWritable()); bindIntParameter(memberdef_insert,":gettable",md->isGettable()); + bindIntParameter(memberdef_insert,":privategettable",md->isPrivateGettable()); + bindIntParameter(memberdef_insert,":protectedgettable",md->isProtectedGettable()); bindIntParameter(memberdef_insert,":settable",md->isSettable()); - if (md->isAssign() || md->isCopy() || md->isRetain()) + bindIntParameter(memberdef_insert,":privatesettable",md->isPrivateSettable()); + bindIntParameter(memberdef_insert,":protectedsettable",md->isProtectedSettable()); + if (md->isAssign() || md->isCopy() || md->isRetain() + || md->isStrong() || md->isWeak()) { - int accessor = md->isAssign() ? md->isAssign() : - (md->isCopy() ? md->isCopy() : md->isRetain()) ; + int accessor=0; + if (md->isAssign()) accessor = 1; + else if (md->isCopy()) accessor = 2; + else if (md->isRetain()) accessor = 3; + else if (md->isStrong()) accessor = 4; + else if (md->isWeak()) accessor = 5; bindIntParameter(memberdef_insert,":accessor",accessor); } + bindTextParameter(memberdef_insert,":read",md->getReadAccessor()); + bindTextParameter(memberdef_insert,":write",md->getWriteAccessor()); } else if (md->memberType() == MemberType_Event) { @@ -843,19 +995,6 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def) bindTextParameter(memberdef_insert,":name",md->name()); - if (md->memberType() == MemberType_Property) - { - if (md->isReadable()) - { - bindIntParameter(memberdef_insert,":readable",1); - } - if (md->isWritable()) - { - bindIntParameter(memberdef_insert,":writable",1); - } - } - - // Extract references from initializer if (md->hasMultiLineInitializer() || md->hasOneLineInitializer()) { @@ -874,7 +1013,11 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def) s->data(), md->getBodyDef()->getDefFileName().data(), md->getStartBodyLine())); - insertMemberReference(db,md->anchor().data(),s->data(),md->getBodyDef()->getDefFileName().data(),md->getStartBodyLine(),1); + QCString qrefid_src = md->getOutputFileBase() + "_1" + md->anchor(); + int refid_src = insertRefid(db,qrefid_src.data()); + int refid_dst = insertRefid(db,s->data()); + int id_file = insertFile(db,stripFromPath(md->getBodyDef()->getDefFileName())); + insertMemberReference(db,refid_src,refid_dst,id_file,md->getStartBodyLine(),-1); } ++li; } @@ -893,7 +1036,7 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def) // File location if (md->getDefLine() != -1) { - int id_file = insertFile(db,md->getDefFileName()); + int id_file = insertFile(db,stripFromPath(md->getDefFileName())); if (id_file!=-1) { bindIntParameter(memberdef_insert,":id_file",id_file); @@ -902,7 +1045,7 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def) if (md->getStartBodyLine()!=-1) { - int id_bodyfile = insertFile(db,md->getBodyDef()->absFilePath()); + int id_bodyfile = insertFile(db,stripFromPath(md->getBodyDef()->absFilePath())); if (id_bodyfile == -1) { sqlite3_clear_bindings(memberdef_insert.stmt); @@ -939,7 +1082,7 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def) MemberDef *rmd; for (mdi.toFirst();(rmd=mdi.current());++mdi) { - insertMemberReference(db,md,rmd,mdi.currentKey()); + insertMemberReference(db,md,rmd);//,mdi.currentKey()); } } // + source referenced by @@ -950,7 +1093,7 @@ static void generateSqlite3ForMember(sqlite3*db,MemberDef *md,Definition *def) MemberDef *rmd; for (mdi.toFirst();(rmd=mdi.current());++mdi) { - insertMemberReference(db,rmd,md,mdi.currentKey()); + insertMemberReference(db,rmd,md);//,mdi.currentKey()); } } } @@ -1017,7 +1160,7 @@ static void generateSqlite3ForClass(sqlite3 *db, ClassDef *cd) int refid = insertRefid(db, cd->getOutputFileBase()); bindIntParameter(compounddef_insert,":refid", refid); - int id_file = insertFile(db,cd->getDefFileName().data()); + int id_file = insertFile(db,stripFromPath(cd->getDefFileName())); bindIntParameter(compounddef_insert,":id_file",id_file); bindIntParameter(compounddef_insert,":line",cd->getDefLine()); bindIntParameter(compounddef_insert,":column",cd->getDefColumn()); diff --git a/src/vhdlcode.l b/src/vhdlcode.l index 6d2ebcb..ebebc10 100644 --- a/src/vhdlcode.l +++ b/src/vhdlcode.l @@ -85,6 +85,7 @@ static int g_yyLineNr; //!< current line number static bool g_needsTermination; static Definition *g_searchCtx; +static bool g_exampleBlock; static QCString g_exampleName; static QCString g_exampleFile; @@ -1504,7 +1505,7 @@ void resetVhdlCodeParserState() } 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, MemberDef *memberDef,bool,Definition *searchCtx, bool /* collectXRefs */) @@ -1527,23 +1528,24 @@ void parseVhdlCode(CodeOutputInterface &od,const char *className,const QCString g_needsTermination = FALSE; g_searchCtx = searchCtx; - if (endLine!=-1) - g_inputLines = endLine+1; - else - g_inputLines = countLines(); - if (startLine!=-1) g_yyLineNr = startLine; else g_yyLineNr = 1; + if (endLine!=-1) + g_inputLines = endLine+1; + else + g_inputLines = g_yyLineNr + countLines() - 1; + // g_theCallContext.clear(); g_classScope = className; + g_exampleBlock = exBlock; g_exampleName = exName; g_sourceFileDef = fd; bool cleanupSourceDef = FALSE; - if (fd==0) + if (exBlock && fd==0) { // create a dummy filedef for the example g_sourceFileDef = new FileDef("",exName); diff --git a/src/xmlcode.l b/src/xmlcode.l index fd36ebb..efcac0e 100644 --- a/src/xmlcode.l +++ b/src/xmlcode.l @@ -49,6 +49,7 @@ static int g_yyLineNr; //!< current line number static bool g_needsTermination; static Definition *g_searchCtx; +static bool g_exampleBlock; static QCString g_exampleName; static QCString g_exampleFile; @@ -323,12 +324,12 @@ void parseXmlCode( CodeOutputInterface &od, const char * /*className*/, const QCString &s, - bool /*exBlock*/, + bool exBlock, const char *exName, FileDef *fd, int startLine, int endLine, - bool /*inlineFragment*/, + bool inlineFragment, MemberDef *, bool,Definition *searchCtx, bool /*collectXRefs*/ @@ -345,22 +346,23 @@ void parseXmlCode( g_needsTermination = FALSE; g_searchCtx=searchCtx; - if (endLine!=-1) - g_inputLines = endLine+1; - else - g_inputLines = countLines(); - if (startLine!=-1) g_yyLineNr = startLine; else g_yyLineNr = 1; + if (endLine!=-1) + g_inputLines = endLine+1; + else + g_inputLines = g_yyLineNr + countLines() - 1; + + g_exampleBlock = exBlock; g_exampleName = exName; g_sourceFileDef = fd; bool cleanupSourceDef = FALSE; - if (fd==0) + if (exBlock && fd==0) { // create a dummy filedef for the example g_sourceFileDef = new FileDef("",(exName?exName:"generated")); @@ -372,6 +374,7 @@ void parseXmlCode( setCurrentDoc("l00001"); } + g_includeCodeFragment = inlineFragment; // Starts line 1 on the output startCodeLine(); diff --git a/src/xmldocvisitor.cpp b/src/xmldocvisitor.cpp index b0d6551..815759e 100644 --- a/src/xmldocvisitor.cpp +++ b/src/xmldocvisitor.cpp @@ -329,6 +329,28 @@ void XmlDocVisitor::visit(DocInclude *inc) ); m_t << "</programlisting>"; break; + case DocInclude::SnipWithLines: + { + m_t << "<programlisting>"; + QFileInfo cfi( inc->file() ); + FileDef fd( cfi.dirPath().utf8(), cfi.fileName().utf8() ); + Doxygen::parserManager->getParser(inc->extension()) + ->parseCode(m_ci, + inc->context(), + extractBlock(inc->text(),inc->blockId()), + langExt, + inc->isExample(), + inc->exampleFile(), + &fd, + lineBlock(inc->text(),inc->blockId()), + -1, // endLine + FALSE, // inlineFragment + 0, // memberDef + TRUE // show line number + ); + m_t << "</programlisting>"; + } + break; case DocInclude::SnippetDoc: case DocInclude::IncludeDoc: err("Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s" diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index 1551727..a00c17e 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -804,6 +804,7 @@ static void generateXMLForMember(MemberDef *md,FTextStream &ti,FTextStream &t,De if (md->isWritable()) t << " <write>" << convertToXML(md->getWriteAccessor()) << "</write>" << endl; } + if (md->memberType()==MemberType_Variable && md->bitfieldString()) { QCString bitfield = md->bitfieldString(); |