]>
Commit | Line | Data |
---|---|---|
6de9cd9a | 1 | /* Parser header |
6441eb6d | 2 | Copyright (C) 2003-2025 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_PARSE_H | |
23 | #define GFC_PARSE_H | |
24 | ||
6de9cd9a | 25 | /* Enum for what the compiler is currently doing. */ |
a79683d5 | 26 | enum gfc_compile_state |
6de9cd9a | 27 | { |
4668d6f9 PT |
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, | |
f6288c24 | 31 | COMP_STRUCTURE, COMP_UNION, COMP_MAP, |
30b608eb | 32 | COMP_DO, COMP_SELECT, COMP_FORALL, COMP_WHERE, COMP_CONTAINS, COMP_ENUM, |
70570ec1 | 33 | COMP_SELECT_TYPE, COMP_SELECT_RANK, COMP_OMP_STRUCTURED_BLOCK, COMP_CRITICAL, |
8fbccdb3 | 34 | COMP_DO_CONCURRENT, COMP_OMP_STRICTLY_STRUCTURED_BLOCK, |
8f4ee36b | 35 | COMP_OMP_METADIRECTIVE, COMP_OMP_BEGIN_METADIRECTIVE, COMP_CHANGE_TEAM |
a79683d5 | 36 | }; |
6de9cd9a DN |
37 | |
38 | /* Stack element for the current compilation state. These structures | |
39 | are allocated as automatic variables. */ | |
40 | typedef struct gfc_state_data | |
41 | { | |
42 | gfc_compile_state state; | |
43 | gfc_symbol *sym; /* Block name associated with this level */ | |
c9583ed2 TS |
44 | gfc_symtree *do_variable; /* For DO blocks the iterator variable. */ |
45 | ||
e5ca9693 | 46 | struct gfc_code *construct; |
6de9cd9a DN |
47 | struct gfc_code *head, *tail; |
48 | struct gfc_state_data *previous; | |
49 | ||
f7b529fa | 50 | /* Block-specific state data. */ |
6de9cd9a DN |
51 | union |
52 | { | |
53 | gfc_st_label *end_do_label; | |
dc7a8b4b | 54 | gfc_oacc_declare *oacc_declare_clauses; |
6de9cd9a DN |
55 | } |
56 | ext; | |
57 | } | |
58 | gfc_state_data; | |
59 | ||
60 | extern gfc_state_data *gfc_state_stack; | |
61 | ||
62 | #define gfc_current_block() (gfc_state_stack->sym) | |
63 | #define gfc_current_state() (gfc_state_stack->state) | |
f6288c24 FR |
64 | #define gfc_comp_struct(s) \ |
65 | ((s) == COMP_DERIVED || (s) == COMP_STRUCTURE || (s) == COMP_MAP) | |
6de9cd9a | 66 | |
c072df1a | 67 | bool gfc_check_do_variable (gfc_symtree *); |
524af0d6 | 68 | bool gfc_find_state (gfc_compile_state); |
6de9cd9a | 69 | gfc_state_data *gfc_enclosing_unit (gfc_compile_state *); |
e2a22843 | 70 | const char *gfc_ascii_statement (gfc_statement, bool strip_sentinel = false) ; |
8fbccdb3 | 71 | gfc_statement gfc_omp_end_stmt (gfc_statement, bool = true, bool = true); |
25d8f0a2 TS |
72 | match gfc_match_enum (void); |
73 | match gfc_match_enumerator_def (void); | |
74 | void gfc_free_enum_history (void); | |
1c8bcdf7 | 75 | extern bool gfc_matching_function; |
8fbccdb3 SL |
76 | extern bool gfc_matching_omp_context_selector; |
77 | extern bool gfc_in_omp_metadirective_body; | |
78 | extern int gfc_omp_metadirective_region_count; | |
79 | ||
1c8bcdf7 | 80 | match gfc_match_prefix (gfc_typespec *); |
41dbbb37 | 81 | bool is_oacc (gfc_state_data *); |
6de9cd9a | 82 | #endif /* GFC_PARSE_H */ |