From 38c6a14b15d87348076be142abea8663009ace82 Mon Sep 17 00:00:00 2001 From: dimitri Date: Wed, 23 Jan 2008 21:30:39 +0000 Subject: Release-1.5.4-20080123 --- INSTALL | 4 +- Makefile.in | 5 +- README | 4 +- configure | 2 +- doc/commands.doc | 23 ++++++- doc/config.doc | 16 ++--- doc/output.doc | 2 +- qtools/qcstring.cpp | 2 +- qtools/qcstring.h | 1 + qtools/scstring.cpp | 4 +- src/commentcnv.l | 39 +++++++++++- src/commentscan.l | 8 +++ src/config.l | 12 ++-- src/defargs.l | 7 +- src/definition.cpp | 39 ++++++++---- src/docsets.cpp | 11 ++-- src/doxygen.cpp | 6 +- src/filedef.cpp | 5 +- src/fortrancode.l | 12 ++-- src/fortranscanner.l | 156 ++++++++++++++++++++++++--------------------- src/groupdef.cpp | 40 +++++++----- src/groupdef.h | 4 +- src/index.cpp | 2 +- src/pre.l | 12 ++-- src/pyscanner.l | 2 +- src/scanner.l | 3 +- src/util.cpp | 23 ++++++- src/vhdldocgen.cpp | 67 +++++++++++-------- src/vhdlscanner.l | 1 + winbuild/Doxywizard.vcproj | 4 +- 30 files changed, 338 insertions(+), 178 deletions(-) diff --git a/INSTALL b/INSTALL index fbe41fb..ddcac48 100644 --- a/INSTALL +++ b/INSTALL @@ -1,7 +1,7 @@ -DOXYGEN Version 1.5.4-20080101 +DOXYGEN Version 1.5.4-20080123 Please read the installation section of the manual (http://www.doxygen.org/install.html) for instructions. -------- -Dimitri van Heesch (01 January 2008) +Dimitri van Heesch (23 January 2008) diff --git a/Makefile.in b/Makefile.in index 233e57b..3d299c3 100644 --- a/Makefile.in +++ b/Makefile.in @@ -41,9 +41,12 @@ distclean: clean -rm -r addon/doxywizard/Makefile -rm -f addon/doxywizard/Makefile.doxywizard -rm -f addon/doxywizard/doxywizard.pro - -rm -f addon/doxywizard/obj/*.o -rm -f addon/doxywizard/moc/moc_* -rm -f addon/doxywizard/config.cpp + -rm -f addon/doxywizard/lib + -rm -f addon/doxywizard/objects + -rm -f VERSION + -rm -f packages/rpm/doxygen.spec DATE=$(shell date "+%B %Y") diff --git a/README b/README index b5733ed..f3dbb49 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -DOXYGEN Version 1.5.4_20080101 +DOXYGEN Version 1.5.4_20080123 Please read INSTALL for compilation instructions. @@ -17,4 +17,4 @@ to subscribe to the lists or to visit the archives. Enjoy, -Dimitri van Heesch (dimitri@stack.nl) (01 January 2008) +Dimitri van Heesch (dimitri@stack.nl) (23 January 2008) diff --git a/configure b/configure index 6590f8f..bcbd4a8 100755 --- a/configure +++ b/configure @@ -20,7 +20,7 @@ doxygen_version_minor=5 doxygen_version_revision=4 #NOTE: Setting version_mmn to "NO" will omit mmn info from the package. -doxygen_version_mmn=20080101 +doxygen_version_mmn=20080123 bin_dirs=`echo $PATH | sed -e "s/:/ /g"` diff --git a/doc/commands.doc b/doc/commands.doc index 05f812f..7843999 100644 --- a/doc/commands.doc +++ b/doc/commands.doc @@ -88,6 +88,7 @@ documentation: \refitem cmdfcurlyclose \\f} \refitem cmdfile \\file \refitem cmdfn \\fn +\refitem cmdheaderfile \\headerfile \refitem cmdhideinitializer \\hideinitializer \refitem cmdhtmlinclude \\htmlinclude \refitem cmdhtmlonly \\htmlonly @@ -259,7 +260,9 @@ doxygen. Unrecognized commands are treated as normal text. on the default include path (like \). With the \ argument you can also specify how the include statement should look like, by adding either quotes or sharp brackets around the name. - Sharp brackets are used if just the name is given. + Sharp brackets are used if just the name is given. Note that the + last two arguments can also specified using + the \ref cmdheaderfile "\\headerfile" command. \par Example: \verbinclude class.h @@ -421,6 +424,24 @@ doxygen. Unrecognized commands are treated as normal text. \sa section \ref cmdvar "\\var" and \ref cmdtypedef "\\typedef".
+\section cmdheaderfile \\headerfile [] + + \addindex \\headerfile + Intended to be used for class, struct, or union documentation, where + the documentation is in front of the definition. The arguments of + this command are the same as the second and third argument of + \ref cmdclass "\\cmdclass". + The header-file name refers to the file that should by included by the + application to obtain the definition of the class, struct, or union. + The \ argument can be used to overwrite the + name of the link that is used in the class documentation to something other + than \. This can be useful if the include name is not located + on the default include path (like \). With the \ + argument you can also specify how the include statement should look like, + by adding either quotes or sharp brackets around the name. + Sharp brackets are used if just the name is given. + +
\section cmdhideinitializer \\hideinitializer \addindex \\hideinitializer diff --git a/doc/config.doc b/doc/config.doc index 4b6b949..3c8a6b2 100644 --- a/doc/config.doc +++ b/doc/config.doc @@ -543,13 +543,13 @@ sources. Doxygen will then generate output that is tailored for VHDL. \anchor cfg_typedef_hides_struct
\c TYPEDEF_HIDES_STRUCT
\addindex TYPEDEF_HIDES_STRUCT - When \c TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct (or union) is - documented as struct with the name of the typedef. So - typedef struct TypeS {} TypeT, will appear in the documentation as a struct - with name \c TypeT. When disabled the typedef will appear as a member of a file, - namespace, or class. And the struct will be named \c TypeS. This can typically - be useful for C code where the coding convention is that all structs are - typedef'ed and only the typedef is referenced never the struct's name. + When \c TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum + is documented as struct, union, or enum with the name of the typedef. So + typedef struct TypeS {} TypeT, will appear in the documentation as a struct + with name \c TypeT. When disabled the typedef will appear as a member of a file, + namespace, or class. And the struct will be named \c TypeS. This can typically + be useful for C code in case the coding convention dictates that all compound + types are typedef'ed and only the typedef is referenced, never the tag name. @@ -1189,7 +1189,7 @@ FILE_VERSION_INFO = "cleartool desc -fmt \%Vn" on Windows. The HTML Help Workshop contains a compiler that can convert all HTML output - generated by doxygen into a single compressed HTML file (.chm). Compressed + generated by doxygen into a single compiled HTML file (.chm). Compiled HTML files are now used as the Windows 98 help format, and will replace the old Windows help format (.hlp) on all Windows platforms in the future. Compressed HTML files also contain an index, a table of contents, diff --git a/doc/output.doc b/doc/output.doc index 225d796..f5a8d3d 100644 --- a/doc/output.doc +++ b/doc/output.doc @@ -39,7 +39,7 @@ The following output formats are \e directly supported by doxygen: The following output formats are \e indirectly supported by doxygen:
-
Compressed HTML (a.k.a. Windows 98 help) +
Compiled HTML Help (a.k.a. Windows 98 help)
Generated by Microsoft's HTML Help workshop from the HTML output if \c GENERATE_HTMLHELP is set to \c YES.
PostScript diff --git a/qtools/qcstring.cpp b/qtools/qcstring.cpp index e0e53e4..c3aad40 100644 --- a/qtools/qcstring.cpp +++ b/qtools/qcstring.cpp @@ -466,7 +466,7 @@ QCString QCString::simplifyWhiteSpace() const QCString &QCString::insert( uint index, const char *s ) { - int len = qstrlen(s); + int len = s ? qstrlen(s) : 0; if ( len == 0 ) return *this; uint olen = length(); diff --git a/qtools/qcstring.h b/qtools/qcstring.h index 8df3bfd..ef1189a 100644 --- a/qtools/qcstring.h +++ b/qtools/qcstring.h @@ -295,6 +295,7 @@ inline void QCString::duplicate( const char *str) inline QCString &QCString::duplicate( const char *str, int) { + if (m_data==str) return *this; if (m_data) free(m_data); duplicate(str); return *this; diff --git a/qtools/scstring.cpp b/qtools/scstring.cpp index 5632f57..4a02320 100644 --- a/qtools/scstring.cpp +++ b/qtools/scstring.cpp @@ -84,6 +84,7 @@ SCString::~SCString() SCString &SCString::assign( const char *str ) { + if (m_data==str) return *this; if (m_data) free(m_data); duplicate(str); return *this; @@ -562,8 +563,7 @@ SCString &SCString::replace( const QRegExp &rx, const char *str ) QString d = QString::fromLatin1( m_data ); QString r = QString::fromLatin1( str ); d.replace( rx, r ); - operator=( d.ascii() ); - return *this; + return assign(d.ascii()); } long SCString::toLong( bool *ok ) const diff --git a/src/commentcnv.l b/src/commentcnv.l index 68ee64e..b772868 100644 --- a/src/commentcnv.l +++ b/src/commentcnv.l @@ -64,6 +64,7 @@ static bool g_inSpecialComment; static QCString g_aliasString; static int g_blockCount; static int g_lastBlockContext; +static bool g_PythonDocString; static SrcLangExt g_lang; @@ -273,6 +274,18 @@ void replaceComment(int offset); [^"'\/\n\\#\\-]* { /* eat anything that is not " / or \n */ copyToOutput(yytext,yyleng); } +"\"\"\""! { /* start of python long comment */ + if (g_lang!=SrcLangExt_Python) + { + REJECT; + } + else + { + g_PythonDocString = TRUE; + copyToOutput(yytext,yyleng); + BEGIN(CComment); + } + } "\"" { /* start of a string */ copyToOutput(yytext,yyleng); BEGIN(SkipString); @@ -431,15 +444,34 @@ void replaceComment(int offset); "*"+[^*/\\@\n]* { /* stars without slashes */ copyToOutput(yytext,yyleng); } +"\"\"\"" { /* end of Python docstring */ + if (g_lang!=SrcLangExt_Python) + { + REJECT; + } + else + { + g_PythonDocString = FALSE; + copyToOutput(yytext,yyleng); + BEGIN(Scan); + } + } \n { /* new line in comment */ copyToOutput(yytext,yyleng); } "*"+"/" { /* end of C comment */ - copyToOutput(yytext,yyleng); - BEGIN(Scan); + if (g_lang==SrcLangExt_Python) + { + REJECT; + } + else + { + copyToOutput(yytext,yyleng); + BEGIN(Scan); + } } "\n"/[ \t]*[^#] { /* end of Python comment */ - if (g_lang!=SrcLangExt_Python) + if (g_lang!=SrcLangExt_Python || g_PythonDocString) { REJECT; } @@ -646,6 +678,7 @@ void convertCppComments(BufStr *inBuf,BufStr *outBuf,const char *fileName) g_skip = FALSE; g_fileName = fileName; g_lang = getLanguageFromFileName(fileName); + g_PythonDocString = FALSE; g_lineNr = 0; g_condStack.clear(); g_condStack.setAutoDelete(TRUE); diff --git a/src/commentscan.l b/src/commentscan.l index b72df2f..115aac4 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -57,6 +57,7 @@ static bool handleWeakGroup(const QCString &); static bool handleNamespace(const QCString &); static bool handlePackage(const QCString &); static bool handleClass(const QCString &); +static bool handleHeaderFile(const QCString &); static bool handleProtocol(const QCString &); static bool handleCategory(const QCString &); static bool handleUnion(const QCString &); @@ -134,6 +135,7 @@ static DocCmdMap docCmdMap[] = { "namespace", &handleNamespace, TRUE }, { "package", &handlePackage, TRUE }, { "class", &handleClass, TRUE }, + { "headerfile", &handleHeaderFile, TRUE }, { "protocol", &handleProtocol, TRUE }, { "category", &handleCategory, TRUE }, { "union", &handleUnion, TRUE }, @@ -1900,6 +1902,12 @@ static bool handleClass(const QCString &) return stop; } +static bool handleHeaderFile(const QCString &) +{ + BEGIN( ClassDocArg2 ); + return FALSE; +} + static bool handleProtocol(const QCString &) { // Obj-C protocol bool stop=makeStructuralIndicator(Entry::PROTOCOLDOC_SEC); diff --git a/src/config.l b/src/config.l index 4be1ff7..b328d50 100644 --- a/src/config.l +++ b/src/config.l @@ -1214,6 +1214,7 @@ void Config::check() filePatternList.append("*.dox"); filePatternList.append("*.py"); filePatternList.append("*.f90"); + filePatternList.append("*.f"); filePatternList.append("*.vhd"); filePatternList.append("*.vhdl"); if (portable_fileSystemIsCaseSensitive()) @@ -1234,6 +1235,7 @@ void Config::check() filePatternList.append("*.MM"); filePatternList.append("*.PY"); filePatternList.append("*.F90"); + filePatternList.append("*.F"); filePatternList.append("*.VHD"); filePatternList.append("*.VHDL"); } @@ -1747,13 +1749,13 @@ void Config::create() TRUE ); cb = addBool( "TYPEDEF_HIDES_STRUCT", - "When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct (or union) is \n" - "documented as struct with the name of the typedef. So \n" + "When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum \n" + "is documented as struct, union, or enum with the name of the typedef. So \n" "typedef struct TypeS {} TypeT, will appear in the documentation as a struct \n" "with name TypeT. When disabled the typedef will appear as a member of a file, \n" "namespace, or class. And the struct will be named TypeS. This can typically \n" - "be useful for C code where the coding convention is that all structs are \n" - "typedef'ed and only the typedef is referenced never the struct's name.\n", + "be useful for C code in case the coding convention dictates that all compound \n" + "types are typedef'ed and only the typedef is referenced, never the tag name.\n", FALSE ); //----------------------------------------------------------------------------------------------- @@ -2305,7 +2307,7 @@ void Config::create() "GENERATE_HTMLHELP", "If the GENERATE_HTMLHELP tag is set to YES, additional index files \n" "will be generated that can be used as input for tools like the \n" - "Microsoft HTML help workshop to generate a compressed HTML help file (.chm) \n" + "Microsoft HTML help workshop to generate a compiled HTML help file (.chm) \n" "of the generated HTML documentation. \n", FALSE ); diff --git a/src/defargs.l b/src/defargs.l index b7259a1..ea37c45 100644 --- a/src/defargs.l +++ b/src/defargs.l @@ -149,7 +149,7 @@ ID [a-z_A-Z][a-z_A-Z0-9]* {ID} { g_curArgName=yytext; } -")"{B}*"(" { +")"{B}*"(" { // function pointer g_curArgTypeName+=yytext; //g_curArgTypeName=g_curArgTypeName.simplifyWhiteSpace(); g_readArgContext = ReadFuncArgType; @@ -157,6 +157,11 @@ ID [a-z_A-Z][a-z_A-Z0-9]* g_argRoundCount=0; BEGIN( CopyArgRound2 ); } +")"/{B}*"[" { // pointer to fixed size array + g_curArgTypeName+=yytext; + //g_curArgTypeName=g_curArgTypeName.simplifyWhiteSpace(); + BEGIN( ReadFuncArgType ); + } ")" { // redundant braces detected / remove them int i=g_curArgTypeName.findRev('('),l=g_curArgTypeName.length(); if (i!=-1) diff --git a/src/definition.cpp b/src/definition.cpp index 9bc0ad6..3d742ef 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -36,15 +36,12 @@ #include "htags.h" #include "parserintf.h" #include "marshal.h" - -#if defined(_MSC_VER) || defined(__BORLANDC__) -#define popen _popen -#define pclose _pclose -#endif +#include "debug.h" #define START_MARKER 0x4445465B // DEF[ #define END_MARKER 0x4445465D // DEF] +//----------------------------------------------------------------------------------------- class DefinitionImpl { @@ -476,20 +473,33 @@ void Definition::setBriefDescription(const char *b,const char *briefFile,int bri * stored in \a result. If FALSE is returned the code fragment could not be * found. * - * The file is scanned for a opening bracket ('{') from \a startLine onward. + * The file is scanned for a opening bracket ('{') from \a startLine onward * The line actually containing the bracket is returned via startLine. * The file is scanned for a closing bracket ('}') from \a endLine backward. * The line actually containing the bracket is returned via endLine. + * Note that for VHDL code the bracket search is not done. */ static bool readCodeFragment(const char *fileName, int &startLine,int &endLine,QCString &result) { - static bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL"); + static bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL"); + static bool filterSourceFiles = Config_getBool("FILTER_SOURCE_FILES"); //printf("readCodeFragment(%s,%d,%d)\n",fileName,startLine,endLine); if (fileName==0 || fileName[0]==0) return FALSE; // not a valid file name - QCString cmd=getFileFilter(fileName)+" \""+fileName+"\""; - FILE *f = Config_getBool("FILTER_SOURCE_FILES") ? popen(cmd,"r") : fopen(fileName,"r"); - bool found=vhdlOpt; // for VHDL not bracket search is possible + QCString filter = getFileFilter(fileName); + FILE *f=0; + bool usePipe = !filter.isEmpty() && filterSourceFiles; + if (!usePipe) // no filter given or wanted + { + f = fopen(fileName,"r"); + } + else // use filter + { + QCString cmd=filter+" \""+fileName+"\""; + Debug::print(Debug::ExtCmd,0,"Executing popen(`%s`)\n",cmd.data()); + f = portable_popen(cmd,"r"); + } + bool found=vhdlOpt; // for VHDL no bracket search is possible if (f) { int c=0; @@ -584,7 +594,14 @@ static bool readCodeFragment(const char *fileName, endLine=lineNr-1; } } - if (Config_getBool("FILTER_SOURCE_FILES")) pclose(f); else fclose(f); + if (usePipe) + { + portable_pclose(f); + } + else + { + fclose(f); + } } result = transcodeCharacterStringToUTF8(result); return found; diff --git a/src/docsets.cpp b/src/docsets.cpp index 52a3c33..86fe54e 100644 --- a/src/docsets.cpp +++ b/src/docsets.cpp @@ -62,8 +62,11 @@ void DocSets::initialize() "DOCSET_RESOURCES=$(DOCSET_CONTENTS)/Resources\n" "DOCSET_DOCUMENTS=$(DOCSET_RESOURCES)/Documents\n" "DOCSET_INSTALL=~/Library/Developer/Shared/Documentation/DocSets\n" + "XCODE_INSTALL=$(shell xcode-select -print-path)\n" "\n" - "all: always\n" + "all: docset\n" + "\n" + "docset:\n" "\tmkdir -p $(DOCSET_DOCUMENTS)\n" "\tcp Nodes.xml $(DOCSET_RESOURCES)\n" "\tcp Tokens.xml $(DOCSET_RESOURCES)\n" @@ -74,16 +77,16 @@ void DocSets::initialize() "\t --exclude Info.plist \\\n" "\t --exclude Makefile -c -f - . \\\n" "\t | (cd $(DOCSET_DOCUMENTS); tar xvf -)\n" - "\tdocsetutil index $(DOCSET_NAME)\n" + "\t$(XCODE_INSTALL)/usr/bin/docsetutil index $(DOCSET_NAME)\n" "\trm -f $(DOCSET_DOCUMENTS)/Nodes.xml\n" "\trm -f $(DOCSET_DOCUMENTS)/Info.plist\n" "\trm -f $(DOCSET_DOCUMENTS)/Makefile\n" "\trm -f $(DOCSET_RESOURCES)/Nodes.xml\n" "\trm -f $(DOCSET_RESOURCES)/Tokens.xml\n" "\n" - "install:\n" + "install: docset\n" "\tmkdir -p $(DOCSET_INSTALL)\n" - "\tcp -a $(DOCSET_NAME) $(DOCSET_INSTALL)\n" + "\tcp -R $(DOCSET_NAME) $(DOCSET_INSTALL)\n" "\n" "uninstall:\n" "\trm -rf $(DOCSET_INSTALL)\n" diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 2b04453..0d163cd 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -734,7 +734,7 @@ static void addIncludeFile(ClassDef *cd,FileDef *ifd,Entry *root) { // explicit request QCString text; text.sprintf("Warning: the name `%s' supplied as " - "the second argument in the \\class, \\struct, or \\union statement ", + "the argument of the \\class, \\struct, \\union, or \\include command ", root->includeFile.data() ); if (ambig) // name is ambigious @@ -8337,6 +8337,7 @@ void copyAndFilterFile(const char *fileName,BufStr &dest) else { QCString cmd=filterName+" \""+fileName+"\""; + Debug::print(Debug::ExtCmd,0,"Executing popen(`%s`)\n",cmd.data()); FILE *f=portable_popen(cmd,"r"); if (!f) { @@ -8884,7 +8885,8 @@ void initDoxygen() ParserInterface *defaultParser = new CLanguageScanner; Doxygen::parserManager = new ParserManager(defaultParser); - Doxygen::parserManager->registerParser(".py",new PythonLanguageScanner); + Doxygen::parserManager->registerParser(".py", new PythonLanguageScanner); + Doxygen::parserManager->registerParser(".f", new FortranLanguageScanner); Doxygen::parserManager->registerParser(".f90", new FortranLanguageScanner); Doxygen::parserManager->registerParser(".vhd", new VHDLLanguageScanner); diff --git a/src/filedef.cpp b/src/filedef.cpp index 5daeb6a..9123976 100644 --- a/src/filedef.cpp +++ b/src/filedef.cpp @@ -34,6 +34,7 @@ #include "parserintf.h" #include "portable.h" #include "vhdldocgen.h" +#include "debug.h" class DevNullCodeDocInterface : public CodeOutputInterface { @@ -1336,7 +1337,9 @@ void FileDef::acquireFileVersion() if (!vercmd.isEmpty()) { msg("Version of %s : ",filepath.data()); - FILE *f=portable_popen(vercmd+" \""+filepath+"\"","r"); + QCString cmd = vercmd+" \""+filepath+"\""; + Debug::print(Debug::ExtCmd,0,"Executing popen(`%s`)\n",cmd.data()); + FILE *f=portable_popen(cmd,"r"); if (!f) { err("Error: could not execute %s\n",vercmd.data()); diff --git a/src/fortrancode.l b/src/fortrancode.l index 63fdb0a..a2a3ad8 100644 --- a/src/fortrancode.l +++ b/src/fortrancode.l @@ -581,8 +581,8 @@ ARGS {BS}("("[^)]*")"){BS} NUM_TYPE (complex|integer|logical|real) KIND {ARGS} -CHAR (CHARACTER{ARGS}?|CHARACTER{BS}"*"([0-9]+|{ARGS})) -TYPE_SPEC (({NUM_TYPE}("*"[0-9]+)?)|({NUM_TYPE}{KIND})|DOUBLE{BS}PRECISION|{CHAR}) +CHAR (CHARACTER{ARGS}?|CHARACTER{BS}"*"({BS}[0-9]+|{ARGS})) +TYPE_SPEC (({NUM_TYPE}({BS}"*"{BS}[0-9]+)?)|({NUM_TYPE}{KIND})|DOUBLE{B}PRECISION|{CHAR}) INTENT_SPEC intent{BS}"("{BS}(in|out|in{BS}out){BS}")" ATTR_SPEC (ALLOCATABLE|DIMENSION{ARGS}|EXTERNAL|{INTENT_SPEC}|INTRINSIC|OPTIONAL|PARAMETER|POINTER|PRIVATE|PUBLIC|SAVE|TARGET) @@ -630,7 +630,7 @@ IGNORE (IMPLICIT{BS}NONE|CONTAINS|WRITE|READ|ALLOCATE|DEALLOCATE|SIZE) codifyLines(yytext); endFontClass(); } -"end"{BS}{COMMANDS}/[ \t\n].* { +"end"({BS_}{COMMANDS})?/[ \t\n].* { startFontClass("keyword"); codifyLines(yytext); endFontClass(); @@ -687,11 +687,11 @@ IGNORE (IMPLICIT{BS}NONE|CONTAINS|WRITE|READ|ALLOCATE|DEALLOCATE|SIZE) yy_pop_state(); REJECT; } -"end"{BS}"module".* { // just reset currentModule, rest is done in following rule +"end"({BS_}"module")?.* { // just reset currentModule, rest is done in following rule currentModule=0; REJECT; } -"end"{BS}("program"|"module"|"type"|"interface") { // +"end"({BS_}("program"|"module"|"type"|"interface"))? { // endUseScope(); startFontClass("keyword"); codifyLines(yytext); @@ -722,7 +722,7 @@ IGNORE (IMPLICIT{BS}NONE|CONTAINS|WRITE|READ|ALLOCATE|DEALLOCATE|SIZE) "\n" { codifyLines(yytext); yy_pop_state(); } -"end"{BS}{SUBPROG}.* { // Fortran subroutine or function ends +"end"({BS_}{SUBPROG})? { // Fortran subroutine or function ends //cout << "===> end function " << yytext << endl; endUseScope(); startFontClass("keyword"); diff --git a/src/fortranscanner.l b/src/fortranscanner.l index 8eddc14..285bc24 100644 --- a/src/fortranscanner.l +++ b/src/fortranscanner.l @@ -189,8 +189,8 @@ NOARGS {BS}"\n" NUM_TYPE (complex|integer|logical|real) KIND {ARGS} -CHAR (CHARACTER{ARGS}?|CHARACTER{BS}"*"([0-9]+|{ARGS})) -TYPE_SPEC (({NUM_TYPE}("*"[0-9]+)?)|({NUM_TYPE}{KIND})|DOUBLE{BS}PRECISION|{CHAR}|TYPE{ARGS}) +CHAR (CHARACTER{ARGS}?|CHARACTER{BS}"*"({BS}[0-9]+|{ARGS})) +TYPE_SPEC (({NUM_TYPE}({BS}"*"{BS}[0-9]+)?)|({NUM_TYPE}{KIND})|DOUBLE{BS_}PRECISION|{CHAR}|TYPE{ARGS}) INTENT_SPEC intent{BS}"("{BS}(in|out|in{BS}out){BS}")" ATTR_SPEC (ALLOCATABLE|DIMENSION{ARGS}|EXTERNAL|{INTENT_SPEC}|INTRINSIC|OPTIONAL|PARAMETER|POINTER|PRIVATE|PUBLIC|SAVE|TARGET) @@ -244,7 +244,7 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} <*>"\\\""|\\\' { /* ignore \" and \' */} \"|\' { // string ends with next quote without previous backspace - if(yytext[0]!=stringStartSymbol) REJECT; // single vs double quote + if (yytext[0]!=stringStartSymbol) REJECT; // single vs double quote // fprintf(stderr,"string end: %s\n",debugStr.data()); yy_pop_state(); } @@ -252,7 +252,7 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} . { debugStr+=yytext; } // ignore String contents (especially '!') <*>\"|\' { /* string starts */ - if(YY_START == StrIgnore) REJECT; // ignore in simple comments + if (YY_START == StrIgnore) REJECT; // ignore in simple comments // fprintf(stderr,"string start: %c %d\n",yytext[0],yyLineNr); yy_push_state(YY_START); stringStartSymbol=yytext[0]; // single or double quote @@ -264,7 +264,8 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} <*>"!"/[^<>\n] { if (YY_START == String) REJECT; // "!" is ignored in strings // skip comment line (without docu comments "!>" "!<" ) /* ignore further "!" and ignore comments in Strings */ - if ((YY_START != StrIgnore) && (YY_START != String)) { + if ((YY_START != StrIgnore) && (YY_START != String)) + { yy_push_state(YY_START); BEGIN(StrIgnore); debugStr="*!"; @@ -316,7 +317,7 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} int index = name.find("interface", 0, FALSE); index = name.find(QRegExp("[^ \\t]"), index+9); //printf(stderr,"%s,%d\n",name.data(),index); - if(index!=-1) + if (index!=-1) name = name.right(name.length()-index); else // interface without name, must be inside subprog name = "interface"; @@ -324,8 +325,8 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} yy_push_state(InterfaceBody); startScope(last_entry); } -"end"{BS}"interface".* { - if(!endScope(current_root)) +"end"({BS_}"interface")?.* { + if (!endScope(current_root)) yyterminate(); yy_pop_state(); } @@ -348,9 +349,9 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} BEGIN(Module); defaultProtection = Public; } -"end"{BS}(module|program).* { // end module +"end"({BS_}(module|program))?.* { // end module resolveModuleProcedures(moduleProcedures, current_root); - if(!endScope(current_root)) + if (!endScope(current_root)) yyterminate(); defaultProtection = Public; BEGIN(Start); @@ -405,15 +406,26 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} startScope(last_entry); BEGIN(TypedefBody); } -"end"{BS}"type".* { /* end type definition */ +"end"{BS_}"type".* { /* end type definition */ //cout << "=========> got typedef end "<< endl; - if(!endScope(current_root)) + if (!endScope(current_root)) yyterminate(); yy_pop_state(); } /*------- module/global/typedef variable ---------------------------------------------------*/ +"end"({BS_}{SUBPROG})?.* { + //cout << "1e=========> got end subprog: " << yytext << endl; + + /* args is used for parameters in list of functions, argList for + parameters in detailed function descripttion */ + //current->args = argListToString(current->argList); + //current->endBodyLine = yyLineNr; // ??? what ist endBodyLine for + if (!endScope(current_root)) + yyterminate(); + yy_pop_state() ; + } { {TYPE_SPEC}/{SEPARATE} { /* variable declaration starts */ @@ -429,16 +441,19 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} DefineDict* defines = getFileDefineDict(); QCString name; int index = str.find("("); - if(index != -1) + if (index != -1) name = str.left(index).stripWhiteSpace(); else name = str; Define *define = (*defines)[name]; - if(define != 0 && isTypeName(define->definition)) { + if (define != 0 && isTypeName(define->definition)) + { argType = str; yy_push_state(AttributeList); - } else { + } + else + { REJECT; } } @@ -452,6 +467,8 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} yy_push_state(YY_START); BEGIN( AttributeList ) ; } +{ID} { + } } { {COMMA} {} @@ -481,7 +498,8 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} int last= yy_top_state(); v_type= V_IGNORE; - if (!argType.isEmpty() && last != SubprogBody) { // new variable entry + if (!argType.isEmpty() && last != SubprogBody) + { // new variable entry v_type = V_VARIABLE; current->section = Entry::VARIABLE_SEC; current->name = argName; @@ -489,7 +507,9 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} current->fileName = yyFileName; current->bodyLine = yyLineNr; // used for source reference addCurrentEntry(); - } else if(!argType.isEmpty()){ // deklaration of parameter list: add type for corr. parameter + } + else if (!argType.isEmpty()) + { // deklaration of parameter list: add type for corr. parameter parameter= addFortranParameter(argType,argName,docBlock); if (parameter) v_type= V_PARAMETER; // save, it may be function return type @@ -518,14 +538,13 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} docBlock.resize(0); } -"(/" { initializer+=yytext; +"(" { initializer+=yytext; BEGIN(ArrayInitializer); // initializer may contain comma } -. { initializer+=yytext; } -"/)" { initializer+=yytext; - yy_pop_state(); // end initialization - if (v_type == V_VARIABLE) last_entry->initializer= initializer; +")" { initializer+=yytext; + BEGIN(Initialization); } +. { initializer+=yytext; } {COMMA} { yy_pop_state(); // end initialization if (v_type == V_VARIABLE) last_entry->initializer= initializer; } @@ -569,7 +588,8 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} QCString arglist= yytext; //cout << "3=========> got parameterlist " << yytext << endl; yyLineNr+= arglist.contains('\n'); - arglist = arglist.replace(QRegExp("&[^\n]*\n"),""); + static QRegExp re("&[^\n]*\n"); + arglist = arglist.replace(re,""); //cout << "3=========> got parameterlist " << arglist << endl; current->args = arglist; current->args = removeRedundantWhiteSpace(current->args); @@ -593,17 +613,6 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} modifiers[current_root->parent()][current_root->name.lower()].returnName = result; //cout << "=====> got result " << result << endl; } -"end"{BS}{SUBPROG}.* { - //cout << "1e=========> got end subprog: " << yytext << endl; - - /* args is used for parameters in list of functions, argList for - parameters in detailed function descripttion */ - //current->args = argListToString(current->argList); - //current->endBodyLine = yyLineNr; // ??? what ist endBodyLine for - if(!endScope(current_root)) - yyterminate(); - yy_pop_state() ; - } /*---- documentation comments --------------------------------------------------------------------*/ @@ -620,13 +629,15 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} } .* { // contents of current comment line docBlock=yytext; - if (v_type == V_VARIABLE) { + if (v_type == V_VARIABLE) + { Entry *tmp_entry = current; current = last_entry; // temporarily switch to the previous entry handleCommentBlock(docBlock,TRUE); current=tmp_entry; } - else if (v_type == V_PARAMETER) { + else if (v_type == V_PARAMETER) + { parameter->docs=docBlock; } yy_pop_state(); @@ -659,9 +670,10 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} /*------------------------------------------------------------------------------------------------*/ -<*>"\n" {yyLineNr++; - //if (debugStr.stripWhiteSpace().length() > 0) cout << "ignored text: " << debugStr << " state: " <"\n" { + yyLineNr++; + //if (debugStr.stripWhiteSpace().length() > 0) cout << "ignored text: " << debugStr << " state: " <. {debugStr+=yytext;} // ignore remaining text + <*>. { + debugStr+=yytext; + } // ignore remaining text /**********************************************************************************/ /**********************************************************************************/ @@ -725,12 +739,12 @@ static QCString extractFromParens(const QCString name) { QCString extracted = name; int start = extracted.find("("); - if(start != -1) + if (start != -1) { extracted.remove(0, start+1); } int end = extracted.findRev(")"); - if(end != -1) + if (end != -1) { int length = extracted.length(); extracted.remove(end, length); @@ -743,10 +757,10 @@ static QCString extractFromParens(const QCString name) /*! Adds passed modifiers to these modifiers.*/ SymbolModifiers& SymbolModifiers::operator|=(const SymbolModifiers &mdfs) { - if(mdfs.protection!=NONE_P) protection = mdfs.protection; - if(mdfs.direction!=NONE_D) direction = mdfs.direction; + if (mdfs.protection!=NONE_P) protection = mdfs.protection; + if (mdfs.direction!=NONE_D) direction = mdfs.direction; optional |= mdfs.optional; - if(!mdfs.dimension.isNull()) dimension = mdfs.dimension; + if (!mdfs.dimension.isNull()) dimension = mdfs.dimension; allocatable |= mdfs.allocatable; external |= mdfs.external; intrinsic |= mdfs.intrinsic; @@ -772,9 +786,9 @@ SymbolModifiers& SymbolModifiers::operator|=(QCString mdfString) QCString tmp = extractFromParens(mdfString); bool isin = tmp.contains("in"); bool isout = tmp.contains("out"); - if(isin && isout) newMdf.direction = SymbolModifiers::INOUT; - else if(isin) newMdf.direction = SymbolModifiers::IN; - else if(isout) newMdf.direction = SymbolModifiers::OUT; + if (isin && isout) newMdf.direction = SymbolModifiers::INOUT; + else if (isin) newMdf.direction = SymbolModifiers::IN; + else if (isout) newMdf.direction = SymbolModifiers::OUT; } else if (mdfString=="public") { @@ -796,23 +810,23 @@ SymbolModifiers& SymbolModifiers::operator|=(QCString mdfString) { newMdf.external = TRUE; } - else if(mdfString=="intrinsic") + else if (mdfString=="intrinsic") { newMdf.intrinsic = TRUE; } - else if(mdfString=="parameter") + else if (mdfString=="parameter") { newMdf.parameter = TRUE; } - else if(mdfString=="pointer") + else if (mdfString=="pointer") { newMdf.pointer = TRUE; } - else if(mdfString=="target") + else if (mdfString=="target") { newMdf.target = TRUE; } - else if(mdfString=="save") + else if (mdfString=="save") { newMdf.save = TRUE; } @@ -838,7 +852,7 @@ static Argument *findArgument(Entry* subprog, QCString name, bool byTypeName = F for (unsigned int i=0; iargList->count(); i++) { Argument *arg = subprog->argList->at(i); - if(!byTypeName && arg->name.lower() == cname || + if (!byTypeName && arg->name.lower() == cname || byTypeName && arg->type.lower() == cname) return arg; } @@ -856,10 +870,10 @@ static Entry *findFunction(Entry* entry, QCString name) Entry *ce; for (;(ce=eli.current());++eli) { - if(ce->section != Entry::FUNCTION_SEC) + if (ce->section != Entry::FUNCTION_SEC) continue; - if(ce->name.lower() == cname) + if (ce->name.lower() == cname) return ce; } @@ -870,52 +884,52 @@ static Entry *findFunction(Entry* entry, QCString name) /*! Apply modifiers stored in \a mdfs to the \a typeName string. */ static QCString applyModifiers(QCString typeName, SymbolModifiers& mdfs) { - if(!mdfs.dimension.isNull()) + if (!mdfs.dimension.isNull()) { typeName += ","; typeName += mdfs.dimension; } - if(mdfs.direction!=SymbolModifiers::NONE_D) + if (mdfs.direction!=SymbolModifiers::NONE_D) { typeName += ","; typeName += directionStrs[mdfs.direction]; } - if(mdfs.optional) + if (mdfs.optional) { typeName += ","; typeName += "optional"; } - if(mdfs.allocatable) + if (mdfs.allocatable) { typeName += ","; typeName += "allocatable"; } - if(mdfs.external) + if (mdfs.external) { typeName += ","; typeName += "external"; } - if(mdfs.intrinsic) + if (mdfs.intrinsic) { typeName += ","; typeName += "intrinsic"; } - if(mdfs.parameter) + if (mdfs.parameter) { typeName += ","; typeName += "parameter"; } - if(mdfs.pointer) + if (mdfs.pointer) { typeName += ","; typeName += "pointer"; } - if(mdfs.target) + if (mdfs.target) { typeName += ","; typeName += "target"; } - if(mdfs.save) + if (mdfs.save) { typeName += ","; typeName += "save"; @@ -937,9 +951,9 @@ static void applyModifiers(Entry *ent, SymbolModifiers& mdfs) QCString tmp = ent->type; ent->type = applyModifiers(tmp, mdfs); - if(mdfs.protection == SymbolModifiers::PUBLIC) + if (mdfs.protection == SymbolModifiers::PUBLIC) ent->protection = Public; - else if(mdfs.protection == SymbolModifiers::PRIVATE) + else if (mdfs.protection == SymbolModifiers::PRIVATE) ent->protection = Private; } @@ -1013,7 +1027,7 @@ static bool endScope(Entry *scope) continue; Argument *arg = findArgument(scope->parent(), ce->name, TRUE); - if(arg != 0) + if (arg != 0) { // set type of dummy procedure argument to interface arg->name = arg->type; @@ -1029,11 +1043,11 @@ static bool endScope(Entry *scope) Entry *ce; for (;(ce=eli.current());++eli) { - if(ce->section != Entry::VARIABLE_SEC && ce->section != Entry::FUNCTION_SEC) + if (ce->section != Entry::VARIABLE_SEC && ce->section != Entry::FUNCTION_SEC) continue; //cout<name<<", "<name.lower())<name.lower())) + if (mdfsMap.contains(ce->name.lower())) applyModifiers(ce, mdfsMap[ce->name.lower()]); } } diff --git a/src/groupdef.cpp b/src/groupdef.cpp index de41fe7..af0e83b 100644 --- a/src/groupdef.cpp +++ b/src/groupdef.cpp @@ -161,22 +161,32 @@ void GroupDef::addFile(const FileDef *def) fileList->append(def); } -void GroupDef::addClass(const ClassDef *cd) +bool GroupDef::addClass(const ClassDef *cd) { - if (cd->isHidden()) return; - if (Config_getBool("SORT_BRIEF_DOCS")) - classSDict->inSort(cd->name(),cd); - else - classSDict->append(cd->name(),cd); + if (cd->isHidden()) return FALSE; + if (classSDict->find(cd->name())==0) + { + if (Config_getBool("SORT_BRIEF_DOCS")) + classSDict->inSort(cd->name(),cd); + else + classSDict->append(cd->name(),cd); + return TRUE; + } + return FALSE; } -void GroupDef::addNamespace(const NamespaceDef *def) +bool GroupDef::addNamespace(const NamespaceDef *def) { - if (def->isHidden()) return; - if (Config_getBool("SORT_BRIEF_DOCS")) - namespaceSDict->inSort(def->name(),def); - else - namespaceSDict->append(def->name(),def); + if (def->isHidden()) return FALSE; + if (namespaceSDict->find(def->name())==0) + { + if (Config_getBool("SORT_BRIEF_DOCS")) + namespaceSDict->inSort(def->name(),def); + else + namespaceSDict->append(def->name(),def); + return TRUE; + } + return FALSE; } void GroupDef::addDir(const DirDef *def) @@ -926,8 +936,7 @@ void addClassToGroups(Entry *root,ClassDef *cd) GroupDef *gd=0; if (!g->groupname.isEmpty() && (gd=Doxygen::groupSDict->find(g->groupname))) { - gd->addClass(cd); - cd->makePartOfGroup(gd); + if (gd->addClass(cd)) cd->makePartOfGroup(gd); //printf("Compound %s: in group %s\n",cd->name().data(),s->data()); } } @@ -944,8 +953,7 @@ void addNamespaceToGroups(Entry *root,NamespaceDef *nd) //printf("group `%s'\n",s->data()); if (!g->groupname.isEmpty() && (gd=Doxygen::groupSDict->find(g->groupname))) { - gd->addNamespace(nd); - nd->makePartOfGroup(gd); + if (gd->addNamespace(nd)) nd->makePartOfGroup(gd); //printf("Namespace %s: in group %s\n",nd->name().data(),s->data()); } } diff --git a/src/groupdef.h b/src/groupdef.h index d2f262c..dcbe1e4 100644 --- a/src/groupdef.h +++ b/src/groupdef.h @@ -51,8 +51,8 @@ class GroupDef : public Definition void setGroupTitle( const char *newtitle ); bool hasGroupTitle( ) { return titleSet; } void addFile(const FileDef *def); - void addClass(const ClassDef *def); - void addNamespace(const NamespaceDef *def); + bool addClass(const ClassDef *def); + bool addNamespace(const NamespaceDef *def); void addGroup(const GroupDef *def); void addParentGroup(const GroupDef *def); void addPage(PageDef *def); diff --git a/src/index.cpp b/src/index.cpp index ad8647a..a762ecf 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -2253,7 +2253,7 @@ void writePageIndex(OutputList &ol) } } endIndexHierarchy(ol,0); - Doxygen::indexList.decContentsDepth(); + //Doxygen::indexList.decContentsDepth(); endFile(ol); ol.popGeneratorState(); } diff --git a/src/pre.l b/src/pre.l index c578763..e226148 100644 --- a/src/pre.l +++ b/src/pre.l @@ -1975,7 +1975,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) . { outputChar(*yytext); } -[^*]+ { +[^*a-z_A-Z]+ { g_defLitText+=yytext; g_defText+=escapeAt(yytext); } @@ -1989,10 +1989,6 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) g_defLitText+=yytext; g_defText+=yytext; } -. { - g_defLitText+=yytext; - g_defText+=yytext; - } "*/" { BEGIN(g_lastCContext); } "//" "/*" @@ -2026,7 +2022,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) g_quoteArg=TRUE; g_defLitText+=yytext; } -{ID} { +{ID} { g_defLitText+=yytext; if (g_quoteArg) { @@ -2059,6 +2055,10 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) } g_quoteArg=FALSE; } +. { + g_defLitText+=yytext; + g_defText+=yytext; + } \\[\r]?\n { g_defLitText+=yytext; outputChar('\n'); diff --git a/src/pyscanner.l b/src/pyscanner.l index c8857da..b70c448 100644 --- a/src/pyscanner.l +++ b/src/pyscanner.l @@ -311,7 +311,7 @@ static void handleCommentBlock(const QCString &doc,bool brief) yyFileName, // file brief ? current->briefLine : current->docLine, // line of block start docBlockInBody ? FALSE : brief, - FALSE, //docBlockJavaStyle, // javadoc style + docBlockJavaStyle, // javadoc style // or FALSE, docBlockInBody, protection, position, diff --git a/src/scanner.l b/src/scanner.l index 3f86c2f..50edea9 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -3143,7 +3143,8 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) // -> omit typedef and use S_t as the struct name if (typedefHidesStruct && isTypedef && - (current->spec&(Entry::Struct|Entry::Union)) && + ((current->spec&(Entry::Struct|Entry::Union)) || + current->section==Entry::ENUM_SEC )&& msType.stripWhiteSpace().isEmpty() && memspecEntry) { diff --git a/src/util.cpp b/src/util.cpp index 5f52d40..d2e9593 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1465,6 +1465,20 @@ static bool findOperator(const QCString &s,int i) return TRUE; } +static bool findOperator2(const QCString &s,int i) +{ + int b = s.findRev("operator",i); + if (b==-1) return FALSE; // not found + b+=8; + while (b0 && (isId(result.at(rl-1)) || result.at(rl-1)=='>')) result+=' '; + if ((rl>0 && (isId(result.at(rl-1)) || result.at(rl-1)=='>')) && + (c!='*' || !findOperator2(s,i)) // avoid splitting operator* and operator->* + ) + { + result+=' '; + } } result+=c; if (cliSupport && (c=='^' || c=='%') && i>1 && isId(s.at(i-1))) result+=' '; // C++/CLI: Type^ name and Type% name @@ -2141,6 +2160,7 @@ QCString fileToString(const char *name,bool filter) else // filter the input { QCString cmd=filterName+" \""+name+"\""; + Debug::print(Debug::ExtCmd,0,"Executing popen(`%s`)\n",cmd.data()); FILE *f=portable_popen(cmd,"r"); if (!f) { @@ -6270,6 +6290,7 @@ SrcLangExt getLanguageFromFileName(const QCString fileName) extLookup.insert(".M", new int(SrcLangExt_ObjC)); extLookup.insert(".mm", new int(SrcLangExt_ObjC)); extLookup.insert(".py", new int(SrcLangExt_Python)); + extLookup.insert(".f", new int(SrcLangExt_F90)); extLookup.insert(".f90", new int(SrcLangExt_F90)); extLookup.insert(".vhd", new int(SrcLangExt_VHDL)); extLookup.insert(".vhdl", new int(SrcLangExt_VHDL)); diff --git a/src/vhdldocgen.cpp b/src/vhdldocgen.cpp index 60a49b1..0fbd1b4 100644 --- a/src/vhdldocgen.cpp +++ b/src/vhdldocgen.cpp @@ -144,13 +144,13 @@ QCString* VhdlDocGen::findKeyWord(const QCString& word) if (word.isEmpty() || word.at(0)=='\0') return 0; //printf("VhdlDocGen::findKeyWord(%s)\n",word.data()); - if (g_vhdlKeyDict0.find(word)) + if (g_vhdlKeyDict0.find(word.lower())) return &g_vhdlkeyword; - if (g_vhdlKeyDict1.find(word)) + if (g_vhdlKeyDict1.find(word.lower())) return &g_vhdltype; - if (g_vhdlKeyDict2.find(word)) + if (g_vhdlKeyDict2.find(word.lower())) return &g_vhdllogic; return 0; @@ -832,21 +832,23 @@ bool VhdlDocGen::getSigTypeName(QList& ql, const char* str,QCString& b bool VhdlDocGen::getSigName(QList& ql, const char* str,QCString& buffer) { - int len,j,ll,index; + int j,ll,index; char *signal = "signal "; QCString qmem; QCString temp(str); QCString st(str); - QRegExp semi(","); - QRegExp r(":"); - j = r.match(temp.data(),0,&len); + //QRegExp semi(","); + //QRegExp r(":"); + + // colon position + j = temp.find(':'); if (j < 0) return FALSE; // no input definition - st=st.left(j); + st=st.left(j); // name only index=st.find(signal,0,FALSE); - if (index > -1) + if (index > -1) // found "signal " { - qmem=st.remove(index,strlen(signal)); + qmem=st.remove(index,strlen(signal)); // strip it temp=qmem; st=qmem; } @@ -855,56 +857,71 @@ bool VhdlDocGen::getSigName(QList& ql, qmem=temp; } - ll=semi.match(st.data(),0,&len); + ll=st.find(','); - if (ll>0) + if (ll>0) // multiple names { while (TRUE) { - st=st.left(ll); + st=st.left(ll).stripWhiteSpace(); // one name + QCString *sig =new QCString(st); ql.insert(0,sig); - qmem=qmem.right(qmem.length()-ll-1); - st=qmem; - ll=semi.match(st.data(),0,&len); - if (ll<0) + qmem=qmem.right(qmem.length()-ll-1); // strip from list + st=qmem; // remainder + ll=st.find(','); + if (ll<0) // last name { - ll = r.match(st.data(),0,&len); - st=st.left(ll); + ll = st.find(':'); + st=st.left(ll).stripWhiteSpace(); ql.insert(0,new QCString(st)); break; } } } - else + else // single name { - st=st.left(j); + st=st.stripWhiteSpace(); ql.insert(0,new QCString(st)); } QCString *qdir=new QCString(str); - st=qdir->mid(j+1); - //st=st.lower(); - st=st.stripWhiteSpace(); + st=qdir->mid(j+1); // part after : + st=st.lower().stripWhiteSpace(); *qdir=st; - ql.insert(0,qdir); + if (st.stripPrefix("inout")) { buffer+="inout"; return TRUE; } + if (st.stripPrefix("INOUT")) + { + buffer+="inout"; + return TRUE; + } if (st.stripPrefix("out")) { buffer+="out"; return TRUE; } + if (st.stripPrefix("OUT")) + { + buffer+="out"; + return TRUE; + } if (st.stripPrefix("in")) { buffer+="in"; return TRUE; } + if (st.stripPrefix("IN")) + { + buffer+="in"; + return TRUE; + } return FALSE; } diff --git a/src/vhdlscanner.l b/src/vhdlscanner.l index 54a75a6..f669188 100644 --- a/src/vhdlscanner.l +++ b/src/vhdlscanner.l @@ -247,6 +247,7 @@ void addSignals(const char* str,int line, Entry *e,const char *comment=0) for (int k=1;kdata(),ql.at(k)->data()); Entry *pTemp=new Entry; initEntry(pTemp); pTemp->startLine = line; diff --git a/winbuild/Doxywizard.vcproj b/winbuild/Doxywizard.vcproj index 14309f4..34722cb 100644 --- a/winbuild/Doxywizard.vcproj +++ b/winbuild/Doxywizard.vcproj @@ -73,7 +73,7 @@ />