@@ -439,10 +439,25 @@ public void declaration_type_spec(Token udtKeyword, int type) {
439439 }
440440
441441 public void attr_spec (Token attrKeyword , int attr ) {
442+ Element preceeding = null ;
442443 String nestIn = "" ;
443444 switch (attr ) {
444445 case IActionEnums .AttrSpec_access :
445- // private
446+ preceeding = contextNode (-1 );
447+ int accessType = Integer .parseInt (getAttribute ("type" , preceeding ).getValue ());
448+ switch (accessType ) {
449+ case IActionEnums .AttrSpec_PUBLIC :
450+ nestIn = "public" ;
451+ break ;
452+ case IActionEnums .AttrSpec_PROTECTED :
453+ nestIn = "protected" ;
454+ break ;
455+ case IActionEnums .AttrSpec_PRIVATE :
456+ nestIn = "private" ;
457+ break ;
458+ default :
459+ throw new IllegalArgumentException (Integer .toString (attr ) + " - " + attrKeyword + ", type=" + Integer .toString (accessType ));
460+ }
446461 break ;
447462 case IActionEnums .AttrSpec_language_binding :
448463 // bind
@@ -497,6 +512,8 @@ public void attr_spec(Token attrKeyword, int attr) {
497512 }
498513 if (nestIn .length () > 0 )
499514 contextOpen ("attribute-" + nestIn );
515+ if (preceeding != null )
516+ moveHere (preceeding );
500517 super .attr_spec (attrKeyword , attr );
501518 if (nestIn .length () > 0 )
502519 contextClose ();
@@ -629,15 +646,11 @@ public void intent_spec(Token intentKeyword1, Token intentKeyword2, int intent)
629646 contextClose ();
630647 }
631648
632- public void access_id_list__begin () {
633- // contextOpen("access-list");
634- if (verbosity >= 100 )
635- super .access_id_list__begin ();
636- }
637-
638- public void access_id_list (int count ) {
639- super .access_id_list (count );
640- // contextClose("access-list");
649+ public void access_stmt (Token label , Token eos , boolean hasList ) {
650+ if (!context .getTagName ().equals ("declaration" ))
651+ cleanUpAfterError ("tag name is not 'declaration' but '" + context .getTagName () + "'" );
652+ setAttribute ("type" , "access" );
653+ super .access_stmt (label , eos , hasList );
641654 }
642655
643656 public void allocatable_decl_list__begin () {
0 commit comments