2005-10-25 Gaurav Gautam * arith.c (gfc_enum_initializer): New function added. (gfc_check_integer_range): prototype changed. * decl.c (enumerator_history): New typedef added. (last_initializer, enum_history, max_enum): New variables (create_enum_history, gfc_free_enum_history): New functions. (add_init_expr_to_sym): Modified to call function create_enum_history. (variable_decl): Modified to parse enumerator definition. Call gfc_free_enum_history if gfc_match_array_spec returns ERROR. Calls gfc_enum_initializer to add initializer to enumerator. Calls gfc_enum_initializer and appropriate error handling is done. Last initialiser is stored here to be used next time. (match_attr_spec): Modified to assign PARAMETER attribute, by calling function gfc_add_flavor. Also checks that no other attribute is present. Issues the appropriate errors. (gfc_match_data_decl): Issues approprite errors, if match_type_spec do not return desired return values. (reset_enum_kind, gfc_match_enum, gfc_match_enumerator_def): New Function. (gfc_match_end): New case COMP_ENUM added. Parses the end-enum stmt. * gfortran.h (gfc_statement): ST_ENUM, ST_ENUMERATOR, ST_END_ENUM added. (symbol_attribute): bit field for enumerator added. (gfc_options): fshort_enums added to gfc_option. (gfc_enum_initializer, gfc_check_integer_range): prototypes added. * options.c (gfc_init_options): fshort_enums initialized. (gfc_handle_option): fshort_enums is set. (target.h): included. * parse.c (decode_statement): match ("enum , bind ( c )", gfc_match_enum, ST_ENUM) added. match (NULL, gfc_match_enumerator_def, ST_ENUMERATOR) added. (gfc_ascii_statement): Added cases ST_ENUM , ST_ENUMERATOR and ST_END_ENUM. (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): set the enumeration attribute. * lang.opt (fshort-enums): option added.