1 |
285 |
jeremybenn |
/* All matcher functions.
|
2 |
|
|
Copyright (C) 2003, 2005, 2007, 2008, 2010
|
3 |
|
|
Free Software Foundation, Inc.
|
4 |
|
|
Contributed by Steven Bosscher
|
5 |
|
|
|
6 |
|
|
This file is part of GCC.
|
7 |
|
|
|
8 |
|
|
GCC is free software; you can redistribute it and/or modify it under
|
9 |
|
|
the terms of the GNU General Public License as published by the Free
|
10 |
|
|
Software Foundation; either version 3, or (at your option) any later
|
11 |
|
|
version.
|
12 |
|
|
|
13 |
|
|
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
14 |
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
15 |
|
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
16 |
|
|
for more details.
|
17 |
|
|
|
18 |
|
|
You should have received a copy of the GNU General Public License
|
19 |
|
|
along with GCC; see the file COPYING3. If not see
|
20 |
|
|
<http://www.gnu.org/licenses/>. */
|
21 |
|
|
|
22 |
|
|
|
23 |
|
|
#ifndef GFC_MATCH_H
|
24 |
|
|
#define GFC_MATCH_H
|
25 |
|
|
|
26 |
|
|
#include "gfortran.h"
|
27 |
|
|
|
28 |
|
|
/* gfc_new_block points to the symbol of a newly matched block. */
|
29 |
|
|
extern gfc_symbol *gfc_new_block;
|
30 |
|
|
|
31 |
|
|
/* Current statement label. Zero means no statement label. Because
|
32 |
|
|
new_st can get wiped during statement matching, we have to keep it
|
33 |
|
|
separate. */
|
34 |
|
|
extern gfc_st_label *gfc_statement_label;
|
35 |
|
|
|
36 |
|
|
extern int gfc_matching_procptr_assignment;
|
37 |
|
|
extern bool gfc_matching_prefix;
|
38 |
|
|
|
39 |
|
|
/* Default access specifier while matching procedure bindings. */
|
40 |
|
|
extern gfc_access gfc_typebound_default_access;
|
41 |
|
|
|
42 |
|
|
/****************** All gfc_match* routines *****************/
|
43 |
|
|
|
44 |
|
|
/* match.c. */
|
45 |
|
|
|
46 |
|
|
/* Generic match subroutines. */
|
47 |
|
|
match gfc_match_special_char (gfc_char_t *);
|
48 |
|
|
match gfc_match_space (void);
|
49 |
|
|
match gfc_match_eos (void);
|
50 |
|
|
match gfc_match_small_literal_int (int *, int *);
|
51 |
|
|
match gfc_match_st_label (gfc_st_label **);
|
52 |
|
|
match gfc_match_label (void);
|
53 |
|
|
match gfc_match_small_int (int *);
|
54 |
|
|
match gfc_match_small_int_expr (int *, gfc_expr **);
|
55 |
|
|
match gfc_match_name (char *);
|
56 |
|
|
match gfc_match_name_C (char *buffer);
|
57 |
|
|
match gfc_match_symbol (gfc_symbol **, int);
|
58 |
|
|
match gfc_match_sym_tree (gfc_symtree **, int);
|
59 |
|
|
match gfc_match_intrinsic_op (gfc_intrinsic_op *);
|
60 |
|
|
match gfc_match_char (char);
|
61 |
|
|
match gfc_match (const char *, ...);
|
62 |
|
|
match gfc_match_iterator (gfc_iterator *, int);
|
63 |
|
|
match gfc_match_parens (void);
|
64 |
|
|
|
65 |
|
|
/* Statement matchers. */
|
66 |
|
|
match gfc_match_program (void);
|
67 |
|
|
match gfc_match_pointer_assignment (void);
|
68 |
|
|
match gfc_match_assignment (void);
|
69 |
|
|
match gfc_match_if (gfc_statement *);
|
70 |
|
|
match gfc_match_else (void);
|
71 |
|
|
match gfc_match_elseif (void);
|
72 |
|
|
match gfc_match_block (void);
|
73 |
|
|
match gfc_match_do (void);
|
74 |
|
|
match gfc_match_cycle (void);
|
75 |
|
|
match gfc_match_exit (void);
|
76 |
|
|
match gfc_match_pause (void);
|
77 |
|
|
match gfc_match_stop (void);
|
78 |
|
|
match gfc_match_continue (void);
|
79 |
|
|
match gfc_match_assign (void);
|
80 |
|
|
match gfc_match_goto (void);
|
81 |
|
|
|
82 |
|
|
match gfc_match_allocate (void);
|
83 |
|
|
match gfc_match_nullify (void);
|
84 |
|
|
match gfc_match_deallocate (void);
|
85 |
|
|
match gfc_match_return (void);
|
86 |
|
|
match gfc_match_call (void);
|
87 |
|
|
|
88 |
|
|
/* We want to use this function to check for a common-block-name
|
89 |
|
|
that can exist in a bind statement, so removed the "static"
|
90 |
|
|
declaration of the function in match.c.
|
91 |
|
|
|
92 |
|
|
TODO: should probably rename this now that it'll be globally seen to
|
93 |
|
|
gfc_match_common_name. */
|
94 |
|
|
match match_common_name (char *name);
|
95 |
|
|
|
96 |
|
|
match gfc_match_common (void);
|
97 |
|
|
match gfc_match_block_data (void);
|
98 |
|
|
match gfc_match_namelist (void);
|
99 |
|
|
match gfc_match_module (void);
|
100 |
|
|
match gfc_match_equivalence (void);
|
101 |
|
|
match gfc_match_st_function (void);
|
102 |
|
|
match gfc_match_case (void);
|
103 |
|
|
match gfc_match_select (void);
|
104 |
|
|
match gfc_match_select_type (void);
|
105 |
|
|
match gfc_match_type_is (void);
|
106 |
|
|
match gfc_match_class_is (void);
|
107 |
|
|
match gfc_match_where (gfc_statement *);
|
108 |
|
|
match gfc_match_elsewhere (void);
|
109 |
|
|
match gfc_match_forall (gfc_statement *);
|
110 |
|
|
|
111 |
|
|
/* Other functions. */
|
112 |
|
|
|
113 |
|
|
gfc_common_head *gfc_get_common (const char *, int);
|
114 |
|
|
|
115 |
|
|
/* openmp.c. */
|
116 |
|
|
|
117 |
|
|
/* OpenMP directive matchers. */
|
118 |
|
|
match gfc_match_omp_eos (void);
|
119 |
|
|
match gfc_match_omp_atomic (void);
|
120 |
|
|
match gfc_match_omp_barrier (void);
|
121 |
|
|
match gfc_match_omp_critical (void);
|
122 |
|
|
match gfc_match_omp_do (void);
|
123 |
|
|
match gfc_match_omp_flush (void);
|
124 |
|
|
match gfc_match_omp_master (void);
|
125 |
|
|
match gfc_match_omp_ordered (void);
|
126 |
|
|
match gfc_match_omp_parallel (void);
|
127 |
|
|
match gfc_match_omp_parallel_do (void);
|
128 |
|
|
match gfc_match_omp_parallel_sections (void);
|
129 |
|
|
match gfc_match_omp_parallel_workshare (void);
|
130 |
|
|
match gfc_match_omp_sections (void);
|
131 |
|
|
match gfc_match_omp_single (void);
|
132 |
|
|
match gfc_match_omp_task (void);
|
133 |
|
|
match gfc_match_omp_taskwait (void);
|
134 |
|
|
match gfc_match_omp_threadprivate (void);
|
135 |
|
|
match gfc_match_omp_workshare (void);
|
136 |
|
|
match gfc_match_omp_end_nowait (void);
|
137 |
|
|
match gfc_match_omp_end_single (void);
|
138 |
|
|
|
139 |
|
|
/* decl.c. */
|
140 |
|
|
|
141 |
|
|
match gfc_match_data (void);
|
142 |
|
|
match gfc_match_null (gfc_expr **);
|
143 |
|
|
match gfc_match_kind_spec (gfc_typespec *, bool);
|
144 |
|
|
match gfc_match_old_kind_spec (gfc_typespec *);
|
145 |
|
|
match gfc_match_decl_type_spec (gfc_typespec *, int);
|
146 |
|
|
|
147 |
|
|
match gfc_match_end (gfc_statement *);
|
148 |
|
|
match gfc_match_data_decl (void);
|
149 |
|
|
match gfc_match_formal_arglist (gfc_symbol *, int, int);
|
150 |
|
|
match gfc_match_procedure (void);
|
151 |
|
|
match gfc_match_generic (void);
|
152 |
|
|
match gfc_match_function_decl (void);
|
153 |
|
|
match gfc_match_entry (void);
|
154 |
|
|
match gfc_match_subroutine (void);
|
155 |
|
|
match gfc_match_derived_decl (void);
|
156 |
|
|
match gfc_match_final_decl (void);
|
157 |
|
|
|
158 |
|
|
match gfc_match_implicit_none (void);
|
159 |
|
|
match gfc_match_implicit (void);
|
160 |
|
|
|
161 |
|
|
void gfc_set_constant_character_len (int, gfc_expr *, int);
|
162 |
|
|
|
163 |
|
|
/* Matchers for attribute declarations. */
|
164 |
|
|
match gfc_match_allocatable (void);
|
165 |
|
|
match gfc_match_asynchronous (void);
|
166 |
|
|
match gfc_match_dimension (void);
|
167 |
|
|
match gfc_match_external (void);
|
168 |
|
|
match gfc_match_gcc_attributes (void);
|
169 |
|
|
match gfc_match_import (void);
|
170 |
|
|
match gfc_match_intent (void);
|
171 |
|
|
match gfc_match_intrinsic (void);
|
172 |
|
|
match gfc_match_optional (void);
|
173 |
|
|
match gfc_match_parameter (void);
|
174 |
|
|
match gfc_match_pointer (void);
|
175 |
|
|
match gfc_match_protected (void);
|
176 |
|
|
match gfc_match_private (gfc_statement *);
|
177 |
|
|
match gfc_match_public (gfc_statement *);
|
178 |
|
|
match gfc_match_save (void);
|
179 |
|
|
match gfc_match_modproc (void);
|
180 |
|
|
match gfc_match_target (void);
|
181 |
|
|
match gfc_match_value (void);
|
182 |
|
|
match gfc_match_volatile (void);
|
183 |
|
|
|
184 |
|
|
/* decl.c. */
|
185 |
|
|
|
186 |
|
|
/* Fortran 2003 c interop.
|
187 |
|
|
TODO: some of these should be moved to another file rather than decl.c */
|
188 |
|
|
void set_com_block_bind_c (gfc_common_head *, int);
|
189 |
|
|
gfc_try set_binding_label (char *, const char *, int);
|
190 |
|
|
gfc_try set_verify_bind_c_sym (gfc_symbol *, int);
|
191 |
|
|
gfc_try set_verify_bind_c_com_block (gfc_common_head *, int);
|
192 |
|
|
gfc_try get_bind_c_idents (void);
|
193 |
|
|
match gfc_match_bind_c_stmt (void);
|
194 |
|
|
match gfc_match_suffix (gfc_symbol *, gfc_symbol **);
|
195 |
|
|
match gfc_match_bind_c (gfc_symbol *, bool);
|
196 |
|
|
match gfc_get_type_attr_spec (symbol_attribute *, char*);
|
197 |
|
|
|
198 |
|
|
/* primary.c. */
|
199 |
|
|
match gfc_match_structure_constructor (gfc_symbol *, gfc_expr **, bool);
|
200 |
|
|
match gfc_match_variable (gfc_expr **, int);
|
201 |
|
|
match gfc_match_equiv_variable (gfc_expr **);
|
202 |
|
|
match gfc_match_actual_arglist (int, gfc_actual_arglist **);
|
203 |
|
|
match gfc_match_literal_constant (gfc_expr **, int);
|
204 |
|
|
|
205 |
|
|
/* expr.c -- FIXME: this one should be eliminated by moving the
|
206 |
|
|
matcher to matchexp.c and a call to a new function in expr.c that
|
207 |
|
|
only makes sure the init expr. is valid. */
|
208 |
|
|
gfc_try gfc_reduce_init_expr (gfc_expr *expr);
|
209 |
|
|
match gfc_match_init_expr (gfc_expr **);
|
210 |
|
|
|
211 |
|
|
/* array.c. */
|
212 |
|
|
match gfc_match_array_spec (gfc_array_spec **);
|
213 |
|
|
match gfc_match_array_ref (gfc_array_ref *, gfc_array_spec *, int);
|
214 |
|
|
match gfc_match_array_constructor (gfc_expr **);
|
215 |
|
|
|
216 |
|
|
/* interface.c. */
|
217 |
|
|
match gfc_match_abstract_interface (void);
|
218 |
|
|
match gfc_match_generic_spec (interface_type *, char *, gfc_intrinsic_op *);
|
219 |
|
|
match gfc_match_interface (void);
|
220 |
|
|
match gfc_match_end_interface (void);
|
221 |
|
|
|
222 |
|
|
/* io.c. */
|
223 |
|
|
match gfc_match_format (void);
|
224 |
|
|
match gfc_match_open (void);
|
225 |
|
|
match gfc_match_close (void);
|
226 |
|
|
match gfc_match_endfile (void);
|
227 |
|
|
match gfc_match_backspace (void);
|
228 |
|
|
match gfc_match_rewind (void);
|
229 |
|
|
match gfc_match_flush (void);
|
230 |
|
|
match gfc_match_inquire (void);
|
231 |
|
|
match gfc_match_read (void);
|
232 |
|
|
match gfc_match_wait (void);
|
233 |
|
|
match gfc_match_write (void);
|
234 |
|
|
match gfc_match_print (void);
|
235 |
|
|
|
236 |
|
|
/* matchexp.c. */
|
237 |
|
|
match gfc_match_defined_op_name (char *, int);
|
238 |
|
|
match gfc_match_expr (gfc_expr **);
|
239 |
|
|
|
240 |
|
|
/* module.c. */
|
241 |
|
|
match gfc_match_use (void);
|
242 |
|
|
void gfc_use_module (void);
|
243 |
|
|
|
244 |
|
|
#endif /* GFC_MATCH_H */
|
245 |
|
|
|