1 |
/* Open and close files for Bison. |
/* Open and close files for Bison. |
2 |
|
|
3 |
Copyright (C) 1984, 1986, 1989, 1992, 2000, 2001, 2002 |
Copyright (C) 1984, 1986, 1989, 1992, 2000, 2001, 2002, 2003 |
4 |
Free Software Foundation, Inc. |
Free Software Foundation, Inc. |
5 |
|
|
6 |
This file is part of Bison, the GNU Compiler Compiler. |
This file is part of Bison, the GNU Compiler Compiler. |
140 |
return (temp); |
return (temp); |
141 |
} |
} |
142 |
|
|
143 |
/* Computes extensions from the grammar file extension. */ |
/* Compute extensions from the grammar file extension. */ |
144 |
static void |
static void |
145 |
compute_exts_from_gf (const char *ext) |
compute_exts_from_gf (const char *ext) |
146 |
{ |
{ |
150 |
header_extension = tr (header_extension, 'Y', 'H'); |
header_extension = tr (header_extension, 'Y', 'H'); |
151 |
} |
} |
152 |
|
|
153 |
/* Computes extensions from the given c source file extension. */ |
/* Compute extensions from the given c source file extension. */ |
154 |
static void |
static void |
155 |
compute_exts_from_src (const char *ext) |
compute_exts_from_src (const char *ext) |
156 |
{ |
{ |
280 |
+ strlen (TAB_EXT) + 1); |
+ strlen (TAB_EXT) + 1); |
281 |
stpcpy (stpcpy (full_base_name, short_base_name), TAB_EXT); |
stpcpy (stpcpy (full_base_name, short_base_name), TAB_EXT); |
282 |
|
|
283 |
/* Computes the extensions from the grammar file name. */ |
/* Compute the extensions from the grammar file name. */ |
284 |
filename_split (grammar_file, &base, &tab, &ext); |
filename_split (grammar_file, &base, &tab, &ext); |
285 |
if (ext && !yacc_flag) |
if (ext && !yacc_flag) |
286 |
compute_exts_from_gf (ext); |
compute_exts_from_gf (ext); |