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.  Also fixed some other nits.

2005-09-09  Paul Eggert  <[EMAIL PROTECTED]>

        * doc/bison.texinfo: Don't use "filename", as per GNU coding
        standards.  Use "file name" or "file" or "name", depending on
        the context.
        (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
        not to hack/foo.tab.c.
        (Calc++ Top Level): 2nd arg of main is not const.

--- bison.texinfo       24 Jul 2005 07:24:22 -0000      1.155
+++ bison.texinfo       9 Sep 2005 22:14:28 -0000       1.156
@@ -1716,12 +1716,12 @@ With all the source in a single file, yo
 convert it into a parser file:
 
 @example
-bison @var{file_name}.y
+bison @var{file}.y
 @end example
 
 @noindent
 In this example the file was called @file{rpcalc.y} (for ``Reverse Polish
[EMAIL PROTECTED]'').  Bison produces a file named @[EMAIL PROTECTED],
[EMAIL PROTECTED]'').  Bison produces a file named @[EMAIL PROTECTED],
 removing the @samp{.y} from the original file name.  The file output by
 Bison contains the source code for @code{yyparse}.  The additional
 functions in the input file (@code{yylex}, @code{yyerror} and @code{main})
@@ -3779,10 +3779,10 @@ Declare that the @var{code} must be invo
 For instance, if your locations use a file name, you may use
 
 @example
-%parse-param @{ const char *filename @};
+%parse-param @{ const char *file @};
 %initial-action
 @{
-  @@$.begin.filename = @@$.end.filename = filename;
+  @@$.begin.file = @@$.end.file = file;
 @};
 @end example
 
@@ -4133,7 +4133,7 @@ parser file contains just @code{#define}
 declarations.
 
 This option also tells Bison to write the C code for the grammar actions
-into a file named @[EMAIL PROTECTED], in the form of a
+into a file named @[EMAIL PROTECTED], in the form of a
 brace-surrounded body fit for a @code{switch} statement.
 @end deffn
 
@@ -4146,8 +4146,8 @@ associate errors with the parser file, t
 file in its own right.
 @end deffn
 
[EMAIL PROTECTED] {Directive} %output="@var{filename}"
-Specify the @var{filename} for the parser file.
[EMAIL PROTECTED] {Directive} %output="@var{file}"
+Specify @var{file} for the parser file.
 @end deffn
 
 @deffn {Directive} %pure-parser
@@ -6605,14 +6605,15 @@ bison @var{infile}
 
 Here @var{infile} is the grammar file name, which usually ends in
 @samp{.y}.  The parser file's name is made by replacing the @samp{.y}
-with @samp{.tab.c}.  Thus, the @samp{bison foo.y} filename yields
[EMAIL PROTECTED], and the @samp{bison hack/foo.y} filename yields
[EMAIL PROTECTED]/foo.tab.c}.  It's also possible, in case you are writing
+with @samp{.tab.c} and removing any leading directory.  Thus, the
[EMAIL PROTECTED] foo.y} file name yields
[EMAIL PROTECTED], and the @samp{bison hack/foo.y} file name yields
[EMAIL PROTECTED]  It's also possible, in case you are writing
 C++ code instead of C in your grammar file, to name it @file{foo.ypp}
 or @file{foo.y++}.  Then, the output files will take an extension like
 the given one as input (respectively @file{foo.tab.cpp} and
 @file{foo.tab.c++}).
-This feature takes effect with all options that manipulate filenames like
+This feature takes effect with all options that manipulate file names like
 @samp{-o} or @samp{-d}.
 
 For example :
@@ -6770,11 +6771,11 @@ Pretend that @code{%verbose} was specifi
 file containing verbose descriptions of the grammar and
 parser.  @xref{Decl Summary}.
 
[EMAIL PROTECTED] -o @var{filename}
[EMAIL PROTECTED] [EMAIL PROTECTED]
-Specify the @var{filename} for the parser file.
[EMAIL PROTECTED] -o @var{file}
[EMAIL PROTECTED] [EMAIL PROTECTED]
+Specify the @var{file} for the parser file.
 
