bison-patches
[Top][All Lists]
Advanced

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

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


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

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  <address@hidden>

        * 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
address@hidden'').  Bison produces a file named @address@hidden,
address@hidden'').  Bison produces a file named @address@hidden,
 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 @address@hidden, in the form of a
+into a file named @address@hidden, 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
 
address@hidden {Directive} %output="@var{filename}"
-Specify the @var{filename} for the parser file.
address@hidden {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
address@hidden, and the @samp{bison hack/foo.y} filename yields
address@hidden/foo.tab.c}.  It's also possible, in case you are writing
+with @samp{.tab.c} and removing any leading directory.  Thus, the
address@hidden foo.y} file name yields
address@hidden, and the @samp{bison hack/foo.y} file name yields
address@hidden  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}.
 
address@hidden -o @var{filename}
address@hidden address@hidden
-Specify the @var{filename} for the parser file.
address@hidden -o @var{file}
address@hidden address@hidden
+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 address@hidden
 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.
 
address@hidden @var{filename}.hh
address@hidden @var{filename}.cc
address@hidden @var{file}.hh
address@hidden @var{file}.cc
 The declaration and implementation of the C++ parser class.
address@hidden is the name of the output file.  It follows the same
address@hidden is the name of the output file.  It follows the same
 rules as with regular C parsers.
 
-Note that @address@hidden is @emph{mandatory}, the C++ cannot
+Note that @address@hidden 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
address@hidden - %define "filename_type" "const symbol::Symbol"
address@hidden - %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).
 
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
 
 @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:
address@hidden@var{filename}:@address@hidden, or
address@hidden@address@hidden if @var{filename} is null.
address@hidden@var{file}:@address@hidden, or
address@hidden@address@hidden 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
 
address@hidden {Directive} %output="@var{filename}"
address@hidden {Directive} %output="@var{file}"
 Bison declaration to set the name of the parser file.  @xref{Decl
 Summary}.
 @end deffn




reply via email to

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