111
|
1 /* Parser header
|
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_PARSE_H
|
|
23 #define GFC_PARSE_H
|
|
24
|
|
25 /* Enum for what the compiler is currently doing. */
|
|
26 enum gfc_compile_state
|
|
27 {
|
|
28 COMP_NONE, COMP_PROGRAM, COMP_MODULE, COMP_SUBMODULE, COMP_SUBROUTINE,
|
|
29 COMP_FUNCTION, COMP_BLOCK_DATA, COMP_INTERFACE, COMP_DERIVED,
|
|
30 COMP_DERIVED_CONTAINS, COMP_BLOCK, COMP_ASSOCIATE, COMP_IF,
|
|
31 COMP_STRUCTURE, COMP_UNION, COMP_MAP,
|
|
32 COMP_DO, COMP_SELECT, COMP_FORALL, COMP_WHERE, COMP_CONTAINS, COMP_ENUM,
|
145
|
33 COMP_SELECT_TYPE, COMP_SELECT_RANK, COMP_OMP_STRUCTURED_BLOCK, COMP_CRITICAL,
|
|
34 COMP_DO_CONCURRENT
|
111
|
35 };
|
|
36
|
|
37 /* Stack element for the current compilation state. These structures
|
|
38 are allocated as automatic variables. */
|
|
39 typedef struct gfc_state_data
|
|
40 {
|
|
41 gfc_compile_state state;
|
|
42 gfc_symbol *sym; /* Block name associated with this level */
|
|
43 gfc_symtree *do_variable; /* For DO blocks the iterator variable. */
|
|
44
|
|
45 struct gfc_code *construct;
|
|
46 struct gfc_code *head, *tail;
|
|
47 struct gfc_state_data *previous;
|
|
48
|
|
49 /* Block-specific state data. */
|
|
50 union
|
|
51 {
|
|
52 gfc_st_label *end_do_label;
|
|
53 gfc_oacc_declare *oacc_declare_clauses;
|
|
54 }
|
|
55 ext;
|
|
56 }
|
|
57 gfc_state_data;
|
|
58
|
|
59 extern gfc_state_data *gfc_state_stack;
|
|
60
|
|
61 #define gfc_current_block() (gfc_state_stack->sym)
|
|
62 #define gfc_current_state() (gfc_state_stack->state)
|
|
63 #define gfc_comp_struct(s) \
|
|
64 ((s) == COMP_DERIVED || (s) == COMP_STRUCTURE || (s) == COMP_MAP)
|
|
65
|
|
66 int gfc_check_do_variable (gfc_symtree *);
|
|
67 bool gfc_find_state (gfc_compile_state);
|
|
68 gfc_state_data *gfc_enclosing_unit (gfc_compile_state *);
|
|
69 const char *gfc_ascii_statement (gfc_statement);
|
|
70 match gfc_match_enum (void);
|
|
71 match gfc_match_enumerator_def (void);
|
|
72 void gfc_free_enum_history (void);
|
|
73 extern bool gfc_matching_function;
|
|
74 match gfc_match_prefix (gfc_typespec *);
|
|
75 bool is_oacc (gfc_state_data *);
|
|
76 #endif /* GFC_PARSE_H */
|