2 Copyright (C) 2003 Free Software Foundaton, Inc.
3 Contributed by Steven Bosscher
5 This file is part of GNU G95.
7 GNU G95 is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
12 GNU G95 is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GNU G95; see the file COPYING. If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
28 /* Enum for what the compiler is currently doing. */
31 COMP_NONE, COMP_PROGRAM, COMP_MODULE, COMP_SUBROUTINE, COMP_FUNCTION,
32 COMP_BLOCK_DATA, COMP_INTERFACE, COMP_DERIVED, COMP_IF, COMP_DO,
33 COMP_SELECT, COMP_FORALL, COMP_WHERE, COMP_CONTAINS
37 /* Stack element for the current compilation state. These structures
38 are allocated as automatic variables. */
39 typedef struct gfc_state_data
41 gfc_compile_state state;
42 gfc_symbol *sym; /* Block name associated with this level */
43 struct gfc_code *head, *tail;
44 struct gfc_state_data *previous;
46 /* Block-specific state data. */
49 gfc_st_label *end_do_label;
55 extern gfc_state_data *gfc_state_stack;
57 #define gfc_current_block() (gfc_state_stack->sym)
58 #define gfc_current_state() (gfc_state_stack->state)
60 try gfc_find_state (gfc_compile_state);
61 gfc_state_data *gfc_enclosing_unit (gfc_compile_state *);
62 const char *gfc_ascii_statement (gfc_statement);
63 const char *gfc_state_name (gfc_compile_state);
65 #endif /* GFC_PARSE_H */