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