match.h 5.29 KB
Newer Older
dnovillo's avatar
 
dnovillo committed
1
/* All matcher functions.
2
   Copyright (C) 2003, 2005 Free Software Foundation, Inc.
dnovillo's avatar
 
dnovillo committed
3 4
   Contributed by Steven Bosscher

5
This file is part of GCC.
dnovillo's avatar
 
dnovillo committed
6

7 8 9 10
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2, or (at your option) any later
version.
dnovillo's avatar
 
dnovillo committed
11

12 13 14 15
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.
dnovillo's avatar
 
dnovillo committed
16 17

You should have received a copy of the GNU General Public License
18
along with GCC; see the file COPYING.  If not, write to the Free
kcook's avatar
kcook committed
19 20
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.  */
dnovillo's avatar
 
dnovillo committed
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43


#ifndef GFC_MATCH_H
#define GFC_MATCH_H

#include "gfortran.h"

/* gfc_new_block points to the symbol of a newly matched block.  */
extern gfc_symbol *gfc_new_block;

/* Current statement label.  Zero means no statement label.  Because
   new_st can get wiped during statement matching, we have to keep it
   separate.  */
extern gfc_st_label *gfc_statement_label;

/****************** All gfc_match* routines *****************/

/* match.c */

/* Generic match subroutines */
match gfc_match_space (void);
match gfc_match_eos (void);
match gfc_match_small_literal_int (int *);
fxcoudert's avatar
fxcoudert committed
44
match gfc_match_st_label (gfc_st_label **);
dnovillo's avatar
 
dnovillo committed
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
match gfc_match_label (void);
match gfc_match_small_int (int *);
int gfc_match_strings (mstring *);
match gfc_match_name (char *);
match gfc_match_symbol (gfc_symbol **, int);
match gfc_match_sym_tree (gfc_symtree **, int);
match gfc_match_intrinsic_op (gfc_intrinsic_op *);
match gfc_match_char (char);
match gfc_match (const char *, ...);
match gfc_match_iterator (gfc_iterator *, int);

/* Statement matchers */
match gfc_match_program (void);
match gfc_match_pointer_assignment (void);
match gfc_match_assignment (void);
match gfc_match_if (gfc_statement *);
match gfc_match_else (void);
match gfc_match_elseif (void);
match gfc_match_do (void);
match gfc_match_cycle (void);
match gfc_match_exit (void);
match gfc_match_pause (void);
match gfc_match_stop (void);
match gfc_match_continue (void);
match gfc_match_assign (void);
match gfc_match_goto (void);

match gfc_match_allocate (void);
match gfc_match_nullify (void);
match gfc_match_deallocate (void);
match gfc_match_return (void);
match gfc_match_call (void);
match gfc_match_common (void);
match gfc_match_block_data (void);
match gfc_match_namelist (void);
match gfc_match_module (void);
match gfc_match_equivalence (void);
match gfc_match_st_function (void);
match gfc_match_case (void);
match gfc_match_select (void);
match gfc_match_where (gfc_statement *);
match gfc_match_elsewhere (void);
match gfc_match_forall (gfc_statement *);

89 90
/* Other functions.  */

tobi's avatar
tobi committed
91
gfc_common_head *gfc_get_common (const char *, int);
92

dnovillo's avatar
 
dnovillo committed
93 94
/* decl.c */

tobi's avatar
tobi committed
95
match gfc_match_data (void);
dnovillo's avatar
 
dnovillo committed
96 97 98 99 100 101 102 103 104 105 106 107
match gfc_match_null (gfc_expr **);
match gfc_match_kind_spec (gfc_typespec *);
match gfc_match_old_kind_spec (gfc_typespec *);

match gfc_match_end (gfc_statement *);
match gfc_match_data_decl (void);
match gfc_match_formal_arglist (gfc_symbol *, int, int);
match gfc_match_function_decl (void);
match gfc_match_entry (void);
match gfc_match_subroutine (void);
match gfc_match_derived_decl (void);

tobi's avatar
tobi committed
108 109 110
match gfc_match_implicit_none (void);
match gfc_match_implicit (void);

111 112
void gfc_set_constant_character_len (int, gfc_expr *);

dnovillo's avatar
 
dnovillo committed
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
/* Matchers for attribute declarations */
match gfc_match_allocatable (void);
match gfc_match_dimension (void);
match gfc_match_external (void);
match gfc_match_intent (void);
match gfc_match_intrinsic (void);
match gfc_match_optional (void);
match gfc_match_parameter (void);
match gfc_match_pointer (void);
match gfc_match_private (gfc_statement *);
match gfc_match_public (gfc_statement *);
match gfc_match_save (void);
match gfc_match_modproc (void);
match gfc_match_target (void);

/* primary.c */
tobi's avatar
tobi committed
129
match gfc_match_structure_constructor (gfc_symbol *, gfc_expr **);
dnovillo's avatar
 
dnovillo committed
130 131
match gfc_match_rvalue (gfc_expr **);
match gfc_match_variable (gfc_expr **, int);
132
match gfc_match_equiv_variable (gfc_expr **);
dnovillo's avatar
 
dnovillo committed
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157
match gfc_match_actual_arglist (int, gfc_actual_arglist **);
match gfc_match_literal_constant (gfc_expr **, int);

/* expr.c -- FIXME: this one should be eliminated by moving the
   matcher to matchexp.c and a call to a new function in expr.c that
   only makes sure the init expr. is valid.  */
match gfc_match_init_expr (gfc_expr **);

/* array.c */
match gfc_match_array_spec (gfc_array_spec **);
match gfc_match_array_ref (gfc_array_ref *, gfc_array_spec *, int);
match gfc_match_array_constructor (gfc_expr **);

/* interface.c */
match gfc_match_generic_spec (interface_type *, char *, gfc_intrinsic_op *);
match gfc_match_interface (void);
match gfc_match_end_interface (void);

/* io.c  */
match gfc_match_format (void);
match gfc_match_open (void);
match gfc_match_close (void);
match gfc_match_endfile (void);
match gfc_match_backspace (void);
match gfc_match_rewind (void);
158
match gfc_match_flush (void);
dnovillo's avatar
 
dnovillo committed
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
match gfc_match_inquire (void);
match gfc_match_read (void);
match gfc_match_write (void);
match gfc_match_print (void);

/* matchexp.c */
match gfc_match_defined_op_name (char *, int);
match gfc_match_expr (gfc_expr **);

/* module.c */
match gfc_match_use (void);
void gfc_use_module (void);

#endif  /* GFC_MATCH_H  */