Home | History | Annotate | Line # | Download | only in fortran
match.h revision 1.1.1.2
      1      1.1  mrg /* All matcher functions.
      2  1.1.1.2  mrg    Copyright (C) 2003-2020 Free Software Foundation, Inc.
      3      1.1  mrg    Contributed by Steven Bosscher
      4      1.1  mrg 
      5      1.1  mrg This file is part of GCC.
      6      1.1  mrg 
      7      1.1  mrg GCC is free software; you can redistribute it and/or modify it under
      8      1.1  mrg the terms of the GNU General Public License as published by the Free
      9      1.1  mrg Software Foundation; either version 3, or (at your option) any later
     10      1.1  mrg version.
     11      1.1  mrg 
     12      1.1  mrg GCC is distributed in the hope that it will be useful, but WITHOUT ANY
     13      1.1  mrg WARRANTY; without even the implied warranty of MERCHANTABILITY or
     14      1.1  mrg FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
     15      1.1  mrg for more details.
     16      1.1  mrg 
     17      1.1  mrg You should have received a copy of the GNU General Public License
     18      1.1  mrg along with GCC; see the file COPYING3.  If not see
     19      1.1  mrg <http://www.gnu.org/licenses/>.  */
     20      1.1  mrg 
     21      1.1  mrg 
     22      1.1  mrg #ifndef GFC_MATCH_H
     23      1.1  mrg #define GFC_MATCH_H
     24      1.1  mrg 
     25      1.1  mrg /* gfc_new_block points to the symbol of a newly matched block.  */
     26      1.1  mrg extern gfc_symbol *gfc_new_block;
     27      1.1  mrg 
     28      1.1  mrg /* Current statement label.  Zero means no statement label.  Because
     29      1.1  mrg    new_st can get wiped during statement matching, we have to keep it
     30      1.1  mrg    separate.  */
     31      1.1  mrg extern gfc_st_label *gfc_statement_label;
     32      1.1  mrg 
     33      1.1  mrg extern int gfc_matching_ptr_assignment;
     34      1.1  mrg extern int gfc_matching_procptr_assignment;
     35      1.1  mrg extern bool gfc_matching_prefix;
     36      1.1  mrg 
     37      1.1  mrg /* Default access specifier while matching procedure bindings.  */
     38      1.1  mrg extern gfc_access gfc_typebound_default_access;
     39      1.1  mrg 
     40      1.1  mrg /****************** All gfc_match* routines *****************/
     41      1.1  mrg 
     42      1.1  mrg /* match.c.  */
     43      1.1  mrg 
     44      1.1  mrg /* Generic match subroutines.  */
     45      1.1  mrg match gfc_match_special_char (gfc_char_t *);
     46      1.1  mrg match gfc_match_space (void);
     47      1.1  mrg match gfc_match_eos (void);
     48      1.1  mrg match gfc_match_small_literal_int (int *, int *);
     49      1.1  mrg match gfc_match_st_label (gfc_st_label **);
     50      1.1  mrg match gfc_match_label (void);
     51      1.1  mrg match gfc_match_small_int (int *);
     52      1.1  mrg match gfc_match_small_int_expr (int *, gfc_expr **);
     53      1.1  mrg match gfc_match_name (char *);
     54      1.1  mrg match gfc_match_name_C (const char **buffer);
     55      1.1  mrg match gfc_match_symbol (gfc_symbol **, int);
     56      1.1  mrg match gfc_match_sym_tree (gfc_symtree **, int);
     57      1.1  mrg match gfc_match_intrinsic_op (gfc_intrinsic_op *);
     58      1.1  mrg match gfc_match_char (char);
     59      1.1  mrg match gfc_match (const char *, ...);
     60      1.1  mrg match gfc_match_iterator (gfc_iterator *, int);
     61      1.1  mrg match gfc_match_parens (void);
     62      1.1  mrg match gfc_match_type_spec (gfc_typespec *);
     63      1.1  mrg match gfc_match_member_sep(gfc_symbol *);
     64      1.1  mrg 
     65      1.1  mrg 
     66      1.1  mrg /* Statement matchers.  */
     67      1.1  mrg match gfc_match_program (void);
     68      1.1  mrg match gfc_match_pointer_assignment (void);
     69      1.1  mrg match gfc_match_assignment (void);
     70      1.1  mrg match gfc_match_if (gfc_statement *);
     71      1.1  mrg match gfc_match_else (void);
     72      1.1  mrg match gfc_match_elseif (void);
     73      1.1  mrg match gfc_match_event_post (void);
     74      1.1  mrg match gfc_match_event_wait (void);
     75      1.1  mrg match gfc_match_critical (void);
     76      1.1  mrg match gfc_match_fail_image (void);
     77      1.1  mrg match gfc_match_change_team (void);
     78      1.1  mrg match gfc_match_end_team (void);
     79      1.1  mrg match gfc_match_form_team (void);
     80      1.1  mrg match gfc_match_sync_team (void);
     81      1.1  mrg match gfc_match_block (void);
     82      1.1  mrg match gfc_match_associate (void);
     83      1.1  mrg match gfc_match_do (void);
     84      1.1  mrg match gfc_match_cycle (void);
     85      1.1  mrg match gfc_match_exit (void);
     86      1.1  mrg match gfc_match_lock (void);
     87      1.1  mrg match gfc_match_pause (void);
     88      1.1  mrg match gfc_match_stop (void);
     89      1.1  mrg match gfc_match_error_stop (void);
     90      1.1  mrg match gfc_match_continue (void);
     91      1.1  mrg match gfc_match_assign (void);
     92      1.1  mrg match gfc_match_goto (void);
     93      1.1  mrg match gfc_match_sync_all (void);
     94      1.1  mrg match gfc_match_sync_images (void);
     95      1.1  mrg match gfc_match_sync_memory (void);
     96      1.1  mrg match gfc_match_unlock (void);
     97      1.1  mrg 
     98      1.1  mrg match gfc_match_allocate (void);
     99      1.1  mrg match gfc_match_nullify (void);
    100      1.1  mrg match gfc_match_deallocate (void);
    101      1.1  mrg match gfc_match_return (void);
    102      1.1  mrg match gfc_match_call (void);
    103      1.1  mrg 
    104      1.1  mrg /* We want to use this function to check for a common-block-name
    105      1.1  mrg    that can exist in a bind statement, so removed the "static"
    106      1.1  mrg    declaration of the function in match.c.
    107      1.1  mrg 
    108      1.1  mrg    TODO: should probably rename this now that it'll be globally seen to
    109      1.1  mrg    gfc_match_common_name.  */
    110      1.1  mrg match match_common_name (char *name);
    111      1.1  mrg 
    112      1.1  mrg match gfc_match_common (void);
    113      1.1  mrg match gfc_match_block_data (void);
    114      1.1  mrg match gfc_match_namelist (void);
    115      1.1  mrg match gfc_match_module (void);
    116      1.1  mrg match gfc_match_equivalence (void);
    117      1.1  mrg match gfc_match_st_function (void);
    118      1.1  mrg match gfc_match_ptr_fcn_assign (void);
    119      1.1  mrg match gfc_match_case (void);
    120      1.1  mrg match gfc_match_select (void);
    121      1.1  mrg match gfc_match_select_type (void);
    122      1.1  mrg match gfc_match_type_is (void);
    123      1.1  mrg match gfc_match_class_is (void);
    124  1.1.1.2  mrg match gfc_match_select_rank (void);
    125  1.1.1.2  mrg match gfc_match_rank_is (void);
    126      1.1  mrg match gfc_match_where (gfc_statement *);
    127      1.1  mrg match gfc_match_elsewhere (void);
    128      1.1  mrg match gfc_match_forall (gfc_statement *);
    129      1.1  mrg 
    130      1.1  mrg /* Other functions.  */
    131      1.1  mrg 
    132      1.1  mrg gfc_common_head *gfc_get_common (const char *, int);
    133      1.1  mrg 
    134      1.1  mrg /* openmp.c.  */
    135      1.1  mrg 
    136      1.1  mrg /* OpenACC directive matchers.  */
    137      1.1  mrg match gfc_match_oacc_atomic (void);
    138      1.1  mrg match gfc_match_oacc_cache (void);
    139      1.1  mrg match gfc_match_oacc_wait (void);
    140      1.1  mrg match gfc_match_oacc_update (void);
    141      1.1  mrg match gfc_match_oacc_declare (void);
    142      1.1  mrg match gfc_match_oacc_loop (void);
    143      1.1  mrg match gfc_match_oacc_host_data (void);
    144      1.1  mrg match gfc_match_oacc_data (void);
    145      1.1  mrg match gfc_match_oacc_kernels (void);
    146      1.1  mrg match gfc_match_oacc_kernels_loop (void);
    147      1.1  mrg match gfc_match_oacc_parallel (void);
    148      1.1  mrg match gfc_match_oacc_parallel_loop (void);
    149  1.1.1.2  mrg match gfc_match_oacc_serial (void);
    150  1.1.1.2  mrg match gfc_match_oacc_serial_loop (void);
    151      1.1  mrg match gfc_match_oacc_enter_data (void);
    152      1.1  mrg match gfc_match_oacc_exit_data (void);
    153      1.1  mrg match gfc_match_oacc_routine (void);
    154      1.1  mrg 
    155      1.1  mrg /* OpenMP directive matchers.  */
    156  1.1.1.2  mrg match gfc_match_omp_eos_error (void);
    157      1.1  mrg match gfc_match_omp_atomic (void);
    158      1.1  mrg match gfc_match_omp_barrier (void);
    159      1.1  mrg match gfc_match_omp_cancel (void);
    160      1.1  mrg match gfc_match_omp_cancellation_point (void);
    161      1.1  mrg match gfc_match_omp_critical (void);
    162      1.1  mrg match gfc_match_omp_declare_reduction (void);
    163      1.1  mrg match gfc_match_omp_declare_simd (void);
    164      1.1  mrg match gfc_match_omp_declare_target (void);
    165      1.1  mrg match gfc_match_omp_distribute (void);
    166      1.1  mrg match gfc_match_omp_distribute_parallel_do (void);
    167      1.1  mrg match gfc_match_omp_distribute_parallel_do_simd (void);
    168      1.1  mrg match gfc_match_omp_distribute_simd (void);
    169      1.1  mrg match gfc_match_omp_do (void);
    170      1.1  mrg match gfc_match_omp_do_simd (void);
    171      1.1  mrg match gfc_match_omp_flush (void);
    172      1.1  mrg match gfc_match_omp_master (void);
    173      1.1  mrg match gfc_match_omp_ordered (void);
    174      1.1  mrg match gfc_match_omp_ordered_depend (void);
    175      1.1  mrg match gfc_match_omp_parallel (void);
    176      1.1  mrg match gfc_match_omp_parallel_do (void);
    177      1.1  mrg match gfc_match_omp_parallel_do_simd (void);
    178      1.1  mrg match gfc_match_omp_parallel_sections (void);
    179      1.1  mrg match gfc_match_omp_parallel_workshare (void);
    180      1.1  mrg match gfc_match_omp_sections (void);
    181      1.1  mrg match gfc_match_omp_simd (void);
    182      1.1  mrg match gfc_match_omp_single (void);
    183      1.1  mrg match gfc_match_omp_target (void);
    184      1.1  mrg match gfc_match_omp_target_data (void);
    185      1.1  mrg match gfc_match_omp_target_enter_data (void);
    186      1.1  mrg match gfc_match_omp_target_exit_data (void);
    187      1.1  mrg match gfc_match_omp_target_parallel (void);
    188      1.1  mrg match gfc_match_omp_target_parallel_do (void);
    189      1.1  mrg match gfc_match_omp_target_parallel_do_simd (void);
    190      1.1  mrg match gfc_match_omp_target_simd (void);
    191      1.1  mrg match gfc_match_omp_target_teams (void);
    192      1.1  mrg match gfc_match_omp_target_teams_distribute (void);
    193      1.1  mrg match gfc_match_omp_target_teams_distribute_parallel_do (void);
    194      1.1  mrg match gfc_match_omp_target_teams_distribute_parallel_do_simd (void);
    195      1.1  mrg match gfc_match_omp_target_teams_distribute_simd (void);
    196      1.1  mrg match gfc_match_omp_target_update (void);
    197      1.1  mrg match gfc_match_omp_task (void);
    198      1.1  mrg match gfc_match_omp_taskgroup (void);
    199      1.1  mrg match gfc_match_omp_taskloop (void);
    200      1.1  mrg match gfc_match_omp_taskloop_simd (void);
    201      1.1  mrg match gfc_match_omp_taskwait (void);
    202      1.1  mrg match gfc_match_omp_taskyield (void);
    203      1.1  mrg match gfc_match_omp_teams (void);
    204      1.1  mrg match gfc_match_omp_teams_distribute (void);
    205      1.1  mrg match gfc_match_omp_teams_distribute_parallel_do (void);
    206      1.1  mrg match gfc_match_omp_teams_distribute_parallel_do_simd (void);
    207      1.1  mrg match gfc_match_omp_teams_distribute_simd (void);
    208      1.1  mrg match gfc_match_omp_threadprivate (void);
    209      1.1  mrg match gfc_match_omp_workshare (void);
    210      1.1  mrg match gfc_match_omp_end_critical (void);
    211      1.1  mrg match gfc_match_omp_end_nowait (void);
    212      1.1  mrg match gfc_match_omp_end_single (void);
    213      1.1  mrg 
    214      1.1  mrg /* decl.c.  */
    215      1.1  mrg 
    216      1.1  mrg match gfc_match_data (void);
    217      1.1  mrg match gfc_match_null (gfc_expr **);
    218      1.1  mrg match gfc_match_kind_spec (gfc_typespec *, bool);
    219      1.1  mrg match gfc_match_old_kind_spec (gfc_typespec *);
    220      1.1  mrg match gfc_match_decl_type_spec (gfc_typespec *, int);
    221      1.1  mrg 
    222      1.1  mrg match gfc_match_end (gfc_statement *);
    223      1.1  mrg match gfc_match_data_decl (void);
    224      1.1  mrg match gfc_match_formal_arglist (gfc_symbol *, int, int, bool = false);
    225      1.1  mrg match gfc_match_procedure (void);
    226      1.1  mrg match gfc_match_generic (void);
    227      1.1  mrg match gfc_match_function_decl (void);
    228      1.1  mrg match gfc_match_entry (void);
    229      1.1  mrg match gfc_match_subroutine (void);
    230      1.1  mrg match gfc_match_submod_proc (void);
    231      1.1  mrg match gfc_match_map (void);
    232      1.1  mrg match gfc_match_union (void);
    233      1.1  mrg match gfc_match_structure_decl (void);
    234      1.1  mrg match gfc_match_derived_decl (void);
    235      1.1  mrg match gfc_match_final_decl (void);
    236      1.1  mrg match gfc_match_type (gfc_statement *);
    237      1.1  mrg 
    238      1.1  mrg match gfc_match_implicit_none (void);
    239      1.1  mrg match gfc_match_implicit (void);
    240      1.1  mrg 
    241      1.1  mrg void gfc_set_constant_character_len (gfc_charlen_t, gfc_expr *,
    242      1.1  mrg 				     gfc_charlen_t);
    243      1.1  mrg 
    244      1.1  mrg /* Matchers for attribute declarations.  */
    245      1.1  mrg match gfc_match_allocatable (void);
    246      1.1  mrg match gfc_match_asynchronous (void);
    247      1.1  mrg match gfc_match_automatic (void);
    248      1.1  mrg match gfc_match_codimension (void);
    249      1.1  mrg match gfc_match_contiguous (void);
    250      1.1  mrg match gfc_match_dimension (void);
    251      1.1  mrg match gfc_match_external (void);
    252      1.1  mrg match gfc_match_gcc_attributes (void);
    253      1.1  mrg match gfc_match_gcc_builtin (void);
    254      1.1  mrg match gfc_match_gcc_ivdep (void);
    255      1.1  mrg match gfc_match_gcc_novector (void);
    256      1.1  mrg match gfc_match_gcc_unroll (void);
    257      1.1  mrg match gfc_match_gcc_vector (void);
    258      1.1  mrg match gfc_match_import (void);
    259      1.1  mrg match gfc_match_intent (void);
    260      1.1  mrg match gfc_match_intrinsic (void);
    261      1.1  mrg match gfc_match_optional (void);
    262      1.1  mrg match gfc_match_parameter (void);
    263      1.1  mrg match gfc_match_pointer (void);
    264      1.1  mrg match gfc_match_protected (void);
    265      1.1  mrg match gfc_match_private (gfc_statement *);
    266      1.1  mrg match gfc_match_public (gfc_statement *);
    267      1.1  mrg match gfc_match_save (void);
    268      1.1  mrg match gfc_match_static (void);
    269      1.1  mrg match gfc_match_modproc (void);
    270      1.1  mrg match gfc_match_target (void);
    271      1.1  mrg match gfc_match_value (void);
    272      1.1  mrg match gfc_match_volatile (void);
    273      1.1  mrg 
    274      1.1  mrg /* decl.c.  */
    275      1.1  mrg 
    276      1.1  mrg /* Fortran 2003 c interop.
    277      1.1  mrg    TODO: some of these should be moved to another file rather than decl.c */
    278      1.1  mrg void set_com_block_bind_c (gfc_common_head *, int);
    279      1.1  mrg bool set_verify_bind_c_sym (gfc_symbol *, int);
    280      1.1  mrg bool set_verify_bind_c_com_block (gfc_common_head *, int);
    281      1.1  mrg bool get_bind_c_idents (void);
    282      1.1  mrg match gfc_match_bind_c_stmt (void);
    283      1.1  mrg match gfc_match_suffix (gfc_symbol *, gfc_symbol **);
    284      1.1  mrg match gfc_match_bind_c (gfc_symbol *, bool);
    285      1.1  mrg match gfc_get_type_attr_spec (symbol_attribute *, char*);
    286      1.1  mrg 
    287      1.1  mrg /* primary.c.  */
    288      1.1  mrg match gfc_match_structure_constructor (gfc_symbol *, gfc_expr **);
    289      1.1  mrg match gfc_match_variable (gfc_expr **, int);
    290      1.1  mrg match gfc_match_equiv_variable (gfc_expr **);
    291      1.1  mrg match gfc_match_actual_arglist (int, gfc_actual_arglist **, bool = false);
    292      1.1  mrg match gfc_match_literal_constant (gfc_expr **, int);
    293      1.1  mrg 
    294      1.1  mrg /* expr.c -- FIXME: this one should be eliminated by moving the
    295      1.1  mrg    matcher to matchexp.c and a call to a new function in expr.c that
    296      1.1  mrg    only makes sure the init expr. is valid.  */
    297      1.1  mrg bool gfc_reduce_init_expr (gfc_expr *expr);
    298      1.1  mrg match gfc_match_init_expr (gfc_expr **);
    299      1.1  mrg 
    300      1.1  mrg /* array.c.  */
    301      1.1  mrg match gfc_match_array_spec (gfc_array_spec **, bool, bool);
    302      1.1  mrg match gfc_match_array_ref (gfc_array_ref *, gfc_array_spec *, int, int);
    303      1.1  mrg match gfc_match_array_constructor (gfc_expr **);
    304      1.1  mrg 
    305      1.1  mrg /* interface.c.  */
    306      1.1  mrg match gfc_match_abstract_interface (void);
    307      1.1  mrg match gfc_match_generic_spec (interface_type *, char *, gfc_intrinsic_op *);
    308      1.1  mrg match gfc_match_interface (void);
    309      1.1  mrg match gfc_match_end_interface (void);
    310      1.1  mrg 
    311      1.1  mrg /* io.c.  */
    312      1.1  mrg match gfc_match_format (void);
    313      1.1  mrg match gfc_match_open (void);
    314      1.1  mrg match gfc_match_close (void);
    315      1.1  mrg match gfc_match_endfile (void);
    316      1.1  mrg match gfc_match_backspace (void);
    317      1.1  mrg match gfc_match_rewind (void);
    318      1.1  mrg match gfc_match_flush (void);
    319      1.1  mrg match gfc_match_inquire (void);
    320      1.1  mrg match gfc_match_read (void);
    321      1.1  mrg match gfc_match_wait (void);
    322      1.1  mrg match gfc_match_write (void);
    323      1.1  mrg match gfc_match_print (void);
    324      1.1  mrg 
    325      1.1  mrg /* matchexp.c.  */
    326      1.1  mrg match gfc_match_defined_op_name (char *, int);
    327      1.1  mrg match gfc_match_expr (gfc_expr **);
    328      1.1  mrg 
    329      1.1  mrg /* module.c.  */
    330      1.1  mrg match gfc_match_use (void);
    331      1.1  mrg match gfc_match_submodule (void);
    332      1.1  mrg void gfc_use_modules (void);
    333      1.1  mrg 
    334      1.1  mrg #endif  /* GFC_MATCH_H  */
    335      1.1  mrg 
    336