diff options
62 files changed, 839 insertions, 407 deletions
diff --git a/examples/include.cpp b/examples/include.cpp index ba8c054..d9ea5ea 100644 --- a/examples/include.cpp +++ b/examples/include.cpp @@ -8,7 +8,7 @@ class Include_Test void example(); }; -/*! \page example +/*! \page pag_example * \dontinclude include_test.cpp * Our main function starts like this: * \skip main diff --git a/src/clangparser.cpp b/src/clangparser.cpp index 77151d6..2ea15ee 100644 --- a/src/clangparser.cpp +++ b/src/clangparser.cpp @@ -4,6 +4,7 @@ #if USE_LIBCLANG #include <clang-c/Index.h> +#include "clang/Tooling/CompilationDatabase.h" #include "clang/Tooling/Tooling.h" #include <qfileinfo.h> #include <stdlib.h> diff --git a/src/classdef.cpp b/src/classdef.cpp index 4ce48a7..f810154 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -440,7 +440,7 @@ void ClassDef::internalInsertMember(MemberDef *md, if (getLanguage()==SrcLangExt_VHDL) { - QCString title=VhdlDocGen::trVhdlType(md->getMemberSpecifiers(),FALSE); + QCString title=theTranslator->trVhdlType(md->getMemberSpecifiers(),FALSE); if (!m_impl->vhdlSummaryTitles.find(title)) { m_impl->vhdlSummaryTitles.append(title,new QCString(title)); @@ -1882,7 +1882,7 @@ void ClassDef::writeDeclarationLink(OutputList &ol,bool &found,const char *heade } else if (lang==SrcLangExt_VHDL) { - ol.parseText(VhdlDocGen::trVhdlType(VhdlDocGen::ARCHITECTURE,FALSE)); + ol.parseText(theTranslator->trVhdlType(VhdlDocGen::ARCHITECTURE,FALSE)); } else { @@ -2122,7 +2122,7 @@ QCString ClassDef::title() const } else if (lang==SrcLangExt_VHDL) { - pageTitle = VhdlDocGen::getClassTitle(this)+" Reference"; + pageTitle = theTranslator->trCustomReference(VhdlDocGen::getClassTitle(this)); } else if (isJavaEnum()) { @@ -2474,7 +2474,7 @@ void ClassDef::writeMemberList(OutputList &ol) QStrList sl; if (lang==SrcLangExt_VHDL) { - sl.append(VhdlDocGen::trVhdlType(md->getMemberSpecifiers())); //append vhdl type + sl.append(theTranslator->trVhdlType(md->getMemberSpecifiers(),TRUE)); //append vhdl type } else if (md->isFriend()) sl.append("friend"); else if (md->isRelated()) sl.append("related"); diff --git a/src/commentscan.l b/src/commentscan.l index de31b2e..55c55a7 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -548,7 +548,7 @@ static void addXRefItem(const char *listName,const char *itemTitle, if (docEntry->sli) { QListIterator<ListItemInfo> slii(*docEntry->sli); - for (slii.toFirst();(lii=slii.current());++slii) + for (slii.toLast();(lii=slii.current());--slii) { if (qstrcmp(lii->type,listName)==0) { diff --git a/src/config.xml b/src/config.xml index fa0ae26..2dcc0f4 100644 --- a/src/config.xml +++ b/src/config.xml @@ -2533,13 +2533,14 @@ EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ... ]]> </docs> </option> - <option type='string' id='LATEX_CMD_NAME' format='file' defval='latex' depends='GENERATE_LATEX'> + <option type='string' id='LATEX_CMD_NAME' format='file' defval='' depends='GENERATE_LATEX'> <docs> <![CDATA[ The \c LATEX_CMD_NAME tag can be used to specify the \f$\mbox{\LaTeX}\f$ command name to be invoked. - <br>Note that when enabling \ref cfg_use_pdflatex "USE_PDFLATEX" this option is only used for - generating bitmaps for formulas in the HTML output, but not in the - \c Makefile that is written to the output directory. + <br>Note that when not enabling \ref cfg_use_pdflatex "USE_PDFLATEX" the default is \c latex when + enabling \ref cfg_use_pdflatex "USE_PDFLATEX" the default is \c pdflatex and when in the later case + \c latex is chosen this is overwritten by \c pdflatex. For specific output languages the default can + have been set differently, this depends on the implementation of the output language. ]]> </docs> </option> diff --git a/src/context.cpp b/src/context.cpp index 4584920..c9a6bb3 100644 --- a/src/context.cpp +++ b/src/context.cpp @@ -617,7 +617,7 @@ class TranslateContext::Private TemplateVariant classes() const { return theTranslator->trClasses(); - // TODO: VHDL: trVhdlType(VhdlDocGen::ENTITY,FALSE) + // TODO: VHDL: theTranslator->trVhdlType(VhdlDocGen::ENTITY,FALSE) // TODO: Fortran: trDataTypes() } TemplateVariant classList() const @@ -927,8 +927,8 @@ class TranslateContext::Private { static bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN); static bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL); - return fortranOpt ? theTranslator->trSubprograms() : - vhdlOpt ? VhdlDocGen::trFunctionAndProc() : + return fortranOpt ? theTranslator->trSubprograms() : + vhdlOpt ? theTranslator->trFunctionAndProc() : theTranslator->trFunctions(); } TemplateVariant variables() const @@ -2816,7 +2816,7 @@ class NamespaceContext::Private : public DefinitionContext<NamespaceContext::Pri QCString title = theTranslator->trFunctions(); SrcLangExt lang = m_namespaceDef->getLanguage(); if (lang==SrcLangExt_Fortran) title=theTranslator->trSubprograms(); - else if (lang==SrcLangExt_VHDL) title=VhdlDocGen::trFunctionAndProc(); + else if (lang==SrcLangExt_VHDL) title=theTranslator->trFunctionAndProc(); return getMemberList(getCache().functions,MemberListType_decFuncMembers,title); } TemplateVariant variables() const @@ -3249,7 +3249,7 @@ class FileContext::Private : public DefinitionContext<FileContext::Private> QCString title = theTranslator->trFunctions(); SrcLangExt lang = m_fileDef->getLanguage(); if (lang==SrcLangExt_Fortran) title=theTranslator->trSubprograms(); - else if (lang==SrcLangExt_VHDL) title=VhdlDocGen::trFunctionAndProc(); + else if (lang==SrcLangExt_VHDL) title=theTranslator->trFunctionAndProc(); return getMemberList(getCache().functions,MemberListType_decFuncMembers,title); } TemplateVariant variables() const @@ -5489,7 +5489,7 @@ class ModuleContext::Private : public DefinitionContext<ModuleContext::Private> QCString title = theTranslator->trFunctions(); SrcLangExt lang = m_groupDef->getLanguage(); if (lang==SrcLangExt_Fortran) title=theTranslator->trSubprograms(); - else if (lang==SrcLangExt_VHDL) title=VhdlDocGen::trFunctionAndProc(); + else if (lang==SrcLangExt_VHDL) title=theTranslator->trFunctionAndProc(); return getMemberList(getCache().functions,MemberListType_decFuncMembers,title); } TemplateVariant variables() const @@ -5828,7 +5828,7 @@ class ClassIndexContext::Private } else if (vhdlOpt) { - return VhdlDocGen::trDesignUnits(); + return theTranslator->trDesignUnits(); } else { @@ -6022,7 +6022,7 @@ class ClassHierarchyContext::Private static bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL); if (vhdlOpt) { - return VhdlDocGen::trDesignUnitHierarchy(); + return theTranslator->trDesignUnitHierarchy(); } else { @@ -6780,7 +6780,7 @@ class ClassTreeContext::Private } else if (vhdlOpt) { - return VhdlDocGen::trDesignUnitList(); + return theTranslator->trDesignUnitList(); } else { diff --git a/src/docparser.cpp b/src/docparser.cpp index 215439a..29c6ca7 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -5037,25 +5037,27 @@ void DocPara::handleIncludeOperator(const QCString &cmdName,DocIncOperator::Type void DocPara::handleImage(const QCString &cmdName) { + QCString saveCmdName = cmdName; + int tok=doctokenizerYYlex(); if (tok!=TK_WHITESPACE) { warn_doc_error(g_fileName,doctokenizerYYlineno,"expected whitespace after %s command", - qPrint(cmdName)); + qPrint(saveCmdName)); return; } tok=doctokenizerYYlex(); if (tok!=TK_WORD && tok!=TK_LNKWORD) { warn_doc_error(g_fileName,doctokenizerYYlineno,"unexpected token %s as the argument of %s", - tokToString(tok),qPrint(cmdName)); + tokToString(tok),qPrint(saveCmdName)); return; } tok=doctokenizerYYlex(); if (tok!=TK_WHITESPACE) { warn_doc_error(g_fileName,doctokenizerYYlineno,"expected whitespace after %s command", - qPrint(cmdName)); + qPrint(saveCmdName)); return; } DocImage::Type t; @@ -5066,9 +5068,9 @@ void DocPara::handleImage(const QCString &cmdName) else if (imgType=="rtf") t=DocImage::Rtf; else { - warn_doc_error(g_fileName,doctokenizerYYlineno,"image type %s specified as the first argument of " - "%s is not valid", - qPrint(imgType),qPrint(cmdName)); + warn_doc_error(g_fileName,doctokenizerYYlineno,"output format %s specified as the first argument of " + "%s command is not valid", + qPrint(imgType),qPrint(saveCmdName)); return; } doctokenizerYYsetStateFile(); @@ -5077,7 +5079,7 @@ void DocPara::handleImage(const QCString &cmdName) if (tok!=TK_WORD) { warn_doc_error(g_fileName,doctokenizerYYlineno,"unexpected token %s as the argument of %s", - tokToString(tok),qPrint(cmdName)); + tokToString(tok),qPrint(saveCmdName)); return; } HtmlAttribList attrList; diff --git a/src/filedef.cpp b/src/filedef.cpp index 74c4c67..e2df9be 100644 --- a/src/filedef.cpp +++ b/src/filedef.cpp @@ -1420,7 +1420,6 @@ bool FileDef::generateSourceFile() const { static bool sourceBrowser = Config_getBool(SOURCE_BROWSER); static bool verbatimHeaders = Config_getBool(VERBATIM_HEADERS); - QCString extension = name().right(4); return !isReference() && (sourceBrowser || (verbatimHeaders && guessSection(name())==Entry::HEADER_SEC) diff --git a/src/formula.cpp b/src/formula.cpp index 6fe617d..9e48b2d 100644 --- a/src/formula.cpp +++ b/src/formula.cpp @@ -25,6 +25,7 @@ #include "util.h" #include "message.h" #include "config.h" +#include "language.h" #include "portable.h" #include "index.h" #include "doxygen.h" @@ -96,8 +97,7 @@ void FormulaList::generateBitmaps(const char *path) { //printf("Running latex...\n"); //system("latex _formulas.tex </dev/null >/dev/null"); - QCString latexCmd = Config_getString(LATEX_CMD_NAME); - if (latexCmd.isEmpty()) latexCmd="latex"; + QCString latexCmd = theTranslator->latexCommandName(); portable_sysTimerStart(); if (portable_system(latexCmd,"_formulas.tex")!=0) { diff --git a/src/fortrancode.l b/src/fortrancode.l index 14268cf..e64c38e 100644 --- a/src/fortrancode.l +++ b/src/fortrancode.l @@ -687,7 +687,7 @@ NUM_TYPE (complex|integer|logical|real) LOG_OPER (\.and\.|\.eq\.|\.eqv\.|\.ge\.|\.gt\.|\.le\.|\.lt\.|\.ne\.|\.neqv\.|\.or\.|\.not\.) KIND {ARGS} CHAR (CHARACTER{ARGS}?|CHARACTER{BS}"*"({BS}[0-9]+|{ARGS})) -TYPE_SPEC (({NUM_TYPE}({BS}"*"{BS}[0-9]+)?)|({NUM_TYPE}{KIND})|DOUBLE{BS}COMPLEX|DOUBLE{BS}PRECISION|{CHAR}|TYPE|CLASS|PROCEDURE) +TYPE_SPEC (({NUM_TYPE}({BS}"*"{BS}[0-9]+)?)|({NUM_TYPE}{KIND})|DOUBLE{BS}COMPLEX|DOUBLE{BS}PRECISION|{CHAR}|TYPE|CLASS|PROCEDURE|ENUMERATOR) INTENT_SPEC intent{BS}"("{BS}(in|out|in{BS}out){BS}")" ATTR_SPEC (IMPLICIT|ALLOCATABLE|DIMENSION{ARGS}|EXTERNAL|{INTENT_SPEC}|INTRINSIC|OPTIONAL|PARAMETER|POINTER|PROTECTED|PRIVATE|PUBLIC|SAVE|TARGET|(NON_)?RECURSIVE|PURE|IMPURE|ELEMENTAL|VALUE|NOPASS|DEFERRED|CONTIGUOUS|VOLATILE) @@ -697,7 +697,8 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION FLOW (DO|SELECT|CASE|SELECT{BS}(CASE|TYPE)|WHERE|IF|THEN|ELSE|WHILE|FORALL|ELSEWHERE|ELSEIF|RETURN|CONTINUE|EXIT|GO{BS}TO) COMMANDS (FORMAT|CONTAINS|MODULE{BS_}PROCEDURE|WRITE|READ|ALLOCATE|ALLOCATED|ASSOCIATED|PRESENT|DEALLOCATE|NULLIFY|SIZE|INQUIRE|OPEN|CLOSE|FLUSH|DATA|COMMON) IGNORE (CALL) -PREFIX ((NON_)?RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,4}((NON_)?RECURSIVE|IMPURE|PURE|ELEMENTAL)? +PREFIX ((NON_)?RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,4}((NON_)?RECURSIVE|IMPURE|PURE|ELEMENTAL)?0 +LANGUAGE_BIND_SPEC BIND{BS}"("{BS}C{BS}(,{BS}NAME{BS}"="{BS}"\""(.*)"\""{BS})?")" /* | */ @@ -778,12 +779,12 @@ PREFIX ((NON_)?RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,4}((NON BEGIN(Use); } <Use>"ONLY" { // TODO: rename - startFontClass("keywordtype"); - codifyLines(yytext); - endFontClass(); + startFontClass("keywordtype"); + codifyLines(yytext); + endFontClass(); yy_push_state(YY_START); - BEGIN(UseOnly); - } + BEGIN(UseOnly); + } <Use>{ID} { QCString tmp = yytext; tmp = tmp.lower(); @@ -844,6 +845,20 @@ PREFIX ((NON_)?RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,4}((NON BEGIN(ClassName); if (!qstricmp(yytext,"module")) currentModule="module"; } +<Start>("enum")/{BS_}|{BS}{COMMA}{BS}{LANGUAGE_BIND_SPEC}|\n { // + startScope(); + startFontClass("keyword"); + codifyLines(yytext); + endFontClass(); + yy_push_state(YY_START); + BEGIN(ClassName); + currentClass="class"; + } +<*>{LANGUAGE_BIND_SPEC} { // + startFontClass("keyword"); + codifyLines(yytext); + endFontClass(); + } <Start>("type")/{BS_}|({COMMA}({ACCESS_SPEC}|ABSTRACT|EXTENDS))|\n { // startScope(); startFontClass("keyword"); @@ -869,15 +884,19 @@ PREFIX ((NON_)?RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,4}((NON } <ClassName>\n { // interface may be without name yy_pop_state(); - YY_FTN_REJECT; - } + YY_FTN_REJECT; + } +<Start>^{BS}"end"({BS_}"enum").* { // just reset currentClass, rest is done in following rule + currentClass=0; + YY_FTN_REJECT; + } <Start>^{BS}"end"({BS_}"type").* { // just reset currentClass, rest is done in following rule currentClass=0; - YY_FTN_REJECT; + YY_FTN_REJECT; } <Start>^{BS}"end"({BS_}"module").* { // just reset currentModule, rest is done in following rule currentModule=0; - YY_FTN_REJECT; + YY_FTN_REJECT; } /*-------- subprog definition -------------------------------------*/ <Start>({PREFIX}{BS_})?{TYPE_SPEC}{BS_}({PREFIX}{BS_})?{BS}/{SUBPROG}{BS_} { // TYPE_SPEC is for old function style function result @@ -910,7 +929,7 @@ PREFIX ((NON_)?RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,4}((NON yy_pop_state(); YY_FTN_RESET } -<Start>^{BS}"end"{BS}("block"{BS}"data"|{SUBPROG}|"module"|"program"|"type"|"interface")?{BS} { // Fortran subroutine or function ends +<Start>^{BS}"end"{BS}("block"{BS}"data"|{SUBPROG}|"module"|"program"|"enum"|"type"|"interface")?{BS} { // Fortran subroutine or function ends //cout << "===> end function " << yytext << endl; endScope(); startFontClass("keyword"); @@ -923,7 +942,7 @@ PREFIX ((NON_)?RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,4}((NON generateLink(*g_code,yytext); yy_pop_state(); } -<Start>^{BS}"end"{BS}("block"{BS}"data"|{SUBPROG}|"module"|"program"|"type"|"interface"){BS}/(\n|!) { // Fortran subroutine or function ends +<Start>^{BS}"end"{BS}("block"{BS}"data"|{SUBPROG}|"module"|"program"|"enum"|"type"|"interface"){BS}/(\n|!) { // Fortran subroutine or function ends //cout << "===> end function " << yytext << endl; endScope(); startFontClass("keyword"); @@ -966,8 +985,11 @@ PREFIX ((NON_)?RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,4}((NON g_code->codify(yytext); endFontClass(); } - else if (g_currentMemberDef && ((g_currentMemberDef->isFunction() && (g_currentMemberDef->typeString() != QCString("subroutine") || inTypeDecl)) || - g_currentMemberDef->isVariable())) + else if (g_currentMemberDef && + ((g_currentMemberDef->isFunction() && (g_currentMemberDef->typeString()!=QCString("subroutine") || inTypeDecl)) || + g_currentMemberDef->isVariable() || g_currentMemberDef->isEnumValue() + ) + ) { generateLink(*g_code, yytext); } @@ -1050,11 +1072,20 @@ PREFIX ((NON_)?RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,4}((NON // fixed form continuation line YY_FTN_REJECT; } + else if (QCString(yytext).stripWhiteSpace().lower() == "type") + { + yy_push_state(YY_START); + BEGIN(Declaration); + startFontClass("keywordtype"); + g_code->codify(QCString(yytext).stripWhiteSpace()); + endFontClass(); + g_code->codify(yytext + 4); + } else { - g_insideBody=TRUE; + g_insideBody=TRUE; generateLink(*g_code, yytext); - g_insideBody=FALSE; + g_insideBody=FALSE; } } diff --git a/src/fortranscanner.l b/src/fortranscanner.l index 774251b..d0503c2 100644 --- a/src/fortranscanner.l +++ b/src/fortranscanner.l @@ -164,6 +164,7 @@ static Entry* global_root = 0 ; static Entry* file_root = 0 ; static Entry* current = 0 ; static Entry* last_entry = 0 ; +static Entry* last_enum = 0 ; static ScanVar v_type = V_IGNORE; // type of parsed variable static QList<Entry> moduleProcedures; // list of all interfaces which contain unresolved // module procedures @@ -198,8 +199,8 @@ static SymbolModifiers currentModifiers; //! Holds program scope->symbol name->symbol modifiers. static QMap<Entry*,QMap<QCString,SymbolModifiers> > modifiers; -static Entry *global_scope = NULL; - +static Entry *global_scope = NULL; +static int anonCount = 0 ; //----------------------------------------------------------------------------- static int yyread(char *buf,int max_size); @@ -228,6 +229,7 @@ static QCString extractFromParens(const QCString name); static CommentInPrepass* locatePrepassComment(int from, int to); static void updateVariablePrepassComment(int from, int to); static void newLine(); +static void initEntry(); //----------------------------------------------------------------------------- #undef YY_INPUT @@ -263,7 +265,7 @@ NUM_TYPE (complex|integer|logical|real) LOG_OPER (\.and\.|\.eq\.|\.eqv\.|\.ge\.|\.gt\.|\.le\.|\.lt\.|\.ne\.|\.neqv\.|\.or\.|\.not\.) KIND {ARGS} CHAR (CHARACTER{ARGS}?|CHARACTER{BS}"*"({BS}[0-9]+|{ARGS})) -TYPE_SPEC (({NUM_TYPE}({BS}"*"{BS}[0-9]+)?)|({NUM_TYPE}{KIND})|DOUBLE{BS}COMPLEX|DOUBLE{BS}PRECISION|{CHAR}|TYPE{ARGS}|CLASS{ARGS}|PROCEDURE{ARGS}?) +TYPE_SPEC (({NUM_TYPE}({BS}"*"{BS}[0-9]+)?)|({NUM_TYPE}{KIND})|DOUBLE{BS}COMPLEX|DOUBLE{BS}PRECISION|ENUMERATOR|{CHAR}|TYPE{ARGS}|CLASS{ARGS}|PROCEDURE{ARGS}?) INTENT_SPEC intent{BS}"("{BS}(in|out|in{BS}out){BS}")" ATTR_SPEC (EXTERNAL|ALLOCATABLE|DIMENSION{ARGS}|{INTENT_SPEC}|INTRINSIC|OPTIONAL|PARAMETER|POINTER|PROTECTED|PRIVATE|PUBLIC|SAVE|TARGET|NOPASS|PASS{ARGS}?|DEFERRED|NON_OVERRIDABLE|CONTIGUOUS|VOLATILE|VALUE) @@ -300,6 +302,7 @@ SCOPENAME ({ID}{BS}"::"{BS})* %x Variable %x Initialization %x ArrayInitializer +%x Enum %x Typedef %x TypedefBody %x TypedefBodyContains @@ -726,8 +729,17 @@ private { {ID} { } } -<Start,ModuleBody,TypedefBody,SubprogBody>{ +<Start,ModuleBody,TypedefBody,SubprogBody,Enum>{ ^{BS}{TYPE_SPEC}/{SEPARATE} { + last_enum = 0; + if (YY_START == Enum) + { + argType = "@"; // enum marker + } + else + { + argType = QCString(yytext).simplifyWhiteSpace().lower(); + } current->bodyLine = yyLineNr + 1; current->endBodyLine = yyLineNr + lineCountPrepass; /* variable declaration starts */ @@ -736,7 +748,6 @@ private { addModule(NULL); yy_push_state(ModuleBody); //anon program } - argType = QCString(yytext).simplifyWhiteSpace().lower(); yy_push_state(AttributeList); } /* Dimitri: macro expansion should already be done during preprocessing not here! @@ -834,17 +845,30 @@ private { modifiers[current_root][name.lower()] |= currentModifiers; argName= name; - v_type= V_IGNORE; - if (!argType.isEmpty() && current_root->section!=Entry::FUNCTION_SEC) - { // new variable entry - v_type = V_VARIABLE; + v_type= V_IGNORE; + if (!argType.isEmpty() && current_root->section!=Entry::FUNCTION_SEC) + { // new variable entry + v_type = V_VARIABLE; current->section = Entry::VARIABLE_SEC; - current->name = argName; - current->type = argType; - current->fileName = yyFileName; - current->bodyLine = yyLineNr; // used for source reference + current->name = argName; + current->type = argType; + current->fileName = yyFileName; + current->bodyLine = yyLineNr; // used for source reference current->startLine = yyLineNr; - addCurrentEntry(1); + if (argType == "@") + { + current_root->addSubEntry(current); + current = new Entry(*current); + // add to the scope surrounding the enum (copy!) + current_root->parent()->addSubEntry(current); + last_enum = current; + current = new Entry ; + initEntry(); + } + else + { + addCurrentEntry(1); + } } else if (!argType.isEmpty()) { // declaration of parameter list: add type for corr. parameter @@ -980,19 +1004,72 @@ private { { updateVariablePrepassComment(yyColNr-(int)yyleng, yyColNr); yy_pop_state(); // end initialization - if (v_type == V_VARIABLE) last_entry->initializer= initializer; + if (last_enum) + { + last_enum->initializer= initializer; + } + else + { + if (v_type == V_VARIABLE) last_entry->initializer= initializer; + } } else initializer+=", "; } <Initialization>"\n"|"!" { //| yy_pop_state(); // end initialization - if (v_type == V_VARIABLE) last_entry->initializer= initializer; + if (last_enum) + { + last_enum->initializer= initializer; + } + else + { + if (v_type == V_VARIABLE) last_entry->initializer= initializer; + } yyColNr -= 1; unput(*yytext); } <Initialization>. { initializer+=yytext; } +<*>{BS}"enum"{BS}","{BS}"bind"{BS}"("{BS}"c"{BS}")"{BS} { + if(YY_START == Start) + { + addModule(NULL); + yy_push_state(ModuleBody); //anon program + } + + yy_push_state(Enum); + current->protection = defaultProtection; + typeProtection = defaultProtection; + typeMode = true; + + current->spec |= Entry::Struct; + current->name.resize(0); + current->args.resize(0); + current->name.sprintf("@%d",anonCount++); + + current->section = Entry::ENUM_SEC; + current->fileName = yyFileName; + current->startLine = yyLineNr; + current->bodyLine = yyLineNr; + if ((current_root) && + (current_root->section == Entry::CLASS_SEC + || current_root->section == Entry::NAMESPACE_SEC)) + { + current->name = current_root->name + "::" + current->name; + } + + addCurrentEntry(1); + startScope(last_entry); + BEGIN( Enum ) ; + } +<Enum>"end"{BS}"enum" { + last_entry->parent()->endBodyLine = yyLineNr; + if (!endScope(current_root)) + yyterminate(); + typeMode = false; + yy_pop_state(); + } /*------ fortran subroutine/function handling ------------------------------------------------------------*/ /* Start is initial condition */ @@ -1133,6 +1210,7 @@ private { { Entry *tmp_entry = current; current = last_entry; // temporarily switch to the previous entry + if (last_enum) current = last_enum; handleCommentBlock(docBlock,TRUE); current=tmp_entry; } @@ -1148,7 +1226,7 @@ private { docBlock.resize(0); } -<Start,SubprogBody,ModuleBody,TypedefBody,InterfaceBody,ModuleBodyContains,SubprogBodyContains,TypedefBodyContains>"!>" { +<Start,SubprogBody,ModuleBody,TypedefBody,InterfaceBody,ModuleBodyContains,SubprogBodyContains,TypedefBodyContains,Enum>"!>" { yy_push_state(YY_START); current->docLine = yyLineNr; docBlockJavaStyle = FALSE; diff --git a/src/ftvhelp.cpp b/src/ftvhelp.cpp index 14c94a3..d71c48f 100644 --- a/src/ftvhelp.cpp +++ b/src/ftvhelp.cpp @@ -257,7 +257,7 @@ void FTVHelp::generateIndent(FTextStream &t, FTVNode *n,bool opened) while (p) { indent++; p=p->parent; } if (n->isDir) { - QCString dir = opened ? "▼" : "▶"; + QCString dir = opened ? "▼" : "►"; t << "<span style=\"width:" << (indent*16) << "px;display:inline-block;\"> </span>" << "<span id=\"arr_" << generateIndentLabel(n,0) << "\" class=\"arrow\" "; t << "onclick=\"toggleFolder('" << generateIndentLabel(n,0) << "')\""; diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index accc6a0..740b2f5 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -1428,13 +1428,7 @@ void HtmlGenerator::startMemberItem(const char *anchor,int annoType,const char * t << " inherit " << inheritId; } t << "\">"; - switch(annoType) - { - case 0: t << "<td class=\"memItemLeft\" align=\"right\" valign=\"top\">"; break; - case 1: t << "<td class=\"memItemLeft\" >"; break; - case 2: t << "<td class=\"memItemLeft\" valign=\"top\">"; break; - default: t << "<td class=\"memTemplParams\" colspan=\"2\">"; break; - } + insertMemberAlignLeft(annoType, true); } void HtmlGenerator::endMemberItem() @@ -1466,7 +1460,19 @@ void HtmlGenerator::insertMemberAlign(bool templ) t << " </td><td class=\"" << className << "\" valign=\"bottom\">"; } -void HtmlGenerator::startMemberDescription(const char *anchor,const char *inheritId) +void HtmlGenerator::insertMemberAlignLeft(int annoType, bool initTag) +{ + if (!initTag) t << " </td>"; + switch(annoType) + { + case 0: t << "<td class=\"memItemLeft\" align=\"right\" valign=\"top\">"; break; + case 1: t << "<td class=\"memItemLeft\" >"; break; + case 2: t << "<td class=\"memItemLeft\" valign=\"top\">"; break; + default: t << "<td class=\"memTemplParams\" colspan=\"2\">"; break; + } +} + +void HtmlGenerator::startMemberDescription(const char *anchor,const char *inheritId, bool typ) { DBG_HTML(t << "<!-- startMemberDescription -->" << endl) if (m_emptySection) @@ -1479,7 +1485,10 @@ void HtmlGenerator::startMemberDescription(const char *anchor,const char *inheri { t << " inherit " << inheritId; } - t << "\"><td class=\"mdescLeft\"> </td><td class=\"mdescRight\">"; + t << "\">"; + t << "<td class=\"mdescLeft\"> </td>"; + if (typ) t << "<td class=\"mdescLeft\"> </td>"; + t << "<td class=\"mdescRight\">";; } void HtmlGenerator::endMemberDescription() @@ -1505,7 +1514,7 @@ void HtmlGenerator::endMemberSections() } } -void HtmlGenerator::startMemberHeader(const char *anchor) +void HtmlGenerator::startMemberHeader(const char *anchor, int typ) { DBG_HTML(t << "<!-- startMemberHeader -->" << endl) if (!m_emptySection) @@ -1518,7 +1527,7 @@ void HtmlGenerator::startMemberHeader(const char *anchor) t << "<table class=\"memberdecls\">" << endl; m_emptySection=FALSE; } - t << "<tr class=\"heading\"><td colspan=\"2\"><h2 class=\"groupheader\">"; + t << "<tr class=\"heading\"><td colspan=\"" << typ << "\"><h2 class=\"groupheader\">"; if (anchor) { t << "<a name=\"" << anchor << "\"></a>" << endl; diff --git a/src/htmlgen.h b/src/htmlgen.h index 82f0c17..2d8d6e0 100644 --- a/src/htmlgen.h +++ b/src/htmlgen.h @@ -175,7 +175,7 @@ class HtmlGenerator : public OutputGenerator void endMemberSections(); void startHeaderSection(); void endHeaderSection(); - void startMemberHeader(const char *); + void startMemberHeader(const char *, int); void endMemberHeader(); void startMemberSubtitle(); void endMemberSubtitle(); @@ -200,7 +200,8 @@ class HtmlGenerator : public OutputGenerator void endMemberGroup(bool); void insertMemberAlign(bool); - void startMemberDescription(const char *anchor,const char *inheritId); + void insertMemberAlignLeft(int,bool); + void startMemberDescription(const char *anchor,const char *inheritId, bool typ); void endMemberDescription(); void startMemberDeclaration() {} void endMemberDeclaration(const char *anchor,const char *inheritId); diff --git a/src/index.cpp b/src/index.cpp index 24c0290..3706bbf 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -2508,8 +2508,8 @@ static const CmhlInfo *getCmhlInfo(int hl) { CmhlInfo("functions", theTranslator->trAll()), CmhlInfo("functions_func", - fortranOpt ? theTranslator->trSubprograms() : - vhdlOpt ? VhdlDocGen::trFunctionAndProc() : + fortranOpt ? theTranslator->trSubprograms() : + vhdlOpt ? theTranslator->trFunctionAndProc() : theTranslator->trFunctions()), CmhlInfo("functions_vars",theTranslator->trVariables()), CmhlInfo("functions_type",theTranslator->trTypedefs()), @@ -2687,8 +2687,8 @@ static const FmhlInfo *getFmhlInfo(int hl) { FmhlInfo("globals", theTranslator->trAll()), FmhlInfo("globals_func", - fortranOpt ? theTranslator->trSubprograms() : - vhdlOpt ? VhdlDocGen::trFunctionAndProc() : + fortranOpt ? theTranslator->trSubprograms() : + vhdlOpt ? theTranslator->trFunctionAndProc() : theTranslator->trFunctions()), FmhlInfo("globals_vars",theTranslator->trVariables()), FmhlInfo("globals_type",theTranslator->trTypedefs()), @@ -2855,8 +2855,8 @@ static const NmhlInfo *getNmhlInfo(int hl) { NmhlInfo("namespacemembers", theTranslator->trAll()), NmhlInfo("namespacemembers_func", - fortranOpt ? theTranslator->trSubprograms() : - vhdlOpt ? VhdlDocGen::trFunctionAndProc() : + fortranOpt ? theTranslator->trSubprograms() : + vhdlOpt ? theTranslator->trFunctionAndProc() : theTranslator->trFunctions()), NmhlInfo("namespacemembers_vars",theTranslator->trVariables()), NmhlInfo("namespacemembers_type",theTranslator->trTypedefs()), @@ -4022,7 +4022,7 @@ static void writeIndex(OutputList &ol) ol.startIndexSection(isClassHierarchyIndex); ol.parseText(/*projPrefix+*/ (fortranOpt ? theTranslator->trCompoundIndexFortran() : - vhdlOpt ? VhdlDocGen::trDesignUnitIndex() : + vhdlOpt ? theTranslator->trHierarchicalIndex() : theTranslator->trHierarchicalIndex() )); ol.endIndexSection(isClassHierarchyIndex); @@ -4032,7 +4032,7 @@ static void writeIndex(OutputList &ol) ol.startIndexSection(isCompoundIndex); ol.parseText(/*projPrefix+*/ (fortranOpt ? theTranslator->trCompoundIndexFortran() : - vhdlOpt ? VhdlDocGen::trDesignUnitIndex() : + vhdlOpt ? theTranslator->trDesignUnitIndex() : theTranslator->trCompoundIndex() )); ol.endIndexSection(isCompoundIndex); diff --git a/src/latexgen.cpp b/src/latexgen.cpp index 7d72974..7a2ea59 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -286,13 +286,15 @@ static void writeLatexMakefile() exit(1); } // inserted by KONNO Akihisa <konno@researchers.jp> 2002-03-05 - QCString latex_command = Config_getString(LATEX_CMD_NAME); + QCString latex_command = theTranslator->latexCommandName(); QCString mkidx_command = Config_getString(MAKEINDEX_CMD_NAME); // end insertion by KONNO Akihisa <konno@researchers.jp> 2002-03-05 FTextStream t(&file); if (!Config_getBool(USE_PDFLATEX)) // use plain old latex { - t << "all: refman.dvi" << endl + t << "LATEX_CMD=" << latex_command << endl + << endl + << "all: refman.dvi" << endl << endl << "ps: refman.ps" << endl << endl @@ -309,7 +311,7 @@ static void writeLatexMakefile() t << "\tps2pdf refman.ps refman.pdf" << endl << endl; t << "refman.dvi: clean refman.tex doxygen.sty" << endl << "\techo \"Running latex...\"" << endl - << "\t" << latex_command << " refman.tex" << endl + << "\t$(LATEX_CMD) refman.tex" << endl << "\techo \"Running makeindex...\"" << endl << "\t" << mkidx_command << " refman.idx" << endl; if (generateBib) @@ -317,19 +319,19 @@ static void writeLatexMakefile() t << "\techo \"Running bibtex...\"" << endl; t << "\tbibtex refman" << endl; t << "\techo \"Rerunning latex....\"" << endl; - t << "\t" << latex_command << " refman.tex" << endl; + t << "\t$(LATEX_CMD) refman.tex" << endl; } t << "\techo \"Rerunning latex....\"" << endl - << "\t" << latex_command << " refman.tex" << endl + << "\t$(LATEX_CMD) refman.tex" << endl << "\tlatex_count=8 ; \\" << endl << "\twhile egrep -s 'Rerun (LaTeX|to get cross-references right)' refman.log && [ $$latex_count -gt 0 ] ;\\" << endl << "\t do \\" << endl << "\t echo \"Rerunning latex....\" ;\\" << endl - << "\t " << latex_command << " refman.tex ;\\" << endl + << "\t $(LATEX_CMD) refman.tex ; \\" << endl << "\t latex_count=`expr $$latex_count - 1` ;\\" << endl << "\t done" << endl << "\t" << mkidx_command << " refman.idx" << endl - << "\t" << latex_command << " refman.tex" << endl << endl + << "\t$(LATEX_CMD) refman.tex" << endl << endl << "refman_2on1.ps: refman.ps" << endl << "\tpsnup -2 refman.ps >refman_2on1.ps" << endl << endl @@ -338,26 +340,28 @@ static void writeLatexMakefile() } else // use pdflatex for higher quality output { + t << "LATEX_CMD=" << latex_command << endl + << endl; t << "all: refman.pdf" << endl << endl << "pdf: refman.pdf" << endl << endl; t << "refman.pdf: clean refman.tex" << endl; - t << "\tpdflatex refman" << endl; + t << "\t$(LATEX_CMD) refman" << endl; t << "\t" << mkidx_command << " refman.idx" << endl; if (generateBib) { t << "\tbibtex refman" << endl; - t << "\tpdflatex refman" << endl; + t << "\t$(LATEX_CMD) refman" << endl; } - t << "\tpdflatex refman" << endl + t << "\t$(LATEX_CMD) refman" << endl << "\tlatex_count=8 ; \\" << endl << "\twhile egrep -s 'Rerun (LaTeX|to get cross-references right)' refman.log && [ $$latex_count -gt 0 ] ;\\" << endl << "\t do \\" << endl << "\t echo \"Rerunning latex....\" ;\\" << endl - << "\t pdflatex refman ;\\" << endl + << "\t $(LATEX_CMD) refman ;\\" << endl << "\t latex_count=`expr $$latex_count - 1` ;\\" << endl << "\t done" << endl << "\t" << mkidx_command << " refman.idx" << endl - << "\tpdflatex refman" << endl << endl; + << "\t$(LATEX_CMD) refman" << endl << endl; } t << endl @@ -371,7 +375,7 @@ static void writeMakeBat() #if defined(_MSC_VER) QCString dir=Config_getString(LATEX_OUTPUT); QCString fileName=dir+"/make.bat"; - QCString latex_command = Config_getString(LATEX_CMD_NAME); + QCString latex_command = theTranslator->latexCommandName(); QCString mkidx_command = Config_getString(MAKEINDEX_CMD_NAME); QFile file(fileName); bool generateBib = !Doxygen::citeDict->isEmpty(); @@ -386,14 +390,15 @@ static void writeMakeBat() t << "del /s /f *.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out *.brf *.blg *.bbl refman.pdf\n\n"; if (!Config_getBool(USE_PDFLATEX)) // use plain old latex { - t << latex_command << " refman.tex\n"; + t << "set LATEX_CMD=" << latex_command << "\n"; + t << "%LATEX_CMD% refman.tex\n"; t << "echo ----\n"; t << mkidx_command << " refman.idx\n"; if (generateBib) { t << "bibtex refman\n"; t << "echo ----\n"; - t << latex_command << " refman.tex\n"; + t << "\t%LATEX_CMD% refman.tex\n"; } t << "setlocal enabledelayedexpansion\n"; t << "set count=8\n"; @@ -405,28 +410,29 @@ static void writeMakeBat() t << "set /a count-=1\n"; t << "if !count! EQU 0 goto :skip\n\n"; t << "echo ----\n"; - t << latex_command << " refman.tex\n"; + t << "%LATEX_CMD% refman.tex\n"; t << "goto :repeat\n"; t << ":skip\n"; t << "endlocal\n"; t << mkidx_command << " refman.idx\n"; - t << latex_command << " refman.tex\n"; + t << "%LATEX_CMD% refman.tex\n"; t << "dvips -o refman.ps refman.dvi\n"; t << "gswin32c -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite " "-sOutputFile=refman.pdf -c save pop -f refman.ps\n"; } else // use pdflatex { - t << "pdflatex refman\n"; + t << "set LATEX_CMD=" << latex_command << "\n"; + t << "%LATEX_CMD% refman\n"; t << "echo ----\n"; t << mkidx_command << " refman.idx\n"; if (generateBib) { t << "bibtex refman" << endl; - t << "pdflatex refman" << endl; + t << "%LATEX_CMD% refman" << endl; } t << "echo ----\n"; - t << "pdflatex refman\n\n"; + t << "%LATEX_CMD% refman\n\n"; t << "setlocal enabledelayedexpansion\n"; t << "set count=8\n"; t << ":repeat\n"; @@ -437,12 +443,12 @@ static void writeMakeBat() t << "set /a count-=1\n"; t << "if !count! EQU 0 goto :skip\n\n"; t << "echo ----\n"; - t << "pdflatex refman\n"; + t << "%LATEX_CMD% refman\n"; t << "goto :repeat\n"; t << ":skip\n"; t << "endlocal\n"; t << mkidx_command << " refman.idx\n"; - t << "pdflatex refman\n"; + t << "%LATEX_CMD% refman\n"; t << "cd /D %Dir_Old%\n"; t << "set Dir_Old=\n"; } @@ -517,6 +523,8 @@ static void writeDefaultHeaderPart1(FTextStream &t) "\\PassOptionsToPackage{warn}{textcomp}\n" "\\usepackage{textcomp}\n" "\\usepackage[nointegrals]{wasysym}\n" + "\\usepackage[table]{xcolor}\n" + "\\usepackage{ifpdf,ifxetex}\n" "\n"; // Language support @@ -529,9 +537,13 @@ static void writeDefaultHeaderPart1(FTextStream &t) } // Define default fonts - t << "% Font selection\n" - "\\usepackage[T1]{fontenc}\n" - "\\usepackage[scaled=.90]{helvet}\n" + t << "% Font selection\n"; + QCString fontenc = theTranslator->latexFontenc(); + if (!fontenc.isEmpty()) + { + t << "\\usepackage[" << fontenc << "]{fontenc}\n"; + } + t << "\\usepackage[scaled=.90]{helvet}\n" "\\usepackage{courier}\n" "\\usepackage{amssymb}\n" "\\usepackage{sectsty}\n" @@ -659,7 +671,11 @@ static void writeDefaultHeaderPart1(FTextStream &t) "\\ifpdf\n" " \\usepackage[pdftex,pagebackref=true]{hyperref}\n" "\\else\n" - " \\usepackage[ps2pdf,pagebackref=true]{hyperref}\n" + " \\ifxetex\n" + " \\usepackage[pagebackref=true]{hyperref}\n" + " \\else\n" + " \\usepackage[ps2pdf,pagebackref=true]{hyperref}\n" + " \\fi\n" "\\fi\n" "\\ifpdf\n" " \\DeclareUnicodeCharacter{207B}{${}^{-}$}% Superscript minus\n" @@ -694,12 +710,18 @@ static void writeDefaultHeaderPart1(FTextStream &t) t << "\\usepackage{caption}\n" << "\\captionsetup{labelsep=space,justification=centering,font={bf},singlelinecheck=off,skip=4pt,position=top}\n\n"; + // prevent numbers overlap the titles in toc + t << "\\renewcommand{\\numberline}[1]{#1~}\n"; + // End of preamble, now comes the document contents t << "%===== C O N T E N T S =====\n" "\n" "\\begin{document}\n"; - if (theTranslator->idLanguage()=="greek") - t << "\\selectlanguage{greek}\n"; + QCString documentPre = theTranslator->latexDocumentPre(); + if (!documentPre.isEmpty()) + { + t << documentPre; + } t << "\n"; // Front matter @@ -792,8 +814,13 @@ static void writeDefaultFooter(FTextStream &t) "\\clearemptydoublepage\n" "\\addcontentsline{toc}{" << unit << "}{\\indexname}\n" "\\printindex\n" - "\n" - "\\end{document}\n"; + "\n"; + QCString documentPost = theTranslator->latexDocumentPost(); + if (!documentPost.isEmpty()) + { + t << documentPost; + } + t << "\\end{document}\n"; } void LatexGenerator::writeHeaderFile(QFile &f) @@ -1547,7 +1574,7 @@ void LatexGenerator::endGroupHeader(int) t << "}" << endl; } -void LatexGenerator::startMemberHeader(const char *) +void LatexGenerator::startMemberHeader(const char *,int) { if (Config_getBool(COMPACT_LATEX)) { @@ -1835,7 +1862,7 @@ void LatexGenerator::endMemberItem() t << endl; } -void LatexGenerator::startMemberDescription(const char *,const char *) +void LatexGenerator::startMemberDescription(const char *,const char *,bool) { if (!insideTabbing) { diff --git a/src/latexgen.h b/src/latexgen.h index 430d250..469e411 100644 --- a/src/latexgen.h +++ b/src/latexgen.h @@ -169,7 +169,7 @@ class LatexGenerator : public OutputGenerator void endMemberSections() {} void startHeaderSection() {} void endHeaderSection() {} - void startMemberHeader(const char *); + void startMemberHeader(const char *,int); void endMemberHeader(); void startMemberSubtitle() {} void endMemberSubtitle() {} @@ -194,6 +194,7 @@ class LatexGenerator : public OutputGenerator void endMemberGroup(bool); void insertMemberAlign(bool) {} + void insertMemberAlignLeft(int,bool){} void writeRuler() { t << endl << endl; } void writeAnchor(const char *fileName,const char *name); @@ -225,7 +226,7 @@ class LatexGenerator : public OutputGenerator void endCenter() { t << "\\end{center}" << endl; } void startSmall() { t << "\\footnotesize "; } void endSmall() { t << "\\normalsize "; } - void startMemberDescription(const char *,const char *); + void startMemberDescription(const char *,const char *,bool); void endMemberDescription(); void startMemberDeclaration() {} void endMemberDeclaration(const char *,const char *) {} diff --git a/src/layout.cpp b/src/layout.cpp index fdc9f4c..1d9a5ed 100644 --- a/src/layout.cpp +++ b/src/layout.cpp @@ -310,7 +310,7 @@ class LayoutParser : public QXmlDefaultHandler new StartElementHandlerSection(this,LayoutDocEntry::ClassNestedClasses,&LayoutParser::startSectionEntry, COMPILE_FOR_2_OPTIONS( theTranslator->trCompounds(), - SrcLangExt_VHDL,VhdlDocGen::trVhdlType(VhdlDocGen::ENTITY,FALSE), + SrcLangExt_VHDL,theTranslator->trVhdlType(VhdlDocGen::ENTITY,FALSE), SrcLangExt_Fortran,theTranslator->trDataTypes() ))); m_sHandler.insert("class/memberdecl/services", @@ -491,7 +491,7 @@ class LayoutParser : public QXmlDefaultHandler new StartElementHandlerSection(this,LayoutDocEntry::NamespaceClasses,&LayoutParser::startSectionEntry, COMPILE_FOR_2_OPTIONS( theTranslator->trCompounds(), - SrcLangExt_VHDL,VhdlDocGen::trVhdlType(VhdlDocGen::ENTITY,FALSE), + SrcLangExt_VHDL,theTranslator->trVhdlType(VhdlDocGen::ENTITY,FALSE), SrcLangExt_Fortran,theTranslator->trDataTypes() ))); m_sHandler.insert("namespace/memberdecl/membergroups", @@ -508,7 +508,7 @@ class LayoutParser : public QXmlDefaultHandler COMPILE_FOR_2_OPTIONS( theTranslator->trFunctions(), SrcLangExt_Fortran,theTranslator->trSubprograms(), - SrcLangExt_VHDL,VhdlDocGen::trFunctionAndProc() + SrcLangExt_VHDL,theTranslator->trFunctionAndProc() ))); m_sHandler.insert("namespace/memberdecl/variables", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, @@ -570,7 +570,7 @@ class LayoutParser : public QXmlDefaultHandler new StartElementHandlerSection(this,LayoutDocEntry::FileClasses,&LayoutParser::startSectionEntry, COMPILE_FOR_2_OPTIONS( theTranslator->trCompounds(), - SrcLangExt_VHDL,VhdlDocGen::trVhdlType(VhdlDocGen::ENTITY,FALSE), + SrcLangExt_VHDL,theTranslator->trVhdlType(VhdlDocGen::ENTITY,FALSE), SrcLangExt_Fortran,theTranslator->trDataTypes() ))); m_sHandler.insert("file/memberdecl/namespaces", @@ -599,7 +599,7 @@ class LayoutParser : public QXmlDefaultHandler COMPILE_FOR_2_OPTIONS( theTranslator->trFunctions(), SrcLangExt_Fortran,theTranslator->trSubprograms(), - SrcLangExt_VHDL,VhdlDocGen::trFunctionAndProc() + SrcLangExt_VHDL,theTranslator->trFunctionAndProc() ))); m_sHandler.insert("file/memberdecl/variables", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, @@ -660,7 +660,7 @@ class LayoutParser : public QXmlDefaultHandler new StartElementHandlerSection(this,LayoutDocEntry::GroupClasses,&LayoutParser::startSectionEntry, COMPILE_FOR_2_OPTIONS( theTranslator->trCompounds(), - SrcLangExt_VHDL,VhdlDocGen::trVhdlType(VhdlDocGen::ENTITY,FALSE), + SrcLangExt_VHDL,theTranslator->trVhdlType(VhdlDocGen::ENTITY,FALSE), SrcLangExt_Fortran,theTranslator->trDataTypes() ))); m_sHandler.insert("group/memberdecl/namespaces", @@ -701,7 +701,7 @@ class LayoutParser : public QXmlDefaultHandler COMPILE_FOR_2_OPTIONS( theTranslator->trFunctions(), SrcLangExt_Fortran,theTranslator->trSubprograms(), - SrcLangExt_VHDL,VhdlDocGen::trFunctionAndProc() + SrcLangExt_VHDL,theTranslator->trFunctionAndProc() ))); m_sHandler.insert("group/memberdecl/variables", new StartElementHandlerMember(this,&LayoutParser::startMemberDeclEntry, @@ -954,35 +954,35 @@ class LayoutParser : public QXmlDefaultHandler }, { "classindex", LayoutNavEntry::ClassIndex, - fortranOpt ? theTranslator->trDataTypes() : vhdlOpt ? VhdlDocGen::trDesignUnits() : theTranslator->trCompoundIndex(), + fortranOpt ? theTranslator->trDataTypes() : vhdlOpt ? theTranslator->trDesignUnits() : theTranslator->trCompoundIndex(), QCString(), QCString(), "classes" }, { "classes", LayoutNavEntry::Classes, - fortranOpt ? theTranslator->trCompoundListFortran() : vhdlOpt ? VhdlDocGen::trDesignUnitList() : theTranslator->trClasses(), + fortranOpt ? theTranslator->trCompoundListFortran() : vhdlOpt ? theTranslator->trDesignUnitList() : theTranslator->trClasses(), theTranslator->trCompoundList(), - fortranOpt ? theTranslator->trCompoundListDescriptionFortran() : vhdlOpt ? VhdlDocGen::trDesignUnitListDescription() : theTranslator->trCompoundListDescription(), + fortranOpt ? theTranslator->trCompoundListDescriptionFortran() : vhdlOpt ? theTranslator->trDesignUnitListDescription() : theTranslator->trCompoundListDescription(), "annotated" }, { "classlist", LayoutNavEntry::ClassList, - fortranOpt ? theTranslator->trCompoundListFortran() : vhdlOpt ? VhdlDocGen::trDesignUnitList() : theTranslator->trCompoundList(), + fortranOpt ? theTranslator->trCompoundListFortran() : vhdlOpt ? theTranslator->trDesignUnitList() : theTranslator->trCompoundList(), QCString(), - fortranOpt ? theTranslator->trCompoundListDescriptionFortran() : vhdlOpt ? VhdlDocGen::trDesignUnitListDescription() : theTranslator->trCompoundListDescription(), + fortranOpt ? theTranslator->trCompoundListDescriptionFortran() : vhdlOpt ? theTranslator->trDesignUnitListDescription() : theTranslator->trCompoundListDescription(), "annotated" }, { "hierarchy", LayoutNavEntry::ClassHierarchy, - vhdlOpt ? VhdlDocGen::trDesignUnitHierarchy() : theTranslator->trClassHierarchy(), + vhdlOpt ? theTranslator->trDesignUnitHierarchy() : theTranslator->trClassHierarchy(), QCString(), theTranslator->trClassHierarchyDescription(), hasGraphicalHierarchy ? "inherits" : "hierarchy" }, { "classmembers", LayoutNavEntry::ClassMembers, - fortranOpt ? theTranslator->trCompoundMembersFortran() : vhdlOpt ? VhdlDocGen::trDesignUnitMembers() : theTranslator->trCompoundMembers(), + fortranOpt ? theTranslator->trCompoundMembersFortran() : vhdlOpt ? theTranslator->trDesignUnitMembers() : theTranslator->trCompoundMembers(), QCString(), fortranOpt ? theTranslator->trCompoundMembersDescriptionFortran(extractAll) : theTranslator->trCompoundMembersDescription(extractAll), "functions" diff --git a/src/mangen.cpp b/src/mangen.cpp index 17e6003..d23b2fe 100644 --- a/src/mangen.cpp +++ b/src/mangen.cpp @@ -283,7 +283,7 @@ void ManGenerator::endGroupHeader(int) upperCase=FALSE; } -void ManGenerator::startMemberHeader(const char *) +void ManGenerator::startMemberHeader(const char *,int) { if (!firstCol) t << endl; t << ".SS \""; @@ -619,9 +619,9 @@ void ManGenerator::startSection(const char *,const char *,SectionInfo::SectionTy { case SectionInfo::Page: startGroupHeader(FALSE); break; case SectionInfo::Section: startGroupHeader(FALSE); break; - case SectionInfo::Subsection: startMemberHeader(0); break; - case SectionInfo::Subsubsection: startMemberHeader(0); break; - case SectionInfo::Paragraph: startMemberHeader(0); break; + case SectionInfo::Subsection: startMemberHeader(0, -1); break; + case SectionInfo::Subsubsection: startMemberHeader(0, -1); break; + case SectionInfo::Paragraph: startMemberHeader(0, -1); break; default: ASSERT(0); break; } } diff --git a/src/mangen.h b/src/mangen.h index b3b9f76..0413ffd 100644 --- a/src/mangen.h +++ b/src/mangen.h @@ -99,9 +99,10 @@ class ManGenerator : public OutputGenerator void endMemberSections() {} void startHeaderSection() {} void endHeaderSection(); - void startMemberHeader(const char *); + void startMemberHeader(const char *,int); void endMemberHeader(); void insertMemberAlign(bool) {} + void insertMemberAlignLeft(int,bool){} void startMemberSubtitle() {} void endMemberSubtitle() {} //void writeListItem(); @@ -160,7 +161,7 @@ class ManGenerator : public OutputGenerator void endCenter() {} void startSmall() {} void endSmall() {} - void startMemberDescription(const char *,const char *) { t << "\n.RI \""; firstCol=FALSE; } + void startMemberDescription(const char *,const char *,bool) { t << "\n.RI \""; firstCol=FALSE; } void endMemberDescription() { t << "\""; firstCol=FALSE; } void startMemberDeclaration() {} void endMemberDeclaration(const char *,const char *) {} diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 0bd0701..9be2ecb 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -1978,7 +1978,7 @@ void MemberDef::getLabels(QStrList &sl,Definition *container) const bool extractPrivate = Config_getBool(EXTRACT_PRIVATE); if (optVhdl) { - sl.append(VhdlDocGen::trTypeString(getMemberSpecifiers())); + sl.append(theTranslator->trVhdlType(getMemberSpecifiers(),TRUE)); } else { diff --git a/src/outputgen.h b/src/outputgen.h index 68356b4..44d34b8 100644 --- a/src/outputgen.h +++ b/src/outputgen.h @@ -380,7 +380,7 @@ class OutputGenerator : public BaseOutputDocInterface virtual void endMemberSections() = 0; virtual void startHeaderSection() = 0; virtual void endHeaderSection() = 0; - virtual void startMemberHeader(const char *anchor) = 0; + virtual void startMemberHeader(const char *anchor, int typ) = 0; virtual void endMemberHeader() = 0; virtual void startMemberSubtitle() = 0; virtual void endMemberSubtitle() = 0; @@ -403,6 +403,7 @@ class OutputGenerator : public BaseOutputDocInterface virtual void startMemberGroup() = 0; virtual void endMemberGroup(bool) = 0; virtual void insertMemberAlign(bool) = 0; + virtual void insertMemberAlignLeft(int,bool) = 0; virtual void startMemberDoc(const char *,const char *, const char *,const char *,int,int,bool) = 0; virtual void endMemberDoc(bool) = 0; @@ -414,7 +415,7 @@ class OutputGenerator : public BaseOutputDocInterface virtual void writeStartAnnoItem(const char *type,const char *file, const char *path,const char *name) = 0; virtual void writeEndAnnoItem(const char *name) = 0; - virtual void startMemberDescription(const char *anchor,const char *inheritId) = 0; + virtual void startMemberDescription(const char *anchor,const char *inheritId, bool typ) = 0; virtual void endMemberDescription() = 0; virtual void startMemberDeclaration() = 0; virtual void endMemberDeclaration(const char *anchor,const char *inheritId) = 0; diff --git a/src/outputlist.h b/src/outputlist.h index 0738ed1..2e89101 100644 --- a/src/outputlist.h +++ b/src/outputlist.h @@ -191,8 +191,8 @@ class OutputList : public OutputDocInterface { forall(&OutputGenerator::startHeaderSection); } void endHeaderSection() { forall(&OutputGenerator::endHeaderSection); } - void startMemberHeader(const char *anchor) - { forall(&OutputGenerator::startMemberHeader,anchor); } + void startMemberHeader(const char *anchor, int typ = 2) + { forall(&OutputGenerator::startMemberHeader,anchor,typ); } void endMemberHeader() { forall(&OutputGenerator::endMemberHeader); } void startMemberSubtitle() @@ -237,6 +237,8 @@ class OutputList : public OutputDocInterface { forall(&OutputGenerator::endMemberGroup,last); } void insertMemberAlign(bool templ=FALSE) { forall(&OutputGenerator::insertMemberAlign,templ); } + void insertMemberAlignLeft(int typ=0, bool templ=FALSE) + { forall(&OutputGenerator::insertMemberAlignLeft,typ,templ); } void writeRuler() { forall(&OutputGenerator::writeRuler); } void writeAnchor(const char *fileName,const char *name) @@ -306,8 +308,8 @@ class OutputList : public OutputDocInterface { forall(&OutputGenerator::startBold); } void endBold() { forall(&OutputGenerator::endBold); } - void startMemberDescription(const char *anchor,const char *inheritId=0) - { forall(&OutputGenerator::startMemberDescription,anchor,inheritId); } + void startMemberDescription(const char *anchor,const char *inheritId=0, bool typ = false) + { forall(&OutputGenerator::startMemberDescription,anchor,inheritId, typ); } void endMemberDescription() { forall(&OutputGenerator::endMemberDescription); } void startMemberDeclaration() diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp index 7fcfbb3..e41700b 100644 --- a/src/rtfgen.cpp +++ b/src/rtfgen.cpp @@ -703,7 +703,7 @@ void RTFGenerator::endIndexSection(IndexSections is) } else if (vhdlOpt) { - t << "{\\tc \\v " << VhdlDocGen::trDesignUnitIndex() << "}"<< endl; + t << "{\\tc \\v " << theTranslator->trDesignUnitIndex() << "}"<< endl; } else { @@ -1626,7 +1626,7 @@ void RTFGenerator::endDescItem() newParagraph(); } -void RTFGenerator::startMemberDescription(const char *,const char *) +void RTFGenerator::startMemberDescription(const char *,const char *,bool) { DBG_RTF(t << "{\\comment (startMemberDescription)}" << endl) t << "{" << endl; diff --git a/src/rtfgen.h b/src/rtfgen.h index d8f6ca7..1eb7db0 100644 --- a/src/rtfgen.h +++ b/src/rtfgen.h @@ -103,7 +103,7 @@ class RTFGenerator : public OutputGenerator void endMemberSections() {} void startHeaderSection() {} void endHeaderSection() {} - void startMemberHeader(const char *) { startGroupHeader(FALSE); } + void startMemberHeader(const char *,int) { startGroupHeader(FALSE); } void endMemberHeader() { endGroupHeader(FALSE); } void startMemberSubtitle(); void endMemberSubtitle(); @@ -120,6 +120,7 @@ class RTFGenerator : public OutputGenerator void startMemberTemplateParams() {} void endMemberTemplateParams(const char *,const char *) {} void insertMemberAlign(bool) {} + void insertMemberAlignLeft(int,bool){} void writeRuler() { rtfwriteRuler_thin(); } @@ -156,7 +157,7 @@ class RTFGenerator : public OutputGenerator void startSmall() { t << "{\\sub "; } void endSmall() { t << "}"; } - void startMemberDescription(const char *,const char *); + void startMemberDescription(const char *,const char *,bool); void endMemberDescription(); void startMemberDeclaration() {} void endMemberDeclaration(const char *,const char *) {} diff --git a/src/translator.h b/src/translator.h index 7092174..9da2317 100644 --- a/src/translator.h +++ b/src/translator.h @@ -19,6 +19,8 @@ #define TRANSLATOR_H #include "classdef.h" +#include "config.h" +#include "vhdldocgen.h" /** Abstract base class for all translatable text fragments. */ class Translator @@ -41,6 +43,36 @@ class Translator virtual QCString idLanguage() = 0; virtual QCString latexLanguageSupportCommand() = 0; + /*! + * Sets the LaTeX font encoding to be used. The default is set to `T1`, + * in case another font encoding has to be used this can be specified with + * this routine. In case no font encoding is required the empty string + * can be returned. + */ + virtual QCString latexFontenc() { return "T1"; } + /*! + * Sets the commands to be insered directly after the `\\begin{document}` + * in the LaTeX document. + */ + virtual QCString latexDocumentPre() { return ""; } + /*! + * Sets the commands to be insered directly before the `\\end{document}` + * in the LaTeX document. + */ + virtual QCString latexDocumentPost() { return ""; } + /*! + * Set the name to be used as latex command. + */ + virtual QCString latexCommandName() + { + QCString latex_command = Config_getString(LATEX_CMD_NAME); + if (latex_command.isEmpty()) latex_command = "latex"; + if (Config_getBool(USE_PDFLATEX)) + { + if (latex_command == "latex") latex_command = "pdflatex"; + } + return latex_command; + } // --- Language translation methods ------------------- @@ -570,6 +602,20 @@ class Translator virtual QCString trSingletonReference(const char *sName) = 0; virtual QCString trServiceGeneratedFromFiles(bool single) = 0; virtual QCString trSingletonGeneratedFromFiles(bool single) = 0; + +////////////////////////////////////////////////////////////////////////// +// new since 1.8.15 +////////////////////////////////////////////////////////////////////////// + + virtual QCString trDesignUnitHierarchy() = 0; + virtual QCString trDesignUnitList() = 0; + virtual QCString trDesignUnitMembers() = 0; + virtual QCString trDesignUnitListDescription() = 0; + virtual QCString trDesignUnitIndex() = 0; + virtual QCString trDesignUnits() = 0; + virtual QCString trFunctionAndProc() = 0; + virtual QCString trVhdlType(uint64 type,bool single) = 0; + virtual QCString trCustomReference(const char *name) = 0; }; #endif diff --git a/src/translator_adapter.h b/src/translator_adapter.h index 254876a..e66c9bf 100644 --- a/src/translator_adapter.h +++ b/src/translator_adapter.h @@ -41,7 +41,40 @@ class TranslatorAdapterBase : public Translator }; -class TranslatorAdapter_1_8_4 : public TranslatorAdapterBase +class TranslatorAdapter_1_8_15 : public TranslatorAdapterBase +{ + public: + virtual QCString updateNeededMessage() + { return createUpdateNeededMessage(idLanguage(),"release 1.8.15"); } + + virtual QCString trDesignUnitHierarchy() + { return english.trDesignUnitHierarchy(); } + + virtual QCString trDesignUnitList() + { return english.trDesignUnitList(); } + + virtual QCString trDesignUnitMembers() + { return english.trDesignUnitMembers(); } + + virtual QCString trDesignUnitListDescription() + { return english.trDesignUnitListDescription(); } + + virtual QCString trDesignUnitIndex() + { return english.trDesignUnitIndex(); } + + virtual QCString trDesignUnits() + { return english.trDesignUnits(); } + + virtual QCString trFunctionAndProc() + { return english.trFunctionAndProc(); } + + virtual QCString trVhdlType(uint64 type,bool single) + { return english.trVhdlType(type,single); } + virtual QCString trCustomReference(const char *name) + { return english.trCustomReference(name); } +}; + +class TranslatorAdapter_1_8_4 : public TranslatorAdapter_1_8_15 { public: virtual QCString updateNeededMessage() diff --git a/src/translator_am.h b/src/translator_am.h index 6f5e671..5b4c446 100644 --- a/src/translator_am.h +++ b/src/translator_am.h @@ -32,8 +32,8 @@ class TranslatorArmenian : public TranslatorAdapter_1_8_0 /* Used to get the command(s) for the language support. */
virtual QCString latexLanguageSupportCommand()
{
- return "<pre>\\usepackage[latin]{armtex}\n"
- "\\usepackage[armscii8]{inputenc}\n</pre>";
+ return "\\usepackage[latin]{armtex}\n"
+ "\\usepackage[armscii8]{inputenc}\n";
}
// --- Language translation methods -------------------
diff --git a/src/translator_br.h b/src/translator_br.h index a294ee0..3d12f08 100644 --- a/src/translator_br.h +++ b/src/translator_br.h @@ -45,7 +45,7 @@ #ifndef TRANSLATOR_BR_H #define TRANSLATOR_BR_H -class TranslatorBrazilian : public Translator +class TranslatorBrazilian : public TranslatorAdapter_1_8_15 { public: diff --git a/src/translator_cn.h b/src/translator_cn.h index fc0cf3c..0e559c1 100644 --- a/src/translator_cn.h +++ b/src/translator_cn.h @@ -24,7 +24,7 @@ */ #define CN_SPC " " -class TranslatorChinese : public Translator +class TranslatorChinese : public TranslatorAdapter_1_8_15 { public: /*! Used for identification of the language. The identification @@ -53,8 +53,20 @@ class TranslatorChinese : public Translator */ virtual QCString latexLanguageSupportCommand() { + return "\\usepackage{CJKutf8}\n"; + } + virtual QCString latexFontenc() + { return ""; } + virtual QCString latexDocumentPre() + { + return "\\begin{CJK}{UTF8}{min}\n"; + } + virtual QCString latexDocumentPost() + { + return "\\end{CJK}\n"; + } /*! used in the compound documentation before a list of related functions. */ diff --git a/src/translator_cz.h b/src/translator_cz.h index 056d0e4..7c61f58 100644 --- a/src/translator_cz.h +++ b/src/translator_cz.h @@ -85,7 +85,7 @@ // something else. It is difficult to find the general translation // for all kinds in the Czech language. -class TranslatorCzech : public Translator +class TranslatorCzech : public TranslatorAdapter_1_8_15 { public: // --- Language control methods ------------------- diff --git a/src/translator_de.h b/src/translator_de.h index d63bdcf..8e6ec2c 100644 --- a/src/translator_de.h +++ b/src/translator_de.h @@ -316,8 +316,17 @@ class TranslatorGerman : public Translator /*! This is an introduction to the class hierarchy. */ virtual QCString trClassHierarchyDescription() - { return "Die Liste der Ableitungen ist -mit Einschränkungen- " - "alphabetisch sortiert:"; + { + if (Config_getBool(OPTIMIZE_OUTPUT_VHDL)) + { + return "Hier folgt eine hierarchische Auflistung der " + "Entwurfseinheiten:"; + } + else + { + return "Die Liste der Ableitungen ist -mit Einschränkungen- " + "alphabetisch sortiert:"; + } } /*! This is an introduction to the list with all files. */ @@ -469,6 +478,10 @@ class TranslatorGerman : public Translator { return "Datenstruktur-Dokumentation"; } + else if (Config_getBool(OPTIMIZE_OUTPUT_VHDL)) + { + return "Entwurfseinheiten-Dokumentation"; + } else { return "Klassen-Dokumentation"; @@ -2125,6 +2138,123 @@ class TranslatorGerman : public Translator } ////////////////////////////////////////////////////////////////////////// +// new since 1.8.15 +////////////////////////////////////////////////////////////////////////// + + /** VHDL design unit hierarchy */ + virtual QCString trDesignUnitHierarchy() + { return "Entwurfseinheiten-Hierarchie"; } + /** VHDL design unit list */ + virtual QCString trDesignUnitList() + { return "Auflistung der Entwurfseinheiten"; } + /** VHDL design unit members */ + virtual QCString trDesignUnitMembers() + { return "Entwurfseinheiten-Elemente"; } + /** VHDL design unit list description */ + virtual QCString trDesignUnitListDescription() + { + return "Hier folgt die Aufzählung aller Entwurfseinheiten und deren " + "Elemente mit einer Kurzbeschreibung:"; + } + /** VHDL design unit index */ + virtual QCString trDesignUnitIndex() + { return "Entwurfseinheiten-Verzeichnis"; } + /** VHDL design units */ + virtual QCString trDesignUnits() + { return "Entwurfseinheiten"; } + /** VHDL functions/procedures/processes */ + virtual QCString trFunctionAndProc() + { return "Funktionen/Prozeduren/Prozesse"; } + /** VHDL type */ + virtual QCString trVhdlType(uint64 type,bool single) + { + switch(type) + { + case VhdlDocGen::LIBRARY: + if (single) return "Bibliothek"; + else return "Bibliotheken"; + case VhdlDocGen::PACKAGE: + if (single) return "Paket"; + else return "Pakete"; + case VhdlDocGen::SIGNAL: + if (single) return "Signal"; + else return "Signale"; + case VhdlDocGen::COMPONENT: + if (single) return "Komponente"; + else return "Komponenten"; + case VhdlDocGen::CONSTANT: + if (single) return "Konstante"; + else return "Konstanten"; + case VhdlDocGen::ENTITY: + if (single) return "Entwurfseinheit"; + else return "Entwurfseinheiten"; + case VhdlDocGen::TYPE: + if (single) return "Typ"; + else return "Typen"; + case VhdlDocGen::SUBTYPE: + if (single) return "Subtyp"; + else return "Subtypen"; + case VhdlDocGen::FUNCTION: + if (single) return "Funktion"; + else return "Funktionen"; + case VhdlDocGen::RECORD: + if (single) return "Datenstruktur"; + else return "Datenstrukturen"; + case VhdlDocGen::PROCEDURE: + if (single) return "Prozedur"; + else return "Prozeduren"; + case VhdlDocGen::ARCHITECTURE: + if (single) return "Architektur"; + else return "Architekturen"; + case VhdlDocGen::ATTRIBUTE: + if (single) return "Attribut"; + else return "Attribute"; + case VhdlDocGen::PROCESS: + if (single) return "Prozess"; + else return "Prozesse"; + case VhdlDocGen::PORT: + if (single) return "Schnittstelle"; + else return "Schnittstellen"; + case VhdlDocGen::USE: + if (single) return "Use Klausel"; + else return "Use Klauseln"; + case VhdlDocGen::GENERIC: + if (single) return "Parameter"; + else return "Parameter"; + case VhdlDocGen::PACKAGE_BODY: + return "Paketkörper"; + case VhdlDocGen::UNITS: + return "Einheiten"; + case VhdlDocGen::SHAREDVARIABLE: + if (single) return "Geteilte Variable"; + else return "Geteilte Variablen"; + case VhdlDocGen::VFILE: + if (single) return "Datei"; + else return "Dateien"; + case VhdlDocGen::GROUP: + if (single) return "Gruppe"; + else return "Gruppen"; + case VhdlDocGen::INSTANTIATION: + if (single) return "Instanziierung"; + else return "Instanziierungen"; + case VhdlDocGen::ALIAS: + if (single) return "Alias"; + else return "Aliase"; + case VhdlDocGen::CONFIG: + if (single) return "Konfiguration"; + else return "Konfigurationen"; + case VhdlDocGen::MISCELLANEOUS: + return "Verschiedenes"; + case VhdlDocGen::UCF_CONST: + return "Constraints"; + default: + return "Klasse"; + } + } + virtual QCString trCustomReference(const char *name) + { return QCString(name)+"-Referenz"; } + +////////////////////////////////////////////////////////////////////////// }; diff --git a/src/translator_dk.h b/src/translator_dk.h index e98cfa8..70e9032 100644 --- a/src/translator_dk.h +++ b/src/translator_dk.h @@ -116,8 +116,7 @@ class TranslatorDanish : public TranslatorAdapter_1_8_0 virtual QCString latexLanguageSupportCommand() { return - "\\usepackage[danish]{babel}\n" - "\\usepackage[T1]{fontenc}\n"; + "\\usepackage[danish]{babel}\n"; } // --- Language translation methods ------------------- diff --git a/src/translator_en.h b/src/translator_en.h index 190ba79..d12621e 100644 --- a/src/translator_en.h +++ b/src/translator_en.h @@ -224,8 +224,16 @@ class TranslatorEnglish : public Translator /*! This is an introduction to the class hierarchy. */ virtual QCString trClassHierarchyDescription() - { return "This inheritance list is sorted roughly, " - "but not completely, alphabetically:"; + { + if (Config_getBool(OPTIMIZE_OUTPUT_VHDL)) + { + return "Here is a hierarchical list of all entities:"; + } + else + { + return "This inheritance list is sorted roughly, " + "but not completely, alphabetically:"; + } } /*! This is an introduction to the list with all files. */ @@ -1993,6 +2001,123 @@ class TranslatorEnglish : public Translator } ////////////////////////////////////////////////////////////////////////// +// new since 1.8.15 +////////////////////////////////////////////////////////////////////////// + + /** VHDL design unit hierarchy */ + virtual QCString trDesignUnitHierarchy() + { return "Design Unit Hierarchy"; } + /** VHDL design unit list */ + virtual QCString trDesignUnitList() + { return "Design Unit List"; } + /** VHDL design unit members */ + virtual QCString trDesignUnitMembers() + { return "Design Unit Members"; } + /** VHDL design unit list description */ + virtual QCString trDesignUnitListDescription() + { + return "Here is a list of all design unit members with links to " + "the Entities they belong to:"; + } + /** VHDL design unit index */ + virtual QCString trDesignUnitIndex() + { return "Design Unit Index"; } + /** VHDL design units */ + virtual QCString trDesignUnits() + { return "Design Units"; } + /** VHDL functions/procedures/processes */ + virtual QCString trFunctionAndProc() + { return "Functions/Procedures/Processes"; } + /** VHDL type */ + virtual QCString trVhdlType(uint64 type,bool single) + { + switch(type) + { + case VhdlDocGen::LIBRARY: + if (single) return "Library"; + else return "Libraries"; + case VhdlDocGen::PACKAGE: + if (single) return "Package"; + else return "Packages"; + case VhdlDocGen::SIGNAL: + if (single) return "Signal"; + else return "Signals"; + case VhdlDocGen::COMPONENT: + if (single) return "Component"; + else return "Components"; + case VhdlDocGen::CONSTANT: + if (single) return "Constant"; + else return "Constants"; + case VhdlDocGen::ENTITY: + if (single) return "Entity"; + else return "Entities"; + case VhdlDocGen::TYPE: + if (single) return "Type"; + else return "Types"; + case VhdlDocGen::SUBTYPE: + if (single) return "Subtype"; + else return "Subtypes"; + case VhdlDocGen::FUNCTION: + if (single) return "Function"; + else return "Functions"; + case VhdlDocGen::RECORD: + if (single) return "Record"; + else return "Records"; + case VhdlDocGen::PROCEDURE: + if (single) return "Procedure"; + else return "Procedures"; + case VhdlDocGen::ARCHITECTURE: + if (single) return "Architecture"; + else return "Architectures"; + case VhdlDocGen::ATTRIBUTE: + if (single) return "Attribute"; + else return "Attributes"; + case VhdlDocGen::PROCESS: + if (single) return "Process"; + else return "Processes"; + case VhdlDocGen::PORT: + if (single) return "Port"; + else return "Ports"; + case VhdlDocGen::USE: + if (single) return "use clause"; + else return "Use Clauses"; + case VhdlDocGen::GENERIC: + if (single) return "Generic"; + else return "Generics"; + case VhdlDocGen::PACKAGE_BODY: + return "Package Body"; + case VhdlDocGen::UNITS: + return "Units"; + case VhdlDocGen::SHAREDVARIABLE: + if (single) return "Shared Variable"; + else return "Shared Variables"; + case VhdlDocGen::VFILE: + if (single) return "File"; + else return "Files"; + case VhdlDocGen::GROUP: + if (single) return "Group"; + else return "Groups"; + case VhdlDocGen::INSTANTIATION: + if (single) return "Instantiation"; + else return "Instantiations"; + case VhdlDocGen::ALIAS: + if (single) return "Alias"; + else return "Aliases"; + case VhdlDocGen::CONFIG: + if (single) return "Configuration"; + else return "Configurations"; + case VhdlDocGen::MISCELLANEOUS: + return "Miscellaneous"; + case VhdlDocGen::UCF_CONST: + return "Constraints"; + default: + return "Class"; + } + } + virtual QCString trCustomReference(const char *name) + { return QCString(name)+" Reference"; } + +////////////////////////////////////////////////////////////////////////// }; diff --git a/src/translator_es.h b/src/translator_es.h index 8922297..5f89f24 100644 --- a/src/translator_es.h +++ b/src/translator_es.h @@ -34,7 +34,7 @@ * Updated to 1.8.4 by Bartomeu Creus Navarro (17-julio-2013) */ -class TranslatorSpanish : public Translator +class TranslatorSpanish : public TranslatorAdapter_1_8_15 { public: diff --git a/src/translator_fr.h b/src/translator_fr.h index 9775a29..b0fb5b1 100644 --- a/src/translator_fr.h +++ b/src/translator_fr.h @@ -103,7 +103,7 @@ // Translator class (by the local maintainer) when the localized // translator is made up-to-date again. -class TranslatorFrench : public Translator +class TranslatorFrench : public TranslatorAdapter_1_8_15 { public: diff --git a/src/translator_gr.h b/src/translator_gr.h index 8b7afe1..6ed43db 100644 --- a/src/translator_gr.h +++ b/src/translator_gr.h @@ -42,7 +42,7 @@ #ifndef TRANSLATOR_GR_H #define TRANSLATOR_GR_H -class TranslatorGreek : public Translator +class TranslatorGreek : public TranslatorAdapter_1_8_15 { public: @@ -59,8 +59,8 @@ class TranslatorGreek : public Translator virtual QCString latexLanguageSupportCommand() { - //return "\\usepackage[greek,english]{babel}\n\\usepackage[iso-8859-7]{inputenc}\n"; - return "\\usepackage[greek,english]{babel}\n"; + return "\\usepackage[greek,english]{babel}\n" + "\\usepackage{alphabeta}\n"; } // --- Language translation methods ------------------- diff --git a/src/translator_it.h b/src/translator_it.h index 8f08b5a..9638a01 100644 --- a/src/translator_it.h +++ b/src/translator_it.h @@ -89,7 +89,7 @@ #ifndef TRANSLATOR_IT_H #define TRANSLATOR_IT_H -class TranslatorItalian : public Translator +class TranslatorItalian : public TranslatorAdapter_1_8_15 { public: diff --git a/src/translator_je.h b/src/translator_je.h index 835a516..d555421 100644 --- a/src/translator_je.h +++ b/src/translator_je.h @@ -36,7 +36,19 @@ class TranslatorJapaneseEn : public TranslatorEnglish { return "japanese-en"; } virtual QCString latexLanguageSupportCommand() { - return "platex"; + return "\\usepackage{CJKutf8}\n"; + } + virtual QCString latexFontenc() + { + return ""; + } + virtual QCString latexDocumentPre() + { + return "\\begin{CJK}{UTF8}{min}\n"; + } + virtual QCString latexDocumentPost() + { + return "\\end{CJK}\n"; } virtual QCString trRTFansicp() { diff --git a/src/translator_jp.h b/src/translator_jp.h index c4f92c2..fc0d65d 100644 --- a/src/translator_jp.h +++ b/src/translator_jp.h @@ -69,7 +69,7 @@ Doxygen の開発の方でもそれはそれでいーんじゃん?みたいな #ifndef TRANSLATOR_JP_H #define TRANSLATOR_JP_H -class TranslatorJapanese : public Translator +class TranslatorJapanese : public TranslatorAdapter_1_8_15 { public: virtual QCString idLanguage() @@ -77,8 +77,20 @@ class TranslatorJapanese : public Translator virtual QCString latexLanguageSupportCommand() { + return "\\usepackage{CJKutf8}\n"; + } + virtual QCString latexFontenc() + { return ""; } + virtual QCString latexDocumentPre() + { + return "\\begin{CJK}{UTF8}{min}\n"; + } + virtual QCString latexDocumentPost() + { + return "\\end{CJK}\n"; + } /*! used in the compound documentation before a list of related functions. */ virtual QCString trRelatedFunctions() diff --git a/src/translator_ke.h b/src/translator_ke.h index 525cf84..c9f488c 100644 --- a/src/translator_ke.h +++ b/src/translator_ke.h @@ -35,12 +35,22 @@ class TranslatorKoreanEn : public TranslatorEnglish { return "korean-en"; } virtual QCString latexLanguageSupportCommand() { - return "\\usepackage{hfont}\n"; + return "\\usepackage{kotex}\n"; } virtual QCString trRTFansicp() { return "949"; } + virtual QCString latexCommandName() + { + QCString latex_command = Config_getString(LATEX_CMD_NAME); + if (latex_command.isEmpty()) latex_command = "latex"; + if (Config_getBool(USE_PDFLATEX)) + { + if (latex_command == "latex") latex_command = "xelatex"; + } + return latex_command; + } /*! Used as ansicpg for RTF fcharset * \see trRTFansicp() for a table of possible values. diff --git a/src/translator_kr.h b/src/translator_kr.h index 7e95e3b..fb1c356 100644 --- a/src/translator_kr.h +++ b/src/translator_kr.h @@ -48,7 +48,7 @@ Translator class (by the local maintainer) when the localized translator is made up-to-date again. */ -class TranslatorKorean : public Translator +class TranslatorKorean : public TranslatorAdapter_1_8_15 { protected: friend class TranslatorAdapterBase; @@ -86,7 +86,17 @@ class TranslatorKorean : public Translator // I'm not sure what this should be. // When I figure it out, I'll update this. // see http://www.ktug.or.kr/jsboard/read.php?table=operate&no=4422&page=1 - return "\\usepackage{hfont}\n"; + return "\\usepackage{kotex}\n"; + } + virtual QCString latexCommandName() + { + QCString latex_command = Config_getString(LATEX_CMD_NAME); + if (latex_command.isEmpty()) latex_command = "latex"; + if (Config_getBool(USE_PDFLATEX)) + { + if (latex_command == "latex") latex_command = "xelatex"; + } + return latex_command; } // --- Language translation methods ------------------- diff --git a/src/translator_lv.h b/src/translator_lv.h index 2736bb0..bd579da 100644 --- a/src/translator_lv.h +++ b/src/translator_lv.h @@ -76,7 +76,7 @@ class TranslatorLatvian : public TranslatorAdapter_1_8_4 */ virtual QCString latexLanguageSupportCommand() { - return "\\usepackage[LV]{fontenc}\n" + return "\\usepackage[T2A]{fontenc}\n" "\\usepackage[latvian]{babel}\n"; } diff --git a/src/translator_nl.h b/src/translator_nl.h index 241cf97..b6d0d1d 100644 --- a/src/translator_nl.h +++ b/src/translator_nl.h @@ -18,7 +18,7 @@ #ifndef TRANSLATOR_NL_H #define TRANSLATOR_NL_H -class TranslatorDutch : public Translator +class TranslatorDutch : public TranslatorAdapter_1_8_15 { public: QCString idLanguage() diff --git a/src/translator_no.h b/src/translator_no.h index 58b596a..eccd952 100644 --- a/src/translator_no.h +++ b/src/translator_no.h @@ -72,8 +72,7 @@ class TranslatorNorwegian : public TranslatorAdapter_1_4_6 virtual QCString latexLanguageSupportCommand() { return - "\\usepackage[norwegian]{babel}\n" - "\\usepackage[T1]{fontenc}\n"; + "\\usepackage[norsk]{babel}\n"; } // --- Language translation methods ------------------- diff --git a/src/translator_pl.h b/src/translator_pl.h index 421f407..e0ecc8f 100644 --- a/src/translator_pl.h +++ b/src/translator_pl.h @@ -44,8 +44,14 @@ class TranslatorPolish : public TranslatorAdapter_1_8_2 */ QCString latexLanguageSupportCommand() { - return "\\usepackage{polski}\n" - "\\usepackage[T1]{fontenc}\n"; + return "\\usepackage[polish]{babel}\n" + "\\let\\lll\\undefined\n"; /* to overcome problems with the <<< + symbol as defined in the amssymb + package, and the Polish symbol + "Latin Small Letter L With Stroke" + ł or ł or ł + We take the amssymb symbol as leading. + */ } // --- Language translation methods ------------------- diff --git a/src/translator_pt.h b/src/translator_pt.h index c58bf64..6bbe2bc 100644 --- a/src/translator_pt.h +++ b/src/translator_pt.h @@ -55,7 +55,7 @@ #define TRANSLATOR_PT_H -class TranslatorPortuguese : public Translator +class TranslatorPortuguese : public TranslatorAdapter_1_8_15 { public: @@ -85,7 +85,10 @@ class TranslatorPortuguese : public Translator * the empty string is returned in this implementation. */ virtual QCString latexLanguageSupportCommand() - { return "Portuguese"; } + { + return + "\\usepackage[portuges]{babel}\n"; + } // --- Language translation methods ------------------- diff --git a/src/translator_ro.h b/src/translator_ro.h index 661578b..6f0c197 100644 --- a/src/translator_ro.h +++ b/src/translator_ro.h @@ -42,7 +42,7 @@ #define TRANSLATOR_RO_H -class TranslatorRomanian : public Translator +class TranslatorRomanian : public TranslatorAdapter_1_8_15 { public: diff --git a/src/translator_ru.h b/src/translator_ru.h index 54c0202..9d92888 100644 --- a/src/translator_ru.h +++ b/src/translator_ru.h @@ -26,7 +26,7 @@ #ifndef TRANSLATOR_RU_H #define TRANSLATOR_RU_H -class TranslatorRussian : public Translator +class TranslatorRussian : public TranslatorAdapter_1_8_15 { public: /*! Used for identification of the language. */ diff --git a/src/translator_sc.h b/src/translator_sc.h index d2b3954..e8191df 100644 --- a/src/translator_sc.h +++ b/src/translator_sc.h @@ -71,6 +71,11 @@ class TranslatorSerbianCyrillic : public TranslatorAdapter_1_6_0 */ virtual QCString latexLanguageSupportCommand() { + return "\\usepackage[T2A]{fontenc}\n" + "\\usepackage[russian]{babel}\n"; + } + virtual QCString latexFontenc() + { return ""; } diff --git a/src/translator_si.h b/src/translator_si.h index 792053e..2dd7e5b 100644 --- a/src/translator_si.h +++ b/src/translator_si.h @@ -36,7 +36,7 @@ class TranslatorSlovene : public TranslatorAdapter_1_4_6 */ QCString latexLanguageSupportCommand() { - return "\\usepackage[slovene]{babel}\n\\usepackage[T1]{fontenc}\n"; + return "\\usepackage[slovene]{babel}\n"; } QCString trRelatedFunctions() { return "Povezane funkcije"; } diff --git a/src/translator_sk.h b/src/translator_sk.h index 3a925ec..ec8af4b 100644 --- a/src/translator_sk.h +++ b/src/translator_sk.h @@ -32,7 +32,7 @@ #ifndef TRANSLATOR_SK_H #define TRANSLATOR_SK_H -class TranslatorSlovak : public Translator +class TranslatorSlovak : public TranslatorAdapter_1_8_15 { public: // --- Language control methods ------------------- diff --git a/src/translator_sv.h b/src/translator_sv.h index 88fffd9..5da89df 100644 --- a/src/translator_sv.h +++ b/src/translator_sv.h @@ -120,7 +120,7 @@ Problem! #ifndef TRANSLATOR_SE_H #define TRANSLATOR_SE_H -class TranslatorSwedish : public Translator +class TranslatorSwedish : public TranslatorAdapter_1_8_15 { public: diff --git a/src/translator_tw.h b/src/translator_tw.h index 26a6db6..9e9092d 100644 --- a/src/translator_tw.h +++ b/src/translator_tw.h @@ -41,7 +41,7 @@ // Translator class (by the local maintainer) when the localized // translator is made up-to-date again. -class TranslatorChinesetraditional : public Translator +class TranslatorChinesetraditional : public TranslatorAdapter_1_8_15 { public: @@ -72,8 +72,20 @@ class TranslatorChinesetraditional : public Translator */ virtual QCString latexLanguageSupportCommand() { + return "\\usepackage{CJKutf8}\n"; + } + virtual QCString latexFontenc() + { return ""; } + virtual QCString latexDocumentPre() + { + return "\\begin{CJK}{UTF8}{min}\n"; + } + virtual QCString latexDocumentPost() + { + return "\\end{CJK}\n"; + } // --- Language translation methods ------------------- diff --git a/src/translator_vi.h b/src/translator_vi.h index a0046b0..b391b0c 100644 --- a/src/translator_vi.h +++ b/src/translator_vi.h @@ -78,9 +78,23 @@ class TranslatorVietnamese : public TranslatorAdapter_1_6_0 */ virtual QCString latexLanguageSupportCommand() { + return + "\\usepackage[vietnamese]{babel}\n"; + } + virtual QCString latexFontenc() + { return ""; } - + virtual QCString latexCommandName() + { + QCString latex_command = Config_getString(LATEX_CMD_NAME); + if (latex_command.isEmpty()) latex_command = "latex"; + if (Config_getBool(USE_PDFLATEX)) + { + if (latex_command == "latex") latex_command = "xelatex"; + } + return latex_command; + } // --- Language translation methods ------------------- /*! used in the compound documentation before a list of related functions. */ diff --git a/src/util.cpp b/src/util.cpp index 330e061..352cb87 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -323,7 +323,6 @@ int guessSection(const char *name) n.right(4)==".c++" || n.right(5)==".java" || n.right(2)==".m" || - n.right(2)==".M" || n.right(3)==".mm" || n.right(3)==".ii" || // inline n.right(4)==".ixx" || diff --git a/src/vhdlcode.l b/src/vhdlcode.l index ce1f92b..618258f 100644 --- a/src/vhdlcode.l +++ b/src/vhdlcode.l @@ -94,7 +94,7 @@ static QCString g_exampleFile; static QCString g_classScope; -static QCString g_CurrScope; +static bool g_CurrARCH = FALSE; static FileDef * g_sourceFileDef; static Definition * g_currentDefinition; @@ -109,7 +109,7 @@ static int g_braceCount=0; static void writeFont(const char *s,const char* text); static void generateMemLink(CodeOutputInterface &ol,QCString &clName,QCString& memberName); static bool writeColoredWord(QCString& word ); -static void generateClassOrGlobalLink(CodeOutputInterface &ol,const char *clName, bool typeOnly=FALSE); +static void generateClassOrGlobalLink(CodeOutputInterface &ol,const char *clName, bool typeOnly=FALSE, const char *curr_class=0); static void endFontClass(); static void startFontClass(const char *s); //------------------------------------------------------------------- @@ -291,7 +291,7 @@ static void writeWord(const char *word,const char* curr_class=0,bool classLink=F } else { - generateClassOrGlobalLink(*g_code,temp); + generateClassOrGlobalLink(*g_code,temp,FALSE,curr_class); } } else @@ -328,7 +328,7 @@ static void writeWord(const char *word,const char* curr_class=0,bool classLink=F } else { - generateClassOrGlobalLink(*g_code,temp); + generateClassOrGlobalLink(*g_code,temp,FALSE,curr_class); } } else @@ -383,7 +383,7 @@ static void codifyLines(const char *text,const char *cl=0,bool classlink=FALSE,b if (comment) writeFont("keyword",sp); else - writeWord(sp,cl,classlink); + writeWord(sp,cl,classlink); done=TRUE; } } @@ -510,7 +510,7 @@ static void generateMemLink(CodeOutputInterface &ol,QCString &clName,QCString& m }// generateMemLink -static void generateClassOrGlobalLink(CodeOutputInterface &ol,const char *clName, bool /*typeOnly*/) +static void generateClassOrGlobalLink(CodeOutputInterface &ol,const char *clName, bool /*typeOnly*/, const char *curr_class) { QCString className=clName; @@ -521,6 +521,11 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,const char *clName //bool isLocal=FALSE; className.stripPrefix("_"); cd = getClass(className.data()); + if (!cd && curr_class) + { + if (QCString(curr_class).contains(QRegExp("::"+QCString(clName)+"$"))) cd = getClass(curr_class); + } + while (cd) { //className.stripPrefix("_"); @@ -759,7 +764,7 @@ DIGITSS [0-9]+|[0-9]+("#")*[0-9_a-fA-F\+\.\-]+("#")* ALLTYPESMAP {B}*[_a-zA-Z0-9. ]+{BN}* ALLTYPESMAP1 {BN}*[_a-zA-Z0-9.() ]+{BN}* -ARCHITECTURE ^{B}*("architecture"){BN}+{FUNCNAME}{BN}+("of"){BN}+{FUNCNAME} +ARCHITECTURE ^{B}*("architecture"){BN}+{FUNCNAME}{BN}+("of"){BN}+{FUNCNAME}{BN}+("is") PROCESS ({BN}*{FUNCNAME}{BN}*[:]+{BN}*("process"){BN}*[(]*)|[^a-zA-Z]("process "|"process("){BN}*[ (]*|[^a-zA-Z]("process"){BN}+ END1 {B}*("end "){BN}+("if"|"case"|"loop"|"generate"|"for") @@ -768,7 +773,7 @@ END3 {BN}*[^a-zA-Z]("end"){BN}+{FUNCNAME}{BN}*[;] END4 {B}*("end"){BN}+"function"{BN}+{FUNCNAME}{BN}*[;] ENDEFUNC {END3}|{END4}|{END2} -KEYWORD ("new"|"event"|"break"|"case"|"end"|"loop"|"else"|"for"|"goto"|"if"|"return"|"generate"|"is"|"while"|"in") +KEYWORD ("of"|"new"|"event"|"break"|"case"|"end"|"loop"|"else"|"for"|"goto"|"if"|"return"|"generate"|"is"|"while"|"in") TYPEKW ^{B}*("type"|"subtype"|"constant"|"attribute"|"signal"|"variable","alias","configuration") FUNC ^{B}*("function"|"procedure"){BN}*{FUNCNAME}{BN}*("(") @@ -807,6 +812,7 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI %x ClassVar %x ClassesName %x Map +%x End %x Body %% @@ -1058,14 +1064,7 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI g_CurrClass.append(vhdlcodeYYtext); g_CurrClass=g_CurrClass.stripWhiteSpace(); - if (!writeColoredWord(g_CurrScope)) - { - generateClassOrGlobalLink(*g_code,vhdlcodeYYtext); - } - else - { - codifyLines(vhdlcodeYYtext,g_CurrClass.data()); - } + generateClassOrGlobalLink(*g_code,vhdlcodeYYtext); BEGIN(Bases); } @@ -1284,6 +1283,7 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI //temp+=("-"); //temp+=VhdlDocGen::getIndexWord(vhdlcodeYYtext,3); QCString temp = VhdlDocGen::getIndexWord(vhdlcodeYYtext,3); + g_CurrARCH = TRUE; temp+="::"; temp+=VhdlDocGen::getIndexWord(vhdlcodeYYtext,1); g_CurrClass=temp; @@ -1291,7 +1291,6 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI codifyLines(vhdlcodeYYtext,temp.data(),TRUE); //generateClassOrGlobalLink(*g_code,temp.data()); isPackageBody=FALSE; - BEGIN(ClassName); } @@ -1371,6 +1370,41 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI } +<Bases>"end"{BN}+"architecture"{BN}+{FUNCNAME} { + codifyLines(vhdlcodeYYtext,g_CurrClass.data(),TRUE); + g_CurrARCH = FALSE; + } +<Bases>"end"{BN}+{FUNCNAME} { + if (g_CurrARCH) + { + codifyLines(vhdlcodeYYtext,g_CurrClass.data(),TRUE); + g_CurrARCH = FALSE; + } + else + REJECT; + } +<Bases>"end" { + appStringLower(g_PrevString,vhdlcodeYYtext); + QCString temp(vhdlcodeYYtext); + temp=temp.stripWhiteSpace(); + + writeColoredWord(temp); + BEGIN(End); + } +<End>{ID} { + appStringLower(g_PrevString,vhdlcodeYYtext); + QCString temp(vhdlcodeYYtext); + temp=temp.stripWhiteSpace(); + + if (!writeColoredWord(temp)) + { + generateClassOrGlobalLink(*g_code,temp.data()); + } + } +<End>";" { + codifyLines(vhdlcodeYYtext); + BEGIN(Bases); + } <Bases>{KEYWORD} { // found keyword QCString qcs(vhdlcodeYYtext); if (!writeColoredWord(qcs)) diff --git a/src/vhdldocgen.cpp b/src/vhdldocgen.cpp index dcf7f42..007c45f 100644 --- a/src/vhdldocgen.cpp +++ b/src/vhdldocgen.cpp @@ -61,7 +61,7 @@ #include "vhdlcode.h" #include "plantuml.h" //#define DEBUGFLOW -#define theTranslator_vhdlType VhdlDocGen::trVhdlType +#define theTranslator_vhdlType theTranslator->trVhdlType static QDict<QCString> g_vhdlKeyDict0(17,FALSE); static QDict<QCString> g_vhdlKeyDict1(17,FALSE); @@ -968,7 +968,6 @@ QCString VhdlDocGen::getClassTitle(const ClassDef *cd) int ii=cd->protection(); pageTitle+=" "; pageTitle+=theTranslator_vhdlType(ii+2,TRUE); - pageTitle+=" "; return pageTitle; } // getClassTitle @@ -1241,42 +1240,6 @@ QCString VhdlDocGen::getProtectionName(int prot) return ""; } -QCString VhdlDocGen::trTypeString(uint64 type) -{ - switch(type) - { - case VhdlDocGen::LIBRARY: return "Library"; - case VhdlDocGen::ENTITY: return "Entity"; - case VhdlDocGen::PACKAGE_BODY: return "Package Body"; - case VhdlDocGen::ATTRIBUTE: return "Attribute"; - case VhdlDocGen::PACKAGE: return "Package"; - case VhdlDocGen::SIGNAL: return "Signal"; - case VhdlDocGen::COMPONENT: return "Component"; - case VhdlDocGen::CONSTANT: return "Constant"; - case VhdlDocGen::TYPE: return "Type"; - case VhdlDocGen::SUBTYPE: return "Subtype"; - case VhdlDocGen::FUNCTION: return "Function"; - case VhdlDocGen::RECORD: return "Record"; - case VhdlDocGen::PROCEDURE: return "Procedure"; - case VhdlDocGen::ARCHITECTURE: return "Architecture"; - case VhdlDocGen::USE: return "Package"; - case VhdlDocGen::PROCESS: return "Process"; - case VhdlDocGen::PORT: return "Port"; - case VhdlDocGen::GENERIC: return "Generic"; - case VhdlDocGen::UNITS: return "Units"; - //case VhdlDocGen::PORTMAP: return "Port Map"; - case VhdlDocGen::SHAREDVARIABLE: return "Shared Variable"; - case VhdlDocGen::GROUP: return "Group"; - case VhdlDocGen::VFILE: return "File"; - case VhdlDocGen::INSTANTIATION: return "Instantiation"; - case VhdlDocGen::ALIAS: return "Alias"; - case VhdlDocGen::CONFIG: return "Configuration"; - case VhdlDocGen::MISCELLANEOUS: return "Miscellaneous"; - case VhdlDocGen::UCF_CONST: return "Constraints"; - default: return ""; - } -} // convertType - /*! * deletes a char backwards in a string */ @@ -1790,7 +1753,7 @@ void VhdlDocGen::writeVhdlDeclarations(MemberList* ml, VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::GROUP,FALSE),0,FALSE,VhdlDocGen::GROUP); VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::INSTANTIATION,FALSE),0,FALSE,VhdlDocGen::INSTANTIATION); VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::ALIAS,FALSE),0,FALSE,VhdlDocGen::ALIAS); - VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::MISCELLANEOUS),0,FALSE,VhdlDocGen::MISCELLANEOUS); + VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::MISCELLANEOUS,TRUE),0,FALSE,VhdlDocGen::MISCELLANEOUS); // configurations must be added to global file definitions. VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::CONFIG,FALSE),0,FALSE,VhdlDocGen::CONFIG); @@ -2096,19 +2059,21 @@ void VhdlDocGen::writeVHDLDeclaration(MemberDef* mdef,OutputList &ol, writeLink(mdef,ol); ol.docify(" "); - ol.insertMemberAlign(); if (mm==VhdlDocGen::GENERIC) { + ol.insertMemberAlign(); ol.startBold(); VhdlDocGen::formatString(largs,ol,mdef); ol.endBold(); } else { + ol.insertMemberAlignLeft(isAnonymous, false); ol.docify(" "); ol.startBold(); VhdlDocGen::formatString(ltype,ol,mdef); ol.endBold(); + ol.insertMemberAlign(); ol.docify(" "); VhdlDocGen::formatString(largs,ol,mdef); } @@ -2263,11 +2228,11 @@ void VhdlDocGen::writeVHDLDeclaration(MemberDef* mdef,OutputList &ol, ol.endMemberItem(); if (!mdef->briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC) /* && !annMemb */) { - QCString s=mdef->briefDescription(); - ol.startMemberDescription(mdef->anchor()); + QCString s=mdef->briefDescription(); + ol.startMemberDescription(mdef->anchor(), NULL, mm == VhdlDocGen::PORT); ol.generateDoc(mdef->briefFile(),mdef->briefLine(), - mdef->getOuterScope()?mdef->getOuterScope():d, - mdef,s.data(),TRUE,FALSE,0,TRUE,FALSE); + mdef->getOuterScope()?mdef->getOuterScope():d, + mdef,s.data(),TRUE,FALSE,0,TRUE,FALSE); if (detailsVisible) { ol.pushGeneratorState(); @@ -2364,7 +2329,7 @@ void VhdlDocGen::writeVHDLDeclarations(MemberList* ml,OutputList &ol, if (title) { - ol.startMemberHeader(title); + ol.startMemberHeader(title,type == VhdlDocGen::PORT ? 3 : 2); ol.parseText(title); ol.endMemberHeader(); ol.docify(" "); @@ -2416,7 +2381,7 @@ bool VhdlDocGen::writeClassType( ClassDef *& cd, OutputList &ol ,QCString & cname) { int id=cd->protection(); - QCString qcs = VhdlDocGen::trTypeString(id+2); + QCString qcs = theTranslator->trVhdlType(id+2,TRUE); cname=VhdlDocGen::getClassName(cd); ol.startBold(); ol.writeString(qcs.data()); @@ -2426,128 +2391,6 @@ bool VhdlDocGen::writeClassType( ClassDef *& cd, return FALSE; }// writeClassLink -QCString VhdlDocGen::trVhdlType(uint64 type,bool sing) -{ - switch(type) - { - case VhdlDocGen::LIBRARY: - if (sing) return "Library"; - else return "Libraries"; - case VhdlDocGen::PACKAGE: - if (sing) return "Package"; - else return "Packages"; - case VhdlDocGen::SIGNAL: - if (sing) return "Signal"; - else return "Signals"; - case VhdlDocGen::COMPONENT: - if (sing) return "Component"; - else return "Components"; - case VhdlDocGen::CONSTANT: - if (sing) return "Constant"; - else return "Constants"; - case VhdlDocGen::ENTITY: - if (sing) return "Entity"; - else return "Entities"; - case VhdlDocGen::TYPE: - if (sing) return "Type"; - else return "Types"; - case VhdlDocGen::SUBTYPE: - if (sing) return "Subtype"; - else return "Subtypes"; - case VhdlDocGen::FUNCTION: - if (sing) return "Function"; - else return "Functions"; - case VhdlDocGen::RECORD: - if (sing) return "Record"; - else return "Records"; - case VhdlDocGen::PROCEDURE: - if (sing) return "Procedure"; - else return "Procedures"; - case VhdlDocGen::ARCHITECTURE: - if (sing) return "Architecture"; - else return "Architectures"; - case VhdlDocGen::ATTRIBUTE: - if (sing) return "Attribute"; - else return "Attributes"; - case VhdlDocGen::PROCESS: - if (sing) return "Process"; - else return "Processes"; - case VhdlDocGen::PORT: - if (sing) return "Port"; - else return "Ports"; - case VhdlDocGen::USE: - if (sing) return "use clause"; - else return "Use Clauses"; - case VhdlDocGen::GENERIC: - if (sing) return "Generic"; - else return "Generics"; - case VhdlDocGen::PACKAGE_BODY: - return "Package Body"; - case VhdlDocGen::UNITS: - return "Units"; - case VhdlDocGen::SHAREDVARIABLE: - if (sing) return "Shared Variable"; - return "Shared Variables"; - case VhdlDocGen::VFILE: - if (sing) return "File"; - return "Files"; - case VhdlDocGen::GROUP: - if (sing) return "Group"; - return "Groups"; - case VhdlDocGen::INSTANTIATION: - if (sing) return "Instantiation"; - else return "Instantiations"; - case VhdlDocGen::ALIAS: - if (sing) return "Alias"; - return "Aliases"; - case VhdlDocGen::CONFIG: - if (sing) return "Configuration"; - return "Configurations"; - case VhdlDocGen::MISCELLANEOUS: - return "Miscellaneous"; - case VhdlDocGen::UCF_CONST: - return "Constraints"; - default: - return "Class"; - } -} - -QCString VhdlDocGen::trDesignUnitHierarchy() -{ - return "Design Unit Hierarchy"; -} - -QCString VhdlDocGen::trDesignUnitList() -{ - return "Design Unit List"; -} - -QCString VhdlDocGen::trDesignUnitMembers() -{ - return "Design Unit Members"; -} - -QCString VhdlDocGen::trDesignUnitListDescription() -{ - return "Here is a list of all design unit members with links to " - "the Entities they belong to:"; -} - -QCString VhdlDocGen::trDesignUnitIndex() -{ - return "Design Unit Index"; -} - -QCString VhdlDocGen::trDesignUnits() -{ - return "Design Units"; -} - -QCString VhdlDocGen::trFunctionAndProc() -{ - return "Functions/Procedures/Processes"; -} - /*! writes a link if the string is linkable else a formatted string */ @@ -3993,7 +3836,7 @@ void FlowChart::createSVG() //const MemberDef *m=VhdlDocGen::getFlowMember(); //if (m) - // fprintf(stderr,"\n creating flowchart : %s %s in file %s \n",VhdlDocGen::trTypeString(m->getMemberSpecifiers()),m->name().data(),m->getFileDef()->name().data()); + // fprintf(stderr,"\n creating flowchart : %s %s in file %s \n",theTranslator->trVhdlType(m->getMemberSpecifiers(),TRUE),m->name().data(),m->getFileDef()->name().data()); QCString dir=" -o \""+ov+qcs+"\""; ov+="/flow_design.dot"; diff --git a/src/vhdldocgen.h b/src/vhdldocgen.h index bd190ca..9dd8417 100644 --- a/src/vhdldocgen.h +++ b/src/vhdldocgen.h @@ -150,33 +150,6 @@ class VhdlDocGen static bool isMisc(const MemberDef *mdef); //----------------------------------------------------- - // translatable items - - static QCString trTypeString(uint64 type); - static QCString trVhdlType(uint64 type,bool sing=true); - - // trClassHierarchy. - static QCString trDesignUnitHierarchy(); - - // trCompoundList - static QCString trDesignUnitList(); - - // trCompoundMembers. - static QCString trDesignUnitMembers(); - - // trCompoundListDescription - static QCString trDesignUnitListDescription(); - - // trCompounds - static QCString trDesignUnits(); - - // trCompoundIndex - static QCString trDesignUnitIndex(); - - // trFunctions - static QCString trFunctionAndProc(); - - //----------------------------------------------------- static void prepareComment(QCString&); static void formatString(const QCString&,OutputList& ol,const MemberDef*); diff --git a/templates/html/dynsections.js b/templates/html/dynsections.js index c1ce122..ea0a7b3 100644 --- a/templates/html/dynsections.js +++ b/templates/html/dynsections.js @@ -60,7 +60,7 @@ function toggleLevel(level) $(this).show(); } else if (l==level+1) { i.removeClass('iconfclosed iconfopen').addClass('iconfclosed'); - a.html('▶'); + a.html('►'); $(this).show(); } else { $(this).hide(); @@ -87,7 +87,7 @@ function toggleFolder(id) // replace down arrow by right arrow for current row var currentRowSpans = currentRow.find("span"); currentRowSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed"); - currentRowSpans.filter(".arrow").html('▶'); + currentRowSpans.filter(".arrow").html('►'); rows.filter("[id^=row_"+id+"]").hide(); // hide all children } else { // we are SHOWING // replace right arrow by down arrow for current row @@ -97,7 +97,7 @@ function toggleFolder(id) // replace down arrows by right arrows for child rows var childRowsSpans = childRows.find("span"); childRowsSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed"); - childRowsSpans.filter(".arrow").html('▶'); + childRowsSpans.filter(".arrow").html('►'); childRows.show(); //show all children } updateStripes(); diff --git a/templates/html/htmldirtree.tpl b/templates/html/htmldirtree.tpl index 6d3ef8c..a6b9b21 100644 --- a/templates/html/htmldirtree.tpl +++ b/templates/html/htmldirtree.tpl @@ -20,7 +20,7 @@ {% else %} <span style="width:{{ (node.level)*16 }}px;display:inline-block;"> </span> <span id="arr_{{ node.id }}" class="arrow" onclick="toggleFolder('{{ node.id}}')"> - {%if node.level+1<tree.preferredDepth %}▼{% else %}▶{% endif %} + {%if node.level+1<tree.preferredDepth %}▼{% else %}►{% endif %} </span> {% endif %} {% if node.namespace %} diff --git a/templates/html/navtree.js b/templates/html/navtree.js index e310bc9..7ce2935 100644 --- a/templates/html/navtree.js +++ b/templates/html/navtree.js @@ -23,7 +23,7 @@ */ var navTreeSubIndices = new Array(); var arrowDown = '▼'; -var arrowRight = '▶'; +var arrowRight = '►'; function getData(varName) { |