annotate gcc/fortran/parse.h @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Parser header
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2 Copyright (C) 2003-2020 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
3 Contributed by Steven Bosscher
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 This file is part of GCC.
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 GCC is free software; you can redistribute it and/or modify it under
kono
parents:
diff changeset
8 the terms of the GNU General Public License as published by the Free
kono
parents:
diff changeset
9 Software Foundation; either version 3, or (at your option) any later
kono
parents:
diff changeset
10 version.
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
kono
parents:
diff changeset
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
kono
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
kono
parents:
diff changeset
15 for more details.
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
18 along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
19 <http://www.gnu.org/licenses/>. */
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22 #ifndef GFC_PARSE_H
kono
parents:
diff changeset
23 #define GFC_PARSE_H
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 /* Enum for what the compiler is currently doing. */
kono
parents:
diff changeset
26 enum gfc_compile_state
kono
parents:
diff changeset
27 {
kono
parents:
diff changeset
28 COMP_NONE, COMP_PROGRAM, COMP_MODULE, COMP_SUBMODULE, COMP_SUBROUTINE,
kono
parents:
diff changeset
29 COMP_FUNCTION, COMP_BLOCK_DATA, COMP_INTERFACE, COMP_DERIVED,
kono
parents:
diff changeset
30 COMP_DERIVED_CONTAINS, COMP_BLOCK, COMP_ASSOCIATE, COMP_IF,
kono
parents:
diff changeset
31 COMP_STRUCTURE, COMP_UNION, COMP_MAP,
kono
parents:
diff changeset
32 COMP_DO, COMP_SELECT, COMP_FORALL, COMP_WHERE, COMP_CONTAINS, COMP_ENUM,
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
33 COMP_SELECT_TYPE, COMP_SELECT_RANK, COMP_OMP_STRUCTURED_BLOCK, COMP_CRITICAL,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
34 COMP_DO_CONCURRENT
111
kono
parents:
diff changeset
35 };
kono
parents:
diff changeset
36
kono
parents:
diff changeset
37 /* Stack element for the current compilation state. These structures
kono
parents:
diff changeset
38 are allocated as automatic variables. */
kono
parents:
diff changeset
39 typedef struct gfc_state_data
kono
parents:
diff changeset
40 {
kono
parents:
diff changeset
41 gfc_compile_state state;
kono
parents:
diff changeset
42 gfc_symbol *sym; /* Block name associated with this level */
kono
parents:
diff changeset
43 gfc_symtree *do_variable; /* For DO blocks the iterator variable. */
kono
parents:
diff changeset
44
kono
parents:
diff changeset
45 struct gfc_code *construct;
kono
parents:
diff changeset
46 struct gfc_code *head, *tail;
kono
parents:
diff changeset
47 struct gfc_state_data *previous;
kono
parents:
diff changeset
48
kono
parents:
diff changeset
49 /* Block-specific state data. */
kono
parents:
diff changeset
50 union
kono
parents:
diff changeset
51 {
kono
parents:
diff changeset
52 gfc_st_label *end_do_label;
kono
parents:
diff changeset
53 gfc_oacc_declare *oacc_declare_clauses;
kono
parents:
diff changeset
54 }
kono
parents:
diff changeset
55 ext;
kono
parents:
diff changeset
56 }
kono
parents:
diff changeset
57 gfc_state_data;
kono
parents:
diff changeset
58
kono
parents:
diff changeset
59 extern gfc_state_data *gfc_state_stack;
kono
parents:
diff changeset
60
kono
parents:
diff changeset
61 #define gfc_current_block() (gfc_state_stack->sym)
kono
parents:
diff changeset
62 #define gfc_current_state() (gfc_state_stack->state)
kono
parents:
diff changeset
63 #define gfc_comp_struct(s) \
kono
parents:
diff changeset
64 ((s) == COMP_DERIVED || (s) == COMP_STRUCTURE || (s) == COMP_MAP)
kono
parents:
diff changeset
65
kono
parents:
diff changeset
66 int gfc_check_do_variable (gfc_symtree *);
kono
parents:
diff changeset
67 bool gfc_find_state (gfc_compile_state);
kono
parents:
diff changeset
68 gfc_state_data *gfc_enclosing_unit (gfc_compile_state *);
kono
parents:
diff changeset
69 const char *gfc_ascii_statement (gfc_statement);
kono
parents:
diff changeset
70 match gfc_match_enum (void);
kono
parents:
diff changeset
71 match gfc_match_enumerator_def (void);
kono
parents:
diff changeset
72 void gfc_free_enum_history (void);
kono
parents:
diff changeset
73 extern bool gfc_matching_function;
kono
parents:
diff changeset
74 match gfc_match_prefix (gfc_typespec *);
kono
parents:
diff changeset
75 bool is_oacc (gfc_state_data *);
kono
parents:
diff changeset
76 #endif /* GFC_PARSE_H */