1 /* str.c -- Implementation File (module.c template V1.0)
2 Copyright (C) 1995 Free Software Foundation, Inc.
3 Contributed by James Craig Burley.
5 This file is part of GNU Fortran.
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)
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.
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
26 Handles recognition of keywords.
38 /* Externals defined here. */
41 /* Simple definitions and enumerations. */
44 /* Internal typedefs. */
47 /* Private include files. */
50 /* Internal structure definitions. */
53 /* Static objects accessed by functions in this module. */
56 /* Static functions (internal). */
59 /* Internal macros. */
62 /* ffestr_first -- Look up the first names in a statement
68 Returns FFESTR_firstNone if no matches, else FFESTR_firstXYZ if the
69 NAME or NAMES token matches XYZ. t must be a NAME or NAMES token or this
72 This routine's code is actually written by a utility called FINI, itself
73 written specifically for the Gnu Fortran project. FINI takes an input
74 file, in this case "ffe_first.fini", consisting primarily of a
75 list of statements (ASSIGN, IF, DO, DOWHILE), and outputs a C file,
76 "str-1t.j", that contains the definition of the
77 ffestr_first function. We #include that file here.
80 Updated for Fortran 90.
83 #ifndef MAKING_DEPENDENCIES
86 /* ffestr_format -- Look up format names in a statement
90 kw = ffestr_format(t);
92 Returns FFESTR_formatNone if no matches, else FFESTR_formatXYZ if the
93 NAME or NAMES token matches XYZ. t must be a NAME or NAMES token or this
96 This routine's code is actually written by a utility called FINI, itself
97 written specifically for the Gnu Fortran project. FINI takes an input
98 file, in this case "ffe_format.fini", consisting primarily of a
99 list of format keywords (I, F, TL, TR), and outputs a C file,
100 "str-fo.j", that contains the definition of the
101 ffestr_format function. We #include that file here.
105 #ifndef MAKING_DEPENDENCIES
108 /* ffestr_genio -- Look up genio names in a statement
112 kw = ffestr_genio(t);
114 Returns FFESTR_genioNone if no matches, else FFESTR_genioXYZ if the
115 NAME or NAMES token matches XYZ. t must be a NAME or NAMES token or this
118 This routine's code is actually written by a utility called FINI, itself
119 written specifically for the Gnu Fortran project. FINI takes an input
120 file, in this case "ffe_genio.fini", consisting primarily of a
121 list of statement keywords (TO, FUNCTION), and outputs a C file,
122 "str-io.j", that contains the definition of the
123 ffestr_genio function. We #include that file here.
127 #ifndef MAKING_DEPENDENCIES
130 /* ffestr_inquire -- Look up inquire names in a statement
134 kw = ffestr_inquire(t);
136 Returns FFESTR_inquireNone if no matches, else FFESTR_inquireXYZ if the
137 NAME or NAMES token matches XYZ. t must be a NAME or NAMES token or this
140 This routine's code is actually written by a utility called FINI, itself
141 written specifically for the Gnu Fortran project. FINI takes an input
142 file, in this case "ffe_inquire.fini", consisting primarily of a
143 list of statement keywords (TO, FUNCTION), and outputs a C file,
144 "str-nq.j", that contains the definition of the
145 ffestr_inquire function. We #include that file here.
149 #ifndef MAKING_DEPENDENCIES
152 /* ffestr_open -- Look up open names in a statement
158 Returns FFESTR_openNone if no matches, else FFESTR_openXYZ if the
159 NAME or NAMES token matches XYZ. t must be a NAME or NAMES token or this
162 This routine's code is actually written by a utility called FINI, itself
163 written specifically for the Gnu Fortran project. FINI takes an input
164 file, in this case "ffe_open.fini", consisting primarily of a
165 list of statement keywords (TO, FUNCTION), and outputs a C file,
166 "str-op.j", that contains the definition of the
167 ffestr_open function. We #include that file here.
171 #ifndef MAKING_DEPENDENCIES
174 /* ffestr_other -- Look up other names in a statement
178 kw = ffestr_other(t);
180 Returns FFESTR_otherNone if no matches, else FFESTR_otherXYZ if the
181 NAME or NAMES token matches XYZ. t must be a NAME or NAMES token or this
184 This routine's code is actually written by a utility called FINI, itself
185 written specifically for the Gnu Fortran project. FINI takes an input
186 file, in this case "ffe_other.fini", consisting primarily of a
187 list of statement keywords (TO, FUNCTION), and outputs a C file,
188 "str-ot.j", that contains the definition of the
189 ffestr_other function. We #include that file here.
193 #ifndef MAKING_DEPENDENCIES
196 /* ffestr_second -- Look up the second name in a statement
200 kw = ffestr_second(t);
202 Returns FFESTR_secondNone if no matches, else FFESTR_secondXYZ if the
203 NAME or NAMES token matches XYZ. t must be a NAME or NAMES token or this
206 This routine's code is actually written by a utility called FINI, itself
207 written specifically for the Gnu Fortran project. FINI takes an input
208 file, in this case "ffe_second.fini", consisting primarily of a
209 list of statement keywords (TO, FUNCTION), and outputs a C file,
210 "str-2t.j", that contains the definition of the
211 ffestr_second function. We #include that file here.
215 #ifndef MAKING_DEPENDENCIES