Index: src/fortrancode.l
===================================================================
RCS file: /cygdrive/d/cvs_doxygen/doxygen/doxygen/src/fortrancode.l,v
retrieving revision 1.7.2.1
diff -u -r1.7.2.1 fortrancode.l
--- src/fortrancode.l	6 Jan 2013 15:13:59 -0000	1.7.2.1
+++ src/fortrancode.l	6 Jan 2013 18:54:21 -0000
@@ -694,8 +694,8 @@
 TYPE_SPEC (({NUM_TYPE}({BS}"*"{BS}[0-9]+)?)|({NUM_TYPE}{KIND})|DOUBLE{BS_}COMPLEX|DOUBLE{BS_}PRECISION|{CHAR})
 
 INTENT_SPEC intent{BS}"("{BS}(in|out|in{BS}out){BS}")"
-ATTR_SPEC (IMPLICIT|ALLOCATABLE|DIMENSION{ARGS}|EXTERNAL|{INTENT_SPEC}|INTRINSIC|OPTIONAL|PARAMETER|POINTER|PRIVATE|PUBLIC|SAVE|TARGET|RECURSIVE|PURE|ELEMENTAL)
-ACCESS_SPEC (PRIVATE|PUBLIC)
+ATTR_SPEC (IMPLICIT|ALLOCATABLE|DIMENSION{ARGS}|EXTERNAL|{INTENT_SPEC}|INTRINSIC|OPTIONAL|PARAMETER|POINTER|PROTECTED|PRIVATE|PUBLIC|SAVE|TARGET|RECURSIVE|PURE|ELEMENTAL)
+ACCESS_SPEC (PROTECTED|PRIVATE|PUBLIC)
 /* Assume that attribute statements are almost the same as attributes. */
 ATTR_STMT {ATTR_SPEC}|DIMENSION
 FLOW  (DO|SELECT|CASE|WHERE|IF|THEN|ELSE|WHILE|FORALL|ELSEWHERE|ELSEIF|RETURN|CONTINUE|EXIT)
Index: src/fortranscanner.l
===================================================================
RCS file: /cygdrive/d/cvs_doxygen/doxygen/doxygen/src/fortranscanner.l,v
retrieving revision 1.7
diff -u -r1.7 fortranscanner.l
--- src/fortranscanner.l	11 Dec 2012 18:59:15 -0000	1.7
+++ src/fortranscanner.l	6 Jan 2013 18:55:37 -0000
@@ -74,7 +74,7 @@
 // {{{ ----- Helper structs -----
 //! Holds modifiers (ie attributes) for one symbol (variable, function, etc)
 struct SymbolModifiers {
-  enum Protection {NONE_P, PUBLIC, PRIVATE};
+  enum Protection {NONE_P, PUBLIC, PRIVATE, PROTECTED};
   enum Direction {NONE_D, IN, OUT, INOUT};
 
   //!< This is only used with function return value.
@@ -252,8 +252,8 @@
 TYPE_SPEC (({NUM_TYPE}({BS}"*"{BS}[0-9]+)?)|({NUM_TYPE}{KIND})|DOUBLE{BS_}COMPLEX|DOUBLE{BS_}PRECISION|{CHAR}|TYPE{ARGS}|CLASS{ARGS}|PROCEDURE{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|NOPASS|PASS{ARGS}?|DEFERRED|NON_OVERRIDABLE)
-ACCESS_SPEC (PRIVATE|PUBLIC)
+ATTR_SPEC (ALLOCATABLE|DIMENSION{ARGS}|EXTERNAL|{INTENT_SPEC}|INTRINSIC|OPTIONAL|PARAMETER|POINTER|PROTECTED|PRIVATE|PUBLIC|SAVE|TARGET|NOPASS|PASS{ARGS}?|DEFERRED|NON_OVERRIDABLE)
+ACCESS_SPEC (PROTECTED|PRIVATE|PUBLIC)
 LANGUAGE_BIND_SPEC BIND{BS}"("{BS}C{BS}(,{BS}NAME{BS}"="{BS}"\""(.*)"\""{BS})?")"
 /* Assume that attribute statements are almost the same as attributes. */
 ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC}
@@ -545,6 +545,9 @@
 
   /*------- access specification --------------------------------------------------------------------------*/
 
+<ModuleBody>protected/{BS}(\n|"!")       { defaultProtection = Protected;
+                                           current->protection = defaultProtection ;
+                                         }
 <ModuleBody>private/{BS}(\n|"!")         { defaultProtection = Private;
                                            current->protection = defaultProtection ;
                                          }
@@ -586,6 +589,10 @@
                                           current->protection = Private;
                                           typeProtection = Private;
                                         }
+protected                               {
+                                          current->protection = Protected;
+                                          typeProtection = Protected;
+                                        }
 {LANGUAGE_BIND_SPEC}                    {
                                           /* ignored for now */
                                         }
@@ -1527,6 +1534,10 @@
   {
     newMdf.protection = SymbolModifiers::PRIVATE;
   }
+  else if (mdfString=="protected") 
+  {
+    newMdf.protection = SymbolModifiers::PROTECTED;
+  }
   else if (mdfString=="optional") 
   {
     newMdf.optional = TRUE;
@@ -1717,6 +1728,11 @@
     if (!typeName.isEmpty()) typeName += ", ";
     typeName += "private";
   }
+  else if (mdfs.protection == SymbolModifiers::PROTECTED)
+  {
+    if (!typeName.isEmpty()) typeName += ", ";
+    typeName += "protected";
+  }
 
   return typeName;
 }
@@ -1738,6 +1754,8 @@
     ent->protection = Public;
   else if (mdfs.protection == SymbolModifiers::PRIVATE)
     ent->protection = Private;
+  else if (mdfs.protection == SymbolModifiers::PROTECTED)
+    ent->protection = Protected;
 }
 
 /*! Starts the new scope in fortran program. Consider using this function when