-The other output files' names are constructed from @var{filename} as
+The other output files' names are constructed from @var{file} as
 described under the @samp{-v} and @samp{-d} options.
 
 @item -g
@@ -6786,7 +6787,7 @@ be @file{foo.vcg}.
 @item [EMAIL PROTECTED]
 The behavior of @var{--graph} is the same than @samp{-g}.  The only
 difference is that it has an optional argument which is the name of
-the output graph filename.
+the output graph file.
 @end table
 
 @node Option Cross Key
@@ -6902,13 +6903,13 @@ used for location tracking.  @xref{C++ L
 @item stack.hh
 An auxiliary class @code{stack} used by the parser.
 
[EMAIL PROTECTED] @var{filename}.hh
[EMAIL PROTECTED] @var{filename}.cc
[EMAIL PROTECTED] @var{file}.hh
[EMAIL PROTECTED] @var{file}.cc
 The declaration and implementation of the C++ parser class.
[EMAIL PROTECTED] is the name of the output file.  It follows the same
[EMAIL PROTECTED] is the name of the output file.  It follows the same
 rules as with regular C parsers.
 
-Note that @[EMAIL PROTECTED] is @emph{mandatory}, the C++ cannot
+Note that @[EMAIL PROTECTED] is @emph{mandatory}, the C++ cannot
 work without the parser class declaration.  Therefore, you must either
 pass @option{-d}/@option{--defines} to @command{bison}, or use the
 @samp{%defines} directive.
@@ -6949,7 +6950,7 @@ Symbols}.
 @c - %locations
 @c - class Position
 @c - class Location
[EMAIL PROTECTED] - %define "filename_type" "const symbol::Symbol"
[EMAIL PROTECTED] - %define "file_type" "const symbol::Symbol"
 
 When the directive @code{%locations} is used, the C++ parser supports
 location tracking, see @ref{Locations, , Locations Overview}.  Two
@@ -6957,11 +6958,11 @@ auxiliary classes define a @code{positio
 and a @code{location}, a range composed of a pair of
 @code{position}s (possibly spanning several files).
 
[EMAIL PROTECTED] {position} {std::string*} filename
[EMAIL PROTECTED] {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 @[EMAIL PROTECTED] using @samp{%define
-"filename_type" "@var{type}"}.
+"file_type" "@var{type}"}.
 @end deftypemethod
 
 @deftypemethod {position} {unsigned int} line
@@ -6989,8 +6990,8 @@ Various forms of syntactic sugar for @co
 
 @deftypemethod {position} {position} operator<< (std::ostream @var{o}, const 
position& @var{p})
 Report @var{p} on @var{o} like this:
[EMAIL PROTECTED]@var{filename}:@[EMAIL PROTECTED], or
[EMAIL PROTECTED]@[EMAIL PROTECTED] if @var{filename} is null.
[EMAIL PROTECTED]@var{file}:@[EMAIL PROTECTED], or
[EMAIL PROTECTED]@[EMAIL PROTECTED] if @var{file} is null.
 @end deftypemethod
 
 @deftypemethod {location} {position} begin
@@ -7321,7 +7322,7 @@ automatically propagated.
 %initial-action
 @{
   // Initialize the initial location.
-  @@$.begin.filename = @@$.end.filename = &driver.file;
+  @@$.begin.file = @@$.end.file = &driver.file;
 @};
 @end example
 
@@ -7530,7 +7531,7 @@ The top level file, @file{calc++.cc}, po
 #include "calc++-driver.hh"
 
 int
-main (int argc, const char* argv[])
+main (int argc, char *argv[])
 @{
   calcxx_driver driver;
   for (++argv; argv[0]; ++argv)
@@ -7923,7 +7924,7 @@ Bison declaration to assign non-associat
 @xref{Precedence Decl, ,Operator Precedence}.
 @end deffn
 
[EMAIL PROTECTED] {Directive} %output="@var{filename}"
[EMAIL PROTECTED] {Directive} %output="@var{file}"
 Bison declaration to set the name of the parser file.  @xref{Decl
 Summary}.
 @end deffn


Reply via email to