diff options
author | tobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-10-30 18:09:55 +0000 |
---|---|---|
committer | tobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-10-30 18:09:55 +0000 |
commit | 3b6a4b4184528ed5c6c5f8e51c1c57cd92ed2cf5 (patch) | |
tree | 3920d0fc1db1a9d875d55587afd2ffefff790a10 /gcc/fortran/parse.h | |
parent | ca2399d9e4c7a5ee317197fbbbcfd591e0d543af (diff) | |
download | gcc-3b6a4b4184528ed5c6c5f8e51c1c57cd92ed2cf5.tar.gz |
fortran/
2005-10-30 Gaurav Gautam <gauravga@noida.hcltech.com>
Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
* arith.c (gfc_enum_initializer): New function.
(gfc_check_integer_range): Made extern.
* decl.c (enumerator_history): New typedef.
(last_initializer, enum_history, max_enum): New variables.
(create_enum_history, gfc_free_enum_history): New functions.
(add_init_expr_to_sym): Call create_enum_history if parsing ENUM.
(variable_decl): Modified to parse enumerator definition.
(match_attr_spec): Add PARAMETER attribute to ENUMERATORs.
(gfc_match_data_decl): Issues error, if match_type_spec do not
return desired return values.
(set_enum_kind, gfc_match_enum, gfc_match_enumerator_def): New
functions.
(gfc_match_end): Deal with END ENUM.
* gfortran.h (gfc_statement): ST_ENUM, ST_ENUMERATOR, ST_END_ENUM
added.
(symbol_attribute): Bit field for enumerator added.
(gfc_options): Add fshort_enums.
(gfc_enum_initializer, gfc_check_integer_range): Add prototypes.
* options.c: Include target.h
(gfc_init_options): Initialize fshort_enums.
(gfc_handle_option): Deal with fshort_enums.
* parse.c (decode_statement): Match ENUM and ENUMERATOR statement.
(gfc_ascii_statement): Deal with the enumerator statements.
(parse_enum): New function to parse enum construct.
(parse_spec): Added case ST_ENUM.
* parse.h (gfc_compile_state): COMP_ENUM added.
(gfc_match_enum, gfc_match_enumerator_def, gfc_free_enum_history):
Prototype added.
* symbol.c (gfc_copy_attr): Copy enumeration attribute.
* lang.opt (fshort-enums): Option added.
testsuite/
2005-10-30 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
* gfortran.dg/enum_10.f90, gfortran.dg/enum_10.c: New test.
2005-10-30 Gaurav Gautam <gauravga@noida.hcltech.com>
* gfortran.dg/enum_1.f90, gfortran.dg/enum_2.f90,
gfortran.dg/enum_3.f90, gfortran.dg/enum_4.f90,
gfortran.dg/enum_5.f90, gfortran.dg/enum_6.f90,
gfortran.dg/enum_7.f90, gfortran.dg/enum_8.f90,
gfortran.dg/enum_9.f90,
gfortran.fortran-torture/compile/enum_1.f90,
gfortran.fortran-torture/execute/enum_1.f90,
gfortran.fortran-torture/execute/enum_2.f90,
gfortran.fortran-torture/execute/enum_3.f90,
gfortran.fortran-torture/execute/enum_4.f90: New tests.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@106246 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/parse.h')
-rw-r--r-- | gcc/fortran/parse.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/fortran/parse.h b/gcc/fortran/parse.h index 1460ff301f6..193e1150674 100644 --- a/gcc/fortran/parse.h +++ b/gcc/fortran/parse.h @@ -30,7 +30,7 @@ typedef enum { COMP_NONE, COMP_PROGRAM, COMP_MODULE, COMP_SUBROUTINE, COMP_FUNCTION, COMP_BLOCK_DATA, COMP_INTERFACE, COMP_DERIVED, COMP_IF, COMP_DO, - COMP_SELECT, COMP_FORALL, COMP_WHERE, COMP_CONTAINS + COMP_SELECT, COMP_FORALL, COMP_WHERE, COMP_CONTAINS, COMP_ENUM } gfc_compile_state; @@ -63,5 +63,8 @@ int gfc_check_do_variable (gfc_symtree *); try gfc_find_state (gfc_compile_state); gfc_state_data *gfc_enclosing_unit (gfc_compile_state *); const char *gfc_ascii_statement (gfc_statement); +match gfc_match_enum (void); +match gfc_match_enumerator_def (void); +void gfc_free_enum_history (void); #endif /* GFC_PARSE_H */ |