bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: doc fixes for bison (bison dir/foo.y, etc.)


From: Paul Eggert
Subject: Re: doc fixes for bison (bison dir/foo.y, etc.)
Date: Wed, 14 Sep 2005 14:49:01 -0700
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

Akim Demaille <address@hidden> writes:

> address@hidden {position} {std::string*} filename
> address@hidden {position} {std::string*} file
>  The name of the file.  It will always be handled as a pointer, the
>  parser will never duplicate nor deallocate it.  As an experimental
>  feature you may change it to @address@hidden using @samp{%define
> -"filename_type" "@var{type}"}.
> +"file_type" "@var{type}"}.
>  @end deftypemethod
>
> This is wrong, unless you adjust lalr1.cc.

Yes, thanks, I did that.  lalr1.cc and bison.texinfo now both use
file_name_type.


>  > I noticed that the Bison documentation disagreed with the behavior
>  > with respect to whether "bison dir/foo.y" creates foo.tab.c or
>  > dir/foo.tab.c, and decided to change the documentation to match the
>  > behavior.
>
> This is really a bad behavior.  I'd rather fix the behavior than the
> documentation.

I preferred the old behavior too, but was cautious about changing it
just before Bison 2.1 came out.  Can you please explain why you
changed it to the current behavior?  Here's the patch that did it.
Thanks.

2002-06-18  Akim Demaille  <address@hidden>

        * src/files.c (compute_base_names): When computing the output file
        names from the input file name, strip the directory part.

--- src/files.c 14 Jun 2002 17:36:24 -0000      1.73
+++ src/files.c 18 Jun 2002 12:39:54 -0000      1.74
@@ -384,11 +384,11 @@ compute_base_names (void)
       else
        {
          /* Otherwise, the short base name is computed from the input
-            grammar: `foo.yy' => `foo'.  */
+            grammar: `foo/bar.yy' => `bar'.  */
          filename_split (infile, &base, &tab, &ext);
          short_base_name =
-           xstrndup (infile,
-                     (strlen (infile) - (ext ? strlen (ext) : 0)));
+           xstrndup (base,
+                     (strlen (base) - (ext ? strlen (ext) : 0)));
        }
 
       /* In these cases, always append `.tab'. */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]