1/* stp.h -- Private #include File (module.h template V1.0)
2   Copyright (C) 1995 Free Software Foundation, Inc.
3   Contributed by James Craig Burley.
4
5This file is part of GNU Fortran.
6
7GNU Fortran is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2, or (at your option)
10any later version.
11
12GNU Fortran is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GNU Fortran; see the file COPYING.  If not, write to
19the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
2002111-1307, USA.
21
22   Owning Modules:
23      stp.c
24
25   Modifications:
26*/
27
28/* Allow multiple inclusion to work. */
29
30#ifndef _H_f_stp
31#define _H_f_stp
32
33/* Simple definitions and enumerations. */
34
35enum _ffestp_acceptix_
36  {
37    FFESTP_acceptixFORMAT,
38    FFESTP_acceptix
39  };
40typedef enum _ffestp_acceptix_ ffestpAcceptIx;
41
42enum _ffestp_attrib_
43  {
44#if FFESTR_F90
45    FFESTP_attribALLOCATABLE,
46#endif
47    FFESTP_attribDIMENSION,
48    FFESTP_attribEXTERNAL,
49#if FFESTR_F90
50    FFESTP_attribINTENT,
51#endif
52    FFESTP_attribINTRINSIC,
53#if FFESTR_F90
54    FFESTP_attribOPTIONAL,
55#endif
56    FFESTP_attribPARAMETER,
57#if FFESTR_F90
58    FFESTP_attribPOINTER,
59#endif
60#if FFESTR_F90
61    FFESTP_attribPRIVATE,
62    FFESTP_attribPUBLIC,
63#endif
64    FFESTP_attribSAVE,
65#if FFESTR_F90
66    FFESTP_attribTARGET,
67#endif
68    FFESTP_attrib
69  };
70typedef enum _ffestp_attrib_ ffestpAttrib;
71
72enum _ffestp_beruix_
73  {
74    FFESTP_beruixERR,
75    FFESTP_beruixIOSTAT,
76    FFESTP_beruixUNIT,
77    FFESTP_beruix
78  };
79typedef enum _ffestp_beruix_ ffestpBeruIx;
80
81enum _ffestp_closeix_
82  {
83    FFESTP_closeixERR,
84    FFESTP_closeixIOSTAT,
85    FFESTP_closeixSTATUS,
86    FFESTP_closeixUNIT,
87    FFESTP_closeix
88  };
89typedef enum _ffestp_closeix_ ffestpCloseIx;
90
91enum _ffestp_deleteix_
92  {
93    FFESTP_deleteixERR,
94    FFESTP_deleteixIOSTAT,
95    FFESTP_deleteixREC,
96    FFESTP_deleteixUNIT,
97    FFESTP_deleteix
98  };
99typedef enum _ffestp_deleteix_ ffestpDeleteIx;
100
101enum _ffestp_findix_
102  {
103    FFESTP_findixERR,
104    FFESTP_findixIOSTAT,
105    FFESTP_findixREC,
106    FFESTP_findixUNIT,
107    FFESTP_findix
108  };
109typedef enum _ffestp_findix_ ffestpFindIx;
110
111enum _ffestp_inquireix_
112  {
113    FFESTP_inquireixACCESS,
114    FFESTP_inquireixACTION,
115    FFESTP_inquireixBLANK,
116    FFESTP_inquireixCARRIAGECONTROL,
117    FFESTP_inquireixDEFAULTFILE,
118    FFESTP_inquireixDELIM,
119    FFESTP_inquireixDIRECT,
120    FFESTP_inquireixERR,
121    FFESTP_inquireixEXIST,
122    FFESTP_inquireixFILE,
123    FFESTP_inquireixFORM,
124    FFESTP_inquireixFORMATTED,
125    FFESTP_inquireixIOLENGTH,
126    FFESTP_inquireixIOSTAT,
127    FFESTP_inquireixKEYED,
128    FFESTP_inquireixNAME,
129    FFESTP_inquireixNAMED,
130    FFESTP_inquireixNEXTREC,
131    FFESTP_inquireixNUMBER,
132    FFESTP_inquireixOPENED,
133    FFESTP_inquireixORGANIZATION,
134    FFESTP_inquireixPAD,
135    FFESTP_inquireixPOSITION,
136    FFESTP_inquireixREAD,
137    FFESTP_inquireixREADWRITE,
138    FFESTP_inquireixRECL,
139    FFESTP_inquireixRECORDTYPE,
140    FFESTP_inquireixSEQUENTIAL,
141    FFESTP_inquireixUNFORMATTED,
142    FFESTP_inquireixUNIT,
143    FFESTP_inquireixWRITE,
144    FFESTP_inquireix
145  };
146typedef enum _ffestp_inquireix_ ffestpInquireIx;
147
148enum _ffestp_openix_
149  {
150    FFESTP_openixACCESS,
151    FFESTP_openixACTION,
152    FFESTP_openixASSOCIATEVARIABLE,
153    FFESTP_openixBLANK,
154    FFESTP_openixBLOCKSIZE,
155    FFESTP_openixBUFFERCOUNT,
156    FFESTP_openixCARRIAGECONTROL,
157    FFESTP_openixDEFAULTFILE,
158    FFESTP_openixDELIM,
159    FFESTP_openixDISPOSE,
160    FFESTP_openixERR,
161    FFESTP_openixEXTENDSIZE,
162    FFESTP_openixFILE,
163    FFESTP_openixFORM,
164    FFESTP_openixINITIALSIZE,
165    FFESTP_openixIOSTAT,
166    FFESTP_openixKEY,
167    FFESTP_openixMAXREC,
168    FFESTP_openixNOSPANBLOCKS,
169    FFESTP_openixORGANIZATION,
170    FFESTP_openixPAD,
171    FFESTP_openixPOSITION,
172    FFESTP_openixREADONLY,
173    FFESTP_openixRECL,
174    FFESTP_openixRECORDTYPE,
175    FFESTP_openixSHARED,
176    FFESTP_openixSTATUS,
177    FFESTP_openixUNIT,
178    FFESTP_openixUSEROPEN,
179    FFESTP_openix
180  };
181typedef enum _ffestp_openix_ ffestpOpenIx;
182
183enum _ffestp_printix_
184  {
185    FFESTP_printixFORMAT,
186    FFESTP_printix
187  };
188typedef enum _ffestp_printix_ ffestpPrintIx;
189
190enum _ffestp_readix_
191  {
192    FFESTP_readixADVANCE,
193    FFESTP_readixEND,
194    FFESTP_readixEOR,
195    FFESTP_readixERR,
196    FFESTP_readixFORMAT,	/* Or NAMELIST (use expr info to
197				   distinguish). */
198    FFESTP_readixIOSTAT,
199    FFESTP_readixKEYEQ,
200    FFESTP_readixKEYGE,
201    FFESTP_readixKEYGT,
202    FFESTP_readixKEYID,
203    FFESTP_readixNULLS,
204    FFESTP_readixREC,
205    FFESTP_readixSIZE,
206    FFESTP_readixUNIT,
207    FFESTP_readix
208  };
209typedef enum _ffestp_readix_ ffestpReadIx;
210
211enum _ffestp_rewriteix_
212  {
213    FFESTP_rewriteixERR,
214    FFESTP_rewriteixFMT,
215    FFESTP_rewriteixIOSTAT,
216    FFESTP_rewriteixUNIT,
217    FFESTP_rewriteix
218  };
219typedef enum _ffestp_rewriteix_ ffestpRewriteIx;
220
221enum _ffestp_typeix_
222  {
223    FFESTP_typeixFORMAT,
224    FFESTP_typeix
225  };
226typedef enum _ffestp_typeix_ ffestpTypeIx;
227
228enum _ffestp_vxtcodeix_
229  {
230    FFESTP_vxtcodeixB,
231    FFESTP_vxtcodeixC,
232    FFESTP_vxtcodeixERR,
233    FFESTP_vxtcodeixF,
234    FFESTP_vxtcodeixIOSTAT,
235    FFESTP_vxtcodeix
236  };
237typedef enum _ffestp_vxtcodeix_ ffestpVxtcodeIx;
238
239enum _ffestp_writeix_
240  {
241    FFESTP_writeixADVANCE,
242    FFESTP_writeixEOR,
243    FFESTP_writeixERR,
244    FFESTP_writeixFORMAT,	/* Or NAMELIST (use expr info to
245				   distinguish). */
246    FFESTP_writeixIOSTAT,
247    FFESTP_writeixREC,
248    FFESTP_writeixUNIT,
249    FFESTP_writeix
250  };
251typedef enum _ffestp_writeix_ ffestpWriteIx;
252
253#if FFESTR_F90
254enum _ffestp_definedoperator_
255  {
256    FFESTP_definedoperatorNone,	/* INTERFACE generic-name. */
257    FFESTP_definedoperatorOPERATOR,	/* INTERFACE
258					   OPERATOR(defined-operator). */
259    FFESTP_definedoperatorASSIGNMENT,	/* INTERFACE ASSIGNMENT(=). */
260    FFESTP_definedoperatorPOWER,
261    FFESTP_definedoperatorMULT,
262    FFESTP_definedoperatorADD,
263    FFESTP_definedoperatorCONCAT,
264    FFESTP_definedoperatorDIVIDE,
265    FFESTP_definedoperatorSUBTRACT,
266    FFESTP_definedoperatorNOT,
267    FFESTP_definedoperatorAND,
268    FFESTP_definedoperatorOR,
269    FFESTP_definedoperatorEQV,
270    FFESTP_definedoperatorNEQV,
271    FFESTP_definedoperatorEQ,
272    FFESTP_definedoperatorNE,
273    FFESTP_definedoperatorLT,
274    FFESTP_definedoperatorLE,
275    FFESTP_definedoperatorGT,
276    FFESTP_definedoperatorGE,
277    FFESTP_definedoperator
278  };
279typedef enum _ffestp_definedoperator_ ffestpDefinedOperator;
280#endif
281
282enum _ffestp_dimtype_
283  {
284    FFESTP_dimtypeNONE,
285    FFESTP_dimtypeKNOWN,	/* Known-bounds dimension list. */
286    FFESTP_dimtypeADJUSTABLE,	/* Adjustable dimension list. */
287    FFESTP_dimtypeASSUMED,	/* Assumed dimension list (known except for
288				   last). */
289    FFESTP_dimtypeADJUSTABLEASSUMED,	/* Both. */
290    FFESTP_dimtype
291  };
292typedef enum _ffestp_dimtype_ ffestpDimtype;
293
294enum _ffestp_formattype_
295  {
296    FFESTP_formattypeNone,
297    FFESTP_formattypeI,
298    FFESTP_formattypeB,
299    FFESTP_formattypeO,
300    FFESTP_formattypeZ,
301    FFESTP_formattypeF,
302    FFESTP_formattypeE,
303    FFESTP_formattypeEN,
304    FFESTP_formattypeG,
305    FFESTP_formattypeL,
306    FFESTP_formattypeA,
307    FFESTP_formattypeD,
308    FFESTP_formattypeQ,
309    FFESTP_formattypeDOLLAR,	/* $ (V-extension). */
310    FFESTP_formattypeP,
311    FFESTP_formattypeT,
312    FFESTP_formattypeTL,
313    FFESTP_formattypeTR,
314    FFESTP_formattypeX,
315    FFESTP_formattypeS,
316    FFESTP_formattypeSP,
317    FFESTP_formattypeSS,
318    FFESTP_formattypeBN,
319    FFESTP_formattypeBZ,
320    FFESTP_formattypeH,		/* Hollerith, used only for error-reporting. */
321    FFESTP_formattypeSLASH,
322    FFESTP_formattypeCOLON,
323    FFESTP_formattypeR1016,	/* char-literal-constant or cHchars. */
324    FFESTP_formattypeFORMAT,	/* [r](format-item-list). */
325    FFESTP_formattype
326  };
327typedef enum _ffestp_formattype_ ffestpFormatType;
328
329enum _ffestp_type_
330  {
331    FFESTP_typeNone,
332    FFESTP_typeINTEGER,
333    FFESTP_typeREAL,
334    FFESTP_typeCOMPLEX,
335    FFESTP_typeLOGICAL,
336    FFESTP_typeCHARACTER,
337    FFESTP_typeDBLPRCSN,
338    FFESTP_typeDBLCMPLX,
339    FFESTP_typeBYTE,
340    FFESTP_typeWORD,
341#if FFESTR_F90
342    FFESTP_typeTYPE,
343#endif
344    FFESTP_type
345  };
346typedef enum _ffestp_type_ ffestpType;
347
348/* Typedefs. */
349
350typedef struct _ffest_accept_stmt_ ffestpAcceptStmt;
351typedef struct _ffest_beru_stmt_ ffestpBeruStmt;
352typedef struct _ffest_close_stmt_ ffestpCloseStmt;
353typedef struct _ffest_delete_stmt_ ffestpDeleteStmt;
354typedef struct _ffestp_file ffestpFile;
355typedef struct _ffest_find_stmt_ ffestpFindStmt;
356typedef struct _ffest_inquire_stmt_ ffestpInquireStmt;
357typedef struct _ffest_open_stmt_ ffestpOpenStmt;
358typedef struct _ffest_print_stmt_ ffestpPrintStmt;
359typedef struct _ffest_read_stmt_ ffestpReadStmt;
360typedef struct _ffest_rewrite_stmt_ ffestpRewriteStmt;
361typedef struct _ffest_type_stmt_ ffestpTypeStmt;
362typedef struct _ffest_vxtcode_stmt_ ffestpVxtcodeStmt;
363typedef struct _ffest_write_stmt_ ffestpWriteStmt;
364
365/* Include files needed by this one. */
366
367#include "bld.h"
368#include "lab.h"
369#include "lex.h"
370#include "stp.h"
371#include "stt.h"
372
373/* Structure definitions. */
374
375struct _ffestp_file
376  {
377    bool kw_or_val_present;	/* If FALSE, all else is n/a. */
378    bool kw_present;		/* Indicates whether kw has a token. */
379    bool value_present;		/* Indicates whether value/expr are valid. */
380    bool value_is_label;	/* TRUE if expr has no expression, value is
381				   NUMBER. */
382    ffelexToken kw;		/* The keyword, iff kw_or_val_present &&
383				   kw_present. */
384    ffelexToken value;		/* The value, iff kw_or_val_present &&
385				   value_present. */
386    union
387      {
388	ffebld expr;		/* The expr, iff kw_or_val_present &&
389				   value_present && !value_is_label. */
390	ffelab label;		/* The label, iff kw_or_val_present &&
391				   value_present && value_is_label. */
392      }
393    u;
394  };
395
396struct _ffest_accept_stmt_
397  {
398    ffestpFile accept_spec[FFESTP_acceptix];
399  };
400
401struct _ffest_beru_stmt_
402  {
403    ffestpFile beru_spec[FFESTP_beruix];
404  };
405
406struct _ffest_close_stmt_
407  {
408    ffestpFile close_spec[FFESTP_closeix];
409  };
410
411struct _ffest_delete_stmt_
412  {
413    ffestpFile delete_spec[FFESTP_deleteix];
414  };
415
416struct _ffest_find_stmt_
417  {
418    ffestpFile find_spec[FFESTP_findix];
419  };
420
421struct _ffest_imp_list_
422  {
423    ffesttImpList next;
424    ffesttImpList previous;
425    ffelexToken first;
426    ffelexToken last;		/* NULL if a single letter. */
427  };
428
429struct _ffest_inquire_stmt_
430  {
431    ffestpFile inquire_spec[FFESTP_inquireix];
432  };
433
434struct _ffest_open_stmt_
435  {
436    ffestpFile open_spec[FFESTP_openix];
437  };
438
439struct _ffest_print_stmt_
440  {
441    ffestpFile print_spec[FFESTP_printix];
442  };
443
444struct _ffest_read_stmt_
445  {
446    ffestpFile read_spec[FFESTP_readix];
447  };
448
449struct _ffest_rewrite_stmt_
450  {
451    ffestpFile rewrite_spec[FFESTP_rewriteix];
452  };
453
454struct _ffest_type_stmt_
455  {
456    ffestpFile type_spec[FFESTP_typeix];
457  };
458
459struct _ffest_vxtcode_stmt_
460  {
461    ffestpFile vxtcode_spec[FFESTP_vxtcodeix];
462  };
463
464struct _ffest_write_stmt_
465  {
466    ffestpFile write_spec[FFESTP_writeix];
467  };
468
469union _ffestp_fileu_
470  {
471    ffestpAcceptStmt accept;
472    ffestpBeruStmt beru;
473    ffestpCloseStmt close;
474    ffestpDeleteStmt delete;
475    ffestpFindStmt find;
476    ffestpInquireStmt inquire;
477    ffestpOpenStmt open;
478    ffestpPrintStmt print;
479    ffestpReadStmt read;
480    ffestpRewriteStmt rewrite;
481    ffestpTypeStmt type;
482    ffestpVxtcodeStmt vxtcode;
483    ffestpWriteStmt write;
484  };
485
486/* Global objects accessed by users of this module. */
487
488extern union _ffestp_fileu_ ffestp_file;
489
490/* Declare functions with prototypes. */
491
492
493/* Define macros. */
494
495#define ffestp_init_0()
496#define ffestp_init_1()
497#define ffestp_init_2()
498#define ffestp_init_3()
499#define ffestp_init_4()
500#define ffestp_terminate_0()
501#define ffestp_terminate_1()
502#define ffestp_terminate_2()
503#define ffestp_terminate_3()
504#define ffestp_terminate_4()
505
506/* End of #include file. */
507
508#endif
509