Commit 8051d0cf authored by Dimitri van Heesch's avatar Dimitri van Heesch

Release-1.5.5-20080309

parent 2ddfaa1d
DOXYGEN Version 1.5.5-20080307 DOXYGEN Version 1.5.5-20080309
Please read the installation section of the manual Please read the installation section of the manual
(http://www.doxygen.org/install.html) for instructions. (http://www.doxygen.org/install.html) for instructions.
-------- --------
Dimitri van Heesch (07 March 2008) Dimitri van Heesch (09 March 2008)
DOXYGEN Version 1.5.5_20080307 DOXYGEN Version 1.5.5_20080309
Please read INSTALL for compilation instructions. Please read INSTALL for compilation instructions.
...@@ -17,4 +17,4 @@ to subscribe to the lists or to visit the archives. ...@@ -17,4 +17,4 @@ to subscribe to the lists or to visit the archives.
Enjoy, Enjoy,
Dimitri van Heesch (dimitri@stack.nl) (07 March 2008) Dimitri van Heesch (dimitri@stack.nl) (09 March 2008)
...@@ -20,7 +20,7 @@ doxygen_version_minor=5 ...@@ -20,7 +20,7 @@ doxygen_version_minor=5
doxygen_version_revision=5 doxygen_version_revision=5
#NOTE: Setting version_mmn to "NO" will omit mmn info from the package. #NOTE: Setting version_mmn to "NO" will omit mmn info from the package.
doxygen_version_mmn=20080307 doxygen_version_mmn=20080309
bin_dirs=`echo $PATH | sed -e "s/:/ /g"` bin_dirs=`echo $PATH | sed -e "s/:/ /g"`
......
...@@ -203,7 +203,9 @@ followed by the descriptions of the tags grouped by category. ...@@ -203,7 +203,9 @@ followed by the descriptions of the tags grouped by category.
\refitem cfg_separate_member_pages SEPARATE_MEMBER_PAGES \refitem cfg_separate_member_pages SEPARATE_MEMBER_PAGES
\refitem cfg_short_names SHORT_NAMES \refitem cfg_short_names SHORT_NAMES
\refitem cfg_show_dirs SHOW_DIRECTORIES \refitem cfg_show_dirs SHOW_DIRECTORIES
\refitem cfg_show_files SHOW_FILES
\refitem cfg_show_include_files SHOW_INCLUDE_FILES \refitem cfg_show_include_files SHOW_INCLUDE_FILES
\refitem cfg_show_namespaces SHOW_NAMESPACES
\refitem cfg_show_used_files SHOW_USED_FILES \refitem cfg_show_used_files SHOW_USED_FILES
\refitem cfg_sip_support SIP_SUPPORT \refitem cfg_sip_support SIP_SUPPORT
\refitem cfg_skip_function_macros SKIP_FUNCTION_MACROS \refitem cfg_skip_function_macros SKIP_FUNCTION_MACROS
...@@ -766,6 +768,20 @@ function's detailed documentation block. ...@@ -766,6 +768,20 @@ function's detailed documentation block.
then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
in the documentation. in the documentation.
\anchor cfg_show_files
<dt>\c SHOW_FILES <dd>
\addindex SHOW_FILES
Set the \c SHOW_FILES tag to \c NO to disable the generation of the Files page.
This will remove the Files entry from the Quick Index and from the
Folder Tree View (if specified). The default is \c YES.
\anchor cfg_show_namespaces
<dt>\c SHOW_NAMESPACES <dd>
\addindex SHOW_NAMESPACES
Set the \c SHOW_NAMESPACES tag to \c NO to disable the generation of the
Namespaces page. This will remove the Namespaces entry from the Quick Index
and from the Folder Tree View (if specified). The default is \c YES.
</dl> </dl>
\section messages_input Options related to warning and progress messages \section messages_input Options related to warning and progress messages
......
...@@ -1972,6 +1972,20 @@ void Config::create() ...@@ -1972,6 +1972,20 @@ void Config::create()
"in the documentation. The default is NO.\n", "in the documentation. The default is NO.\n",
FALSE FALSE
); );
cb = addBool(
"SHOW_FILES",
"Set the SHOW_FILES tag to NO to disable the generation of the Files page.\n"
"This will remove the Files entry from the Quick Index and from the \n"
"Folder Tree View (if specified). The default is YES.\n",
TRUE
);
cb = addBool(
"SHOW_NAMESPACES",
"Set the SHOW_NAMESPACES tag to NO to disable the generation of the \n"
"Namespaces page. This will remove the Namespaces entry from the Quick Index\n"
"and from the Folder Tree View (if specified). The default is YES.\n",
TRUE
);
cs = addString( "FILE_VERSION_FILTER", cs = addString( "FILE_VERSION_FILTER",
"The FILE_VERSION_FILTER tag can be used to specify a program or script that \n" "The FILE_VERSION_FILTER tag can be used to specify a program or script that \n"
"doxygen should invoke to get the current version for each file (typically from \n" "doxygen should invoke to get the current version for each file (typically from \n"
......
...@@ -1449,3 +1449,10 @@ void FileDef::writeMemberDocumentation(OutputList &ol,MemberList::ListType lt,co ...@@ -1449,3 +1449,10 @@ void FileDef::writeMemberDocumentation(OutputList &ol,MemberList::ListType lt,co
MemberList * ml = getMemberList(lt); MemberList * ml = getMemberList(lt);
if (ml) ml->writeDocumentation(ol,name(),this,title); if (ml) ml->writeDocumentation(ol,name(),this,title);
} }
bool FileDef::isLinkableInProject() const
{
static bool showFiles = Config_getBool("SHOW_FILES");
return hasDocumentation() && !isReference() && showFiles;
}
...@@ -116,10 +116,7 @@ class FileDef : public Definition ...@@ -116,10 +116,7 @@ class FileDef : public Definition
/*! Returns version of this file. */ /*! Returns version of this file. */
QCString getVersion() const { return fileVersion; } QCString getVersion() const { return fileVersion; }
bool isLinkableInProject() const bool isLinkableInProject() const;
{
return hasDocumentation() && !isReference();
}
bool isLinkable() const bool isLinkable() const
{ {
......
...@@ -542,7 +542,7 @@ void endUseScope() ...@@ -542,7 +542,7 @@ void endUseScope()
currentUseNames= useStack.pop(); currentUseNames= useStack.pop();
if (currentUseNames == 0) if (currentUseNames == 0)
{ {
fprintf(stderr,"fortrancode.l: stack empty!"); fprintf(stderr,"WARNING: fortrancode.l: stack empty!");
//exit(-1); //exit(-1);
} }
} }
...@@ -691,7 +691,7 @@ IGNORE (IMPLICIT{BS}NONE|CONTAINS|WRITE|READ|ALLOCATE|DEALLOCATE|SIZE) ...@@ -691,7 +691,7 @@ IGNORE (IMPLICIT{BS}NONE|CONTAINS|WRITE|READ|ALLOCATE|DEALLOCATE|SIZE)
currentModule=0; currentModule=0;
REJECT; REJECT;
} }
<Start>"end"({BS_}("program"|"module"|"type"|"interface"))? { // <Start>^{BS}"end"({BS}("program"|"module"|"type"|"interface")({BS_}{ID})?)?{BS}/(\n|!) { //
endUseScope(); endUseScope();
startFontClass("keyword"); startFontClass("keyword");
codifyLines(yytext); codifyLines(yytext);
...@@ -722,7 +722,7 @@ IGNORE (IMPLICIT{BS}NONE|CONTAINS|WRITE|READ|ALLOCATE|DEALLOCATE|SIZE) ...@@ -722,7 +722,7 @@ IGNORE (IMPLICIT{BS}NONE|CONTAINS|WRITE|READ|ALLOCATE|DEALLOCATE|SIZE)
<Subprog>"\n" { codifyLines(yytext); <Subprog>"\n" { codifyLines(yytext);
yy_pop_state(); yy_pop_state();
} }
<Start>"end"({BS_}{SUBPROG})? { // Fortran subroutine or function ends <Start>"^{BS}end"({BS}{SUBPROG}({BS_}{ID})?)?{BS}/(\n|!) { // Fortran subroutine or function ends
//cout << "===> end function " << yytext << endl; //cout << "===> end function " << yytext << endl;
endUseScope(); endUseScope();
startFontClass("keyword"); startFontClass("keyword");
...@@ -860,6 +860,8 @@ IGNORE (IMPLICIT{BS}NONE|CONTAINS|WRITE|READ|ALLOCATE|DEALLOCATE|SIZE) ...@@ -860,6 +860,8 @@ IGNORE (IMPLICIT{BS}NONE|CONTAINS|WRITE|READ|ALLOCATE|DEALLOCATE|SIZE)
endFontClass(); endFontClass();
yy_pop_state(); yy_pop_state();
} }
<String>. {str+=yytext;}
<*>\"|\' { /* string starts */ <*>\"|\' { /* string starts */
/* if(YY_START == StrIgnore) REJECT; // ignore in simple comments */ /* if(YY_START == StrIgnore) REJECT; // ignore in simple comments */
yy_push_state(YY_START); yy_push_state(YY_START);
...@@ -867,7 +869,6 @@ IGNORE (IMPLICIT{BS}NONE|CONTAINS|WRITE|READ|ALLOCATE|DEALLOCATE|SIZE) ...@@ -867,7 +869,6 @@ IGNORE (IMPLICIT{BS}NONE|CONTAINS|WRITE|READ|ALLOCATE|DEALLOCATE|SIZE)
BEGIN(String); BEGIN(String);
str=yytext; str=yytext;
} }
<String>. {str+=yytext;}
/*-----------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------*/
<*>\n { <*>\n {
......
...@@ -112,6 +112,14 @@ static const char *directionStrs[] = ...@@ -112,6 +112,14 @@ static const char *directionStrs[] =
static ParserInterface *g_thisParser; static ParserInterface *g_thisParser;
static const char * inputString; static const char * inputString;
static int inputPosition; static int inputPosition;
static QCString inputStringPrepass; ///< Input string for prepass of line cont. '&'
static unsigned int inputPositionPrepass;
static int lineCountPrepass = 0;
#define MAX_INCLUDE_DEPTH 10
YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
int include_stack_ptr = 0;
static QFile inputFile; static QFile inputFile;
static QCString yyFileName; static QCString yyFileName;
static int yyLineNr = 1 ; static int yyLineNr = 1 ;
...@@ -138,6 +146,7 @@ static Argument *parameter; // element of parameter list ...@@ -138,6 +146,7 @@ static Argument *parameter; // element of parameter list
static QCString argType; // fortran type of an argument of a parameter list static QCString argType; // fortran type of an argument of a parameter list
static QCString argName; // last identifier name in variable list static QCString argName; // last identifier name in variable list
static QCString initializer; // initial value of a variable static QCString initializer; // initial value of a variable
static int initializerScope; // number if nested array scopes in initializer
static QCString useModuleName; // name of module in the use statement static QCString useModuleName; // name of module in the use statement
static Protection defaultProtection; static Protection defaultProtection;
...@@ -154,15 +163,20 @@ static int yyread(char *buf,int max_size); ...@@ -154,15 +163,20 @@ static int yyread(char *buf,int max_size);
static void startCommentBlock(bool); static void startCommentBlock(bool);
static void handleCommentBlock(const QCString &doc,bool brief); static void handleCommentBlock(const QCString &doc,bool brief);
static void addCurrentEntry(); static void addCurrentEntry();
static void addModule(const char *name);
static void addSubprogram(const char *text);
static void addInterface(QCString name); static void addInterface(QCString name);
static Argument *addFortranParameter(const QCString &type,const QCString &name, const QCString docs); static Argument *addFortranParameter(const QCString &type,const QCString &name, const QCString docs);
static void scanner_abort(); static void scanner_abort();
static void startScope(Entry *scope); static void startScope(Entry *scope);
static bool endScope(Entry *scope); static bool endScope(Entry *scope, bool isGlobalRoot=FALSE);
static QCString getFullName(Entry *e); static QCString getFullName(Entry *e);
static bool isTypeName(QCString name); static bool isTypeName(QCString name);
static void resolveModuleProcedures(QList<Entry> &moduleProcedures, Entry *current_root); static void resolveModuleProcedures(QList<Entry> &moduleProcedures, Entry *current_root);
static int getAmpersandAtTheEnd(const char *buf, int length);
static void pushBuffer(QCString &buffer);
static void popBuffer();
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#undef YY_INPUT #undef YY_INPUT
...@@ -198,6 +212,9 @@ ACCESS_SPEC (PRIVATE|PUBLIC) ...@@ -198,6 +212,9 @@ ACCESS_SPEC (PRIVATE|PUBLIC)
/* Assume that attribute statements are almost the same as attributes. */ /* Assume that attribute statements are almost the same as attributes. */
ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC}
CONTAINS CONTAINS
PREFIX (RECURSIVE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,2}(RECURSIVE|PURE|ELEMENTAL)?
%option noyywrap %option noyywrap
%option stack %option stack
%option caseless %option caseless
...@@ -207,12 +224,15 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} ...@@ -207,12 +224,15 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC}
/** fortran parsing states */ /** fortran parsing states */
%x Subprog %x Subprog
%x SubprogPrefix
%x Parameterlist %x Parameterlist
%x SubprogBody %x SubprogBody
%x SubprogBodyContains
%x Start %x Start
%x Comment %x Comment
%x Module %x Module
%x ModuleBody %x ModuleBody
%x ModuleBodyContains
%x AttributeList %x AttributeList
%x Variable %x Variable
%x Initialization %x Initialization
...@@ -226,6 +246,8 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} ...@@ -226,6 +246,8 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC}
%x UseOnly %x UseOnly
%x ModuleProcedure %x ModuleProcedure
%x Prepass
/** comment parsing states */ /** comment parsing states */
%x DocBlock %x DocBlock
%x DocBackLine %x DocBackLine
...@@ -235,9 +257,36 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} ...@@ -235,9 +257,36 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC}
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
<*>"&".*"\n" { if (YY_START == String) REJECT; // "&" is ignored in strings <*>^.*"&"{BS}(!.*)?\n { // ampersand is somewhere in line
yyLineNr++;} /* line not finished -> read next line (text after "&" may be //fprintf(stderr, "---%s", yytext);
comment and has to be ignored */
int index = getAmpersandAtTheEnd(yytext, yyleng);
if(index<0){ // ampersand is not line continuation
if(YY_START == Prepass) { // last line in "continuation"
inputStringPrepass+=(const char*)yytext;
pushBuffer(inputStringPrepass);
yy_pop_state();
} else { // simple line
REJECT;
}
} else { // line with continuation
inputStringPrepass+=(const char*)yytext;
lineCountPrepass ++;
// replace & with space and remove the following chars
int length = inputStringPrepass.length();
inputStringPrepass[length-yyleng+index] = ' ';
inputStringPrepass.truncate(length-yyleng+index+1);
if(YY_START != Prepass)
yy_push_state(Prepass);
}
}
<Prepass>^.*\n {
inputStringPrepass+=(const char*)yytext;
pushBuffer(inputStringPrepass);
yy_pop_state();
}
/*------ ignore strings */ /*------ ignore strings */
<*>"\\\\" { /* ignore \\ */} <*>"\\\\" { /* ignore \\ */}
...@@ -280,9 +329,13 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} ...@@ -280,9 +329,13 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC}
/*------ use handling ------------------------------------------------------------*/ /*------ use handling ------------------------------------------------------------*/
<Start,ModuleBody,TypedefBody,SubprogBody>"use"{BS_} { <Start,ModuleBody,TypedefBody,SubprogBody>"use"{BS_} {
yy_push_state(YY_START); if(YY_START == Start)
BEGIN(Use); {
addModule(NULL);
yy_push_state(ModuleBody); //anon program
}
yy_push_state(Use);
} }
<Use>{ID} { <Use>{ID} {
//fprintf(stderr,"using dir %s\n",yytext); //fprintf(stderr,"using dir %s\n",yytext);
...@@ -313,6 +366,12 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} ...@@ -313,6 +366,12 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC}
/*------ ignore special fortran statements */ /*------ ignore special fortran statements */
<Start,ModuleBody,SubprogBody>^[ \t]*interface({BS_}{ID}({BS}\({BS}[^ \t()]+{BS}\))?)? { // handle interface block <Start,ModuleBody,SubprogBody>^[ \t]*interface({BS_}{ID}({BS}\({BS}[^ \t()]+{BS}\))?)? { // handle interface block
if(YY_START == Start)
{
addModule(NULL);
yy_push_state(ModuleBody); //anon program
}
QCString name = yytext; QCString name = yytext;
int index = name.find("interface", 0, FALSE); int index = name.find("interface", 0, FALSE);
index = name.find(QRegExp("[^ \\t]"), index+9); index = name.find(QRegExp("[^ \\t]"), index+9);
...@@ -325,7 +384,7 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} ...@@ -325,7 +384,7 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC}
yy_push_state(InterfaceBody); yy_push_state(InterfaceBody);
startScope(last_entry); startScope(last_entry);
} }
<InterfaceBody>^{BS}"end"({BS_}"interface")? { <InterfaceBody>^{BS}"end"({BS}"interface"({BS_}{ID})?)?{BS}/(\n|!) {
if (!endScope(current_root)) if (!endScope(current_root))
yyterminate(); yyterminate();
yy_pop_state(); yy_pop_state();
...@@ -343,31 +402,32 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} ...@@ -343,31 +402,32 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC}
yy_pop_state(); yy_pop_state();
} }
<InterfaceBody>. {} <InterfaceBody>. {}
/*-- Contains handling --*/
<Start>^{BS}{CONTAINS}/({BS}|\n|!) {
if(YY_START == Start)
{
addModule(NULL);
yy_push_state(ModuleBodyContains); //anon program
}
}
<ModuleBody>^{BS}{CONTAINS}/({BS}|\n|!) { BEGIN(ModuleBodyContains); }
<SubprogBody>^{BS}{CONTAINS}/({BS}|\n|!) { BEGIN(SubprogBodyContains); }
/*------ module handling ------------------------------------------------------------*/ /*------ module handling ------------------------------------------------------------*/
<Start>module|program{BS_} { // <Start>module|program{BS_} { //
BEGIN(Module); yy_push_state(Module);
defaultProtection = Public; defaultProtection = Public;
} }
<Start,ModuleBody>^{BS}"end"({BS_}(module|program))?{BS} { // end module <Start,ModuleBody,ModuleBodyContains>^{BS}"end"({BS}(module|program)({BS_}{ID})?)?{BS}/(\n|!) { // end module
resolveModuleProcedures(moduleProcedures, current_root); resolveModuleProcedures(moduleProcedures, current_root);
if (!endScope(current_root)) if (!endScope(current_root))
yyterminate(); yyterminate();
defaultProtection = Public; defaultProtection = Public;
BEGIN(Start); yy_pop_state();
} }
<Module>{ID} { <Module>{ID} {
//cout << "0=========> got module " << yytext << endl; addModule(yytext);
current->section = Entry::NAMESPACE_SEC;
current->name = yytext;
current->type = "module";
current->fileName = yyFileName;
current->bodyLine = yyLineNr; // used for source reference
current->protection = Public ;
addCurrentEntry();
startScope(last_entry);
BEGIN(ModuleBody); BEGIN(ModuleBody);
} }
...@@ -379,8 +439,13 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} ...@@ -379,8 +439,13 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC}
/*------- type definition -------------------------------------------------------------------------------*/ /*------- type definition -------------------------------------------------------------------------------*/
<Start,ModuleBody>"type"({BS_}|({COMMA}{ACCESS_SPEC})) { /* type definition found : TYPE , access-spec::type-name |*/ <Start,ModuleBody>"type"({BS_}|({COMMA}{ACCESS_SPEC})) { /* type definition found : TYPE , access-spec::type-name |*/
yy_push_state(YY_START); if(YY_START == Start)
BEGIN(Typedef); {
addModule(NULL);
yy_push_state(ModuleBody); //anon program
}
yy_push_state(Typedef);
current->protection = defaultProtection; current->protection = defaultProtection;
} }
<Typedef>{ACCESS_SPEC} { <Typedef>{ACCESS_SPEC} {
...@@ -406,7 +471,7 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} ...@@ -406,7 +471,7 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC}
startScope(last_entry); startScope(last_entry);
BEGIN(TypedefBody); BEGIN(TypedefBody);
} }
<TypedefBody>"end"{BS_}"type".* { /* end type definition */ <TypedefBody>^{BS}"end"{BS}"type"({BS_}{ID})?{BS}/(\n|!) { /* end type definition */
//cout << "=========> got typedef end "<< endl; //cout << "=========> got typedef end "<< endl;
if (!endScope(current_root)) if (!endScope(current_root))
yyterminate(); yyterminate();
...@@ -415,8 +480,8 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} ...@@ -415,8 +480,8 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC}
/*------- module/global/typedef variable ---------------------------------------------------*/ /*------- module/global/typedef variable ---------------------------------------------------*/
<SubprogBody>^{BS}"end"({BS_}{SUBPROG})?{BS} { <SubprogBody,SubprogBodyContains>^{BS}"end"({BS}{SUBPROG}({BS_}{ID})?)?{BS}/(\n|!) {
//cout << "1e=========> got end subprog: " << yytext << endl; //fprintf(stderr,"1e=========> got end subprog: %s\n", yytext);
/* args is used for parameters in list of functions, argList for /* args is used for parameters in list of functions, argList for
parameters in detailed function descripttion */ parameters in detailed function descripttion */
...@@ -427,8 +492,13 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} ...@@ -427,8 +492,13 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC}
yy_pop_state() ; yy_pop_state() ;
} }
<Start,ModuleBody,TypedefBody,SubprogBody>{ <Start,ModuleBody,TypedefBody,SubprogBody>{
{TYPE_SPEC}/{SEPARATE} { ^{BS}{TYPE_SPEC}/{SEPARATE} {
/* variable declaration starts */ /* variable declaration starts */
if(YY_START == Start)
{
addModule(NULL);
yy_push_state(ModuleBody); //anon program
}
//fprintf(stderr,"4=========> got variable type: %s\n",yytext); //fprintf(stderr,"4=========> got variable type: %s\n",yytext);
QCString help=yytext; QCString help=yytext;
help= help.simplifyWhiteSpace(); help= help.simplifyWhiteSpace();
...@@ -530,19 +600,26 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} ...@@ -530,19 +600,26 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC}
<Variable>{COMMA} {} <Variable>{COMMA} {}
<Variable>{BS}"=" { yy_push_state(YY_START); <Variable>{BS}"=" { yy_push_state(YY_START);
initializer=""; initializer="";
initializerScope = 0;
BEGIN(Initialization); BEGIN(Initialization);
} }
<Variable>"\n" { currentModifiers = SymbolModifiers(); <Variable>"\n" { currentModifiers = SymbolModifiers();
yy_pop_state(); // end variable deklaration list yy_pop_state(); // end variable deklaration list
yyLineNr++; yyLineNr++; yyLineNr+=lineCountPrepass; lineCountPrepass=0;
docBlock.resize(0); docBlock.resize(0);
} }
<Initialization>"(" { initializer+=yytext; <Initialization,ArrayInitializer>"(/" { initializer+=yytext;
BEGIN(ArrayInitializer); // initializer may contain comma initializerScope++;
BEGIN(ArrayInitializer); // initializer may contain comma
} }
<ArrayInitializer>")" { initializer+=yytext; <ArrayInitializer>"/)" { initializer+=yytext;
BEGIN(Initialization); initializerScope--;
if(initializerScope<=0)
{
initializerScope = 0; // just in case
BEGIN(Initialization);
}
} }
<ArrayInitializer>. { initializer+=yytext; } <ArrayInitializer>. { initializer+=yytext; }
<Initialization>{COMMA} { yy_pop_state(); // end initialization <Initialization>{COMMA} { yy_pop_state(); // end initialization
...@@ -558,25 +635,44 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} ...@@ -558,25 +635,44 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC}
/*------ fortran subroutine/function handling ------------------------------------------------------------*/ /*------ fortran subroutine/function handling ------------------------------------------------------------*/
/* Start is initial condition */ /* Start is initial condition */
<Start,ModuleBody,SubprogBody,InterfaceBody>{TYPE_SPEC}{BS}/{SUBPROG}{BS_} { <Start,ModuleBody,SubprogBody,InterfaceBody,ModuleBodyContains,SubprogBodyContains>^{BS}({PREFIX}{BS_})?{TYPE_SPEC}{BS}/{SUBPROG}{BS_} {
// TYPE_SPEC is for old function style function result // TYPE_SPEC is for old function style function result
result= yytext; result= yytext;
result= result.stripWhiteSpace(); result= result.stripWhiteSpace();
int prefixIndex = 0;
int curIndex = 0;
bool cont = TRUE;
const char* pre[] = {"RECURSIVE","PURE","ELEMENTAL"};
while(cont)
{
cont = FALSE;
for(unsigned int i=0; i<3; i++)
{
if((prefixIndex=result.find(pre[i], curIndex, FALSE))==0)
{
result.remove(0,strlen(pre[i]));
result.stripWhiteSpace();
cont = TRUE;
}
}
}
//fprintf(stderr, "===%s\n", (const char*)result);
current->type = result; current->type = result;
} yy_push_state(SubprogPrefix);
<Start,ModuleBody,SubprogBody,InterfaceBody>{BS}{SUBPROG}{BS_} { // Fortran subroutine or function found }
//fprintf(stderr,"1=========> got subprog, type: %s\n",yytext);
current->section = Entry::FUNCTION_SEC ; <SubprogPrefix>{BS}{SUBPROG}{BS_} {
QCString subtype = yytext; subtype=subtype.lower().stripWhiteSpace(); // Fortran subroutine or function found
if (!current->type) current->type = subtype; addSubprogram(yytext);
current->fileName = yyFileName; BEGIN(Subprog);
current->bodyLine = yyLineNr; // used for source reference }
current->startLine = -1; // ??? what is startLine for?
current->args.resize(0); <Start,ModuleBody,SubprogBody,InterfaceBody,ModuleBodyContains,SubprogBodyContains>^{BS}{SUBPROG}{BS_} {
current->argList->clear(); // Fortran subroutine or function found
yy_push_state(Subprog); addSubprogram(yytext);
docBlock.resize(0); yy_push_state(Subprog);
} }
<Subprog>{BS} { /* ignore white space */ } <Subprog>{BS} { /* ignore white space */ }
<Subprog>{ID} { current->name = yytext; <Subprog>{ID} { current->name = yytext;
//cout << "1a==========> got " << current->type << " " << yytext << " " << yyLineNr << endl; //cout << "1a==========> got " << current->type << " " << yytext << " " << yyLineNr << endl;
...@@ -587,9 +683,9 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} ...@@ -587,9 +683,9 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC}
//current->type not yet available //current->type not yet available
QCString arglist= yytext; QCString arglist= yytext;
//cout << "3=========> got parameterlist " << yytext << endl; //cout << "3=========> got parameterlist " << yytext << endl;
yyLineNr+= arglist.contains('\n'); //yyLineNr+= arglist.contains('\n');
static QRegExp re("&[^\n]*\n"); //static QRegExp re("&[^\n]*\n");
arglist = arglist.replace(re,""); //arglist = arglist.replace(re,"");
//cout << "3=========> got parameterlist " << arglist << endl; //cout << "3=========> got parameterlist " << arglist << endl;
current->args = arglist; current->args = arglist;
current->args = removeRedundantWhiteSpace(current->args); current->args = removeRedundantWhiteSpace(current->args);
...@@ -599,8 +695,8 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} ...@@ -599,8 +695,8 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC}
BEGIN(SubprogBody); BEGIN(SubprogBody);
} }
<Parameterlist>{NOARGS} { <Parameterlist>{NOARGS} {
yyLineNr++; yyLineNr++; yyLineNr+=lineCountPrepass; lineCountPrepass=0;
//cout << "3=========> without parameterlist " <<endl; //printf("3=========> without parameterlist \n");
stringToArgumentList("", current->argList); stringToArgumentList("", current->argList);
addCurrentEntry(); addCurrentEntry();
startScope(last_entry); startScope(last_entry);
...@@ -643,7 +739,7 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} ...@@ -643,7 +739,7 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC}
yy_pop_state(); yy_pop_state();
} }
<Start,SubprogBody,ModuleBody,TypedefBody,InterfaceBody>"!>" { <Start,SubprogBody,ModuleBody,TypedefBody,InterfaceBody,ModuleBodyContains,SubprogBodyContains>"!>" {
yy_push_state(YY_START); yy_push_state(YY_START);
current->docLine = yyLineNr; current->docLine = yyLineNr;
docBlockJavaStyle = FALSE; docBlockJavaStyle = FALSE;
...@@ -659,7 +755,7 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} ...@@ -659,7 +755,7 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC}
} }
<DocBlock>"\n"{BS}"!"(">"|"!"+) { // comment block (next line is also comment line) <DocBlock>"\n"{BS}"!"(">"|"!"+) { // comment block (next line is also comment line)
docBlock+="\n"; // \n is necessary for lists docBlock+="\n"; // \n is necessary for lists
yyLineNr++; yyLineNr++; yyLineNr+=lineCountPrepass; lineCountPrepass=0;
} }
<DocBlock>"\n" { // comment block ends at the end of this line <DocBlock>"\n" { // comment block ends at the end of this line
//cout <<"3=========> comment block : "<< docBlock << endl; //cout <<"3=========> comment block : "<< docBlock << endl;
...@@ -671,19 +767,27 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} ...@@ -671,19 +767,27 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC}
/*------------------------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------------------------*/
<*>"\n" { <*>"\n" {
yyLineNr++; yyLineNr++; yyLineNr+=lineCountPrepass; lineCountPrepass=0;
//if (debugStr.stripWhiteSpace().length() > 0) cout << "ignored text: " << debugStr << " state: " <<YY_START << endl; //if (debugStr.stripWhiteSpace().length() > 0) cout << "ignored text: " << debugStr << " state: " <<YY_START << endl;
debugStr=""; debugStr="";
} }
/*---- error: EOF in wrong state --------------------------------------------------------------------*/ /*---- error: EOF in wrong state --------------------------------------------------------------------*/
<SubprogBody,ModuleBody,String,StrIgnore,InterfaceBody><<EOF>> {
fprintf(stderr,"==== Error: EOF reached in wrong state (end missing)"); <*><<EOF>> {
scanner_abort(); if ( include_stack_ptr <= 0 ) {
yyterminate(); if (YY_START!=INITIAL && YY_START!=Start) {
//fprintf(stderr,"==== Error: EOF reached in wrong state (end missing)");
scanner_abort();
}
yyterminate();
} else {
popBuffer();
}
} }
<*>. { <*>. {
debugStr+=yytext; //debugStr+=yytext;
} // ignore remaining text } // ignore remaining text
/**********************************************************************************/ /**********************************************************************************/
...@@ -692,6 +796,70 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} ...@@ -692,6 +796,70 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC}
%% %%
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
static int getAmpersandAtTheEnd(const char *buf, int length)
{
// Avoid ampersands in string and comments
int parseState = Start;
char quoteSymbol = 0;
int ampIndex = -1;
for(int i=0; i<length && parseState!=Comment; i++)
{
if(parseState==String)
{
if(buf[i]=='\\') i++;
if(buf[i]==quoteSymbol)
{
parseState = Start;
quoteSymbol = 0;
}
} else // not in string
{
switch(buf[i])
{
case '\'':
case '"':
parseState = String;
quoteSymbol = buf[i];
break;
case '!':
parseState = Comment;
break;
case ' ': // ignore whitespace
case '\t':
case '\n': // this may be at the end of line
break;
case '&':
ampIndex = i;
break;
default:
ampIndex = -1; // invalidate prev ampersand
}
}
}
return ampIndex;
}
static void pushBuffer(QCString& buffer)
{
if ( include_stack_ptr >= MAX_INCLUDE_DEPTH )
{
fprintf( stderr, "Stack buffers nested too deeply" );
exit( 1 );
}
include_stack[include_stack_ptr++] = YY_CURRENT_BUFFER;
yy_switch_to_buffer(yy_scan_string(buffer));
//fprintf(stderr, "--POP--%s", (const char *)buffer);
buffer = NULL;
}
static void popBuffer() {
include_stack_ptr --;
yy_delete_buffer( YY_CURRENT_BUFFER );
yy_switch_to_buffer( include_stack[include_stack_ptr] );
}
/** used to copy entry to an interface module procedure */ /** used to copy entry to an interface module procedure */
static void copyEntry(Entry *dest, Entry *src) static void copyEntry(Entry *dest, Entry *src)
{ {
...@@ -973,10 +1141,10 @@ static void startScope(Entry *scope) ...@@ -973,10 +1141,10 @@ static void startScope(Entry *scope)
/*! Ends scope in fortran program: may update subprogram arguments or module variable attributes. /*! Ends scope in fortran program: may update subprogram arguments or module variable attributes.
* \see startScope() * \see startScope()
*/ */
static bool endScope(Entry *scope) static bool endScope(Entry *scope, bool isGlobalRoot)
{ {
//cout<<"end scope: "<<scope->name<<endl; //cout<<"end scope: "<<scope->name<<endl;
if (current_root->parent()) if (current_root->parent() || isGlobalRoot)
{ {
current_root= current_root->parent(); /* end substructure */ current_root= current_root->parent(); /* end substructure */
} }
...@@ -1072,6 +1240,7 @@ static QCString getFullName(Entry *e) ...@@ -1072,6 +1240,7 @@ static QCString getFullName(Entry *e)
static int yyread(char *buf,int max_size) static int yyread(char *buf,int max_size)
{ {
int c=0; int c=0;
while ( c < max_size && inputString[inputPosition] ) while ( c < max_size && inputString[inputPosition] )
{ {
*buf = inputString[inputPosition++] ; *buf = inputString[inputPosition++] ;
...@@ -1099,13 +1268,55 @@ static void initEntry() ...@@ -1099,13 +1268,55 @@ static void initEntry()
*/ */
static void addCurrentEntry() static void addCurrentEntry()
{ {
//cout << "Adding entry " <<current->name.data() << endl; //printf("===Adding entry %s to %s\n", current->name.data(), current_root->name.data());
current_root->addSubEntry(current); current_root->addSubEntry(current);
last_entry = current; last_entry = current;
current = new Entry ; current = new Entry ;
initEntry(); initEntry();
} }
static int max(int a, int b) {return a>b?a:b;}
static void addModule(const char *name)
{
//fprintf(stderr, "0=========> got module %s\n", name);
current->section = Entry::NAMESPACE_SEC;
if (name!=NULL)
{
current->name = name;
}
else
{
QCString fname = yyFileName;
int index = max(fname.findRev('/'), fname.findRev('\\'));
fname = fname.right(fname.length()-index-1);
fname = fname.prepend("__").append("__");
current->name = fname;
}
current->type = "program";
current->fileName = yyFileName;
current->bodyLine = yyLineNr; // used for source reference
current->protection = Public ;
addCurrentEntry();
startScope(last_entry);
}
static void addSubprogram(const char *text)
{
//fprintf(stderr,"1=========> got subprog, type: %s\n",text);
current->section = Entry::FUNCTION_SEC ;
QCString subtype = text; subtype=subtype.lower().stripWhiteSpace();
if (!current->type) current->type = subtype;
current->fileName = yyFileName;
current->bodyLine = yyLineNr; // used for source reference
current->startLine = -1; // ??? what is startLine for?
current->args.resize(0);
current->argList->clear();
docBlock.resize(0);
}
/*! Adds interface to the root entry. /*! Adds interface to the root entry.
* \note Code was brought to this procedure from the parser, * \note Code was brought to this procedure from the parser,
* because there was/is idea to use it in several parts of the parser. * because there was/is idea to use it in several parts of the parser.
...@@ -1231,6 +1442,8 @@ static void parseMain(const char *fileName,const char *fileBuf,Entry *rt) ...@@ -1231,6 +1442,8 @@ static void parseMain(const char *fileName,const char *fileBuf,Entry *rt)
defaultProtection = Public; defaultProtection = Public;
inputString = fileBuf; inputString = fileBuf;
inputPosition = 0; inputPosition = 0;
inputStringPrepass = NULL;
inputPositionPrepass = 0;
//anonCount = 0; // don't reset per file //anonCount = 0; // don't reset per file
mtype = Method; mtype = Method;
...@@ -1245,7 +1458,7 @@ static void parseMain(const char *fileName,const char *fileBuf,Entry *rt) ...@@ -1245,7 +1458,7 @@ static void parseMain(const char *fileName,const char *fileBuf,Entry *rt)
yyFileName = fileName; yyFileName = fileName;
msg("Parsing file %s...\n",yyFileName.data()); msg("Parsing file %s...\n",yyFileName.data());
current_root = rt ; startScope(rt); // implies current_root = rt
initParser(); initParser();
groupEnterFile(yyFileName,yyLineNr); groupEnterFile(yyFileName,yyLineNr);
...@@ -1264,6 +1477,8 @@ static void parseMain(const char *fileName,const char *fileBuf,Entry *rt) ...@@ -1264,6 +1477,8 @@ static void parseMain(const char *fileName,const char *fileBuf,Entry *rt)
fscanYYlex(); fscanYYlex();
groupLeaveFile(yyFileName,yyLineNr); groupLeaveFile(yyFileName,yyLineNr);
endScope(current_root, TRUE); // TRUE - global root
//debugCompounds(rt); //debug //debugCompounds(rt); //debug
rt->program.resize(0); rt->program.resize(0);
......
...@@ -3008,7 +3008,8 @@ void writeIndex(OutputList &ol) ...@@ -3008,7 +3008,8 @@ void writeIndex(OutputList &ol)
{ {
ol.startIndexSection(isCompoundIndex); ol.startIndexSection(isCompoundIndex);
ol.parseText(/*projPrefix+*/ ol.parseText(/*projPrefix+*/
(vhdlOpt ? VhdlDocGen::trDesignUnitIndex() : (fortranOpt ? theTranslator->trCompoundIndexFortran() :
vhdlOpt ? VhdlDocGen::trDesignUnitIndex() :
theTranslator->trCompoundIndex() theTranslator->trCompoundIndex()
)); ));
ol.endIndexSection(isCompoundIndex); ol.endIndexSection(isCompoundIndex);
......
...@@ -769,12 +769,19 @@ bool NamespaceDef::isLinkableInProject() const ...@@ -769,12 +769,19 @@ bool NamespaceDef::isLinkableInProject() const
int i = name().findRev("::"); int i = name().findRev("::");
if (i==-1) i=0; else i+=2; if (i==-1) i=0; else i+=2;
static bool extractAnonNs = Config_getBool("EXTRACT_ANON_NSPACES"); static bool extractAnonNs = Config_getBool("EXTRACT_ANON_NSPACES");
if (extractAnonNs && name().mid(i,20)=="anonymous_namespace{") static bool showNamespaces = Config_getBool("SHOW_NAMESPACES");
if (extractAnonNs && // extract anonymous ns
name().mid(i,20)=="anonymous_namespace{" && // correct prefix
showNamespaces) // not disabled by config
{ {
return TRUE; return TRUE;
} }
return !name().isEmpty() && name().at(i)!='@' && return !name().isEmpty() && name().at(i)!='@' && // not anonymous
hasDocumentation() && !isReference() && !isHidden() && !isArtificial(); hasDocumentation() && // documented
!isReference() && // not an external reference
!isHidden() && // not hidden
!isArtificial() && // or artificial
showNamespaces; // not disabled by config
} }
bool NamespaceDef::isLinkable() const bool NamespaceDef::isLinkable() const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment