diff options
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r-- | gcc/fortran/decl.c | 66 |
1 files changed, 65 insertions, 1 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 25fa6b5..46c49ba 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -2117,7 +2117,7 @@ match_attr_spec (void) DECL_ALLOCATABLE = GFC_DECL_BEGIN, DECL_DIMENSION, DECL_EXTERNAL, DECL_IN, DECL_OUT, DECL_INOUT, DECL_INTRINSIC, DECL_OPTIONAL, DECL_PARAMETER, DECL_POINTER, DECL_PRIVATE, DECL_PUBLIC, DECL_SAVE, - DECL_TARGET, DECL_VOLATILE, DECL_COLON, DECL_NONE, + DECL_TARGET, DECL_VALUE, DECL_VOLATILE, DECL_COLON, DECL_NONE, GFC_DECL_END /* Sentinel */ } decl_types; @@ -2140,6 +2140,7 @@ match_attr_spec (void) minit (", public", DECL_PUBLIC), minit (", save", DECL_SAVE), minit (", target", DECL_TARGET), + minit (", value", DECL_VALUE), minit (", volatile", DECL_VOLATILE), minit ("::", DECL_COLON), minit (NULL, DECL_NONE) @@ -2261,6 +2262,9 @@ match_attr_spec (void) case DECL_TARGET: attr = "TARGET"; break; + case DECL_VALUE: + attr = "VALUE"; + break; case DECL_VOLATILE: attr = "VOLATILE"; break; @@ -2378,6 +2382,15 @@ match_attr_spec (void) t = gfc_add_target (¤t_attr, &seen_at[d]); break; + case DECL_VALUE: + if (gfc_notify_std (GFC_STD_F2003, + "Fortran 2003: VALUE attribute at %C") + == FAILURE) + t = FAILURE; + else + t = gfc_add_value (¤t_attr, NULL, &seen_at[d]); + break; + case DECL_VOLATILE: if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: VOLATILE attribute at %C") @@ -4051,6 +4064,57 @@ syntax: match +gfc_match_value (void) +{ + gfc_symbol *sym; + match m; + + if (gfc_notify_std (GFC_STD_F2003, + "Fortran 2003: VALUE statement at %C") + == FAILURE) + return MATCH_ERROR; + + if (gfc_match (" ::") == MATCH_NO && gfc_match_space () == MATCH_NO) + { + return MATCH_ERROR; + } + + if (gfc_match_eos () == MATCH_YES) + goto syntax; + + for(;;) + { + m = gfc_match_symbol (&sym, 0); + switch (m) + { + case MATCH_YES: + if (gfc_add_value (&sym->attr, sym->name, + &gfc_current_locus) == FAILURE) + return MATCH_ERROR; + goto next_item; + + case MATCH_NO: + break; + + case MATCH_ERROR: + return MATCH_ERROR; + } + + next_item: + if (gfc_match_eos () == MATCH_YES) + break; + if (gfc_match_char (',') != MATCH_YES) + goto syntax; + } + + return MATCH_YES; + +syntax: + gfc_error ("Syntax error in VALUE statement at %C"); + return MATCH_ERROR; +} + +match gfc_match_volatile (void) { gfc_symbol *sym; |