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