-       {
-         /* Otherwise, the short base name is computed from the input
-            grammar: `foo/bar.yy' => `bar'.  */
-         filename_split (infile, &base, &tab, &ext);
-         short_base_name =
-           xstrndup (base,
-                     (strlen (base) - (ext ? strlen (ext) : 0)));
-       }
-
-      /* In these cases, always append `.tab'. */
-      output_infix = xstrdup (EXT_TAB);
-
-      full_base_name = XMALLOC (char,
-                               strlen (short_base_name)
-                               + strlen (EXT_TAB) + 1);
-      stpcpy (stpcpy (full_base_name, short_base_name), EXT_TAB);
-
-      /* Computes the extensions from the grammar file name.  */
-      filename_split (infile, &base, &tab, &ext);
+        {
+          /* Otherwise, ALL_BUT_TAB_EXT is computed from the input
+             grammar: `foo/bar.yy' => `bar'.  */
+          dir_prefix = xstrdup ("");
+          all_but_tab_ext =
+            xstrndup (base, (strlen (base) - (ext ? strlen (ext) : 0)));
+        }
+
+      if (language->add_tab)
+        all_but_ext = concat2 (all_but_tab_ext, TAB_EXT);
+      else
+        all_but_ext = xstrdup (all_but_tab_ext);
+
+      /* Compute the extensions from the grammar file name.  */