]> git.saurik.com Git - bison.git/blobdiff - src/files.c
* data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
[bison.git] / src / files.c
index 11de06e7510a4b64aac10b6886ad375a5115f345..3c1a0ba2fb8104787c75a5be4d4f4eea55443e48 100644 (file)
@@ -33,8 +33,9 @@ const char *base_name PARAMS ((char const *name));
 FILE *finput = NULL;
 
 struct obstack action_obstack;
-struct obstack attrs_obstack;
 struct obstack output_obstack;
+struct obstack pre_prologue_obstack;
+struct obstack post_prologue_obstack;
 
 /* Initializing some values below (such SPEC_NAME_PREFIX to `yy') is
    tempting, but don't do that: for the time being our handling of the
@@ -192,6 +193,7 @@ skeleton_find (const char *envvar, const char *skeleton_name)
   const char *res = getenv (envvar);
 
 #if defined (MSDOS) || defined (_WIN32)
+  const char *cp = getenv ("INIT");
   if (!res)
     {
       /* Skeleton file name without path */
@@ -204,7 +206,6 @@ skeleton_find (const char *envvar, const char *skeleton_name)
         ++skel_name;
 
       /* File doesn't exist in current directory; try in INIT directory.  */
-      const char *cp = getenv ("INIT");
       if (cp)
        {
          res = XMALLOC (char, strlen (cp) + strlen (skel_name) + 2);
@@ -403,7 +404,7 @@ compute_base_names (void)
 
       /* Computes the extensions from the grammar file name.  */
       filename_split (infile, &base, &tab, &ext);
-      if (ext)
+      if (ext && !yacc_flag)
        compute_exts_from_gf (ext);
     }
 }
@@ -417,15 +418,15 @@ compute_output_file_names (void)
 {
   compute_base_names ();
 
-  parser_file_name =
-    spec_outfile ? spec_outfile : stringappend (full_base_name, src_extension);
-
   /* If not yet done. */
   if (!src_extension)
     src_extension = ".c";
   if (!header_extension)
     header_extension = ".h";
-
+  
+  parser_file_name =
+    spec_outfile ? spec_outfile : stringappend (full_base_name, src_extension);
+  
   /* It the defines filename if not given, we create it.  */
   if (!spec_defines_file)
     spec_defines_file = stringappend (full_base_name, header_extension);