Bring in a trimmed down gcc-3.4-20040618.
[dragonfly.git] / contrib / gcc-3.4 / gcc / f / lab.h
1 /* lab.h -- Public #include File (module.h template V1.0)
2    Copyright (C) 1995, 2003 Free Software Foundation, Inc.
3    Contributed by James Craig Burley.
4
5 This file is part of GNU Fortran.
6
7 GNU Fortran 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)
10 any later version.
11
12 GNU Fortran 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.
16
17 You should have received a copy of the GNU General Public License
18 along with GNU Fortran; see the file COPYING.  If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
20 02111-1307, USA.
21
22    Owning Modules:
23       lab.c
24
25    Modifications:
26       22-Aug-89  JCB  1.1
27          Change for new ffewhere interface.
28 */
29
30 /* Allow multiple inclusion to work. */
31
32 #ifndef GCC_F_LAB_H
33 #define GCC_F_LAB_H
34
35 /* Simple definitions and enumerations. */
36
37 typedef enum
38   {
39     FFELAB_typeUNKNOWN,         /* No info yet on label. */
40     FFELAB_typeANY,             /* Label valid for anything, no msgs. */
41     FFELAB_typeUSELESS,         /* No valid way to reference this label. */
42     FFELAB_typeASSIGNABLE,      /* Target of ASSIGN: so FORMAT or BRANCH. */
43     FFELAB_typeFORMAT,          /* FORMAT label. */
44     FFELAB_typeLOOPEND,         /* Target of a labeled DO statement. */
45     FFELAB_typeNOTLOOP,         /* Branch target statement not valid DO
46                                    target. */
47     FFELAB_typeENDIF,           /* END IF label. */
48     FFELAB_type
49   } ffelabType;
50
51 #define FFELAB_valueNONE 0
52 #define FFELAB_valueMAX 99999
53
54 /* Typedefs. */
55
56 typedef struct _ffelab_ *ffelab;
57 typedef ffelab ffelabHandle;
58 typedef unsigned long ffelabNumber;     /* Count of new labels. */
59 #define ffelabNumber_f "l"
60 typedef unsigned long ffelabValue;
61 #define ffelabValue_f "l"
62
63 /* Include files needed by this one. */
64
65 #include "com.h"
66 #include "where.h"
67
68 /* Structure definitions. */
69
70 struct _ffelab_
71   {
72     ffelab next;
73     ffecomLabel hook;
74     ffelabValue value;          /* 1 through 99999, or 100000+ for temp
75                                    labels. */
76     unsigned long blocknum;     /* Managed entirely by user of module. */
77     ffewhereLine firstref_line;
78     ffewhereColumn firstref_col;
79     ffewhereLine doref_line;
80     ffewhereColumn doref_col;
81     ffewhereLine definition_line;       /* ffewhere_line_unknown() if not
82                                            defined. */
83     ffewhereColumn definition_col;
84     ffelabType type;
85   };
86
87 /* Global objects accessed by users of this module. */
88
89 extern ffelab ffelab_list_;
90 extern ffelabNumber ffelab_num_news_;
91
92 /* Declare functions with prototypes. */
93
94 ffelab ffelab_find (ffelabValue v);
95 void ffelab_finish (void);
96 void ffelab_init_3 (void);
97 ffelab ffelab_new (ffelabValue v);
98
99 /* Define macros. */
100
101 #define ffelab_blocknum(l) ((l)->blocknum)
102 #define ffelab_definition_column(l) ((l)->definition_col)
103 #define ffelab_definition_filename(l) \
104       ffewhere_line_filename((l)->definition_line)
105 #define ffelab_definition_filelinenum(l) \
106       ffewhere_line_filelinenum((l)->definition_line)
107 #define ffelab_definition_line(l) ((l)->definition_line)
108 #define ffelab_definition_line_number(l) \
109       ffewhere_line_number((l)->definition_line)
110 #define ffelab_doref_column(l) ((l)->doref_col)
111 #define ffelab_doref_filename(l) ffewhere_line_filename((l)->doref_line)
112 #define ffelab_doref_filelinenum(l) ffewhere_line_filelinenum((l)->doref_line)
113 #define ffelab_doref_line(l) ((l)->doref_line)
114 #define ffelab_doref_line_number(l) ffewhere_line_number((l)->doref_line)
115 #define ffelab_firstref_column(l) ((l)->firstref_col)
116 #define ffelab_firstref_filename(l) ffewhere_line_filename((l)->firstref_line)
117 #define ffelab_firstref_filelinenum(l) \
118       ffewhere_line_filelinenum((l)->firstref_line)
119 #define ffelab_firstref_line(l) ((l)->firstref_line)
120 #define ffelab_firstref_line_number(l) ffewhere_line_number((l)->firstref_line)
121 #define ffelab_handle_done(h)
122 #define ffelab_handle_first() ((ffelabHandle) ffelab_list_)
123 #define ffelab_handle_next(h) ((ffelabHandle) (((ffelab) h)->next))
124 #define ffelab_handle_target(h) ((ffelab) h)
125 #define ffelab_hook(l) ((l)->hook)
126 #define ffelab_init_0()
127 #define ffelab_init_1()
128 #define ffelab_init_2()
129 #define ffelab_init_4()
130 #define ffelab_kill(l) ffelab_set_value(l,FFELAB_valueNONE);
131 #define ffelab_new_generated() (ffelab_new(ffelab_generated_++))
132 #define ffelab_number() (ffelab_num_news_)
133 #define ffelab_set_blocknum(l,b) ((l)->blocknum = (b))
134 #define ffelab_set_definition_column(l,cn) ((l)->definition_col = (cn))
135 #define ffelab_set_definition_line(l,ln) ((l)->definition_line = (ln))
136 #define ffelab_set_doref_column(l,cn) ((l)->doref_col = (cn))
137 #define ffelab_set_doref_line(l,ln) ((l)->doref_line = (ln))
138 #define ffelab_set_firstref_column(l,cn) ((l)->firstref_col = (cn))
139 #define ffelab_set_firstref_line(l,ln) ((l)->firstref_line = (ln))
140 #define ffelab_set_hook(l,h) ((l)->hook = (h))
141 #define ffelab_set_type(l,t) ((l)->type = (t))
142 #define ffelab_terminate_0()
143 #define ffelab_terminate_1()
144 #define ffelab_terminate_2()
145 #define ffelab_terminate_3()
146 #define ffelab_terminate_4()
147 #define ffelab_type(l) ((l)->type)
148 #define ffelab_value(l) ((l)->value)
149
150 /* End of #include file. */
151
152 #endif /* ! GCC_F_LAB_H */