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