1/* str.c -- Implementation File (module.c 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 Related Modules: 23 None 24 25 Description: 26 Handles recognition of keywords. 27 28 Modifications: 29*/ 30 31/* Include files. */ 32 33#include "proj.h" 34#include "src.h" 35#include "str.h" 36#include "lex.h" 37 38/* Externals defined here. */ 39 40 41/* Simple definitions and enumerations. */ 42 43 44/* Internal typedefs. */ 45 46 47/* Private include files. */ 48 49 50/* Internal structure definitions. */ 51 52 53/* Static objects accessed by functions in this module. */ 54 55 56/* Static functions (internal). */ 57 58 59/* Internal macros. */ 60 61 62/* ffestr_first -- Look up the first names in a statement 63 64 ffestrFirst kw; 65 ffelexToken t; 66 kw = ffestr_first(t); 67 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 70 routine will crash. 71 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. 78 79 30-Jan-90 JCB 2.0 80 Updated for Fortran 90. 81*/ 82 83#ifndef MAKING_DEPENDENCIES 84#include "str-1t.j" 85#endif 86/* ffestr_format -- Look up format names in a statement 87 88 ffestrFormat kw; 89 ffelexToken t; 90 kw = ffestr_format(t); 91 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 94 routine will crash. 95 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. 102 103*/ 104 105#ifndef MAKING_DEPENDENCIES 106#include "str-fo.j" 107#endif 108/* ffestr_genio -- Look up genio names in a statement 109 110 ffestrGenio kw; 111 ffelexToken t; 112 kw = ffestr_genio(t); 113 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 116 routine will crash. 117 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. 124 125*/ 126 127#ifndef MAKING_DEPENDENCIES 128#include "str-io.j" 129#endif 130/* ffestr_inquire -- Look up inquire names in a statement 131 132 ffestrInquire kw; 133 ffelexToken t; 134 kw = ffestr_inquire(t); 135 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 138 routine will crash. 139 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. 146 147*/ 148 149#ifndef MAKING_DEPENDENCIES 150#include "str-nq.j" 151#endif 152/* ffestr_open -- Look up open names in a statement 153 154 ffestrOpen kw; 155 ffelexToken t; 156 kw = ffestr_open(t); 157 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 160 routine will crash. 161 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. 168 169*/ 170 171#ifndef MAKING_DEPENDENCIES 172#include "str-op.j" 173#endif 174/* ffestr_other -- Look up other names in a statement 175 176 ffestrOther kw; 177 ffelexToken t; 178 kw = ffestr_other(t); 179 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 182 routine will crash. 183 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. 190 191*/ 192 193#ifndef MAKING_DEPENDENCIES 194#include "str-ot.j" 195#endif 196/* ffestr_second -- Look up the second name in a statement 197 198 ffestrSecond kw; 199 ffelexToken t; 200 kw = ffestr_second(t); 201 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 204 routine will crash. 205 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. 212 213*/ 214 215#ifndef MAKING_DEPENDENCIES 216#include "str-2t.j" 217#endif 218