annotate gcc/fortran/parse.h @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Parser header
kono
parents:
diff changeset
2 Copyright (C) 2003-2017 Free Software Foundation, Inc.
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,
kono
parents:
diff changeset
33 COMP_SELECT_TYPE, COMP_OMP_STRUCTURED_BLOCK, COMP_CRITICAL, COMP_DO_CONCURRENT
kono
parents:
diff changeset
34 };
kono
parents:
diff changeset
35
kono
parents:
diff changeset
36 /* Stack element for the current compilation state. These structures
kono
parents:
diff changeset
37 are allocated as automatic variables. */
kono
parents:
diff changeset
38 typedef struct gfc_state_data
kono
parents:
diff changeset
39 {
kono
parents:
diff changeset
40 gfc_compile_state state;
kono
parents:
diff changeset
41 gfc_symbol *sym; /* Block name associated with this level */
kono
parents:
diff changeset
42 gfc_symtree *do_variable; /* For DO blocks the iterator variable. */
kono
parents:
diff changeset
43
kono
parents:
diff changeset
44 struct gfc_code *construct;
kono
parents:
diff changeset
45 struct gfc_code *head, *tail;
kono
parents:
diff changeset
46 struct gfc_state_data *previous;
kono
parents:
diff changeset
47
kono
parents:
diff changeset
48 /* Block-specific state data. */
kono
parents:
diff changeset
49 union
kono
parents:
diff changeset
50 {
kono
parents:
diff changeset
51 gfc_st_label *end_do_label;
kono
parents:
diff changeset
52 gfc_oacc_declare *oacc_declare_clauses;
kono
parents:
diff changeset
53 }
kono
parents:
diff changeset
54 ext;
kono
parents:
diff changeset
55 }
kono
parents:
diff changeset
56 gfc_state_data;
kono
parents:
diff changeset
57
kono
parents:
diff changeset
58 extern gfc_state_data *gfc_state_stack;
kono
parents:
diff changeset
59
kono
parents:
diff changeset
60 #define gfc_current_block() (gfc_state_stack->sym)
kono
parents:
diff changeset
61 #define gfc_current_state() (gfc_state_stack->state)
kono
parents:
diff changeset
62 #define gfc_comp_struct(s) \
kono
parents:
diff changeset
63 ((s) == COMP_DERIVED || (s) == COMP_STRUCTURE || (s) == COMP_MAP)
kono
parents:
diff changeset
64
kono
parents:
diff changeset
65 int gfc_check_do_variable (gfc_symtree *);
kono
parents:
diff changeset
66 bool gfc_find_state (gfc_compile_state);
kono
parents:
diff changeset
67 gfc_state_data *gfc_enclosing_unit (gfc_compile_state *);
kono
parents:
diff changeset
68 const char *gfc_ascii_statement (gfc_statement);
kono
parents:
diff changeset
69 match gfc_match_enum (void);
kono
parents:
diff changeset
70 match gfc_match_enumerator_def (void);
kono
parents:
diff changeset
71 void gfc_free_enum_history (void);
kono
parents:
diff changeset
72 extern bool gfc_matching_function;
kono
parents:
diff changeset
73 match gfc_match_prefix (gfc_typespec *);
kono
parents:
diff changeset
74 bool is_oacc (gfc_state_data *);
kono
parents:
diff changeset
75 #endif /* GFC_PARSE_H */