Initial import from FreeBSD RELENG_4:
[dragonfly.git] / contrib / gcc / f / stt.h
1 /* stt.h -- Private #include File (module.h template V1.0)
2    Copyright (C) 1995 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       stt.c
24
25    Modifications:
26 */
27
28 /* Allow multiple inclusion to work. */
29
30 #ifndef _H_f_stt
31 #define _H_f_stt
32
33 /* Simple definitions and enumerations. */
34
35
36 /* Typedefs. */
37
38 typedef struct _ffest_case_list_ *ffesttCaseList;
39 typedef struct _ffest_dim_list_ *ffesttDimList;
40 typedef struct _ffest_expr_list_ *ffesttExprList;
41 typedef struct _ffest_format_value_ ffesttFormatValue;
42 typedef struct _ffest_format_list_ *ffesttFormatList;
43 typedef struct _ffest_imp_list_ *ffesttImpList;
44 typedef struct _ffest_token_item_ *ffesttTokenItem;
45 typedef struct _ffest_token_list_ *ffesttTokenList;
46
47 /* Include files needed by this one. */
48
49 #include "top.h"
50 #include "bld.h"
51 #include "info.h"
52 #include "lex.h"
53 #include "stp.h"
54
55 /* Structure definitions. */
56
57 struct _ffest_case_list_
58   {
59     ffesttCaseList next;
60     ffesttCaseList previous;
61     ffelexToken t;
62     ffebld expr1;
63     ffebld expr2;
64     bool range;                 /* TRUE if "[expr1]:[expr2]", FALSE if
65                                    "expr1". */
66   };
67
68 struct _ffest_dim_list_
69   {
70     ffesttDimList next;
71     ffesttDimList previous;
72     ffelexToken t;
73     ffebld lower;
74     ffebld upper;
75   };
76
77 struct _ffest_expr_list_
78   {
79     ffesttExprList next;
80     ffesttExprList previous;
81     ffelexToken t;
82     ffebld expr;
83   };
84
85 struct _ffest_token_item_
86   {
87     ffesttTokenItem next;
88     ffesttTokenItem previous;
89     ffelexToken t;
90   };
91
92 struct _ffest_token_list_
93   {
94     ffesttTokenItem first;
95     ffesttTokenItem last;
96     int count;                  /* Number of tokens in list. */
97   };
98
99 struct _ffest_format_value_
100   {
101     bool present;               /* TRUE if value supplied (needed for
102                                    optional values only). */
103     bool rtexpr;                /* FALSE if constant value here, TRUE if
104                                    run-time expr (VXT). */
105     ffelexToken t;              /* The first token, or perhaps just prior if
106                                    can't get it. */
107     union
108       {
109         ffeUnionLongPtr unused; /* Make sure all the info gets copied. */
110         long signed_val;        /* for R1011. */
111         unsigned long unsigned_val;     /* For other constant values. */
112         ffebld expr;            /* For run-time expression (VXT). */
113       }
114     u;
115   };
116
117 struct _ffest_format_list_
118   {
119     ffesttFormatList next;
120     ffesttFormatList previous;
121     ffelexToken t;              /* The NAME, CHARACTER, or HOLLERITH token. */
122     ffestpFormatType type;
123     union ffest_format_
124       {
125         struct
126           {
127             ffesttFormatValue R1004;    /* r, the repeat count. */
128             ffesttFormatValue R1006;    /* w, the field width. */
129             ffesttFormatValue R1007_or_R1008;   /* m, the minimum number of
130                                                    digits; d, the number of
131                                                    decimal digits. */
132             ffesttFormatValue R1009;    /* e, the number of exponent digits. */
133           }
134         R1005;                  /* data-edit-desc. */
135         struct
136           {
137             ffesttFormatValue val;      /* r, the repeat count; k, the
138                                            precision magnitude adjustment; n,
139                                            the column number (abs or rel). */
140           }
141         R1010;                  /* control-edit-desc. */
142         struct
143           {
144             ffesttFormatValue R1004;    /* r, the repeat count. */
145             ffesttFormatList format;    /* the parenthesized
146                                            format-item-list. */
147           }
148         R1003D;                 /* format-item of for [r](format-item-list). */
149         struct
150           {
151             ffesttFormatList parent;    /* NULL if outer list, else parent
152                                            item. */
153           }
154         root;                   /* FFESTP_formattypeNone case. */
155       }
156     u;
157   };
158
159 /* Global objects accessed by users of this module. */
160
161
162 /* Declare functions with prototypes. */
163
164 void ffestt_caselist_append (ffesttCaseList list, bool range, ffebld case1,
165                              ffebld case2, ffelexToken t);
166 ffesttCaseList ffestt_caselist_create (void);
167 #if FFECOM_targetCURRENT == FFECOM_targetFFE
168 void ffestt_caselist_dump (ffesttCaseList list);
169 #endif
170 void ffestt_caselist_kill (ffesttCaseList list);
171 void ffestt_dimlist_append (ffesttDimList list, ffebld lower, ffebld upper,
172                             ffelexToken t);
173 ffebld ffestt_dimlist_as_expr (ffesttDimList list, ffeinfoRank *rank,
174                                ffebld *array_size, ffebld *extents,
175                                bool is_ugly_assumed);
176 ffesttDimList ffestt_dimlist_create (void);
177 #if FFECOM_targetCURRENT == FFECOM_targetFFE
178 void ffestt_dimlist_dump (ffesttDimList list);
179 #endif
180 void ffestt_dimlist_kill (ffesttDimList list);
181 ffestpDimtype ffestt_dimlist_type (ffesttDimList dims, bool is_ugly_assumed);
182 void ffestt_exprlist_append (ffesttExprList list, ffebld expr, ffelexToken t);
183 ffesttExprList ffestt_exprlist_create (void);
184 void ffestt_exprlist_drive (ffesttExprList list, void (*fn) (ffebld, ffelexToken));
185 #if FFECOM_targetCURRENT == FFECOM_targetFFE
186 void ffestt_exprlist_dump (ffesttExprList list);
187 #endif
188 void ffestt_exprlist_kill (ffesttExprList list);
189 ffesttFormatList ffestt_formatlist_append (ffesttFormatList list);
190 ffesttFormatList ffestt_formatlist_create (ffesttFormatList parent,
191                                            ffelexToken t);
192 #if FFECOM_targetCURRENT == FFECOM_targetFFE
193 void ffestt_formatlist_dump (ffesttFormatList list);
194 #endif
195 void ffestt_formatlist_kill (ffesttFormatList list);
196 void ffestt_implist_append (ffesttImpList list, ffelexToken first,
197                             ffelexToken last);
198 ffesttImpList ffestt_implist_create (void);
199 void ffestt_implist_drive (ffesttImpList list, void (*fn) (ffelexToken, ffelexToken));
200 #if FFECOM_targetCURRENT == FFECOM_targetFFE
201 void ffestt_implist_dump (ffesttImpList list);
202 #endif
203 void ffestt_implist_kill (ffesttImpList list);
204 void ffestt_tokenlist_append (ffesttTokenList list, ffelexToken t);
205 ffesttTokenList ffestt_tokenlist_create (void);
206 void ffestt_tokenlist_drive (ffesttTokenList list, void (*fn) (ffelexToken));
207 #if FFECOM_targetCURRENT == FFECOM_targetFFE
208 void ffestt_tokenlist_dump (ffesttTokenList list);
209 #endif
210 ffelexHandler ffestt_tokenlist_handle (ffesttTokenList list,
211                                        ffelexHandler handler);
212 void ffestt_tokenlist_kill (ffesttTokenList list);
213
214 /* Define macros. */
215
216 #define ffestt_init_0()
217 #define ffestt_init_1()
218 #define ffestt_init_2()
219 #define ffestt_init_3()
220 #define ffestt_init_4()
221 #define ffestt_terminate_0()
222 #define ffestt_terminate_1()
223 #define ffestt_terminate_2()
224 #define ffestt_terminate_3()
225 #define ffestt_terminate_4()
226 #define ffestt_tokenlist_count(tl) ((tl)->count)
227
228 /* End of #include file. */
229
230 #endif