Index: src/fortrancode.l
===================================================================
--- src/fortrancode.l	(revision 795)
+++ src/fortrancode.l	(working copy)
@@ -661,7 +661,7 @@
 ACCESS_SPEC (PRIVATE|PUBLIC)
 /* Assume that attribute statements are almost the same as attributes. */
 ATTR_STMT {ATTR_SPEC}|DIMENSION
-COMMANDS  (BLOCK{BS}DATA|DO|SELECT|CASE|WHERE|IF|THEN|ELSE|MODULE{BS_}PROCEDURE|CONTAINS|IMPLICIT{BS}NONE|CONTAINS|WRITE|READ|ALLOCATE|ALLOCATED|ASSOCIATED|DEALLOCATE|SIZE|END{BS}IF|END{BS}DO|WHILE|INQUIRE|OPEN|CLOSE|DATA)
+COMMANDS  (DO|SELECT|CASE|WHERE|IF|THEN|ELSE|MODULE{BS_}PROCEDURE|CONTAINS|IMPLICIT{BS}NONE|CONTAINS|WRITE|READ|ALLOCATE|ALLOCATED|ASSOCIATED|DEALLOCATE|SIZE|END{BS}IF|END{BS}DO|WHILE|INQUIRE|OPEN|CLOSE|DATA)
 IGNORE (CALL)
 
 /* |  */
@@ -741,7 +741,7 @@
                                         }
        
  /*-------- fortran module  -----------------------------------------*/
-<Start>("program"|"module"|"type"|"interface")/{BS_}|({COMMA}{ACCESS_SPEC})|\n {  //
+<Start>("block"{BS}"data"|"program"|"module"|"type"|"interface")/{BS_}|({COMMA}{ACCESS_SPEC})|\n {  //
 					  startScope();
   					  startFontClass("keyword"); 
   					  codifyLines(yytext);
Index: src/fortranscanner.l
===================================================================
--- src/fortranscanner.l	(revision 795)
+++ src/fortranscanner.l	(working copy)
@@ -230,6 +230,7 @@
 NOTIDSYM  [^a-z_A-Z0-9]
 SEPARATE  [:, \t]
 ID        [a-z_A-Z%]+{IDSYM}*
+ID_       [a-z_A-Z%]*{IDSYM}*
 PP_ID     {ID}
 LABELID   [a-z_A-Z]+[a-z_A-Z0-9\-]*
 SUBPROG   (subroutine|function)
@@ -299,6 +300,7 @@
 %x	DocBackLine
 %x	EndDoc
 
+%x      BlockData
 %%
 
  /*-----------------------------------------------------------------------------------*/
@@ -505,6 +507,11 @@
 <TypedefBody>^{BS}{CONTAINS}/({BS}|\n|!)  { BEGIN(TypedefBodyContains); }
 
  /*------ module handling ------------------------------------------------------------*/ 
+<Start>block{BS}data{BS}{ID_}        {  //
+                                         v_type = V_IGNORE;
+					    yy_push_state(BlockData);
+                                            defaultProtection = Public;
+                                       }
 <Start>module|program{BS_}             {  //
                                          v_type = V_IGNORE;
 					    if(yytext[0]=='m' || yytext[0]=='M')
@@ -513,6 +520,12 @@
 					      yy_push_state(Program);
                                             defaultProtection = Public;
                                        }
+<BlockData>^{BS}"end"({BS}(block{BS}data)({BS_}{ID})?)?{BS}/(\n|!) { // end block data
+					    //if (!endScope(current_root))
+					    //  yyterminate();
+                                            defaultProtection = Public;
+					    yy_pop_state();
+                                       }
 <Start,ModuleBody,ModuleBodyContains>^{BS}"end"({BS}(module|program)({BS_}{ID})?)?{BS}/(\n|!) { // end module	
 					    resolveModuleProcedures(moduleProcedures, current_root);
 					    if (!endScope(current_root))
@@ -660,6 +673,10 @@
                                            subrCurrent.remove(0u);
 					   yy_pop_state() ;
 				        }
+<BlockData>{
+{ID}                                    {
+                                        }
+}
 <Start,ModuleBody,TypedefBody,SubprogBody>{
 ^{BS}{TYPE_SPEC}/{SEPARATE}             {
                                           /* variable declaration starts */
