From 3a97099d5e6afd298486f219694a7fb5eff67fea Mon Sep 17 00:00:00 2001 From: Mark Spruiell Date: Wed, 27 Dec 2017 11:12:07 -0800 Subject: Added *.ice files as a recognized file type. Added a Slice-optimized output mode. --- src/classdef.cpp | 325 +++++++++++++-- src/classdef.h | 6 + src/code.l | 4 +- src/config.xml | 1091 ++++++++++++++++++++++++------------------------ src/context.cpp | 125 ++++-- src/defgen.cpp | 34 +- src/dirdef.cpp | 6 + src/docbookgen.cpp | 47 ++- src/docsets.cpp | 5 + src/dot.cpp | 15 +- src/dot.h | 14 +- src/doxygen.cpp | 151 +++++-- src/entry.cpp | 1 + src/entry.h | 66 +-- src/filedef.cpp | 138 ++++-- src/filedef.h | 6 +- src/ftvhelp.cpp | 69 ++- src/groupdef.cpp | 6 + src/htmlgen.cpp | 18 +- src/index.cpp | 972 ++++++++++++++++++++++++++++++++++++++---- src/index.h | 19 +- src/layout.cpp | 196 ++++++++- src/layout.h | 16 +- src/layout_default.xml | 32 ++ src/marshal.cpp | 2 + src/memberdef.cpp | 83 +++- src/memberdef.h | 5 +- src/membergroup.cpp | 10 + src/membergroup.h | 2 + src/memberlist.cpp | 64 ++- src/memberlist.h | 26 +- src/namespacedef.cpp | 152 ++++++- src/namespacedef.h | 18 +- src/pre.l | 2 +- src/scanner.l | 203 +++++++-- src/searchindex.cpp | 115 +++-- src/searchindex.h | 37 +- src/translator.h | 32 +- src/translator_am.h | 135 ++++++ src/translator_ar.h | 135 ++++++ src/translator_br.h | 135 ++++++ src/translator_ca.h | 135 ++++++ src/translator_cn.h | 135 ++++++ src/translator_cz.h | 135 ++++++ src/translator_de.h | 136 +++++- src/translator_dk.h | 134 ++++++ src/translator_en.h | 136 ++++++ src/translator_eo.h | 135 ++++++ src/translator_es.h | 135 ++++++ src/translator_fa.h | 135 ++++++ src/translator_fi.h | 135 ++++++ src/translator_fr.h | 135 ++++++ src/translator_gr.h | 135 ++++++ src/translator_hr.h | 135 ++++++ src/translator_hu.h | 133 +++++- src/translator_id.h | 135 ++++++ src/translator_it.h | 135 ++++++ src/translator_jp.h | 135 ++++++ src/translator_kr.h | 135 ++++++ src/translator_lt.h | 133 ++++++ src/translator_lv.h | 135 ++++++ src/translator_mk.h | 135 ++++++ src/translator_nl.h | 132 ++++++ src/translator_no.h | 135 ++++++ src/translator_pl.h | 135 ++++++ src/translator_pt.h | 135 ++++++ src/translator_ro.h | 135 ++++++ src/translator_ru.h | 135 ++++++ src/translator_sc.h | 135 ++++++ src/translator_si.h | 135 ++++++ src/translator_sk.h | 135 ++++++ src/translator_sr.h | 135 ++++++ src/translator_sv.h | 133 ++++++ src/translator_tr.h | 135 ++++++ src/translator_tw.h | 135 ++++++ src/translator_ua.h | 135 ++++++ src/translator_vi.h | 135 ++++++ src/translator_za.h | 135 ++++++ src/types.h | 10 +- src/util.cpp | 66 ++- src/util.h | 25 +- src/vhdldocgen.cpp | 3 +- src/xmlgen.cpp | 32 +- 83 files changed, 8594 insertions(+), 1047 deletions(-) diff --git a/src/classdef.cpp b/src/classdef.cpp index 787cd5e..abe7a52 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -17,6 +17,7 @@ #include #include +#include #include #include "classdef.h" #include "classlist.h" @@ -201,6 +202,8 @@ class ClassDefImpl bool isAnonymous; uint64 spec; + + QCString metaData; }; void ClassDefImpl::init(const char *defFileName, const char *name, @@ -1372,27 +1375,53 @@ void ClassDef::writeIncludeFiles(OutputList &ol) { if (m_impl->incInfo /*&& Config_getBool(SHOW_INCLUDE_FILES)*/) { - QCString nm=m_impl->incInfo->includeName.isEmpty() ? - (m_impl->incInfo->fileDef ? - m_impl->incInfo->fileDef->docName().data() : "" - ) : - m_impl->incInfo->includeName.data(); - if (!nm.isEmpty()) + SrcLangExt lang = getLanguage(); + if (lang==SrcLangExt_Slice) { + QCString nm; + QStrList paths = Config_getList(STRIP_FROM_PATH); + if (!paths.isEmpty() && m_impl->incInfo->fileDef) + { + QCString abs = m_impl->incInfo->fileDef->absFilePath(); + const char *s = paths.first(); + QCString potential; + unsigned int length = 0; + while (s) + { + QFileInfo info(s); + if (info.exists()) + { + QString prefix = info.absFilePath(); + if (prefix.at(prefix.length() - 1) != '/') + { + prefix += '/'; + } + + if (prefix.length() > length && + qstricmp(abs.left(prefix.length()).data(), prefix.data()) == 0) // case insensitive compare + { + length = prefix.length(); + potential = abs.right(abs.length() - prefix.length()); + } + s = paths.next(); + } + } + + if (length > 0) + { + nm = potential; + } + } + + if (nm.isEmpty()) + { + nm = m_impl->incInfo->includeName.data(); + } + ol.startParagraph(); + ol.docify("Defined in "); ol.startTypewriter(); - ol.docify(includeStatement()); - SrcLangExt lang = getLanguage(); - bool isIDLorJava = lang==SrcLangExt_IDL || lang==SrcLangExt_Java; - if (m_impl->incInfo->local || isIDLorJava) - ol.docify("\""); - else - ol.docify("<"); - ol.pushGeneratorState(); - ol.disable(OutputGenerator::Html); - ol.docify(nm); - ol.disableAllBut(OutputGenerator::Html); - ol.enable(OutputGenerator::Html); + ol.docify("<"); if (m_impl->incInfo->fileDef) { ol.writeObjectLink(0,m_impl->incInfo->fileDef->includeName(),0,nm); @@ -1401,13 +1430,143 @@ void ClassDef::writeIncludeFiles(OutputList &ol) { ol.docify(nm); } - ol.popGeneratorState(); - if (m_impl->incInfo->local || isIDLorJava) - ol.docify("\""); + ol.docify(">"); + ol.endTypewriter(); + ol.endParagraph(); + } + else + { + QCString nm=m_impl->incInfo->includeName.isEmpty() ? + (m_impl->incInfo->fileDef ? + m_impl->incInfo->fileDef->docName().data() : "" + ) : + m_impl->incInfo->includeName.data(); + if (!nm.isEmpty()) + { + ol.startParagraph(); + ol.startTypewriter(); + ol.docify(includeStatement()); + bool isIDLorJava = lang==SrcLangExt_IDL || lang==SrcLangExt_Java; + if (m_impl->incInfo->local || isIDLorJava) + ol.docify("\""); + else + ol.docify("<"); + ol.pushGeneratorState(); + ol.disable(OutputGenerator::Html); + ol.docify(nm); + ol.disableAllBut(OutputGenerator::Html); + ol.enable(OutputGenerator::Html); + if (m_impl->incInfo->fileDef) + { + ol.writeObjectLink(0,m_impl->incInfo->fileDef->includeName(),0,nm); + } + else + { + ol.docify(nm); + } + ol.popGeneratorState(); + if (m_impl->incInfo->local || isIDLorJava) + ol.docify("\""); + else + ol.docify(">"); + if (isIDLorJava) + ol.docify(";"); + ol.endTypewriter(); + ol.endParagraph(); + } + } + + // Write a summary of the Slice definition including metadata. + if (lang == SrcLangExt_Slice) + { + ol.startParagraph(); + ol.startTypewriter(); + if (!m_impl->metaData.isEmpty()) + { + ol.docify(m_impl->metaData); + ol.lineBreak(); + } + if (m_impl->spec & Entry::Local) + { + ol.docify("local "); + } + if (m_impl->spec & Entry::Interface) + { + ol.docify("interface "); + } + else if (m_impl->spec & Entry::Struct) + { + ol.docify("struct "); + } + else if (m_impl->spec & Entry::Exception) + { + ol.docify("exception "); + } else - ol.docify(">"); - if (isIDLorJava) - ol.docify(";"); + { + ol.docify("class "); + } + ol.docify(stripScope(name())); + if (m_impl->inherits) + { + if (m_impl->spec & (Entry::Interface|Entry::Exception)) + { + ol.docify(" extends "); + BaseClassListIterator it(*m_impl->inherits); + BaseClassDef *ibcd; + for (;(ibcd=it.current());++it) + { + ClassDef *icd = ibcd->classDef; + ol.docify(icd->name()); + if (!it.atLast()) + { + ol.docify(", "); + } + } + } + else + { + // Must be a class. + bool implements = false; + BaseClassListIterator it(*m_impl->inherits); + BaseClassDef *ibcd; + for (;(ibcd=it.current());++it) + { + ClassDef *icd = ibcd->classDef; + if (icd->m_impl->spec & Entry::Interface) + { + implements = true; + } + else + { + ol.docify(" extends "); + ol.docify(icd->name()); + } + } + if (implements) + { + ol.docify(" implements "); + bool first = true; + for (ibcd=it.toFirst();(ibcd=it.current());++it) + { + ClassDef *icd = ibcd->classDef; + if (icd->m_impl->spec & Entry::Interface) + { + if (!first) + { + ol.docify(", "); + } + else + { + first = false; + } + ol.docify(icd->name()); + } + } + } + } + } + ol.docify(" { ... }"); ol.endTypewriter(); ol.endParagraph(); } @@ -1914,6 +2073,10 @@ void ClassDef::writeDeclarationLink(OutputList &ol,bool &found,const char *heade if (lang!=SrcLangExt_VHDL) // for VHDL we swap the name and the type { + if (isSliceLocal()) + { + ol.writeString("local "); + } ol.writeString(ctype); ol.writeString(" "); ol.insertMemberAlign(); @@ -2079,8 +2242,14 @@ void ClassDef::writeDocumentationContents(OutputList &ol,const QCString & /*page case LayoutDocEntry::NamespaceNestedNamespaces: case LayoutDocEntry::NamespaceNestedConstantGroups: case LayoutDocEntry::NamespaceClasses: + case LayoutDocEntry::NamespaceInterfaces: + case LayoutDocEntry::NamespaceStructs: + case LayoutDocEntry::NamespaceExceptions: case LayoutDocEntry::NamespaceInlineClasses: case LayoutDocEntry::FileClasses: + case LayoutDocEntry::FileInterfaces: + case LayoutDocEntry::FileStructs: + case LayoutDocEntry::FileExceptions: case LayoutDocEntry::FileNamespaces: case LayoutDocEntry::FileConstantGroups: case LayoutDocEntry::FileIncludes: @@ -2119,6 +2288,12 @@ QCString ClassDef::title() const m_impl->compType, m_impl->tempArgs != 0); } + else if (lang==SrcLangExt_Slice) + { + pageTitle = theTranslator->trCompoundReferenceSlice(displayName(), + m_impl->compType, + isSliceLocal()); + } else if (lang==SrcLangExt_VHDL) { pageTitle = theTranslator->trCustomReference(VhdlDocGen::getClassTitle(this)); @@ -2157,9 +2332,35 @@ void ClassDef::writeDocumentation(OutputList &ol) static bool generateTreeView = Config_getBool(GENERATE_TREEVIEW); //static bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN); //static bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL); + static bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE); QCString pageTitle = title(); - startFile(ol,getOutputFileBase(),name(),pageTitle,HLI_ClassVisible,!generateTreeView); + HighlightedItem hli; + if (sliceOpt) + { + if (isInterface()) + { + hli = HLI_InterfaceVisible; + } + else if (isStruct()) + { + hli = HLI_StructVisible; + } + else if (isException()) + { + hli = HLI_ExceptionVisible; + } + else + { + hli = HLI_ClassVisible; + } + } + else + { + hli = HLI_ClassVisible; + } + + startFile(ol,getOutputFileBase(),name(),pageTitle,hli,!generateTreeView); if (!generateTreeView) { if (getOuterScope()!=Doxygen::globalScope) @@ -2286,15 +2487,40 @@ void ClassDef::writeMemberList(OutputList &ol) { static bool cOpt = Config_getBool(OPTIMIZE_OUTPUT_FOR_C); //static bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL); + static bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE); static bool generateTreeView = Config_getBool(GENERATE_TREEVIEW); if (m_impl->allMemberNameInfoSDict==0 || cOpt) return; // only for HTML ol.pushGeneratorState(); ol.disableAllBut(OutputGenerator::Html); + HighlightedItem hli; + if (sliceOpt) + { + if (isInterface()) + { + hli = HLI_InterfaceVisible; + } + else if (isStruct()) + { + hli = HLI_StructVisible; + } + else if (isException()) + { + hli = HLI_ExceptionVisible; + } + else + { + hli = HLI_ClassVisible; + } + } + else + { + hli = HLI_ClassVisible; + } + QCString memListFile = getMemberListFileName(); - startFile(ol,memListFile,memListFile,theTranslator->trMemberList(), - HLI_ClassVisible,!generateTreeView,getOutputFileBase()); + startFile(ol,memListFile,memListFile,theTranslator->trMemberList(),hli,!generateTreeView,getOutputFileBase()); if (!generateTreeView) { if (getOuterScope()!=Doxygen::globalScope) @@ -3549,19 +3775,21 @@ QCString ClassDef::compoundTypeString() const } else { + QCString type; switch (m_impl->compType) { - case Class: return isJavaEnum() ? "enum" : "class"; - case Struct: return "struct"; - case Union: return "union"; - case Interface: return getLanguage()==SrcLangExt_ObjC ? "class" : "interface"; - case Protocol: return "protocol"; - case Category: return "category"; - case Exception: return "exception"; - case Service: return "service"; - case Singleton: return "singleton"; + case Class: type += isJavaEnum() ? "enum" : "class"; break; + case Struct: type += "struct"; break; + case Union: type += "union"; break; + case Interface: type += getLanguage()==SrcLangExt_ObjC ? "class" : "interface"; break; + case Protocol: type += "protocol"; break; + case Category: type += "category"; break; + case Exception: type += "exception"; break; + case Service: type += "service"; break; + case Singleton: type += "singleton"; break; default: return "unknown"; } + return type; } } @@ -4746,12 +4974,37 @@ bool ClassDef::subGrouping() const return m_impl->subGrouping; } +bool ClassDef::isInterface() const +{ + return m_impl->compType == Interface; +} + +bool ClassDef::isStruct() const +{ + return m_impl->compType == Struct; +} + +bool ClassDef::isException() const +{ + return m_impl->compType == Exception; +} + +bool ClassDef::isSliceLocal() const +{ + return m_impl->spec&Entry::Local; +} + void ClassDef::setName(const char *name) { m_impl->isAnonymous = QCString(name).find('@')!=-1; Definition::setName(name); } +void ClassDef::setMetaData(const char *md) +{ + m_impl->metaData = md; +} + bool ClassDef::isAnonymous() const { return m_impl->isAnonymous; diff --git a/src/classdef.h b/src/classdef.h index 12fcd93..caa2750 100644 --- a/src/classdef.h +++ b/src/classdef.h @@ -336,6 +336,10 @@ class ClassDef : public Definition QCString getMemberListFileName() const; bool subGrouping() const; + bool isInterface() const; + bool isStruct() const; + bool isException() const; + bool isSliceLocal() const; //----------------------------------------------------------------------------------- // --- setters ---- @@ -376,6 +380,8 @@ class ClassDef : public Definition void setTagLessReference(ClassDef *cd); void setName(const char *name); + void setMetaData(const char *md); + //----------------------------------------------------------------------------------- // --- actions ---- //----------------------------------------------------------------------------------- diff --git a/src/code.l b/src/code.l index a55ab1a..3fd2f6a 100644 --- a/src/code.l +++ b/src/code.l @@ -1834,7 +1834,7 @@ KEYWORD_OBJC ("@public"|"@private"|"@protected"|"@class"|"@implementation"|"@int KEYWORD ("asm"|"__assume"|"auto"|"class"|"const"|"delete"|"enum"|"explicit"|"extern"|"false"|"friend"|"gcnew"|"gcroot"|"set"|"get"|"inline"|"internal"|"mutable"|"namespace"|"new"|"null"|"nullptr"|"override"|"operator"|"pin_ptr"|"private"|"protected"|"public"|"raise"|"register"|"remove"|"self"|"sizeof"|"static"|"struct"|"__super"|"function"|"template"|"generic"|"this"|"true"|"typedef"|"typeid"|"typename"|"union"|"using"|"virtual"|"volatile"|"abstract"|"final"|"import"|"synchronized"|"transient"|"alignas"|"alignof"|{KEYWORD_OBJC}) FLOWKW ("break"|"catch"|"continue"|"default"|"do"|"else"|"finally"|"return"|"switch"|"throw"|"throws"|"@catch"|"@finally") FLOWCONDITION ("case"|"for"|"foreach"|"for each"|"goto"|"if"|"try"|"while"|"@try") -TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"object"|"short"|"signed"|"unsigned"|"void"|"wchar_t"|"size_t"|"boolean"|"id"|"SEL"|"string"|"nullptr") +TYPEKW ("bool"|"byte"|"char"|"double"|"float"|"int"|"long"|"object"|"short"|"signed"|"unsigned"|"void"|"wchar_t"|"size_t"|"boolean"|"id"|"SEL"|"string"|"nullptr"|"LocalObject"|"Object"|"Value") CASTKW ("const_cast"|"dynamic_cast"|"reinterpret_cast"|"static_cast") CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^' \\\n]{1,4}"'")) ARITHOP "+"|"-"|"/"|"*"|"%"|"--"|"++" @@ -2241,7 +2241,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" unput(*yytext); BEGIN( Body ); } -("extends"|"implements") { // Java +("extends"|"implements") { // Java, Slice startFontClass("keyword"); codifyLines(yytext); endFontClass(); diff --git a/src/config.xml b/src/config.xml index 08795dc..74c50c2 100644 --- a/src/config.xml +++ b/src/config.xml @@ -4,13 +4,13 @@ =) and one or more values. If the same tag is assigned more than once, the last assignment overwrites any earlier assignment. For tags that take a list as their argument, -the += operator can be used instead of = to append -new values to the list. Values are sequences of non-blanks. If the value should +the += operator can be used instead of = to append +new values to the list. Values are sequences of non-blanks. If the value should contain one or more blanks it must be surrounded by quotes ("..."). Multiple lines can be concatenated by inserting a backslash (\c \\) -as the last character of a line. Environment variables can be expanded +as the last character of a line. Environment variables can be expanded using the pattern \$(ENV_VARIABLE_NAME). You can also include part of a configuration file from another configuration file using a \@INCLUDE tag as follows: \verbatim @INCLUDE = config_file_name -\endverbatim -The include file is searched in the current working directory. You can +\endverbatim +The include file is searched in the current working directory. You can also specify a list of directories that should be searched before looking -in the current working directory. Do this by putting a \@INCLUDE_PATH tag +in the current working directory. Do this by putting a \@INCLUDE_PATH tag with these paths before the \@INCLUDE tag, e.g.: \verbatim @INCLUDE_PATH = my_config_dir \endverbatim The configuration options can be divided into several categories. -Below is an alphabetical index of the tags that are recognized +Below is an alphabetical index of the tags that are recognized followed by the descriptions of the tags grouped by category. ]]> @@ -91,14 +91,14 @@ Values that contain spaces should be placed between quotes (\" \"). /usr/bin, a more realistic configuration file would be: \verbatim PROJECT_NAME = Example @@ -109,7 +109,7 @@ PERL_PATH = /usr/local/bin/perl SEARCHENGINE = NO \endverbatim -To generate the documentation for the +To generate the documentation for the QdbtTabular package I have used the following configuration file: \verbatim @@ -160,7 +160,7 @@ INPUT = $(QTDIR)/doc \ $(QTDIR)/src/dialogs \ $(QTDIR)/src/tools FILE_PATTERNS = *.cpp *.h q*.doc -INCLUDE_PATH = $(QTDIR)/include +INCLUDE_PATH = $(QTDIR)/include RECURSIVE = YES \endverbatim @@ -212,7 +212,7 @@ Go to the next section or return to the + @@ -670,9 +680,9 @@ Go to the next section or return to the @@ -713,8 +723,8 @@ Go to the next section or return to the For Microsoft's IDL there are \c propget and \c propput attributes to indicate getter and setter methods for a property. Setting this option to \c YES will make doxygen to replace the get and set methods by a property in the - documentation. This will only work if the methods are indeed getting or - setting a simple type. If this is not the case, or you want to show the + documentation. This will only work if the methods are indeed getting or + setting a simple type. If this is not the case, or you want to show the methods anyway, you should set this option to \c NO. ]]> @@ -745,16 +755,16 @@ Go to the next section or return to the the same type (for instance a group of public functions) to be put as a subgroup of that type (e.g. under the Public Functions section). Set it to \c NO to prevent subgrouping. Alternatively, this can be done per class using - the \ref cmdnosubgrouping "\\nosubgrouping" command. + the \ref cmdnosubgrouping "\\nosubgrouping" command. ]]>