]>
Commit | Line | Data |
---|---|---|
5ff904cd JL |
1 | /* name.h -- Public #include File (module.h template V1.0) |
2 | Copyright (C) 1995 Free Software Foundation, Inc. | |
25d7717e | 3 | Contributed by James Craig Burley. |
5ff904cd JL |
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 | name.c | |
24 | ||
25 | Modifications: | |
26 | */ | |
27 | ||
28 | /* Allow multiple inclusion to work. */ | |
29 | ||
88657302 RH |
30 | #ifndef GCC_F_NAME_H |
31 | #define GCC_F_NAME_H | |
5ff904cd JL |
32 | |
33 | /* Simple definitions and enumerations. */ | |
34 | ||
35 | ||
36 | /* Typedefs. */ | |
37 | ||
38 | typedef struct _ffename_ *ffename; | |
39 | typedef struct _ffename_space_ *ffenameSpace; | |
40 | ||
41 | /* Include files needed by this one. */ | |
42 | ||
43 | #include "global.h" | |
44 | #include "lex.h" | |
45 | #include "malloc.h" | |
46 | #include "symbol.h" | |
47 | ||
48 | /* Structure definitions. */ | |
49 | ||
50 | struct _ffename_ | |
51 | { | |
52 | ffename next; | |
53 | ffename previous; | |
54 | ffelexToken t; | |
55 | union | |
56 | { | |
57 | ffesymbol s; | |
58 | ffeglobal g; | |
59 | } | |
60 | u; | |
61 | }; | |
62 | ||
63 | struct _ffename_space_ | |
64 | { | |
65 | ffename first; | |
66 | ffename last; | |
67 | mallocPool pool; | |
68 | }; | |
69 | ||
70 | /* Global objects accessed by users of this module. */ | |
71 | ||
72 | ||
73 | /* Declare functions with prototypes. */ | |
74 | ||
75 | ffename ffename_find (ffenameSpace ns, ffelexToken t); | |
76 | void ffename_kill (ffenameSpace ns, ffename n); | |
77 | ffename ffename_lookup (ffenameSpace ns, ffelexToken t); | |
26f096f9 KG |
78 | void ffename_space_drive_global (ffenameSpace ns, ffeglobal (*fn) (ffeglobal)); |
79 | void ffename_space_drive_symbol (ffenameSpace ns, ffesymbol (*fn) (ffesymbol)); | |
5ff904cd JL |
80 | void ffename_space_kill (ffenameSpace ns); |
81 | ffenameSpace ffename_space_new (mallocPool pool); | |
82 | ||
83 | /* Define macros. */ | |
84 | ||
85 | #define ffename_first_token(n) ((n)->t) | |
86 | #define ffename_global(n) ((n)->u.g) | |
87 | #define ffename_init_0() | |
88 | #define ffename_init_1() | |
89 | #define ffename_init_2() | |
90 | #define ffename_init_3() | |
91 | #define ffename_init_4() | |
92 | #define ffename_set_global(n,glob) ((n)->u.g = (glob)) | |
93 | #define ffename_set_symbol(n,sym) ((n)->u.s = (sym)) | |
94 | #define ffename_symbol(n) ((n)->u.s) | |
95 | #define ffename_terminate_0() | |
96 | #define ffename_terminate_1() | |
97 | #define ffename_terminate_2() | |
98 | #define ffename_terminate_3() | |
99 | #define ffename_terminate_4() | |
100 | #define ffename_text(n) ffelex_token_text((n)->t) | |
101 | #define ffename_token(n) ((n)->t) | |
102 | #define ffename_where_filename(n) ffelex_token_where_filename((n)->t) | |
103 | #define ffename_where_filelinenum(n) ffelex_token_where_filelinenum((n)->t) | |
104 | #define ffename_where_line(n) ffelex_token_where_line((n)->t) | |
105 | #define ffename_where_column(n) ffelex_token_where_column((n)->t) | |
106 | ||
107 | /* End of #include file. */ | |
108 | ||
88657302 | 109 | #endif /* ! GCC_F_NAME_H */ |