diff options
author | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2009-07-20 20:05:52 (GMT) |
---|---|---|
committer | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2009-07-20 20:05:52 (GMT) |
commit | 6e28050ef5483e624122b0bacb998c40664f78ee (patch) | |
tree | b8b0cb3ac894bdb88087d78e328a8a0d88943b97 /src/fortranscanner.l | |
parent | 7c0a46b50fad0925e47b78326f8c2e92e3829fb4 (diff) | |
download | Doxygen-6e28050ef5483e624122b0bacb998c40664f78ee.zip Doxygen-6e28050ef5483e624122b0bacb998c40664f78ee.tar.gz Doxygen-6e28050ef5483e624122b0bacb998c40664f78ee.tar.bz2 |
Release-1.5.9-20090720
Diffstat (limited to 'src/fortranscanner.l')
-rw-r--r-- | src/fortranscanner.l | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/fortranscanner.l b/src/fortranscanner.l index 766a261..97909f0 100644 --- a/src/fortranscanner.l +++ b/src/fortranscanner.l @@ -171,7 +171,7 @@ static int yyread(char *buf,int max_size); static void startCommentBlock(bool); static void handleCommentBlock(const QCString &doc,bool brief); static void addCurrentEntry(); -static void addModule(const char *name); +static void addModule(const char *name, bool isModule=FALSE); static void addSubprogram(const char *text); static void addInterface(QCString name); static Argument *addFortranParameter(const QCString &type,const QCString &name, const QCString docs); @@ -242,6 +242,7 @@ PREFIX (RECURSIVE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,2}(RECURSIVE|PURE|ELEMENTA %x Start %x Comment %x Module +%x Program %x ModuleBody %x ModuleBodyContains %x AttributeList @@ -437,7 +438,10 @@ PREFIX (RECURSIVE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,2}(RECURSIVE|PURE|ELEMENTA /*------ module handling ------------------------------------------------------------*/ <Start>module|program{BS_} { // - yy_push_state(Module); + if(yytext[0]=='m' || yytext[0]=='M') + yy_push_state(Module); + else + yy_push_state(Program); defaultProtection = Public; } <Start,ModuleBody,ModuleBodyContains>^{BS}"end"({BS}(module|program)({BS_}{ID})?)?{BS}/(\n|!) { // end module @@ -448,7 +452,12 @@ PREFIX (RECURSIVE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,2}(RECURSIVE|PURE|ELEMENTA yy_pop_state(); } <Module>{ID} { - addModule(yytext); + addModule(yytext, TRUE); + BEGIN(ModuleBody); + } + +<Program>{ID} { + addModule(yytext, FALSE); BEGIN(ModuleBody); } @@ -1468,11 +1477,15 @@ static void addCurrentEntry() static int max(int a, int b) {return a>b?a:b;} -static void addModule(const char *name) +static void addModule(const char *name, bool isModule) { //fprintf(stderr, "0=========> got module %s\n", name); - current->section = Entry::NAMESPACE_SEC; + if (isModule) + current->section = Entry::NAMESPACE_SEC; + else + current->section = Entry::FUNCTION_SEC; + if (name!=NULL) { current->name = name; |